修改资料库

This commit is contained in:
GGJ
2024-09-18 15:52:50 +08:00
parent 5cf6144763
commit 1a8e5e88a4
11 changed files with 588 additions and 330 deletions

View File

@@ -1,267 +1,284 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader>
<template v-slot:select>
<!-- <el-form-item label='任务名称'>-->
<!-- <el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称'></el-input>-->
<!-- </el-form-item>-->
<div>
<TableHeader>
<template v-slot:select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入搜索内容"></el-input>
</el-form-item>
<!-- <el-form-item label='任务类型'>-->
<!-- <el-select v-model="tableStore.table.params.runF" clearable placeholder="请选择任务类型">-->
<!-- <el-option-->
<!-- v-for="item in runFlagList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
<!-- <el-form-item label='任务类型'>-->
<!-- <el-select v-model="tableStore.table.params.runF" clearable placeholder="请选择任务类型">-->
<!-- <el-option-->
<!-- v-for="item in runFlagList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang='ts'>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import {onMounted, provide, ref, watch} from 'vue'
import {useRouter} from 'vue-router'
import {getById} from "@/api/supervision-boot/leaflet";
import {getRunningDeviceById} from "@/api/supervision-boot/device/quitRunningDev";
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import { getById } from '@/api/supervision-boot/leaflet'
import { getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
const router = useRouter() // 路由对象
defineOptions({
name: 'businessUser'
name: 'businessUser'
})
const {push, options, currentRoute} = useRouter()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/task/allTodoList',
method: 'POST',
publicHeight: 65,
isWebPaging: true,
column: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{title: '任务名称', field: 'taskName', minWidth: 200},
{title: '任务内容', field: 'taskContent', minWidth: 300},
{title: '任务来源', field: 'startUser', minWidth: 120},
{title: '发起时间', field: 'taskCreateTime', minWidth: 180},
{
field: 'source',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'danger',
3: 'primary'
},
replaceValue: {
1: '待审批',
2: '审批不通过',
3: '待处理'
}
},
{
title: '操作',
align: 'center',
minWidth: 100,
render: 'buttons',
buttons: [
url: '/bpm-boot/bpm/task/allTodoList',
method: 'POST',
publicHeight: 65,
isWebPaging: true,
column: [
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 2 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '重新发起',
type: 'warning',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: async row => {
// 页面内tab切换
let type = 1
let key = row.businessKey
// 特殊处理预告警单
if(key == 'warn_leaflet'){
await getById(row.id).then(res => {
if(res.code == 'A0000'){
if(res.data.leafletType == 1){
type = 0
}else {
type = 1
}
}
})
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'taskName', minWidth: 200 },
{ title: '任务内容', field: 'taskContent', minWidth: 300 },
{ title: '任务来源', field: 'startUser', minWidth: 120 },
{ title: '发起时间', field: 'taskCreateTime', minWidth: 180 },
{
field: 'source',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'danger',
3: 'primary'
},
replaceValue: {
1: '待审批',
2: '审批不通过',
3: '待处理'
}
},
{
title: '操作',
align: 'center',
minWidth: 100,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 2 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '重新发起',
type: 'warning',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: async row => {
// 页面内tab切换
let type = 1
let key = row.businessKey
// 特殊处理预告警单
if (key == 'warn_leaflet') {
await getById(row.id).then(res => {
if (res.code == 'A0000') {
if (res.data.leafletType == 1) {
type = 0
} else {
type = 1
}
}
})
}
if(key == 'quit_running_device'){
await getRunningDeviceById(row.id).then(res => {
if(res.code == 'A0000'){
if(res.data.deviceType == 1){
type = 0
}else {
type = 1
}
if (key == 'quit_running_device') {
await getRunningDeviceById(row.id).then(res => {
if (res.code == 'A0000') {
if (res.data.deviceType == 1) {
type = 0
} else {
type = 1
}
}
})
}
// 特殊处理终端监测点状态切换
if (
// 干扰源建档
key == 'build_user_info' ||
// 终端入网检测
key == 'device_info_add' ||
// 技术监督计划
key == 'sup_plan_add' ||
// 台账管理 干扰源用户台账
key == 'build_user_info_archivist'
) {
type = 1
} else if (
// 干扰源用户常态化管理
key == 'user_report_update' ||
// 入网方案申请
key == 'user_go_net' ||
// 治理工程审核
key == 'user_treat_check' ||
// 监测点台账录入
key == 'line_info_add' ||
// 技术监督计划测试
key == 'survey_test'
) {
type = 2
} else if (
// 监测点联调
key == 'temp_line_debug'
) {
type = 3
} else if (
// 终端周期检测
key == 'timing_check_device'
) {
type = 4
}
// 业务记录id
let id = row.id
router.push({
name: row.routePath,
query: {
type,
id,
key,
t: Date.now()
}
})
}
},
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 2
},
click: row => {
// 页面内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()
}
})
}
}
})
}
// 特殊处理终端监测点状态切换
if (
// 干扰源建档
key == 'build_user_info'
// 终端入网检测
|| key == 'device_info_add'
// 技术监督计划
|| key == 'sup_plan_add'
// 台账管理 干扰源用户台账
|| key == 'build_user_info_archivist') {
type = 1
} else if (
// 干扰源用户常态化管理
key == 'user_report_update'
// 入网方案申请
|| key == 'user_go_net'
// 治理工程审核
|| key == 'user_treat_check'
// 监测点台账录入
|| key == 'line_info_add'
// 技术监督计划测试
|| key == 'survey_test') {
type = 2
} else if (
// 监测点联调
key == 'temp_line_debug'
) {
type = 3
} else if (
// 终端周期检测
key == 'timing_check_device'
) {
type = 4
}
// 业务记录id
let id = row.id
router.push({
name: row.routePath,
query: {
type,
id,
key,
t: Date.now()
}
})
}
},
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 2
},
click: row => {
// 页面内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()
}
})
}
]
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '' && key != 'searchValue') {
delete tableStore.table.params[key]
}
}
},
loadCallback: () => {
if (tableStore.table.params.searchValue) {
const searchProps = ['taskName', 'taskContent', 'startUser', 'taskCreateTime']
const rest = tableStore.table.data.filter(item =>
searchProps.some(
key => String(item[key]).toLowerCase().indexOf(tableStore.table.params.searchValue) > -1
)
)
tableStore.table.data = rest.map(row => {
const item = Object.assign({}, row)
onMounted(() => {
// 加载数据
tableStore.index()
return item
})
} else {
tableStore.table.data = tableStore.table.data
}
}
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
provide('tableStore', tableStore)
onMounted(() => {
// 加载数据
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
todo: 'todo',
historyInstanceId
}
})
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
todo: 'todo',
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
deep: true
}
)
</script>