修改冀北现场问题
This commit is contained in:
@@ -1,21 +1,29 @@
|
||||
<!---试运行列表-->
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll ref="TableHeaderRef">
|
||||
<template #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-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="试运行评估" name="1">
|
||||
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll ref="TableHeaderRef">
|
||||
<template #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-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- <el-dialog
|
||||
v-model='timeDialog'
|
||||
@@ -62,11 +70,11 @@ const { push } = useRouter()
|
||||
const adminInfo = useAdminInfo()
|
||||
const TableHeaderRef = ref()
|
||||
const tableRef = ref()
|
||||
|
||||
const activeName = ref('1')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/tempLinedebug/pageHasDebug',
|
||||
method: 'POST',
|
||||
// publicHeight: 65,
|
||||
publicHeight: 65,
|
||||
column: [
|
||||
{ title: '', type: 'checkbox', width: 40 },
|
||||
{ field: 'lineName', title: '监测点名称', minWidth: 160 },
|
||||
@@ -266,23 +274,20 @@ const deleteEven = () => {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let createBy = tableStore.table.selection.map(item => item.createBy)
|
||||
let status = tableStore.table.selection.map(item => item.status)
|
||||
if (adminInfo.roleCode.includes('delete_info')) {
|
||||
deleteList()
|
||||
} else if (createBy.includes(adminInfo.$state.id) && status.includes(0)) {
|
||||
deleteList()
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '只能删除自己填报的数据!!!'
|
||||
})
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
let createBy = tableStore.table.selection.map(item => item.createBy)
|
||||
let status = tableStore.table.selection.map(item => item.status)
|
||||
if (adminInfo.roleCode.includes('delete_info')) {
|
||||
deleteList()
|
||||
} else if (createBy.includes(adminInfo.$state.id) && status.includes(0)) {
|
||||
deleteList()
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '只能删除自己填报的数据!!!'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,43 +415,46 @@ const runTestSubmit = (type: number) => {
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
watch(() => route.query.t, async (newValue, oldValue) => {
|
||||
let nowTime = Date.now()
|
||||
let routeTime = route.query.t as number || 1
|
||||
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms,则不执行
|
||||
if (route.fullPath.includes('/testRun')) {
|
||||
let id = (route.query.id as string) || 'null'
|
||||
if (id != 'null') {
|
||||
monitorIds = []
|
||||
monitorIds.push(id)
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() + 1)
|
||||
start.setHours(0, 0, 0)
|
||||
const end = new Date()
|
||||
end.setDate(end.getDate() + 3)
|
||||
end.setHours(23, 59, 59)
|
||||
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
|
||||
const endString = formatDate(end, 'YYYY-MM-DD')
|
||||
const data = {
|
||||
startTime: startString,
|
||||
endTime: endString,
|
||||
lineIds: monitorIds,
|
||||
operateType: 1,
|
||||
id
|
||||
}
|
||||
update(data).then((res: any) => {
|
||||
if (res.code === 'A0000') {
|
||||
ElMessage({
|
||||
message: '发起试运行成功',
|
||||
type: 'success'
|
||||
})
|
||||
tableStore.index()
|
||||
watch(
|
||||
() => route.query.t,
|
||||
async (newValue, oldValue) => {
|
||||
let nowTime = Date.now()
|
||||
let routeTime = (route.query.t as number) || 1
|
||||
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms,则不执行
|
||||
if (route.fullPath.includes('/testRun')) {
|
||||
let id = (route.query.id as string) || 'null'
|
||||
if (id != 'null') {
|
||||
monitorIds = []
|
||||
monitorIds.push(id)
|
||||
const start = new Date()
|
||||
start.setDate(start.getDate() + 1)
|
||||
start.setHours(0, 0, 0)
|
||||
const end = new Date()
|
||||
end.setDate(end.getDate() + 3)
|
||||
end.setHours(23, 59, 59)
|
||||
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
|
||||
const endString = formatDate(end, 'YYYY-MM-DD')
|
||||
const data = {
|
||||
startTime: startString,
|
||||
endTime: endString,
|
||||
lineIds: monitorIds,
|
||||
operateType: 1,
|
||||
id
|
||||
}
|
||||
})
|
||||
|
||||
update(data).then((res: any) => {
|
||||
if (res.code === 'A0000') {
|
||||
ElMessage({
|
||||
message: '发起试运行成功',
|
||||
type: 'success'
|
||||
})
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { deep: true, immediate: true })
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user