index.vue 28.5 KB
Newer Older
1
<template>
yaqizhang's avatar
yaqizhang committed
2 3 4
  <div class="app-container detail" style="background-color: rgb(238, 241, 245);">
    <div style="padding-top: 10px;background: #fff;height: 100%;">
      <el-row>
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 58 59
              <!-- <font>{{form.orderId}}</font> -->
              <template slot-scope="scope">
                <el-button type="text" @click="showDetail(form.orderId)">{{form.orderId}}</el-button>
              </template>
yaqizhang's avatar
yaqizhang committed
60
            </el-form-item>
61
            <el-form-item label="处理状态:" prop="dealStatus">
yaqizhang's avatar
yaqizhang committed
62
              <font v-if="form.orderId == null || form.orderId == ''">未生成工单</font>
yaqizhang's avatar
yaqizhang committed
63 64
              <font
                v-if="(form.dealStatus == null || form.dealStatus == '') && form.orderId != null && form.orderId != ''">
王晓倩's avatar
王晓倩 committed
65
                暂未处理</font>
yaqizhang's avatar
yaqizhang committed
66
              <font v-if="form.dealStatus == 1">不需处理</font>
67 68 69 70
              <font v-if="form.dealStatus == 2">已处理完成</font>
              <font v-if="form.dealStatus == 3">未处理完成</font>
            </el-form-item>
          </el-form>
yaqizhang's avatar
yaqizhang committed
71 72 73
        </el-col>
      </el-row>
      <el-divider></el-divider>
yaqizhang's avatar
yaqizhang committed
74 75
      <el-row style="width: 100%;height: 45px;margin-top: -15px;">
        <el-col :span="24" style="margin-bottom: -10px;">
yaqizhang's avatar
yaqizhang committed
76 77 78 79 80
          <div style="color: #31EAEA;">
            <ul><li>设备详情</li></ul>
          </div>
        </el-col>
      </el-row>
yaqizhang's avatar
yaqizhang committed
81 82
      <el-row>
        <el-col :span="16" style="padding: 10px;">
王晓倩's avatar
王晓倩 committed
83 84
          <div style="width: 100%;float: left;height: 100%;" v-if="form.deviceType != '管道'">
            <el-table :data="dataListdetail" style="width: 100%">
yaqizhang's avatar
yaqizhang committed
85 86
              <el-table-column label="设备名称" align="center" prop="deviceName" />
              <el-table-column label="设备编号" align="center" prop="deviceCode" />
王晓倩's avatar
王晓倩 committed
87 88 89 90 91 92 93 94 95
              <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
96
            </el-table>
97

王晓倩's avatar
王晓倩 committed
98 99 100 101 102
            <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
103
            </el-table>
104

王晓倩's avatar
王晓倩 committed
105 106 107 108 109 110 111 112
            <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
113
            </el-table>
王晓倩's avatar
王晓倩 committed
114
          </div>
115

王晓倩's avatar
王晓倩 committed
116 117 118 119 120 121 122 123 124 125 126
          <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>
127

王晓倩's avatar
王晓倩 committed
128 129
            <el-table :data="dataListdetail" style="width: 100%;margin-top: 20px;">
              <el-table-column label="管道压力" align="center" prop="pipePressure" >
yaqizhang's avatar
yaqizhang committed
130
                <template slot-scope="scope">
王晓倩's avatar
王晓倩 committed
131 132 133 134
                  <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
135 136
                </template>
              </el-table-column>
王晓倩's avatar
王晓倩 committed
137 138
              <el-table-column label="管道长度" align="center" prop="pipeLength" />
              <el-table-column label="管道地址" align="center" prop="pipeAddr" />
yaqizhang's avatar
yaqizhang committed
139
            </el-table>
140

王晓倩's avatar
王晓倩 committed
141 142 143 144 145 146 147 148 149
            <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
150
          </div>
yaqizhang's avatar
yaqizhang committed
151
        </el-col>
王晓倩's avatar
王晓倩 committed
152

yaqizhang's avatar
yaqizhang committed
153 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;">
            <div style="width: 100%;height: 100%" id="container"></div>
yaqizhang's avatar
yaqizhang committed
156
          </div>
yaqizhang's avatar
yaqizhang committed
157 158
        </el-col>
      </el-row>
yaqizhang's avatar
yaqizhang committed
159

yaqizhang's avatar
yaqizhang committed
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
      <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
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
      <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>
237
    </div>
yaqizhang's avatar
yaqizhang committed
238 239 240 241
  </div>
</template>

<script>
242

王晓倩's avatar
王晓倩 committed
243
  import { getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
244
  import { deviceTree } from "@/api/device/deviceInfo";
yaqizhang's avatar
yaqizhang committed
245
  import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
246
  import gaodeMap from "utils/gaodeMap.js";
yaqizhang's avatar
yaqizhang committed
247
  import { map, DEVICE_TYPE } from "utils/gaodeMap.js";
248
  import { inspectorList } from "@/api/system/user";
yaqizhang's avatar
yaqizhang committed
249
  import echarts from 'echarts';
250 251

export default {
王晓倩's avatar
王晓倩 committed
252 253 254 255 256
  name: "DeviceAlarm",
  components: {
  },
  data() {
    return {
王晓倩's avatar
王晓倩 committed
257
      dataListdetail: [],
yaqizhang's avatar
yaqizhang committed
258
      alarmId:'',
王晓倩's avatar
王晓倩 committed
259
      // 折线图标题
260
      title: "",
yaqizhang's avatar
yaqizhang committed
261 262 263
      open: false,
      // 巡检员列表
      inspector: [],
264 265
      // 表单参数
      form: { },
266
      rule: { },
yaqizhang's avatar
yaqizhang committed
267 268 269 270 271 272 273 274 275
      // 表单校验
      rules: {
        orderName: [
          { required: true, message: "工单名称不能为空", trigger: "blur" },
        ],
        appointInspector: [
          { required: true, message: "请选择巡检人员", trigger: "blur" },
        ],
      },
276 277 278 279
      };
    },
    created() {
      // 如果是跳转来的,则接受初始化参数
yaqizhang's avatar
yaqizhang committed
280
      this.alarmId = +this.$route.query.alarmId;
王晓倩's avatar
王晓倩 committed
281
      this.getDetail();
282
    },
yaqizhang's avatar
yaqizhang committed
283
    mounted() {
yaqizhang's avatar
yaqizhang committed
284 285
      // let gaoMap = new gaodeMap("石家庄");
      // this.gaoMap = gaoMap;
286 287
    },
    methods: {
yaqizhang's avatar
yaqizhang committed
288 289 290 291 292 293
      initData(getData1, getData2, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart1 = echarts.init(document.getElementById('main1'));
        // 绘制图表
        myChart1.setOption({
          title: {
yaqizhang's avatar
yaqizhang committed
294
            text: '标况流量、工况流量'
yaqizhang's avatar
yaqizhang committed
295 296
          },
          tooltip: {
yaqizhang's avatar
yaqizhang committed
297 298
            trigger: 'axis'
          },
yaqizhang's avatar
yaqizhang committed
299 300
          legend: {
            data: ['标况流量', '工况流量']
yaqizhang's avatar
yaqizhang committed
301
          },
yaqizhang's avatar
yaqizhang committed
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
          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
319 320 321
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
322 323 324 325 326 327 328 329 330 331 332 333
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
334 335
              }
            }
yaqizhang's avatar
yaqizhang committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
          },
          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
354
                }
yaqizhang's avatar
yaqizhang committed
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
              }
            },
            {
              // 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
373
                }
yaqizhang's avatar
yaqizhang committed
374
              }
yaqizhang's avatar
yaqizhang committed
375
            }
yaqizhang's avatar
yaqizhang committed
376 377 378 379 380 381 382 383
          ]
        });
      },
      drawPieChart(getData4, getData5, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart2 = echarts.init(document.getElementById('main2'));
        // 绘制图表
        myChart2.setOption({
yaqizhang's avatar
yaqizhang committed
384 385 386 387 388 389 390 391 392
          title: {
            text: '标况累积量、工况累积量'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['标况累积量', '工况累积量']
          },
yaqizhang's avatar
yaqizhang committed
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
          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
410
            }
yaqizhang's avatar
yaqizhang committed
411 412 413 414 415 416 417 418 419
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
yaqizhang's avatar
yaqizhang committed
420
            },
yaqizhang's avatar
yaqizhang committed
421 422 423 424 425
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
              }
            }
yaqizhang's avatar
yaqizhang committed
426
          },
yaqizhang's avatar
yaqizhang committed
427 428 429
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
430
              name: '标况累积量',
yaqizhang's avatar
yaqizhang committed
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
              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
448
              name: '工况累积量',
yaqizhang's avatar
yaqizhang committed
449 450 451 452 453 454 455 456 457 458 459 460 461 462
              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
463
            }
yaqizhang's avatar
yaqizhang committed
464 465 466 467 468 469 470 471
          ]
        });
      },
      main3(getData6, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart3 = echarts.init(document.getElementById('main3'));
        // 绘制图表
        myChart3.setOption({
yaqizhang's avatar
yaqizhang committed
472 473 474 475 476 477 478 479 480
          title: {
            text: '温度'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['温度']
          },
yaqizhang's avatar
yaqizhang committed
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
          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
497 498 499
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
500 501 502 503 504 505 506 507 508 509 510 511
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
512 513 514
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
515 516 517
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
518
              name: '温度',
yaqizhang's avatar
yaqizhang committed
519 520 521 522 523 524 525 526 527 528 529 530 531 532
              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
533
            }
yaqizhang's avatar
yaqizhang committed
534 535 536 537 538 539 540 541
          ]
        });
      },
      main4(getData7, getData3) {
        // 基于准备好的dom,初始化echarts实例
        var myChart4 = echarts.init(document.getElementById('main4'));
        // 绘制图表
        myChart4.setOption({
yaqizhang's avatar
yaqizhang committed
542 543 544 545 546 547 548 549 550
          title: {
            text: '压力'
          },
          tooltip: {
            trigger: 'axis'
          },
          legend: {
            data: ['压力']
          },
yaqizhang's avatar
yaqizhang committed
551 552 553 554 555 556 557 558 559 560 561 562
          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
563
            },
yaqizhang's avatar
yaqizhang committed
564 565 566 567
            axisLine: {
              lineStyle: {
                color: '#ccc' // x轴的颜色
              }
yaqizhang's avatar
yaqizhang committed
568
            }
yaqizhang's avatar
yaqizhang committed
569 570 571 572 573 574 575 576 577 578 579 580 581
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              formatter: '{value}',
              textStyle: {
                color: '#000' //数字的颜色
              },
              inside: false //控制数据是否在内侧还是外侧显示
            },
            axisLine: {
              lineStyle: {
                color: '#ccc' // 折线的颜色
yaqizhang's avatar
yaqizhang committed
582 583 584
              }
            }
          },
yaqizhang's avatar
yaqizhang committed
585 586 587
          series: [
            {
              // data: this.dataY,
yaqizhang's avatar
yaqizhang committed
588
              name: '压力',
yaqizhang's avatar
yaqizhang committed
589 590 591 592 593 594 595 596 597 598 599 600 601
              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
602 603
              }
            }
yaqizhang's avatar
yaqizhang committed
604 605
          ]
        });
yaqizhang's avatar
yaqizhang committed
606
      },
王晓倩's avatar
王晓倩 committed
607

yaqizhang's avatar
yaqizhang committed
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649

      /** 下发按钮操作 */
      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();
      },
650
      /** 详细信息跳转 */
王晓倩's avatar
王晓倩 committed
651 652 653 654 655 656 657 658
      showDetail(orderId) {
        this.$router.push({
           path: '/workOrder/detail',
           query:{
             orderId : orderId
           }
        }) //带参跳转
      },
王晓倩's avatar
王晓倩 committed
659 660
      getDetail (){
        getDeviceAlarm(this.alarmId).then(response =>{
661
          this.form = response.data;
662
          console.log("this.form", this.form);
663

王晓倩's avatar
王晓倩 committed
664 665
          if(this.form.pipeList != null){
            let pipe = this.form.pipeList[0];
yaqizhang's avatar
yaqizhang committed
666 667 668 669 670 671 672

            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];
            let gaoMap = new gaodeMap("石家庄",path3);
            this.gaoMap=gaoMap;
王晓倩's avatar
王晓倩 committed
673 674 675 676 677 678 679 680 681
            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);
yaqizhang's avatar
yaqizhang committed
682 683
            let gaoMap = new gaodeMap("石家庄",[device.longitude, device.latitude]);
            this.gaoMap = gaoMap;
王晓倩's avatar
王晓倩 committed
684
            this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, device);
yaqizhang's avatar
yaqizhang committed
685 686

            // this.gaoMap.resetMapCenter([device.longitude, device.latitude]);
王晓倩's avatar
王晓倩 committed
687
          }
yaqizhang's avatar
yaqizhang committed
688 689 690 691 692 693 694 695 696 697

          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
698
            getData1.push(this.form.deviceReportDataList[i].standardConditionFlow)
yaqizhang's avatar
yaqizhang committed
699 700 701 702 703 704
            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)
705
          }
yaqizhang's avatar
yaqizhang committed
706 707 708 709 710
          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
711 712 713 714
          console.log("getData1", getData1)
          console.log("getData2", getData2)
          console.log("getData3", getData3)

yaqizhang's avatar
yaqizhang committed
715

716 717 718
          if(this.form.orderType == '1') {
            // 获取设备列表树
            let data = {
yaqizhang's avatar
yaqizhang committed
719 720
              key1: this.form.deviceInfoList,
              key2: this.form.pipeList
721 722 723 724 725 726 727 728 729
            };
            deviceTree(data).then(response => {
              this.deviceOptions[0].childList = response.data;
            });
          }
        });
      },
    }
  }
yaqizhang's avatar
yaqizhang committed
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 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
</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 {
790 791 792 793 794 795
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
yaqizhang's avatar
yaqizhang committed
796

797 798 799
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
yaqizhang's avatar
yaqizhang committed
800

801 802 803 804 805 806 807 808
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
yaqizhang's avatar
yaqizhang committed
809

810 811 812 813 814
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
yaqizhang's avatar
yaqizhang committed
815 816

  li {
817 818 819
    font-size: 15px;
    font-weight: 900;
  }
820
</style>