diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index bb421c3..357358a 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -83,6 +83,9 @@ .ml20 { margin-left: 20px; } +.mt50 { + margin-top: 50px; +} .mb50 { margin-bottom: 50px; } diff --git a/src/components/ZhengBian/index.vue b/src/components/ZhengBian/index.vue index 126d708..7e5b45d 100644 --- a/src/components/ZhengBian/index.vue +++ b/src/components/ZhengBian/index.vue @@ -36,7 +36,7 @@
- + @@ -44,6 +44,27 @@ 数据修改 + + + + + + + + + + + + + + + + + + + 确 定 + + @@ -82,43 +103,20 @@ - - - - - - - - - - - - - - - - - -
- - -
- 将文件拖到此处,或点击上传 +
+ + +
+ 将文件拖到此处,或点击上传 +
+ +
+
+
@@ -136,7 +134,7 @@ import useAppStore from '@/store/modules/app' import { getStationConfig } from '@/config/stationConfig' const device = computed(() => useAppStore().device); - + const route = useRoute(); const props = defineProps({ stationType: { type: String, @@ -264,6 +262,52 @@ dataType: staticType.value, chartType: echartType.value }); + let routeQuery = ref(null) + const getRouteQuery = () => { + routeQuery.value = route.query; + if (JSON.stringify(routeQuery.value) !== '{}') { + queryParams.startTime = routeQuery.value.startTime + queryParams.endTime = routeQuery.value.endTime + queryParams.stnm = routeQuery.value.name // 保存站点名称 + + // 临时存储 name,用于后续匹配 + const targetName = routeQuery.value.name; + + // 等待 treeSelectOptions 加载完成后再设置 stnmId + if (treeSelectOptions.value.length > 0) { + const matchedNode = findNodeByName(treeSelectOptions.value, targetName); + if (matchedNode) { + queryParams.stnmId = matchedNode.stnmId; + queryParams.stnmIds = queryParams.stnmId; + } + } else { + // 如果还没加载完,监听 treeSelectOptions 变化 + watch(() => treeSelectOptions.value, (newVal) => { + if (newVal.length > 0 && !queryParams.stnmId) { + const matchedNode = findNodeByName(newVal, targetName); + if (matchedNode) { + queryParams.stnmId = matchedNode.stnmId; + queryParams.stnmIds = queryParams.stnmId; + } + } + }, { immediate: true }); + } + } + } + // 查找对应的站点名称 + const findNodeByName = (nodes, name) => { + for (let node of nodes) { + if (node.name === name) { + return node; + } + if (node.children && node.children.length > 0) { + const found = findNodeByName(node.children, name); + if (found) return found; + } + } + return null; + }; + const timeType = computed(() => { return staticType.value == '0' ? 'hour' : "day" }) @@ -307,8 +351,8 @@ // 新增处理站点变化的函数:stnmId:是当前选择的站点ID,options:是站点选择器的options,stnm:是当前选择的站点名称 const handleStationChange = async (stnmId, options, stnm) => { - queryParams.stnmId = stnmId queryParams.stnm = stnm + queryParams.stnmId = stnmId queryParams.stnmIds = stnmId const data = options.filter(item => item.stnmId != stnmId) // const data = options @@ -345,21 +389,39 @@ let res = await proxy.axiosGet('basic/stype/getNewTreeStationType/', { 'type': proxy.stationType, 'isState': queryParams.isState }); if (res.code == 0) { treeSelectOptions.value = res.data + if (JSON.stringify(routeQuery.value) !== '{}') { + const matchedNode = findNodeByName(res.data, routeQuery.value.name); + if (matchedNode) { + queryParams.stnmId = matchedNode.stnmId; + queryParams.stnmIds = queryParams.stnmId; + queryParams.stnm = matchedNode.name; + } else { + // 如果没找到 name,则使用第一个叶子节点 + const firstLeaf = findFirstLeafNode(res.data); + if (firstLeaf) { + queryParams.stnmId = firstLeaf.stnmId; + queryParams.stnmIds = queryParams.stnmId; + queryParams.stnm = firstLeaf.name; + } + } + } // 设置默认值为第一个叶子节点的stnmId - if (treeSelectOptions.value.length > 0) { - const firstLeafNode = findFirstLeafNode(treeSelectOptions.value); - if (firstLeafNode) { - queryParams.stnmId = firstLeafNode.stnmId; + else { + // 没有路由参数,使用第一个叶子节点 + const firstLeaf = findFirstLeafNode(res.data); + if (firstLeaf) { + queryParams.stnmId = firstLeaf.stnmId; queryParams.stnmIds = queryParams.stnmId; - await Promise.all([ - drawTable1(), - drawTable2(), - drawTable3(), - getEchartsData() - - ]); + queryParams.stnm = firstLeaf.name; } } + await Promise.all([ + drawTable1(), + drawTable2(), + drawTable3(), + getEchartsData() + + ]); } } catch (error) { @@ -689,14 +751,12 @@ handleQuery() } // 对比站点改变 - let compareStation = ref() + let compareStation = ref([]) const changeCompareStnmIds = (val) => { - console.log(val, '======val') - // compareStation.value = val - - // let list = [queryParams.stnmId, ...val]; - // let str = list.join(',') - // queryParams.stnmIds = str + compareStation.value = val + let list = [queryParams.stnmId, ...val]; + let str = list.join(',') + queryParams.stnmIds = str } // 对比查询 @@ -715,11 +775,7 @@ } /**************************************************** 数据修改弹窗 ******************************************************/ let formRef = ref(null) - // 取消按钮 - const cancel = () => { - open.value = false; - reset(); - } + const reset = () => { Object.assign(form, {}); proxy.resetForm("formRef"); @@ -785,6 +841,8 @@ } onMounted(() => { + getRouteQuery() + getTreeStation() getCompareTreeStation() }) diff --git a/src/config/stationConfig.js b/src/config/stationConfig.js index 0fbaa60..896f864 100644 --- a/src/config/stationConfig.js +++ b/src/config/stationConfig.js @@ -14,20 +14,30 @@ export const STATION_CONFIGS = { // 建德配置 jiande: { showStationType: false, - stationTypes: [], + stationTypes: [ + { label: '水文测站', value: '0' }, + { label: '气象站', value: '1' } + + ], showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据) }, // 青田配置 qingtian: { showStationType: false, - stationTypes: [], + stationTypes: [ + { label: '水文测站', value: '0' }, + { label: '气象站', value: '1' } + ], showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据) }, // 赣县配置 ganxian: { showStationType: false, - stationTypes: [], + stationTypes: [ + { label: '水文测站', value: '0' }, + { label: '气象站', value: '1' } + ], showDeviceStcd: true,// 是否显示设备编码(遥测数据-设备数据) } }; diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 42fffdf..3cc2b8d 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -34,7 +34,8 @@ const tagsViewStore = useTagsViewStore() .hasTagsView { .app-main { /* 84 = navbar + tags-view = 50 + 34 */ - min-height: calc(100vh - 84px); + /* min-height: calc(100vh - 84px); */ + min-height: calc(100vh - 50px); } .fixed-header + .app-main { diff --git a/src/views/data/history/index.vue b/src/views/data/history/index.vue index 7aad398..ef82611 100644 --- a/src/views/data/history/index.vue +++ b/src/views/data/history/index.vue @@ -2,14 +2,15 @@
- - - + + + + - + @@ -72,9 +73,10 @@ stnmId: '', stationType: "A", startTime: dateTime.value[0], - endTime: dateTime.value[1] + endTime: dateTime.value[1], + isState: "0", + stcd: '' }) - let propety = ref('0') // 根据测站属性获取测站名称 const stationList = ref([]) @@ -82,8 +84,8 @@ if (val === undefined || val === null) { val = '0' // 默认值 } - propety.value = val; - queryParams.prop = val + queryParams.isState = val; + // queryParams.prop = val try { console.log(queryParams, val) let res = await proxy.axiosGet('/basic/station/queryStnmandStnmId', queryParams); @@ -92,12 +94,17 @@ stationList.value = data; queryParams.stnmId = data[0].stnmId getStcdList() - getEchartsData() + } } catch (error) { } } + // 改变测站名称 + const changeStnmId = (val) => { + queryParams.stnmId = val + getStcdList() + } // 获取设备编号数据列表下拉框 const stcdList = ref([]) const getStcdList = async () => { @@ -106,39 +113,55 @@ if (res.code == 0) { let data = res.data stcdList.value = data; + queryParams.stcd = data[0] + getEchartsData() } } catch (error) { } } - const unitList = [{ - label: "雨量(mm)", - value: "A" - }, { - label: "水位(m)", - value: "B" - }, { - label: "水位(m)", - value: "C" - }, { - label: "风速(m/s)", - value: "S" - }, { - label: "温度(℃)", - value: "T" - }, { - label: "湿度(%)", - value: "R" - }, { - label: "电压(V)", - value: "V" - }, { - label: "风向", - value: "U" - }, { - label: "", - value: "Y" - },] + const unitList = [ + { + label: "雨量(mm)", + value: "A" + }, + { + label: "水位(m)", + value: "B" + }, + { + label: "水位(m)", + value: "C" + }, + { + label: "流量(m³/s)", + value: "E" + }, + { + label: "风速(m/s)", + value: "S" + }, + { + label: "温度(℃)", + value: "T" + }, + { + label: "湿度(%)", + value: "R" + }, + { + label: "电压(V)", + value: "V" + }, + { + label: "风向", + value: "U" + }, + { + label: "", + value: "Y" + }, + ] let color1 = ['#1075fd', '#0fec7d', '#d364fd', '#5cffea', '#f2b622', '#fc3c54', '#EE1289', '#ee9c9c', '#06e8d6', '#de79c2', '#bebe0f', '#00F5FF', @@ -153,8 +176,10 @@ const echartsData = ref([]) const getEchartsData = async () => { fullscreenLoading.value = true + // /history/data/historydataDetail // 余姚 + // /history/data/historydata // 建德 try { - let url = '/history/data/historydata' + let url = '/history/data/historydataDetail' let res = await proxy.axiosPost2(url, queryParams); if (res.code == 0) { const seriesMap = res.data @@ -193,6 +218,7 @@ }) echartsData.value = result + console.log(echartsData.value, 'echartsData.value') } } catch (error) { @@ -219,15 +245,15 @@ const showDeviceStcd = computed(() => { return currentStationConfig.value.showDeviceStcd; }); - + // 测站类型选项 + const mainTypes = computed(() => { + return currentStationConfig.value.stationTypes; + }); onMounted(() => { propChange('0') }) - const propsList = ref([ - { label: '水文测站', value: '0' }, - { label: '气象站', value: '1' } - ]) + \ No newline at end of file diff --git a/src/views/statistic/rain/jslmonth.vue b/src/views/statistic/rain/jslmonth.vue index 3360c27..306d31f 100644 --- a/src/views/statistic/rain/jslmonth.vue +++ b/src/views/statistic/rain/jslmonth.vue @@ -35,11 +35,11 @@
{{tableTitle}}
- + - + @@ -392,18 +392,18 @@ } const interval_options = ref([ - { value: "01", label: "1月" }, - { value: "02", label: "2月" }, - { value: "03", label: "3月" }, - { value: "04", label: "4月" }, - { value: "05", label: "5月" }, - { value: "06", label: "6月" }, - { value: "07", label: "7月" }, - { value: "08", label: "8月" }, - { value: "09", label: "9月" }, - { value: "10", label: "10月" }, - { value: "11", label: "11月" }, - { value: "12", label: "12月" }, + { value: 1, label: "1月" }, + { value: 2, label: "2月" }, + { value: 3, label: "3月" }, + { value: 4, label: "4月" }, + { value: 5, label: "5月" }, + { value: 6, label: "6月" }, + { value: 7, label: "7月" }, + { value: 8, label: "8月" }, + { value: 9, label: "9月" }, + { value: 10, label: "10月" }, + { value: 11, label: "11月" }, + { value: 12, label: "12月" }, { value: "all", label: "全年" }, ]) \ No newline at end of file diff --git a/src/views/syslog/alarm/index.vue b/src/views/syslog/alarm/index.vue index f30c936..91dd9f0 100644 --- a/src/views/syslog/alarm/index.vue +++ b/src/views/syslog/alarm/index.vue @@ -79,11 +79,17 @@
+ +
+ +
+