初始版本提交

This commit is contained in:
yaoyn
2024-02-05 09:15:37 +08:00
parent b52d4414be
commit 445292105f
1848 changed files with 236859 additions and 75 deletions

View File

@ -0,0 +1,123 @@
<template>
<BasicTable @register="registerTable">
<template #action="{ record }">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
auth: 'processtasks:edit',
onClick: handleEdit.bind(null, record),
},
{
icon: 'ant-design:delete-outlined',
auth: 'processtasks:delete',
color: 'error',
popConfirm: {
title: t('是否确认删除'),
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</BasicTable>
<LaunchProcess
v-if="processData.visible"
:draftsId="processData.draftsId"
:schemaId="processData.schemaId"
:draftsJsonStr="processData.draftsJsonStr"
@close="processData.visible = false"
/>
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import LaunchProcess from './../LaunchProcess.vue';
import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
import { deleteDraft, getDraftInfo, getSchemaTask } from '/@/api/workflow/process';
import { reactive } from 'vue';
import { notification } from 'ant-design-vue';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const configColumns: BasicColumn[] = [
{
title: t('流程名称'),
dataIndex: 'schemaName',
align: 'left',
},
{
title: t('发起者'),
dataIndex: 'originator',
sorter: true,
align: 'left',
},
{
title: t('发起时间'),
dataIndex: 'createDate',
align: 'left',
},
];
const processData = reactive({
visible: false,
schemaId: '',
draftsJsonStr: '',
draftsId: '',
});
const { formConfig } = userTaskTable();
const [registerTable, { reload }] = useTable({
title: t('草稿箱列表'),
api: getSchemaTask,
rowKey: 'id',
columns: configColumns,
formConfig: formConfig('Drafts'),
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.DRAFT };
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
actionColumn: {
width: 80,
title: t('操作'),
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: undefined,
},
});
async function handleEdit(record: Recordable) {
try {
let res = await getDraftInfo(record.id);
processData.draftsId = record.id;
processData.schemaId = res.schemaId;
processData.draftsJsonStr = res.formData;
processData.visible = true;
} catch (error) {}
}
async function handleDelete(record: Recordable) {
try {
let res = await deleteDraft([record.id]);
if (res) {
notification.open({
type: 'success',
message: t('删除'),
description: t('删除成功'),
});
reload();
} else {
notification.open({
type: 'error',
message: t('删除'),
description: t('删除失败'),
});
}
} catch (error) {}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,87 @@
<template>
<BasicTable @register="registerTable" @selection-change="selectionChange">
<template #toolbar>
<LookProcess :taskId="taskId" :processId="processId" @close="reload"
><a-button v-auth="'processtasks:view'">{{ t('查看') }}</a-button></LookProcess
>
</template>
<template #currentProgress="{ record }">
<a-progress v-if="record.currentProgress" :percent="record.currentProgress" size="small" />
</template>
</BasicTable>
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import LookProcess from './../LookProcess.vue';
import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
import { getSchemaTask } from '/@/api/workflow/process';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const configColumns: BasicColumn[] = [
{
title: t('流水号'),
dataIndex: 'serialNumber',
width: 50,
sorter: true,
},
{
title: t('流程名称'),
dataIndex: 'processName',
width: '32%',
align: 'left',
},
{
title: t('任务名称'),
dataIndex: 'taskName',
sorter: true,
width: '17%',
align: 'left',
},
{
title: t('当前进度'),
dataIndex: 'currentProgress',
sorter: true,
width: '17%',
slots: { customRender: 'currentProgress' },
},
{
title: t('发起人'),
dataIndex: 'originator',
align: 'left',
width: 80,
},
{
title: t('发起时间'),
width: 120,
dataIndex: 'createTime',
align: 'left',
},
];
const { formConfig, processId, taskId, selectionChange } = userTaskTable();
const [registerTable, { reload }] = useTable({
title: t('我的传阅列表'),
api: getSchemaTask,
rowKey: 'taskId',
columns: configColumns,
formConfig: formConfig(),
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.CIRCULATED };
},
rowSelection: {
type: 'radio',
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
});
</script>
<style scoped></style>

View File

@ -0,0 +1,181 @@
<template>
<BasicTable @register="registerTable" @selection-change="selectionChange">
<template #toolbar>
<RejectProcess
:processId="processId"
:taskId="taskId"
@close="reload"
@restart="restartProcess"
><a-button v-auth="'processtasks:withdraw'">{{ t('撤回') }}</a-button></RejectProcess
>
<LookProcess :taskId="taskId" :processId="processId" @close="reload"
><a-button v-auth="'processtasks:view'">{{ t('查看') }}</a-button></LookProcess
>
<a-button v-auth="'processtasks:relaunch'" @click="restartProcess">{{
t('重新发起')
}}</a-button>
</template>
<template #currentProgress="{ record }">
<a-progress v-if="record.currentProgress" :percent="record.currentProgress" size="small" />
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
icon: 'ant-design:delete-outlined',
auth: 'processtasks:delete',
color: 'error',
popConfirm: {
title: t('移入回收站'),
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</BasicTable>
<LaunchProcess
v-if="restartProcessVisible"
:schemaId="schemaId"
:taskId="taskId"
:processId="processId"
@close="restartProcessClose"
/>
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import { ref, unref, watch } from 'vue';
import LookProcess from './../LookProcess.vue';
import LaunchProcess from './../LaunchProcess.vue';
import RejectProcess from './../RejectProcess.vue';
import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
import { getSchemaTask, moveRecycle } from '/@/api/workflow/process';
import { notification } from 'ant-design-vue';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
import { useRouter } from 'vue-router';
const { t } = useI18n();
const restartProcessVisible = ref(false);
const configColumns: BasicColumn[] = [
{
title: t('流水号'),
dataIndex: 'serialNumber',
width: 50,
sorter: true,
},
{
title: t('流程名称'),
dataIndex: 'processName',
align: 'left',
width: '32%',
sorter: true,
},
{
title: t('任务名称'),
dataIndex: 'currentTaskName',
sorter: true,
width: '17%',
align: 'left',
},
{
title: t('当前进度'),
dataIndex: 'currentProgress',
sorter: true,
width: '17%',
slots: { customRender: 'currentProgress' },
},
{
title: t('发起人'),
dataIndex: 'originator',
align: 'left',
width: 80,
},
{
title: t('发起时间'),
align: 'left',
width: 120,
dataIndex: 'createTime',
},
];
const { formConfig, processId, taskId, schemaId, selectionChange } = userTaskTable();
const [registerTable, { reload }] = useTable({
title: t('我的流程列表'),
api: getSchemaTask,
rowKey: 'id',
columns: configColumns,
formConfig: formConfig('MyProcess'),
rowSelection: {
type: 'radio',
},
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.MY_PROCESS };
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
actionColumn: {
width: 60,
title: t('操作'),
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: undefined,
},
});
function restartProcess() {
if (processId.value) {
restartProcessVisible.value = true;
} else {
notification.open({
type: 'error',
message: t('提示'),
description: t('请选择一个流程重新发起'),
});
}
}
function restartProcessClose() {
restartProcessVisible.value = false;
reload();
}
async function handleDelete(record: Recordable) {
if (record.processId) {
try {
let res = await moveRecycle(record.processId);
if (res) {
notification.open({
type: 'success',
message: t('移入回收站'),
description: t('移入回收站成功'),
});
reload();
} else {
notification.open({
type: 'error',
message: t('移入回收站'),
description: t('移入回收站失败'),
});
}
} catch (error) {}
}
}
const { currentRoute } = useRouter();
watch(
() => unref(currentRoute),
(val) => {
if (val.name == 'ProcessTasks') reload();
},
{ deep: true },
);
</script>
<style scoped></style>

View File

@ -0,0 +1,136 @@
<template>
<BasicTable @register="registerTable" @selection-change="selectionChange">
<template #toolbar>
<LookProcess :taskId="taskId" :processId="processId" @close="reload">
<a-button v-auth="'processtasks:view'">{{ t('查看') }} </a-button>
</LookProcess>
<RestartProcess :schemaId="schemaId" :taskId="taskId" :processId="processId" @close="reload">
<a-button v-auth="'processtasks:relaunch'">{{ t('重新发起') }}</a-button>
</RestartProcess>
</template>
<template #currentProgress="{ record }">
<a-progress v-if="record.currentProgress" :percent="record.currentProgress" size="small" />
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
icon: 'ant-design:delete-outlined',
auth: 'processtasks:delete',
color: 'error',
popConfirm: {
title: t('是否确认删除'),
confirm: handleDelete.bind(null, record),
},
},
]"
/>
</template>
</BasicTable>
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import LookProcess from './../LookProcess.vue';
import RestartProcess from './../RestartProcess.vue';
import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
import { deleteRecycle, getSchemaTask } from '/@/api/workflow/process';
import { notification } from 'ant-design-vue';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const configColumns: BasicColumn[] = [
{
title: t('流水号'),
dataIndex: 'serialNumber',
width: 80,
},
{
title: t('流程名称'),
dataIndex: 'processName',
width: '32%',
align: 'left',
},
{
title: t('任务名称'),
dataIndex: 'currentTaskName',
width: '17%',
align: 'left',
},
{
title: t('当前进度'),
dataIndex: 'currentProgress',
width: '17%',
align: 'left',
slots: { customRender: 'currentProgress' },
},
{
title: t('发起人'),
dataIndex: 'originator',
width: 80,
align: 'left',
},
{
title: t('发起时间'),
width: 140,
dataIndex: 'createTime',
align: 'left',
},
];
const { formConfig, processId, taskId, schemaId, selectionChange } = userTaskTable();
const [registerTable, { reload }] = useTable({
title: t('回收站列表'),
api: getSchemaTask,
rowKey: 'taskId',
columns: configColumns,
formConfig: formConfig(),
rowSelection: {
type: 'radio',
},
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.RECYCLE };
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
actionColumn: {
width: 60,
title: t('操作'),
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: undefined,
},
});
async function handleDelete(record: Recordable) {
if (record.processId) {
try {
let res = await deleteRecycle([record.processId]);
if (res) {
notification.open({
type: 'success',
message: t('移入回收站'),
description: t('移入回收站成功'),
});
reload();
} else {
notification.open({
type: 'error',
message: t('移入回收站'),
description: t('移入回收站失败'),
});
}
} catch (error) {}
}
}
</script>
<style scoped></style>

View File

@ -0,0 +1,117 @@
<template>
<BasicTable @register="registerTable" @selection-change="selectionChange">
<template #toolbar>
<div class="button-box">
<RejectProcess
:taskId="taskId"
:processId="processId"
@close="reload"
@restart="restartProcess"
class="mr-2"
><a-button v-auth="'processtasks:withdraw'">{{ t('撤回') }}</a-button></RejectProcess
>
<LookProcess :taskId="taskId" :processId="processId" @close="reload"
><a-button v-auth="'processtasks:view'">{{ t('查看') }}</a-button></LookProcess
>
</div>
</template>
<template #currentProgress="{ record }">
<a-progress v-if="record.currentProgress" :percent="record.currentProgress" size="small" />
</template>
</BasicTable>
<LaunchProcess
v-if="restartProcessVisible"
:schemaId="schemaId"
:taskId="taskId"
@close="restartProcessClose"
/>
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import { ref } from 'vue';
import LookProcess from './../LookProcess.vue';
import LaunchProcess from './../LaunchProcess.vue';
import RejectProcess from './../RejectProcess.vue';
import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
import { getSchemaTask } from '/@/api/workflow/process';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const restartProcessVisible = ref(false);
const configColumns: BasicColumn[] = [
{
title: t('流水号'),
dataIndex: 'serialNumber',
width: 80,
},
{
title: t('流程名称'),
dataIndex: 'processName',
width: '32%',
align: 'left',
},
{
title: t('任务名称'),
dataIndex: 'currentTaskName',
width: '17%',
align: 'left',
},
{
title: t('当前进度'),
dataIndex: 'currentProgress',
width: '17%',
slots: { customRender: 'currentProgress' },
},
{
title: t('发起人'),
dataIndex: 'originator',
align: 'left',
width: 80,
},
{
title: t('发起时间'),
dataIndex: 'createTime',
align: 'left',
width: 120,
},
];
const { formConfig, processId, taskId, schemaId, selectionChange } = userTaskTable();
const [registerTable, { reload }] = useTable({
title: t('已办任务列表'),
api: getSchemaTask,
rowKey: 'id',
columns: configColumns,
formConfig: formConfig(),
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.FINISHED_TASKS };
},
rowSelection: {
type: 'radio',
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
indexColumnProps: {
width: 50,
},
});
function restartProcess() {
restartProcessVisible.value = true;
}
function restartProcessClose() {
restartProcessVisible.value = false;
reload();
}
</script>
<style scoped></style>

View File

@ -0,0 +1,132 @@
<template>
<BasicTable @register="registerTable" @selection-change="selectionChange">
<template #toolbar>
<BatchApprovalProcess
v-if="showBatchApproval"
@close="BatchClearHandler"
:selectedRows="data.selectedRows"
>
<a-button v-auth="'processtasks:batchApproval'">{{ t('批量审批') }}</a-button>
</BatchApprovalProcess>
<ApprovalProcess
v-else
:taskId="taskId"
:processId="processId"
:schemaId="schemaId"
@close="clearHandler"
:visible="false"
>
<a-button v-auth="'processtasks:approve'">{{ t('审批') }}</a-button>
</ApprovalProcess>
<LookProcess :taskId="taskId" :processId="processId" @close="clearHandler">
<a-button v-auth="'processtasks:view'">{{ t('查看') }}</a-button>
</LookProcess>
</template>
<template #currentProgress="{ record }">
<a-progress v-if="record.currentProgress" :percent="record.currentProgress" size="small" />
</template>
</BasicTable>
<InfoModal @register="registerModal" @success="reload" />
</template>
<script setup lang="ts">
import userTaskTable from './../../hooks/userTaskTable';
import { useModal } from '/@/components/Modal';
import LookProcess from './../LookProcess.vue';
import ApprovalProcess from './../ApprovalProcess.vue';
import BatchApprovalProcess from './../BatchApprovalProcess.vue';
import InfoModal from '../BatchApprovalInfo.vue';
import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
import { getSchemaTask } from '/@/api/workflow/process';
import { TaskTypeUrl } from '/@/enums/workflowEnum';
import { useI18n } from '/@/hooks/web/useI18n';
import { unref, watch } from 'vue';
import { useRouter } from 'vue-router';
const { t } = useI18n();
const configColumns: BasicColumn[] = [
{
title: t('流水号'),
dataIndex: 'serialNumber',
width: 80,
align: 'left',
},
{
title: t('流程名称'),
dataIndex: 'processName',
width: '32%',
align: 'left',
},
{
title: t('任务名称'),
dataIndex: 'taskName',
width: '17%',
align: 'left',
},
{
title: t('当前进度'),
dataIndex: 'currentProgress',
width: '17%',
align: 'left',
slots: { customRender: 'currentProgress' },
},
{
title: t('发起人'),
dataIndex: 'startUserName',
width: 80,
align: 'left',
},
{
title: t('发起时间'),
width: 120,
dataIndex: 'startTime',
align: 'left',
},
];
const [registerModal, { openModal }] = useModal();
const { formConfig, data, processId, taskId, schemaId, selectionChange, showBatchApproval } =
userTaskTable();
function BatchClearHandler(v) {
if (v) {
openModal(true, v);
}
clearSelectedRowKeys();
}
const clearHandler = () => {
clearSelectedRowKeys();
reload();
};
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
title: t('待办任务列表'),
api: getSchemaTask,
rowKey: 'id',
columns: configColumns,
formConfig: formConfig(),
beforeFetch: (params) => {
return { data: params, taskUrl: TaskTypeUrl.PENDING_TASKS };
},
rowSelection: {
type: 'checkbox',
},
useSearchForm: true,
showTableSetting: true,
striped: false,
pagination: {
pageSize: 18,
},
tableSetting: {
size: false,
setting: false,
},
});
const { currentRoute } = useRouter();
watch(
() => unref(currentRoute),
(val) => {
if (val.name == 'ProcessTasks') reload();
},
{ deep: true },
);
</script>
<style scoped></style>