123
This commit is contained in:
@@ -30,6 +30,8 @@ import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import {queryMineStarted, queryMineTask} from "/@/api/flow/task";
|
||||
import {useMessage} from "/@/hooks/message";
|
||||
import request from "/@/utils/request";
|
||||
import {examineDict} from "/@/hooks/enums";
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -46,27 +48,7 @@ const emit = defineEmits<{
|
||||
const activeTab = ref('pending');
|
||||
const tableData = ref<any[]>([]);
|
||||
const loading = ref(false);
|
||||
/**
|
||||
* 根据任务名称判断类型
|
||||
* @param name 任务名称
|
||||
* @returns 任务类型
|
||||
*/
|
||||
const getTaskType = (name: string): string => {
|
||||
if (name.includes('投资申报') || name.includes('项目投资')) {
|
||||
return 'investment';
|
||||
}
|
||||
if (name.includes('专家') || name.includes('专家登记')) {
|
||||
return 'expert';
|
||||
}
|
||||
if (name.includes('投资储备') || name.includes('储备')) {
|
||||
return 'reserve';
|
||||
}
|
||||
if (name.includes('合作单位') || name.includes('合作')) {
|
||||
return 'cooperation';
|
||||
}
|
||||
// 默认类型
|
||||
return 'default';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 根据类型获取审批页面路由
|
||||
@@ -91,20 +73,29 @@ const getApprovalRoute = (type: string, taskId: string): string => {
|
||||
* @param row 行数据
|
||||
*/
|
||||
const handleRowClick = (row: any) => {
|
||||
const taskType = row.type || getTaskType(row.name);
|
||||
console.log(row);
|
||||
const taskId = row.taskId || row.id;
|
||||
const route = getApprovalRoute(taskType, taskId);
|
||||
|
||||
const route = getApprovalRoute(row.flowType, taskId);
|
||||
const routePath = examineDict[row.flowType]
|
||||
if (!routePath){
|
||||
useMessage().error('未定义的审批类型!')
|
||||
return
|
||||
}
|
||||
console.log(routePath)
|
||||
// 跳转到对应的审批页面
|
||||
router.push({
|
||||
path: route.split('?')[0],
|
||||
path: routePath,
|
||||
query: {
|
||||
id: taskId,
|
||||
type: taskType,
|
||||
processInstanceId: row.processInstanceId,
|
||||
tab: activeTab.value, // 传递当前标签页信息,用于返回时定位
|
||||
},
|
||||
});
|
||||
};
|
||||
// request('admin/sys/code/list',{
|
||||
// method:'get',
|
||||
// }).then(res=>{
|
||||
// console.log('test',res)
|
||||
// })
|
||||
const getQueryMineTask = () =>{
|
||||
return new Promise((resolve, reject) =>{
|
||||
queryMineTask({
|
||||
|
||||
Reference in New Issue
Block a user