diff --git a/src/components/Common/Cesium/index.js b/src/components/Common/Cesium/index.js index 6c52318..ecaf560 100644 --- a/src/components/Common/Cesium/index.js +++ b/src/components/Common/Cesium/index.js @@ -167,7 +167,7 @@ export default class MyCesium { */ setClientByCenter(position) { this.viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 100000), // 目标点坐标 + destination: Cesium.Cartesian3.fromDegrees(position.longitude, position.latitude, 50000), // 目标点坐标 orientation: { heading: 0, // 航向角(弧度),0表示正北 pitch: Cesium.Math.toRadians(-90), // 俯仰角(弧度),-90度表示垂直向下看 diff --git a/src/components/Common/Chart/CustomChart.vue b/src/components/Common/Chart/CustomChart.vue new file mode 100644 index 0000000..a0cff43 --- /dev/null +++ b/src/components/Common/Chart/CustomChart.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/components/Common/Chart/constant.js b/src/components/Common/Chart/constant.js new file mode 100644 index 0000000..3698fd9 --- /dev/null +++ b/src/components/Common/Chart/constant.js @@ -0,0 +1,45 @@ +export const loadingOptions = { + graphic: { + elements: [ + { + type: 'group', + left: 'center', + top: 'center', + children: new Array(7).fill(0).map((val, i) => ({ + type: 'rect', + x: i * 20, + shape: { + x: 0, + y: -40, + width: 10, + height: 80, + }, + style: { + fill: '#5470c6', + }, + keyframeAnimation: { + duration: 1000, + delay: i * 200, + loop: true, + keyframes: [ + { + percent: 0.5, + scaleY: 0.3, + easing: 'cubicIn', + }, + { + percent: 1, + scaleY: 1, + easing: 'cubicOut', + }, + ], + }, + })), + }, + ], + }, +} + +export const defaultOptions = { + grid: { left: 10, right: 10, top: 40, bottom: 10 }, +} diff --git a/src/components/Common/register.js b/src/components/Common/register.js index bf0fba3..a2d1fe8 100644 --- a/src/components/Common/register.js +++ b/src/components/Common/register.js @@ -14,6 +14,7 @@ import LatitudeInput from './Form/LatitudeInput.vue' import DurationInput from './Form/DurationInput.vue' import WangEditor from './WangEditor/Index.vue' +import CustomChart from './Chart/CustomChart.vue' import Loading from './Directives/Loading' import resize from 'vue-resize-directive' @@ -21,6 +22,7 @@ import resize from 'vue-resize-directive' import Bus from './Bus/index' import MyCesium from './Cesium/index' import MyWebsocket from './Websocket/index' +import './utils/extends' export default { install(Vue) { @@ -40,6 +42,7 @@ export default { Vue.component('DurationInput', DurationInput) Vue.component('WangEditor', WangEditor) + Vue.component('CustomChart', CustomChart) Vue.directive('loading', Loading) Vue.directive('resize', resize) diff --git a/src/components/Common/utils/extends.js b/src/components/Common/utils/extends.js new file mode 100644 index 0000000..ccdff3a --- /dev/null +++ b/src/components/Common/utils/extends.js @@ -0,0 +1,32 @@ +Object.isObject = function (target) { + return target !== null && typeof target === 'object' && target.toString() === '[object Object]' +} + +Object.deepAssign = function (...resources) { + let res + for (var i = 0; i < resources.length;) { + const resource = resources[i] + if (Object.isObject(resource)) { + i++ + } else { + res = resources.splice(0, i + 1).reverse()[0] + i = 0 + continue + } + } + if (resources.length === 0) { + return res + } else if (resources.length === 1) { + return resources[0] + } + const allKeys = [...new Set(resources.flatMap(resource => Object.keys(resource)))] + res = {} + allKeys.forEach(key => { + res[key] = Object.deepAssign( + ...resources + .filter(resource => Object.prototype.hasOwnProperty.call(resource, key)) + .map(resource => resource[key]) + ) + }) + return res +} diff --git a/src/config/router.config.js b/src/config/router.config.js index 50ef7c1..010faf1 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -112,6 +112,10 @@ export const constantRouterMap = [ path: '/guaranteeProcess', component: () => import(/* webpackChunkName: "fail" */ '@/views/functional/guaranteeProcess.vue'), }, + { + path: '/roomStatistics', + component: () => import(/* webpackChunkName: "fail" */ '@/views/functional/roomStatistics.vue'), + }, { path: '/404', component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'), diff --git a/src/layouts/BasicLayout.less b/src/layouts/BasicLayout.less index 829bb41..cfb16e0 100644 --- a/src/layouts/BasicLayout.less +++ b/src/layouts/BasicLayout.less @@ -49,7 +49,7 @@ display: none; } .ant-pro-basicLayout-content { - margin: 0; + margin: 0 !important; > .ant-pro-basicLayout-children-content-wrap { height: 100%; > .ant-pro-grid-content { diff --git a/src/views/functional/roomStatistics.vue b/src/views/functional/roomStatistics.vue new file mode 100644 index 0000000..1fdc62f --- /dev/null +++ b/src/views/functional/roomStatistics.vue @@ -0,0 +1,182 @@ + + + + + diff --git a/src/views/simulationScene/database/bzhjsjk.vue b/src/views/simulationScene/database/bzhjsjk.vue index 71b885f..bd63c50 100644 --- a/src/views/simulationScene/database/bzhjsjk.vue +++ b/src/views/simulationScene/database/bzhjsjk.vue @@ -80,6 +80,7 @@ this.$http({ - url: `/environment/weather/list`, + url: `/baseData/weatherResource/list`, method: 'get', params: { id: this.xd.selectedKeys[0], ...queryParams }, }), columns: [ { dataIndex: 'serial' }, - { title: '区域', dataIndex: 'area' }, - { title: '日期', dataIndex: 'date' }, - { title: '天气', dataIndex: 'weather' }, - { title: '大气压', dataIndex: 'airPressure' }, - { title: '空气质量', dataIndex: 'airQuality' }, - { title: '湿度', dataIndex: 'humidity' }, - { title: '降水量', dataIndex: 'precipitation' }, - { title: '能见度', dataIndex: 'visibility' }, - { title: '风向', dataIndex: 'windDirection' }, - { title: '风力', dataIndex: 'windPower' }, - { title: '风速', dataIndex: 'windSpeed' }, - { dataIndex: 'action', width: 100 }, + { title: '天气类型', dataIndex: 'weatherType' }, + { title: '持续开始时间', dataIndex: 'lastBegTime' }, + { title: '持续结束时间', dataIndex: 'lastEndTime' }, + // { dataIndex: 'action', width: 100 }, ], }, pageConfig: true, @@ -137,26 +130,30 @@ export default { mode: '', formItems: [ { - label: '区域', - prop: 'area', + label: '天气类型', + prop: 'weatherType', component: 'AntOriginSelect', - options: { dataSource: () => this.$http({ url: `/system/area/getTreeSelect`, method: 'get' }) }, + options: { + dataSource: () => ({ + data: [ + { title: 'rain', id: 'rain' }, + { title: 'snow', id: 'snow' }, + ], + }), + }, }, { - label: '日期', - prop: 'date', + label: '持续开始时间', + prop: 'lastBegTimeStr', component: 'a-date-picker', - options: { format: 'YYYY/MM/DD', valueFormat: 'YYYY/MM/DD' }, + options: { showTime: true, valueFormat: 'YYYY-MM-DD HH:mm:ss' }, + }, + { + label: '持续结束时间', + prop: 'lastEndTimeStr', + component: 'a-date-picker', + options: { showTime: true, valueFormat: 'YYYY-MM-DD HH:mm:ss' }, }, - { label: '天气', prop: 'weather' }, - { label: '大气压', prop: 'airPressure' }, - { label: '空气质量', prop: 'airQuality' }, - { label: '湿度', prop: 'humidity' }, - { label: '降水量', prop: 'precipitation' }, - { label: '能见度', prop: 'visibility' }, - { label: '风向', prop: 'windDirection' }, - { label: '风力', prop: 'windPower' }, - { label: '风速', prop: 'windSpeed' }, ], formRules: {}, formData: {}, @@ -175,17 +172,10 @@ export default { }), columns: [ { dataIndex: 'serial' }, - { title: '区域', dataIndex: 'area' }, - { title: '持续时间', dataIndex: 'duration' }, - { title: '环境变化趋势', dataIndex: 'environmentalChangeTrends' }, - { title: '环境复杂度', dataIndex: 'environmentalComplexity' }, - { title: '磁场强度', dataIndex: 'fieldStrength' }, - { title: '频率', dataIndex: 'frequency' }, - { title: '频率区间', dataIndex: 'frequencyRang' }, - { title: '干扰幅度', dataIndex: 'interferenceAmplitude' }, - { title: '干扰源', dataIndex: 'interferenceSource' }, - { title: '干扰类型', dataIndex: 'interferenceType' }, - { title: '波型', dataIndex: 'waveType' }, + { title: '电磁强度', dataIndex: 'fieldStrength' }, + { title: '频率', dataIndex: 'ebeR' }, + { title: '经度', dataIndex: 'ebeLon' }, + { title: '纬度', dataIndex: 'ebeLat' }, { dataIndex: 'action', width: 100 }, ], }, @@ -198,21 +188,22 @@ export default { mode: '', formItems: [ { - label: '区域', - prop: 'area', + label: '电磁强度', + prop: 'fieldStrength', component: 'AntOriginSelect', - options: { dataSource: () => this.$http({ url: `/system/area/getTreeSelect`, method: 'get' }) }, + options: { + dataSource: () => ({ + data: [ + { title: '高', id: '高' }, + { title: '中', id: '中' }, + { title: '低', id: '低' }, + ], + }), + }, }, - { label: '持续时间', prop: 'duration' }, - { label: '环境变化趋势', prop: 'environmentalChangeTrends' }, - { label: '环境复杂度', prop: 'environmentalComplexity' }, - { label: '磁场强度', prop: 'fieldStrength' }, - { label: '频率', prop: 'frequency' }, - { label: '频率区间', prop: 'frequencyRang' }, - { label: '干扰幅度', prop: 'interferenceAmplitude' }, - { label: '干扰源', prop: 'interferenceSource' }, - { label: '干扰类型', prop: 'interferenceType' }, - { label: '波型', prop: 'waveType' }, + { label: '频率', prop: 'ebeR' }, + { label: '经度', prop: 'ebeLon', component: 'LongitudeInput' }, + { label: '纬度', prop: 'ebeLat', component: 'LatitudeInput' }, ], formRules: {}, formData: {}, @@ -258,26 +249,18 @@ export default { handleOpenAddQxhjModal() { this.qxhjModal.title = '新建气象环境' this.qxhjModal.mode = 'add' - this.qxhjModal.formData = { sceneId: this.xd.selectedKeys[0] } + this.qxhjModal.formData = { scenarioId: this.xd.selectedKeys[0] } this.qxhjModal.visible = true }, - async handleOpenEditQxhjModal(record) { - try { - const res = await this.$http({ - url: `/environment/weather/${record.id}`, - method: 'get', - }) - this.qxhjModal.title = `编辑气象环境` - this.qxhjModal.mode = 'edit' - this.qxhjModal.formData = { ...res.data } - this.qxhjModal.visible = true - } catch (error) { - console.log(error) - } + handleOpenEditQxhjModal(record) { + this.qxhjModal.title = `编辑气象环境` + this.qxhjModal.mode = 'edit' + this.qxhjModal.formData = { ...record } + this.qxhjModal.visible = true }, handleSubmitQxhj(formData) { return this.$http({ - url: `/environment/weather/save`, + url: `/baseData/weatherResource/add`, method: 'post', data: formData, }) diff --git a/src/views/subsystem/display/index.vue b/src/views/subsystem/display/index.vue index fdedf75..5f36d3c 100644 --- a/src/views/subsystem/display/index.vue +++ b/src/views/subsystem/display/index.vue @@ -1,8 +1,8 @@