update 流程定义预览 优化
This commit is contained in:
parent
1e0cc0f6f9
commit
8a7730936c
@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { LeaveVO, LeaveForm, LeaveQuery } from '@/api/demo/leave/types';
|
import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/workflow/leave/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询请假列表
|
* 查询请假列表
|
||||||
@ -31,7 +31,7 @@ export const getLeave = (id: string | number): AxiosPromise<LeaveVO> => {
|
|||||||
* 新增请假
|
* 新增请假
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const addLeave = (data: LeaveForm) => {
|
export const addLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/demo/leave',
|
url: '/demo/leave',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -43,7 +43,7 @@ export const addLeave = (data: LeaveForm) => {
|
|||||||
* 修改请假
|
* 修改请假
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
export const updateLeave = (data: LeaveForm) => {
|
export const updateLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/demo/leave',
|
url: '/demo/leave',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
@ -1,74 +1,22 @@
|
|||||||
export interface LeaveVO {
|
export interface LeaveVO {
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id: string | number;
|
id: string | number;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假类型
|
|
||||||
*/
|
|
||||||
leaveType: string;
|
leaveType: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
startDate: string;
|
startDate: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
endDate: string;
|
endDate: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假天数
|
|
||||||
*/
|
|
||||||
leaveDays: number;
|
leaveDays: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假原因
|
|
||||||
*/
|
|
||||||
remark: string;
|
remark: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LeaveForm extends BaseEntity {
|
export interface LeaveForm extends BaseEntity {
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
id?: string | number;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假类型
|
|
||||||
*/
|
|
||||||
leaveType?: string;
|
leaveType?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
startDate?: string;
|
startDate?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
endDate?: string;
|
endDate?: string;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假天数
|
|
||||||
*/
|
|
||||||
leaveDays?: number;
|
leaveDays?: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* 请假原因
|
|
||||||
*/
|
|
||||||
remark?: string;
|
remark?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LeaveQuery extends PageQuery {
|
export interface LeaveQuery extends PageQuery {
|
||||||
/**
|
|
||||||
* 请假天数
|
|
||||||
*/
|
|
||||||
startLeaveDays?: number;
|
startLeaveDays?: number;
|
||||||
/**
|
|
||||||
* 请假天数
|
|
||||||
*/
|
|
||||||
endLeaveDays?: number;
|
endLeaveDays?: number;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { ModelForm, ModelQuery, ModelVO } from '@/api/workflow/model/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询模型列表
|
* 查询模型列表
|
||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const listModel = (query: object) => {
|
export const listModel = (query: ModelQuery): AxiosPromise<ModelVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/model/list',
|
url: '/workflow/model/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -15,10 +17,10 @@ export const listModel = (query: object) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增模型
|
* 新增模型
|
||||||
* @param query
|
* @param data
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const addModel = (data: object) => {
|
export const addModel = (data: ModelForm): AxiosPromise<void> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/model/rest/models',
|
url: '/workflow/model/rest/models',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -28,10 +30,10 @@ export const addModel = (data: object) => {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 按id删除模型
|
* 按id删除模型
|
||||||
* @param {模型id} id
|
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
|
* @param id 模型id
|
||||||
*/
|
*/
|
||||||
export function delModel(id: object) {
|
export function delModel(id: string | string[]): AxiosPromise<void> {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/model/' + id,
|
url: '/workflow/model/' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
@ -40,10 +42,10 @@ export function delModel(id: object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型部署
|
* 模型部署
|
||||||
* @param {模型id} id
|
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
|
* @param id 模型id
|
||||||
*/
|
*/
|
||||||
export const modelDeploy = (id: string) => {
|
export const modelDeploy = (id: string): AxiosPromise<void> => {
|
||||||
return request({
|
return request({
|
||||||
url: `/workflow/model/modelDeploy/${id}`,
|
url: `/workflow/model/modelDeploy/${id}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
|
@ -6,7 +6,58 @@ export interface ModelForm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ModelQuery extends PageQuery {
|
export interface ModelQuery extends PageQuery {
|
||||||
|
name?: string;
|
||||||
|
key?: string;
|
||||||
|
categoryCode?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OriginalPersistentState {
|
||||||
|
metaInfo: string;
|
||||||
|
editorSourceValueId: string;
|
||||||
|
createTime: string;
|
||||||
|
deploymentId?: string;
|
||||||
|
name: string;
|
||||||
|
tenantId: string;
|
||||||
|
category?: string;
|
||||||
|
version: number;
|
||||||
|
editorSourceExtraValueId?: string;
|
||||||
|
key: string;
|
||||||
|
lastUpdateTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PersistentState {
|
||||||
|
metaInfo: string;
|
||||||
|
editorSourceValueId: string;
|
||||||
|
createTime: string;
|
||||||
|
deploymentId?: string;
|
||||||
|
name: string;
|
||||||
|
tenantId: string;
|
||||||
|
category?: string;
|
||||||
|
version: number;
|
||||||
|
editorSourceExtraValueId?: string;
|
||||||
|
key: string;
|
||||||
|
lastUpdateTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ModelVO {
|
||||||
|
id: string;
|
||||||
|
revision: number;
|
||||||
|
originalPersistentState: OriginalPersistentState;
|
||||||
name: string;
|
name: string;
|
||||||
key: string;
|
key: string;
|
||||||
categoryCode: string;
|
category?: string;
|
||||||
|
createTime: string;
|
||||||
|
lastUpdateTime: string;
|
||||||
|
version: number;
|
||||||
|
metaInfo: string;
|
||||||
|
deploymentId?: string;
|
||||||
|
editorSourceValueId: string;
|
||||||
|
editorSourceExtraValueId?: string;
|
||||||
|
tenantId: string;
|
||||||
|
persistentState: PersistentState;
|
||||||
|
revisionNext: number;
|
||||||
|
idPrefix: string;
|
||||||
|
inserted: boolean;
|
||||||
|
updated: boolean;
|
||||||
|
deleted: boolean;
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
* v-copyText 复制文本内容
|
* v-copyText 复制文本内容
|
||||||
* Copyright (c) 2022 ruoyi
|
* Copyright (c) 2022 ruoyi
|
||||||
*/
|
*/
|
||||||
|
import { DirectiveBinding } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
beforeMount(el: any, { value, arg }: any) {
|
beforeMount(el: any, { value, arg }: DirectiveBinding) {
|
||||||
if (arg === 'callback') {
|
if (arg === 'callback') {
|
||||||
el.$copyCallback = value;
|
el.$copyCallback = value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div class="search" v-show="showSearch">
|
<div v-show="showSearch" class="search">
|
||||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px">
|
||||||
<el-form-item label="分类名称" prop="categoryName">
|
<el-form-item label="分类名称" prop="categoryName">
|
||||||
<el-input v-model="queryParams.categoryName" placeholder="请输入分类名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.categoryName" placeholder="请输入分类名称" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -21,36 +21,43 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['workflow:category:add']">新增</el-button>
|
<el-button v-hasPermi="['workflow:category:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
<el-table v-loading="loading" :data="categoryList" row-key="id" :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" ref="categoryTableRef">
|
<el-table
|
||||||
|
ref="categoryTableRef"
|
||||||
|
v-loading="loading"
|
||||||
|
:data="categoryList"
|
||||||
|
row-key="id"
|
||||||
|
:default-expand-all="isExpandAll"
|
||||||
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
|
>
|
||||||
<el-table-column label="分类名称" prop="categoryName" />
|
<el-table-column label="分类名称" prop="categoryName" />
|
||||||
<el-table-column label="分类编码" align="center" prop="categoryCode" />
|
<el-table-column label="分类编码" align="center" prop="categoryCode" />
|
||||||
<el-table-column label="排序" align="center" prop="sortNum" />
|
<el-table-column label="排序" align="center" prop="sortNum" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip content="修改" placement="top">
|
<el-tooltip content="修改" placement="top">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['workflow:category:edit']" />
|
<el-button v-hasPermi="['workflow:category:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="新增" placement="top">
|
<el-tooltip content="新增" placement="top">
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['workflow:category:add']" />
|
<el-button v-hasPermi="['workflow:category:add']" link type="primary" icon="Plus" @click="handleAdd(scope.row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="删除" placement="top">
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['workflow:category:remove']" />
|
<el-button v-hasPermi="['workflow:category:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改流程分类对话框 -->
|
<!-- 添加或修改流程分类对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="500px" append-to-body>
|
||||||
<el-form ref="categoryFormRef" :model="form" :rules="rules" label-width="80px" v-loading="loading">
|
<el-form ref="categoryFormRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="父级分类" prop="parentId">
|
<el-form-item label="父级分类" prop="parentId">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="form.parentId"
|
v-model="form.parentId"
|
||||||
@ -82,20 +89,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Category" lang="ts">
|
<script setup name="Category" lang="ts">
|
||||||
import { listCategory, getCategory, delCategory, addCategory, updateCategory } from "@/api/workflow/category";
|
import { listCategory, getCategory, delCategory, addCategory, updateCategory } from '@/api/workflow/category';
|
||||||
import { CategoryVO, CategoryQuery, CategoryForm } from '@/api/workflow/category/types';
|
import { CategoryVO, CategoryQuery, CategoryForm } from '@/api/workflow/category/types';
|
||||||
import { ComponentInternalInstance } from 'vue';
|
|
||||||
import { ElForm, ElTable } from 'element-plus';
|
|
||||||
|
|
||||||
|
|
||||||
type CategoryOption = {
|
type CategoryOption = {
|
||||||
id: number;
|
id: number;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
children?: CategoryOption[];
|
children?: CategoryOption[];
|
||||||
}
|
};
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;;
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
const categoryList = ref<CategoryVO[]>([]);
|
const categoryList = ref<CategoryVO[]>([]);
|
||||||
const categoryOptions = ref<CategoryOption[]>([]);
|
const categoryOptions = ref<CategoryOption[]>([]);
|
||||||
@ -104,23 +107,22 @@ const showSearch = ref(true);
|
|||||||
const isExpandAll = ref(true);
|
const isExpandAll = ref(true);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const categoryFormRef = ref(ElForm);
|
const categoryFormRef = ref<ElFormInstance>();
|
||||||
const categoryTableRef = ref(ElTable)
|
const categoryTableRef = ref<ElTableInstance>();
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const initFormData: CategoryForm = {
|
const initFormData: CategoryForm = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
categoryName: undefined,
|
categoryName: undefined,
|
||||||
categoryCode: undefined,
|
categoryCode: undefined,
|
||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
sortNum: 0,
|
sortNum: 0
|
||||||
}
|
};
|
||||||
|
|
||||||
const data = reactive<PageData<CategoryForm, CategoryQuery>>({
|
const data = reactive<PageData<CategoryForm, CategoryQuery>>({
|
||||||
form: { ...initFormData },
|
form: { ...initFormData },
|
||||||
@ -128,21 +130,13 @@ const data = reactive<PageData<CategoryForm, CategoryQuery>>({
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
categoryName: undefined,
|
categoryName: undefined,
|
||||||
categoryCode: undefined,
|
categoryCode: undefined
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
id: [
|
id: [{ required: true, message: '主键不能为空', trigger: 'blur' }],
|
||||||
{ required: true, message: "主键不能为空", trigger: "blur" }
|
categoryName: [{ required: true, message: '分类名称不能为空', trigger: 'blur' }],
|
||||||
],
|
categoryCode: [{ required: true, message: '分类编码不能为空', trigger: 'blur' }],
|
||||||
categoryName: [
|
parentId: [{ required: true, message: '父级id不能为空', trigger: 'blur' }]
|
||||||
{ required: true, message: "分类名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
categoryCode: [
|
|
||||||
{ required: true, message: "分类编码不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
parentId: [
|
|
||||||
{ required: true, message: "父级id不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -152,49 +146,49 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listCategory(queryParams.value);
|
const res = await listCategory(queryParams.value);
|
||||||
const data = proxy?.handleTree<CategoryVO>(res.data, "id", "parentId");
|
const data = proxy?.handleTree<CategoryVO>(res.data, 'id', 'parentId');
|
||||||
if (data) {
|
if (data) {
|
||||||
categoryList.value = data;
|
categoryList.value = data;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 查询流程分类下拉树结构 */
|
/** 查询流程分类下拉树结构 */
|
||||||
const getTreeselect = async () => {
|
const getTreeselect = async () => {
|
||||||
const res = await listCategory();
|
const res = await listCategory();
|
||||||
categoryOptions.value = [];
|
categoryOptions.value = [];
|
||||||
const data: CategoryOption = { id: 0, categoryName: '顶级节点', children: [] };
|
const data: CategoryOption = { id: 0, categoryName: '顶级节点', children: [] };
|
||||||
data.children = proxy?.handleTree<CategoryOption>(res.data, "id", "parentId");
|
data.children = proxy?.handleTree<CategoryOption>(res.data, 'id', 'parentId');
|
||||||
categoryOptions.value.push(data);
|
categoryOptions.value.push(data);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
reset();
|
reset();
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
}
|
};
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {...initFormData}
|
form.value = { ...initFormData };
|
||||||
categoryFormRef.value.resetFields();
|
categoryFormRef.value?.resetFields();
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
getList();
|
getList();
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
queryFormRef.value.resetFields();
|
queryFormRef.value?.resetFields();
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
const handleAdd = (row?: CategoryVO) => {
|
const handleAdd = (row?: CategoryVO) => {
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = "添加流程分类";
|
dialog.title = '添加流程分类';
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
reset();
|
reset();
|
||||||
getTreeselect();
|
getTreeselect();
|
||||||
@ -204,27 +198,27 @@ const handleAdd = (row?: CategoryVO) => {
|
|||||||
form.value.parentId = 0;
|
form.value.parentId = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
const handleToggleExpandAll = () => {
|
const handleToggleExpandAll = () => {
|
||||||
isExpandAll.value = !isExpandAll.value;
|
isExpandAll.value = !isExpandAll.value;
|
||||||
toggleExpandAll(categoryList.value, isExpandAll.value)
|
toggleExpandAll(categoryList.value, isExpandAll.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
const toggleExpandAll = (data: CategoryVO[], status: boolean) => {
|
const toggleExpandAll = (data: CategoryVO[], status: boolean) => {
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
categoryTableRef.value.toggleRowExpansion(item, status)
|
categoryTableRef.value?.toggleRowExpansion(item, status);
|
||||||
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status)
|
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
const handleUpdate = (row: CategoryVO) => {
|
const handleUpdate = (row: CategoryVO) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
dialog.title = "修改流程分类";
|
dialog.title = '修改流程分类';
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
reset();
|
reset();
|
||||||
await getTreeselect();
|
await getTreeselect();
|
||||||
@ -235,7 +229,7 @@ const handleUpdate = (row: CategoryVO) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
@ -243,25 +237,25 @@ const submitForm = () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
if (form.value.id) {
|
if (form.value.id) {
|
||||||
await updateCategory(form.value).finally(() => buttonLoading.value = false);
|
await updateCategory(form.value).finally(() => (buttonLoading.value = false));
|
||||||
} else {
|
} else {
|
||||||
await addCategory(form.value).finally(() => buttonLoading.value = false);
|
await addCategory(form.value).finally(() => (buttonLoading.value = false));
|
||||||
}
|
}
|
||||||
proxy?.$modal.msgSuccess("操作成功");
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
getList();
|
await getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row: CategoryVO) => {
|
const handleDelete = async (row: CategoryVO) => {
|
||||||
await proxy?.$modal.confirm('是否确认删除流程分类编号为"' + row.id + '"的数据项?');
|
await proxy?.$modal.confirm('是否确认删除流程分类编号为"' + row.id + '"的数据项?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await delCategory(row.id).finally(() => loading.value = false);
|
await delCategory(row.id).finally(() => (loading.value = false));
|
||||||
await getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess("删除成功");
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
}
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div class="search" v-show="showSearch">
|
<div v-show="showSearch" class="search">
|
||||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px">
|
||||||
<el-form-item label="请假天数" prop="startLeaveDays">
|
<el-form-item label="请假天数" prop="startLeaveDays">
|
||||||
<el-input v-model="queryParams.startLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.startLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="endLeaveDays">
|
<el-form-item prop="endLeaveDays"> 至 </el-form-item>
|
||||||
至
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item prop="endLeaveDays">
|
<el-form-item prop="endLeaveDays">
|
||||||
<el-input v-model="queryParams.endLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.endLeaveDays" placeholder="请输入请假天数" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -24,21 +22,21 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['demo:leave:add']">新增</el-button>
|
<el-button v-hasPermi="['demo:leave:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['demo:leave:export']">导出</el-button>
|
<el-button v-hasPermi="['demo:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="leaveList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="leaveList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="主键" align="center" prop="id" v-if="false" />
|
<el-table-column v-if="false" label="主键" align="center" prop="id" />
|
||||||
<el-table-column label="请假类型" align="center">
|
<el-table-column label="请假类型" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="primary">{{ options.find(e=>e.value === scope.row.leaveType)?.label }}</el-tag>
|
<el-tag>{{ options.find((e) => e.value === scope.row.leaveType)?.label }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="开始时间" align="center" prop="startDate">
|
<el-table-column label="开始时间" align="center" prop="startDate">
|
||||||
@ -61,41 +59,56 @@
|
|||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
|
v-if="
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'draft' ||
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'cancel' ||
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'back'
|
||||||
|
"
|
||||||
content="修改"
|
content="修改"
|
||||||
placement="top"
|
placement="top"
|
||||||
v-if="scope.row.processInstanceVo.businessStatus === 'draft' || scope.row.processInstanceVo.businessStatus === 'cancel' || scope.row.processInstanceVo.businessStatus === 'back'"
|
|
||||||
>
|
>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['demo:leave:edit']"></el-button>
|
<el-button v-hasPermi="['demo:leave:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
|
v-if="
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'draft' ||
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'cancel' ||
|
||||||
|
scope.row.processInstanceVo.businessStatus === 'back'
|
||||||
|
"
|
||||||
content="删除"
|
content="删除"
|
||||||
placement="top"
|
placement="top"
|
||||||
v-if="scope.row.processInstanceVo.businessStatus === 'draft' || scope.row.processInstanceVo.businessStatus === 'cancel' || scope.row.processInstanceVo.businessStatus === 'back'"
|
|
||||||
>
|
>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['demo:leave:remove']"></el-button>
|
<el-button v-hasPermi="['demo:leave:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="撤销" placement="top" v-if="scope.row.processInstanceVo.businessStatus === 'waiting'">
|
<el-tooltip v-if="scope.row.processInstanceVo.businessStatus === 'waiting'" content="撤销" placement="top">
|
||||||
<el-button link type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.processInstanceVo.id)"></el-button>
|
<el-button link type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.processInstanceVo.id)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip content="审批记录" placement="top" v-if="scope.row.processInstanceVo.businessStatus === 'waiting'">
|
<el-tooltip v-if="scope.row.processInstanceVo.businessStatus === 'waiting'" content="审批记录" placement="top">
|
||||||
<el-button link type="primary" icon="Document" @click="handleApprovalRecord(scope.row.processInstanceVo.id)"></el-button>
|
<el-button link type="primary" icon="Document" @click="handleApprovalRecord(scope.row.processInstanceVo.id)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 添加或修改请假对话框 -->
|
<!-- 添加或修改请假对话框 -->
|
||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="800px" append-to-body>
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="800px" append-to-body>
|
||||||
<el-form ref="leaveFormRef" :model="form" :rules="rules" label-width="80px" v-loading="loading">
|
<el-form ref="leaveFormRef" v-loading="loading" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="请假类型" prop="leaveType">
|
<el-form-item label="请假类型" prop="leaveType">
|
||||||
<el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%;">
|
<el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%">
|
||||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请假时间">
|
<el-form-item label="请假时间">
|
||||||
<el-date-picker @change="changeLeaveTime()" v-model="leaveTime" type="daterange" range-separator="To" start-placeholder="开始时间" end-placeholder="结束时间" />
|
<el-date-picker
|
||||||
|
v-model="leaveTime"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="To"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
@change="changeLeaveTime()"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="请假天数" prop="leaveDays">
|
<el-form-item label="请假天数" prop="leaveDays">
|
||||||
<el-input v-model="form.leaveDays" disabled type="number" placeholder="请输入请假天数" />
|
<el-input v-model="form.leaveDays" disabled type="number" placeholder="请输入请假天数" />
|
||||||
@ -113,19 +126,20 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 提交组件 -->
|
<!-- 提交组件 -->
|
||||||
<submitVerify ref="submitVerifyRef" @submitCallback="submitCallback" :taskVariables="taskVariables" />
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
<!-- 审批记录 -->
|
<!-- 审批记录 -->
|
||||||
<approvalRecord ref="approvalRecordRef" />
|
<approvalRecord ref="approvalRecordRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Leave" lang="ts">
|
<script setup name="Leave" lang="ts">
|
||||||
import { listLeave, getLeave, delLeave, addLeave, updateLeave } from '@/api/workflow/leave';
|
import { addLeave, delLeave, getLeave, listLeave, updateLeave } from '@/api/workflow/leave';
|
||||||
import { cancelProcessApply } from '@/api/workflow/processInstance';
|
import { cancelProcessApply } from '@/api/workflow/processInstance';
|
||||||
import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/workflow/leave/types';
|
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||||
import { startWorkFlow } from '@/api/workflow/task';
|
import { startWorkFlow } from '@/api/workflow/task';
|
||||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
|
import { AxiosResponse } from 'axios';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
@ -155,14 +169,14 @@ const options = [
|
|||||||
value: '4',
|
value: '4',
|
||||||
label: '婚假'
|
label: '婚假'
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
//提交组件
|
//提交组件
|
||||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
//审批记录组件
|
//审批记录组件
|
||||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||||
|
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const leaveFormRef = ref(ElForm);
|
const leaveFormRef = ref<ElFormInstance>();
|
||||||
|
|
||||||
const submitFormData = ref<Record<string, any>>({
|
const submitFormData = ref<Record<string, any>>({
|
||||||
businessKey: '',
|
businessKey: '',
|
||||||
@ -171,7 +185,6 @@ const submitFormData = ref<Record<string, any>>({
|
|||||||
});
|
});
|
||||||
const taskVariables = ref<Record<string, any>>({});
|
const taskVariables = ref<Record<string, any>>({});
|
||||||
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
title: ''
|
title: ''
|
||||||
@ -221,8 +234,8 @@ const cancel = () => {
|
|||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = { ...initFormData };
|
form.value = { ...initFormData };
|
||||||
leaveTime.value = []
|
leaveTime.value = [];
|
||||||
leaveFormRef.value.resetFields();
|
leaveFormRef.value?.resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -233,7 +246,7 @@ const handleQuery = () => {
|
|||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
queryFormRef.value.resetFields();
|
queryFormRef.value?.resetFields();
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -254,11 +267,10 @@ const handleAdd = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changeLeaveTime = () => {
|
const changeLeaveTime = () => {
|
||||||
const startDate = new Date(leaveTime.value[0]).getTime()
|
const startDate = new Date(leaveTime.value[0]).getTime();
|
||||||
const endDate = new Date(leaveTime.value[1]).getTime()
|
const endDate = new Date(leaveTime.value[1]).getTime();
|
||||||
const diffInMilliseconds = endDate - startDate
|
const diffInMilliseconds = endDate - startDate;
|
||||||
const diffInDays = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24))
|
form.value.leaveDays = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24));
|
||||||
form.value.leaveDays = diffInDays
|
|
||||||
};
|
};
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
const handleUpdate = (row?: LeaveVO) => {
|
const handleUpdate = (row?: LeaveVO) => {
|
||||||
@ -270,9 +282,9 @@ const handleUpdate = (row?: LeaveVO) => {
|
|||||||
const _id = row?.id || ids.value[0];
|
const _id = row?.id || ids.value[0];
|
||||||
const res = await getLeave(_id);
|
const res = await getLeave(_id);
|
||||||
Object.assign(form.value, res.data);
|
Object.assign(form.value, res.data);
|
||||||
leaveTime.value = []
|
leaveTime.value = [];
|
||||||
leaveTime.value.push(form.value.startDate)
|
leaveTime.value.push(form.value.startDate);
|
||||||
leaveTime.value.push(form.value.endDate)
|
leaveTime.value.push(form.value.endDate);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -280,27 +292,27 @@ const handleUpdate = (row?: LeaveVO) => {
|
|||||||
const submitForm = (status: string) => {
|
const submitForm = (status: string) => {
|
||||||
if (leaveTime.value.length === 0) {
|
if (leaveTime.value.length === 0) {
|
||||||
proxy?.$modal.msgError('请假时间不能为空');
|
proxy?.$modal.msgError('请假时间不能为空');
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
leaveFormRef.value.validate(async (valid: boolean) => {
|
leaveFormRef.value?.validate(async (valid: boolean) => {
|
||||||
form.value.startDate = leaveTime.value[0]
|
form.value.startDate = leaveTime.value[0];
|
||||||
form.value.endDate = leaveTime.value[1]
|
form.value.endDate = leaveTime.value[1];
|
||||||
if (valid) {
|
if (valid) {
|
||||||
buttonLoading.value = true;
|
buttonLoading.value = true;
|
||||||
let res = {};
|
let res: AxiosResponse<LeaveVO>;
|
||||||
if (form.value.id) {
|
if (form.value.id) {
|
||||||
res = await updateLeave(form.value)
|
res = await updateLeave(form.value);
|
||||||
} else {
|
} else {
|
||||||
res = await addLeave(form.value)
|
res = await addLeave(form.value);
|
||||||
}
|
}
|
||||||
form.value = res.data
|
form.value = res.data;
|
||||||
if (status === 'draft') {
|
if (status === 'draft') {
|
||||||
buttonLoading.value = false
|
buttonLoading.value = false;
|
||||||
proxy?.$modal.msgSuccess('暂存成功');
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
getList()
|
await getList();
|
||||||
} else {
|
} else {
|
||||||
handleStartWorkFlow(res.data);
|
await handleStartWorkFlow(res.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -327,7 +339,7 @@ const handleExport = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//提交申请
|
//提交申请
|
||||||
const handleStartWorkFlow = async (data: any) => {
|
const handleStartWorkFlow = async (data: LeaveVO) => {
|
||||||
submitFormData.value.processKey = 'leave1';
|
submitFormData.value.processKey = 'leave1';
|
||||||
submitFormData.value.businessKey = data.id;
|
submitFormData.value.businessKey = data.id;
|
||||||
//流程变量
|
//流程变量
|
||||||
@ -335,14 +347,13 @@ const handleStartWorkFlow = async (data: any) => {
|
|||||||
entity: data,
|
entity: data,
|
||||||
leaveDays: data.leaveDays,
|
leaveDays: data.leaveDays,
|
||||||
userList: [1, 2]
|
userList: [1, 2]
|
||||||
}
|
};
|
||||||
submitFormData.value.variables = taskVariables.value;
|
submitFormData.value.variables = taskVariables.value;
|
||||||
startWorkFlow(submitFormData.value).then((response: any) => {
|
const resp = await startWorkFlow(submitFormData.value);
|
||||||
if (submitVerifyRef.value) {
|
if (submitVerifyRef.value) {
|
||||||
buttonLoading.value = false
|
buttonLoading.value = false;
|
||||||
submitVerifyRef.value.openDialog(response.data.taskId);
|
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
};
|
};
|
||||||
//审批记录
|
//审批记录
|
||||||
const handleApprovalRecord = (id: string) => {
|
const handleApprovalRecord = (id: string) => {
|
||||||
@ -360,7 +371,7 @@ const handleCancelProcessApply = async (id: string) => {
|
|||||||
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
await proxy?.$modal.confirm('是否确认撤销当前单据?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await cancelProcessApply(id).finally(() => (loading.value = false));
|
await cancelProcessApply(id).finally(() => (loading.value = false));
|
||||||
getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess('撤销成功');
|
proxy?.$modal.msgSuccess('撤销成功');
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="Flowable工作流在线流程设计器" width="90%" height="100%" v-model="visible" v-if="visible" :before-close="handleClose">
|
<el-dialog v-if="visible" v-model="visible" title="Flowable工作流在线流程设计器" width="90%" height="100%" :before-close="handleClose">
|
||||||
<div class="modeler">
|
<div class="modeler">
|
||||||
<iframe class="iframe" :src="src"></iframe>
|
<iframe class="iframe" :src="src"></iframe>
|
||||||
</div>
|
</div>
|
||||||
@ -7,12 +7,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { propTypes } from '@/utils/propTypes';
|
||||||
|
|
||||||
const baseURL = import.meta.env.VITE_APP_BASE_API;
|
const baseURL = import.meta.env.VITE_APP_BASE_API;
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
modelId: String
|
modelId: propTypes.string.isRequired
|
||||||
},
|
},
|
||||||
|
emits: ['handleClose'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -31,7 +34,7 @@ export default {
|
|||||||
},
|
},
|
||||||
clientid() {
|
clientid() {
|
||||||
return import.meta.env.VITE_APP_CLIENT_ID;
|
return import.meta.env.VITE_APP_CLIENT_ID;
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//全局存入当前vue实例
|
//全局存入当前vue实例
|
||||||
@ -39,10 +42,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async handleClose() {
|
async handleClose() {
|
||||||
await this.$modal.confirm('请记得点击左上角保存按钮,确定关闭设计窗口?').finally(() => (this as any).loading = false);
|
await this.$modal.confirm('请记得点击左上角保存按钮,确定关闭设计窗口?').finally(() => ((this as any).loading = false));
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
// 刷新数据
|
// 刷新数据
|
||||||
this.$emit("handleClose")
|
this.$emit('handleClose');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -51,6 +54,6 @@ export default {
|
|||||||
.iframe {
|
.iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 120px);
|
height: calc(100vh - 120px);
|
||||||
border: 0px;
|
border: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
<!-- 流程分类树 -->
|
<!-- 流程分类树 -->
|
||||||
<el-col :lg="4" :xs="24" style="">
|
<el-col :lg="4" :xs="24" style="">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-input placeholder="请输入流程分类名" v-model="categoryName" prefix-icon="Search" clearable />
|
<el-input v-model="categoryName" placeholder="请输入流程分类名" prefix-icon="Search" clearable />
|
||||||
<el-tree
|
<el-tree
|
||||||
class="mt-2"
|
|
||||||
ref="categoryTreeRef"
|
ref="categoryTreeRef"
|
||||||
|
class="mt-2"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:data="categoryOptions"
|
:data="categoryOptions"
|
||||||
:props="{ label: 'categoryName', children: 'children' }"
|
:props="{ label: 'categoryName', children: 'children' }"
|
||||||
@ -21,9 +21,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="20" :xs="24">
|
<el-col :lg="20" :xs="24">
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div class="mb-[10px]" v-show="showSearch">
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form v-show="showSearch" ref="queryFormRef" :model="queryParams" :inline="true" label-width="80px">
|
||||||
<el-form-item label="模型名称" prop="name">
|
<el-form-item label="模型名称" prop="name">
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入模型名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.name" placeholder="请输入模型名称" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -45,9 +45,9 @@
|
|||||||
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
<el-button type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -74,7 +74,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button link type="primary" size="small" icon="ScaleToOriginal" @click="clickDeploy(scope.row.id, scope.row.key)"> 流程部署 </el-button>
|
<el-button link type="primary" size="small" icon="ScaleToOriginal" @click="clickDeploy(scope.row.id, scope.row.key)">
|
||||||
|
流程部署
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button link type="primary" size="small" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
<el-button link type="primary" size="small" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
@ -83,12 +85,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 设计流程开始 -->
|
<!-- 设计流程开始 -->
|
||||||
<design ref="designModel" :modelId="modelId" @handleClose="getList" />
|
<design ref="designModel" :model-id="modelId" @handle-close="getList" />
|
||||||
<!-- 设计流程结束 -->
|
<!-- 设计流程结束 -->
|
||||||
<!-- 添加模型对话框 -->
|
<!-- 添加模型对话框 -->
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" width="650px" append-to-body :close-on-click-modal="false">
|
<el-dialog v-model="dialog.visible" :title="dialog.title" width="650px" append-to-body :close-on-click-modal="false">
|
||||||
@ -110,7 +118,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注:" prop="description">
|
<el-form-item label="备注:" prop="description">
|
||||||
<el-input type="textarea" v-model="form.description" maxlength="30" show-word-limit></el-input>
|
<el-input v-model="form.description" type="textarea" maxlength="30" show-word-limit></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -124,36 +132,34 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="Model">
|
<script lang="ts" setup name="Model">
|
||||||
import { listModel, addModel, delModel, modelDeploy } from '@/api/workflow/model';
|
|
||||||
import { ModelQuery, ModelForm } from '@/api/workflow/model/types';
|
|
||||||
import { ComponentInternalInstance } from 'vue';
|
|
||||||
import Design from './design.vue';
|
import Design from './design.vue';
|
||||||
import { listCategory } from "@/api/workflow/category";
|
import { listModel, addModel, delModel, modelDeploy } from '@/api/workflow/model';
|
||||||
import { ElTree } from 'element-plus';
|
import { ModelQuery, ModelForm, ModelVO } from '@/api/workflow/model/types';
|
||||||
|
import { listCategory } from '@/api/workflow/category';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
const designModel = ref<InstanceType<typeof Design>>();
|
const designModel = ref<InstanceType<typeof Design>>();
|
||||||
const formRef = ref(ElForm);
|
const formRef = ref<ElFormInstance>();
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const categoryTreeRef = ref<ElTreeInstance>();
|
||||||
|
|
||||||
type CategoryOption = {
|
type CategoryOption = {
|
||||||
categoryCode: string;
|
categoryCode: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
children?: CategoryOption[];
|
children?: CategoryOption[];
|
||||||
}
|
};
|
||||||
|
|
||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const ids = ref<Array<string | number>>([]);
|
const ids = ref<string[]>([]);
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const modelList = ref<any[]>([]);
|
const modelList = ref<ModelVO[]>([]);
|
||||||
const categoryOptions = ref<CategoryOption[]>([]);
|
const categoryOptions = ref<CategoryOption[]>([]);
|
||||||
const categoryName = ref('');
|
const categoryName = ref('');
|
||||||
const categoryTreeRef = ref(ElTree);
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
@ -194,18 +200,20 @@ onMounted(() => {
|
|||||||
const handleNodeClick = (data: ModelForm) => {
|
const handleNodeClick = (data: ModelForm) => {
|
||||||
queryParams.value.categoryCode = data.categoryCode;
|
queryParams.value.categoryCode = data.categoryCode;
|
||||||
if (data.categoryCode === 'ALL') {
|
if (data.categoryCode === 'ALL') {
|
||||||
queryParams.value.categoryCode = ''
|
queryParams.value.categoryCode = '';
|
||||||
}
|
|
||||||
handleQuery()
|
|
||||||
}
|
}
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
/** 通过条件过滤节点 */
|
/** 通过条件过滤节点 */
|
||||||
const filterNode = (value: string, data: any) => {
|
const filterNode = (value: string, data: any) => {
|
||||||
if (!value) return true
|
if (!value) return true;
|
||||||
return data.categoryName.indexOf(value) !== -1
|
return data.categoryName.indexOf(value) !== -1;
|
||||||
}
|
};
|
||||||
/** 根据名称筛选部门树 */
|
/** 根据名称筛选部门树 */
|
||||||
watchEffect(
|
watchEffect(
|
||||||
() => { categoryTreeRef.value.filter(categoryName.value); },
|
() => {
|
||||||
|
categoryTreeRef.value?.filter(categoryName.value);
|
||||||
|
},
|
||||||
{
|
{
|
||||||
flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
|
flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行
|
||||||
}
|
}
|
||||||
@ -218,34 +226,33 @@ const handleQuery = () => {
|
|||||||
};
|
};
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
queryFormRef.value.resetFields();
|
queryFormRef.value?.resetFields();
|
||||||
queryParams.value.categoryCode = '';
|
queryParams.value.categoryCode = '';
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
queryParams.value.pageSize = 10;
|
queryParams.value.pageSize = 10;
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
const handleSelectionChange = (selection: any) => {
|
const handleSelectionChange = (selection: ModelVO[]) => {
|
||||||
ids.value = selection.map((item: any) => item.id);
|
ids.value = selection.map((item: ModelVO) => item.id);
|
||||||
single.value = selection.length !== 1;
|
single.value = selection.length !== 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
//分页
|
//分页
|
||||||
const getList = () => {
|
const getList = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listModel(queryParams.value).then((resp) => {
|
const resp = await listModel(queryParams.value);
|
||||||
modelList.value = resp.rows;
|
modelList.value = resp.rows;
|
||||||
total.value = resp.total;
|
total.value = resp.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
|
||||||
};
|
};
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (row: any) => {
|
const handleDelete = async (row?: ModelVO) => {
|
||||||
const id = row.id || ids.value;
|
const id = row?.id || ids.value;
|
||||||
await proxy?.$modal.confirm('是否确认删除模型id为【' + id + '】的数据项?');
|
await proxy?.$modal.confirm('是否确认删除模型id为【' + id + '】的数据项?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await delModel(id).finally(() => (loading.value = false));
|
await delModel(id).finally(() => (loading.value = false));
|
||||||
getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
proxy?.$modal.msgSuccess('删除成功');
|
||||||
};
|
};
|
||||||
// 流程部署
|
// 流程部署
|
||||||
@ -253,7 +260,7 @@ const clickDeploy = async (id: string, key: string) => {
|
|||||||
await proxy?.$modal.confirm('是否部署模型key为【' + key + '】流程?');
|
await proxy?.$modal.confirm('是否部署模型key为【' + key + '】流程?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
await modelDeploy(id).finally(() => (loading.value = false));
|
await modelDeploy(id).finally(() => (loading.value = false));
|
||||||
getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess('部署成功');
|
proxy?.$modal.msgSuccess('部署成功');
|
||||||
};
|
};
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
@ -270,7 +277,7 @@ const submitForm = () => {
|
|||||||
await addModel(form.value);
|
await addModel(form.value);
|
||||||
proxy?.$modal.msgSuccess('新增成功');
|
proxy?.$modal.msgSuccess('新增成功');
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
getList();
|
await getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -303,7 +310,7 @@ const getTreeselect = async () => {
|
|||||||
const res = await listCategory();
|
const res = await listCategory();
|
||||||
categoryOptions.value = [];
|
categoryOptions.value = [];
|
||||||
const data: CategoryOption = { categoryCode: 'ALL', categoryName: '顶级节点', children: [] };
|
const data: CategoryOption = { categoryCode: 'ALL', categoryName: '顶级节点', children: [] };
|
||||||
data.children = proxy?.handleTree<CategoryOption>(res.data, "id", "parentId");
|
data.children = proxy?.handleTree<CategoryOption>(res.data, 'id', 'parentId');
|
||||||
categoryOptions.value.push(data);
|
categoryOptions.value.push(data);
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user