add 添加表单配置

This commit is contained in:
gssong 2024-03-31 15:34:54 +08:00
parent 5dfc25a493
commit 2ea1807f34
19 changed files with 744 additions and 159 deletions

View File

@ -0,0 +1,38 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DefinitionConfigVO, DefinitionConfigForm } from '@/api/workflow/definitionConfig/types';
/**
*
* @param id
*/
export const getByDefId = (definitionId: string | number): AxiosPromise<DefinitionConfigVO> => {
return request({
url: '/workflow/definitionConfig/getByDefId/' + definitionId,
method: 'get'
});
};
/**
*
* @param data
*/
export const saveOrUpdate = (data: DefinitionConfigForm) => {
return request({
url: '/workflow/definitionConfig/saveOrUpdate',
method: 'post',
data: data
});
};
/**
*
* @param id
*/
export const deldefinitionConfig = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/definitionConfig/' + id,
method: 'delete'
});
};

View File

@ -1,13 +1,15 @@
export interface FormDefinitionVO {
import { FormManageVO } from '@/api/workflow/formManage/types';
export interface DefinitionConfigVO {
/**
*
*/
id: string | number;
/**
*
* ID
*/
path: string;
formId?: string | number;
/**
* ID
@ -24,18 +26,23 @@ export interface FormDefinitionVO {
*/
remark: string;
/**
*
*/
wfFormManageVo: FormManageVO;
}
export interface FormDefinitionForm extends BaseEntity {
export interface DefinitionConfigForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
*
* ID
*/
path?: string;
formId?: string | number;
/**
* ID
@ -52,14 +59,20 @@ export interface FormDefinitionForm extends BaseEntity {
*/
remark?: string;
/**
*
*/
wfFormManageVo: FormManageVO;
}
export interface FormDefinitionQuery extends PageQuery {
export interface DefinitionConfigQuery extends PageQuery {
/**
*
* ID
*/
path?: string;
formId?: string | number;
/**
* ID
@ -72,9 +85,10 @@ export interface FormDefinitionQuery extends PageQuery {
processKey?: string;
/**
*
*
*/
params?: any;
wfFormManageVo: FormManageVO;
}

View File

@ -1,38 +0,0 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FormDefinitionVO, FormDefinitionForm, FormDefinitionQuery } from '@/api/workflow/formDefinition/types';
/**
*
* @param id
*/
export const getByDefId = (definitionId: string | number): AxiosPromise<FormDefinitionVO> => {
return request({
url: '/workflow/formDefinition/getByDefId/' + definitionId,
method: 'get'
});
};
/**
*
* @param data
*/
export const saveOrUpdate = (data: FormDefinitionForm) => {
return request({
url: '/workflow/formDefinition/saveOrUpdate',
method: 'post',
data: data
});
};
/**
*
* @param id
*/
export const delFormDefinition = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/formDefinition/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,76 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FormManageVO, FormManageForm, FormManageQuery } from '@/api/workflow/formManage/types';
/**
*
* @param query
* @returns {*}
*/
export const listFormManage = (query?: FormManageQuery): AxiosPromise<FormManageVO[]> => {
return request({
url: '/workflow/formManage/list',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const selectListFormManage = (): AxiosPromise<FormManageVO[]> => {
return request({
url: '/workflow/formManage/list/selectList',
method: 'get',
});
};
/**
*
* @param id
*/
export const getFormManage = (id: string | number): AxiosPromise<FormManageVO> => {
return request({
url: '/workflow/formManage/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addFormManage = (data: FormManageForm) => {
return request({
url: '/workflow/formManage',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateFormManage = (data: FormManageForm) => {
return request({
url: '/workflow/formManage',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delFormManage = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/formManage/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,75 @@
export interface FormManageVO {
/**
*
*/
id: string | number;
/**
*
*/
formName: string;
/**
*
*/
formType: string;
/**
*
*/
formTypeName: string;
/**
* /ID
*/
router: string;
/**
*
*/
remork: string;
}
export interface FormManageForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
*
*/
formName?: string;
/**
*
*/
formType?: string;
/**
* /ID
*/
router?: string;
/**
*
*/
remork?: string;
}
export interface FormManageQuery extends PageQuery {
/**
*
*/
formName?: string;
/**
*
*/
formType?: string;
}

View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types';
/**
*
* @param query
* @returns {*}
*/
export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise<NodeConfigVO[]> => {
return request({
url: '/workflow/nodeConfig/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getNodeConfig = (id: string | number): AxiosPromise<NodeConfigVO> => {
return request({
url: '/workflow/nodeConfig/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addNodeConfig = (data: NodeConfigForm) => {
return request({
url: '/workflow/nodeConfig',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateNodeConfig = (data: NodeConfigForm) => {
return request({
url: '/workflow/nodeConfig',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delNodeConfig = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/nodeConfig/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,43 @@
import { FormManageVO } from '@/api/workflow/formManage/types';
export interface NodeConfigVO {
/**
*
*/
id: string | number;
/**
* id
*/
formId: string | number;
/**
*
*/
formType: string;
/**
*
*/
nodeName: string;
/**
* id
*/
nodeId: string | number;
/**
* id
*/
definitionId: string | number;
/**
*
*/
wfFormManageVo: FormManageVO;
}

View File

@ -1,3 +1,5 @@
import { NodeConfigVO } from '@/api/workflow/nodeConfig/types';
import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types';
export interface TaskQuery extends PageQuery {
name?: string;
processDefinitionKey?: string;
@ -37,8 +39,8 @@ export interface TaskVO extends BaseEntity {
participantVo: ParticipantVo;
multiInstance: boolean;
businessKey: string;
formKey: string;
wfFormDefinitionVo: any;
wfNodeConfigVo: NodeConfigVO;
wfDefinitionConfigVo: DefinitionConfigVO;
}
export interface VariableVo {

View File

@ -0,0 +1,49 @@
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
export default {
routerJump(routerJumpVo: RouterJumpVo,proxy){
if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'static' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`,
query: {
id: routerJumpVo.businessKey,
type: routerJumpVo.type,
taskId: routerJumpVo.taskId
}
});
} else if (routerJumpVo.wfNodeConfigVo && routerJumpVo.wfNodeConfigVo.formType === 'dynamic' && routerJumpVo.wfNodeConfigVo.wfFormManageVo) {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${routerJumpVo.wfNodeConfigVo.wfFormManageVo.router}`,
query: {
id: routerJumpVo.businessKey,
type: routerJumpVo.type,
taskId: routerJumpVo.taskId
}
});
}else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'static') {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`,
query: {
id: routerJumpVo.businessKey,
type: routerJumpVo.type,
taskId: routerJumpVo.taskId
}
});
}else if (routerJumpVo.wfDefinitionConfigVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo && routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.formType === 'dynamic') {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${routerJumpVo.wfDefinitionConfigVo.wfFormManageVo.router}`,
query: {
id: routerJumpVo.businessKey,
type: routerJumpVo.type,
taskId: routerJumpVo.taskId
}
});
} else {
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
}
}

View File

@ -0,0 +1,10 @@
import { NodeConfigVO } from '@/api/workflow/nodeConfig/types';
import { DefinitionConfigVO } from '@/api/workflow/definitionConfig/types';
export interface RouterJumpVo {
wfDefinitionConfigVo: DefinitionConfigVO;
wfNodeConfigVo: NodeConfigVO;
businessKey: string;
taskId: string;
type: string;
}

View File

@ -21,8 +21,10 @@
<el-form-item v-if="showConfig.skipExpression" prop="skipExpression" label="跳过表达式">
<el-input v-model="formData.skipExpression" @change="skipExpressionChange"> </el-input>
</el-form-item>
<el-form-item prop="formKey" label="表单地址">
<el-input v-model="formData.formKey" @change="formKeyChange" placeholder="当前节点表单路由如:/demo/leaveEdit/index"> </el-input>
<el-form-item prop="formKey" label="表单地址" v-loading="formManageListLoading">
<el-select @change="formKeyChange" v-model="formData.formKey" clearable filterable placeholder="请选择表单" style="width: 260px" >
<el-option v-for="item in formManageList" :key="item.id" :label="item.formTypeName+':'+item.formName" :value="item.formType+':'+item.id" />
</el-select>
</el-form-item>
</div>
</el-collapse-item>
@ -239,9 +241,10 @@ import { TaskPanel } from 'bpmnDesign';
import { AllocationTypeEnum, MultiInstanceTypeEnum, SpecifyDescEnum } from '@/enums/bpmn/IndexEnums';
import { UserVO } from '@/api/system/user/types';
import { RoleVO } from '@/api/system/role/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { selectListFormManage } from '@/api/workflow/formManage';
import { FormManageVO } from '@/api/workflow/formManage/types';
const formManageList = ref<FormManageVO[]>([]);
const formManageListLoading = ref(false);
interface PropType {
element: ModdleElement;
}
@ -459,6 +462,18 @@ const SpecifyDesc = [
{ id: 'fa253b34-4335-458c-b1bc-b039e2a2b7a6', label: '指定一个人', value: 'specifySingle' },
{ id: '7365ff54-2e05-4312-9bfb-0b8edd779c5b', label: '指定多个人', value: 'specifyMultiple' }
];
const listFormManage = async () => {
formManageListLoading.value = true
const res = await selectListFormManage();
formManageList.value = res.data;
formManageListLoading.value = false
}
onMounted(() => {
nextTick(() => {
listFormManage();
});
});
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,249 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div class="search" v-show="showSearch">
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="表单名称" prop="formName">
<el-input v-model="queryParams.formName" placeholder="请输入表单名称" clearable style="width: 240px" @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['workflow:formManage:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['workflow:formManage:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['workflow:formManage:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['workflow:formManage:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="formManageList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="表单名称" align="center" prop="formName" />
<el-table-column label="表单类型" align="center">
<template #default="scope">
<dict-tag :options="wf_form_type" :value="scope.row.formType"></dict-tag>
</template>
</el-table-column>
<el-table-column label="地址" align="center" prop="router" />
<el-table-column label="备注" align="center" prop="remork" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['workflow:formManage:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['workflow:formManage:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
<!-- 添加或修改表单管理对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="formManageFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="表单名称" prop="formName">
<el-input v-model="form.formName" placeholder="请输入表单名称" />
</el-form-item>
<el-form-item label="表单类型" prop="formType">
<el-radio-group v-model="form.formType" @change="form.router = ''">
<el-radio border v-for="dict in wf_form_type" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="路由地址" prop="router" v-if="form.formType === 'static'">
<el-input v-model="form.router" placeholder="请输入路由地址" />
</el-form-item>
<el-form-item label="表单" prop="router" v-else>
<el-input v-model="form.router" disabled placeholder="请选择表单" >
<template #append>
<el-button icon="Search" />
</template>
</el-input>
</el-form-item>
<el-form-item label="备注" prop="remork">
<el-input v-model="form.remork" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="FormManage" lang="ts">
import { listFormManage, getFormManage, delFormManage, addFormManage, updateFormManage } from '@/api/workflow/formManage';
import { FormManageVO, FormManageQuery, FormManageForm } from '@/api/workflow/formManage/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wf_form_type } = toRefs<any>(proxy?.useDict('wf_form_type'));
const formManageList = ref<FormManageVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const formManageFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: FormManageForm = {
id: undefined,
formName: undefined,
formType: 'static',
remork: undefined,
}
const data = reactive<PageData<FormManageForm, FormManageQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
formName: undefined,
formType: undefined
},
rules: {
id: [
{ required: true, message: "主键不能为空", trigger: "blur" }
],
formName: [
{ required: true, message: "表单名称不能为空", trigger: "blur" }
],
formType: [
{ required: true, message: "表单类型不能为空", trigger: "change" }
],
router: [
{ required: true, message: "不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询表单管理列表 */
const getList = async () => {
loading.value = true;
const res = await listFormManage(queryParams.value);
formManageList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
formManageFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: FormManageVO[]) => {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加表单管理";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: FormManageVO) => {
reset();
const _id = row?.id || ids.value[0]
const res = await getFormManage(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改表单管理";
}
/** 提交按钮 */
const submitForm = () => {
formManageFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateFormManage(form.value).finally(() => buttonLoading.value = false);
} else {
await addFormManage(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: FormManageVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除表单管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
await delFormManage(_ids);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('workflow/formManage/export', {
...queryParams.value
}, `formManage_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>

View File

@ -221,15 +221,17 @@
</el-dialog>
<!-- 表单配置 -->
<el-dialog v-model="formDialog.visible" :title="formDialog.title" width="650px" append-to-body :close-on-click-modal="false">
<el-form :model="formDefinitionForm" label-width="auto">
<el-form :model="definitionConfigForm" label-width="auto">
<el-form-item label="流程KEY">
<el-input v-model="formDefinitionForm.processKey" disabled/>
<el-input v-model="definitionConfigForm.processKey" disabled/>
</el-form-item>
<el-form-item label="路由地址">
<el-input v-model="formDefinitionForm.path" placeholder="请假示例路由请填写:/demo/leaveEdit/index"/>
<el-form-item label="表单" prop="formId">
<el-select v-model="definitionConfigForm.formId" clearable filterable placeholder="请选择表单" style="width: 260px" >
<el-option v-for="item in formManageList" :key="item.id" :label="item.formTypeName+':'+item.formName" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="formDefinitionForm.remark" type="textarea" resize="none"/>
<el-input v-model="definitionConfigForm.remark" type="textarea" resize="none"/>
</el-form-item>
</el-form>
@ -258,12 +260,15 @@ import {
} from '@/api/workflow/processDefinition';
import ProcessPreview from './components/processPreview.vue';
import { listCategory } from '@/api/workflow/category';
import { getByDefId,saveOrUpdate } from '@/api/workflow/formDefinition';
import { getByDefId,saveOrUpdate } from '@/api/workflow/definitionConfig';
import { CategoryVO } from '@/api/workflow/category/types';
import { ProcessDefinitionQuery, ProcessDefinitionVO } from '@/api/workflow/processDefinition/types';
import { FormDefinitionForm } from '@/api/workflow/formDefinition/types';
import { definitionConfigForm } from '@/api/workflow/definitionConfig/types';
import { UploadRequestOptions } from 'element-plus';
import { FormManageVO } from '@/api/workflow/formManage/types';
import { selectListFormManage } from '@/api/workflow/formManage';
const formManageList = ref<FormManageVO[]>([]);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const previewRef = ref<InstanceType<typeof ProcessPreview>>();
@ -290,7 +295,7 @@ const categoryOptions = ref<CategoryOption[]>([]);
const categoryName = ref('');
/** 部署文件分类选择 */
const selectCategory = ref();
const formDefinitionForm = ref<FormDefinitionForm>({});
const definitionConfigForm = ref<definitionConfigForm>({});
const uploadDialog = reactive<DialogOption>({
visible: false,
@ -473,21 +478,22 @@ const handerDeployProcessFile = (data: UploadRequestOptions): XMLHttpRequest =>
};
//
const handleFormOpen = async (row: ProcessDefinitionVO) => {
listFormManage()
formDialog.visible = true
formDefinitionForm.value.processKey = row.key
formDefinitionForm.value.definitionId = row.id
definitionConfigForm.value.processKey = row.key
definitionConfigForm.value.definitionId = row.id
const resp = await getByDefId(row.id)
if(resp.data){
formDefinitionForm.value = resp.data
definitionConfigForm.value = resp.data
}else{
formDefinitionForm.value.path = undefined
formDefinitionForm.value.remark = undefined
definitionConfigForm.value.formId = undefined
definitionConfigForm.value.remark = undefined
}
}
//
const handlerSaveForm = async () => {
await proxy?.$modal.confirm('是否确认保存?');
saveOrUpdate(formDefinitionForm.value).then(resp=>{
saveOrUpdate(definitionConfigForm.value).then(resp=>{
if(resp.code === 200){
proxy?.$modal.msgSuccess('操作成功');
formDialog.visible = false
@ -495,4 +501,9 @@ const handlerSaveForm = async () => {
}
})
}
//
const listFormManage = async () => {
const res = await selectListFormManage();
formManageList.value = res.data;
}
</script>

View File

@ -161,6 +161,8 @@ import { getListByKey, migrationDefinition } from '@/api/workflow/processDefinit
import { listCategory } from '@/api/workflow/category';
import { CategoryVO } from '@/api/workflow/category/types';
import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
//
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const queryFormRef = ref<ElFormInstance>();
@ -347,18 +349,14 @@ const handleChange = async (id: string) => {
};
/** 查看按钮操作 */
const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: 'view'
});
workflowCommon.routerJump(routerJumpVo,proxy)
};
onMounted(() => {

View File

@ -54,13 +54,13 @@
</template>
<template v-else>
<el-tag type="success">
{{ scope.row.assigneeName }}
{{ scope.row.assigneeName || '无'}}
</el-tag>
</template>
</template>
<template v-else-if="tab === 'finish'" #default="scope">
<el-tag type="success">
{{ scope.row.assigneeName }}
{{ scope.row.assigneeName || '无'}}
</el-tag>
</template>
</el-table-column>
@ -129,6 +129,8 @@ import { getPageByAllTaskWait, getPageByAllTaskFinish, updateAssignee, getInstan
import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue';
import UserSelect from '@/components/UserSelect';
import { TaskQuery, TaskVO, VariableVo } from '@/api/workflow/task/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
//
//
const multiInstanceUserRef = ref<InstanceType<typeof MultiInstanceUser>>();
@ -260,18 +262,14 @@ const handleInstanceVariable = async (row: TaskVO) => {
};
/** 查看按钮操作 */
const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: 'view'
});
workflowCommon.routerJump(routerJumpVo,proxy)
};
onMounted(() => {
getWaitingList();

View File

@ -117,6 +117,8 @@ import { getPageByCurrent, deleteRunAndHisInstance, cancelProcessApply } from '@
import { listCategory } from '@/api/workflow/category';
import { CategoryVO } from '@/api/workflow/category/types';
import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const queryFormRef = ref<ElFormInstance>();
const categoryTreeRef = ref<ElTreeInstance>();
@ -250,17 +252,13 @@ const handleCancelProcessApply = async (processInstanceId: string) => {
//
const handleOpen = async (row,type) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: type
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: type
});
workflowCommon.routerJump(routerJumpVo,proxy)
};
</script>

View File

@ -43,7 +43,7 @@
</template>
<template v-else>
<el-tag type="success">
{{ scope.row.assigneeName }}
{{ scope.row.assigneeName || '无'}}
</el-tag>
</template>
</template>
@ -73,6 +73,8 @@
<script lang="ts" setup>
import { getPageByTaskCopy} from '@/api/workflow/task';
import { TaskQuery } from '@/api/workflow/task/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
//
const queryFormRef = ref<ElFormInstance>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -127,18 +129,14 @@ const getTaskCopyList = () => {
/** 查看按钮操作 */
const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: 'view'
});
workflowCommon.routerJump(routerJumpVo,proxy)
};

View File

@ -37,7 +37,7 @@
<el-table-column fixed align="center" prop="assigneeName" label="办理人">
<template #default="scope">
<el-tag type="success">
{{ scope.row.assigneeName }}
{{ scope.row.assigneeName || '无'}}
</el-tag>
</template>
</el-table-column>
@ -62,6 +62,8 @@
<script lang="ts" setup>
import { getPageByTaskFinish } from '@/api/workflow/task';
import { TaskQuery, TaskVO } from '@/api/workflow/task/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
//
const queryFormRef = ref<ElFormInstance>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -113,19 +115,15 @@ const getFinishList = () => {
});
};
/** 查看按钮操作 */
const handleView = (row) => {
if(row.wfFormDefinitionVo){
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'view'
}
})
}else{
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const handleView = (row: TaskVO) => {
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: 'view'
});
workflowCommon.routerJump(routerJumpVo,proxy)
};
onMounted(() => {

View File

@ -43,7 +43,7 @@
</template>
<template v-else>
<el-tag type="success">
{{ scope.row.assigneeName }}
{{ scope.row.assigneeName || '无' }}
</el-tag>
</template>
</template>
@ -79,6 +79,9 @@
<script lang="ts" setup>
import { getPageByTaskWait, claim, returnTask } from '@/api/workflow/task';
import { TaskQuery, TaskVO } from '@/api/workflow/task/types';
import workflowCommon from '@/api/workflow/workflowCommon';
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
//
const queryFormRef = ref<ElFormInstance>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -135,29 +138,14 @@ const getWaitingList = () => {
};
//
const handleOpen = async (row: TaskVO) => {
if (row.formKey != null) {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.formKey}`,
query: {
id: row.businessKey,
type: 'approval',
taskId: row.id
}
});
} else if (row.wfFormDefinitionVo) {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: `${row.wfFormDefinitionVo.path}`,
query: {
id: row.businessKey,
type: 'approval',
taskId: row.id
}
});
} else {
proxy?.$modal.msgError('请到流程定义菜单配置路由!');
}
const routerJumpVo = reactive<RouterJumpVo>({
wfDefinitionConfigVo: row.wfDefinitionConfigVo,
wfNodeConfigVo: row.wfNodeConfigVo,
businessKey: row.businessKey,
taskId: row.id,
type: 'approval'
});
workflowCommon.routerJump(routerJumpVo,proxy)
};
/** 认领任务 */