xieqy il y a 3 ans
Parent
commit
d72bf1f0fa

+ 1 - 0
src/store/modules/bigScreen.ts

@@ -7,6 +7,7 @@ const groupPageInfo = () => {
     groupProject: [],
     groupName: null,
     groupCodeValue: null,
+    isShowGroupPage: false,
     //头部
     projectTreeData: null,
     currentMenuItem: null,//下拉切换

+ 14 - 16
src/views/groupPage/baseMap/components/EchartsMap.vue

@@ -42,7 +42,9 @@ export default {
       clickPermissions: false,
 
       //防抖
-      timeout: null
+      timeout: null,
+      //标题栏组件引用
+      headerComp: null
     }
   },
   computed: {
@@ -488,8 +490,8 @@ export default {
             })
           }
         })
-        this.clickSymbol = 0
-        this.isSilent = false
+        this.clickSymbol = 1
+        this.isSilent = true
         this.mapDistance = 320
         this.mapBoxWidth = 550
         this.offset = 40
@@ -747,7 +749,8 @@ export default {
       }
       //地图点击事件
       if (this.clickSymbol == 0) {
-        this.chartRegionClickEvent()
+        // this.chartRegionClickEvent()
+        this.chartProjectClickEvent()
       } else {
         this.chartProjectClickEvent()
       }
@@ -780,18 +783,13 @@ export default {
       this.groupChart.off('click') //清除原有的点击事件
       this.groupChart.on('click', 'series.scatter3D', function (e) {
         if (e.value == null) return
-        let changeData = {
-          prjId: e.data.datas.projectId,
-          projectName: e.data.datas.projectName,
-          unitSymbol: e.data.datas.projectId,
-          pidSymbol: '2',
-          showName: '环保集团' + '/' + e.data.datas.region + '/' + e.data.datas.projectName
-        }
-        that.$emit('changeProjectData', changeData)
-        if (that.userBindInfo[0].groupName != '环保集团') {
-          that.backShow = true
-          that.clickPermissions = true
-        }
+        that.debounce(() => {
+          that.$store.state.bigScreen.currentMenuItem = {
+            name: e.name.split('项目')[0],
+            value: 'HB06',
+            pid: 2
+          }
+        }, 600)
       })
     },
     //返回至初始

+ 1 - 0
src/views/groupPage/districtPageModules/pipeUnitInfo/index.vue

@@ -19,6 +19,7 @@
           <el-tab-pane label="质量" name="quality"><Quality ref="qualityPanel" /></el-tab-pane>
           <el-tab-pane label="合同材料" name="contract"><Contract ref="contractPanel" /></el-tab-pane>
           <el-tab-pane label="图纸档案" name="document"><Dcouments ref="dcoumentPanel" /></el-tab-pane>
+          <el-tab-pane label="安全" name="security"></el-tab-pane>
         </el-tabs>
       </div>
     </div>

+ 17 - 11
src/views/groupPage/header/header.vue

@@ -14,7 +14,7 @@
               <div class="caption">{{ title }}</div>
               <div class="splitLine"></div>
               <el-select
-                ref="stlectTree"
+                ref="select"
                 v-model="treeSelectText"
                 placeholder=""
                 :popper-append-to-body="false"
@@ -30,7 +30,7 @@
                     :props="defaultProps"
                     :expand-on-click-node="false"
                     default-expand-all=""
-                    node-key="pbsTree"
+                    node-key="name"
                     highlight-current
                     @node-click="nodeClick"
                     ref="tree"
@@ -83,10 +83,7 @@ export default {
       operationName: null,
       //
       treeSelectText: '三峡发展',
-      treeValue: {
-        value: null,
-        label: null
-      },
+      treeValue: {},
       defaultProps: {
         children: 'children',
         label: 'name'
@@ -143,30 +140,39 @@ export default {
     //项目切换
     switchingItems(val) {
       const { label, value, pid } = val
+      this.treeSelectText = label
       if (pid == 2) {
         this.getUserActiveModule()
-        this.$parent.showGroupPage = false
-        this.$parent.showDistrictPage = true
+        this.$store.state.bigScreen.isShowGroupPage = false
         this.$store.state.bigScreen.currentProjectCode = value
       } else {
         this.menuList = []
         this.$store.state.bigScreen.groupName = label
         this.$store.state.bigScreen.groupCodeValue = value
-        this.$parent.showGroupPage = true
-        this.$parent.showDistrictPage = false
+        this.$store.state.bigScreen.isShowGroupPage = true
       }
     },
     // 点击tree节点
     nodeClick(item) {
       this.setTreeValue(item)
-      this.$refs.stlectTree.blur()
+      this.$refs.select.blur()
+    },
+    flatten(data) {
+      return [].concat(...data.map((item) => [].concat(item, ...this.flatten(item.children))))
     },
     setTreeValue(item) {
       const { name, value, pid } = item
+      if (!this.flatten(this.treeDatas).find((e) => e.name == name)) {
+        this.$message.info('暂无此项目信息')
+        return
+      }
       this.$set(this.treeValue, 'value', value)
       this.$set(this.treeValue, 'label', name)
       this.$set(this.treeValue, 'pid', pid)
       this.treeSelectText = name
+      this.$nextTick(() => {
+        this.$refs.tree.setCurrentKey(name)
+      })
     },
     //获取用户激活模块
     getUserActiveModule() {

+ 18 - 11
src/views/groupPage/index.vue

@@ -7,7 +7,7 @@
     <!--集团、分公司级页面模块-->
     <GroupPageModules :show="showGroupPage" />
     <!--项目级页面模块-->
-    <DistrictPageModules :show="showDistrictPage" />
+    <DistrictPageModules :show="!showGroupPage" />
   </div>
 </template>
 
@@ -30,10 +30,13 @@ export default {
     GroupPageModules,
     DistrictPageModules
   },
+  computed: {
+    showGroupPage() {
+      return this.$store.state.bigScreen.isShowGroupPage
+    }
+  },
   data() {
     return {
-      showGroupPage: false,
-      showDistrictPage: false,
       flexibleObject: null,
       //角色
       roc: Symbol('公司级用户'),
@@ -55,16 +58,17 @@ export default {
           // console.log(res.result.records[0].roleName)
           let roleArr = res.result.records[0].roleName.split(',')
           if (!roleArr.includes(this.roc.description) && !roleArr.includes(this.robc.description)) {
-            this.showDistrictPage = true
+            this.$store.state.bigScreen.isShowGroupPage = false
             this.$store.dispatch('bigScreen/setProjectTreeData', [
               {
                 name: '宜昌两网二期',
                 value: 'HB06',
-                pid: 2
+                pid: 2,
+                children: []
               }
             ])
           } else {
-            this.showGroupPage = true
+            this.$store.state.bigScreen.isShowGroupPage = true
             this.$store.dispatch('bigScreen/setProjectTreeData', [
               {
                 name: '三峡发展',
@@ -79,7 +83,8 @@ export default {
                       {
                         name: '宜昌两网二期',
                         value: 'HB06',
-                        pid: 2
+                        pid: 2,
+                        children: []
                       }
                     ]
                   }
@@ -88,7 +93,7 @@ export default {
             ])
           }
           if (roleArr.includes(this.roc.description) && !roleArr.includes(this.robc.description)) {
-            this.showGroupPage = true
+            this.$store.state.bigScreen.isShowGroupPage = true
             this.$store.dispatch('bigScreen/setProjectTreeData', [
               {
                 name: '三峡发展',
@@ -98,14 +103,15 @@ export default {
                   {
                     name: '宜昌两网二期',
                     value: 'HB06',
-                    pid: 2
+                    pid: 2,
+                    children: []
                   }
                 ]
               }
             ])
           }
           if (!roleArr.includes(this.roc.description) && roleArr.includes(this.robc.description)) {
-            this.showGroupPage = true
+            this.$store.state.bigScreen.isShowGroupPage = true
             this.$store.dispatch('bigScreen/setProjectTreeData', [
               {
                 name: '三峡分公司',
@@ -115,7 +121,8 @@ export default {
                   {
                     name: '宜昌两网二期',
                     value: 'HB06',
-                    pid: 2
+                    pid: 2,
+                    children: []
                   }
                 ]
               }