dedsudiyu 11 months ago
parent
commit
f74c03dad5

+ 56 - 7
src/api/emergencyManagement/index.js

@@ -271,7 +271,7 @@ export function laboratoryBigViewGetBuildByBigView(query) {
     params: query
   })
 }
-//获取楼层布局数据
+//应急处置-获取楼层布局数据
 export function laboratoryBigViewGetFloorByBigView(query) {
   return request({
     url: '/laboratory/bigView/getFloorByBigView',
@@ -279,7 +279,7 @@ export function laboratoryBigViewGetFloorByBigView(query) {
     params: query
   })
 }
-//获取楼层-智能物联设备列表
+//应急处置-获取楼层-智能物联设备列表
 export function iotBigViewStatisticsHardwareDeviceType(query) {
   return request({
     url: '/iot/bigView/statistics/hardwareDeviceType',
@@ -288,7 +288,7 @@ export function iotBigViewStatisticsHardwareDeviceType(query) {
   })
 }
 /*
-指定物联设备查询列表
+应急处置-指定物联设备查询列表
 typeKey:'camera'//摄像头
 楼层或实验室 floorId 楼层ID  subjectId  实验室ID
 */
@@ -299,7 +299,7 @@ export function iotBigViewDeviceList(data) {
     data: data
   })
 }
-//获取当前楼栋-楼层下的疏散数据
+//应急处置-获取当前楼栋-楼层下的疏散数据
 export function laboratoryExitLineGetRedisEvacuation(data) {
   return request({
     url: '/laboratory/exitLine/getRedisEvacuation',
@@ -307,7 +307,7 @@ export function laboratoryExitLineGetRedisEvacuation(data) {
     data: data
   })
 }
-//执行疏散
+//应急处置-执行疏散
 export function laboratoryExitLineExecuteEvacuation(data) {
   return request({
     url: '/laboratory/exitLine/executeEvacuation',
@@ -315,7 +315,7 @@ export function laboratoryExitLineExecuteEvacuation(data) {
     data: data
   })
 }
-//结束疏散
+//应急处置-结束疏散
 export function laboratoryExitLineEndEvacuation(data) {
   return request({
     url: '/laboratory/exitLine/endEvacuation',
@@ -323,7 +323,7 @@ export function laboratoryExitLineEndEvacuation(data) {
     data: data
   })
 }
-//查询-楼层/实验室人员
+//应急处置-查询楼层/实验室人员
 export function laboratoryBigViewOnLineUserList(data) {
   return request({
     url: '/laboratory/bigView/onLineUserList',
@@ -331,5 +331,54 @@ export function laboratoryBigViewOnLineUserList(data) {
     data: data
   })
 }
+//应急处置-查询实验室硬件列表
+export function iotBigViewHardwareFindByType(data) {
+  return request({
+    url: '/iot/bigView/hardware/findByType',
+    method: 'post',
+    data: data
+  })
+}
+//应急处置-查询实验室传感器列表
+export function iotBigViewDeviceFindBySubId(query) {
+  return request({
+    url: '/iot/bigView/device/findBySubId',
+    method: 'get',
+    params: query
+  })
+}
+//应急处置-查询实验室喇叭列表
+export function iotBigViewDeviceFindByType(data) {
+  return request({
+    url: '/iot/bigView/device/findByType',
+    method: 'post',
+    data: data
+  })
+}
+//应急处置-喇叭播放文本
+export function iotBigViewSpeakerPlayText(query) {
+  return request({
+    url: '/iot/bigView/speaker/playText',
+    method: 'get',
+    params: query
+  })
+}
+//应急处置-设备开关
+export function iotBigViewHardwareOperatingHardware(query) {
+  return request({
+    url: '/iot/bigView/hardware/operatingHardware',
+    method: 'get',
+    params: query
+  })
+}
+//应急处置-危险源列表
+export function laboratoryBigViewHazardCensus(data) {
+  return request({
+    url: '/laboratory/bigView/hazardCensus',
+    method: 'post',
+    data: data
+  })
+}
+
 
 

BIN
src/assets/ZDimages/emergencyManagement/img_znkz_bg.png


+ 28 - 17
src/views/emergencyManagement/performEvacuation/performEvacuation.vue

@@ -3,7 +3,7 @@
   <div class="performEvacuation scrollbar-box">
     <div style="position: relative">
       <perform-evacuation-home
-        v-if="pageType == 1"
+        v-if="pageType == 1" :propsBigData="propsBigData"
         style="transform: scale(0.822);position: absolute;top:50%;left:50%;margin-top:-95px;margin-left:-960px;">
       </perform-evacuation-home>
       <perform-evacuation-data
@@ -25,17 +25,26 @@
     data () {
       return {
         pageType:null,
-        propsBigData:null,
+        propsBigData:{
+          buildId:null,
+          floorId:null,
+        },
       }
     },
     created () {
-      if(this.$route.query.buildId){
+      if(this.$route.query.type == 2){
         this.$set(this,'propsBigData',{
           buildId:this.$route.query.buildId,
           floorId:this.$route.query.floorId,
         });
         this.$set(this,'pageType',2);
-      }else{
+      }else if(this.$route.query.type == 1){
+        this.$set(this,'propsBigData',{
+          buildId:this.$route.query.buildId,
+          floorId:this.$route.query.floorId,
+        });
+        this.$set(this,'pageType',1);
+      }else {
         this.$set(this,'pageType',1);
       }
     },
@@ -44,22 +53,24 @@
     },
     methods: {
       goPage(type,data){
+        if(this.$route.query.buildId){
+          delete this.$route.query.buildId;
+        }
+        if(this.$route.query.subId){
+          delete this.$route.query.subId;
+        }
+        if(this.$route.query.floorId){
+          delete this.$route.query.floorId;
+        }
+        if(this.$route.query.groupId){
+          delete this.$route.query.groupId;
+        }
         if(type == 1){
-          if(this.$route.query.buildId){
-            delete this.$route.query.buildId;
-          }
-          if(this.$route.query.subId){
-            delete this.$route.query.subId;
-          }
-          if(this.$route.query.floorId){
-            delete this.$route.query.floorId;
-          }
-          if(this.$route.query.groupId){
-            delete this.$route.query.groupId;
-          }
-          this.$set(this,'propsBigData',null);
+          //二级返回至一级
+          this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
           this.$set(this,'pageType',type);
         } else if(type == 2){
+          //一级跳转至二级
           this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
           this.$set(this,'pageType',type);
         }

+ 28 - 18
src/views/emergencyManagement/performEvacuation/performEvacuationBig.vue

@@ -1,7 +1,7 @@
 <!-- 应急疏散全屏 -->
 <template>
   <div class="performEvacuationBig">
-    <perform-evacuation-home v-if="pageType == 1"></perform-evacuation-home>
+    <perform-evacuation-home v-if="pageType == 1" :propsBigData="propsBigData"></perform-evacuation-home>
     <perform-evacuation-data v-if="pageType == 2" :propsBigData="propsBigData"></perform-evacuation-data>
   </div>
 </template>
@@ -17,19 +17,27 @@
     data () {
       return {
         pageType:null,
-        propsBigData:null,
+        propsBigData:{
+          buildId:null,
+          floorId:null,
+        },
       }
     },
     created () {
-      if(this.$route.query.buildId){
+      if(this.$route.query.type == 2){
         this.$set(this,'propsBigData',{
           buildId:this.$route.query.buildId,
           floorId:this.$route.query.floorId,
-          subId:this.$route.query.subId,
         });
         this.$set(this,'pageType',2);
-      }else{
+      }else if(this.$route.query.type == 1){
+        this.$set(this,'propsBigData',{
+          buildId:this.$route.query.buildId,
+          floorId:this.$route.query.floorId,
+        });
         this.$set(this,'pageType',1);
+      }else{
+
       }
     },
     mounted () {
@@ -37,22 +45,24 @@
     },
     methods: {
       goPage(type,data){
+        if(this.$route.query.buildId){
+          delete this.$route.query.buildId;
+        }
+        if(this.$route.query.subId){
+          delete this.$route.query.subId;
+        }
+        if(this.$route.query.floorId){
+          delete this.$route.query.floorId;
+        }
+        if(this.$route.query.groupId){
+          delete this.$route.query.groupId;
+        }
         if(type == 1){
-          if(this.$route.query.buildId){
-            delete this.$route.query.buildId;
-          }
-          if(this.$route.query.subId){
-            delete this.$route.query.subId;
-          }
-          if(this.$route.query.floorId){
-            delete this.$route.query.floorId;
-          }
-          if(this.$route.query.groupId){
-            delete this.$route.query.groupId;
-          }
-          this.$set(this,'propsBigData',null);
+          //二级返回至一级
+          this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
           this.$set(this,'pageType',type);
         } else if(type == 2){
+          //一级跳转至二级
           this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
           this.$set(this,'pageType',type);
         }

File diff suppressed because it is too large
+ 1056 - 92
src/views/emergencyManagement/performEvacuation/performEvacuationData.vue


+ 247 - 18
src/views/emergencyManagement/performEvacuation/performEvacuationHome.vue

@@ -141,14 +141,14 @@
               <p>智能物联</p>
             </div>
             <p class="content-position-monitor-num-p">总数:{{monitorNum}}</p>
-            <div class="content-monitor-for-box" :class="!monitorList[0]?'content-monitor-null-box':''">
+            <div class="content-monitor-for-box scrollbar-box" :class="!monitorList[0]?'content-monitor-null-box':''">
               <div class="monitor-for-box" v-for="(item,index) in monitorList" :key="index">
                 <div class="monitor-num-box">
                   <p class="monitor-num-p">{{item.count}}</p>
                   <div class="monitor-img-box">
                     <!--svg组件-->
                     <!--<svg-icon class="svg-img" icon-class="http://192.168.1.43/labSystem/admin/statics/statics/bigFile/2022020818/404.svg"/>-->
-                    <svg-icon class="svg-img" :icon-class="item.smallIcon"/>
+                    <svg-icon v-if="item.exceptionIcon" class="svg-img" :icon-class="item.exceptionIcon"/>
                   </div>
                 </div>
                 <p class="monitor-name-p">{{item.name}}</p>
@@ -165,8 +165,9 @@
               <img src="@/assets/ZDimages/emergencyManagement/icon_yygb_wxy.png">
               <p>危险源</p>
             </div>
-            <div class="content-danger-for-box" :class="!dangerList[0]?'content-danger-null-box':''">
-              <div class="null-box" v-if="!dangerList[0]">
+            <div class="content-danger-for-box" :class="!dangerList.nameList[0]?'content-danger-null-box':''">
+              <div class="danger-for-box" id="eCharts" v-show="dangerList.nameList[0]"></div>
+              <div class="null-box" v-if="!dangerList.nameList[0]">
                 <img class="null-img" src="@/assets/ZDimages/emergencyManagement/newImg/img_zhpt_zwzzsj.png">
                 <p class="null-p">暂无数据</p>
               </div>
@@ -206,7 +207,7 @@
   </div>
 </template>
 <script>
-  import { laboratoryBigViewGetBuildByBigView,laboratoryBigViewGetFloorByBigView,
+  import { laboratoryBigViewGetBuildByBigView,laboratoryBigViewGetFloorByBigView,laboratoryBigViewHazardCensus,
     iotBigViewStatisticsHardwareDeviceType,iotBigViewDeviceList,laboratoryBigViewOnLineUserList } from "@/api/emergencyManagement/index";
   import { laboratoryBigViewSelectTriggerInfo } from "@/api/commonality/permission";
   import mpegtsVideo from '@/components/mpegtsVideo/mpegtsVideo.vue'
@@ -215,6 +216,9 @@
     components: {
       mpegtsVideo,
     },
+    props:{
+      propsBigData:{},
+    },
     data () {
       return {
         //当前路由状态
@@ -233,7 +237,11 @@
         monitorList:[],
         monitorNum:0,
         //危险源
-        dangerList:[],
+        dangerList:{
+          nameList: [],
+          numList: [],
+          maxNumList: [],
+        },
         //视频数据
         videoQueryParams:{
           page:1,
@@ -260,6 +268,8 @@
       }else{
         this.$set(this,'routeType',false);
       }
+      this.$set(this,'buildId',this.propsBigData.buildId);
+      this.$set(this,'floorId',this.propsBigData.floorId);
     },
     mounted () {
       this.getBuild();
@@ -289,7 +299,7 @@
         //获取楼层-摄像头列表;
         this.iotBigViewDeviceList();
         //获取楼层-危险源统计;
-        //获取楼层-内实验室内人数;
+        this.laboratoryBigViewHazardCensus();
       },
       //切换楼层
       clickFloor(item,index){
@@ -300,18 +310,28 @@
       //楼栋数据选择
       buildingChange(){
         //获取楼层数据
-        this.getFloor();
+        this.getFloor(2);
       },
       //跳转
       goRoute(){
         if(this.routeType){
           this.$router.push({
-            path: "/emergencyManagement/performEvacuation"
+            path: "/emergencyManagement/performEvacuation",
+            query: {
+              buildId: this.buildId,
+              floorId:this.floorId,
+              type:1,
+            }
           })
           this.exitfull();
         }else{
           this.$router.push({
-            path: "/performEvacuationBig"
+            path: "/performEvacuationBig",
+            query: {
+              buildId: this.buildId,
+              floorId:this.floorId,
+              type:1,
+            }
           })
           this.fullScreen();
         }
@@ -321,20 +341,37 @@
         laboratoryBigViewGetBuildByBigView({type:2}).then(response => {
           if(response.data[0]){
             this.$set(this,'buildOptions',response.data);
-            this.$set(this,'buildId',response.data[0].id);
+            if(!this.buildId){
+              this.$set(this,'buildId',response.data[0].id);
+            }
             //获取楼层数据
-            this.getFloor();
+            this.getFloor(1);
           }
         })
       },
       //获取楼层数据
-      getFloor(){
+      getFloor(type){
+        let self = this;
         laboratoryBigViewGetBuildByBigView({id:this.buildId,type:3}).then(response => {
           //重置 楼层数据
           this.$set(this,'floorOptions',response.data);
-          this.$set(this,'floorId',response.data[0].id);
-          //重置 选中楼层
-          this.$set(this,'checkFloor',0);
+          if(type == 1){
+            if(self.floorId){
+              response.data.forEach((item,index)=>{
+                if(item.id == self.floorId){
+                  this.$set(this,'checkFloor',index);
+                }
+              })
+            }else{
+              this.$set(this,'floorId',response.data[0].id);
+              //重置 选中楼层
+              this.$set(this,'checkFloor',0);
+            }
+          }else if(type == 2){
+            this.$set(this,'floorId',response.data[0].id);
+            //重置 选中楼层
+            this.$set(this,'checkFloor',0);
+          }
           this.getFloorData();
         })
       },
@@ -526,6 +563,178 @@
           this.$set(this,'videoTotal',response.data.total);
         })
       },
+      //查询实验室危险源
+      laboratoryBigViewHazardCensus(){
+        laboratoryBigViewHazardCensus({floorId:this.floorId}).then(response => {
+          if(response.data[0]){
+            let obj = {
+              nameList: [],
+              numList: [],
+              maxNumList: [],
+            }
+            for(let i=0;i<response.data.length;i++){
+              obj.nameList.push(response.data[i].name)
+              obj.numList.push(response.data[i].percentage)
+              obj.maxNumList.push(100)
+            }
+            this.$set(this,'dangerList',obj);
+            this.eChartsFunction(this.dangerList);
+          }else{
+            let obj = {
+              nameList: [],
+              numList: [],
+              maxNumList: [],
+            }
+            this.$set(this,'dangerList',obj);
+            this.eChartsFunction(this.dangerList);
+          }
+        })
+      },
+      //eCharts表格
+      eChartsFunction(obj){
+        let self = this;
+        let myChart = this.$echarts.init(document.getElementById('eCharts'));
+        let option = {
+          backgroundColor: 'rgba(0,0,0,0)',
+          grid: {
+            left: '6%',
+            right: '4%',
+            bottom: '5%',
+            top: '10%',
+            containLabel: true,
+          },
+          legend: [{
+            show: false,
+          }],
+          xAxis: [
+            {
+              type: 'category',
+              data: obj.nameList,
+              axisLine: {
+                lineStyle: {
+                  color: 'rgba(5, 80, 93, 1)',
+                },
+              },
+              axisLabel: {
+                fontSize: 12,
+                // color: 'black',
+                color: '#fff',
+                fontFamily: 'DIN-Medium',
+                padding: [3, 0, 0, 0]
+              },
+
+              axisTick: {
+                show: false,
+              },
+            },
+            {
+              type: 'category',
+              data: obj.nameList,
+              show: false,
+            },],
+          yAxis: [{
+            type: 'value',
+            name: "",
+            nameTextStyle: {
+              fontSize: 14,
+              fontFamily: 'Source Han Sans CN',
+              fontWeight: '400',
+              color: 'rgba(255, 255, 255, 1)',
+              padding: [0, 75, -8, 0]
+            },
+            nameGap: 24,
+            axisLine: {
+              show: true,
+              lineStyle: {
+                color: 'rgba(5, 80, 93, 1)',
+              }
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine: {
+              show: false,
+              lineStyle: {
+                color: 'rgba(5, 80, 93, 1)',
+                type: "dashed",
+              },
+            },
+            alignTicks: true,
+            axisLabel: {
+              fontSize: 14,
+              color: 'rgba(255, 255, 255, 1)',
+              fontFamily: 'DIN-Medium',
+              padding: [0, 7, 0, 0]
+            },
+            splitArea: {
+              show: false,
+            },
+          }],
+          series: [
+            {
+              type: 'bar',
+              label: {
+                normal: {
+                  show: true,
+                  position: 'top',
+                  fontSize: 12,
+                  color: 'rgba(16, 213, 223, 1)',
+                  formatter: function (params) {
+                    return params.value + '%'
+                  },
+                  offset: [0, -10],
+                },
+              },
+              tooltip: {
+                show: false
+              },
+              barWidth: 14,
+              itemStyle: {
+                color: {
+                  type: 'linear',
+                  x: 0, x2: 0, y: 0, y2: 1,
+                  colorStops: [
+                    { offset: 0, color: '#00FCFC' },
+                    { offset: 1, color: '#016FCC' }
+                  ]
+                },
+              },
+              name: '',
+              data: obj.numList
+            },
+            {
+              // 分隔
+              type: 'pictorialBar',
+              itemStyle: {
+                normal: {
+                  color: 'rgba(3, 72, 84, 0.5)',
+                },
+              },
+              symbolRepeat: 'fixed',//重复
+              symbolMargin: 2,//上下间隔
+              symbol: 'rect',//图形类型
+              symbolClip: true,//是否裁剪
+              symbolSize: [20, 2],//图形的大小,可以用数组分开表示宽和高
+              symbolPosition: 'center',//图形的定位位置
+              symbolOffset: [0, 2],//图形相对于原本位置的偏移
+              data: obj.numList,
+              z: 0,
+              zlevel: 1,
+            },
+            {
+              type: 'bar',
+              barWidth: 40,
+              xAxisIndex: 1,
+              itemStyle: {
+                color: 'rgba(0, 0, 0, 0)'
+              },
+              name: '',
+              data: obj.maxNumList
+            },
+          ],
+        }
+        myChart.setOption(option);
+      },
       //计算布局最大尺寸
       calculateMapMax(list) {
         //基础参数
@@ -1042,6 +1251,7 @@
           .content-monitor-box{
             width:954px;
             position: relative;
+            overflow: hidden;
             .content-position-monitor-num-p{
               position: absolute;
               top:27px;
@@ -1055,12 +1265,12 @@
             .content-monitor-for-box{
               margin-left:33px;
               margin-top:20px;
-              width:860px;
+              width:870px;
               height:260px;
               position: relative;
               .monitor-for-box{
                 display: inline-block;
-                margin:15px 30px 0 0;
+                margin:14px 30px 0 0;
                 .monitor-num-box{
                   background: url("../../../assets/ZDimages/emergencyManagement/monitor/icon_znjc_bg.png");
                   background-size: 100%;
@@ -1122,6 +1332,21 @@
             .content-monitor-null-box{
               background-color: #021e30;
             }
+            //滚动条
+            .scrollbar-box::-webkit-scrollbar{
+              width: 6px!important;     /*高宽分别对应横竖滚动条的尺寸*/
+              height: 6px!important;
+            }
+            .scrollbar-box::-webkit-scrollbar-thumb{
+              border-radius: 5px!important;
+              -webkit-box-shadow: inset 0 0 5px #116e8e!important;
+              background: #116e8e!important;
+            }
+            .scrollbar-box::-webkit-scrollbar-track{
+              -webkit-box-shadow: inset 0 0 5px rgba(255,255,255,0)!important;
+              border-radius: 0!important;
+              background: rgba(255,255,255,0)!important;
+            }
           }
           .content-danger-box{
             width:539px;
@@ -1130,6 +1355,10 @@
               width:480px;
               height:260px;
               position: relative;
+              .danger-for-box{
+                width:480px;
+                height:260px;
+              }
               .null-box{
                 position: absolute;
                 left:50%;

+ 67 - 9
src/views/iotDevice/hardwareManagement/hardwareClassification/index.vue

@@ -127,6 +127,36 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="小图标:" prop="icon">
+          <el-upload
+            style="width:100px;"
+            class="iotClassification-dialog-upload"
+            :action="uploadImgUrl"
+            :show-file-list="false"
+            :on-success="(res)=>handleAvatarSuccess(res,'icon')"
+            :headers="headers"
+            :before-upload="(file)=>beforeAvatarUpload(file)">
+            <div class="center-img" style="margin-left:20px;">
+              <img v-if="dialogForm.icon" :src="dialogForm.icon" style="max-width:40px;max-height:40px;">
+              <p v-if="!dialogForm.icon" class="el-icon-upload" style="text-align: center;line-height:40px;font-size:30px;color:#0183FA;"></p>
+            </div>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="大图标:" prop="exceptionIcon">
+          <el-upload
+            style="width:100px;"
+            class="iotClassification-dialog-upload"
+            :action="uploadImgUrl"
+            :show-file-list="false"
+            :on-success="(res)=>handleAvatarSuccess(res,'exceptionIcon')"
+            :headers="headers"
+            :before-upload="(file)=>beforeAvatarUpload(file)">
+            <div class="center-img" style="margin-left:20px;">
+              <img v-if="dialogForm.exceptionIcon" :src="dialogForm.exceptionIcon" style="max-width:40px;max-height:40px;">
+              <p v-if="!dialogForm.exceptionIcon" class="el-icon-upload" style="text-align: center;line-height:40px;font-size:30px;color:#E65D6E;"></p>
+            </div>
+          </el-upload>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer dialog-footer-box">
         <p class="dialog-footer-button-null"></p>
@@ -139,15 +169,16 @@
   </div>
 </template>
 <script>
-import {
-  iotHardwareTypeAdd,
-  iotHardwareTypeUpdate,
-  iotHardwareTypeList,
-  iotHardwareTypeDelete,
-  iotHardwareTypeGetTypeKey,
-  iotTypeGetAllTypes
-} from '@/api/iotDevice/index'
-import infoPage from "./infoPage.vue"
+  import { getToken } from "@/utils/auth";
+  import {
+    iotHardwareTypeAdd,
+    iotHardwareTypeUpdate,
+    iotHardwareTypeList,
+    iotHardwareTypeDelete,
+    iotHardwareTypeGetTypeKey,
+    iotTypeGetAllTypes
+  } from '@/api/iotDevice/index'
+  import infoPage from "./infoPage.vue"
   export default {
     name: 'index',
     components: {
@@ -155,6 +186,11 @@ import infoPage from "./infoPage.vue"
     },
     data () {
       return {
+        //上传相关
+        uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
+        headers: {
+          Authorization:getToken(),
+        },
         tableButtonType:this.hasPermiDom(['iot:hardwareType:edit','iot:hardwareType:del',]),
         //页面状态
         pageType:1,
@@ -332,6 +368,8 @@ import infoPage from "./infoPage.vue"
           deviceTypeName:"",
           deviceTypeKey:"",
           state:"",
+          icon:"",
+          exceptionIcon:"",
         });
         this.$set(this,'dialogType',true);
       },
@@ -346,6 +384,8 @@ import infoPage from "./infoPage.vue"
               deviceTypeName:this.dialogForm.deviceTypeName,
               deviceTypeKey:this.dialogForm.deviceTypeKey,
               state:this.dialogForm.state,
+              icon:this.dialogForm.icon,
+              exceptionIcon:this.dialogForm.icon,
             }
             if(this.dialogForm.hardwareTypeId){
               obj.hardwareTypeId = this.dialogForm.hardwareTypeId;
@@ -364,6 +404,24 @@ import infoPage from "./infoPage.vue"
           }
         })
       },
+      //图片上传相关
+      handleAvatarSuccess(res,type) {
+        if(type == 'icon'){
+          this.$set(this.dialogForm,'icon',res.data.url);
+        }else if(type == 'exceptionIcon'){
+          this.$set(this.dialogForm,'exceptionIcon',res.data.url);
+        }
+      },
+      beforeAvatarUpload(file) {
+        return new Promise((resolve, reject) => {
+          if (file.type == 'image/svg+xml') {
+            resolve()
+          }else{
+            this.$message.error('只能上传svg格式图片');
+            reject();
+          }
+        })
+      },
     },
   }
 </script>

+ 2 - 3
src/views/iotDevice/intelligenceIot/iotClassification/attributePage.vue

@@ -148,7 +148,7 @@
                           resize="none" v-model="dialogForm.remark" show-word-limit :autosize="{ minRows: 2, maxRows: 2}"></el-input>
               </el-form-item>
               <div>
-                <el-form-item label="正常icon:" prop="icon">
+                <el-form-item label="小图标:" prop="icon">
                   <el-upload
                     style="width:100px;"
                     class="iotClassification-dialog-upload"
@@ -163,7 +163,7 @@
                     </div>
                   </el-upload>
                 </el-form-item>
-                <el-form-item label="异常icon:" prop="exceptionIcon">
+                <el-form-item label="大图标:" prop="exceptionIcon">
                   <el-upload
                     style="width:100px;"
                     class="iotClassification-dialog-upload"
@@ -618,7 +618,6 @@
         }
       },
       beforeAvatarUpload(file) {
-        console.log('file',file);
         return new Promise((resolve, reject) => {
           if (file.type == 'image/svg+xml') {
             resolve()