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

@@ -286,7 +286,7 @@ const tableStore = new TableStore({
},
click: row => {
feedbackPopup.value.open(
'填报反馈单',
'填报告警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -324,7 +324,7 @@ const tableStore = new TableStore({
},
click: row => {
feedbackPopup.value.open(
'编辑',
'编辑告警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -349,7 +349,7 @@ const tableStore = new TableStore({
click: row => {
// deviceQuitPopup.value.open('重新发起', row)
feedbackPopup.value.open(
'重新发起告警单',
'重新填报告警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -448,7 +448,7 @@ const handleAudit = (instanceId: any, historyInstanceId: any) => {
})
}
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]
@@ -457,18 +457,33 @@ watch(() => props.id, async (newValue, oldValue) => {
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getById(fullId).then(res => {
if (res && res.code == 'A0000') {
feedbackPopup.value.open(
'重新发起告警单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.supervisionReport,
res.data.reformAdvice,
res.data.takeStep,
res.data.reportPath,
res.data.reformAdvice
)
if (res && res.code == 'A0000') {
if(props.businessKey == '3'){
feedbackPopup.value.open(
'填报告警反馈单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.supervisionReport,
res.data.reformAdvice
)
}else{
feedbackPopup.value.open(
'重新填报告警反馈单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.supervisionReport,
res.data.reformAdvice,
res.data.takeStep,
res.data.reportPath,
res.data.reformAdvice
)
}
}
}
})
}, {immediate: true})

View File

@@ -166,7 +166,7 @@ const tableStore = new TableStore({
},
click: row => {
feedbackPopup.value.open(
'填报反馈单',
'填报预警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -203,7 +203,7 @@ const tableStore = new TableStore({
},
click: row => {
feedbackPopup.value.open(
'编辑',
'编辑预警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -227,7 +227,7 @@ const tableStore = new TableStore({
click: row => {
// deviceQuitPopup.value.open('重新发起', row)
feedbackPopup.value.open(
'重新发起预警单',
'重新填报预警反馈单',
row.id,
row.status,
row.issueDetail,
@@ -322,7 +322,7 @@ const handleAudit = (instanceId: any, historyInstanceId: any) => {
})
}
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]
@@ -331,17 +331,29 @@ watch(() => props.id, async (newValue, oldValue) => {
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getById(fullId).then(res => {
if (res && res.code == 'A0000') {
feedbackPopup.value.open(
'重新发起预警单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.reportPath,
res.data.reformAdvice,
res.data.takeStep,
res.data.reportPath
)
if(props.businessKey == '3'){
feedbackPopup.value.open(
'填报预警反馈单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.reportPath,
res.data.reformAdvice
)
}else{
feedbackPopup.value.open(
'重新填报预警反馈单',
res.data.id,
res.data.status,
res.data.issueDetail,
res.data.problemPath,
res.data.reportPath,
res.data.reformAdvice,
res.data.takeStep,
res.data.reportPath
)
}
}
})
}, {immediate: true})

View File

@@ -5,10 +5,10 @@
<el-tab-pane label="技术监督管理" name="2"><technology v-if="activeName == '2'"/></el-tab-pane> -->
<el-tab-pane label='预警单列表' name='3'>
<earlyWarn :id="id" v-if="activeName == '3'" />
<earlyWarn :id="id" :businessKey='key' v-if="activeName == '3'" />
</el-tab-pane>
<el-tab-pane label='告警单列表' name='4'>
<alarm :id="id" v-if="activeName == '4'" />
<alarm :id="id" :businessKey='key' v-if="activeName == '4'" />
</el-tab-pane>
</el-tabs>
</div>
@@ -22,6 +22,7 @@ import { useRoute } from 'vue-router'
import { mainHeight } from '@/utils/layout'
const route = useRoute()
const id = ref('')
const key = ref('')
defineOptions({
name: 'supervision/supervision/manage'
})
@@ -32,12 +33,13 @@ const activeName: any = ref(null)
watch(() => route.query.t, async (newValue, oldValue) => {
if (route.fullPath.includes('supervision/supervision/manage')) {
let type = (route.query.type as string) || 'null'
if (type == 'null' || type == '0') {
if (type == 'null' || type == '0' || type == '3') {
activeName.value = '3'
} else {
activeName.value = '4'
}
id.value = (route.query.id as string) || 'null'
key.value = (route.query.key as string) || 'null'
id.value = id.value + '@' + route.query.t
}
}, {deep: true, immediate: true})

View File

@@ -1,59 +1,76 @@
<template>
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="550px" top="20vh">
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
<el-form-item for="-" label="本次定检时间:" prop="nowCheckTime">
<el-date-picker
v-model="form.nowCheckTime"
placeholder="选择日期"
format="YYYY-MM-DD"
style="width: 100%"
value-format="YYYY-MM-DD"
type="date"
/>
</el-form-item>
<el-dialog draggable class='cn-operate-dialog' v-model='dialogVisible' :title='title' width='550px' top='20vh'>
<el-form :inline='false' :model='form' label-width='120px' :rules='rules' ref='formRef'>
<el-form-item for="-" label="报告文件:" class="uploadFile" prop="reportPath">
<el-upload
v-model:file-list="form.reportPath"
ref="uploadRef"
action=""
accept=""
:limit="1"
:on-exceed="handleExceed"
:on-change="choose"
:auto-upload="false"
:on-remove="removeFile"
>
<template #trigger>
<el-button type="primary">上传文件</el-button>
</template>
</el-upload>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input
type="textarea"
clearable
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="请输入描述"
v-model="form.description"
></el-input>
</el-form-item>
</el-form>
<el-form-item label='所属供电公司' >
<el-input
readonly
v-model='form.dept'
></el-input>
</el-form-item>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-form-item label='终端名称' >
<el-input
readonly
v-model='form.deviceName'
></el-input>
</el-form-item>
<el-form-item for='-' label='本次定检时间:' prop='nowCheckTime'>
<el-date-picker
v-model='form.nowCheckTime'
placeholder='选择日期'
format='YYYY-MM-DD'
style='width: 100%'
value-format='YYYY-MM-DD'
type='date'
/>
</el-form-item>
<el-form-item for='-' label='报告文件:' class='uploadFile' prop='reportPath'>
<el-upload
v-model:file-list='form.reportPath'
ref='uploadRef'
action=''
accept=''
:limit='1'
:on-exceed='handleExceed'
:on-change='choose'
:auto-upload='false'
:on-remove='removeFile'
>
<template #trigger>
<el-button type='primary'>上传文件</el-button>
</template>
</el-upload>
</el-form-item>
<el-form-item label='描述' prop='description'>
<el-input
type='textarea'
clearable
:autosize='{ minRows: 2, maxRows: 4 }'
placeholder='请输入描述'
v-model='form.description'
></el-input>
</el-form-item>
</el-form>
<template #footer>
<span class='dialog-footer'>
<el-button @click='dialogVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'>确认</el-button>
</span>
</template>
</el-dialog>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
<script lang='ts' setup>
import { ref, inject } from 'vue'
import { genFileId, ElMessage } from 'element-plus'
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
import { uploadFile } from '@/api/system-boot/file'
import { reload, submitDevice } from '@/api/supervision-boot/cycleDetection/index'
const emits = defineEmits(['onSubmit'])
//下拉数据源
@@ -65,98 +82,102 @@ const dialogVisible = ref(false)
// 注意不要和表单ref的命名冲突
const form: any = ref({
id: '',
reportPath: [],
description: '',
nowCheckTime: ''
id: '',
reportPath: [],
description: '',
nowCheckTime: '',
dept: '',
deviceName: ''
})
//form表单校验规则
const rules = {
reportPath: [{ required: true, message: '请上传文件', trigger: 'change' }],
nowCheckTime: [{ required: true, message: '请选择定检时间', trigger: 'change' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }]
reportPath: [{ required: true, message: '请上传文件', trigger: 'change' }],
nowCheckTime: [{ required: true, message: '请选择定检时间', trigger: 'change' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }]
}
const open = async (text: string, tempData?: any) => {
title.value = text
if (tempData) {
form.value.id = tempData.id
form.value.status = tempData.status
if (tempData.status == null) {
form.value.reportPath = []
form.value.description = ''
} else {
form.value.reportPath = [{ name: tempData.checkFilePath.split('/')[2] }]
form.value.description = tempData.description
form.value.nowCheckTime = tempData.nowCheckTime
}
title.value = text
if (tempData) {
form.value.id = tempData.id
form.value.dept = tempData.dept
form.value.deviceName = tempData.deviceName
form.value.status = tempData.status
if (tempData.status == null) {
form.value.reportPath = []
form.value.description = ''
} else {
form.value.reportPath = [{ name: tempData.checkFilePath.split('/')[2] }]
form.value.description = tempData.description
form.value.nowCheckTime = tempData.nowCheckTime
}
}
dialogVisible.value = true
dialogVisible.value = true
}
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.value.status == null) {
submitDevice({ ...form.value, reportPath: reportPath.value }).then(res => {
ElMessage({
message: '提交成功!',
type: 'success'
})
dialogVisible.value = false
emits('onSubmit')
})
} else {
reload({ ...form.value, reportPath: reportPath.value }).then(res => {
ElMessage({
message: '提交成功!',
type: 'success'
})
dialogVisible.value = false
emits('onSubmit')
})
}
}
})
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.value.status == null) {
submitDevice({ ...form.value, reportPath: reportPath.value }).then(res => {
ElMessage({
message: '提交成功!',
type: 'success'
})
dialogVisible.value = false
emits('onSubmit')
})
} else {
reload({ ...form.value, reportPath: reportPath.value }).then(res => {
ElMessage({
message: '提交成功!',
type: 'success'
})
dialogVisible.value = false
emits('onSubmit')
})
}
}
})
}
// 上传报告
const uploadRef = ref()
const handleExceed: UploadProps['onExceed'] = files => {
uploadRef.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadRef.value!.handleStart(file)
uploadRef.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
uploadRef.value!.handleStart(file)
}
const choose = (e: any) => {
uploadFile(e.raw, '/supervision/').then(res => {
reportPath.value = res.data.name
// reportPath.value = '测试aaa'
})
uploadFile(e.raw, '/supervision/').then(res => {
reportPath.value = res.data.name
// reportPath.value = '测试aaa'
})
}
//移除文件上传
const removeFile = (file: any, uploadFiles: any) => {
console.log(file, uploadFiles)
console.log(file, uploadFiles)
}
defineExpose({ open })
</script>
<style scoped lang="scss">
<style scoped lang='scss'>
.el-upload-list__item {
transition: none !important;
transition: none !important;
}
.el-select {
min-width: 180px;
min-width: 180px;
}
::v-deep .el-tree-node__children > div {
display: block !important;
display: block !important;
}
</style>

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;
}

View File

@@ -11,7 +11,7 @@
<jointDebugList :id="id" v-if="activeName == '3'"/>
</el-tab-pane>
<el-tab-pane label="终端周期检测" name="4">
<cycleDetection :id="id" v-if="activeName == '4'"/>
<cycleDetection :id="id" :businessKey='key' v-if="activeName == '4'"/>
</el-tab-pane>
</el-tabs>
</div>
@@ -33,6 +33,7 @@ const activeName = ref('1')
const route = useRoute()
const id = ref('')
const key = ref('')
watch(() => route.query.t, async (newValue, oldValue) => {
if (route.fullPath.includes('terminalNetwotk')) {
@@ -47,6 +48,7 @@ watch(() => route.query.t, async (newValue, oldValue) => {
activeName.value = '4'
}
id.value = (route.query.id as string) || 'null'
key.value = (route.query.key as string) || 'null'
id.value = id.value + '@' + route.query.t
}
}, {deep: true, immediate: true})

View File

@@ -137,7 +137,6 @@ const tableStore = new TableStore({
}
// 特殊处理终端监测点状态切换
if (
// 干扰源建档
key == 'build_user_info'
@@ -192,8 +191,20 @@ const tableStore = new TableStore({
return row.source == 1 || row.source == 2
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
// 页面内tab切换
let type = row.tabValue
let key = '3'
// 业务记录id
let id = row.id
router.push({
name: row.routePath,
query: {
type,
id,
key,
t: Date.now()
}
})
}
}
]