This commit is contained in:
2024-09-14 10:20:49 +08:00
parent cb9a0fe5e4
commit b870839d39
7 changed files with 244 additions and 176 deletions

View File

@@ -1,54 +1,54 @@
<!---终端入网检测-->
<template>
<TableHeader area ref="TableHeaderRef">
<TableHeader area ref='TableHeaderRef'>
<template #select>
<el-form-item label="搜索">
<el-form-item label='搜索'>
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站.终端名称"
v-model='tableStore.table.params.searchValue'
placeholder='输入变电站.终端名称'
clearable
></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<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"
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-select v-model="tableStore.table.params.state" clearable placeholder="请选处理状态">
<el-form-item label='处理状态'>
<el-select v-model='tableStore.table.params.state' clearable placeholder='请选处理状态'>
<el-option
v-for="item in stateSelect"
:key="item.id"
:label="item.name"
:value="item.id"
v-for='item in stateSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef"/>
<Form ref="FormRef" @onSubmit="tableStore.index()"/>
<Table ref='tableRef' />
<Form ref='FormRef' @onSubmit='tableStore.index()' />
</template>
<script setup lang="ts">
import {ref, onMounted, provide, watch} from 'vue'
<script setup lang='ts'>
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import {ElMessage, ElMessageBox} from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import {useRouter} from 'vue-router'
import {useDictData} from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import Form from './form.vue'
import {cancel, getInfoById} from '@/api/supervision-boot/cycleDetection/index'
import {useAdminInfo} from '@/stores/adminInfo'
import { cancel, getInfoById } from '@/api/supervision-boot/cycleDetection/index'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const {push, options, currentRoute} = useRouter()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
@@ -75,10 +75,10 @@ const tableStore = new TableStore({
publicHeight: 65,
method: 'POST',
column: [
{title: '序号', type: 'seq', width: 80},
{field: 'substation', title: '变电站'},
{ title: '序号', type: 'seq', width: 80 },
{ field: 'substation', title: '变电站' },
{field: 'dept', title: '供电公司'},
{ field: 'dept', title: '供电公司' },
{
field: 'deviceName',
title: '终端名称'
@@ -188,7 +188,7 @@ const tableStore = new TableStore({
},
click: async row => {
// cancelLeave(row)
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
@@ -253,22 +253,27 @@ watch(
deep: true
}
)
const props = defineProps({id: {type: String, default: 'null'}})
const props = defineProps(['id', 'businessKey'])
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 getInfoById({id:fullId}).then(res => {
await getInfoById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
FormRef.value.open('重新发起', res.data)
if (props.businessKey == '3') {
FormRef.value.open('报告上传', res.data)
} else {
FormRef.value.open('重新发起', res.data)
}
}
})
}, {immediate: true})
}, { immediate: true })
</script>
<style scoped lang="scss">
<style scoped lang='scss'>
:deep(.el-upload-list__item) {
width: 400px;
}