修改数据中心问题

This commit is contained in:
GGJ
2024-11-08 16:30:12 +08:00
parent a4b6bb111b
commit 7640b53b20
12 changed files with 874 additions and 456 deletions

View File

@@ -5,21 +5,13 @@
<template v-slot:select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、终端"
clearable
></el-input>
</el-form-item>
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端" clearable></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
@@ -42,7 +34,7 @@ import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import {cancelQuitRunningDevice, getRunningDeviceById} from '@/api/supervision-boot/device/quitRunningDev'
import { cancelQuitRunningDevice, getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { deleteQuitRunningDevice } from '@/api/supervision-boot/delete/index'
@@ -62,7 +54,7 @@ const tableStore = new TableStore({
method: 'POST',
publicHeight: 65,
column: [
{
{
width: '60',
type: 'checkbox'
},
@@ -89,7 +81,7 @@ const tableStore = new TableStore({
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
null: 'primary'
},
replaceValue: {
0: '运行',
@@ -111,7 +103,7 @@ const tableStore = new TableStore({
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
null: 'primary'
},
replaceValue: {
0: '运行',
@@ -119,7 +111,7 @@ const tableStore = new TableStore({
2: '停运',
3: '调试',
4: '退运',
null:'/'
null: '/'
}
},
{
@@ -250,20 +242,20 @@ const deleteEven = () => {
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
tableStore.index()
})
})
}
}
/** 流程实例详情 */
@@ -316,17 +308,17 @@ watch(
}
)
const props = defineProps({id: {type: String, default: 'null'}})
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
}, {immediate: true})
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
}, { immediate: true })
</script>