diff --git a/src/api/device-boot/Business.ts b/src/api/device-boot/Business.ts index 27c0f989..dabb046a 100644 --- a/src/api/device-boot/Business.ts +++ b/src/api/device-boot/Business.ts @@ -206,3 +206,11 @@ export function exportTerminalBase() { responseType: 'blob' }) } +//一键分配终端 +export function allotTerminal(data: any) { + return createAxios({ + url: '/device-boot/nodeDevice/oneKeyDistribution', + method: 'post', + params: data + }) +} diff --git a/src/views/pqs/business/terminal/FrontManagement/index.vue b/src/views/pqs/business/terminal/FrontManagement/index.vue index 1eebaa70..b271d04a 100644 --- a/src/views/pqs/business/terminal/FrontManagement/index.vue +++ b/src/views/pqs/business/terminal/FrontManagement/index.vue @@ -209,7 +209,8 @@ import { updateNode, nodeDeviceTree, updateDeviceProcess, - askRestartProcess + askRestartProcess, + allotTerminal } from '@/api/device-boot/Business' import TableStore from '@/utils/tableStore' import Table from '@/components/table/index.vue' @@ -384,7 +385,32 @@ const tableStore = new TableStore({ tableStore.index() }) } - } + }, + { + name: 'edit', + title: '分配终端', + type: 'primary', + icon: 'InfoFilled', + render: 'confirmButton', + popconfirm: { + confirmButtonText: '确认', + cancelButtonText: '取消', + confirmButtonType: 'primary', + title: '确定分配终端吗?' + }, + click: row => { + if (!hasDevices.value) { + ElMessage.warning('此前置机下无设备,无法分配终端!'); + return; + } + allotTerminal({ + nodeId: row.id + }).then(res => { + ElMessage.success(res.message) + tableStore.index() + }) + } + }, ] } ], diff --git a/src/views/pqs/voltageSags/analyse/eventCorrelation/index.vue b/src/views/pqs/voltageSags/analyse/eventCorrelation/index.vue index 44d6322e..d0c95c0e 100644 --- a/src/views/pqs/voltageSags/analyse/eventCorrelation/index.vue +++ b/src/views/pqs/voltageSags/analyse/eventCorrelation/index.vue @@ -29,6 +29,17 @@ +
@@ -168,7 +179,12 @@ tableStore.table.params.searchValue = '' const bxactiveName = ref('ssbx') const boxoList = ref({}) const wp = ref({}) - +const form = ref({ + pageSize: 20, + pageNum: 1, + id: '' +}) +const total = ref(0) provide('tableStore', tableStore) onMounted(() => { @@ -180,13 +196,47 @@ onMounted(() => { }) }) -//分析记录管理 -const analysis1 = () => { - queryRelevantLogPage({}).then((res: any) => { + +// 分页 +const onTableSizeChange = (val: number) => { + form.value.pageSize = val + form.value.pageNum = 1 // 改变每页条数时回到第一页 + loadAnalysisData() // 重新加载数据 + +} + +const onTableCurrentChange = (val: number) => { + form.value.pageNum = val + loadAnalysisData() // 重新加载数据 + +} + +// 封装数据加载逻辑 +const loadAnalysisData = async () => { + try { + const params = { + pageNum: form.value.pageNum, + pageSize: form.value.pageSize + } + const res: any = await queryRelevantLogPage(params) AnalysisData.value = res.data.records - }) + total.value = res.data.total + } catch (error) { + console.error('获取分析记录失败:', error) + AnalysisData.value = [] + total.value = 0 + } +} + +//分析记录管理 +const analysis1 = async () => { + // 初始化分页参数 + form.value.pageNum = 1 + await loadAnalysisData() dialogAnalysis.value = true } + + // 启动关联分析 const firing = () => { processEvents({ @@ -207,9 +257,8 @@ const details = (row: any) => { type: 'success', message: res.message }) - queryRelevantLogPage({}).then((res: any) => { - AnalysisData.value = res.data.records - }) + // 重新加载当前页的数据 + loadAnalysisData() }) } @@ -217,4 +266,6 @@ const backbxlb = () => { view.value = true view2.value = false } + + diff --git a/src/views/system/strategyManage/index.vue b/src/views/system/strategyManage/index.vue index 0284541b..9c9acaf7 100644 --- a/src/views/system/strategyManage/index.vue +++ b/src/views/system/strategyManage/index.vue @@ -33,10 +33,10 @@ style="width: 100%" > - + - +