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

15

yaqizhang's avatar
yaqizhang committed
16
        <div style="width: 100%;height: 100px;">
17 18 19 20 21 22 23 24 25 26 27 28 29 30
          <!-- <div style="color: #31EAEA;width: 30%;height: 30px;">
            <ul><li>详细信息</li></ul>
          </div> -->
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;">
            <el-form-item label="设备类型:" prop="deviceType">
              <font v-if="form.deviceType == 0">管道</font>
              <font v-if="form.deviceType == 1">调压阀</font>
              <font v-if="form.deviceType == 2">阀门井</font>
              <font v-if="form.deviceType == 3">流量计</font>
              <font v-if="form.deviceType == 4">压力表</font>
            </el-form-item>
            <el-form-item label="设备编号:" prop="deviceCode">
              <font>{{form.deviceCode}}</font> 
            </el-form-item>
yaqizhang's avatar
yaqizhang committed
31 32 33
            <el-form-item label="设备信息:" prop="alarmId">
              <font>{{form.alarmId}}</font> 
            </el-form-item>
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
          </el-form>
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;">
            <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>
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;">
            <el-form-item label="报警开始时间:" prop="startTime">
              <font>{{form.startTime}}</font> 
            </el-form-item>
            <el-form-item label="报警结束时间:" prop="updateTime">
              <font>{{form.endTime}}</font> 
            </el-form-item>
          </el-form>
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="float: left;margin-left: 50px;">
yaqizhang's avatar
yaqizhang committed
52 53 54
            <el-form-item label="工单编号:" prop="orderId">
              <font>{{form.orderId}}</font> 
            </el-form-item>
55
            <el-form-item label="处理状态:" prop="dealStatus">
yaqizhang's avatar
yaqizhang committed
56 57 58
              <font v-if="form.orderId == null || form.orderId == ''">未生成工单</font>
              <font v-if="(form.dealStatus == null || form.dealStatus == '') && form.orderId != null && form.orderId != ''">未处理</font>
              <font v-if="form.dealStatus == 1">不需处理</font>
59 60 61 62 63 64 65 66 67
              <font v-if="form.dealStatus == 2">已处理完成</font>
              <font v-if="form.dealStatus == 3">未处理完成</font>
            </el-form-item>
          </el-form>
          
          
        </div>
        <el-divider></el-divider>

yaqizhang's avatar
yaqizhang committed
68 69
        <div style="width: 100%;height: 350px;padding: 10px;height: 300px;">
            <div style="width: 66.6%;float: left;height: 100%;">
yaqizhang's avatar
yaqizhang committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
              <el-table :data="dataListdetail1" style="width: 100%">
                <el-table-column label="设备名称" align="center" prop="deviceName" />
                <el-table-column label="设备编号" align="center" prop="deviceCode" />
                <el-table-column label="报警类型" align="center" prop="alarmType" />
              </el-table>
    
              <el-table :data="dataListdetail2" style="width: 100%;margin-top: 20px;">
                <el-table-column label="报警值" align="center" prop="alarmValue" />
                <el-table-column label="报警开始时间" align="center" prop="startTime" />
              </el-table>
    
    
              <el-table :data="dataListdetail3" style="width: 100%;margin-top: 20px;">
                <el-table-column label="报警结束时间" align="center" prop="endTime" />
                <el-table-column label="处理状态" align="center" prop="dealStatus">
                  <template slot-scope="scope">
                    <span v-if="scope.row.orderId == null || scope.row.orderId == ''">未生成工单</span>
                    <span v-if="(scope.row.dealStatus == null || scope.row.dealStatus == '') &&
                        scope.row.orderId != null && scope.row.orderId != ''">未处理</span>
                    <span v-if="scope.row.dealStatus == 1">不需处理</span>
                    <span v-if="scope.row.dealStatus == 2">已处理完成</span>
                    <span v-if="scope.row.dealStatus == 3">未处理完成</span>
                  </template>
yaqizhang's avatar
yaqizhang committed
93
                </el-table-column>
yaqizhang's avatar
yaqizhang committed
94 95 96
              </el-table>


yaqizhang's avatar
yaqizhang committed
97
            </div>
98
          <div id="marbox" style="width: 33%;height: 304px; border: 1px solid rgb(218, 213, 213);float: right;">
99 100 101 102
            <div style="width: 100%;height: 100%" id="container"></div>
          </div>
        </div>

yaqizhang's avatar
yaqizhang committed
103 104 105
        <div style="height: 320px;width: 100%;margin-top: 15px;padding: 10px;">
            <div id="main1" style="float: left;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"></div>
            <div id="main2" style="float: right;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"></div>
106 107
        </div>

yaqizhang's avatar
yaqizhang committed
108 109 110 111

        <div style="height: 320px;width: 100%;padding: 10px;"> 
            <div id="main3" style="float: left;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"></div>
            <div id="main4" style="float: right;width: 49.8%;height:300px;background-color: rgb(247 247 247);padding: 5px;"></div>
112 113
        </div>
      </div>
yaqizhang's avatar
yaqizhang committed
114
        
115 116 117 118 119
    </div>
  </template>

  <script>

yaqizhang's avatar
yaqizhang committed
120
  import { listDeviceAlarm, getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
121 122 123 124
  import { deviceTree } from "@/api/device/deviceInfo";
  import gaodeMap from "utils/gaodeMap.js";
  import {map, DEVICE_TYPE} from "utils/gaodeMap.js";
  import { inspectorList } from "@/api/system/user";
yaqizhang's avatar
yaqizhang committed
125
  import echarts from 'echarts';
126
  import { addBasicsInfo } from "@/api/workOrder/basicsInfo";
127 128

export default {
yaqizhang's avatar
yaqizhang committed
129
    name: "DeviceAlarm",
130 131 132 133
    components: {
    },
    data() {
      return {
yaqizhang's avatar
yaqizhang committed
134 135 136 137 138
        tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          },],
139
        inspector: [],
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
         // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      rules:{},
      // 报警信息表格数据
      deviceAlarmList: [],
      // 报警类型字典
      typeOptions: [],
      // 设备级联
      options: [],
yaqizhang's avatar
yaqizhang committed
161 162 163
      dataListdetail1: [],
      dataListdetail2: [],
      dataListdetail3: [],
164
      props: {
165
        multiple: true,
166 167 168 169 170 171 172 173
        value: "id",
        label: "name",
        level: "level",
        children: "childList",
      },
      devices: null,
      // 巡检员列表
      inspector: [],
yaqizhang's avatar
yaqizhang committed
174
      alarmId:'',
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceId: null,
        orderId: null,
        alarmType: null,
        alarmValue: null,
        startTime: null,
        endTime: null,
        dealStatus: null
      },
      // 表单参数
      form: { },
193 194
      };
    },
yaqizhang's avatar
yaqizhang committed
195
    
196 197 198
    created() {
      // 如果是跳转来的,则接受初始化参数
      // this.user_id = this.$route.query.id; //详细信息页接收参数
yaqizhang's avatar
yaqizhang committed
199 200 201 202
     
      this.alarmId = +this.$route.query.alarmId; 
      console.log("query",this.$route.query.alarmId)

203 204 205 206 207 208 209
      this.getList();
      this.getDicts("t_order_status").then(response => {
        this.typeOptions = response.data;
      });
      this.getDicts("t_order_type").then(response => {
        this.ordertypeOptions = response.data;
      });
210
      this.getDeviceAlarm();
211 212 213 214
    },
    mounted(){
      let gaoMap =  new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
yaqizhang's avatar
yaqizhang committed
215
      // this.getDeviceAlarm();
yaqizhang's avatar
yaqizhang committed
216 217 218 219
      this.initData();
      this.drawPieChart();
      this.main3();
      this.main4();
220 221 222 223 224 225 226 227
    },
    methods: {
      getInspectorList(){
        this.loading = true;
        inspectorList().then(response => {
          this.inspector = response.data;
          this.loading = false;
        });
yaqizhang's avatar
yaqizhang committed
228
        
229
      },
yaqizhang's avatar
yaqizhang committed
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 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 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 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
    //   getMap() {
    //   var myChart = this.$echarts.init(document.getElementById('map'))
    //   let option = {
    //     xAxis: {
    //       type: 'category',
    //       // data: this.dataX,
    //       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    //       boundaryGap: false, //控制日期是否在中间显示
    //       axisLabel: {
    //         show: true, //是否显示日期
    //         interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
    //         textStyle: {
    //           color: '#000', //日期的颜色
    //           fontSize: 12 //字体的大小
    //         }
    //       },
    //       axisLine: {
    //         lineStyle: {
    //           color: '#ccc' // x轴的颜色
    //         }
    //       }
    //     },
    //     yAxis: {
    //       type: 'value',
    //       axisLabel: {
    //         formatter: '{value}',
    //         textStyle: {
    //           color: '#000' //数字的颜色
    //         },
    //         inside: false //控制数据是否在内侧还是外侧显示
    //       },
    //       axisLine: {
    //         lineStyle: {
    //           color: '#ccc' // 折线的颜色
    //         }
    //       }
    //     },
    //     series: [
    //       {
    //         // data: this.dataY,
    //         data: [820, 932, 901, 934, 1290, 1330, 1320],
    //         type: 'line',
    //         symbol: 'circle', //是否显示实心的折线圆点
    //         smooth: true, //让折线有弧度
    //         symbolSize: 7, //折线圆点的大小
    //         itemStyle: {
    //           normal: {
    //             color: '#efc883', //折线点的颜色
    //             lineStyle: {
    //               color: '#efc883' //折线的颜色
    //             },
    //             label: { show: true } //是否在折线点上显示数字
    //           }
    //         }
    //       }
    //     ]
    //   }
    //   myChart.setOption(option)
    // },
    initData() {
		// 基于准备好的dom,初始化echarts实例
		var myChart1 = echarts.init(document.getElementById('main1'));
		// let that=this;
		// var getData1 = [];
		// var getData2 = [];
		// METHOD.axiosGet(
		//   this,
		//   `/enterpriseInfo/getNumberByRegulation`,
		//   function(res) {
		//     if (res.code === 0) {
		// 		//先进行赋值
		// 		for(let i=0; i<res.data.result.length; i++) {
		// 			var obj = new Object();
		// 			var arr = new Object();
		// 			// obj.name = res.data.result[i].name;
		// 			// obj.value = res.data.result[i].number;
		// 			obj.name = res.data.result[i].type;
		// 			obj.value = res.data.result[i].number;
		// 			arr = res.data.result[i].type;
		// 			getData1[i] = obj;
		// 			getData2[i] = arr;
		// 		}
		// 		myChart1.setOption({
		// 			legend: {
		// 				data: getData2,
		// 			},
		// 			series:[{
		// 				data: getData1,
		// 			}]
		// 		})
		//     }
		// });
		
	// 绘制图表
      myChart1.setOption({
        title: {
            text: '折线图堆叠'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: ['标况累积量', '工况累积量']
        },
        xAxis: {
          type: 'category',
          // data: this.dataX,
          data: ['23', '44', '77', '34', '56', '88', '38','68','55','99','44','33'],
          boundaryGap: false, //控制日期是否在中间显示
          axisLabel: {
            show: true, //是否显示日期
            interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
            textStyle: {
              color: '#000', //日期的颜色
              fontSize: 12 //字体的大小
            }
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // x轴的颜色
            }
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            formatter: '{value}',
            textStyle: {
              color: '#000' //数字的颜色
            },
            inside: false //控制数据是否在内侧还是外侧显示
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // 折线的颜色
            }
          }
        },
        series: [
          {
            // data: this.dataY,
            name:'工况累计量',
            data: [820, 232, 901, 534, 1290, 330, 1320, 345, 654, 189, 980, 234],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#efc883', //折线点的颜色
                lineStyle: {
                  color: '#efc883' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          },
          {
            // data: this.dataY,
            name:'工况累计量',
            data: [500, 600, 700, 300, 1100, 130, 1200, 820, 932, 901, 934, 1290],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#053B6A', //折线点的颜色
                lineStyle: {
                  color: '#053B6A' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          }
        ]
      });
	 
    },
	drawPieChart(){
		// 基于准备好的dom,初始化echarts实例
		var myChart2 = echarts.init(document.getElementById('main2'));
		// let that=this;
		// var getData1 = [];
		// var getData2 = [];
		// METHOD.axiosGet(
		//   this,
		//   `/enterpriseGoods/getNumberByEnterprise`,
		//   function(res) {
		//     if (res.code === 0) {
		// 		//先进行赋值
		// 		for(let i=0; i<res.data.result.length; i++) {
		// 			var obj = new Object();
		// 			var arr = new Object();
		// 			// obj = res.data.result[i].number;
		// 			// arr = res.data.result[i].type;
		// 			obj = res.data.result[i].number;
		// 			arr = res.data.result[i].name;
		// 			getData1[i] = obj;
		// 			getData2[i] = arr;
		// 		}
		// 		myChart2.setOption({
		// 			xAxis: {
		// 				data: getData2,
		// 			},
		// 			series:[{
		// 				data: getData1,
		// 			}]
		// 		})
		//     }
		// });
		// 绘制图表
		myChart2.setOption({
				  // color:['rgb(8,252,7)','rgb(255,168,0)','rgb(0,121,254)','rgb(0,255,251)','rgb(3,120,251)','rgb(0,200,251)'],
                xAxis: {
                type: 'category',
                // data: this.dataX,
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                boundaryGap: false, //控制日期是否在中间显示
                axisLabel: {
                    show: true, //是否显示日期
                    interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
                    textStyle: {
                    color: '#000', //日期的颜色
                    fontSize: 12 //字体的大小
                    }
                },
                axisLine: {
                    lineStyle: {
                    color: '#ccc' // x轴的颜色
                    }
                }
                },
                yAxis: {
                type: 'value',
                axisLabel: {
                    formatter: '{value}',
                    textStyle: {
                    color: '#000' //数字的颜色
                    },
                    inside: false //控制数据是否在内侧还是外侧显示
                },
                axisLine: {
                    lineStyle: {
                    color: '#ccc' // 折线的颜色
                    }
                }
                },
                series: [
                {
                    // data: this.dataY,
                    data: [820, 932, 901, 934, 1290, 1330, 1320],
                    type: 'line',
                    symbol: 'circle', //是否显示实心的折线圆点
                    smooth: true, //让折线有弧度
                    symbolSize: 7, //折线圆点的大小
                    itemStyle: {
                    normal: {
                        color: '#efc883', //折线点的颜色
                        lineStyle: {
                        color: '#efc883' //折线的颜色
                        },
                        label: { show: true } //是否在折线点上显示数字
                    }
                    }
                },
                {
                    // data: this.dataY,
                    data: [500, 600, 700, 300, 1100, 130, 1200],
                    type: 'line',
                    symbol: 'circle', //是否显示实心的折线圆点
                    smooth: true, //让折线有弧度
                    symbolSize: 7, //折线圆点的大小
                    itemStyle: {
                    normal: {
                        color: '#053B6A', //折线点的颜色
                        lineStyle: {
                        color: '#053B6A' //折线的颜色
                        },
                        label: { show: true } //是否在折线点上显示数字
                    }
                    }
                }
                ]
		});
	},
    main3() {
		// 基于准备好的dom,初始化echarts实例
		var myChart3 = echarts.init(document.getElementById('main3'));
		// let that=this;
		// var getData1 = [];
		// var getData2 = [];
		// METHOD.axiosGet(
		//   this,
		//   `/enterpriseInfo/getNumberByRegulation`,
		//   function(res) {
		//     if (res.code === 0) {
		// 		//先进行赋值
		// 		for(let i=0; i<res.data.result.length; i++) {
		// 			var obj = new Object();
		// 			var arr = new Object();
		// 			// obj.name = res.data.result[i].name;
		// 			// obj.value = res.data.result[i].number;
		// 			obj.name = res.data.result[i].type;
		// 			obj.value = res.data.result[i].number;
		// 			arr = res.data.result[i].type;
		// 			getData1[i] = obj;
		// 			getData2[i] = arr;
		// 		}
		// 		myChart1.setOption({
		// 			legend: {
		// 				data: getData2,
		// 			},
		// 			series:[{
		// 				data: getData1,
		// 			}]
		// 		})
		//     }
		// });
		
	// 绘制图表
      myChart3.setOption({
        xAxis: {
          type: 'category',
          // data: this.dataX,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
          boundaryGap: false, //控制日期是否在中间显示
          axisLabel: {
            show: true, //是否显示日期
            interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
            textStyle: {
              color: '#000', //日期的颜色
              fontSize: 12 //字体的大小
            }
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // x轴的颜色
            }
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            formatter: '{value}',
            textStyle: {
              color: '#000' //数字的颜色
            },
            inside: false //控制数据是否在内侧还是外侧显示
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // 折线的颜色
            }
          }
        },
        series: [
          {
            // data: this.dataY,
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#efc883', //折线点的颜色
                lineStyle: {
                  color: '#efc883' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          },
          {
            // data: this.dataY,
            data: [500, 600, 700, 300, 1100, 130, 1200],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#053B6A', //折线点的颜色
                lineStyle: {
                  color: '#053B6A' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          }
        ]
      });
	 
    },
    main4() {
		// 基于准备好的dom,初始化echarts实例
		var myChart4 = echarts.init(document.getElementById('main4'));
		// let that=this;
		// var getData1 = [];
		// var getData2 = [];
		// METHOD.axiosGet(
		//   this,
		//   `/enterpriseInfo/getNumberByRegulation`,
		//   function(res) {
		//     if (res.code === 0) {
		// 		//先进行赋值
		// 		for(let i=0; i<res.data.result.length; i++) {
		// 			var obj = new Object();
		// 			var arr = new Object();
		// 			// obj.name = res.data.result[i].name;
		// 			// obj.value = res.data.result[i].number;
		// 			obj.name = res.data.result[i].type;
		// 			obj.value = res.data.result[i].number;
		// 			arr = res.data.result[i].type;
		// 			getData1[i] = obj;
		// 			getData2[i] = arr;
		// 		}
		// 		myChart1.setOption({
		// 			legend: {
		// 				data: getData2,
		// 			},
		// 			series:[{
		// 				data: getData1,
		// 			}]
		// 		})
		//     }
		// });
		
	// 绘制图表
      myChart4.setOption({
        xAxis: {
          type: 'category',
          // data: this.dataX,
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
          boundaryGap: false, //控制日期是否在中间显示
          axisLabel: {
            show: true, //是否显示日期
            interval: 0, //强制显示全部 // rotate: 40,//倾斜的角度
            textStyle: {
              color: '#000', //日期的颜色
              fontSize: 12 //字体的大小
            }
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // x轴的颜色
            }
          }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            formatter: '{value}',
            textStyle: {
              color: '#000' //数字的颜色
            },
            inside: false //控制数据是否在内侧还是外侧显示
          },
          axisLine: {
            lineStyle: {
              color: '#ccc' // 折线的颜色
            }
          }
        },
        series: [
          {
            // data: this.dataY,
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#efc883', //折线点的颜色
                lineStyle: {
                  color: '#efc883' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          },
          {
            // data: this.dataY,
            data: [500, 600, 700, 300, 1100, 130, 1200],
            type: 'line',
            symbol: 'circle', //是否显示实心的折线圆点
            smooth: true, //让折线有弧度
            symbolSize: 7, //折线圆点的大小
            itemStyle: {
              normal: {
                color: '#053B6A', //折线点的颜色
                lineStyle: {
                  color: '#053B6A' //折线的颜色
                },
                label: { show: true } //是否在折线点上显示数字
              }
            }
          }
        ]
      });
	 
    },  
    
    // 点击按钮显示隐藏
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
      changeDisplay(e){
        this.isDisplay = !this.isDisplay
        let $timeline = this.$refs.timeline;
        if(!this.showAndHide){
          for(let i = 0; i< $timeline.$children.length; i++){
            if(i>1){
              $timeline.$children[i].$el.style.display = "block";
            }
          }
          this.showAndHide = true;
        }else{
          for(let i = 0; i< $timeline.$children.length; i++){
            if(i>1){
              $timeline.$children[i].$el.style.display = "none";
            }
          }
          this.showAndHide = false;
        }


        //$timeline.toggleRowExpansion(row,true)
      },


      handleRemove(file) {
        console.log(file);
      },
      handlePictureCardPreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisible = true;
      },
      handleDownload(file) {
        console.log(file);
      },
      /** 查询工单基础信息列表 */
      getList() {
772 773 774 775 776 777 778 779
      this.loading = true;
      listDeviceAlarm(this.queryParams).then(response => {
        this.deviceAlarmList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getDeviceAlarm (){
yaqizhang's avatar
yaqizhang committed
780
      getDeviceAlarm(this.alarmId).then(response =>{
yaqizhang's avatar
yaqizhang committed
781 782 783 784 785 786 787
          const { deviceName, deviceCode, alarmType,alarmValue,startTime,endTime,deviceStatus} = response.data;
          const obj1 = {deviceName,deviceCode,alarmType};
          const obj2 = {alarmValue,startTime};
          const obj3 = {endTime,deviceStatus};
          this.dataListdetail1.push(obj1);
          this.dataListdetail2.push(obj2);
          this.dataListdetail3.push(obj3);
yaqizhang's avatar
yaqizhang committed
788
          
789
          this.form = response.data;
yaqizhang's avatar
yaqizhang committed
790
          console.log("this.form",this.form)
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866
          this.active = parseInt(response.data.orderStatus) + 1;
          if(this.form.deviceInfoList.length>0){
            this.gaoMap.resetMapCenter([this.form.deviceInfoList[0].longitude,this.form.deviceInfoList[0].latitude]);
          }
          for(var i = 0; i < this.form.deviceInfoList.length; i++){
            let obj = this.form.deviceInfoList[i];
            this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, obj)
          }

          if(this.form.orderType == '1') {
            // 获取设备列表树
            let data = {
              key1:this.form.deviceInfoList,
              key2:this.form.pipeList
            };
            deviceTree(data).then(response => {
              this.deviceOptions[0].childList = response.data;
            });
          }
        });
      },
      // 筛选节点
      // filterNode(value, data) {
      //   if (!value) return true;
      //   return data.label.indexOf(value) !== -1;
      // },
      // 节点单击事件
      handleNodeClick(data) {

      },
      // 取消按钮
      cancel() {
        this.open = false;
        // this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          orderId: null,
          orderType: null,
          orderName: null,
          orderStatus: "0",
          createTime: null,
          appointInspector: null,
          allotTime: null,
          actualInspector: null,
          actualTime: null,
          remarks: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.orderId)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加工单基础信息";
      },
      /** 归档按钮操作 */
    handleFinish(res) {
      // this.reset();
867
      getDeviceAlarm(res).then(response => {
868 869 870 871 872 873 874 875 876
        this.form = response.data;
        this.open = true;
        this.title = "工单信息归档";
      });
    },
      /** 修改按钮操作 */
      handleUpdate(res) {
      // this.reset();
      this.getInspectorList();
877
      getInspectorList(this.orderId).then(response => {
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003
        this.form = response.data;
        this.open = true;
        this.title = "工单信息修改";
      });
    },
      /** 提交按钮 */
       /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.orderStatus == '0') {
            updateBasicsInfo(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else if(this.form.orderStatus == '2'){
            updateOrderStatus(this.form).then(response => {
              this.msgSuccess("操作成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
      /** 删除按钮操作 */
      handleDelete(row) {
        const orderIds = row.orderId || this.ids;
        this.$confirm('是否确认删除工单基础信息编号为"' + orderIds + '"的数据项?', "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(function() {
            return delBasicsInfo(orderIds);
          }).then(() => {
            this.getList();
            this.msgSuccess("删除成功");
          }).catch(() => {});
      },
      /** 导出按钮操作 */
      handleExport() {
        const queryParams = this.queryParams;
        this.$confirm('是否确认导出所有工单基础信息数据项?', "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            this.exportLoading = true;
            return exportBasicsInfo(queryParams);
          }).then(response => {
            this.download(response.msg);
            this.exportLoading = false;
          }).catch(() => {});
      }
    }
  }
  </script>
  <style>
    .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 {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  li{
    font-size: 15px;
    font-weight: 900;
  }
  </style>