YaolongHan 4 anni fa
parent
commit
d7021c7d81
2 ha cambiato i file con 63 aggiunte e 48 eliminazioni
  1. 5 1
      src/api/editer.js
  2. 58 47
      src/views/drafts.vue

+ 5 - 1
src/api/editer.js

@@ -63,10 +63,14 @@ export function queryWzfldl(data,params){
 
 // 查询图例统计信息
 export function queryStatistic(data,params){
-    return httputils.postJson(`${testApi}/graphElement/statistic/query`, params)
+    return httputils.fetchJson(`${testApi}/graphElement/statistic/query`,data, params)
 }
 
 // 草稿箱专业楼层结构查询
 export function queryDraftGroup(data,params){
     return httputils.getJson(`${testApi}/graph/draftGroup`,data, params)
+}
+// 草稿箱专业楼层结构查询
+export function deleteGraph(params){
+    return httputils.postJson(`${testApi}/graph/delete`, params)
 }

+ 58 - 47
src/views/drafts.vue

@@ -10,7 +10,7 @@
         <div class="conent-tit">
           <div class="tit-left">消防系统-4F</div>
           <div class="tit-right">
-            <a-button>删除</a-button>
+            <a-button @click="deleteBtn">删除</a-button>
             <a-button>发布</a-button>
             <a-button type="primary">编辑</a-button>
           </div>
@@ -38,14 +38,15 @@
             <div
               style="font-size:14px;color: #1F2429;padding-left: 12px;height: 40px;line-height: 40px"
             >可能需要补充的图例</div>
-            <a-table :columns="columns" :data-source="data" size="middle" :pagination="false">
-              <img
-                style="width:10px;heigth:10px"
-                slot="img"
-                slot-scope="text, record"
-                :src="require('@/assets/images/'+record.img+'.png')"
-              />
-              <template v-slot:state></template>
+            <a-table   v-loading='legendLoading' :columns="columns" rowKey="Id" :data-source="legendData" size="middle" :pagination="false">
+                <div slot="Url" slot-scope='text,record'>
+                  <img  v-if="record.Url" style=" width: 20px;height: 22px;"
+                       :src="'/serve/topology-wanda/Picture/query/'+ record.Url"
+                       alt
+                  />
+                  <span v-else>---</span>
+                </div>
+              <span></span>
             </a-table>
           </div>
         </div>
@@ -64,7 +65,8 @@ import {
   saveGroup,
   readGroup,
   queryDraftGroup,
-  queryStatistic
+  queryStatistic,
+  deleteGraph
 } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
@@ -79,33 +81,17 @@ export default {
       columns: [
         {
           title: "名称", // 列的名称
-          dataIndex: "name", // 列的标识
-          scopedSlots: { customRender: "name" }
+          dataIndex: "Name", // 列的标识
+          scopedSlots: { customRender: "Name" }
         },
         {
           title: "图例", // 列的名称
-          dataIndex: "img", // 列的标识
-          scopedSlots: { customRender: "img" }
+          dataIndex: "Url", // 列的标识
+          scopedSlots: { customRender: "Url" }
         }
       ],
-      data: [
-        {
-          key: "1",
-          name: "客梯",
-          img: "shubiao"
-        },
-        {
-          key: "2",
-          name: "防火分区",
-          img: "shubiao"
-        },
-        {
-          key: "3",
-          name: "消防泵室",
-          img: "shubiao"
-        }
-      ],
-      legend: false,
+      legendData: [],
+      legend: true,
       canvasWidth: 700,
       canvasHeight: 600,
       view: null,
@@ -118,16 +104,17 @@ export default {
         children: "Category",
         label: "Gcode"
       },
-      graphId: "",
       projectId: "", //项目id
-      fmapID: "" //蜂鸟地图id
+      fmapID: "", //蜂鸟地图id
+      graphId:'124aeab6fbb346cd92057525a30aee18',
+      legendLoading:false
     };
   },
   methods: {
     handleNodeClick(data) {
       console.log(data);
-      this.graphId = "124aeab6fbb346cd92057525a30aee18";
       this.getLegend();
+      console.log(queryPicture);
     },
     init() {
       // const loadings = this.$loading({type: 'global'});
@@ -206,24 +193,47 @@ export default {
         }
       }
     },
-    getTreeData() {
-      queryDraftGroup({ projectId: this.projectId }).then(res => {
+    getTreeData(){
+      queryDraftGroup({projectId:'1000423'}).then(res=>{
         console.log(res);
         if (res.Result == "success") {
           this.treeData = res.Data;
-        } else {
-          this.treeData = [];
-          this.$message.err("获取楼层结构失败");
+        }else{
+          this.treeData=[];
+          this.$message.error('获取楼层结构失败');
         }
       });
     },
-    getLegend() {
-      const data = {
-        projectId: this.projectId,
-        flag: true,
-        graphId: this.graphId
-      };
-      queryStatistic(data).then(res => {});
+    //获取补充图例
+    getLegend(){
+        this.legendLoading = true;
+      queryStatistic({
+        projectId:'1000423',
+        flag:true,
+        graphId:this.graphId,
+      }).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);
+            }
+          })
+        }else{
+          this.legendData=[];
+          this.$message.error('获取楼层结构补充图例失败');
+        }
+      })
+    },
+    //删除
+    deleteBtn(){
+      const  idList = [];
+      idList.push(this.graphId)
+      deleteGraph({idList:idList}).then(res =>{
+        console.log(res);
+      })
     }
   },
   mounted() {
@@ -331,6 +341,7 @@ export default {
           width: 200px;
           border-left: 1px solid #eff0f1;
           height: 100%;
+          overflow-y: scroll;
         }
         .legend-btn {
           position: absolute;