管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-22 193c02587585f85853352f5553a0f068d078696c
发布管理修改预览效果,一张图修改
已添加3个文件
已修改11个文件
747 ■■■■■ 文件已修改
src/api/api.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/config.css 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/configure.css 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Screen/bottom.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Screen/left.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Screen/right.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Screen/top.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/preview_map.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/diaLog.js 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/service.js 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/LayerTree.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/dialogHeader.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/uploadmanage.vue 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -8,14 +8,14 @@
 */
import request from '@/utils/request';
import axios from 'axios';
import service from '@/utils/service';
//公司后台
const service = axios.create({
  // baseURL: '/api', // api的base_url
  //baseURL: 'http://192.168.20.106/', // api的base_url
  baseURL: 'http://192.168.20.39/', // api的base_url
  timeout: 35000,
});
// const service = axios.create({
//   // baseURL: '/api', // api的base_url
//   //baseURL: 'http://192.168.20.106/', // api的base_url
//   baseURL: BASE_URL, // api的base_url
// });
//字典管理列表
export function selectByPageAndCount(params) {
  //请求地址
@@ -1103,7 +1103,7 @@
}
//数据发布 => æ•°æ®æ’å…¥
export function publish_insert(params) {
  return request.post('/publish/insertForPub', params);
  return service.post('/publish/insertForPub', params);
}
src/assets/css/config.css
@@ -517,4 +517,12 @@
.Black_theme .tabsSpan {
    color: #fff;
}
.Black_theme .el-icon-full-screen {
    color: #fff !important;
}
.Black_theme .el-icon-crop {
    color: #fff !important;
}
src/assets/css/configure.css
@@ -401,4 +401,12 @@
.tabsSpan {
    color: #000;
}
.el-icon-full-screen {
    color: #000 !important;
}
.el-icon-crop {
    color: #000 !important;
}
src/components/Screen/bottom.vue
@@ -281,6 +281,7 @@
      }
    },
    handleMenuClick(menu) {
      this.currMenu = menu.menuName
    },
    handlePopoverClick(child) {
@@ -307,6 +308,9 @@
    //工程巡视
    async showPathLine(params) {
      this.$bus.$emit("closeLeftAndRightMenu", true)
      const line = wktToGeoJSON(params.wkt)
      const position = line.coordinates[0]
      const result = []
@@ -315,7 +319,7 @@
        pos.push(1000)
        result.push(...pos)
      })
      // console.log("line", position)
      window.sgworld.Creator.getFlyData(result, data => {
        data.showPoint = false
@@ -327,6 +331,7 @@
        window.PathAnimationData = {
          flyData: data,
        }
        var that = this
        window.PathAnimationData.winIndex = layer.open({
          type: 2,
          title: "工程巡视",
@@ -337,6 +342,7 @@
          content: SmartEarthRootUrl + "Workers/path/ProjectPath.html",
          end: function () {
            PathAnimationData.fly && PathAnimationData.fly.exit()
            that.$bus.$emit("closeLeftAndRightMenu", false)
          },
        })
      })
@@ -413,6 +419,31 @@
    //专题展示
    changeProject(params) {
      this.$bus.$emit("changeProject", params.name)
      var lon, lat, height;
      if (params.name.indexOf("全国") != -1) {
        height = 20000000;
        lon = 110;
        lat = 32;
        window.viewer.camera.flyTo({
          destination: new Cesium.Cartesian3.fromDegrees(lon, lat, height),
          orientation: {
            heading: Cesium.Math.toRadians(0),
            pitch: Cesium.Math.toRadians(-90),
          },
        })
      } else if (params.name.indexOf("全球") != -1) {
        lon = 85;
        lat = 25;
        height = 30000000;
        window.viewer.camera.flyTo({
          destination: new Cesium.Cartesian3.fromDegrees(lon, lat, height),
          orientation: {
            heading: Cesium.Math.toRadians(0),
            pitch: Cesium.Math.toRadians(-90),
          },
        })
      }
    },
    handleTree(params) {
      this.showTree = !this.showTree
src/components/Screen/left.vue
@@ -1,32 +1,59 @@
<template>
  <div class="current">
    <div class="leftarrow">
      <img :src="leftImg" @click="ChangeLeft" />
      <img
        :src="leftImg"
        @click="ChangeLeft"
      />
    </div>
    <div class="leftContainer" v-if="currentDisplay == '大屏' && ChartDisplay">
      <div class="current1" id="leftCurrent1">
    <div
      class="leftContainer"
      v-if="currentDisplay == '大屏' && ChartDisplay"
    >
      <div
        class="current1"
        id="leftCurrent1"
      >
        <div class="aside-title">数据申请次数</div>
        <count-data-apply></count-data-apply>
      </div>
      <div class="current1" id="leftCurrent2">
      <div
        class="current1"
        id="leftCurrent2"
      >
        <div class="aside-title">用户访问量</div>
        <service-type></service-type>
      </div>
      <div class="current1" id="leftCurrent3">
      <div
        class="current1"
        id="leftCurrent3"
      >
        <div class="aside-title">项目存储信息</div>
        <data-storage></data-storage>
      </div>
    </div>
    <!-- å…¨çƒã€å…¨å›½ç»Ÿè®¡æ¬¡æ•° -->
    <div class="leftContainer" v-if="currentDisplay == '项目'">
      <div class="current1" id="leftCurrent1">
    <div
      class="leftContainer"
      v-if="currentDisplay == '项目'"
    >
      <div
        class="current1"
        id="leftCurrent1"
      >
        <div class="aside-title">数据总览</div>
        <div class="wrapper">
          <div class="title">{{ currentProject }}</div>
          <dv-digital-flop style="height: 40px" :config="xmCountConfig" />
          <dv-digital-flop
            style="height: 40px"
            :config="xmCountConfig"
          />
        </div>
      </div>
      <div class="current1" id="leftCurrent2">
      <div
        class="current1"
        id="leftCurrent2"
      >
        <div class="aside-title">存储信息</div>
        <base-line-chart
          :requsetFn="requsetFn"
@@ -34,21 +61,36 @@
          title="数据存储量"
        ></base-line-chart>
      </div>
      <div class="current1" id="leftCurrent3">
      <div
        class="current1"
        id="leftCurrent3"
      >
        <div class="aside-title">数据存储量</div>
        <data-storage-type></data-storage-type>
      </div>
    </div>
    <!-- å…¨çƒã€å…¨å›½ç®¡ç½‘图 -->
    <div class="leftContainer" v-if="currentDisplay == '管网'">
      <div class="current1" id="leftCurrent1">
    <div
      class="leftContainer"
      v-if="currentDisplay == '管网'"
    >
      <div
        class="current1"
        id="leftCurrent1"
      >
        <div class="aside-title">数据总览</div>
        <div class="wrapper">
          <div class="title">{{ currentProject }}</div>
          <dv-digital-flop style="height: 40px" :config="xmCountConfig" />
          <dv-digital-flop
            style="height: 40px"
            :config="xmCountConfig"
          />
        </div>
      </div>
      <div class="current1" id="leftCurrent2">
      <div
        class="current1"
        id="leftCurrent2"
      >
        <div class="aside-title">管网长度</div>
        <base-line-chart
          :requsetFn="requsetFn"
@@ -58,13 +100,19 @@
        <!-- <base-pie-chart :project="currentProject"></base-pie-chart> -->
        <!-- <service-type></service-type> -->
      </div>
      <div class="current1" id="leftCurrent3">
      <div
        class="current1"
        id="leftCurrent3"
      >
        <div class="aside-title">数据存储量</div>
        <data-storage-type></data-storage-type>
      </div>
    </div>
    <!-- å•个工程展示 -->
    <div class="leftContainer" v-if="currentDisplay == '工程'">
    <div
      class="leftContainer"
      v-if="currentDisplay == '工程'"
    >
      <div class="current1">
        <div class="aside-title">工程简介</div>
        <projectintroduction></projectintroduction>
@@ -161,6 +209,11 @@
          ...this.xmCountConfig,
        }
      }
    })
    this.$bus.$on("closeLeftAndRightMenu", (res) => {
      this.ChartDisplay = res;
      this.ProjectreeDisplay = res;
      this.ChangeLeft();
    })
  },
  methods: {
@@ -448,7 +501,7 @@
          startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)],
          endValue:
            dataAxis[
              Math.min(params.dataIndex + zoomSize / 2, data.length - 1)
            Math.min(params.dataIndex + zoomSize / 2, data.length - 1)
            ],
        })
      })
src/components/Screen/right.vue
@@ -1,6 +1,9 @@
<template>
  <div class="current">
    <div class="rightContainer" v-if="currentDisplay == '大屏' && ChartDisplay">
    <div
      class="rightContainer"
      v-if="currentDisplay == '大屏' && ChartDisplay"
    >
      <div class="current1">
        <div class="aside-title">项目统计</div>
        <project-category></project-category>
@@ -15,7 +18,10 @@
      </div>
    </div>
    <!-- å…¨çƒã€å…¨å›½é¡¹ç›® -->
    <div class="rightContainer" v-if="currentDisplay == '项目'">
    <div
      class="rightContainer"
      v-if="currentDisplay == '项目'"
    >
      <div class="current1">
        <div class="aside-title"></div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
@@ -31,7 +37,10 @@
          v-if="currentProject == '全球项目'"
          ref="pieRef"
        ></country-dimension-pie>
        <province-dimension-pie v-else ref="pieRef"></province-dimension-pie>
        <province-dimension-pie
          v-else
          ref="pieRef"
        ></province-dimension-pie>
      </div>
      <div class="current1">
        <div class="aside-title">数据使用情况</div>
@@ -42,7 +51,10 @@
      </div>
    </div>
    <!-- å…¨å›½ã€å…¨çƒç®¡ç½‘ -->
    <div class="rightContainer" v-if="currentDisplay == '管网'">
    <div
      class="rightContainer"
      v-if="currentDisplay == '管网'"
    >
      <div class="current1">
        <div class="aside-title">站场座数</div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
@@ -67,7 +79,10 @@
      </div>
    </div>
    <!-- å•个工程 -->
    <div class="rightContainer" v-if="currentDisplay == '工程'">
    <div
      class="rightContainer"
      v-if="currentDisplay == '工程'"
    >
      <div class="current1">
        <div class="aside-title">数据存储量</div>
        <base-line-chart
@@ -86,7 +101,10 @@
      </div>
      <div class="current1">
        <div class="aside-title">管道条数</div>
        <div class="content" style="height: 30px">
        <div
          class="content"
          style="height: 30px"
        >
          <div class="header">
            <div>格式</div>
            <div>数量</div>
@@ -97,7 +115,10 @@
    </div>
    <div class="rightarrow">
      <img :src="RightImg" @click="ChangeRight" />
      <img
        :src="RightImg"
        @click="ChangeRight"
      />
    </div>
  </div>
</template>
@@ -251,6 +272,10 @@
        projectCode: code,
      }
    })
    this.$bus.$on("closeLeftAndRightMenu", (res) => {
      this.ChartDisplay = res
      this.ChangeRight();
    })
  },
  methods: {
src/components/Screen/top.vue
@@ -17,7 +17,10 @@
        <img src="../../assets/img/Screen/ptree.png" />
        <span>工程项目</span>
      </div> -->
      <div class="topleft__curr">
      <div
        class="topleft__curr"
        @click="setMapViewStart()"
      >
        <img src="../../assets/img/Screen/ptree.png" />
        <span :title="currentProject">{{ currentProject }}</span>
      </div>
@@ -34,7 +37,10 @@
        <img src="../../assets/img/Screen/bigST.png" />
        <span>返回大屏</span>
      </div>
      <div class="topright1 toprightC" @click="ReturnLast">
      <div
        class="topright1 toprightC"
        @click="ReturnLast"
      >
        <img src="../../assets/img/Screen/return.png" />
        <span>返回上级</span>
      </div>
@@ -74,6 +80,9 @@
      this.$parent.$refs.mapright.OpenLeftInit()
      this.currentProject = "大屏视图"
      // å›žåˆ°åˆå§‹åŒ–视角
      this.setMapViewStart();
    },
    setMapViewStart() {
      window.viewer.camera.flyTo({
        destination: new Cesium.Cartesian3.fromDegrees(110, 32, 20000000),
        orientation: {
@@ -82,7 +91,6 @@
        },
      })
    },
    //打开工程树
    OpenProjectree() {
      this.screen = false
src/components/preview_map.vue
@@ -39,9 +39,9 @@
      //显示fps
      Viewer.scene.debugShowFramesPerSecond = false;
      //导航控件
      window.sgworld.navControl("nav", false);
      // window.sgworld.navControl("nav", false);
      //比例尺
      window.sgworld.navControl("scale", false);
      // window.sgworld.navControl("scale", false);
      //开启深度检测
      // sg.Analysis.depthTestAgainstTerrain(true)
      Viewer.scene.globe.depthTestAgainstTerrain = true;
src/main.js
@@ -20,6 +20,9 @@
import dataV from '@jiaminghi/data-view'
import directive from '@/directive/index.js' // directive
import drag from '@/assets/js/drag.js'
import elDragDialog from './utils/diaLog.js'
Vue.directive('el-drag-dialog', elDragDialog);
ElementUI.Dialog.props.closeOnClickModal.default = false;
Vue.use(directive)
Vue.use(dataV)
Vue.use(VueParticles)
src/utils/diaLog.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
export default {
    bind(el, binding, vnode, oldVnode) {
        const resizeEvent = new CustomEvent('drag-resize', {
            detail: '尺寸变化',
            bubbles: false
        })
        // åˆå§‹åŒ–不最大化
        el.fullscreen = false
        // å¼¹æ¡†å¯æ‹‰ä¼¸æœ€å°å®½é«˜
        const minWidth = 1100
        const minHeight = 570
        // å½“前宽高
        let nowWidth = minWidth
        // eslint-disable-next-line no-unused-vars
        let nowHight = minHeight
        // å½“前顶部高度
        let nowMarginTop = 0
        // èŽ·å–å¼¹æ¡†å¤´éƒ¨ï¼ˆè¿™éƒ¨åˆ†å¯åŒå‡»å…¨å±ï¼‰
        const dialogHeaderEl = el.querySelector('.el-dialog__header')
        let hasSetBodyHight = false
        // å¼¹çª—
        const dragDom = el.querySelector('.el-dialog')
        el.style.overflow = 'initial'
        dragDom.className += ' el-drag-dialog'
        // ç»™å¼¹çª—加上overflow auto;不然缩小时框内的标签可能超出dialog;
        dragDom.style.overflow = 'auto'
        // æ¸…除选择头部文字效果
        // eslint-disable-next-line no-new-func
        dialogHeaderEl.onselectstart = new Function('return false')
        // å¤´éƒ¨åŠ ä¸Šå¯æ‹–åŠ¨cursor
        dialogHeaderEl.style.cursor = 'move'
        // èŽ·å–åŽŸæœ‰å±žæ€§ ie dom元素.currentStyle ç«ç‹è°·æ­Œ window.getComputedStyle(dom元素, null);
        const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
        // å¤´éƒ¨æ’入最大化最小化元素
        const maxMin = document.createElement('button')
        maxMin.className += ' el-dialog__headerbtn el-dialog__minmax'
        maxMin.style.right = '40px'
        maxMin.style.color = '#ffffff'
        maxMin.title = el.fullscreen ? '还原' : '最大化'
        maxMin.innerHTML = '<i class=' + (el.fullscreen ? '"el-icon-crop"' : '"el-icon-full-screen"') + ' onMouseOver="this.style.color=\'#409EFF\'" onMouseOut="this.style.color=\'inherit\'"></i>'
        dialogHeaderEl.insertBefore(maxMin, dialogHeaderEl.childNodes[1])
        const moveDown = (e) => {
            // é¼ æ ‡æŒ‰ä¸‹ï¼Œè®¡ç®—当前元素距离可视区的距离
            const disX = e.clientX - dialogHeaderEl.offsetLeft
            const disY = e.clientY - dialogHeaderEl.offsetTop
            // èŽ·å–åˆ°çš„å€¼å¸¦px æ­£åˆ™åŒ¹é…æ›¿æ¢
            let styL, styT
            // æ³¨æ„åœ¨ie中 ç¬¬ä¸€æ¬¡èŽ·å–åˆ°çš„å€¼ä¸ºç»„ä»¶è‡ªå¸¦50% ç§»åŠ¨ä¹‹åŽèµ‹å€¼ä¸ºpx
            if (sty.left.includes('%')) {
                styL = +document.body.clientWidth * (+sty.left.replace(/\\%/g, '') / 100)
                styT = +document.body.clientHeight * (+sty.top.replace(/\\%/g, '') / 100)
            } else {
                styL = +sty.left.replace(/\px/g, '')
                styT = +sty.top.replace(/\px/g, '')
            }
            document.onmousemove = function (e) {
                // é€šè¿‡äº‹ä»¶å§”托,计算移动的距离
                const l = e.clientX - disX
                const t = e.clientY - disY
                // ç§»åŠ¨å½“å‰å…ƒç´ 
                dragDom.style.left = `${l + styL}px`
                dragDom.style.top = `${t + styT}px`
                // å°†æ­¤æ—¶çš„位置传出去
                // binding.value({x:e.pageX,y:e.pageY})
            }
            document.onmouseup = function (e) {
                document.onmousemove = null
                document.onmouseup = null
            }
        }
        dialogHeaderEl.onmousedown = moveDown
        let bodyHeight = 'auto'
        function setMaxMin() {
            if (el.fullscreen) {
                let i = maxMin.querySelector('.el-icon-crop');
                i.classList.remove('el-icon-crop');
                i.classList.add('el-icon-full-screen');
                maxMin.innerHTML = '<i class="el-icon-full-screen"></i>';
                maxMin.title = '最大化';
                dragDom.style.height = nowHight + 'px';
                dragDom.style.width = nowWidth + 'px';
                dragDom.style.marginTop = window.innerHeight * 0.07 + 'px';
                el.fullscreen = false;
                dialogHeaderEl.style.cursor = 'move';
                dialogHeaderEl.onmousedown = moveDown;
                // dragDom.querySelector('.el-dialog__body').style.height = bodyHeight;
                hasSetBodyHight = false;
            } else {
                const i = maxMin.querySelector('.el-icon-full-screen')
                i.classList.remove('el-icon-full-screen')
                i.classList.add('el-icon-crop')
                maxMin.title = '还原'
                bodyHeight = dragDom.querySelector('.el-dialog__body').offsetHeight + 'px'
                nowHight = dragDom.clientHeight
                nowWidth = dragDom.clientWidth
                nowMarginTop = dragDom.style.marginTop
                dragDom.style.left = 0
                dragDom.style.top = 0
                dragDom.style.height = window.innerHeight + 'px'
                dragDom.style.width = '100VW'
                dragDom.style.marginTop = 0
                el.fullscreen = true
                dialogHeaderEl.style.cursor = 'initial'
                dialogHeaderEl.onmousedown = null
                if (!hasSetBodyHight) {
                    const footerHeight = dragDom.querySelector('.el-dialog__footer') && dragDom.querySelector('.el-dialog__footer').offsetHeight
                    // dragDom.querySelector('.el-dialog__body').style.height =
                    //     'calc(90% - ' + (dialogHeaderEl.offsetHeight + footerHeight) + 'px)'
                    dragDom.querySelector('.el-dialog__body').style.height =
                        'calc(90% - ' + (dialogHeaderEl.offsetHeight + footerHeight) + 'px)'
                    /*          dragDom.querySelector('.el-dialog__body').style.height =
                                window.innerHeight*0.9
                                 - (dialogHeaderEl.offsetHeight + footerHeight) + 'px'*/
                    hasSetBodyHight = true
                }
            }
            el.dispatchEvent(resizeEvent)
        }
        // ç‚¹å‡»æ”¾å¤§ç¼©å°æ•ˆæžœ
        maxMin.onclick = setMaxMin
        // åŒå‡»å¤´éƒ¨æ•ˆæžœ
        dialogHeaderEl.ondblclick = setMaxMin
        // æ‹‰ä¼¸
        const resizeEl = document.createElement('div')
        dragDom.appendChild(resizeEl)
        // åœ¨å¼¹çª—右下角加上一个10-10px的控制块
        resizeEl.style.cursor = 'se-resize'
        resizeEl.style.position = 'absolute'
        resizeEl.style.height = '10px'
        resizeEl.style.width = '10px'
        resizeEl.style.right = '0px'
        resizeEl.style.bottom = '0px'
        resizeEl.style.zIndex = '99';
        // é¼ æ ‡æ‹‰ä¼¸å¼¹çª—
        resizeEl.onmousedown = (e) => {
            // è®°å½•初始x位置
            const clientX = e.clientX
            // é¼ æ ‡æŒ‰ä¸‹ï¼Œè®¡ç®—当前元素距离可视区的距离
            const disX = e.clientX - resizeEl.offsetLeft
            const disY = e.clientY - resizeEl.offsetTop
            document.onmousemove = function (e) {
                e.preventDefault() // ç§»åŠ¨æ—¶ç¦ç”¨é»˜è®¤äº‹ä»¶
                // é€šè¿‡äº‹ä»¶å§”托,计算移动的距离
                const x = e.clientX - disX + (e.clientX - clientX)// è¿™é‡Œ ç”±äºŽelementUI的dialog控制居中的,所以水平拉伸效果是双倍
                const y = e.clientY - disY
                // æ¯”较是否小于最小宽高
                dragDom.style.width = x > minWidth ? `${x}px` : minWidth + 'px'
                dragDom.style.height = y > minHeight ? `${y}px` : minHeight + 'px'
                if (!hasSetBodyHight) {
                    const footerHeight = dragDom.querySelector('.el-dialog__footer') && dragDom.querySelector('.el-dialog__footer').offsetHeight
                    dragDom.querySelector('.el-dialog__body').style.height = 'calc(90% - ' + (dialogHeaderEl.offsetHeight + footerHeight) + 'px)'
                    hasSetBodyHight = true
                }
            }
            // æ‹‰ä¼¸ç»“束
            document.onmouseup = function (e) {
                document.onmousemove = null
                document.onmouseup = null
                el.dispatchEvent(resizeEvent)
            }
        }
    }
}
src/utils/service.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,111 @@
/*
 * @Description:
 * @Author: çŽ‹æ—­
 * @Date: 2022-03-03 15:10:54
 * @LastEditTime: 2022-03-08 17:40:02
 * @LastEditors: çŽ‹æ—­
 */
import axios from "axios";
import { Message } from "element-ui";
import store from "@/store";
import { getToken } from "@/utils/auth";
import router from "../router"
// create an axios instance
const service = axios.create({
  baseURL: BASE_URL, // api的base_url
  timeout: -1, // è¯·æ±‚è¶…æ—¶æ—¶é—´
  headers: {
    "content-type": "application/json;charset=UTF-8",
  },
  // withCredentials: true,
});
// request interceptor
service.interceptors.request.use(
  (config) => {
    // è¯·æ±‚携带token
    let token = getToken();
    if (token) {
      config.headers["token"] = token;
    }
    //加载loading
    store.commit("UPDATE_API_COUNT", "add");
    return config;
  },
  (error) => {
    //减去loading
    store.commit("UPDATE_API_COUNT", "sub");
    console.log(error); // for debug
    return Promise.reject(error);
  }
); service.interceptors.response.use(
  (response) => {
    if (window.localStorage.getItem("LFToken") != null) {
      var expire = JSON.parse(window.localStorage.getItem("LFToken")).expire;
      var timeire = new Date().getTime();
      if (timeire >= expire) {
        router.push('/login')
        localStorage.removeItem("LFToken");
      }
    }
    store.commit("UPDATE_API_COUNT", "sub");
    //console.log(response)
    //返回因有ResponeType===Blob ,分开处理
    if (Object.prototype.toString.call(response.data).indexOf("Blob") > -1) {
      let reader = new FileReader()
      reader.onload = function (e) {
        {
          try {
            let str = this.result.toString();
            let res = JSON.parse(str);
            if (res.code != null) {
              if (res.code !== 200) {
                Message.error(res.msg);
              }
            }
          } catch { }
        }
      }
      reader.readAsText(response.data, "utf-8");
    } else {
      if (response.data.code !== 200) {
        // Message.error(response.data.msg);
      }
    }// æŠ¥é”™æç¤º
    return response.data;
  },
  (error) => {
    store.commit("UPDATE_API_COUNT", "sub");
    const { status, data } = error.response;
    //返回因有ResponeType===Blob ,分开处理
    if (Object.prototype.toString.call(data).indexOf("Blob") > -1) {
      let reader = new FileReader()
      reader.onload = function (e) {
        {
          let str = this.result.toString();
          let res = JSON.parse(str);
          Message({
            message: res.message,
            type: "error",
            duration: 5 * 1000,
          });
        }
      }
      reader.readAsText(data, "utf-8");
    } else {
      Message({
        message: data.message,
        type: "error",
        duration: 5 * 1000,
      });
    }
    return Promise.reject(error);
  }
);
export default service;
src/views/Tools/LayerTree.vue
@@ -544,6 +544,25 @@
            }
          });
        }
      } else if (data.serveType == "TMS") {
        debugger
        if (data.pubid) {
          debugger
        } else {
          var res;
          if (data.url.indexOf("{host}") != -1) {
            res = data.url.replace("{host}", iisHost);
          } else {
            res = data.url
          }
          var url = res.split(';')
          debugger
          window.sgworld.Creator.createImageryProvider('mpt影像', "wms", {
            url: url[0],
            layers: url[1]
          }, "0", undefined, true, "");
        }
      }
@@ -635,10 +654,16 @@
        });
        window.map.addLayer(vectorLayer);
      } else if (res.serveType == "Tileset") {
        var url;
        if (res.url.indexOf("{host}") != -1) {
          url = res.url.replace("{host}", iisHost);
        } else {
          url = modelUrl + "/" + res.url
        }
        var tileset = Viewer.scene.primitives.add(
          new Cesium.Cesium3DTileset({
            name: res.cnName,
            url: modelUrl + "/" + res.url, //192.168.20.106,to4
            url: url, //192.168.20.106,to4
            maximumScreenSpaceError: 64, // æœ€å¤§å±å¹•空间错误:16
            maximumMemoryUsage: 768, // æœ€å¤§å†…存:512
            dynamicScreenSpaceError: true, // å‡å°‘离相机较远的屏幕空间错误:false
src/views/datamanage/dialogHeader.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
<!--最大化最小化组件封装-->
<template>
  <div class="header-title">
    <span class="title-name">{{ dialogTittle }}</span>
    <span
      style="float: right; color: #909399; cursor: pointer;"
      class="el-icon-close"
      @click="() => closed"
    ></span>
    <span
      style="float: right; margin-right: 10px; color:#909399; cursor: pointer;"
      :class="flodIconClass"
      @click="() => isFullscreen"
    ></span>
  </div>
</template>
<script>
export default {
  props: {
    dialogTittle: {
      type: String,
      default: () => ''
    },
    fullscreen: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      header_box: {
        'display': 'flex',
        'align-items': 'center'
      }
    }
  },
  computed: {
    flodIconClass() {
      return this.fullscreen ? 'el-icon-full-screen' : 'el-icon-copy-document';
    },
    isFullscreen() {
      this.$emit('is-fullscreen', !this.fullscreen);
    },
    closed() {
      this.$emit('handle-closed', 2)
    }
  },
  created() {
  },
  methods: {
  },
  mounted() {
  },
}
</script>
src/views/datamanage/uploadmanage.vue
@@ -284,15 +284,44 @@
    <!-- åœ°å€é¢„览 -->
    <el-dialog
      :title="$t('common.preview')"
      :class="isFullscreen ? '' : 'dialogClass_his'"
      custom-class="handleDialogClass"
      width="73.4%"
      :fullscreen="isFullscreen"
      v-if="dialogVisible"
      :visible.sync="dialogVisible"
      :show-close="false"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <dialog-header
        slot="title"
        :dialog-tittle="$t('common.preview')"
        :fullscreen="isFullscreen"
        @handle-closed="handleClose"
        @is-fullscreen="onFullscreen"
      ></dialog-header>
      <div :class="{'fullscreen1':isFullscreen}">
        <mapview v-if="showMapView"></mapview>
      </div>
    </el-dialog>
    <!-- <el-dialog
      :title="$t('common.preview')"
      :visible.sync="dialogVisible"
      width="70%"
      :before-close="handleClose"
      top="13vh"
      :lock-scroll="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      v-el-drag-dialog
    >
      <div style="width:100%;height:65vh">
        <mapview v-if="showMapView"></mapview>
      </div>
    </el-dialog>
      <div
        id="MapDiv"
        style="background:red;widht:100%;height:calc(100% - 10px)"
      ></div>
      <!--
    </el-dialog> -->
    <!-- ä¿®æ”¹æ•°æ® -->
    <el-dialog
      :title="$t('common.update')"
@@ -389,6 +418,7 @@
      :visible.sync="insertDialogVisible"
      width="40%"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <div style="width:100%;height:30vh">
        <el-form
@@ -409,16 +439,42 @@
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('dataManage.vmobj.minLevel')">
            <el-input
            <!-- <el-input
              v-model="insertLayer.min"
              :placeholder="$t('dataManage.vmobj.labe11')"
            ></el-input>
            ></el-input> -->
            <el-select
              style="width:100%"
              v-model="insertLayer.min"
              :placeholder="$t('dataManage.vmobj.labe11')"
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('dataManage.vmobj.maxLevel')">
            <el-input
            <!-- <el-input
              v-model="insertLayer.max"
              :placeholder="$t('dataManage.vmobj.labe12')"
            ></el-input>
            ></el-input> -->
            <el-select
              style="width:100%"
              v-model="insertLayer.max"
              :placeholder="$t('dataManage.vmobj.labe12')"
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button
@@ -454,7 +510,6 @@
        element-loading-text="数据发布中"
        style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "
      >
      </div>
    </div>
  </div>
@@ -462,6 +517,8 @@
</template>
<script>
import axios from 'axios';
import dialogHeader from './dialogHeader.vue'
import mapview from '../../components/preview_map.vue'
import MyBread from "../../components/MyBread.vue"
import {
@@ -476,7 +533,10 @@
} from '../../api/api.js'
export default {
  components: { MyBread, mapview },
  components: {
    MyBread, mapview,
    'dialog-header': dialogHeader,
  },
  data() {
    return {
      active: 'first',
@@ -528,17 +588,29 @@
      detailsDialogVisible: false,
      itemdetail: {},
      insertDialogVisible: false,
      insertLayer: { name: '', number: null, min: 4, max: 8 },
      loadDialogVisible: false
      insertLayer: { name: '', number: null, min: 4, max: 18 },
      loadDialogVisible: false,
      options: [],
      isFullscreen: false,
    }
  },
  methods: {
    setOptions() {
      var std = [];
      for (var i = 0; i < 21; i++) {
        std.push({
          value: i,
          label: i
        })
      }
      this.options = std;
    },
    setloadDialogVisible() {
      this.loadDialogVisible = false
    },
    setinsertLayerCancel() {
      this.insertDialogVisible = false;
      this.insertLayer = { name: '', number: null, min: 4, max: 8 };
      this.insertLayer = { name: '', number: null, min: 4, max: 18 };
    },
    //发布提交
    async setinsertLayerSubmit() {
@@ -574,7 +646,7 @@
      }
      var std = [];
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i])
        std.push(this.multipleSelection[i].id)
      }
      var obj = {
        dircode: this.formInline.dirid,
@@ -582,14 +654,14 @@
        min: min,
        max: max,
        name: name,
        ids: std.toString(),
        ids: std,
        type: this.formInline.type
      }
      this.loadDialogVisible = true
      this.insertDialogVisible = false;
      const data = await publish_insert(obj);
      if (data.code != 200) {
      if (data.code != 200 || data.count > 0) {
        this.$message.error("数据发布失败")
      } else {
@@ -615,13 +687,13 @@
      } else {
        var std = [];
        for (var i in this.multipleSelection) {
          std.push(this.multipleSelection[i])
          std.push(this.multipleSelection[i].id)
        }
        var obj = {
          dircode: this.formInline.dirid,
          depcode: this.formInline.depid,
          ids: std.toString(),
          ids: std,
          type: this.formInline.type
        }
        this.loadDialogVisible = true
@@ -682,33 +754,46 @@
      this.editDialogVisible = true;
    },
    //删除
    async setPageDelete() {
    setPageDelete() {
      if (this.multipleSelection.length == 0) {
        return this.$message.error("请选择要删除的数据")
      } else {
        var std = [];
        for (var i in this.multipleSelection) {
          std.push(this.multipleSelection[i].id);
        }
        const data = await publish_deletes({ ids: std.toString() });
        if (data.code != 200) {
          this.$message.error("单位列表获取失败")
          return
        } else {
          this.$message({
            message: '删除成功',
            type: 'success'
        var that = this
        this.$confirm('确定是否删除所选内容?')
          .then(_ => {
            done();
          })
          .catch(_ => {
            that.deletePage()
          });
          this.getTableData();
        }
      }
    },
    async deletePage() {
      var std = [];
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].id);
      }
      const data = await publish_deletes({ ids: std.toString() });
      if (data.code != 200) {
        this.$message.error("单位列表获取失败")
        return
      } else {
        this.$message({
          message: '删除成功',
          type: 'success'
        });
        this.getTableData();
      }
    },
    //预览弹窗打开
    setPreviewLayer(res) {
      this.$store.state.previewLayer = res;
      this.dialogVisible = true;
      this.showMapView = true;
    },
    //是否为全屏函数
    onFullscreen(fullscreen) {
      this.isFullscreen = fullscreen;
    },
    //预览弹窗关闭
    handleClose() {
@@ -961,6 +1046,7 @@
  mounted() {
    this.active = 'first';
    this.setPageStart();
    this.setOptions();
  }
}
</script>
@@ -1024,5 +1110,15 @@
      background: transparent !important;
    }
  }
  .fullscreen1 {
    width: 100%;
    height: 92vh;
  }
  /deep/.el-dialog__body {
    padding: 10px !important;
  }
  /deep/.el-dialog__header {
    padding: 10px !important;
  }
}
</style>