瀏覽代碼

Merge branch 'dev' of http://192.168.2.241:3000/wanghai/bimgis_sx into dev

zxh 3 年之前
父節點
當前提交
44a24bb586

+ 8 - 5
src/components/Base/index.ts

@@ -4,19 +4,22 @@ import Vue from 'vue'
 // import Dialog from '../Base/Dialog/index.vue'
 // import Title from '../Base/Title/index.vue'
 // import ImagePreview from '../Base/Dialog/ImagePreview.vue'
-
+import { upperFirst, camelCase } from 'lodash'
 // Vue.component('tf-page', Page)
 // Vue.component(`tf-table`, Table)
 // Vue.component(`tf-dialog`, Dialog)
 // Vue.component(`tf-title`, Title)
 // Vue.component(`tf-image-preview`, ImagePreview)
+const requireComponent = require.context('@/components/Base', true, /\.vue$/)
 
 export default {
-  install(vue: typeof Vue): void {
-    const requireComponent = require.context('@/components/Base', true, /\.vue$/)
+  install(): void {
     requireComponent.keys().forEach((fileName) => {
-      const Component = requireComponent(fileName)
-      vue.component(Component.default.name, Component.default)
+      const componentConfig = requireComponent(fileName)
+      const component = componentConfig.default || componentConfig
+      const componentName = upperFirst(camelCase(component.options.name))
+      console.log(componentName, component)
+      Vue.component(componentName, component)
     })
   }
 }

+ 3 - 3
src/main.ts

@@ -11,6 +11,9 @@ import 'element-ui/lib/theme-chalk/index.css'
 import '@/styles/index.scss'
 import './directives'
 
+import baseComponents from '@/components/Base'
+Vue.use(baseComponents)
+
 import App from './App.vue'
 import store from './store'
 import router from './router'
@@ -22,9 +25,6 @@ import '@/permission' // 权限控制
 import '@/assets/iconfont/iconfont.js'
 import '@/assets/iconfont/iconfont.css'
 
-import baseComponents from '@/components/Base'
-Vue.use(baseComponents)
-
 import Moment from 'vue-moment'
 //全局接口
 import PortApi from './api/APIs'

+ 10 - 5
src/store/modules/bigScreen.ts

@@ -1,6 +1,14 @@
 
 import { appconfig } from '@/config/bigScreenConfig'
 import { GetUserInitData } from '@/api/APIs'
+const groupPageInfo = () => {
+  return {
+    //集团、分公司信息
+    groupProject: [],
+    groupName: null,
+    groupCodeValue: null,
+  }
+}
 const getDefaultState = () => {
   return {
     //地图配置信息
@@ -8,11 +16,8 @@ const getDefaultState = () => {
     mapConfig: null,
     isInitViewer: false,//三维场景是否初始化
     mapContainerId: '',//地图容器Id
-    //集团、分公司信息
-    groupProject: [],
-    groupName: null,
-    groupCodeValue: null,
     //项目级信息
+    currentPrjId: 45,
     currentActive: null,//项目当前激活模块
     customToolList: [],//自定义工具激活集合
     currentTool: '',//当前激活工具
@@ -25,7 +30,7 @@ const getDefaultState = () => {
     currentStatisticalActive: null
   }
 }
-const state = getDefaultState()
+const state = { ...groupPageInfo(), ...getDefaultState() }
 //检查是否存在已有数据方法
 function some(arr, str) {
   const result = arr.some((item) => {

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

@@ -92,21 +92,17 @@ export default {
         })
       })
     },
-    debounce(fn, wait) {
-      if (this.timeout !== null) clearTimeout(this.timeout)
-      this.timeout = setTimeout(fn, wait)
-    },
     getData() {
+      if (this.timeout != null) return
       if (!this.$refs.middleMap) return
-      this.debounce(() => {
-        this.destroyChart()
-        // if(this.groupAttr!==true){
-        //     this.showWorkArea()
-        // }else{
-        //   this.composeScanInfo(this.groupInfoData)
-        // }
-        this.composeScanInfo(this.groupData)
-      }, 300)
+      this.destroyChart()
+      // if(this.groupAttr!==true){
+      //     this.showWorkArea()
+      // }else{
+      //   this.composeScanInfo(this.groupInfoData)
+      // }
+      this.composeScanInfo(this.groupData)
+      this.timeout = true
     },
     /**
      * 项目信息模块
@@ -528,9 +524,7 @@ export default {
       let domImg = document.createElement('img')
       domImg.crossOrigin = 'anonymous'
       domImg.src = require('@/views/groupPage/images/mapbj.png')
-      setTimeout(() => {
-        domImg.onload = mapInitialize()
-      }, 1000)
+
       function tooltipCustom(toolTipSource) {
         if (!toolTipSource) {
           return ''
@@ -720,6 +714,14 @@ export default {
         this.groupChart.setOption(option, {
           notMerge: true
         })
+        setTimeout(() => {
+          this.timeout = null
+        }, 300)
+      }
+      domImg.onload = () => {
+        setTimeout(() => {
+          mapInitialize()
+        }, 1000)
       }
       //地图点击事件
       if (this.clickSymbol == 0) {

+ 10 - 8
src/views/groupPage/components/BarChart/ComBarChart.vue

@@ -237,14 +237,16 @@ export default {
       this.creatChart(option, this.$refs.chart)
     },
     creatChart(option, ref) {
-      this.myChart = echarts.init(ref) //this.$refs.chart
-      this.myChart.setOption(option, { notMerge: true })
-      var autoHeight = option.yAxis[1].data.length * 50 + 100
-      this.myChart.getDom().style.height = autoHeight + 'px'
-      this.myChart.getDom().childNodes[0].style.height = autoHeight + 'px'
-      this.myChart.getDom().childNodes[0].childNodes[0].setAttribute('height', autoHeight)
-      this.myChart.getDom().childNodes[0].childNodes[0].style.height = autoHeight + 'px'
-      this.myChart.resize()
+      try {
+        this.myChart = echarts.init(ref) //this.$refs.chart
+        this.myChart.setOption(option, { notMerge: true })
+        var autoHeight = option.yAxis[1].data.length * 50 + 100
+        this.myChart.getDom().style.height = autoHeight + 'px'
+        this.myChart.getDom().childNodes[0].style.height = autoHeight + 'px'
+        this.myChart.getDom().childNodes[0].childNodes[0].setAttribute('height', autoHeight)
+        this.myChart.getDom().childNodes[0].childNodes[0].style.height = autoHeight + 'px'
+        this.myChart.resize()
+      } catch {}
     }
   },
   beforeDestroy() {

+ 0 - 8
src/views/groupPage/districtPageModules/commonModules/SearchBox.vue

@@ -26,11 +26,6 @@
           </el-select>
           <el-button slot="append" icon="el-icon-search" @click="searching()" :loading="isSearching"></el-button>
         </el-input>
-        <!-- <ComTreeList
-          :prjId="prjId"
-          style="position: absolute; top: 0; left: 0.46875rem; /* 90/192 */"
-          @changeProjectName="changeProjectName($event)"
-        /> -->
       </div>
       <transition
         appear
@@ -114,9 +109,6 @@ export default class SearchBox extends Vue {
     else target.style.setProperty('--left', '.10417rem')
   }
   viewer
-  get prjId() {
-    return 45
-  }
   get config() {
     return Config
   }

+ 7 - 7
src/views/groupPage/districtPageModules/commonModules/SectorToolbar.vue

@@ -513,8 +513,8 @@ export default class SectorToolbar extends Vue {
   font-family: Source Han Sans CN;
   .foldBtn {
     position: absolute;
-    width: 50px;
-    height: 50px;
+    width: 0.260417rem /* 50/192 */;
+    height: 0.260417rem /* 50/192 */;
     border-radius: 100% 0 0 0;
     background-color: rgba(126, 201, 255, 0.18);
     bottom: 0;
@@ -524,8 +524,8 @@ export default class SectorToolbar extends Vue {
       width: 0.125rem /* 24/192 */;
       object-fit: contain; //保持原有尺寸比例。内容被缩放。
       position: absolute;
-      bottom: 8px;
-      right: 8px;
+      bottom: 0.041667rem /* 8/192 */;
+      right: 0.041667rem /* 8/192 */;
     }
   }
   .innerFan {
@@ -544,8 +544,8 @@ export default class SectorToolbar extends Vue {
     padding-left: 0.260417rem /* 50/192 */;
     border-top: 0.3125rem /* 60/192 */ solid;
     border-left: 0.3125rem /* 60/192 */ solid;
-    border-top-color: rgba(21, 35, 50,0.7);
-    border-left-color: rgba(21, 35, 50,0.7);
+    border-top-color: rgba(21, 35, 50, 0.7);
+    border-left-color: rgba(21, 35, 50, 0.7);
     display: inline-block;
     pointer-events: none;
     border-radius: 2.083333rem /* 400/192 */ 0 0 0;
@@ -629,7 +629,7 @@ export default class SectorToolbar extends Vue {
   }
   .outerFan-content {
     position: absolute;
-    font-size: 20px;
+    font-size: 0.104167rem /* 20/192 */;
     color: green;
     left: 0.28125rem /* 54/192 */;
     top: -0.104167rem /* 20/192 */;

+ 0 - 12
src/views/groupPage/districtPageModules/customTools/config.json

@@ -656,18 +656,6 @@
                 {
                     "label": "建筑物",
                     "name": "TF_PAPN_BUILD@sxgk_base"
-                },
-                {
-                    "label": "倾斜摄影",
-                    "name": "Config"
-                },
-                {
-                    "label": "污水处理厂模型",
-                    "name": "TF_PAPN_DFWASTE_B@sywastewater,TF_PAPN_DFWATER1_3D@sywastewater,TF_PAPN_DFWATER2_3D@sywastewater"
-                },
-                {
-                    "label": "岳阳水质监测设备",
-                    "name": "TF_JCSB@sxgk#1"
                 }
             ]
         }

+ 13 - 1
src/views/groupPage/districtPageModules/customTools/monitorTree.vue

@@ -117,7 +117,19 @@ export default class monitorTree extends Vue {
   }
   handleTreeNodeClick(data) {
     let entity = customDataSource.entities.getById(data.name)
-    this.viewer.flyTo(entity)
+    let item = {
+      name: data.name,
+      id: data.id,
+      position: [Number(data.positionX.replaceAll(',', '')), Number(data.positionY.replaceAll(',', ''))],
+      image:
+        data.type == '摄像头'
+          ? require('@/views/groupPage/images/设备/摄像头.png')
+          : require('@/views/groupPage/images/设备/噪声.png'),
+      info: data
+    }
+    this.viewer.flyTo(entity).then(() => {
+      this.initInfoPop(item, Cesium.Cartesian3.fromDegrees(item.position[0], item.position[1]))
+    })
   }
   getCheckList() {
     this.deviceCheckList = (this.$refs.tree as any).getCheckedNodes().filter((item) => !item.children)

+ 10 - 5
src/views/groupPage/districtPageModules/customTools/pbsTree.vue

@@ -74,11 +74,15 @@ export default {
         isLeaf: 'leaf'
       },
       pipeInfo: null,
-      prjId: 45,
       //外部调用参数
       prjInfoArr: []
     }
   },
+  computed: {
+    prjId() {
+      return this.$store.state.bigScreen.currentPrjId
+    }
+  },
   methods: {
     //懒加载树状下层
     async loadNode(node, resolve) {
@@ -476,6 +480,7 @@ export default {
     },
     //清除范围显示
     clearWall() {
+      if (!window.viewer) return
       if (window.viewer.entities.getById('dynamicWall')) window.viewer.entities.removeById('dynamicWall')
     },
     //-----------------------------------------------------------------------------------------------------------------------外部调用
@@ -573,15 +578,15 @@ export default {
       // 设置要在输入事件上执行的功能,官方文档查询ScreenSpaceEventType可以看到所有的cesium鼠标事件
       rangeHandler.setInputAction((movement) => {
         var pickedObject = window.viewer.scene.pick(movement.position)
+        this.clearRangeSymbol()
         if (
           window.viewer.scene.pickPositionSupported &&
           Cesium.defined(pickedObject) &&
           pickedObject.id.type == 'constructionRange'
         ) {
-          this.clearRangeSymbol()
-          this.addWall(pickedObject.id.info, false)
-        } else {
-          this.clearRangeSymbol()
+          setTimeout(() => {
+            this.addWall(pickedObject.id.info, false)
+          }, 100)
         }
       }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
     },

+ 4 - 1
src/views/groupPage/districtPageModules/customTools/projectPipeSpeedInfoCheck.vue

@@ -12,7 +12,7 @@
         </span>
         <div class="leftBar">
           <span>进度专题图</span>
-          <CommonTreeList :placeholder="'工程选择'" :prjId="45" @changeProjectName="prjChange($event)" />
+          <CommonTreeList :placeholder="'工程选择'" :prjId="prjId" @changeProjectName="prjChange($event)" />
         </div>
         <div class="rightBar">
           <!-- <el-date-picker
@@ -152,6 +152,9 @@ export default class ProjectPipeSpeedInfoCheck extends Vue {
     // }
     return t
   }
+  get prjId() {
+    return this.$store.state.bigScreen.currentPrjId
+  }
   settings() {
     let label = ''
     switch (this.timeInterval) {

+ 19 - 12
src/views/groupPage/header/header.vue

@@ -23,7 +23,7 @@
                 <el-option
                   :value="treeValue.value"
                   :label="treeValue.label"
-                  style="max-width: 260px; height: auto; padding: 0"
+                  style="max-width: 1.354167rem /* 260/192 */; height: auto; padding: 0"
                 >
                   <el-tree
                     :data="datas"
@@ -158,9 +158,6 @@ export default {
     }
   },
   methods: {
-    captionClick() {
-      this.currentProjectActive = ''
-    },
     // 点击tree节点
     nodeClick(item) {
       const { name, value, pid } = item
@@ -289,6 +286,7 @@ export default {
     display: flex;
     flex-flow: row nowrap;
     .title {
+      width: 3.385417rem /* 650/192 */;
       padding: 0 $size20;
       display: flex;
       justify-content: center;
@@ -305,9 +303,14 @@ export default {
       .titleInfo {
         display: flex;
         flex-flow: column;
-        justify-content: space-around;
-        height: 60%;
+        justify-content: center;
+        align-items: center;
+        height: 100%;
+        width: calc(100% - 0.291667rem /* 56/192 */);
+        overflow: hidden;
         .maintitle {
+          height: calc(100% - 0.208333rem /* 40/192 */);
+          width: 100%;
           display: flex;
           align-items: center;
           .caption {
@@ -357,9 +360,9 @@ export default {
               display: block;
               width: 0;
               height: 0;
-              border-top: 10px solid #2ba7ff;
-              border-right: 7px solid transparent;
-              border-left: 7px solid transparent;
+              border-top: 0.052083rem /* 10/192 */ solid #2ba7ff;
+              border-right: 0.036458rem /* 7/192 */ solid transparent;
+              border-left: 0.036458rem /* 7/192 */ solid transparent;
               transform: rotate(180deg);
             }
           }
@@ -380,9 +383,13 @@ export default {
           }
         }
         .subtitle {
+          height: 0.0625rem /* 12/192 */;
+          width: 100%;
           font-size: 0.057292rem /* 11/192 */;
           font-weight: 400;
           color: #feffff;
+          white-space: nowrap;
+          text-overflow: ellipsis;
         }
       }
     }
@@ -426,17 +433,17 @@ export default {
     .otherItem {
       width: 20%;
       height: 100%;
-      font-size: $size14;
+      font-size: $size16;
       font-weight: 400;
       display: flex;
       align-items: center;
       position: absolute;
-      right: 20px;
+      right: 0.104167rem /* 20/192 */;
       .specificTime {
         flex: 2;
         top: 25%;
         text-align: center;
-        font-weight: 400;
+        font-family: Source Han Sans CN;
         color: #a8d3f1;
       }
       .entrySys {

+ 1 - 1
src/views/groupPage/index.vue

@@ -37,7 +37,7 @@ export default {
       flexibleObject: null
     }
   },
-  mounted() {
+  created() {
     this.flexibleObject = new Flexible()
     // getBlockPage({ size: 999 }).then((res) => {
     // console.log('code列表', res)

+ 7 - 1
src/views/spectrum/report/rainfall/ImportForm.vue

@@ -15,6 +15,11 @@
           <div slot="tip" class="text">⚠️ 注意:请上传.xlsx .xls格式的文件,且文件大小不能超10MB</div>
           <el-button size="small" type="primary" :disabled="loading"> 点击上传 </el-button>
         </el-upload>
+        <div>
+          <el-button type="text" style="margin-top: 1em">
+            <a :href="xlsxString" download="降雨量模板.xlsx">下载降雨量模板</a>
+          </el-button>
+        </div>
       </el-form-item>
     </el-form>
   </tf-dialog>
@@ -24,12 +29,13 @@
   import { Vue, Component, Prop } from 'vue-property-decorator'
   import { ElForm } from 'element-ui/types/form'
   import { ElUploadInternalFileDetail } from 'element-ui/types/upload'
+  import xlsxString from './xlsx_template'
 
   @Component({ name: 'TeamForm', components: {} })
   export default class TeamForm extends Vue {
     @Prop({ type: Boolean, default: false }) loading!: boolean
     $refs!: { form: ElForm }
-
+    xlsxString: string = xlsxString
     formData: { fileList: ElUploadInternalFileDetail[] } = { fileList: [] }
     rules = {
       fileList: [

+ 12 - 1
src/views/spectrum/report/rainfall/QueryForm.vue

@@ -39,6 +39,9 @@
         导入
       </el-button>
     </el-form-item>
+    <el-form-item label-width="0">
+      <!-- <input @change="onChange" type="file" /> -->
+    </el-form-item>
   </el-form>
 </template>
 
@@ -59,7 +62,15 @@
     getDefaultDateTimePickerProp = getDefaultDateTimePickerProp
     datetime: (Date | string)[] = []
     formData: Partial<IRainfall> = {}
-
+    // xlsxString = xlsxString
+    // onChange(e: Event) {
+    //   console.log(e)
+    //   const fr = new FileReader()
+    //   fr.readAsDataURL(e.target.files[0])
+    //   fr.onload = (e) => {
+    //     console.log(fr.result)
+    //   }
+    // }
     onQuery() {
       const [beginDate = '', endDate = ''] = this.datetime
       this.$emit('query', { ...this.formData, beginDate, endDate })

File diff suppressed because it is too large
+ 1 - 0
src/views/spectrum/report/rainfall/xlsx_template.js