Explorar el Código

疑点审计修改

Bella hace 2 años
padre
commit
f3d5519457

+ 132 - 37
src/components/common/BottomMenus.vue

@@ -1,17 +1,35 @@
 <template>
   <div id="bottomMenus">
     <!-- 底部菜单动态SVG底座 -->
-    <BottomMenuSvg id="svgBox" @changeShowBottomMenusStatus="changeShowBottomMenusStatus()" />
+    <BottomMenuSvg
+      id="svgBox"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus()"
+    />
     <!-- 申请任务弹窗 -->
-    <CreateTaskForm ref="sqrw" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
+    <CreateTaskForm
+      ref="sqrw"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
+    />
     <!-- 我的任务弹窗 -->
-    <MyMission ref="wdrw" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
+    <MyMission
+      ref="wdrw"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
+    />
     <!-- 同屏对比弹窗 -->
-    <SameScreenComparison ref="tpdb" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
+    <SameScreenComparison
+      ref="tpdb"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
+    />
     <!-- 上传数据弹窗 -->
-    <UploadingData ref="scsj" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
+    <UploadingData
+      ref="scsj"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
+    />
     <!-- 报告输出弹窗 -->
-    <ReportOutput ref="ReportOutput" @changeShowBottomMenusStatus="changeShowBottomMenusStatus" />
+    <ReportOutput
+      ref="ReportOutput"
+      @changeShowBottomMenusStatus="changeShowBottomMenusStatus"
+    />
     <!-- 自定义模型 -->
     <CustomModelDialog />
     <!-- 底部菜单主体 -->
@@ -20,7 +38,7 @@
       :style="{
         width: showBottomMenusStatus ? '981px' : '0px',
         height: showBottomMenusStatus ? '200px' : '0px',
-        border: showBottomMenusStatus ? '1px solid #00aaff' : 'none'
+        border: showBottomMenusStatus ? '1px solid #00aaff' : 'none',
       }"
     >
       <!-- 模块遍历渲染也是menus对象的第一层数组 -->
@@ -37,16 +55,27 @@
           <!-- 遍历渲染每个模块下的子菜单,也是menus数组中subMenu数组 -->
           <div
             class="colBtuMenu"
+            :style="{ cursor: subItem.isForbidden ? 'not-allowed' : 'pointer' }"
             @click="changeBottomMenu(item.index, subItem)"
             v-for="(subItem, subIndex) in item.subMenu"
             :key="subIndex"
           >
             <!-- 选中状态的背景高亮(舍弃) -->
-            <div :class="ifMenuIndex(item.index, subItem) ? 'colBtuMenuShadow' : ''"></div>
+            <div
+              :class="
+                ifMenuIndex(item.index, subItem) ? 'colBtuMenuShadow' : ''
+              "
+            ></div>
 
             <!-- 子菜单图标的选择性渲染 -->
-            <el-image class="BtuMenu_hover" :src="returnBgImage(subItem.bgImage + '-a')"></el-image>
-            <el-image class="BtuMenu" :src="returnBgImage(subItem.bgImage)"></el-image>
+            <el-image
+              class="BtuMenu_hover"
+              :src="returnBgImage(subItem.bgImage + '-a')"
+            ></el-image>
+            <el-image
+              class="BtuMenu"
+              :src="returnBgImage(subItem.bgImage)"
+            ></el-image>
             <!-- 子菜单标题 -->
             <div class="BtuMenu_title">
               {{ subItem.title }}
@@ -80,7 +109,7 @@ export default {
     SameScreenComparison,
     UploadingData,
     CustomModelDialog,
-    ReportOutput
+    ReportOutput,
   },
   data() {
     return {
@@ -96,8 +125,8 @@ export default {
           title: "任务申请",
           subMenu: [
             { index: 0, title: "申请任务", bgImage: "sqrw", clickRef: "sqrw" },
-            { index: 1, title: "我的任务", bgImage: "wdrw", clickRef: "wdrw" }
-          ]
+            { index: 1, title: "我的任务", bgImage: "wdrw", clickRef: "wdrw" },
+          ],
         },
         {
           index: 1,
@@ -108,44 +137,68 @@ export default {
               index: 0,
               title: "疑点审计",
               bgImage: "ydsj",
-              clickEmit: "caseAuditEvent"
+              clickEmit: "caseAuditEvent",
+              isForbidden: false,
             },
             {
               index: 1,
               title: "标记疑点",
-              bgImage: "bjyd"
+              bgImage: "bjyd",
+              isForbidden: false,
               // clickEmit: "labelCaseEvent"
             },
-            { index: 2, title: "同屏对比", bgImage: "tpdb", clickRef: "tpdb" },
+            {
+              index: 2,
+              title: "同屏对比",
+              bgImage: "tpdb",
+              clickRef: "tpdb",
+              isForbidden: false,
+            },
             {
               index: 3,
               title: "卷帘对比",
               bgImage: "jldb",
               clickEmit: "JLControl",
-              stateKey: "jlActiveState"
+              stateKey: "jlActiveState",
+              isForbidden: false,
             },
-            { index: 4, title: "上传数据", bgImage: "scsj", clickRef: "scsj"},
+            { index: 4, title: "上传数据", bgImage: "scsj", clickRef: "scsj" },
             {
               index: 5,
               title: "自定义模型",
               bgImage: "zdymx",
-              clickEmit: "customModelEvent"
-            }
-          ]
+              clickEmit: "customModelEvent",
+              isForbidden: false,
+            },
+          ],
         },
         {
           index: 2,
           width: "94px",
           title: "疑点报告",
-          subMenu: [{ index: 0, title: "报告输出", bgImage: "bgsc", clickRef: "ReportOutput" }]
+          subMenu: [
+            {
+              index: 0,
+              title: "报告输出",
+              bgImage: "bgsc",
+              clickRef: "ReportOutput",
+            },
+          ],
         },
         {
           index: 3,
           width: "94px",
           title: "现场勘查",
-          subMenu: [{ index: 0, title: "发到手机", bgImage: "fdsj", clickEmit: "notFound" }]
-        }
-      ]
+          subMenu: [
+            {
+              index: 0,
+              title: "发到手机",
+              bgImage: "fdsj",
+              clickEmit: "notFound",
+            },
+          ],
+        },
+      ],
     };
   },
   mounted() {
@@ -168,7 +221,8 @@ export default {
       } else if (index == 1) {
         if (subItem.index === 0 || subItem.index === 1) {
           return (
-            this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subItem.index
+            this.$store.state.bottomMenuIndexs.index == index &&
+            this.$store.state.bottomMenuIndexs.subIndex == subItem.index
           );
         }
       }
@@ -177,25 +231,47 @@ export default {
     changeBottomMenu(index, item) {
       // 该逻辑可能会舍弃
       if (item.stateKey != undefined) {
-        this.$store.commit("changeJlActiveState", !this.$store.state[item.stateKey]);
+        this.$store.commit(
+          "changeJlActiveState",
+          !this.$store.state[item.stateKey]
+        );
       } else {
-        this.$store.commit("changeBottomMenu", {
-          index: index,
-          subIndex: item.index
-        });
+        // 疑点审计按钮禁止点击事件
+        if (item.title === "疑点审计") {
+          if (!item.isForbidden) {
+            this.$store.commit("changeBottomMenu", {
+              index: index,
+              subIndex: item.index,
+            });
+          }
+          if(item.isForbidden){
+            this.$message.info("仅支持开启一个预设模型图层!")
+          }
+        } else {
+          this.$store.commit("changeBottomMenu", {
+            index: index,
+            subIndex: item.index,
+          });
+        }
       }
-      if (item.clickEmit) {
+      if (item.clickEmit && !item.isForbidden) {
         // 调用全局事件总线中的指定事件
         this.$bus.$emit(item.clickEmit);
       }
-      if ((item.clickEmit ? item.clickEmit != "notFound" : true) && item.clickRef) {
+      if (
+        (item.clickEmit ? item.clickEmit != "notFound" : true) &&
+        item.clickRef
+      ) {
         // 调用全局事件总线中的指定事件
         this.$refs[item.clickRef].changeShowBottomMenusStatus();
       }
     },
     // 根据菜单参数bgImage,菜单父级index和子菜单index,判断全局变量已选中底部菜单的index对比,返回不同状态下的icon图标地址。
     returnBgImage(bgImage, index, subIndex) {
-      if (this.$store.state.bottomMenuIndexs.index == index && this.$store.state.bottomMenuIndexs.subIndex == subIndex) {
+      if (
+        this.$store.state.bottomMenuIndexs.index == index &&
+        this.$store.state.bottomMenuIndexs.subIndex == subIndex
+      ) {
         return "/static/images/bottomMenuIcon/" + bgImage + "-a.png";
       } else {
         return "/static/images/bottomMenuIcon/" + bgImage + ".png";
@@ -213,9 +289,23 @@ export default {
         // 否则直接切换底部菜单显示隐藏状态
         this.showBottomMenusStatus = !this.showBottomMenusStatus;
       }
-    }
+    },
+  },
+  watch: {
+    "$store.state.preModelLayerMap": {
+      handler(val) {
+        console.log(val);
+        if (val.length === 1) {
+          console.log("当前打开了一个预设模型图层");
+          this.menus[1].subMenu[0].isForbidden = false;
+        }
+        if (val.length > 1) {
+          console.log("当前不允许开启预设模型图层");
+          this.menus[1].subMenu[0].isForbidden = true;
+        }
+      },
+    },
   },
-  watch: {}
 };
 </script>
 
@@ -303,7 +393,12 @@ export default {
       display: flex;
       justify-content: center;
       align-items: center;
-      background-image: linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
+      background-image: linear-gradient(
+        to left,
+        @topTitleMinLeft,
+        @borderColor,
+        @topTitleMinLeft
+      );
       font-size: 16px;
       font-family: pingfangSC;
       font-weight: 300;

+ 2 - 1
src/components/map/MapHolder.vue

@@ -490,7 +490,8 @@ export default {
     },
     // 疑点审计
     caseAuditEvent() {
-      // 每次点击按钮后重绘弹窗
+      console.log("当前预设模型图层数");
+
       if (this.currentHtml && this.currentCid) {
         setTimeout(() => {
           this.popup.setContent(

+ 1 - 0
src/components/popup/CaseAuditPopup.vue

@@ -98,6 +98,7 @@ export default {
   },
   watch: {
     getPopupStatus(val) {
+
       if (val.index === 1 && val.subIndex === 0) {
         this.status = "special";
       }

+ 5 - 0
src/store/index.js

@@ -50,6 +50,7 @@ export default new Vuex.Store({
     homeSpecialTown: "全部",
     // 全局类型变量
     selectSelectDataMap: {},
+    preModelLayerMap: [],
   },
   getters: {
     customModelsArr: (state) => state.customModelsArr,
@@ -113,6 +114,10 @@ export default new Vuex.Store({
     changeTreeData: (state, option) => {
       state.treeDataCollection.set(option.name, option.value);
     },
+    // 预设模型图层组
+    changePreModelData: (state, data) => {
+      state.preModelLayerMap = data
+    },
   },
   actions: {},
   modules: {},

+ 114 - 3
src/views/ComprehensiveAnalysis.vue

@@ -178,7 +178,6 @@
                   v-if="
                     node.data.mainType === '所有图层' ||
                     node.data.mainType === '我的模型' ||
-                    node.data.mainType === '预设模型' ||
                     node.data.mainType === '疑点问题' ||
                     node.data.mainType === '我的图层'
                   "
@@ -225,6 +224,33 @@
                     </span>
                   </el-checkbox>
                 </template>
+                <template v-else-if="node.data.mainType === '预设模型'">
+                  <el-checkbox
+                    v-model="node.checked"
+                    :disabled="node.data.disabled"
+                    style="position: relative; width: 100%"
+                  >
+                    <el-tooltip
+                      class="item"
+                      effect="light"
+                      :content="node.label"
+                      placement="top-start"
+                    >
+                      <div class="custom-tree-node-item">
+                        {{ node.label }}
+                      </div>
+                    </el-tooltip>
+                    <span
+                      ><el-button
+                        size="normal"
+                        type="text"
+                        icon="el-icon-location"
+                        @click="locateEvent(node)"
+                        style="position: absolute; right: -30px; top: -12px"
+                      ></el-button
+                    ></span>
+                  </el-checkbox>
+                </template>
                 <template v-else>
                   <div
                     :class="{
@@ -514,11 +540,18 @@ export default {
     };
   },
   computed: {
-    // 监听底部菜单栏的状态 -- 监听卷帘对比状态
+    // 监听卷帘对比状态
     getJLStatus() {
+      return this.$store.state.jlActiveState;
+    },
+    // 监听底部菜单栏状态 -- 仅针对疑点审计
+    getAuditBtnStatus() {
       let _index = this.$store.state.bottomMenuIndexs.index;
       let _subIndex = this.$store.state.bottomMenuIndexs.subIndex;
-      return this.$store.state.jlActiveState;
+      return {
+        index: _index,
+        subIndex: _subIndex,
+      };
     },
     getCustomModel() {
       return this.$store.state.customModelsArr;
@@ -579,6 +612,72 @@ export default {
         }
       }
     },
+    "$store.state.preModelLayerMap.length": {
+      handler(val) {
+        // debugger;
+        // console.log(this.$store.state.preModelLayerMap, "preModelLayerMap");
+        console.log(this.$store.state.bottomMenuIndexs.index, "index");
+        console.log(this.$store.state.bottomMenuIndexs.subIndex, "subIndex");
+        // if (val === 1) {
+        //   if (
+        //     this.$store.state.bottomMenuIndexs.index === 1 &&
+        //     this.$store.state.bottomMenuIndexs.subIndex === 0
+        //   ) {
+        //     console.log("预设模型其他按钮都禁选");
+        //     this.$refs.tree.data.map((item1) => {
+        //       if (item1.label === "预设模型") {
+        //         let changeData = item1.children;
+        //         if (changeData.length > 0) {
+        //           changeData = changeData.map((item2) => {
+        //             return {
+        //               id: item2.id,
+        //               label: item2.label,
+        //               children:
+        //                 !item2.children || item2.children.length === 0
+        //                   ? []
+        //                   : item2.children.map((item3) => {
+        //                       if (!this.$store.state.preModelLayerMap.includes(item3.id)) {
+        //                         return {
+        //                           id: item3.id,
+        //                           label: item3.label,
+        //                           sourceType: item3.sourceType,
+        //                           columnId: item3.columnId,
+        //                           mainType: item3.mainType,
+        //                           children: [],
+        //                           disabled: true,
+        //                         };
+        //                       } else {
+        //                         return {
+        //                           id: item3.id,
+        //                           label: item3.label,
+        //                           sourceType: item3.sourceType,
+        //                           columnId: item3.columnId,
+        //                           mainType: item3.mainType,
+        //                           children: [],
+        //                           disabled: false,
+        //                         };
+        //                       }
+        //                     }),
+        //             };
+        //           });
+
+        //           // this.$refs.tree.updateKeyChildren(
+        //           //   this.firstLevelIdMap.get("预设模型").id,
+        //           //   changeData
+        //           // );
+
+        //           // this.expandedKeys.push(
+        //           //   this.firstLevelIdMap.get("预设模型").id
+        //           // );
+        //         }
+        //       }
+        //     });
+
+        //     console.log(this.$refs.tree);
+        //   }
+        // }
+      },
+    },
     "$store.state.navSelect": {
       handler(val, oldVal) {
         if (
@@ -1305,6 +1404,7 @@ export default {
                                     mainType: item1.title,
                                     columnId: item3.id,
                                     children: [],
+                                    disabled: false,
                                   };
                                 }),
                         };
@@ -1680,6 +1780,7 @@ export default {
           // 第一级菜单是预设模型
           if (data.mainType === "预设模型") {
             layerAuthorityMap.set(data.id, "有权限");
+            this.$store.state.preModelLayerMap.push(data.id);
             this.rightPanelTitle = data.id;
             this.displaySingleLayer(
               data.columnId,
@@ -1727,6 +1828,16 @@ export default {
             }
           }
 
+          if (
+            data.mainType === "预设模型" &&
+            this.$store.state.preModelLayerMap.includes(data.id)
+          ) {
+            this.$store.state.preModelLayerMap.splice(
+              this.$store.state.preModelLayerMap.indexOf(data.id),
+              1
+            );
+          }
+
           // 统计后小于0改为0
           if (this.currentTotal < 0) {
             this.currentTotal = 0;