diff --git a/package.json b/package.json index 6f6571c..25d8e0d 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,8 @@ "jspdf": "^2.5.1", "jsplumb": "^2.15.6", "jszip": "^3.0.0", + "lodash-es": "^4.17.21", + "mitt": "^3.0.1", "node-jsencrypt": "^1.0.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", @@ -132,4 +134,4 @@ "> 1%", "last 2 versions" ] -} \ No newline at end of file +} diff --git a/src/api/reservoir/index.js b/src/api/reservoir/index.js new file mode 100644 index 0000000..ddfa8a0 --- /dev/null +++ b/src/api/reservoir/index.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 获取场景列表 +export const getSceneListData = async (data) => { + return request({ + url: `/map/scene/sceneList`, + method: 'post', + data: { + pageNum: 1, + pageSize: 10, + data: { + id: '', + name: data.name + }, + params: { + order: 'asc', + orderBy: 'pub_date' + } + } + }); +}; + +// 根据id获取图层树 +export const getLayerData = async (sceneId) => { + return request({ + url: `/map/scene/getLayerTree/${sceneId}`, + method: 'get' + }); +}; + +// 水库基础信息详情 +export const getReservoirBaseDetailData = (id) =>{ + return request({ + url: `/sk/base/${id}`, + method: 'get' + }) +} +// 水库特征信息详情 +export const getReservoirRsppDetailData = (id) =>{ + return request({ + url: `/sk/rspp/${id}`, + method: 'get' + }) +} diff --git a/src/assets/image/right.png b/src/assets/image/right.png new file mode 100644 index 0000000..b6bccc9 Binary files /dev/null and b/src/assets/image/right.png differ diff --git a/src/assets/image/warning.png b/src/assets/image/warning.png new file mode 100644 index 0000000..4fdf76f Binary files /dev/null and b/src/assets/image/warning.png differ diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index 2f64e26..9467368 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -83,4 +83,11 @@ box-sizing: content-box; } +.el-tree.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{ + background: #36B29E1a; + // border-right: 2px solid #36B29E; + box-shadow: inset -4px 0px 0px 0px #36B29E; +} + + diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 71f1aed..fbfe653 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -191,6 +191,12 @@ aside { .text-center { text-align: center } +.text-left { + text-align: left; +} +.text-right{ + text-align: right; +} .sub-navbar { height: 50px; diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 9819808..3e3c21d 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -144,7 +144,7 @@ export default { sessionStorage.setItem("topTab", e); this.$store.dispatch("changeTopTab", e); this.$router.replace({ - path: "/", + path: `/`, query: { timestamp: new Date().getTime(), }, diff --git a/src/permission.js b/src/permission.js index cdb36f6..3efbe42 100644 --- a/src/permission.js +++ b/src/permission.js @@ -23,7 +23,6 @@ router.beforeEach((to, from, next) => { store.dispatch('GetInfo').then(res => { // 拉取user_info const roles = res.roles - console.log('GenerateRoutes >>>>> ') store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => { // 测试 默认静态页面 // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => { @@ -40,7 +39,6 @@ router.beforeEach((to, from, next) => { }) } else { if(!store.getters.permission_add_routes.length){ - console.log('GenerateRoutes >>>>> ') store.dispatch('GenerateRoutes').then(accessRoutes => { // 测试 默认静态页面 // store.dispatch('permission/generateRoutes', { roles }).then(accessRoutes => { diff --git a/src/router/index.js b/src/router/index.js index 3201505..00643fa 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -157,7 +157,7 @@ const router = createRouter() // 注册一个全局前置守卫 router.beforeEach((to, from, next) => { - + if (to.path === "/singleLogin") { console.log("单点登录设置token", to.query.token); //判断当前路由是否需要进行权限控制 if (to.query.token) { diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index db81dab..381b131 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -167,7 +167,7 @@ function filterAsyncRouter(asyncRouterMap) { return asyncRouterMap.filter((route) => { if (route.component) { // Layout组件特殊处理 - if (route.component === 'Layout') { + if ( route.component === 'Layout') { route.component = Layout; } else { route.component = loadView(route.component); @@ -202,6 +202,24 @@ function resolveChildrenRoutes(routes, pickRoute = permission.state.selectTab) { path: `${parentRoute.path}/${v.path}` }; }) || []; + + newChildrenRoutes = newChildrenRoutes.map(v=> { + if(v.path && v.path != '/' && (!v.children || !v.children.length)){ + // 为了让非目录的一级菜单正常展示 + return { + path: '/', + orderNum: v.orderNum, + meta: v.meta, + component: Layout, + hidden: v.hidden, + children: [ + v + ] + } + } else { + return v + } + }) } } return { diff --git a/src/views/aiSupervision/waterSetting/runScene/layerTree/index.js b/src/views/aiSupervision/waterSetting/runScene/layerTree/index.js index 539c17d..a2f940b 100644 --- a/src/views/aiSupervision/waterSetting/runScene/layerTree/index.js +++ b/src/views/aiSupervision/waterSetting/runScene/layerTree/index.js @@ -183,6 +183,7 @@ const zoomToLayerActions = { // 添加图层 export async function addLayer(layerData) { + console.log('addLayer-layerData >>>>> ', layerData) const { layerType, url, id } = layerData; let action = null; // 超图 S3M图层 diff --git a/src/views/components/SyMixMap.vue b/src/views/components/SyMixMap.vue index 892268e..f0398f1 100644 --- a/src/views/components/SyMixMap.vue +++ b/src/views/components/SyMixMap.vue @@ -23,9 +23,7 @@ const viewerClick = (e) => { if (e.graphic?._style?.canEdit) { currentGraphic = e.graphic; plot.edit(e.graphic, () => { - console.log('编辑viewerClick >>>>> ', e.graphic, graphicsList) let res = graphicsList.find(item => item.graphicId === e.graphic.graphicId); - console.log('res >>>>> ', res) if(res){ res.position = e.graphic.position; res.positions = e.graphic.positions; @@ -201,14 +199,14 @@ export default { // ); setTimeout(() => { viewer.scene.camera.setView({ - destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, this.defaultHeight), - // orientation: { - // heading: 0, - // pitch: -90, - // roll: 0, - // }, - duration: 2, - }); + destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, this.defaultHeight), + // orientation: { + // heading: 0, + // pitch: -90, + // roll: 0, + // }, + duration: 2, + }); }, 300); }, handleKeyUpFunc(e){ diff --git a/src/views/mobilePage/index.vue b/src/views/mobilePage/index.vue index f6889dc..3ab4467 100644 --- a/src/views/mobilePage/index.vue +++ b/src/views/mobilePage/index.vue @@ -1,6 +1,11 @@ - + diff --git a/src/views/reservoir/safeMonitorSetting/index.vue b/src/views/reservoir/safeMonitorSetting/index.vue new file mode 100644 index 0000000..868185e --- /dev/null +++ b/src/views/reservoir/safeMonitorSetting/index.vue @@ -0,0 +1,359 @@ + + + + + + + + + + + + 测点编码: + + 测点类型: + + + + + + + + + + + + + + + + + 配置 + + + + + + + + + + + + 预警类型: + + + + + 日降雨指本日8时至次日8时 + + + + 设置预警值: + + mm/d + + + + + 预警通知人: + + + + + + + 通知模板: + + + + 保存 + + + + + + + + diff --git a/src/views/reservoir/safeOperation/components/BaseInfo.vue b/src/views/reservoir/safeOperation/components/BaseInfo.vue new file mode 100644 index 0000000..3c0be5c --- /dev/null +++ b/src/views/reservoir/safeOperation/components/BaseInfo.vue @@ -0,0 +1,751 @@ + + + + + 水库基本信息 + + + 水库名称 + {{ this.form.resName }} + + + 水库代码 + {{ this.form.resCode }} + + + 水库注册登记号 + {{ this.form.registerCode }} + + + 水库功能 + {{ this.form.resAction }} + + + 水库类型 + {{ this.form.resType }} + + + 水库状态 + {{ this.form.resState }} + + + 工程规模 + {{ this.form.engScal }} + + + 工程等别 + {{ this.form.engGrad }} + + + 曾用名 + {{ this.form.oldName }} + + + 水库中心经度 + {{ this.form.resCenLong }} + + + 水库中心纬度 + {{ this.form.resCenLat }} + + + 归口管理部门 + {{ this.form.admDep }} + + + 水库主管部门 + {{ this.form.cmun }} + + + 水库管理部门 + {{ "" }} + + + 所在行政区划 + {{ "" }} + + + 所在流域 + {{ this.form.localBasin }} + + + 所在河流 + {{ this.form.localRiver }} + + + 水准基面 + {{ "" }} + + + 是否注册 + {{ "" }} + + + 左下角经度 + {{ "" }} + + + 左下角纬度 + {{ "" }} + + + 右上角经度 + {{ "" }} + + + 右上角纬度 + {{ "" }} + + + 水库所在位置 + {{ this.form.resLoc }} + + + 水库管理单位 + {{ this.form.mnun }} + + + 工程建设情况 + {{ this.form.engStat }} + + + 有效年份 + {{ "" }} + + + 主要建筑物级别 + {{ "" }} + + + 控制流域面积 + {{ this.form.watShedArea }} + + + 河道长度 + {{ "" }} + + + 河道比降 + {{ "" }} + + + 多年平均径流量 + {{ this.form.avanrnam }} + + + 多年平均降水量 + {{ this.form.avanpram }} + + + 多年平均流沙量 + {{ this.form.avansdam }} + + + 设计重现期 + {{ this.form.dsrcin }} + + + 设计洪峰流量 + {{ this.form.dspkfl }} + + + 设计1日洪水洪量(万m³) + {{ "" }} + + + 设计3日洪水洪量(万m³) + {{ "" }} + + + 校核重现期 + {{ this.form.chrcin }} + + + 校核洪峰流量 + {{ this.form.chpkfl }} + + + 校核洪水历时 + {{ "" }} + + + 校核洪水总量 + {{ this.form.chflvl }} + + + 设计洪水位 + {{ this.form.dsfllv }} + + + 校核洪水位 + {{ this.form.chfllv }} + + + 防洪高水位 + {{ this.form.uppLevFlco }} + + + 防洪限制水位库容 + {{ this.form.flLowLimLevCap }} + + + 正常蓄水位 + {{ this.form.normWatLev }} + + + 正常蓄水位相应水面面积 + {{ "" }} + + + 正常蓄水位相应库容 + {{ this.form.normPoolStagCap }} + + + 死水位 + {{ this.form.deadLev }} + + + 总库容 + {{ this.form.totCap }} + + + 调节库容 + {{ this.form.storFlCap }} + + + 死库容 + {{ this.form.deadCap }} + + + 防洪库容 + {{ this.form.flcoCap }} + + + 兴利库容 + {{ "" }} + + + 坝址控制流域面积 + {{ this.form.watShedArea }} + + + 地震基本烈度 + {{ "" }} + + + 地震动峰值加速度 + {{ "" }} + + + 设防地震烈度 + {{ "" }} + + + 集雨面积 + {{ "" }} + + + 下泄生态流量 + {{ "" }} + + + 数据来源 + {{ "" }} + + + 数据创建时间 + {{ this.form.createTime }} + + + 备注 + {{ this.form.note }} + + + + + 水库概况 + {{ this.form.resOv }} + + + 水库建设时间 + + + 开工时间 + {{ this.form.startDate }} + + + 完工时间 + {{ this.form.compDate }} + + + 最近异常加固改造时间 + + + 更新时间 + {{ this.form.updateTime }} + + + + + 水库水文特征 + + + 控制流域面积(km²) + {{ this.form.watShedArea }} + + + 多年平均降雨量(mm) + {{ this.form.avanpram }} + + + 多年平均径流量(万m³) + {{ this.form.avanrnam }} + + + 多年平均输沙两(万t) + {{ this.form.avansdam }} + + + 多年平均最低气温(℃) + {{ this.form.myavgmintp }} + + + 多年平均蒸发量(mm) + {{ this.form.avanev }} + + + 多年平均含沙量(kg/m³) + {{ "" }} + + + 水库调节性能 + {{ "" }} + + + 正常蓄水位相应水面面积(km²) + {{ "" }} + + + 防洪高水位(m) + {{ this.form.uppLevFlco }} + + + 死水位(m) + {{ this.form.deadLev }} + + + 橙色预警水位(m) + {{ "" }} + + + 红色预警水位(m) + {{ "" }} + + + 黄色预警水位(m) + {{ "" }} + + + 汛期开始日期 + {{ "" }} + + + 汛期结束日期 + {{ "" }} + + + 水准基面 + {{ "" }} + + + 备注 + {{ this.form.note }} + + + 设计洪水 + + + 校核洪峰流量(m³/s) + {{ this.form.chpkfl }} + + + 设计洪峰流量(m³/s) + {{ this.form.dspkfl }} + + + 设计洪水位(m) + {{ this.form.dsfllv }} + + + 校核洪水位(m) + {{ this.form.chfllv }} + + + 设计1日洪水洪量(万m³) + {{ "" }} + + + 设计3日洪水洪量(万m³) + {{ "" }} + + + 校核洪水历时(d) + {{ "" }} + + + 洪水总量 + {{ "" }} + + + 汛期限制水位 + + + 设计重现期 + {{ this.form.dsrcin }} + + + 河道比降 + {{ "" }} + + + 河道长度 + {{ "" }} + + + 汛期限制水位主汛期 + {{ "" }} + + + 库容 + + + 兴利库容 + {{ "" }} + + + 总库容(m³) + {{ this.form.totCap }} + + + 防洪库容(m³) + {{ this.form.flcoCap }} + + + 调节库容(m³) + {{ this.form.storFlCap }} + + + 死库容(m³) + {{ this.form.deadCap }} + + + + + + + + 责任人信息 + + + + + + + + + + + + + + + + + + diff --git a/src/views/reservoir/safeOperation/components/ProjectDetail.vue b/src/views/reservoir/safeOperation/components/ProjectDetail.vue new file mode 100644 index 0000000..6a0251a --- /dev/null +++ b/src/views/reservoir/safeOperation/components/ProjectDetail.vue @@ -0,0 +1,38 @@ + + + + + + + + + + 监测预警未确定需求 + + + + + diff --git a/src/views/reservoir/safeOperation/components/RealTimeMonitor.vue b/src/views/reservoir/safeOperation/components/RealTimeMonitor.vue new file mode 100644 index 0000000..d962716 --- /dev/null +++ b/src/views/reservoir/safeOperation/components/RealTimeMonitor.vue @@ -0,0 +1,185 @@ + + + + + + + + 开始日期: + + + + + 结束日期: + + + + 查询 + 重置 + + + + + + + + + + + 统计图 + + + + + + + + + diff --git a/src/views/reservoir/safeOperation/index.vue b/src/views/reservoir/safeOperation/index.vue new file mode 100644 index 0000000..ca941aa --- /dev/null +++ b/src/views/reservoir/safeOperation/index.vue @@ -0,0 +1,381 @@ + + + + + + + + + + + 图层管理 + + 二维地图 + + + + + + + + + {{ data.text }} + + + + + + + + + + 大型 + + + + + + + + + + + + diff --git a/src/views/reservoir/safeOperation/js/initEcharts.js b/src/views/reservoir/safeOperation/js/initEcharts.js new file mode 100644 index 0000000..28ef4de --- /dev/null +++ b/src/views/reservoir/safeOperation/js/initEcharts.js @@ -0,0 +1,124 @@ +// 倒立柱状图,y轴inverse +export const initReverseLineOptions = () => { + return { + title: { + // text: "统计", + }, + legend: { + orient: "horizontal", + top: "2%", + }, + grid: { + left: "10%", + right: "10%", + bottom: "10%", + top: '10%', + containLabel: true, + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "cross", + label: { + backgroundColor: "#283b56", + }, + }, + }, + xAxis: [ + { + type: "category", + name: "时间", + position: "bottom", + axisLine: { + show: true, + }, + axisTick: { + alignWithLabel: true, + }, + data: ['00:00','02:00','04:00','06:00','08:00','10:00','12:00', + '14:00','16:00','18:00','20:00','22:00'], + }, + ], + yAxis: [ + { + type: "value", + inverse: true, + name: "降雨量(mm)", + nameLocation: 'start', + }, + ], + series: [ + { + color: "#4a66bb", + type: 'line', + smooth: true, + name: '降雨量', + areaStyle: {}, + data: [0, 10, 4, 8, 1, 6, 3, 5, 2, 7, 9, 11], + }, + ], + }; +}; + +// 双y轴柱状图 +export const doubleYAxisOptions = () => { + return { + title: { + // text: "统计", + }, + grid: { + left: "10%", + right: "10%", + bottom: "10%", + top: '10%', + containLabel: true, + }, + tooltip: { + trigger: "axis", + axisPointer: { + type: "cross", + label: { + backgroundColor: "#283b56", + }, + }, + }, + xAxis:[ + { + type: 'category', + name: '时间', + nameLocation: 'middle', + nameGap: 30, + data: ['00:00','02:00','04:00','06:00','08:00','10:00','12:00', + '14:00','16:00','18:00','20:00','22:00'], + } + ], + yAxis: [ + { + type: 'value', + name: '降雨量(mm)', + nameLocation: 'end', + }, + { + type: 'value', + name: '温度(℃)', + position: 'right', + nameLocation: 'end', + } + ], + series: [ + { + name: '降雨量', + type: 'line', + smooth: true, + data: [0, 10, 4, 8, 1, 6, 3, 5, 2, 7, 9, 11], + }, + { + name: '温度', + type: 'line', + smooth: true, + yAxisIndex: 1, + data: [24,28,26,30,25,27,29,31,23,22,21,20], + } + ] + } +} diff --git a/src/views/reservoir/safeOperation/js/mapUtils.js b/src/views/reservoir/safeOperation/js/mapUtils.js new file mode 100644 index 0000000..19fde01 --- /dev/null +++ b/src/views/reservoir/safeOperation/js/mapUtils.js @@ -0,0 +1,119 @@ +import axios from 'axios' + +const identifyLayerActions = { + '021102': async (params) => { + return new Promise(async (resolve, reject) => { + const { url, input_geometry, geometry_type, layers = 'all', returnGeometry = false, tolerance = 1 } = params; + const result = await axios.get(`${url}.json`); + if (result.status === 200 && result.data) { + const { xmin, ymin, xmax, ymax } = result.data.fullExtent; + const mapExtent = `${xmin},${ymin},${xmax},${ymax}`; + const data = await axios.get( + `${url}/identify?geometry=${input_geometry}&geometryType=${geometry_type}&layers=${layers}&returnGeometry=${returnGeometry}&mapExtent=${mapExtent}&imageDisplay=600,550,96&tolerance=${tolerance}&out_fields=*&f=json` + ); + if (data.status === 200 && data.data) { + resolve(data.data); + } else { + resolve(null); + } + } + }); + }, + '030300': async (params) => { + console.log(params); + }, + '081100': async (params) => { + return new Promise(async (resolve, reject) => { + const { queryMode, bufferDistance, geometry, url, layerTable, layerName, k } = params; + const queryUrl = url.split('maps/')[0].replace('map-', 'data-'); + let requestUrl = `${queryUrl}data/featureResults.rjson?returnContent=true`; + if (k) { + requestUrl += `&k=${k}`; + } + const result = await axios.post( + requestUrl, + JSON.stringify({ + datasetNames: [layerTable || layerName], + getFeatureMode: queryMode, + bufferDistance, + geometry + }), + { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } + } + ); + resolve(result); + }); + } +}; + +export const queryLayersByPos = (position, layerList = [], cb) => { + + const { lng, lat } = position; + const layers = layerList + layers.forEach(async (layer) => { + const action = identifyLayerActions[layer.layerType]; + switch (layer.layerType) { + case '021102': { + const input_geometry = `${lng},${lat}`; + const geometry_type = 'esriGeometryPoint'; + const result = await action({ + input_geometry, + geometry_type, + url: layer.url + }); + let res; + if (result?.results?.length > 0) { + res = result.results[0] + } + if(cb) cb(res) + break; + } + case '030300': + break; + case '081100': { + const queryMode = 'BUFFER'; + const bufferDistance = 0.0005; // 缓冲距离大概是50米 + const spatialQueryMode = 'INTERSECT'; + const geometry = { + id: 0, + style: null, + parts: [1], + points: [ + { + x: lng, + y: lat + } + ], + type: 'POINT' + }; + let type = ''; + let isSite = false; + let layerTable = ''; + if (layer.extendData) { + const extendData = JSON.parse(layer.extendData); + + } + const result = await action({ + queryMode, + spatialQueryMode, + bufferDistance, + geometry, + layerName: layer.text, + layerTable, + url: layer.url, + k: layer.serviceToken + }); + if ([200, 201].includes(result.status)) { + console.log('处理业务数据 >>>>>> ', result) + + } + break; + } + default: + break; + } + }); +};