Procházet zdrojové kódy

更新右侧的接口

xiebeibei před 4 roky
rodič
revize
c9811b5f44

+ 6 - 3
src/components/edit/attr_select.vue

@@ -512,10 +512,13 @@ export default {
           }
         }
       }
+      let  location =[];
+      Item.data.AttachObjectIds.map(item=>{
+        location.push(item.id)
+      })
      if(newval.itemType == 'Zone'){
-       const location = Item.location;
        this.spinning = true;
-       queryGlsmsLocation({plazaId: '1000423'},{location:'1890'}).then(res=>{
+       queryGlsmsLocation({plazaId: '1000423'},{location:location}).then(res=>{
          this.spinning = false;
          if(res.data.result =='success'){
            this.attrCards = res.data.data;
@@ -525,7 +528,7 @@ export default {
        })
      }else if(newval.itemType == 'Image'){
        this.spinning = true;
-       queryGlsmsAsset({plazaId: '1000423'},{assetnum:'21784'}).then(res=>{
+       queryGlsmsAsset({plazaId: '1000423'},{assetnum:location}).then(res=>{
          this.spinning = false;
          if(res.data.result =='success'){
            this.attrCards = res.data.data;

+ 16 - 11
src/components/edit/edit-dialog.vue

@@ -41,7 +41,7 @@
           <searchTree  @getTreeId="getTreeId" :treeData="treeData"/>
         </div>
         <div class="checkbox">
-          <a-table :pagination="false" row-key='id' :columns="typeEdit=='Image'?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
+          <a-table :pagination="false" row-key='location||assetnum' :columns="typeEdit=='Image'?columnsSys:columnsLocal" :data-source="tableData"  :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,onSelect:onSelect }" :scroll="{ y: 340 }"  :loading="loading"/>
           <a-pagination v-if="total>0" v-model="page" :total="total" show-less-items style="margin-left: auto;"  @change="handleTableChange"/>
         </div>
       </div>
@@ -148,7 +148,11 @@
                 setTimeout(() => {
                     this.visible = false;
                     this.loading = false;
-                  console.log(this.selectedRowKeys);
+                    let lists = [];
+                    this.selectList.map(item =>{
+                      lists.push({id:item.location||item.assetnum,name:item.wzjc||item.sbjc})
+                    })
+                  console.log(lists);
                 }, 3000);
             },
             handleCancel(e) {
@@ -245,6 +249,7 @@
           },
           // 中间表格勾选
           onSelectChange(selectedRowKeys,selectedRows) {
+            console.log(selectedRows);
             this.selectedRowKeys = selectedRowKeys;
               if(this.selectedRowKeys.length>this.sysNum){
                 this.selectedRowKeys.pop();
@@ -254,15 +259,15 @@
             selectedRows.map(item=>{
               this.selectList.push(item)
             })
-            let obj = {}
-
-            this.selectList = this.selectList.reduce (function(item,next){
-
-              obj[next.id] ? ' ' : obj[next.id]  = true && item.push(next)
-
-              return item;
-
-            },[])
+            // let obj = {}
+            //
+            // this.selectList = this.selectList.reduce (function(item,next){
+            //
+            //   obj[next.id] ? ' ' : obj[next.id]  = true && item.push(next)
+            //
+            //   return item;
+            //
+            // },[])
           },
           //右侧删除
           deleteItem(item,index){

+ 1 - 1
src/components/mapClass/EditScence.ts

@@ -239,7 +239,7 @@ export class EditScence extends SGraphScene {
     addPolygonItem(event: SMouseEvent): void {
         const SubType = this._legend.SubType ? this._legend.SubType : '';
         //获取信息工程化相关参数
-        const AttachObjectIds = this._legend.InfoTypeId ? this._legend.InfoTypeId : [];
+        const AttachObjectIds = this._legend.InfoLocal ? this._legend.InfoLocal : [];
         const LegendData: Legend = {
             ID: uuid(),
             Name: this._legend.Name,