index.vue 8.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
<template>
  <div class="radar-container">
    <el-card class="box-card">
      <div class="lcl-title">影像查询</div>
      <div class="mt20">
        <el-select
          v-model="radarSelectValue"
          placeholder="请选择"
          class="mr10"
          @change="radarChange"
        >
          <el-option
            v-for="item in radarSelectOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <!-- <el-button type="primary" icon="el-icon-search" size="medium"
          >搜索</el-button
        > -->
        <el-button icon="el-icon-refresh-left" size="medium" @click="resetPic"
          >重置</el-button
        >
      </div>
    </el-card>
    <el-card class="mt10">
      <div class="box-card-bottom">
        <div class="radar-pic">
          <img :src="radarPic" />
        </div>
        <div class="radar-chart-table">
          <!-- <div id="radar-chart"></div> -->
          <div class="chart-container">
            <ChartsForLine :ChartsForLineParant="RadarChartData" />
          </div>
          <div id="radar-table">
            <el-table
              :data="RadarTableData"
              height="230"
              border
              stripe
              style="width: 100%"
              :header-cell-style="{
                textAlign: 'center',
                height: '20px',
              }"
              :row-style="{ height: '20px' }"
            >
              <el-table-column align="center" prop="x" label="x">
              </el-table-column>
              <el-table-column align="center" prop="y" label="y">
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
import * as echarts from "echarts";
import ChartsForLine from "@/components/lclEcharts/ChartsForLine";
import {
  listPost,
  getPost,
  delPost,
  addPost,
  updatePost,
} from "@/api/system/post";

export default {
  components: {
    ChartsForLine,
  },
  name: "Post",
  dicts: ["sys_normal_disable"],
  data() {
    return {
      // 遮罩层
      loading: true,
      radarSelectOptions: [
        {
          value: "1",
          label: "2023年03月10日 15:00",
          radarPic: require("../../assets/images/radar/007.jpg"),
        },
        {
          value: "2",
          label: "2023年03月08日 14:15",
          radarPic: require("../../assets/images/radar/006.jpg"),
        },
        {
          value: "3",
          label: "2023年03月06日 13:30",
          radarPic: require("../../assets/images/radar/005.jpg"),
        },
        {
          value: "4",
          label: "2023年03月04日 12:45",
          radarPic: require("../../assets/images/radar/004.jpg"),
        },
        {
          value: "5",
          label: "2023年03月02日 12:00",
          radarPic: require("../../assets/images/radar/003.jpg"),
        },
        {
          value: "6",
          label: "2023年03月02日 11:45",
          radarPic: require("../../assets/images/radar/002.jpg"),
        },
        {
          value: "7",
          label: "2023年03月01日 11:15",
          radarPic: require("../../assets/images/radar/001.jpg"),
        },
      ],
      radarSelectValue: "1",
      radarPic: require("../../assets/images/radar/007.jpg"),
      RadarChartData: {
        chartId: "radar-chart",
        color: ["#f7af0b", "#05f57a", "#f40852"],
        chartData: [
          {
            name: "1月",
            value1: 13512,
            value2: 0,
            value3: 0,
          },
        ],
        chartType: "line", //bar
        axisLabel: "#B9DAF1",
        itemColor: "rgba(42,148,226,1)",
        lineColor: "rgba(42,148,226,0.1)",
        areaColor: ["rgba(42,148,226,1)", "rgba(42,148,226,0.1)"],
      },
      RadarTableData: [
        {
          x: "34.5",
          y: "688.6",
          id: "1",
        },
        {
          x: "-1.5",
          y: "719.6",
          id: "2",
        },
        {
          x: "102.5",
          y: "683.6",
          id: "3",
        },
        {
          x: "180.2",
          y: "839.5",
          id: "4",
        },
        {
          x: "246.2",
          y: "879.4",
          id: "5",
        },
      ],
    };
  },
  created() {},
  mounted() {
    this.$nextTick(() => {
      this.RadarChart();
    });
  },
  methods: {
    radarChange(e) {
      //雷达切换
      let nowPic = this.radarSelectOptions.filter((item) => item.value === e);
      return (this.radarPic = nowPic[0].radarPic);
    },
    resetPic() {
      this.radarPic = require("../../assets/images/radar/001.jpg");
      this.radarSelectValue = "1";
    },
    RadarChart() {
      //图表数据
      let that = this;
      this.RadarChartData = {
        chartId: "radar-chart",
        color: ["#f7af0b", "#05f57a", "#f40852"],
        bgc: "#f8f8f8",

        xAxisData: ["12:00", "13:00", "14:00", "15:00"],
        yData: [
          [-3, 2, -3, 6],
          [3, 0, 1, 3],
          [1, 2, -1, 0],
          [3, 1, -2, 1],
          [4, 3, -1, -1],
        ],

        chartType: "line", //bar
        axisLabel: "#0562AF",
        itemColor: "rgba(42,148,226,1)",
        legendItem: ["雷达1", "雷达2", "雷达3", "雷达4", "雷达5"],
        alarm: {
          onelevelalarm: 1,
          twolevelalarm: 1,
          threelevelalarm: 1,
          fourlevelalarm: 1,
          unit: "mm",
        },
        unit: "mm",
        grid: {
          left: "5%",
          right: "5%",
          bottom: "15%",
          top: "10%",
          z: 22,
        },
        showlegend: false,
      };
    },
  },
};
</script>
<style lang="scss" scoped>
.radar-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: 100%;
  // border-radius: 10px;
  // background-color: teal;
  .box-card {
    width: 100%;
    flex: 0.13;
    .lcl-title {
      font-size: 22px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #333333;
      line-height: 30px;
      position: relative;
      padding-left: 10px;
      &:before {
        content: "";
        position: absolute;
        left: 0px;
        top: 4px;
        width: 6px;
        height: 22px;
        background: #0d85f4;
      }
    }
  }
  .box-card-bottom {
    flex: 0.745;
    display: flex;
    flex-direction: column;
    .radar-pic {
      overflow: hidden;
      img {
        border-radius: 4px;
        display: flex;
        flex: 1;
        display: block;
        max-height: 100%;
        max-width: 100%;
        margin: 0 auto;
        object-fit: scale-down;
      }
    }
    .radar-chart-table {
      width: 100%;
      height: 230px;
      margin-top: 10px;
      .chart-container {
        width: 79%;
        height: 100%;
        border: 1px solid #c7d8ee;
        box-sizing: border-box;
        float: left;
        margin-right: 1%;
      }
      #radar-table {
        width: 20%;
        height: 100%;
        // border: 1px solid #c7d8ee;
        box-sizing: border-box;
        float: left;
        ::v-deep .el-table--border,
        ::v-deep .el-table--group {
          border: 1px solid #c7d8ee !important;
        }
        // 设置滚动条的宽度
        ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
          width: 6px;
        }
        // 设置滚动条的背景色和圆角
        ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
          background-color: #c7d8ee;
          border-radius: 8px;
        }
        /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
        ::v-deep ::-webkit-scrollbar {
          width: 6px;
          /*滚动条宽度*/
          height: 12px;
          /*滚动条高度*/
          background-color: white;
        }

        /*定义滑块 内阴影+圆角*/
        ::v-deep ::-webkit-scrollbar-thumb {
          box-shadow: inset 0 0 0px white;
          -webkit-box-shadow: inset 0 0 0px white;
          background-color: rgb(193, 193, 193);
          /*滚动条的背景颜色*/
          border-radius: 20px;
        }

        //解决表格固定列时的压样式问题
        .el-table__fixed {
          height: 100px;
          width: 12px;
        }
      }
    }
  }
}
</style>