流程部署

This commit is contained in:
cxc
2022-12-21 14:50:22 +08:00
parent 750f66aaf4
commit 0e9013c8c8
14 changed files with 1083 additions and 871 deletions

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
ref="queryFormRef"
:inline="true"
v-show="showSearch"
label-width="68px"
@ -174,13 +174,14 @@
import { download } from "@/utils/request";
import {
listAllCategory,
// getCategory,
getCategory,
delCategory,
addCategory,
// updateCategory,
updateCategory,
} from "@/api/flowable/category";
import { ElMessage, ElMessageBox } from "element-plus";
import { ref } from "vue";
// 按钮loading
const buttonLoading = ref(false);
// 遮罩层
@ -203,6 +204,7 @@ const title = ref("");
const open = ref(false);
const formRef = ref();
const queryFormRef = ref();
const data = reactive({
// 查询参数
queryParams: {
@ -265,14 +267,19 @@ function handleQuery() {
}
/** 重置按钮操作 */
function resetQuery() {
resetForm("queryForm");
if (queryFormRef.value) {
queryFormRef.value.resetFields();
}
handleQuery();
}
// 多选框选中数据
function handleSelectionChange(selection) {
this.ids = selection.map((item) => item.categoryId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
ids.value = selection.map((item) => ({
id: item.categoryId,
uuid: item.uuid,
}));
single.value = selection.length !== 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
@ -282,14 +289,14 @@ function handleAdd() {
}
/** 修改按钮操作 */
function handleUpdate(row) {
this.loading = true;
this.reset();
const categoryId = row.categoryId || this.ids;
loading.value = true;
reset();
const categoryId = row.categoryId || ids.value[0].id;
getCategory(categoryId).then((response) => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改流程分类";
loading.value = false;
form.value = response.data;
open.value = true;
title.value = "修改流程分类";
});
}
/** 提交按钮 */
@ -325,7 +332,9 @@ function submitForm() {
function handleDelete(row) {
const categoryIds = [{ id: row.categoryId, uuid: row.uuid }] || ids.value;
ElMessageBox.confirm(
'是否确认删除【请填写功能名称】编号为"' + categoryIds + '"的数据项?'
'是否确认删除【请填写功能名称】编号为"' +
categoryIds.map((el) => el.id).join(",") +
'"的数据项?'
)
.then(() => {
loading.value = true;
@ -343,7 +352,7 @@ function handleDelete(row) {
/** 导出按钮操作 */
function handleExport() {
download(
"workflow/category/export",
"flowable/category/export",
{
...queryParams.value,
},

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
ref="queryFormRef"
:inline="true"
v-show="showSearch"
label-width="68px"
@ -75,7 +75,7 @@
size="small"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['workflow:deploy:remove']"
v-hasPermi="['flowable:deploy:remove']"
>删除</el-button
>
</el-col>
@ -141,18 +141,20 @@
<template #default="{ row }">
<el-button
link
type="primary"
size="small"
icon="price-tag"
@click.native="handlePublish(row)"
v-hasPermi="['workflow:deploy:list']"
v-hasPermi="['flowable:deploy:list']"
>版本管理</el-button
>
<el-button
link
type="danger"
size="small"
icon="delete"
@click="handleDelete(row)"
v-hasPermi="['workflow:deploy:remove']"
v-hasPermi="['flowable:deploy:remove']"
>删除</el-button
>
</template>
@ -230,7 +232,7 @@
icon="video-pause"
v-if="!row.suspended"
@click.native="handleChangeState(row, 'suspended')"
v-hasPermi="['workflow:deploy:status']"
v-hasPermi="['flowable:deploy:status']"
>挂起</el-button
>
<el-button
@ -239,7 +241,7 @@
icon="video-play"
v-if="row.suspended"
@click.native="handleChangeState(row, 'active')"
v-hasPermi="['workflow:deploy:status']"
v-hasPermi="['flowable:deploy:status']"
>激活</el-button
>
<el-button
@ -247,7 +249,7 @@
size="small"
icon="delete"
@click="handleDelete(row)"
v-hasPermi="['workflow:deploy:remove']"
v-hasPermi="['flowable:deploy:remove']"
>删除</el-button
>
</template>
@ -359,8 +361,9 @@ function handleQuery() {
getList();
}
/** 重置按钮操作 */
const queryFormRef = ref();
function resetQuery() {
resetForm("queryForm");
queryFormRef.value && queryFormRef.value.resetFields();
handleQuery();
}
// 多选框选中数据
@ -414,6 +417,9 @@ function handleDelete(row) {
.then(() => {
loading.value = false;
getList();
if (publishQueryParams.value.processKey) {
getPublishList();
}
ElMessage.success("删除成功");
})
.finally(() => {

View File

@ -133,7 +133,7 @@
<!-- 添加或修改流程表单对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="表单名称" prop="formName">
<el-input v-model="form.formName" placeholder="请输入表单名称" />
</el-form-item>
@ -202,6 +202,7 @@ const formConfOpen = ref(false);
const formTitle = ref("");
// 是否显示弹出层
const open = ref(false);
const formRef = ref();
const data = reactive({
formConf: {}, // 默认表单数据
// 查询参数
@ -285,7 +286,7 @@ function handleUpdate(row) {
}
/** 提交按钮 */
function submitForm() {
this.$refs["form"].validate((valid) => {
formRef.value.validate((valid) => {
if (valid) {
if (form.value.formId != null) {
updateForm(form.value).then((response) => {
@ -295,9 +296,9 @@ function submitForm() {
});
} else {
addForm(form.value).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
ElMessage.success("新增成功");
open.value = false;
getList();
});
}
}
@ -325,16 +326,16 @@ function handleDelete(row) {
}
/** 导出按钮操作 */
function handleExport() {
let _this = this;
this.$confirm("是否确认导出所有流程表单数据项?", "警告", {
// let _this = this;
ElMessageBox.confirm("是否确认导出所有流程表单数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(function () {
_this.download(
download(
"/workflow/form/export",
{
..._this.queryParams,
...queryParams.value,
},
`form_${new Date().getTime()}.xlsx`
);

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
ref="queryFormRef"
:inline="true"
v-show="showSearch"
label-width="68px"
@ -163,6 +163,7 @@
<el-button
size="small"
link
type="primary"
icon="edit"
@click="handleUpdate(row)"
v-hasPermi="['flowable:model:edit']"
@ -170,6 +171,7 @@
>
<el-button
link
type="primary"
size="small"
icon="brush"
@click="handleDesigner(row)"
@ -178,6 +180,7 @@
>
<el-button
link
type="primary"
size="small"
icon="video-play"
v-hasPermi="['flowable:model:deploy']"
@ -329,7 +332,6 @@
width="70%"
append-to-body
>
<!-- TODO: -->
<process-viewer
:key="`designer-${processView.index}`"
:xml="processView.xmlData"
@ -426,7 +428,6 @@
append-to-body
fullscreen
>
<!-- TODO: -->
<process-designer
:key="designerOpen"
style="border: 1px solid rgba(0, 0, 0, 0.1)"
@ -585,19 +586,20 @@ function reset() {
}
/** 搜索按钮操作 */
function handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const queryFormRef = ref();
function resetQuery() {
this.$refs.queryForm.resetFields();
this.handleQuery();
queryFormRef.value.resetFields();
handleQuery();
}
// 多选框选中数据
function handleSelectionChange(selection) {
this.ids = selection.map((item) => item.modelId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
ids.value = selection.map((item) => item.modelId);
single.value = selection.length !== 1;
multiple.value = !selection.length;
}
/** 部署流程 */
function handleDeploy(row) {