派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-07 be9f3ad87b059e5ddf25a7f8f8672293aecf6302
Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
# src/components/LayerController/modules/LcServiceLayerFilter.vue
1个文件已添加
16个文件已修改
294 ■■■■ 已修改文件
src/components/LayerController/LayerController.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/modules/LcServiceLayerFilter.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/service/WfsLayerService.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/helpers/BasemapHelper.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel/LegendPanel.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel/RightSearchPanel.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel/ToolBoxPanel.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/plugin/PathDashFlow.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/enterprise.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table/summarySheets.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/layers/LayerPipeLines.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/layers/LayerSewers.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/map.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/AjaxUtils.js 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/axios.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Temp.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/LayerController.vue
@@ -2,12 +2,12 @@
  <div :class='["float-panel",layerControllerVisible ? "active" : ""]' >
    <div @click="showPanel" class="iconBtn" :class='layerControllerVisible ? "active-button" : ""' v-show="!layerControllerVisible" style="  position: absolute;top:0;left: 0;">
        <img src="@assets/images/map-pages/icon/layer.png" alt="" class="icon">
        <span class="icon-name">图层</span>
<!--        <span class="icon-name">图层</span>-->
    </div>
    <transition name="animationChange">
      <div :class="'legend-content map-background'" v-show="layerControllerVisible">
        <lc-service-layer></lc-service-layer>
        <buttom  @click="showPanel" type="button" class="el-button special-button el-button--default el-icon-d-arrow-left"></buttom>
        <button  @click="showPanel" type="button" class="el-button special-button el-button--default el-icon-d-arrow-left"></button>
      </div>
    </transition>
  </div>
@@ -247,7 +247,7 @@
    background:@background-color;
  }
  .legend-content{
    width:  1.79167rem;
    width: 2.2rem;
  }
}
src/components/LayerController/modules/LcServiceLayerFilter.vue
@@ -77,9 +77,9 @@
    swSubFilter (url, item) {
      item.checked = !item.checked
      if (item.checked) {
        window.serviceLayerHelper.loadGeojsonLayer(url, item)
        window.layerFactory.show(item)
      } else {
        window.serviceLayerHelper.removeLayer(item)
        window.layerFactory.hide(item)
      }
      // window.serviceLayerHelper.loadLayers()
    }
@@ -99,7 +99,6 @@
<style scoped lang="less">
    .inner-panel {
        color: #90c8e0;
        font-size: 13px;
src/components/LayerController/service/WfsLayerService.js
@@ -29,7 +29,10 @@
  }
  loadData (wfsUrl) {
    AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => this.draw(res.data.features))
    AjaxUtils.get4JsonDataByUrl(wfsUrl, this.params, (res) => {
      console.log(res)
      this.draw(res.data.features)
    })
  }
  draw (features) {
src/components/helpers/BasemapHelper.js
@@ -1,7 +1,6 @@
/* eslint-disable no-debugger */
import AjaxUtils from '@/utils/AjaxUtils'
import * as utils from '../../utils/utils'
/**
 * 底图管理助手,负责底图创建及开关
 */
@@ -20,7 +19,7 @@
     * @param map
     * @param defBasemapName 初始化完成后,默认显示的图层
     */
    initBasemap = (config, isIntranet) => {
    initBasemap =async (config, isIntranet) => {
      if (isIntranet) { // 内网
        this._getToken(config) // 获取token后,并按配置加载地图
      } else { // 外网
@@ -104,11 +103,10 @@
    // 内网地图创建部分
    // 获取内网地图token,并加载到地图中
    _getToken = (config) => {
    _getToken = async (config) => {
      const params = config.TokenConfig
      AjaxUtils.GetDataAsynByUrl(params.url, params.option, (token) => {
      const token = await AjaxUtils.GetDataAsynByUrl(params.url, params.option)
        this._showTDT(token, config)
      })
    }
    // 内网地图加载,并加载到地图
@@ -116,8 +114,8 @@
      const intranetBasemaps = config.mapConfig.IntranetBaseMaps
      for (let i = 0, len = intranetBasemaps.length; i < len; ++i) {
        const basemapConfig = intranetBasemaps[i]
        const basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option)
        const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option)
        const basemapLayer = this.L.tileLayer(basemapConfig.map.url + '&token=' + token, basemapConfig.map.option)
        const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url + '&token=' + token, basemapConfig.annotation.option)
        const basemap = {
          code: basemapConfig.code,
src/components/panel/LegendPanel.vue
@@ -23,17 +23,23 @@
  </div>
</template>
<script>
import { LayerWasteWater } from '../../conf/layers/LayerWasteWater'
import { LayerWasteGas } from '../../conf/layers/LayerWasteGas'
import { LayerWasteSolid } from '../../conf/layers/LayerWasteSolid'
import { LayerAirQuality } from '../../conf/layers/LayerAirQuality'
import { LayerEnvRisk } from '../../conf/layers/LayerEnvRisk'
import { LayerSoilGroundWater } from '../../conf/layers/LayerSoilGroundWater'
import { LayerPipeLines } from '../../conf/layers/LayerPipeLines'
import { LayerPk } from '../../conf/layers/LayerPk'
import { LayerArea } from '../../conf/layers/LayerArea'
export default {
  name: 'LegendPanel',
  data () {
    return {
      // 控制图例 内容的 显示/隐藏
      legendControl: false
    }
  },
  computed: {
    serviceLayers () {
      return this.$store.state.map.serviceLayers.LayerSewersLine
      legendControl: false,
      serviceLayers: [LayerSoilGroundWater, LayerEnvRisk, LayerAirQuality, LayerWasteSolid, LayerWasteGas, LayerWasteWater, LayerArea, LayerPk, LayerPipeLines]
    }
  },
  methods: {
src/components/panel/RightSearchPanel.vue
@@ -7,7 +7,7 @@
      <div class="container">
          <ul>
              <li style="text-align: right">
                  <buttom type="button" class="el-button special-button el-button--default el-icon-d-arrow-right"></buttom>
                  <button type="button" class="el-button special-button el-button--default el-icon-d-arrow-right"></button>
              </li>
          </ul>
        <ul  v-for="item in topicList" :key="item.name" :class="item.checked?'module-wrap map-btn-active':'module-wrap map-btn-unactive'" @click="()=>{selected(item)}" >
src/components/panel/ToolBoxPanel.vue
@@ -3,7 +3,7 @@
    <div class="specific-tools">
      <el-button :class="selectGroup === true ?'active-button':''" class="el-button-choice"   @click.enter.native="changeSelectMouse">
          <img src="@assets/images/map-pages/icon/toolbox/Selecd/tool.png" alt="" class="icon" />
          <span class="span-default">工具</span>
          <!--<span class="span-default">工具</span>-->
      </el-button>
      <transition name="animationChange">
        <el-row v-show="selectGroup" class="specific-tools-group">
@@ -20,8 +20,8 @@
                       @click.native="changeChoose(index)">
              <img :src="item.iconSelecd" alt="" v-if="active === index"/>
              <img :src="item.icon" alt="" v-else/>
              <span v-if="active === index">{{ item.label }}</span>
              <span v-else class="default-span">{{ item.label }}</span>
              <!--<span v-if="active === index">{{ item.label }}</span>
              <span v-else class="default-span">{{ item.label }}</span>-->
            </el-button>
            <el-button v-for="(itemT,indexT) in item.items" :key="indexT" @click="choiceItem(itemT,indexT)"
                       v-show="item.index!=='2'">
src/components/plugin/PathDashFlow.js
@@ -71,7 +71,6 @@
    }
  },
  _fillStroke: function (ctx, layer) {
    debugger
    var options = layer.options
    if (options.fill) {
src/components/table/enterprise.vue
@@ -3,7 +3,7 @@
        <div class="enterprise-function" @click="showWarnDialog()">
            <div :class='["iconBtn",warnVisible ? "active-button" : ""]'>
                <img src="@/assets/images/map-pages/icon/map/warn.png" alt="" class="icon">
                <span class="icon-name">预报警</span>
                <!--<span class="icon-name">预报警</span>-->
                <!--    <el-tooltip :popper-class="'map-tooltip'" effect="dark" content="预报警" placement="left">
                    <img src="@/assets/images/map-pages/icon/map/warn.png" alt="" width="26px" style="display: block;margin: auto">
@@ -13,7 +13,7 @@
        <div class="enterprise-function" @click="showStatisDialog()">
            <div :class='["iconBtn",companyVisible ? "active-button" : ""]'>
                <img src="@/assets/images/map-pages/icon/map/company.png" alt="" class="icon">
                <span class="icon-name">指标</span>
<!--                <span class="icon-name">指标</span>-->
            </div>
        </div>
        <Dialog ref="warnDialog" title="企业预警报警分类统计" >
src/components/table/summarySheets.vue
@@ -2,7 +2,7 @@
    <div class="summary-sheets">
        <div :class='["iconBtn",summaryVisible ? "active-button" : ""]' @click="closeBtn">
            <img src="@assets/images/map-pages/icon/toolbox/table.png" alt="" class="icon">
            <span class="icon-name">统计表</span>
            <!--<span class="icon-name">统计表</span>-->
        </div>
        <Dialog ref="summarySheets" title="企业指标分类统计">
          <tab-handover></tab-handover>
src/conf/layers/LayerPipeLines.js
@@ -1,6 +1,9 @@
/**
 * 管网
 */
import { LayerHbss } from './LayerHbss'
import { LayerFsss } from './LayerFsss'
const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
@@ -8,6 +11,7 @@
  code: 'sewersPipeLines',
  name: '管线',
  checked: true,
  childLayer: [LayerFsss, LayerHbss],
  layers: [
    {
      code: 'rainline',
@@ -15,7 +19,7 @@
      sname: '雨水线',
      checked: true,
      wfs: WFS_URL + '?TYPENAME=管网',
      minZoom: 10 // 在指定级别显示
      minZoom: 10
    },
    {
      code: 'accidentline',
src/conf/layers/LayerSewers.js
@@ -103,7 +103,7 @@
export const LayerSewersPoint = [
  {
    code: 'fsss',
    code: 'sewersFsss',
    name: '附属设施',
    checked: false, // 默认选中状态
    type: 'geojson',
@@ -171,7 +171,7 @@
    ]
  },
  {
    code: 'hbss',
    code: 'sewersHbss',
    name: '环保设施',
    checked: false, // 默认选中状态
    type: 'geojson',
@@ -233,7 +233,7 @@
    ]
  },
  {
    code: 'pk',
    code: 'sewersPk',
    name: '排口',
    checked: false, // 默认选中状态
    type: 'geojson',
@@ -249,7 +249,7 @@
    ]
  },
  {
    code: 'qyxx',
    code: 'sewersQyxx',
    name: '区域信息',
    checked: false, // 默认选中状态
    type: 'geojson',
src/router/index.js
@@ -29,9 +29,11 @@
    next() // 跳转
  } else if (token && to.name === LOGIN_PAGE_ROUTE_NAME) {
    // 已登录且要跳转的页面是登录页
    next({
      name: homeRouterName // 跳转到homeName页
    })
    // next({
    //   name: homeRouterName // 跳转到homeName页
    // })
    console.log(homeRouterName)
    next()
  } else if (!token) {
    next({
      name: LOGIN_PAGE_ROUTE_NAME // 跳转到登录页
src/router/map.js
@@ -9,10 +9,12 @@
 * }
 */
const MapTemplate = (r) => require.ensure([], () => r(require('../views/MapTemplate')), 'frame')
const Temp = (r) => require.ensure([], () => r(require('../views/Temp')), 'frame')
const Login = (r) => require.ensure([], () => r(require('../views/Login')), 'frame')
const routes = [
  { path: '/mapTemplate', name: 'MapTemplate', meta: { statusBgc: 0 }, component: MapTemplate },
  { path: '/Login', name: 'Login', meta: { statusBgc: 0 }, component: Login }
  { path: '/Login', name: 'Login', meta: { statusBgc: 0 }, component: Login },
  { path: '/temp', name: 'Login', meta: { statusBgc: 0 }, component: Temp }
]
// 所有上面定义的路由都要写在下面的routes里
src/utils/AjaxUtils.js
@@ -44,31 +44,15 @@
const GetDataAsynByUrl = async (oUrl, pData) => {
  const pUrl = encodeURI(oUrl)
  const res = await axios({
    method: 'get',
    url: pUrl,
    data: pData
  const res = await axios.get(pUrl, {
    params: pData
  }).then((response) => {
    return (response)
  })
    .catch((error) => {
      console.error('数据获取失败', error)
    })
  return res
  // $.ajax({
  //   type: 'GET',
  //   url: pUrl,
  //   data: pData,
  //   timeout: 600000,
  //   async: true,
  //   success: function (datas, nnn) {
  //     pBackFun(datas)
  //   },
  //   error: function (e, nnnn) {
  //     console.error('数据获取失败', pUrl)
  //   }
  // })
  return res.data
}
function postDataAsynByUrl (pUrl, pData, pBackFun) {
  $.ajax({
src/utils/axios.js
@@ -83,7 +83,7 @@
// 创建axios实例
const Service = axios.create({
  timeout: 5000
  timeout: 1000 * 30
})
const CancelToken = axios.CancelToken
src/views/Temp.vue
New file
@@ -0,0 +1,183 @@
<template>
  <div class="full-screen">
    <popup ref="popup" @callPopup="callPopup"></popup>
    <div id="map" ref="rootmap">
    </div>
    <sgis-layer-controller></sgis-layer-controller>
    <monitor-panel></monitor-panel>
    <!--        <top-enterprise-panel></top-enterprise-panel>-->
    <tool-box-panel ref="toolBox"></tool-box-panel>
    <!--    <menu-special></menu-special>-->
    <legend-panel></legend-panel>
    <summary-sheets></summary-sheets>
    <enterprise></enterprise>
    <!--    <el-button id="map-btn" el-icon-c-scale-to-original icon="el-icon-c-scale-to-original" circle @click="isShowHidden"></el-button>-->
    <!--    <el-button type="primary" @click="ChangeState" class="solid-waste">固废</el-button>-->
    <!--    <el-button type="primary" @click="ChangeWaterState" class="Waste-water">废水</el-button>-->
    <!--    <el-button type="primary" @click="AddGasHelper" class="flue-gas">废气</el-button>-->
    <PublicBounced ref="PublicBounced"></PublicBounced>
  </div>
</template>
<script>
import 'leaflet/dist/leaflet.css'
import Sgis from '@src/Sgis'
// import mapConfig from '@/conf/MapConfig'
import SgisLayerController from '@components/LayerController/LayerController'
import MonitorPanel from '@components/panel/RightSearchPanel'
// import TopEnterprisePanel from '@components/panel/TopEnterprisePanel'
import summarySheets from '@components/table/summarySheets.vue'
import ToolBoxPanel from '@components/panel/ToolBoxPanel'
import Popup from '@views/popup/Popup'
// import MenuSpecial from '@components/panel/MenuTopic'
import LegendPanel from '@components/panel/LegendPanel'
import Enterprise from '../components/table/enterprise'
// // 公共展示数据
import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced'
import LayerFactory from '@components/LayerController/service/LayerFactory'
export default {
  name: 'Temp',
  components: {
    Enterprise,
    LegendPanel,
    // MenuSpecial,
    ToolBoxPanel,
    // TopEnterprisePanel,
    SgisLayerController,
    MonitorPanel,
    Popup,
    summarySheets,
    PublicBounced
  },
  data () {
    return {
      map: null,
      lcServiceLayerVisible: false,
      basemapHelper: {},
      serviceLayerHelper: {},
      vectorLayerHelper: {},
      toolBoxVisible: false
    }
  },
  computed: {
    config () {
      return this.$store.state.map.config
    }
  },
  beforeMount () {
    this.$nextTick(() => {
      this.init()
    })
  },
  methods: {
    saveMapStatus () {
      window.serviceLayerHelper = this.serviceLayerHelper
      this.$store.commit('setMapObj', this.map)
      this.$store.commit('setBasemapHelper', this.basemapHelper)
      // this.$store.commit('setServiceLayerHelper', this.serviceLayerHelper)
      this.$store.commit('setVectorLayerHelper', this.vectorLayerHelper)
      this.lcServiceLayerVisible = true
    },
    init () {
      const mapcontainer = this.$refs.rootmap
      this.map = Sgis.initMap(mapcontainer)
      this.$refs.toolBox.map = this.map
      window.popupComp = this.$refs.popup
      var layerFactory = new LayerFactory({
        L: window.L,
        map: this.map
      })
      layerFactory.init(this.$store.state.map.serviceLayers.LayerSewersLine)
      window.layerFactory = layerFactory
      this.basemapHelper = Sgis.initBasemapsHelper(this.map) // 初始化基础底图助手
      this.basemapHelper.initBasemap(this.config, true) // 第二个参数,表示是否内网底图
      // this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.map) // 初始化动态要素图层助手
      // this.vectorLayerHelper.initVectorLayers(this.config)
      // this.AddGasHelper()
      // this.ChangeWaterState()
      this.saveMapStatus()
      // this.setMapObj(this.mapObj)
      // this.setBasemapHelper(this.basemapHelper)
      // this.setServiceLayerHelper(this.serviceLayerHelper)
      // this.setVectorLayerHelper(this.vectorLayerHelper)
    },
    onLayerClick () {
      this.$refs.popup.setShow()
    },
    callPopup (val) {
      console.log(val)
    }
  }
}
</script>
<style lang="less">
.flue-gas {
  position: fixed;
  top: 88px;
  left: 180px;
  z-index: 500;
}
.solid-waste {
  position: absolute;
  top: 88px;
  left: 88px;
  z-index: 999;
}
.Waste-water {
  position: absolute;
  top: 88px;
  left: 280px;
  z-index: 999;
}
.full-screen {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  position: absolute;
  #map {
    height: 100%;
    width: 100%;
  }
  .barline {
    //width: 100%;
    //height: 1px;
    //background-color: #0661AE;
    border-top: 1px solid #0661AE;
  }
  #map-btn {
    position: fixed;
    top: 20px;
    left: 100px;
    z-index: 9999;
  }
  .leaflet-custom-icon {
    background: white;
  }
  .leaflet-marker-icon {
    background: none;
  }
  #migic {
    width: 48px;
    height: 48px;
    margin: -18px -20px;
    z-index: 999;
  }
}
</style>