From a7cc0e19c99ff47e4a13716429aa6c711943d141 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Tue, 19 May 2026 10:46:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=8D=E9=A6=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/platform.ts | 4 + frontend/src/views/AlarmHistoryView.vue | 33 --- frontend/src/views/AlarmSettingView.vue | 107 ---------- frontend/src/views/ChannelConfigView.vue | 90 -------- frontend/src/views/ControlView.vue | 28 --- frontend/src/views/DeviceConfigView.vue | 104 ---------- frontend/src/views/RealtimeView.vue | 35 ---- frontend/src/views/StatusView.vue | 27 --- frontend/src/views/SystemConfigView.vue | 48 ----- frontend/src/views/aiAlarmSetting/index.vue | 16 +- frontend/src/views/aiChannelSetting/index.vue | 26 ++- frontend/src/views/aiQuantity/index.vue | 35 ++-- frontend/src/views/analogQuantity/index.vue | 100 +++++---- frontend/src/views/aoChannelSetting/index.vue | 25 ++- .../src/views/communicationSetting/index.vue | 28 ++- frontend/src/views/eventReport/index.vue | 20 +- frontend/src/views/lightSetting/index.vue | 2 + frontend/src/views/lineSetting/index.vue | 12 +- frontend/src/views/login/index.vue | 193 ------------------ frontend/src/views/passwordSetting/index.vue | 65 +++--- frontend/src/views/switchQuantity/index.vue | 19 +- 21 files changed, 227 insertions(+), 790 deletions(-) delete mode 100644 frontend/src/views/AlarmHistoryView.vue delete mode 100644 frontend/src/views/AlarmSettingView.vue delete mode 100644 frontend/src/views/ChannelConfigView.vue delete mode 100644 frontend/src/views/ControlView.vue delete mode 100644 frontend/src/views/DeviceConfigView.vue delete mode 100644 frontend/src/views/RealtimeView.vue delete mode 100644 frontend/src/views/StatusView.vue delete mode 100644 frontend/src/views/SystemConfigView.vue delete mode 100644 frontend/src/views/login/index.vue diff --git a/frontend/src/api/platform.ts b/frontend/src/api/platform.ts index 9e99c7f..306d682 100644 --- a/frontend/src/api/platform.ts +++ b/frontend/src/api/platform.ts @@ -114,3 +114,7 @@ export async function saveSystemConfig(payload: SystemConfigPayload): Promise>('/config/system', payload) return response.data } +export async function saveDevicePassword(payload: { password: string }): Promise> { + const response = await http.post>('/config/device/password', payload) + return response.data +} \ No newline at end of file diff --git a/frontend/src/views/AlarmHistoryView.vue b/frontend/src/views/AlarmHistoryView.vue deleted file mode 100644 index a745dc2..0000000 --- a/frontend/src/views/AlarmHistoryView.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/frontend/src/views/AlarmSettingView.vue b/frontend/src/views/AlarmSettingView.vue deleted file mode 100644 index c67aeea..0000000 --- a/frontend/src/views/AlarmSettingView.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/frontend/src/views/ChannelConfigView.vue b/frontend/src/views/ChannelConfigView.vue deleted file mode 100644 index ac62ab7..0000000 --- a/frontend/src/views/ChannelConfigView.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/frontend/src/views/ControlView.vue b/frontend/src/views/ControlView.vue deleted file mode 100644 index f00b7e0..0000000 --- a/frontend/src/views/ControlView.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/frontend/src/views/DeviceConfigView.vue b/frontend/src/views/DeviceConfigView.vue deleted file mode 100644 index db937ce..0000000 --- a/frontend/src/views/DeviceConfigView.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/frontend/src/views/RealtimeView.vue b/frontend/src/views/RealtimeView.vue deleted file mode 100644 index f54555f..0000000 --- a/frontend/src/views/RealtimeView.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/frontend/src/views/StatusView.vue b/frontend/src/views/StatusView.vue deleted file mode 100644 index 7137b47..0000000 --- a/frontend/src/views/StatusView.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/frontend/src/views/SystemConfigView.vue b/frontend/src/views/SystemConfigView.vue deleted file mode 100644 index d50d1b1..0000000 --- a/frontend/src/views/SystemConfigView.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/frontend/src/views/aiAlarmSetting/index.vue b/frontend/src/views/aiAlarmSetting/index.vue index 0a08c1f..49e6f82 100644 --- a/frontend/src/views/aiAlarmSetting/index.vue +++ b/frontend/src/views/aiAlarmSetting/index.vue @@ -20,6 +20,7 @@ const channelList = ref([ const nodeOptions = ref(['开出一', '开出二', '开出三', '开出四', '开出五', '开出六', '开出七', '开出八', '开出九', '开出十', '开出十一', '开出十二']) const isswitch = ref(false) +const dialogVisible = ref(false) const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { confirmButtonText: '确定', @@ -39,10 +40,13 @@ const handleSave = () => { ElMessage.success('保存成功') init() isswitch.value = false + } else { + ElMessage.error('保存失败') } }) }else{ - ElMessage.error('密码错误,不能修改!') + isswitch.value = false + dialogVisible.value = true } }) }) @@ -84,7 +88,9 @@ onMounted(() => {
{{ item.channel_no }}
-
{{ item.singal_type }}
+
+ +
@@ -108,6 +114,12 @@ onMounted(() => {
+ +
原密码验证错误!
+ +
diff --git a/frontend/src/views/aiChannelSetting/index.vue b/frontend/src/views/aiChannelSetting/index.vue index c8cdd7e..de3614a 100644 --- a/frontend/src/views/aiChannelSetting/index.vue +++ b/frontend/src/views/aiChannelSetting/index.vue @@ -19,6 +19,8 @@ const channelList: any = ref([ const aoChannelList: any = ref([]) const lineOptions = ref([{ label: '线路一', value: 1 }, { label: '线路二', value: 2 }, { label: '线路三', value: 3 }, { label: '线路四', value: 4 }]) const categoryOptions = ref(['UA', 'UB', 'UC']) +const categoryOptions2 = ref(['IA', 'IB', 'IC']) +const dialogVisible = ref(false) const isswitch = ref(false) const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { @@ -42,12 +44,15 @@ const handleSave = () => { if (res.data) { ElMessage.success('保存成功') isswitch.value = false + } else { + ElMessage.error('保存失败') } }).catch(err => { isswitch.value = false }) } else { - ElMessage.error('密码错误,不能修改!') + isswitch.value = false + dialogVisible.value = true } }) }) @@ -68,6 +73,7 @@ function init() { }) }) } + onMounted(() => { init() }) @@ -87,7 +93,9 @@ onMounted(() => {
{{ item.ch }}
-
{{ item.singal_type }}
+
+ +
{
- +
@@ -111,6 +119,16 @@ onMounted(() => {
+ +
原密码验证错误!
+ +
@@ -239,5 +257,7 @@ onMounted(() => { :deep(.el-input__inner) { text-align: center !important; + font-size: 14px !important; } + \ No newline at end of file diff --git a/frontend/src/views/aiQuantity/index.vue b/frontend/src/views/aiQuantity/index.vue index ed591aa..423790f 100644 --- a/frontend/src/views/aiQuantity/index.vue +++ b/frontend/src/views/aiQuantity/index.vue @@ -34,21 +34,24 @@ function formatTime(dateStr: string): string { return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` } const tableData = computed(() => { - const list = state.alarms[state.alarms.length - 1] || {} - const arr = [] - let reslist:any = {} - if(list.alarm_type == 'line_alarm'){ - reslist.name = `线路${list?.no || 1}` - }else if(list.alarm_type == 'ai_alarm'){ - reslist.name = `通道${list?.no || 1}` - } else if(list.alarm_type == 'operate_alarm'){ - reslist.name = '' - } - reslist.typeName = list.type - reslist.content = list.content - reslist.time = list.time ? formatTime(list.time) : '' - reslist.level = list.level || '' - return [reslist] + const alarms = state.alarms || [] + const firstThree = alarms.slice(0, 2) + return firstThree.map(list => { + const reslist: any = {} + if (list.alarm_type == 'line_alarm') { + reslist.name = `线路${list?.no || 1}` + } else if (list.alarm_type == 'ai_alarm') { + reslist.name = `通道${list?.no || 1}` + } else if (list.alarm_type == 'operate_alarm') { + reslist.name = '' + } + reslist.typeName = list.type + reslist.content = list.content + reslist.time = list.time ? formatTime(list.time) : '' + reslist.level = list.level || '' + reslist.id = list.id || '0' + return reslist + }) }) function init(){ fetchChannelConfig().then(res => { @@ -191,7 +194,7 @@ onMounted(() => { .container-bottom-box { width: 100%; - height: calc(100vh - 660px); + height: calc(100vh - 646px); padding: 20px; background: #ffffff; box-shadow: 0px 0px 10px rgba(219, 225, 236, 1); diff --git a/frontend/src/views/analogQuantity/index.vue b/frontend/src/views/analogQuantity/index.vue index e3c7774..3c353ee 100644 --- a/frontend/src/views/analogQuantity/index.vue +++ b/frontend/src/views/analogQuantity/index.vue @@ -31,8 +31,8 @@ const currentValues = computed(() => { }) const frequency = computed(() => { - if (!currentValues.value) return '50' - return currentValues.value.frq + if (!currentValues.value) return '50.000' + return currentValues.value.frq.toFixed(3) }) const infoList = computed(() => { @@ -50,45 +50,45 @@ const infoList = computed(() => { return [ { name: '单项电压(V)', - a: values.Ua, - b: values.Ub, - c: values.Uc, + a: values.Ua.toFixed(3), + b: values.Ub.toFixed(3), + c: values.Uc.toFixed(3), total: '', }, { name: '单相电流(A)', - a: values.Ia, - b: values.Ib, - c: values.Ic, + a: values.Ia.toFixed(3), + b: values.Ib.toFixed(3), + c: values.Ic.toFixed(3), total: '', }, { name: '有功功率(kw)', - a: values.Pa, - b: values.Pb, - c: values.Pc, - total: values.Pt + a: values.Pa.toFixed(2), + b: values.Pb.toFixed(2), + c: values.Pc.toFixed(2), + total: values.Pt.toFixed(2) }, { name: '无功功率(kvar)', - a: values.Qa, - b: values.Qb, - c: values.Qc, - total: values.Qt + a: values.Qa.toFixed(2), + b: values.Qb.toFixed(2), + c: values.Qc.toFixed(2), + total: values.Qt.toFixed(2) }, { name: '视在功率(kVA)', - a: values.Sa, - b: values.Sb, - c: values.Sc, - total: values.St + a: values.Sa.toFixed(2), + b: values.Sb.toFixed(2), + c: values.Sc.toFixed(2), + total: values.St.toFixed(2) }, { name: '功率因数(cos)', - a: values.PFa, - b: values.PFb, - c: values.PFc, - total: values.PFt + a: values.PFa.toFixed(3), + b: values.PFb.toFixed(3), + c: values.PFc.toFixed(3), + total: values.PFt.toFixed(3) }, ] }) @@ -100,9 +100,9 @@ const infoData = computed(() => { } return { name: '线电压(V)', - a: values?.Uab, - b: values?.Ubc, - c: values?.Uca, + a: values?.Uab?.toFixed(3), + b: values?.Ubc?.toFixed(3), + c: values?.Uca?.toFixed(3), } }) @@ -118,28 +118,24 @@ function formatTime(dateStr: string): string { } const tableData = computed(() => { - const list = state.alarms[state.alarms.length - 1] || {} - const arr = [] - let reslist:any = {} - if(list.alarm_type == 'line_alarm'){ - reslist.name = `线路${list?.no || 1}` - }else if(list.alarm_type == 'ai_alarm'){ - reslist.name = `通道${list?.no || 1}` - } else if(list.alarm_type == 'operate_alarm'){ - reslist.name = '' - } - reslist.typeName = list.type - reslist.content = list.content - reslist.time = list.time ? formatTime(list.time) : '' - reslist.level = list.level || '' - return [reslist] - // return state.alarms.slice(0, 10).map((alarm, index) => ({ - // name: `线路${currentLineData.value?.line_no || 1}`, - // typeName: alarm.type, - // content: alarm.content, - // time: alarm.time, - // ts: '0', - // })) + const alarms = state.alarms || [] + const firstThree = alarms.slice(0, 2) + return firstThree.map(list => { + const reslist: any = {} + if (list.alarm_type == 'line_alarm') { + reslist.name = `线路${list?.no || 1}` + } else if (list.alarm_type == 'ai_alarm') { + reslist.name = `通道${list?.no || 1}` + } else if (list.alarm_type == 'operate_alarm') { + reslist.name = '' + } + reslist.typeName = list.type + reslist.content = list.content + reslist.time = list.time ? formatTime(list.time) : '' + reslist.level = list.level || '' + reslist.id = list.id || '0' + return reslist + }) }) function handleClick(name: string) { @@ -218,7 +214,7 @@ onMounted(() => {
报警信息
-
+
{{ index + 1 }}
{{ item.name }}
{{ item.typeName }}
@@ -349,7 +345,7 @@ onMounted(() => { .container-bottom-box { width: 100%; - height: calc(100vh - 660px); + height: calc(100vh - 645px); padding: 20px; background: #ffffff; box-shadow: 0px 0px 10px rgba(219, 225, 236, 1); @@ -371,4 +367,4 @@ onMounted(() => { } } } - \ No newline at end of file + diff --git a/frontend/src/views/aoChannelSetting/index.vue b/frontend/src/views/aoChannelSetting/index.vue index f52ad76..181f826 100644 --- a/frontend/src/views/aoChannelSetting/index.vue +++ b/frontend/src/views/aoChannelSetting/index.vue @@ -18,7 +18,8 @@ const channelList: any = ref([ ]) const lineOptions = ref([{ label: '线路一', value: 1 }, { label: '线路二', value: 2 }, { label: '线路三', value: 3 }, { label: '线路四', value: 4 }]) const categoryOptions = ref(['UA', 'UB', 'UC']) - +const categoryOptions2 = ref(['IA', 'IB', 'IC']) +const dialogVisible = ref(false) const aiChannelList = ref([]) function init() { fetchChannelConfig().then((res: any) => { @@ -59,12 +60,15 @@ const handleSave = () => { if (res.code === 200) { ElMessage.success('保存成功') isswitch.value = false + } else { + ElMessage.error('保存失败') } }).catch(err => { isswitch.value = false }) } else { - ElMessage.error('密码错误,不能修改!') + isswitch.value = false + dialogVisible.value = true } }) }) @@ -88,7 +92,9 @@ onMounted(() => {
{{ item.ch }}
-
{{ item.singal_type }}
+
+ +
{
- +
@@ -112,6 +119,16 @@ onMounted(() => {
+ +
原密码验证错误!
+ +
diff --git a/frontend/src/views/communicationSetting/index.vue b/frontend/src/views/communicationSetting/index.vue index 3c09c21..2f093ec 100644 --- a/frontend/src/views/communicationSetting/index.vue +++ b/frontend/src/views/communicationSetting/index.vue @@ -63,7 +63,8 @@ const rtuProtocolOptions = [ { label: 'Modbus RTU', value: 'Modbus RTU' }, { label: 'IEC101 ', value: 'IEC101' } ] - +const isswitch = ref(false) +const dialogVisible = ref(false) // 保存 const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { @@ -74,9 +75,11 @@ const handleSave = () => { .then(({ value }) => { verifyAccessPassword(value).then((res: any) => { if (res.data) { - saveDeviceNetConfig(formData.value).then((res: any) => { - console.log(res) + if (isswitch.value) { + return + } + isswitch.value = true if (res.code == 200) { saveDevicePortConfig(formData2.value).then((res: any) => { if (res.code == 200) { @@ -84,25 +87,26 @@ const handleSave = () => { type: 'success', message: `保存成功`, }) + isswitch.value = false } else { ElMessage({ - type: 'info', + type: 'error', message: '串口设置保存失败', }) + isswitch.value = false } }) } else { ElMessage({ - type: 'info', + type: 'error', message: '常规配置保存失败', }) + isswitch.value = false } }) } else { - ElMessage({ - type: 'info', - message: '密码错误,不能修改!', - }) + isswitch.value = false + dialogVisible.value = true } }) }) @@ -232,6 +236,12 @@ onMounted(() => { 保存
+ +
原密码验证错误!
+ +
diff --git a/frontend/src/views/eventReport/index.vue b/frontend/src/views/eventReport/index.vue index 47f4bdf..41a7a93 100644 --- a/frontend/src/views/eventReport/index.vue +++ b/frontend/src/views/eventReport/index.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/views/lightSetting/index.vue b/frontend/src/views/lightSetting/index.vue index 00a0e87..800cc54 100644 --- a/frontend/src/views/lightSetting/index.vue +++ b/frontend/src/views/lightSetting/index.vue @@ -22,6 +22,8 @@ const handleSave = async () => { saveSystemConfig(form.value).then(res => { if(res.code === 200){ ElMessage.success('保存成功') + } else { + ElMessage.error('保存失败') } isswitch.value = false }) diff --git a/frontend/src/views/lineSetting/index.vue b/frontend/src/views/lineSetting/index.vue index c3703fe..14c1f0e 100644 --- a/frontend/src/views/lineSetting/index.vue +++ b/frontend/src/views/lineSetting/index.vue @@ -141,6 +141,7 @@ const init = () => { }) } const isswitch = ref(false) +const dialogVisible = ref(false) const handleSave = () => { ElMessageBox.prompt('请输入密码', '保存', { confirmButtonText: '确定', @@ -160,10 +161,13 @@ const handleSave = () => { ElMessage.success('保存成功') init() isswitch.value = false + } else { + ElMessage.error('保存失败') } }) }else{ - ElMessage.error('密码错误,不能修改!') + isswitch.value = false + dialogVisible.value = true } }) }) @@ -307,6 +311,12 @@ const handleSave = () => {
保存
+ +
原密码验证错误!
+ +
diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue deleted file mode 100644 index 1d5f7ce..0000000 --- a/frontend/src/views/login/index.vue +++ /dev/null @@ -1,193 +0,0 @@ - diff --git a/frontend/src/views/passwordSetting/index.vue b/frontend/src/views/passwordSetting/index.vue index a7562a3..e8964d6 100644 --- a/frontend/src/views/passwordSetting/index.vue +++ b/frontend/src/views/passwordSetting/index.vue @@ -1,7 +1,7 @@ @@ -122,9 +117,20 @@ onMounted(() => { - + 保存 + +
原密码验证错误!
+ +
@@ -142,6 +148,7 @@ onMounted(() => { border-radius: 4px; box-shadow: 0px 0px 10px rgba(219, 225, 236, 1); } + .title { font-size: 18px; font-weight: 700; @@ -162,6 +169,7 @@ onMounted(() => { .password-form { width: 60%; } + .save-btn { margin-top: 30px; font-size: 14px; @@ -178,7 +186,8 @@ onMounted(() => { color: #363636; min-height: 40px; } + :deep(.el-form-item__label) { - line-height: 40px !important; + line-height: 40px !important; } \ No newline at end of file diff --git a/frontend/src/views/switchQuantity/index.vue b/frontend/src/views/switchQuantity/index.vue index 534c45c..9fc5a4a 100644 --- a/frontend/src/views/switchQuantity/index.vue +++ b/frontend/src/views/switchQuantity/index.vue @@ -34,21 +34,24 @@ function formatTime(dateStr: string): string { return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` } const tableData = computed(() => { - const list = state.alarms[state.alarms.length - 1] || {} - const arr = [] - let reslist: any = {} + const alarms = state.alarms || [] + const firstThree = alarms.slice(0, 2) + return firstThree.map(list => { + const reslist: any = {} if (list.alarm_type == 'line_alarm') { - reslist.name = `线路${list?.no || 1}` + reslist.name = `线路${list?.no || 1}` } else if (list.alarm_type == 'ai_alarm') { - reslist.name = `通道${list?.no || 1}` + reslist.name = `通道${list?.no || 1}` } else if (list.alarm_type == 'operate_alarm') { - reslist.name = '' + reslist.name = '' } reslist.typeName = list.type reslist.content = list.content reslist.time = list.time ? formatTime(list.time) : '' reslist.level = list.level || '' - return [reslist] + reslist.id = list.id || '0' + return reslist + }) }) onMounted(() => { @@ -204,7 +207,7 @@ onMounted(() => { .container-bottom-box { width: 100%; - height: calc(100vh - 660px); + height: calc(100vh - 645px); padding: 20px; background: #ffffff; box-shadow: 0px 0px 10px rgba(219, 225, 236, 1);