xieqy il y a 3 ans
Parent
commit
5419ed4f8a

+ 59 - 0
src/components/ComPopup/index.vue

@@ -0,0 +1,59 @@
+<template>
+  <div class="widget-ComPopup" :class="`widget-ComPopup-${id}`" :ref="`widget-ComPopup-${id}`">
+    <slot />
+  </div>
+</template>
+
+<script lang="ts">
+import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
+const Cesium = (window as any).Cesium
+//公共弹窗载体
+@Component({ name: 'ComPopup' })
+export default class ComPopup extends Vue {
+  @Prop({ type: String }) id!: string
+  @Prop({ type: String, required: true }) mapContainerId!: string
+  viewer
+  _renderCallback = null
+  isExist = null
+  mounted() {
+    this.viewer = (window as any).viewer
+  }
+  get boxTarget() {
+    return this.$refs[`widget-ComPopup-${this.id}`] as any
+  }
+  //初始化
+  initBox() {
+    this.isExist = document.querySelector('#' + this.mapContainerId).appendChild(this.boxTarget)
+  }
+  //设置位置
+  setPosition(position) {
+    if (!this.isExist) this.initBox()
+    this._renderCallback = this.viewer.scene.postRender.addEventListener((e) => {
+      let canvasHeight = this.viewer.scene.canvas.clientHeight //canvas实际高度
+      let windowPosition = new Cesium.Cartesian2()
+      Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene, position, windowPosition)
+      this.boxTarget.style.bottom = canvasHeight - windowPosition.y + 14 + 5 + 'px'
+      let left = this.boxTarget.clientWidth / 2
+      this.boxTarget.style.left = windowPosition.x - left + 'px'
+    })
+  }
+  //移除
+  remove() {
+    if (this._renderCallback) {
+      this._renderCallback()
+      this._renderCallback = null
+    }
+    if (document.querySelector(`.widget-ComPopup-${this.id}`)) {
+      document.querySelector(`.widget-ComPopup-${this.id}`).remove()
+      this.isExist = null
+    }
+  }
+}
+</script>
+
+<style lang='scss' scoped>
+.widget-ComPopup {
+  font-family: Source Han Sans CN;
+  position: absolute;
+}
+</style>

+ 48 - 31
src/views/currentSystem/dashboard/components/Alarm/index.vue

@@ -29,24 +29,39 @@
 
     <el-dialog :visible.sync="alarmDialog" title="报警信息" append-to-body>
       <!-- @look="handleClick" -->
-      <more-infos :columns="tableColumns" :table-data="alarmData" :pagination="pagination" :total="alarmTotal" @size-change="handleSizeChange" @curr-change="handleCurrentChange" @confirm="handleClick">
+      <more-infos
+        :columns="tableColumns"
+        :table-data="alarmData"
+        :pagination="pagination"
+        :total="alarmTotal"
+        @size-change="handleSizeChange"
+        @curr-change="handleCurrentChange"
+        @confirm="handleClick"
+      >
         <template slot="filters">
           <el-row type="flex" align="middle" :gutter="10">
-            <el-col :span="5" style="display: flex; justify-content:flex-start; align-items:center;">
+            <el-col :span="5" style="display: flex; justify-content: flex-start; align-items: center">
               <span style="width: 45px">类型</span>
               <el-select v-model="filter.warnType" style="width: 120px" size="small" clearable>
                 <el-option v-for="type in types" :key="type.ccode" :value="type.ccode" :label="type.cname" />
               </el-select>
             </el-col>
-            <el-col :span="5" style="display: flex; justify-content:flex-start; align-items:center;">
+            <el-col :span="5" style="display: flex; justify-content: flex-start; align-items: center">
               <span style="width: 45px">状态:</span>
               <el-select v-model="filter.isconfirm" style="width: 120px" size="small">
                 <el-option v-for="option in options" :key="option.value" :value="option.value" :label="option.label" />
               </el-select>
             </el-col>
-            <el-col :span="12" style="display: flex; justify-content:flex-start; align-items:center;">
+            <el-col :span="12" style="display: flex; justify-content: flex-start; align-items: center">
               <span style="width: 45px">时间:</span>
-              <el-date-picker v-model="filter.timeRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" />
+              <el-date-picker
+                v-model="filter.timeRange"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                size="small"
+              />
             </el-col>
             <el-col :span="2">
               <el-button size="small" type="primary" @click="clickAlarmData">查询</el-button>
@@ -202,18 +217,18 @@ export default {
     this.clear()
   },
   created() {
-    this.dataRefreh()
-    this.getWarnType()
+    // this.dataRefreh()
+    // this.getWarnType()
   },
   mounted() {
-    this.getTableData()
+    // this.getTableData()
     // this.getAlarmData()
-    window.onresize = () => {
-      return (() => {
-        this.getTableHeight()
-      })()
-    }
-    this.getTableHeight()
+    // window.onresize = () => {
+    //   return (() => {
+    //     this.getTableHeight()
+    //   })()
+    // }
+    // this.getTableHeight()
   },
   methods: {
     /**
@@ -221,7 +236,7 @@ export default {
      */
     getWarnType() {
       // 转入外部流程
-      getCodeParent({ pCid: '845' }).then(res => {
+      getCodeParent({ pCid: '845' }).then((res) => {
         const data = res.result
         this.types = this.getCodeOf(data, 845)
       })
@@ -231,7 +246,7 @@ export default {
      * @description 筛选码表数据
      */
     getCodeOf(data, id) {
-      const code = data.filter(val => {
+      const code = data.filter((val) => {
         return val.id === id
       })
       return code[0].codeList
@@ -250,10 +265,10 @@ export default {
       // Object.assign(query, that.filter)
       const query = { current: 1, size: 10, isconfirm: '0' }
       console.log('首页报警10调:' + JSON.stringify(query))
-      alarmList(query).then(res => {
+      alarmList(query).then((res) => {
         console.log(res)
         if (res.code !== -1) {
-          res.result.records.forEach((item, index) => item.order = index + 1)
+          res.result.records.forEach((item, index) => (item.order = index + 1))
           that.tableData = res.result.records
         }
       })
@@ -271,7 +286,8 @@ export default {
 
       // 追加分页参数
       const query = {
-        current: this.pagination.current, size: that.pagination.size
+        current: this.pagination.current,
+        size: that.pagination.size
       }
       that.postProblems.warnType = that.filter.warnType
       that.postProblems.isconfirm = that.filter.isconfirm
@@ -280,10 +296,12 @@ export default {
       Object.assign(query, that.postProblems)
       console.log('page参数:' + JSON.stringify(query))
 
-      alarmList(query).then(res => {
+      alarmList(query).then((res) => {
         console.log(res)
         if (res.code !== -1) {
-          res.result.records.forEach((item, index) => item.order = ((that.pagination.current - 1) * that.pagination.size) + index + 1)
+          res.result.records.forEach(
+            (item, index) => (item.order = (that.pagination.current - 1) * that.pagination.size + index + 1)
+          )
           that.alarmData = res.result.records
           that.alarmTotal = res.result.total
         }
@@ -304,7 +322,7 @@ export default {
       const _loginId = this.$store.state.user.userId // 登录账号编号
 
       const query = { id: _loginId, wanrIds: _id }
-      handleWarn(query).then(res => {
+      handleWarn(query).then((res) => {
         console.log(res)
         if (res.code !== -1) {
           console.log('确认成功')
@@ -338,8 +356,8 @@ export default {
     },
 
     /**
-		 * @description 计算开始、结束时间
-		 */
+     * @description 计算开始、结束时间
+     */
     getDateDiff() {
       if (this.arrayIsNull(this.filter.timeRange)) {
         this.postProblems.startTime = ''
@@ -387,17 +405,16 @@ export default {
      * @description 判断数组是否为空
      */
     arrayIsNull(aryList) {
-      return (typeof (aryList) === 'undefined' || aryList == null || aryList.length == 0)
+      return typeof aryList === 'undefined' || aryList == null || aryList.length == 0
     }
-
   }
 }
 </script>
 
 <style lang="scss" scoped>
-  // 去除自定义表格header和body不对其方式
-  .userTable{
-    width: 100%;
-    position:absolute;
-  }
+// 去除自定义表格header和body不对其方式
+.userTable {
+  width: 100%;
+  position: absolute;
+}
 </style>

+ 5 - 5
src/views/currentSystem/dashboard/components/Todo/index.vue

@@ -204,7 +204,7 @@ export default {
     this.clear()
   },
   created() {
-    this.dataRefreh()
+    // this.dataRefreh()
   },
   async mounted() {
     // //待办列表
@@ -331,7 +331,7 @@ export default {
               normal: {
                 show: false,
                 position: 'center',
-                formatter: function(data) {
+                formatter: function (data) {
                   // 设置圆饼图中间文字排版
                   return data.name + '\n\n' + data.value + ' 个'
                 }
@@ -385,7 +385,7 @@ export default {
       // 设置默认选中高亮部分
       chartReady.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 })
       // 当鼠标移入时,如果不是第一项,则把当前项置为选中,如果是第一项,则设置第一项为当前项
-      chartReady.on('mouseover', function(e) {
+      chartReady.on('mouseover', function (e) {
         chartReady.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: 0 })
         if (e.dataIndex != index) {
           chartReady.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: index })
@@ -396,13 +396,13 @@ export default {
       })
       let index = 0
       // 当鼠标离开时,把当前项置为选中
-      chartReady.on('mouseout', function(e) {
+      chartReady.on('mouseout', function (e) {
         index = e.dataIndex
         chartReady.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 })
       })
       // 鼠标点击事件
 
-      chartReady.on('click', function(e) {
+      chartReady.on('click', function (e) {
         console.log(e)
         const pieName = e.name
         let typeVal = 0

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

@@ -39,9 +39,9 @@ export default {
   },
   mounted() {
     this.flexibleObject = new Flexible()
-    getBlockPage({ size: 999 }).then((res) => {
-      // console.log('code列表', res)
-    })
+    // getBlockPage({ size: 999 }).then((res) => {
+    // console.log('code列表', res)
+    // })
   },
   methods: {},
   destroyed() {