From aa323c0d9ccd19ea0c7fa41dc6175ddf4f88c59f Mon Sep 17 00:00:00 2001 From: guanj Date: Tue, 15 Jul 2025 16:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cs-device-boot/edData.ts | 10 ++ src/components/echarts/color.ts | 4 +- src/components/echarts/rmsboxi.vue | 24 +-- src/components/echarts/shushiboxi.vue | 36 ++-- src/components/table/index.vue | 94 +++++++--- src/components/tree/device.vue | 5 +- src/components/tree/govern/deviceTree.vue | 1 + src/components/tree/point.vue | 6 +- src/utils/tableStore.ts | 4 +- src/views/auth/audit/index.vue | 2 +- src/views/auth/userList/index.vue | 4 +- src/views/govern/alarm/Abnormal.vue | 22 ++- src/views/govern/alarm/Device.vue | 33 +++- src/views/govern/alarm/Steady.vue | 9 +- src/views/govern/alarm/Transient.vue | 14 +- src/views/govern/analyze/APF/index.vue | 11 +- src/views/govern/analyze/DVR/index.vue | 126 ++++++++------ .../device/control/analysisList/index.vue | 4 +- .../device/control/analysisList/popup.vue | 6 +- src/views/govern/device/control/detail.vue | 2 +- src/views/govern/device/control/index.vue | 4 +- .../govern/device/control/moduleData.vue | 17 +- .../supplementaryRecruitment/history.vue | 2 +- .../govern/device/control/tabs/event.vue | 4 +- .../govern/device/control/tabs/realtime.vue | 12 +- .../govern/device/control/tabs/trend.vue | 4 +- .../device/planData/components/transient.vue | 6 +- src/views/govern/device/planData/index.vue | 6 +- src/views/govern/log/debug.vue | 4 +- src/views/govern/log/opera.vue | 4 +- src/views/govern/log/push.vue | 2 +- src/views/govern/manage/basic/dictionary.vue | 1 + .../govern/manage/basic/popupDictionary.vue | 26 +-- src/views/govern/manage/basic/template.vue | 2 +- src/views/govern/manage/engineering.vue | 160 ++++++++++++++++-- src/views/govern/manage/factory.vue | 36 ++-- src/views/govern/manage/feedback.vue | 2 +- src/views/govern/manage/monthly.vue | 77 ++++++--- src/views/govern/reportForms/index.vue | 4 +- .../govern/terminal/deviceLedger/index.vue | 2 +- .../govern/terminal/deviceMonitor/index.vue | 2 +- .../Region/thermodynamicDiagram.vue | 8 +- .../Event-boot/Region/transientassessment.vue | 10 +- src/views/pms/comptroller/list.vue | 2 +- .../sags/operationsManagement/index.vue | 4 +- .../sags/operationsManagement/statistics.vue | 16 +- src/views/setting/dictionary/list/index.vue | 4 +- .../setting/dictionary/version/index.vue | 2 +- src/views/system/reportForms/index.vue | 4 +- types/table.d.ts | 1 + 50 files changed, 582 insertions(+), 263 deletions(-) diff --git a/src/api/cs-device-boot/edData.ts b/src/api/cs-device-boot/edData.ts index 1b3c80c..0211b07 100644 --- a/src/api/cs-device-boot/edData.ts +++ b/src/api/cs-device-boot/edData.ts @@ -22,11 +22,21 @@ export const auditEdData = (data) => { data: data, }) } +// 修改工程 export const auditEngineering = (data) => { return request({ url: '/cs-device-boot/engineering/auditEngineering', method: 'post', + data: data, + }) +} +// 修改项目 +export const updateProject = (data) => { + return request({ + url: '/cs-device-boot/project/updateProject', + method: 'post', + data: data, }) } \ No newline at end of file diff --git a/src/components/echarts/color.ts b/src/components/echarts/color.ts index a3d2211..c7e3d18 100644 --- a/src/components/echarts/color.ts +++ b/src/components/echarts/color.ts @@ -1,4 +1,4 @@ export let color = [ '#07CCCA','#00BFF5', '#FFBF00', '#77DA63', '#D5FF6B', '#Ff6600', '#FF9100', '#5B6E96', '#66FFCC', '#B3B3B3'] -export const gradeColor3 = ['#339966', '#FFCC33', '#CC0000'] -export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#CC0000'] +export const gradeColor3 = ['#339966', '#FFCC33', '#A52a2a'] +export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#A52a2a'] diff --git a/src/components/echarts/rmsboxi.vue b/src/components/echarts/rmsboxi.vue index db2a968..3f5cfb9 100644 --- a/src/components/echarts/rmsboxi.vue +++ b/src/components/echarts/rmsboxi.vue @@ -745,7 +745,7 @@ export default { zhou = waveDatas[0].RMSSMinDetail.secondeZhou; } - colors.push("#FFCC00"); + colors.push("#DAA520"); colors.push("#fff"); colors.push("#fff"); break; @@ -783,8 +783,8 @@ export default { rmsvY = waveDatas[0].RMSSMinDetail.rmsvSecondY; zhou = waveDatas[0].RMSSMinDetail.secondeZhou; } - colors.push("#FFCC00"); - colors.push("#009900"); + colors.push("#DAA520"); + colors.push("#2E8B57"); colors.push("#fff"); break; case 3: @@ -822,9 +822,9 @@ export default { rmsvY = waveDatas[0].RMSSMinDetail.rmsvSecondY; zhou = waveDatas[0].RMSSMinDetail.secondeZhou; } - colors.push("#FFCC00"); - colors.push("#009900"); - colors.push("#CC0000"); + colors.push("#DAA520"); + colors.push("#2E8B57"); + colors.push("#A52a2a"); break; } if (waveDatas[0].unit === "电压") { @@ -1090,7 +1090,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#FFCC00", + color: "#DAA520", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 @@ -1105,7 +1105,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#009900", + color: "#2E8B57", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 @@ -1120,7 +1120,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#CC0000", + color: "#A52a2a", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 @@ -1518,7 +1518,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#FFCC00", + color: "#DAA520", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 @@ -1533,7 +1533,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#009900", + color: "#2E8B57", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 @@ -1548,7 +1548,7 @@ export default { symbol: "none", sampling: "average", itemStyle: { - color: "#CC0000", + color: "#A52a2a", }, progressive: 500, // 渲染阈值,大于此值则启动渐进渲染 diff --git a/src/components/echarts/shushiboxi.vue b/src/components/echarts/shushiboxi.vue index a812072..d3d8f13 100644 --- a/src/components/echarts/shushiboxi.vue +++ b/src/components/echarts/shushiboxi.vue @@ -461,7 +461,7 @@ export default { adata = waveDatas[0].shunshiS.shunshiSA } - colors.push('#FFCC00') + colors.push('#DAA520') colors.push('#fff') colors.push('#fff') break @@ -481,8 +481,8 @@ export default { adata = waveDatas[0].shunshiS.shunshiSA bdata = waveDatas[0].shunshiS.shunshiSB } - colors.push('#FFCC00') - colors.push('#009900') + colors.push('#DAA520') + colors.push('#2E8B57') colors.push('#fff') break case 3: @@ -505,9 +505,9 @@ export default { cdata = waveDatas[0].shunshiS.shunshiSC } - colors.push('#FFCC00') - colors.push('#009900') - colors.push('#CC0000') + colors.push('#DAA520') + colors.push('#2E8B57') + colors.push('#A52a2a') break } @@ -754,7 +754,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#FFCC00' + color: '#DAA520' }, progressive: 1000, // 渲染阈值,大于此值则启动渐进渲染 @@ -770,7 +770,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#009900' + color: '#2E8B57' }, progressive: 1000, // 渲染阈值,大于此值则启动渐进渲染 @@ -786,7 +786,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#CC0000' + color: '#A52a2a' }, progressive: 1000, // 渲染阈值,大于此值则启动渐进渲染 @@ -844,24 +844,24 @@ export default { switch (this.iphasic) { case 1: a = waveDataTemp.title.aTitle - colors.push('#FFCC00') + colors.push('#DAA520') colors.push('#fff') colors.push('#fff') break case 2: a = waveDataTemp.title.aTitle b = waveDataTemp.title.bTitle - colors.push('#FFCC00') - colors.push('#009900') + colors.push('#DAA520') + colors.push('#2E8B57') colors.push('#fff') break case 3: a = waveDataTemp.title.aTitle b = waveDataTemp.title.bTitle c = waveDataTemp.title.cTitle - colors.push('#FFCC00') - colors.push('#009900') - colors.push('#CC0000') + colors.push('#DAA520') + colors.push('#2E8B57') + colors.push('#A52a2a') break } @@ -1123,7 +1123,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#FFCC00' + color: '#DAA520' }, large: true, progressive: 1000, @@ -1138,7 +1138,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#009900' + color: '#2E8B57' }, progressive: 1000, // 渲染阈值,大于此值则启动渐进渲染 @@ -1153,7 +1153,7 @@ export default { symbol: 'none', sampling: 'average', itemStyle: { - color: '#CC0000' + color: '#A52a2a' }, progressive: 1000, // 渲染阈值,大于此值则启动渐进渲染 diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 85e3548..b448b82 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -1,23 +1,44 @@ @@ -51,7 +77,7 @@ const config = useConfig() const tableRef = ref() const tableStore = inject('tableStore') as TableStoreClass const router = useRouter() - +const key = ref(0) interface Props extends /* @vue-ignore */ Partial> { isGroup?: boolean showOverflow?: boolean @@ -82,7 +108,32 @@ const pageSizes = computed(() => { } return defaultSizes }) +const handleSortChange = ({ field, order }: any) => { + // console.log('🚀 ~ handleSortChange ~ prop, order :', field, order) + if (field && order) { + // 根据当前排序条件对所有数据进行排序 + const list = tableStore.table.copyData.sort((a, b) => { + if (order === 'asc') { + return a[field] > b[field] ? 1 : -1 + } else { + return a[field] < b[field] ? 1 : -1 + } + }) + console.log(tableStore.isWebPaging) + if (tableStore.isWebPaging) { + tableStore.table.data = JSON.parse( + JSON.stringify( + window.XEUtils.chunk(list, tableStore.table.params!.pageSize)[tableStore.table.params!.pageNum - 1] + ) + ) + } else { + tableStore.table.data = JSON.parse(JSON.stringify(list)) + } + + // key.value += 1 + } +} /* * 记录选择的项 */ @@ -98,8 +149,6 @@ watch( () => tableStore.table.allFlag, newVal => { if (tableStore.table.allFlag) { - console.log("🚀 ~ tableStore.table:", tableStore.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '') - tableRef.value?.exportData({ filename: tableStore.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字 sheetName: 'Sheet1', @@ -107,14 +156,15 @@ watch( useStyle: true, data: tableStore.table.allData, // 数据源 // 过滤那个字段导出 columnFilterMethod: function (column: any) { - return !(column.column.title === undefined || column.column.title === '序号' || column.column.title === '操作') + return !( + column.column.title === undefined || + column.column.title === '序号' || + column.column.title === '操作' + ) } }) tableStore.table.allFlag = false - } - - } ) watch( diff --git a/src/components/tree/device.vue b/src/components/tree/device.vue index 3327f9b..7b76da7 100644 --- a/src/components/tree/device.vue +++ b/src/components/tree/device.vue @@ -134,7 +134,7 @@ const defaultProps = { label: 'name', value: 'id' } -const process = ref('2') +const process = ref('') //治理设备数据 const zlDeviceData = ref([]) const zlDevList = ref([]) @@ -181,6 +181,9 @@ watch(process, val => { }, 0) }) function filterProcess(nodes: any) { + if (process.value == '') { + return nodes + } return nodes .map(node => { // 递归处理子节点 diff --git a/src/components/tree/govern/deviceTree.vue b/src/components/tree/govern/deviceTree.vue index 842e5c7..c33d0d4 100644 --- a/src/components/tree/govern/deviceTree.vue +++ b/src/components/tree/govern/deviceTree.vue @@ -32,6 +32,7 @@ const config = useConfig() const tree = ref() const treRef = ref() const changeDeviceType = (val: any, obj: any) => { + console.log("🚀 ~ changeDeviceType ~ val:", val,obj) emit('deviceTypeChange', val, obj) } getDeviceTree().then(res => { diff --git a/src/components/tree/point.vue b/src/components/tree/point.vue index 36bb33c..9f0060d 100644 --- a/src/components/tree/point.vue +++ b/src/components/tree/point.vue @@ -119,7 +119,7 @@ const props = withDefaults(defineProps(), { type: '', data: [] }) -const process = ref('2') +const process = ref('') const route = useRoute() const { proxy } = useCurrentInstance() const menuCollapse = ref(false) @@ -238,12 +238,16 @@ const filterNode = (value: string, data: any, node: any) => { } } function filterProcess(nodes: any) { + if (process.value == '') { + return nodes + } return nodes .map(node => { // 递归处理子节点 const children = node.children ? filterProcess(node.children) : [] // 如果当前节点的process=4,或者有子节点满足条件,则保留当前节点 + if (node.process == process.value || children.length > 0) { return { ...node, diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index abf4074..f35868a 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -34,6 +34,7 @@ export default class TableStore { ref: null, selection: [], data: [], + copyData: [], allData: [], allFlag: false, webPagingData: [], @@ -93,6 +94,7 @@ export default class TableStore { this.table.data = [] this.table.total = 0 } + this.table.copyData = filtration(this.table.data) if (Array.isArray(res)) { this.table.data = res } @@ -204,7 +206,7 @@ export default class TableStore { this.table.allData = filtration(res.data.records || res.data) this.table.allFlag = data.showAllFlag || true }) - },1500) + }, 1500) } ] ]) diff --git a/src/views/auth/audit/index.vue b/src/views/auth/audit/index.vue index 9e92461..22d2832 100644 --- a/src/views/auth/audit/index.vue +++ b/src/views/auth/audit/index.vue @@ -29,7 +29,7 @@ const tableStore = new TableStore({ { title: '角色', field: 'roleName' }, // { title: '部门', field: 'deptId' }, { title: '电话', field: 'phoneShow' }, - { title: '注册时间', field: 'registerTime' }, + { title: '注册时间', field: 'registerTime', sortable: true }, { title: '类型', field: 'casualUserName' }, { title: '状态', field: 'stateName' }, { diff --git a/src/views/auth/userList/index.vue b/src/views/auth/userList/index.vue index 3d9d54c..5e00cb8 100644 --- a/src/views/auth/userList/index.vue +++ b/src/views/auth/userList/index.vue @@ -53,8 +53,8 @@ const tableStore = new TableStore({ { title: '角色', field: 'roleName', minWidth: '130' }, // { title: '部门', field: 'deptName', minWidth: '200' }, { title: '电话', field: 'phoneShow', minWidth: '100' }, - { title: '注册时间', field: 'registerTime', minWidth: '130' }, - { title: '登录时间', field: 'loginTime', minWidth: '130' }, + { title: '注册时间', field: 'registerTime', minWidth: '130', sortable: true }, + { title: '登录时间', field: 'loginTime', minWidth: '130', sortable: true }, { title: '类型', field: 'casualUserName', minWidth: '80' }, { title: '状态', diff --git a/src/views/govern/alarm/Abnormal.vue b/src/views/govern/alarm/Abnormal.vue index 309ef2e..2197df2 100644 --- a/src/views/govern/alarm/Abnormal.vue +++ b/src/views/govern/alarm/Abnormal.vue @@ -25,8 +25,13 @@ --> @@ -80,9 +85,16 @@ const tableStore = new TableStore({ exportName: '异常事件', publicHeight: 65, column: [ + { + title: '序号', + width: 80, + formatter: (row: any) => { + return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 + } + }, { title: '设备名称', field: 'ndid', align: 'center' }, - { title: '异常时间', field: 'evtTime', align: 'center' }, - { title: '告警代码', field: 'code', align: 'center' }, + { title: '异常时间', field: 'evtTime', align: 'center', sortable: true }, + { title: '告警代码', field: 'code', align: 'center', sortable: true } ] }) @@ -112,6 +124,6 @@ onMounted(() => { setTimeout(() => { tableStore.table.height = mainHeight(200).height as any }, 0) -const addMenu = () => { } +const addMenu = () => {} diff --git a/src/views/govern/alarm/Device.vue b/src/views/govern/alarm/Device.vue index 4073216..3e10399 100644 --- a/src/views/govern/alarm/Device.vue +++ b/src/views/govern/alarm/Device.vue @@ -76,10 +76,17 @@ const tableStore = new TableStore({ exportName: '设备告警', publicHeight: 65, column: [ + { + title: '序号', + width: 80, + formatter: (row: any) => { + return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 + } + }, { title: '设备名称', field: 'equipmentName', align: 'center' }, { title: '工程名称', field: 'engineeringName', align: 'center' }, { title: '项目名称', field: 'projectName', align: 'center' }, - { title: '发生时刻', field: 'startTime', align: 'center' }, + { title: '发生时刻', field: 'startTime', align: 'center', minWidth: 110, sortable: true }, { title: '模块信息', field: 'moduleNo', @@ -92,9 +99,11 @@ const tableStore = new TableStore({ title: '告警代码', field: 'code', align: 'center', + formatter: (row: any) => { return row.cellValue ? row.cellValue : '/' - } + }, + sortable: true }, { title: '事件描述', @@ -103,10 +112,26 @@ const tableStore = new TableStore({ { title: '级别', field: 'level', - formatter: (row: any) => { - return row.cellValue == 1 ? '1级' : row.cellValue == 2 ? '2级' : row.cellValue == 3 ? '3级' : '/' + + render: 'tag', + custom: { + 1: 'danger', + 2: 'warning', + 3: 'success' + }, + replaceValue: { + 1: '1级', + 2: '2级', + 3: '3级' } } + // { + // title: '级别', + // field: 'level', + // formatter: (row: any) => { + // return row.cellValue == 1 ? '1级' : row.cellValue == 2 ? '2级' : row.cellValue == 3 ? '3级' : '/' + // } + // } ], beforeSearchFun: () => {} }) diff --git a/src/views/govern/alarm/Steady.vue b/src/views/govern/alarm/Steady.vue index d978af6..9431249 100644 --- a/src/views/govern/alarm/Steady.vue +++ b/src/views/govern/alarm/Steady.vue @@ -76,10 +76,17 @@ const tableStore = new TableStore({ exportName: '稳态越限告警', publicHeight: 65, column: [ + { + title: '序号', + width: 80, + formatter: (row: any) => { + return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 + } + }, { title: '设备名称', field: 'equipmentName', align: 'center' }, { title: '工程名称', field: 'engineeringName', align: 'center' }, { title: '项目名称', field: 'projectName', align: 'center' }, - { title: '发生时刻', field: 'startTime', align: 'center' }, + { title: '发生时刻', field: 'startTime', align: 'center', sortable: true }, { title: '事件描述', field: 'showName', align: 'center' } ], diff --git a/src/views/govern/alarm/Transient.vue b/src/views/govern/alarm/Transient.vue index 6bd3af0..d4fa4eb 100644 --- a/src/views/govern/alarm/Transient.vue +++ b/src/views/govern/alarm/Transient.vue @@ -121,17 +121,23 @@ const tableStore = new TableStore({ method: 'POST', publicHeight: 65, exportName: '暂态事件', - column: [ + column: [ { + title: '序号', + width: 80, + formatter: (row: any) => { + return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 + } + }, { title: '设备名称', field: 'equipmentName', align: 'center' }, { title: '工程名称', field: 'engineeringName', align: 'center' }, { title: '项目名称', field: 'projectName', align: 'center' }, - { title: '发生时刻', field: 'startTime', align: 'center', width: '240' }, + { title: '发生时刻', field: 'startTime', align: 'center', width: '240',sortable: true }, { title: '监测点名称', field: 'lineName', align: 'center' }, { title: '事件描述', field: 'showName', align: 'center' }, { title: '事件发生位置', field: 'evtParamPosition', align: 'center' }, { title: '相别', field: 'evtParamPhase', align: 'center' }, - { title: '持续时间(s)', field: 'evtParamTm', align: 'center' }, - { title: '暂降(聚升)幅值(%)', minWidth: 100, field: 'evtParamVVaDepth', align: 'center' }, + { title: '持续时间(s)', field: 'evtParamTm', align: 'center',sortable: true }, + { title: '暂降(聚升)幅值(%)', minWidth: 100, field: 'evtParamVVaDepth', align: 'center',sortable: true }, { title: '操作', diff --git a/src/views/govern/analyze/APF/index.vue b/src/views/govern/analyze/APF/index.vue index faa84f3..cc52dbd 100644 --- a/src/views/govern/analyze/APF/index.vue +++ b/src/views/govern/analyze/APF/index.vue @@ -1,6 +1,6 @@