feat(web): 新增 syslog 日志功能

- 在 EditCom 组件中添加 syslog 相关配置和逻辑
- 在 log.vue 中使用 EditCom 组件实现 syslog 日志的编辑功能
- 优化 monitor.vue 中的场站切换功能,调整选择框宽度
- 修复 request/index.js 中的错误处理逻辑
This commit is contained in:
zhoumengru
2025-09-15 14:23:28 +08:00
parent 59b78d678d
commit 443338b539
4 changed files with 24 additions and 28 deletions

View File

@@ -27,7 +27,6 @@
</template>
<template #role_id="item">
<a-select
:dropdown-match-select-width="false"
v-model:value="detailInfo.ruleForm[item.key]"
@@ -94,7 +93,8 @@ import {
deviceFormRules,
alarmlogOptions,
serviceApiOptions,
serviceApiFormRules
serviceApiFormRules,
syslogOptions
} from '../../public/config/columnList'
import DetailInfo from './DetailInfo.vue'
import { postReq, getReq } from '@/request/api'
@@ -152,7 +152,7 @@ export default {
value: '5'
}
],
tip: '正在加载...',
roleIdList: [],
transferDialog: false,
@@ -177,24 +177,22 @@ export default {
watch: {
workModeIdSelect: {
handler(n) {
switch (n) {
case '1':
this.detailInfos[0].list[this.detailInfos[0].list.length-1].type='select'
this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'select'
break;
break
case '5':
this.detailInfos[0].list[this.detailInfos[0].list.length-1].type='select'
this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'select'
break;
break
default:
this.detailInfos[0].list[this.detailInfos[0].list.length-1].type='unshow'
break;
this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'unshow'
break
}
},
}
// immediate: true
},
action: {
handler(n) {
@@ -229,7 +227,7 @@ export default {
case 'station':
this.detailInfos = stationOptions
this.formRules = stationFormRules
this.workModeIdSelect=this.detailInfos[0].ruleForm['work_mode']
this.workModeIdSelect = this.detailInfos[0].ruleForm['work_mode']
break
case 'device':
@@ -240,6 +238,11 @@ export default {
this.detailInfos = alarmlogOptions
this.formRules = {}
break
case 'syslog':
this.detailInfos = syslogOptions
this.formRules = {}
break
case 'serviceApi':
this.detailInfos = serviceApiOptions
this.formRules = serviceApiFormRules
@@ -257,8 +260,7 @@ export default {
this.getRoleIdList()
},
unmounted() {
console.log('modal');
console.log('modal')
},
methods: {
async getRoleIdList() {
@@ -377,7 +379,6 @@ export default {
edit: '/updateRole'
}
const { selectedRowKeys } = this.$refs.treeTable[0]
const data = this.filterTreeData(selectedRowKeys, this.$refs.treeTable[0].tableData)
const arr = data.map((item) => ({
@@ -567,13 +568,11 @@ export default {
return ids
},
//移除校验
clearValidate(){
clearValidate() {
for (let i = 0; i < this.detailInfos.length; i++) {
// console.log(`detailInfo${i}`);
this.$refs[`detailInfo${i}`].handleReset()
}
}
}