<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;"
            >返回</el-button>
            <div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
          </div>
        </div>


        <div style="width: 100%;height: 200px;">
          <!-- <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>
          </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;">
            <el-form-item label="处理状态:" prop="dealStatus">
              <font v-if="form.dealStatus == 1">不需要处理</font>
              <font v-if="form.dealStatus == 2">已处理完成</font>
              <font v-if="form.dealStatus == 3">未处理完成</font>
            </el-form-item>
          </el-form>
          
          
        </div>
        <el-divider></el-divider>

        <div style="width: 100%;height: 350px;padding: 10px;height: 300px;">
            <div style="width: 66.6%;float: left;height: 100%;">
                <el-table
                :data="tableData"
                style="width: 100%">
                <el-table-column
                    prop="date"
                    label="日期"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="地址">
                </el-table-column>
                </el-table>
                <el-table
                :data="tableData"
                style="width: 100%;margin-top: 20px;">
                <el-table-column
                    prop="date"
                    label="日期"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="地址">
                </el-table-column>
                </el-table>
                <el-table
                :data="tableData"
                style="width: 100%;margin-top: 20px;">
                <el-table-column
                    prop="date"
                    label="日期"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="address"
                    label="地址">
                </el-table-column>
                </el-table>
            </div>
          <div id="marbox" style="width: 33%;height: 304px; border: 1px solid rgb(218, 213, 213);float: right;">
            <div style="width: 100%;height: 100%" id="container"></div>
          </div>
        </div>

        <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>
        </div>


        <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>
        </div>
      </div>
        
    </div>
  </template>

  <script>

  import { listDeviceAlarm, getDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
  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";
  import echarts from 'echarts';
  import { addBasicsInfo } from "@/api/workOrder/basicsInfo";

export default {
    name: "DeviceAlarm",
    components: {
    },
    data() {
      return {
        tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          },],
        inspector: [],
         // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      rules:{},
      // 报警信息表格数据
      deviceAlarmList: [],
      // 报警类型字典
      typeOptions: [],
      // 设备级联
      options: [],

      props: {
        multiple: true,
        value: "id",
        label: "name",
        level: "level",
        children: "childList",
      },
      devices: null,
      // 巡检员列表
      inspector: [],
      alermId:'',
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceId: null,
        orderId: null,
        alarmType: null,
        alarmValue: null,
        startTime: null,
        endTime: null,
        dealStatus: null
      },
      // 表单参数
      form: { },
      };
    },
    
    created() {
      // 如果是跳转来的，则接受初始化参数
      // this.user_id = this.$route.query.id; //详细信息页接收参数
     
      this.alarmId = +this.$route.query.alarmId; 
      console.log("query",this.$route.query.alarmId)

      this.getList();
      this.getDicts("t_order_status").then(response => {
        this.typeOptions = response.data;
      });
      this.getDicts("t_order_type").then(response => {
        this.ordertypeOptions = response.data;
      });
      this.getDeviceAlarm();
    },
    mounted(){
      let gaoMap =  new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
      // this.getDeviceAlarm();
      this.initData();
      this.drawPieChart();
      this.main3();
      this.main4();
    },
    methods: {
      getInspectorList(){
        this.loading = true;
        inspectorList().then(response => {
          this.inspector = response.data;
          this.loading = false;
        });
        
      },
    //   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 } //是否在折线点上显示数字
              }
            }
          }
        ]
      });
	 
    },  
    
    // 点击按钮显示隐藏
      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() {
      this.loading = true;
      listDeviceAlarm(this.queryParams).then(response => {
        this.deviceAlarmList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getDeviceAlarm (){
      getDeviceAlarm(this.alarmId).then(response =>{
          this.form = response.data;
          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();
      getDeviceAlarm(res).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "工单信息归档";
      });
    },
      /** 修改按钮操作 */
      handleUpdate(res) {
      // this.reset();
      this.getInspectorList();
      getInspectorList(this.orderId).then(response => {
        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>
