|
|
@@ -2,13 +2,13 @@
|
|
|
* @Author: tengmingxue 1473375109@qq.com
|
|
|
* @Date: 2023-08-30 17:25:03
|
|
|
* @LastEditors: tengmingxue 1473375109@qq.com
|
|
|
- * @LastEditTime: 2023-08-31 16:00:09
|
|
|
+ * @LastEditTime: 2023-09-22 17:21:45
|
|
|
* @FilePath: \xld-gis-admin\src\views\dataAdmin\dataAdmin\flowStep\index.vue
|
|
|
* @Description: 流程图表
|
|
|
-->
|
|
|
<template>
|
|
|
<div class="flow-chart">
|
|
|
- <div class="flow-title">{{ flowTitle }}</div>
|
|
|
+ <div class="flow-title">{{ flowTitle }}流程信息</div>
|
|
|
<div class="flow-code">
|
|
|
<span>流程编号:</span>
|
|
|
<span>{{ flowCode }}</span>
|
|
|
@@ -42,7 +42,7 @@
|
|
|
<!-- <div class="desc-step-name">{{ step.stepName }}</div> -->
|
|
|
<div class="desc-handler">
|
|
|
<template v-for="user in step.handlers" :key="user.id">
|
|
|
- <span class="handler-name" :style="`background-color:${colors[user.status]};`">{{
|
|
|
+ <span class="handler-name" :style="`background-color:${colors[user.status]};`" :title="user.handler">{{
|
|
|
user.handler
|
|
|
}}</span>
|
|
|
</template>
|
|
|
@@ -53,7 +53,7 @@
|
|
|
</a-steps>
|
|
|
</div>
|
|
|
<div class="log-table">
|
|
|
- <handle-log></handle-log>
|
|
|
+ <handle-log :flowStatus="flowStatus"></handle-log>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -68,18 +68,26 @@ import { columns, searchFormSchema } from './flowData';
|
|
|
// 引入删除
|
|
|
import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
|
|
|
import { message, Popconfirm } from 'ant-design-vue';
|
|
|
-import HandleLog from './handleLog.vue'
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+import HandleLog from './handleLog.vue';
|
|
|
+import { session } from '/@/utils/Memory.js';
|
|
|
+import { getFlowConfigByBusinessName } from '/@/api/resource/examine';
|
|
|
+import { getAccountList } from '/@/api/system/system';
|
|
|
const props = {
|
|
|
flowTitle: { type: String, require: true },
|
|
|
flowCode: { type: String, default: '' },
|
|
|
+ flowStatus: { type: String, default: '1' }, //流程状态 1,新增 2 审核
|
|
|
};
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, Authority, Popconfirm, TableAction,HandleLog },
|
|
|
+ components: { BasicTable, Authority, Popconfirm, TableAction, HandleLog },
|
|
|
props,
|
|
|
setup(props, { emit }) {
|
|
|
const data = reactive({
|
|
|
flowTitle: ref(props.flowTitle),
|
|
|
flowCode: ref(props.flowCode),
|
|
|
+ flowName: props.flowTitle,
|
|
|
+ flowStatus: props.flowStatus, //流程状态 1,新增 2 审核
|
|
|
+ sysUserInfo: {},
|
|
|
legends: [
|
|
|
{ key: 1, name: '已完成', color: '#67C23A' },
|
|
|
{ key: 2, name: '进行中', color: '#2D74E7' },
|
|
|
@@ -90,54 +98,106 @@ export default defineComponent({
|
|
|
status: ['wait', 'finish', 'process', 'back'],
|
|
|
steps: [
|
|
|
//status 1:已完成,2:进行中,3:驳回,0:未开始
|
|
|
+ // {
|
|
|
+ // xh: 1,
|
|
|
+ // stepName: '地图资源上传',
|
|
|
+ // handlers: [{ handler: '张三', id: '1', status: '1' }],
|
|
|
+ // status: '1',
|
|
|
+ // },
|
|
|
+ // { xh: 6, stepName: '完成', handlers: [], status: '0' },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ const { createMessage } = useMessage();
|
|
|
+ /**
|
|
|
+ * 获取系统人员信息,并存为字典
|
|
|
+ */
|
|
|
+ const queryAllUserInfos = async () => {
|
|
|
+ const res = await getAccountList({ page: 1, pageSize: 999 });
|
|
|
+ if (res) {
|
|
|
+ res.items.map((item) => {
|
|
|
+ data.sysUserInfo[item['EMPLOYEE_ID']] = item['NAME'];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log('人员信息',data.sysUserInfo)
|
|
|
+ };
|
|
|
+ const queryData = async () => {
|
|
|
+ const res = await getFlowConfigByBusinessName(data.flowName);
|
|
|
+ console.log('地图资源上传配置信息', res);
|
|
|
+ if (res) {
|
|
|
+ setFlowNodes(res);
|
|
|
+ } else {
|
|
|
+ createMessage.error(`获取流程【${data.flowName}】配置信息异常!请联系管理员检查!`);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const setFlowNodes = (flow) => {
|
|
|
+ if (!flow?.flowInfo || !flow?.flowNode || !flow?.flowNodePerson) {
|
|
|
+ createMessage.error(`获取流程【${data.flowName}】配置信息异常!请联系管理员检查!`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (flow?.flowNode.length === 0) {
|
|
|
+ createMessage.error(`流程【${data.flowName}】未配置审核步骤!请联系管理员配置!`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const user = session.getItem('userInfo');
|
|
|
+ data.steps = [
|
|
|
{
|
|
|
- xh: '1',
|
|
|
- stepName: '地图资源上传',
|
|
|
- handlers: [{ handler: '张三', id: '1', status: '1' }],
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- xh: '2',
|
|
|
- stepName: '审核1',
|
|
|
- handlers: [
|
|
|
- { handler: '张三', id: '1', status: '1' },
|
|
|
- { handler: '李斯', id: '2', status: '1' },
|
|
|
- ],
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- xh: '3',
|
|
|
- stepName: '审核2',
|
|
|
- handlers: [
|
|
|
- { handler: '张三', id: '1', status: '1' },
|
|
|
- { handler: '李斯', id: '2', status: '2' },
|
|
|
- ],
|
|
|
- status: '2',
|
|
|
- },
|
|
|
- {
|
|
|
- xh: '4',
|
|
|
- stepName: '审核3',
|
|
|
- handlers: [{ handler: '张三', id: '1', status: '3' }],
|
|
|
- status: '3',
|
|
|
- },
|
|
|
- {
|
|
|
- xh: '5',
|
|
|
- stepName: '审核4',
|
|
|
+ xh: 0,
|
|
|
+ stepName: flow.flowInfo['FLOWNAME'],
|
|
|
handlers: [
|
|
|
- { handler: '张三', id: '1', status: '0' },
|
|
|
- { handler: '李斯', id: '2', status: '0' },
|
|
|
+ { handler: user['EMPLOYEE']['NAME'], id: user['EMPLOYEE']['EMPLOYEE_ID'], status: '1' },
|
|
|
],
|
|
|
- status: '0',
|
|
|
+ status: '1', //status 1:已完成,2:进行中,3:驳回,0:未开始
|
|
|
},
|
|
|
- { xh: '6', stepName: '完成', handlers: [], status: '0' },
|
|
|
- ],
|
|
|
- });
|
|
|
+ ];
|
|
|
+ const step = getFlowNodes(flow.flowNode, flow.flowNodePerson);
|
|
|
+ if(step) data.steps.push(...step)
|
|
|
+ const length = step.length
|
|
|
+ //最后一步默认完成
|
|
|
+ data.steps.push({ xh: length+2, stepName: '完成', handlers: [], status: '0' })
|
|
|
+ };
|
|
|
+
|
|
|
+ const getFlowNodes = (flowNode, flowNodePerson) => {
|
|
|
+ let index = 1;
|
|
|
+ let steps = [];
|
|
|
+ function getNextNode(nodes, id) {
|
|
|
+ const node = flowNode.find((item) => item['PRENODEID'] === id);
|
|
|
+ if (node) {
|
|
|
+ const eximPersons = flowNodePerson.filter((item) => item['FLOWNODEID'] === node['ID']);
|
|
|
+ let handlers = [];
|
|
|
+ eximPersons.map((item) => {
|
|
|
+ handlers.push({
|
|
|
+ handler: data.sysUserInfo[item['USERID']],
|
|
|
+ id: item['USERID'],
|
|
|
+ status: '0',
|
|
|
+ });
|
|
|
+ });
|
|
|
+ steps.push({
|
|
|
+ xh: (index = index + 1),
|
|
|
+ stepName: node['NODENAME'],
|
|
|
+ handlers: handlers,
|
|
|
+ status: '0',
|
|
|
+ });
|
|
|
+ getNextNode(nodes, node['ID']); //递归
|
|
|
+ }
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ getNextNode(flowNode,'')
|
|
|
+ return steps
|
|
|
+ };
|
|
|
|
|
|
// 生命周期函数
|
|
|
- onMounted(() => {});
|
|
|
+ onMounted(() => {
|
|
|
+ queryAllUserInfos();
|
|
|
+ queryData();
|
|
|
+ });
|
|
|
|
|
|
return {
|
|
|
...toRefs(data),
|
|
|
+ createMessage,
|
|
|
+ queryData,
|
|
|
+ setFlowNodes,
|
|
|
+ getFlowNodes,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
@@ -262,7 +322,7 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .log-table{
|
|
|
+ .log-table {
|
|
|
height: calc(100% - 374px);
|
|
|
}
|
|
|
}
|