index.vue 29.2 KB
Newer Older
1
<template>
yaqizhang's avatar
yaqizhang committed
2 3
  <div class="app-container detail" style="background-color: rgb(238, 241, 245);">
    <div style="padding-top: 10px;background: #fff;height: 100%;">
4
      <el-row v-if ="resourceId == undefined">
yaqizhang's avatar
yaqizhang committed
5
        <el-col :span="24" style="padding-left: 15px;margin-bottom: -10px;">
yaqizhang's avatar
yaqizhang committed
6 7 8
          <div style="height: 45px;" @click="$router.go(-1)">
            <el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
            </el-button>
yaqizhang's avatar
yaqizhang committed
9 10
            <div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
          </div>
yaqizhang's avatar
yaqizhang committed
11 12
        </el-col>
      </el-row>
13

yaqizhang's avatar
yaqizhang committed
14
      <el-row style="width: 100%;height: 40px;">
yaqizhang's avatar
yaqizhang committed
15 16 17 18 19 20 21
        <el-col :span="24">
          <div style="">
            <ul><li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">报警信息管理详情</li></ul>
          </div>
        </el-col>
      </el-row>
      <el-divider></el-divider>
yaqizhang's avatar
yaqizhang committed
22
      <el-row style="padding-left: 50px;margin-top: -10px;margin-bottom: -10px;">
yaqizhang's avatar
yaqizhang committed
23
        <el-col :span="6">
24
          <el-form ref="form" v-model="form" style="width: 100%;">
25
            <el-form-item label="设备类型:" prop="deviceType">
yaqizhang's avatar
yaqizhang committed
26
              <font>{{form.deviceType}}</font>
27
            </el-form-item>
28 29 30
            <el-form-item label="设备编号:" prop="deviceCode">
              <font>{{form.deviceCode}}</font>
            </el-form-item>
31
          </el-form>
yaqizhang's avatar
yaqizhang committed
32 33
        </el-col>
        <el-col :span="6">
34
          <el-form ref="form" v-model="form" style="width: 100%;">
35 36 37 38
            <el-form-item label="报警类型:" prop="alarmType">
              <font>{{form.alarmType}}</font>
            </el-form-item>
            <el-form-item label="报警值:" prop="alarmValue">
yaqizhang's avatar
yaqizhang committed
39
              <font>{{form.alarmValue}}</font>
40 41
            </el-form-item>
          </el-form>
yaqizhang's avatar
yaqizhang committed
42 43
        </el-col>
        <el-col :span="6">
44
          <el-form ref="form" v-model="form" style="width: 100%;">
45
            <el-form-item label="报警开始时间:" prop="startTime">
yaqizhang's avatar
yaqizhang committed
46
              <font>{{form.startTime}}</font>
47 48
            </el-form-item>
            <el-form-item label="报警结束时间:" prop="updateTime">
yaqizhang's avatar
yaqizhang committed
49
              <font>{{form.endTime}}</font>
50 51
            </el-form-item>
          </el-form>
yaqizhang's avatar
yaqizhang committed
52 53
        </el-col>
        <el-col :span="6">
54
          <el-form ref="form" v-model="form" style="width: 100%;">
yaqizhang's avatar
yaqizhang committed
55
            <el-form-item label="工单编号:" prop="orderId">
56 57
              <!-- <font>{{form.orderId}}</font> -->
              <template slot-scope="scope">
58 59
                <font v-if="resourceId != undefined">{{form.orderId}}</font>
                <el-button type="text" @click="showDetail(form.orderId)" v-if="resourceId == undefined">{{form.orderId}}</el-button>
60
              </template>
yaqizhang's avatar
yaqizhang committed
61
            </el-form-item>
62
            <el-form-item label="处理状态:" prop="dealStatus">
yaqizhang's avatar
yaqizhang committed
63
              <font v-if="form.orderId == null || form.orderId == ''">未生成工单</font>
yaqizhang's avatar
yaqizhang committed
64 65
              <font
                v-if="(form.dealStatus == null || form.dealStatus == '') && form.orderId != null && form.orderId != ''">
王晓倩's avatar
王晓倩 committed
66
                暂未处理</font>
yaqizhang's avatar
yaqizhang committed
67
              <font v-if="form.dealStatus == 1">不需处理</font>
68 69 70 71
              <font v-if="form.dealStatus == 2">已处理完成</font>
              <font v-if="form.dealStatus == 3">未处理完成</font>
            </el-form-item>
          </el-form>
yaqizhang's avatar
yaqizhang committed
72 73 74
        </el-col>
      </el-row>
      <el-divider></el-divider>
yaqizhang's avatar
yaqizhang committed
75 76
      <el-row style="width: 100%;height: 45px;margin-top: -15px;">
        <el-col :span="24" style="margin-bottom: -10px;">
yaqizhang's avatar
yaqizhang committed
77 78 79 80 81
          <div style="color: #31EAEA;">
            <ul><li>设备详情</li></ul>
          </div>
        </el-col>
      </el-row>
yaqizhang's avatar
yaqizhang committed
82 83
      <el-row>
        <el-col :span="16" style="padding: 10px;">
王晓倩's avatar
王晓倩 committed
84 85
          <div style="width: 100%;float: left;height: 100%;" v-if="form.deviceType != '管道'">
            <el-table :data="dataListdetail" style="width: 100%">
yaqizhang's avatar
yaqizhang committed
86 87
              <el-table-column label="设备名称" align="center" prop="deviceName" />
              <el-table-column label="设备编号" align="center" prop="deviceCode" />
王晓倩's avatar
王晓倩 committed
88 89 90 91 92 93 94 95 96
              <el-table-column label="设备类型" align="center" prop="deviceType" >
                <template slot-scope="scope">
                  <span v-if="scope.row.deviceType == 1">调压阀</span>
                  <span v-if="scope.row.deviceType == 2">阀门井</span>
                  <span v-if="scope.row.deviceType == 3">流量计</span>
                  <span v-if="scope.row.deviceType == 4">压力表</span>
                </template>
              </el-table-column>
              <el-table-column label="设备型号" align="center" prop="deviceModel" />
yaqizhang's avatar
yaqizhang committed
97
            </el-table>
98

王晓倩's avatar
王晓倩 committed
99 100 101 102 103
            <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;">
              <el-table-column label="物联网编号" align="center" prop="iotNo" />
              <el-table-column label="所在地址" align="center" prop="deviceAddr" />
              <el-table-column label="联系人" align="center" prop="linkman" />
              <el-table-column label="联系电话" align="center" prop="phone" />
yaqizhang's avatar
yaqizhang committed
104
            </el-table>
105

王晓倩's avatar
王晓倩 committed
106 107 108 109 110 111 112 113
            <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;">
              <el-table-column label="安装日期" align="center" prop="installationTime" />
              <el-table-column label="最后巡检日期" align="center" prop="inspectionTime" />
              <el-table-column label="图片" align="center" prop="iconUrl" >
                <template slot-scope="scope">
                  <el-image :src="scope.row.iconUrl" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null" style="width: 16px;"></el-image>
                </template>
              </el-table-column>
yaqizhang's avatar
yaqizhang committed
114
            </el-table>
王晓倩's avatar
王晓倩 committed
115
          </div>
116

王晓倩's avatar
王晓倩 committed
117 118 119 120 121 122 123 124 125 126 127
          <div style="width: 100%;float: left;height: 100%;" v-if="form.deviceType == '管道'">
            <el-table :data="dataListdetail" style="width: 100%">
              <el-table-column label="管道名称" align="center" prop="pipeName" />
              <el-table-column label="管道编号" align="center" prop="pipeCode" />
              <el-table-column label="管道类型" align="center" prop="pipeType" >
                <template slot-scope="scope">
                  <span v-if="scope.row.pipeType == 1">地埋管线</span>
                  <span v-if="scope.row.pipeType == 2">地表管线</span>
                </template>
              </el-table-column>
            </el-table>
128

王晓倩's avatar
王晓倩 committed
129 130
            <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;">
              <el-table-column label="管道压力" align="center" prop="pipePressure" >
yaqizhang's avatar
yaqizhang committed
131
                <template slot-scope="scope">
王晓倩's avatar
王晓倩 committed
132 133 134 135
                  <span v-if="scope.row.pipePressure == 1">低压</span>
                  <span v-if="scope.row.pipePressure == 2">中压</span>
                  <span v-if="scope.row.pipePressure == 3">次高压</span>
                  <span v-if="scope.row.pipePressure == 4">高压</span>
yaqizhang's avatar
yaqizhang committed
136 137
                </template>
              </el-table-column>
王晓倩's avatar
王晓倩 committed
138 139
              <el-table-column label="管道长度" align="center" prop="pipeLength" />
              <el-table-column label="管道地址" align="center" prop="pipeAddr" />
yaqizhang's avatar
yaqizhang committed
140
            </el-table>
141

王晓倩's avatar
王晓倩 committed
142 143 144 145 146 147 148 149 150
            <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;">
              <el-table-column label="安装日期" align="center" prop="installationTime" />
              <el-table-column label="最后巡检日期" align="center" prop="inspectionTime" />
              <el-table-column label="图片" align="center" prop="iconUrl" >
                <template slot-scope="scope">
                  <el-image :src="scope.row.iconUrl" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null" style="width: 16px;"></el-image>
                </template>
              </el-table-column>
            </el-table>
yaqizhang's avatar
yaqizhang committed
151
          </div>
yaqizhang's avatar
yaqizhang committed
152
        </el-col>
王晓倩's avatar
王晓倩 committed
153

yaqizhang's avatar
yaqizhang committed
154 155
        <el-col :span="8" style="padding: 10px;padding-left: 0px;">
          <div id="marbox" style="width: 100%;height: 304px; border: 1px solid rgb(218, 213, 213);float: right;">
156
            <div style="width: 100%;height: 100%" id="containerAlarm"></div>
yaqizhang's avatar
yaqizhang committed
157
          </div>
yaqizhang's avatar
yaqizhang committed
158 159
        </el-col>
      </el-row>
yaqizhang's avatar
yaqizhang committed
160

yaqizhang's avatar
yaqizhang committed
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
      <template v-if="$route.query.deviceType!='管道'">
        <el-row v-if="form.deviceType != '压力表'">
          <el-col :span="12" style="padding: 10px;">
            <div id="main1" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
              <div v-if="form.deviceReportDataList == null" class="div-null">
                <p>暂无数据</p>
              </div>
            </div>
          </el-col>
          <el-col :span="12" style="padding: 10px;">
            <div id="main2" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
              <div v-if="form.deviceReportDataList == null" class="div-null">
                <p>暂无数据</p>
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12" style="padding: 10px;" v-if="form.deviceType != '压力表'">
            <div id="main3" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
              <div v-if="form.deviceReportDataList == null" class="div-null">
                <p>暂无数据</p>
              </div>
            </div>
          </el-col>
          <el-col :span="12" style="padding: 10px;">
            <div id="main4" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
              <div v-if="form.deviceReportDataList == null" class="div-null">
                <p>暂无数据</p>
              </div>
            </div>
          </el-col>
        </el-row>
      </template>
yaqizhang's avatar
yaqizhang committed
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
      <div class="" style="width: 95%; height: 60px;margin-left: 50px;text-align: center;" v-if="form.orderId == '' || form.orderId == null">
        <el-button
            size="normal"
            type="primary"
            icon="el-icon-edit"
            @click="handleIssue(form.alarmId)"
            v-hasPermi="['workOrder:basicsInfo:add']">
            生成工单
          </el-button>
          <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
            <el-form ref="form" :model="form" :rules="rules" label-width="130px">
              <el-form-item label="报警设备" prop="deviceName">
                <font>{{ form.deviceName }}</font>
              </el-form-item>
              <el-form-item label="报警类型" prop="alarmType">
                <font>{{ form.alarmType }}</font>
              </el-form-item>
              <el-form-item label="报警值" prop="alarmValue">
                <font>{{ form.alarmValue }}</font>
              </el-form-item>
              <el-form-item label="工单名称" prop="orderName">
                <el-input v-model="form.orderName" placeholder="请输入工单名称" />
              </el-form-item>
              <el-form-item label="指定执行人员" prop="appointInspector">
                <el-select v-model="form.appointInspector" placeholder="请选择执行人员" clearable size="small" @change="setUserId">
                  <el-option
                    v-for="item in inspector"
                    :key="item.userId"
                    :label="item.nickName"
                    :value="item.userId"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="工单描述" prop="remarks">
                <el-input type="textarea" v-model="form.remarks" placeholder="请输入工单描述" />
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button type="primary" @click="submitForm">确 定</el-button>
              <el-button @click="cancel">取 消</el-button>
            </div>
          </el-dialog>
      </div>
238
    </div>
239 240 241 242 243 244 245 246 247 248
    <el-dialog
      title = "工单信息"
      lock-scroll
      :visible.sync="dialogVisible"
      width="70%"
    >
      <div style="height:80vh;overflow:auto">
        <workOrder :linkOrderId="form.orderId"/>
      </div>
    </el-dialog>
yaqizhang's avatar
yaqizhang committed
249 250 251 252
  </div>
</template>

<script>
253

王晓倩's avatar
王晓倩 committed
254
  import { getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
255
  import { deviceTree } from "@/api/device/deviceInfo";
yaqizhang's avatar
yaqizhang committed
256
  import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
257
  import gaodeMap from "utils/gaodeMap.js";
yaqizhang's avatar
yaqizhang committed
258
  import { map, DEVICE_TYPE } from "utils/gaodeMap.js";
259
  import { inspectorList } from "@/api/system/user";
yaqizhang's avatar
yaqizhang committed
260
  import echarts from 'echarts';
261
  import workOrder from "../../workOrder/detail/index.vue"
262 263

export default {
264
  props:["resourceId"],
王晓倩's avatar
王晓倩 committed
265 266
  name: "DeviceAlarm",
  components: {
267
    workOrder
王晓倩's avatar
王晓倩 committed
268 269 270
  },
  data() {
    return {
271
      dialogVisible: false,
王晓倩's avatar
王晓倩 committed
272
      dataListdetail: [],
yaqizhang's avatar
yaqizhang committed
273
      alarmId:'',
王晓倩's avatar
王晓倩 committed
274
      // 折线图标题
275
      title: "",
yaqizhang's avatar
yaqizhang committed
276 277 278
      open: false,
      // 巡检员列表
      inspector: [],
279 280
      // 表单参数
      form: { },
281
      rule: { },
yaqizhang's avatar
yaqizhang committed
282 283 284 285 286 287 288 289 290
      // 表单校验
      rules: {
        orderName: [
          { required: true, message: "工单名称不能为空", trigger: "blur" },
        ],
        appointInspector: [
          { required: true, message: "请选择巡检人员", trigger: "blur" },
        ],
      },
291 292 293 294
      };
    },
    created() {
      // 如果是跳转来的,则接受初始化参数
295 296 297 298 299 300
      if(this.resourceId){
        this.alarmId = this.resourceId;
      }else{
        this.alarmId = this.$route.query.alarmId;
      }

王晓倩's avatar
王晓倩 committed
301
      this.getDetail();
302
    },
yaqizhang's avatar
yaqizhang committed
303
    mounted() {
yaqizhang's avatar
yaqizhang committed
304 305
      // let gaoMap = new gaodeMap("石家庄");
      // this.gaoMap = gaoMap;
306 307
    },
    methods: {
yaqizhang's avatar
yaqizhang committed
308 309 310 311 312 313
      initData(getData1, getData2, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart1 = echarts.init(document.getElementById('main1'));
        // 绘制图表
        myChart1.setOption({
          title: {
yaqizhang's avatar
yaqizhang committed
314
            text: '标况流量、工况流量'
yaqizhang's avatar
yaqizhang committed
315 316
          },
          tooltip: {
yaqizhang's avatar
yaqizhang committed
317 318
            trigger: 'axis'
          },
yaqizhang's avatar
yaqizhang committed
319 320
          legend: {
            data: ['标况流量', '工况流量']
yaqizhang's avatar
yaqizhang committed
321
          },
yaqizhang's avatar
yaqizhang committed
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
          xAxis: {
            type: 'category',
            // data: this.dataX,
            // data: ['23', '44', '77', '34', '56', '88', '38', '68', '55', '99', '44', '33'],
            data: getData3,
            boundaryGap: false, //控制日期是否在中间显示
            axisLabel: {
              show: true, //是否显示日期
              interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
              textStyle: {
                color: '#000', //日期的颜色
                fontSize: 12 //字体的大小
              }
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // x轴的颜色
yaqizhang's avatar
yaqizhang committed
339 340 341
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
342 343 344 345 346 347 348 349 350 351 352 353
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
354 355
              }
            }
yaqizhang's avatar
yaqizhang committed
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
          },
          series: [
            {
              // data: this.dataY,
              name: '标况流量',
              // data: [820, 232, 901, 534, 1290, 330, 1320, 345, 654, 189, 980, 234],
              data: getData1,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#efc883', //折线点的颜色
                  lineStyle: {
                    color: '#efc883' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
yaqizhang's avatar
yaqizhang committed
374
                }
yaqizhang's avatar
yaqizhang committed
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
              }
            },
            {
              // data: this.dataY,
              name: '工况流量',
              // data: [500, 600, 700, 300, 1100, 130, 1200, 820, 932, 901, 934, 1290],
              data: getData2,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#053B6A', //折线点的颜色
                  lineStyle: {
                    color: '#053B6A' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
yaqizhang's avatar
yaqizhang committed
393
                }
yaqizhang's avatar
yaqizhang committed
394
              }
yaqizhang's avatar
yaqizhang committed
395
            }
yaqizhang's avatar
yaqizhang committed
396 397 398 399 400 401 402 403
          ]
        });
      },
      drawPieChart(getData4, getData5, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart2 = echarts.init(document.getElementById('main2'));
        // 绘制图表
        myChart2.setOption({
yaqizhang's avatar
yaqizhang committed
404 405 406 407 408 409 410 411 412
          title: {
            text: '标况累积量、工况累积量'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['标况累积量', '工况累积量']
          },
yaqizhang's avatar
yaqizhang committed
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
          xAxis: {
            type: 'category',
            // data: this.dataX,
            data: getData3,
            boundaryGap: false, //控制日期是否在中间显示
            axisLabel: {
              show: true, //是否显示日期
              interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
              textStyle: {
                color: '#000', //日期的颜色
                fontSize: 12 //字体的大小
              }
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // x轴的颜色
              }
yaqizhang's avatar
yaqizhang committed
430
            }
yaqizhang's avatar
yaqizhang committed
431 432 433 434 435 436 437 438 439
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
yaqizhang's avatar
yaqizhang committed
440
            },
yaqizhang's avatar
yaqizhang committed
441 442 443 444 445
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
              }
            }
yaqizhang's avatar
yaqizhang committed
446
          },
yaqizhang's avatar
yaqizhang committed
447 448 449
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
450
              name: '标况累积量',
yaqizhang's avatar
yaqizhang committed
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
              data: getData4,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#efc883', //折线点的颜色
                  lineStyle: {
                    color: '#efc883' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
                }
              }
            },
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
468
              name: '工况累积量',
yaqizhang's avatar
yaqizhang committed
469 470 471 472 473 474 475 476 477 478 479 480 481 482
              data: getData5,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#053B6A', //折线点的颜色
                  lineStyle: {
                    color: '#053B6A' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
                }
              }
yaqizhang's avatar
yaqizhang committed
483
            }
yaqizhang's avatar
yaqizhang committed
484 485 486 487 488 489 490 491
          ]
        });
      },
      main3(getData6, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart3 = echarts.init(document.getElementById('main3'));
        // 绘制图表
        myChart3.setOption({
yaqizhang's avatar
yaqizhang committed
492 493 494 495 496 497 498 499 500
          title: {
            text: '温度'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['温度']
          },
yaqizhang's avatar
yaqizhang committed
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
          xAxis: {
            type: 'category',
            // data: this.dataX,
            data: getData3,
            boundaryGap: false, //控制日期是否在中间显示
            axisLabel: {
              show: true, //是否显示日期
              interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
              textStyle: {
                color: '#000', //日期的颜色
                fontSize: 12 //字体的大小
              }
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // x轴的颜色
yaqizhang's avatar
yaqizhang committed
517 518 519
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
520 521 522 523 524 525 526 527 528 529 530 531
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
532 533 534
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
535 536 537
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
538
              name: '温度',
yaqizhang's avatar
yaqizhang committed
539 540 541 542 543 544 545 546 547 548 549 550 551 552
              data: getData6,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#efc883', //折线点的颜色
                  lineStyle: {
                    color: '#efc883' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
                }
              }
yaqizhang's avatar
yaqizhang committed
553
            }
yaqizhang's avatar
yaqizhang committed
554 555 556 557 558 559 560 561
          ]
        });
      },
      main4(getData7, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart4 = echarts.init(document.getElementById('main4'));
        // 绘制图表
        myChart4.setOption({
yaqizhang's avatar
yaqizhang committed
562 563 564 565 566 567 568 569 570
          title: {
            text: '压力'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['压力']
          },
yaqizhang's avatar
yaqizhang committed
571 572 573 574 575 576 577 578 579 580 581 582
          xAxis: {
            type: 'category',
            // data: this.dataX,
            data: getData3,
            boundaryGap: false, //控制日期是否在中间显示
            axisLabel: {
              show: true, //是否显示日期
              interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
              textStyle: {
                color: '#000', //日期的颜色
                fontSize: 12 //字体的大小
              }
yaqizhang's avatar
yaqizhang committed
583
            },
yaqizhang's avatar
yaqizhang committed
584 585 586 587
            axisLine: {
              lineStyle: {
                color: '#ccc' // x轴的颜色
              }
yaqizhang's avatar
yaqizhang committed
588
            }
yaqizhang's avatar
yaqizhang committed
589 590 591 592 593 594 595 596 597 598 599 600 601
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
602 603 604
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
605 606 607
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
608
              name: '压力',
yaqizhang's avatar
yaqizhang committed
609 610 611 612 613 614 615 616 617 618 619 620 621
              data: getData7,
              type: 'line',
              symbol: 'circle', //是否显示实心的折线圆点
              smooth: true, //让折线有弧度
              symbolSize: 7, //折线圆点的大小
              itemStyle: {
                normal: {
                  color: '#efc883', //折线点的颜色
                  lineStyle: {
                    color: '#efc883' //折线的颜色
                  },
                  label: { show: true } //是否在折线点上显示数字
                }
yaqizhang's avatar
yaqizhang committed
622 623
              }
            }
yaqizhang's avatar
yaqizhang committed
624 625
          ]
        });
yaqizhang's avatar
yaqizhang committed
626
      },
王晓倩's avatar
王晓倩 committed
627

yaqizhang's avatar
yaqizhang committed
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669

      /** 下发按钮操作 */
      handleIssue(alarmId) {
          // this.reset();
          this.getInspectorList();
          // const alarmId = row.alarmId || this.ids;
          getDeviceAlarm(alarmId).then((response) => {
            this.form = response.data;
            this.open = true;
            this.title = "填写工单信息";
          });
        },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate((valid) => {
          if (valid) {
            this.form.resourceId = this.form.alarmId;
            this.form.orderType = "3";
            addBasicsInfo(this.form).then((response) => {
              this.msgSuccess("生成工单成功");
              this.open = false;
              this.getList();
            });
          }
        });
      },

      getInspectorList() {
        this.loading = true;
        inspectorList().then((response) => {
          this.inspector = response.data;
          this.loading = false;
        });
      },
      setUserId(val) {
        this.form.appointInspector = val;
      },
      // 取消按钮
      cancel() {
        this.open = false;
        // this.reset();
      },
670
      /** 详细信息跳转 */
王晓倩's avatar
王晓倩 committed
671
      showDetail(orderId) {
672
        /*this.$router.push({
王晓倩's avatar
王晓倩 committed
673 674 675 676
           path: '/workOrder/detail',
           query:{
             orderId : orderId
           }
677 678
        }) //带参跳转*/
        this.dialogVisible = true;
王晓倩's avatar
王晓倩 committed
679
      },
王晓倩's avatar
王晓倩 committed
680 681
      getDetail (){
        getDeviceAlarm(this.alarmId).then(response =>{
682
          this.form = response.data;
683
          console.log("this.form", this.form);
684

王晓倩's avatar
王晓倩 committed
685 686
          if(this.form.pipeList != null){
            let pipe = this.form.pipeList[0];
yaqizhang's avatar
yaqizhang committed
687 688 689 690 691

            const {coordinates} = this.form.pipeList[0];
            const path1 = eval(coordinates)[0];
            const path2 = eval(coordinates)[1];
            const path3 = [(Number(path1[0]) + Number(path2[0])) / 2, (Number(path1[1]) + Number(path2[1])) / 2];
692
            let gaoMap = new gaodeMap(process.env.VUE_APP_MAP_CENTER,path3,"containerAlarm");
yaqizhang's avatar
yaqizhang committed
693
            this.gaoMap=gaoMap;
王晓倩's avatar
王晓倩 committed
694 695 696 697 698 699 700 701 702
            console.log("pipe", pipe);
            this.dataListdetail.push(pipe);
            this.gaoMap.onlyLine(pipe);
          }

          if(this.form.deviceList != null){
            let device = this.form.deviceList[0];
            console.log("device", device);
            this.dataListdetail.push(device);
703
            let gaoMap = new gaodeMap(process.env.VUE_APP_MAP_CENTER,[device.longitude, device.latitude],"containerAlarm");
yaqizhang's avatar
yaqizhang committed
704
            this.gaoMap = gaoMap;
王晓倩's avatar
王晓倩 committed
705
            this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, device);
yaqizhang's avatar
yaqizhang committed
706 707

            // this.gaoMap.resetMapCenter([device.longitude, device.latitude]);
王晓倩's avatar
王晓倩 committed
708
          }
yaqizhang's avatar
yaqizhang committed
709 710 711 712 713 714 715 716 717 718

          var getData1 = [];
          var getData2 = [];
          var getData3 = [];
          var getData4 = [];
          var getData5 = [];
          var getData6 = [];
          var getData7 = [];
          //先进行赋值
          for (let i = 0; i < this.form.deviceReportDataList.length; i++) {
yaqizhang's avatar
yaqizhang committed
719
            getData1.push(this.form.deviceReportDataList[i].standardConditionFlow)
yaqizhang's avatar
yaqizhang committed
720 721 722 723 724 725
            getData2.push(this.form.deviceReportDataList[i].workingConditionFlow)
            getData3.push(this.form.deviceReportDataList[i].reportTime)
            getData4.push(this.form.deviceReportDataList[i].standardConditionAccumulation)
            getData5.push(this.form.deviceReportDataList[i].workingConditionAccumulation)
            getData6.push(this.form.deviceReportDataList[i].temperature)
            getData7.push(this.form.deviceReportDataList[i].pressure)
726
          }
yaqizhang's avatar
yaqizhang committed
727 728 729 730 731
          this.initData(getData1, getData2, getData3);
          this.drawPieChart(getData4, getData5, getData3);
          this.main3(getData6, getData3);
          this.main4(getData7, getData3);
          console.log(this.form.deviceReportDataList)
yaqizhang's avatar
yaqizhang committed
732 733 734 735
          console.log("getData1", getData1)
          console.log("getData2", getData2)
          console.log("getData3", getData3)

yaqizhang's avatar
yaqizhang committed
736

737 738 739
          if(this.form.orderType == '1') {
            // 获取设备列表树
            let data = {
yaqizhang's avatar
yaqizhang committed
740 741
              key1: this.form.deviceInfoList,
              key2: this.form.pipeList
742 743 744 745 746 747 748 749 750
            };
            deviceTree(data).then(response => {
              this.deviceOptions[0].childList = response.data;
            });
          }
        });
      },
    }
  }
yaqizhang's avatar
yaqizhang committed
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810
</script>
<style>
  .div-null {
    width: 100%;
    height: 300px;
    text-align: center;
    line-height: 250px;
  }

  .el-tree-node__content {
    width: 150px;
  }

  .el-divider--horizontal {
    display: block;
    height: 1px;
    width: 100%;
    margin: 20px 0;
  }

  .feedbackTime-div {
    float: left;
    margin-left: 150px;
    margin-top: 10px;
  }

  .feedbackTime {
    height: 120px;
    width: 120px;
    float: left;
    margin-left: 15px;
    margin-top: 5px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .el-card__body {
    padding: 5px 20px 20px 20px;
  }

  .detail .el-form {
    width: 20%;
  }

  .detail .el-form-item {
    margin-bottom: 0px;
  }

  .el-tree {
    margin-top: 5px;
  }

  .avatar-uploader {
    width: 25%;
    float: left;
  }

  .avatar-uploader .el-upload {
811 812 813 814 815 816
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
yaqizhang's avatar
yaqizhang committed
817

818 819 820
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
yaqizhang's avatar
yaqizhang committed
821

822 823 824 825 826 827 828 829
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
yaqizhang's avatar
yaqizhang committed
830

831 832 833 834 835
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
yaqizhang's avatar
yaqizhang committed
836 837

  li {
838 839 840
    font-size: 15px;
    font-weight: 900;
  }
841
</style>