mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
feat(web): 新增 syslog 日志功能
- 在 EditCom 组件中添加 syslog 相关配置和逻辑 - 在 log.vue 中使用 EditCom 组件实现 syslog 日志的编辑功能 - 优化 monitor.vue 中的场站切换功能,调整选择框宽度 - 修复 request/index.js 中的错误处理逻辑
This commit is contained in:
@@ -27,7 +27,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #role_id="item">
|
<template #role_id="item">
|
||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
:dropdown-match-select-width="false"
|
:dropdown-match-select-width="false"
|
||||||
v-model:value="detailInfo.ruleForm[item.key]"
|
v-model:value="detailInfo.ruleForm[item.key]"
|
||||||
@@ -94,7 +93,8 @@ import {
|
|||||||
deviceFormRules,
|
deviceFormRules,
|
||||||
alarmlogOptions,
|
alarmlogOptions,
|
||||||
serviceApiOptions,
|
serviceApiOptions,
|
||||||
serviceApiFormRules
|
serviceApiFormRules,
|
||||||
|
syslogOptions
|
||||||
} from '../../public/config/columnList'
|
} from '../../public/config/columnList'
|
||||||
import DetailInfo from './DetailInfo.vue'
|
import DetailInfo from './DetailInfo.vue'
|
||||||
import { postReq, getReq } from '@/request/api'
|
import { postReq, getReq } from '@/request/api'
|
||||||
@@ -152,7 +152,7 @@ export default {
|
|||||||
value: '5'
|
value: '5'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
tip: '正在加载...',
|
tip: '正在加载...',
|
||||||
roleIdList: [],
|
roleIdList: [],
|
||||||
transferDialog: false,
|
transferDialog: false,
|
||||||
@@ -177,24 +177,22 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
workModeIdSelect: {
|
workModeIdSelect: {
|
||||||
handler(n) {
|
handler(n) {
|
||||||
|
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case '1':
|
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':
|
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:
|
default:
|
||||||
this.detailInfos[0].list[this.detailInfos[0].list.length-1].type='unshow'
|
this.detailInfos[0].list[this.detailInfos[0].list.length - 1].type = 'unshow'
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
// immediate: true
|
// immediate: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
action: {
|
action: {
|
||||||
handler(n) {
|
handler(n) {
|
||||||
@@ -229,7 +227,7 @@ export default {
|
|||||||
case 'station':
|
case 'station':
|
||||||
this.detailInfos = stationOptions
|
this.detailInfos = stationOptions
|
||||||
this.formRules = stationFormRules
|
this.formRules = stationFormRules
|
||||||
this.workModeIdSelect=this.detailInfos[0].ruleForm['work_mode']
|
this.workModeIdSelect = this.detailInfos[0].ruleForm['work_mode']
|
||||||
|
|
||||||
break
|
break
|
||||||
case 'device':
|
case 'device':
|
||||||
@@ -240,6 +238,11 @@ export default {
|
|||||||
this.detailInfos = alarmlogOptions
|
this.detailInfos = alarmlogOptions
|
||||||
this.formRules = {}
|
this.formRules = {}
|
||||||
break
|
break
|
||||||
|
case 'syslog':
|
||||||
|
this.detailInfos = syslogOptions
|
||||||
|
this.formRules = {}
|
||||||
|
break
|
||||||
|
|
||||||
case 'serviceApi':
|
case 'serviceApi':
|
||||||
this.detailInfos = serviceApiOptions
|
this.detailInfos = serviceApiOptions
|
||||||
this.formRules = serviceApiFormRules
|
this.formRules = serviceApiFormRules
|
||||||
@@ -257,8 +260,7 @@ export default {
|
|||||||
this.getRoleIdList()
|
this.getRoleIdList()
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
console.log('modal');
|
console.log('modal')
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getRoleIdList() {
|
async getRoleIdList() {
|
||||||
@@ -377,7 +379,6 @@ export default {
|
|||||||
edit: '/updateRole'
|
edit: '/updateRole'
|
||||||
}
|
}
|
||||||
const { selectedRowKeys } = this.$refs.treeTable[0]
|
const { selectedRowKeys } = this.$refs.treeTable[0]
|
||||||
|
|
||||||
|
|
||||||
const data = this.filterTreeData(selectedRowKeys, this.$refs.treeTable[0].tableData)
|
const data = this.filterTreeData(selectedRowKeys, this.$refs.treeTable[0].tableData)
|
||||||
const arr = data.map((item) => ({
|
const arr = data.map((item) => ({
|
||||||
@@ -567,13 +568,11 @@ export default {
|
|||||||
return ids
|
return ids
|
||||||
},
|
},
|
||||||
//移除校验
|
//移除校验
|
||||||
clearValidate(){
|
clearValidate() {
|
||||||
|
|
||||||
for (let i = 0; i < this.detailInfos.length; i++) {
|
for (let i = 0; i < this.detailInfos.length; i++) {
|
||||||
// console.log(`detailInfo${i}`);
|
// console.log(`detailInfo${i}`);
|
||||||
|
|
||||||
this.$refs[`detailInfo${i}`].handleReset()
|
this.$refs[`detailInfo${i}`].handleReset()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import openNotification from '../utils/notification'
|
import openNotification from '../utils/notification'
|
||||||
// import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
import router from 'vue-router'
|
import router from 'vue-router'
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: '/api',
|
baseURL: '/api',
|
||||||
@@ -17,8 +17,7 @@ service.interceptors.response.use(
|
|||||||
const res = response.data
|
const res = response.data
|
||||||
|
|
||||||
if (res.errCode !== 0) {
|
if (res.errCode !== 0) {
|
||||||
console.log(res, 'res')
|
if (res.ERR_TOKEN == 2 || res.errmsg == '校验token过期') {
|
||||||
if ((res.ERR_TOKEN = 2 || res.errmsg == '校验token过期')) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// router.push({ path: '/login' })
|
// router.push({ path: '/login' })
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@@ -31,8 +30,6 @@ service.interceptors.response.use(
|
|||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(res.errmsg, 'res.errmsg')
|
|
||||||
|
|
||||||
message.error(res.errmsg)
|
message.error(res.errmsg)
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<span>场站切换</span>
|
<span>场站切换</span>
|
||||||
<a-select v-model:value="selectStationId" style="width: 400px" @change="getStationChange">
|
<a-select v-model:value="selectStationId" style="width: 300px" @change="getStationChange">
|
||||||
<a-select-option v-for="station in stations" :value="station['station_id']"
|
<a-select-option v-for="station in stations" :value="station['station_id']"
|
||||||
>{{ station.name }}
|
>{{ station.name }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
<a-modal v-model:open="formModal" width="750px" style="top: 80px" :footer="null">
|
<a-modal v-model:open="formModal" width="750px" style="top: 80px" :footer="null">
|
||||||
<!-- action:edit add -->
|
<!-- action:edit add -->
|
||||||
<EditCom
|
<EditCom
|
||||||
:record="record"
|
:record="formState"
|
||||||
@operateForm="operateForm"
|
@operateForm="operateForm"
|
||||||
type="user"
|
type="syslog"
|
||||||
:action="formStatus"
|
:action="formStatus"
|
||||||
></EditCom>
|
></EditCom>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user