Browse Source

默认选中专业

xiebeibei 4 years ago
parent
commit
c01c378a7b
3 changed files with 46 additions and 12 deletions
  1. 28 2
      src/components/edit/attr_select.vue
  2. 14 6
      src/components/edit/edit-dialog.vue
  3. 4 4
      src/views/drafts.vue

+ 28 - 2
src/components/edit/attr_select.vue

@@ -300,7 +300,7 @@
         </a-collapse-panel>
       </a-collapse>
     </div>
-    <editDialog ref="dialog" :attrCards="attrCards" :sysNum="imageNum" :key="new Date().getTime()" />
+    <editDialog ref="dialog" :attrCards="attrCards" :getmajorId="getmajorId"  :sysNum="imageNum" :key="new Date().getTime()" />
     <!--    <editDialog ref="dialog" :typeEdit="2" :getmajorId="'1001'" :sysNum="5" />-->
   </div>
 </template>
@@ -511,13 +511,39 @@ export default {
       console.log('------------')
       console.log(FENGMAP)
       const Item = newval.itemList[0];
-      this.getmajorId = Item.data.Properties.InfoSystemId;
       this.imageNum = 1; //切换item初始化
       if (Item.data && Item.data.SubType) {
         this.SubType = Item.data.SubType;
       } else {
         this.SubType = "";
       }
+      this.getmajorId = Item.data.Properties.InfoSystemId;
+      //判断点 面 带回专业类
+      // let InfoTypeIdArr = [];
+      // if( Item.data.Properties.InfoTypeId.length){
+      //   let InfoTypeId = Item.data.Properties.InfoTypeId;
+      //   console.log('poiList',11111111111111,FENGMAP.poiList);
+      //   console.log('spaceType',2222222222222222,FENGMAP.spaceType);
+      //   if(FENGMAP.poiList.length){
+      //     FENGMAP.poiList.join(',').split(',').map((item,index)=>{
+      //       let n = InfoTypeId.includes(item)
+      //       if(n){
+      //         InfoTypeIdArr.push(item);
+      //       }
+      //     })
+      //   }else if(FENGMAP.spaceType.length){
+      //     FENGMAP.spaceType.join(',').split(',').map((item,index)=>{
+      //       let n = InfoTypeId.includes(item)
+      //       if(n){
+      //         InfoTypeIdArr.push(item);
+      //       }
+      //     })
+      //   }else{
+      //     this.getmajorId = '';
+      //   }
+      // }
+      // InfoTypeIdArr.length? this.getmajorId = InfoTypeIdArr[0]:this.getmajorId ='';
+      //结束
 
       if (newval.itemList.length == 1) {
         if (newval.itemType == "baseText") {

+ 14 - 6
src/components/edit/edit-dialog.vue

@@ -12,7 +12,7 @@
       <div class="left">
         <div class="header">
           <div class="select">
-            <a-select style="width: 236px;margin: 0 10px" >
+            <a-select style="width: 236px;margin: 0 10px"  :default-value="majorId">
               <a-select-opt-group>
                 <span slot="label">设备设施</span>
                 <a-select-option v-for="item in majorList" :value="item.id" @click="handleChange(item)">
@@ -87,7 +87,13 @@
         components: {searchTree},
       props:{
         sysNum:Number ,//设备总数
-        attrCards:Array
+        attrCards:Array,
+        getmajorId:String
+      },
+      computed:{
+        majorId(){
+          return this.getmajorId || ''
+        }
       },
         data() {
             return {
@@ -455,6 +461,11 @@
         },
         created() {
           this.floorId = getUrlMsg().FloorID;
+          //如果有专业就带过来
+          console.log(this.getmajorId);
+          if(this.getmajorId){
+            this.getQuerySmsxtBy(this.getmajorId,'Image')
+          }
           if(this.attrCards.length){
             this.attrCards.map(item=>{
               this.selectedRowKeys.push(item.location||item.assetnum)
@@ -465,10 +476,7 @@
             this.selectedRowKeys = [];
           }
           this.getQuerySmsxt();
-          // //如果有专业就带过来
-          // if(this.majorId){
-          //   this.getQuerySmsxtBy(this.majorId)
-          // }
+
           this.getPlazaFloor();
 
         }

+ 4 - 4
src/views/drafts.vue

@@ -89,6 +89,7 @@ import { uuid } from "@/components/mapClass/until";
 import { SImageItem } from "@saga-web/graph/lib";
 import store from "../store";
 import { Loading } from "element-ui";
+import {getUrlMsg}  from '@/components/urlMsg.js'
 let fengmap = null;
 export default {
   components: { Tree },
@@ -360,16 +361,15 @@ export default {
         projectId: this.projectId,
         flag: true,
         graphId: this.graphId,
-        pub: false
+        pub: false,
+        categoryId:getUrlMsg().categoryId
       }).then(res => {
         console.log(res);
         this.legendLoading = false;
         if (res.data.Result == "success") {
           const data = res.data.Data;
           data.map(item => {
-            if (item.RealNum == 0) {
-              this.legendData.push(item);
-            }
+            this.legendData.push(item);
           });
         } else {
           this.legendData = [];