dev_xds
姜玉琦 2023-09-07 23:40:23 +08:00
parent a3c282cdd0
commit ff40abd034
4 changed files with 250 additions and 289 deletions

View File

@ -39,7 +39,7 @@ logging:
com.ruoyi: debug com.ruoyi: debug
com.yanzhu.jh: debug com.yanzhu.jh: debug
org.springframework: warn org.springframework: warn
org.flowable: debug
# 用户配置 # 用户配置
user: user:
password: password:

View File

@ -560,6 +560,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
} else { } else {
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list(); List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
if(CollectionUtils.isNotEmpty(historicTaskInstance)){
flowTask.setTaskId(historicTaskInstance.get(0).getId()); flowTask.setTaskId(historicTaskInstance.get(0).getId());
flowTask.setTaskName(historicTaskInstance.get(0).getName()); flowTask.setTaskName(historicTaskInstance.get(0).getName());
if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) { if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
@ -572,6 +573,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
} }
} }
}
flowList.add(flowTask); flowList.add(flowTask);
} }
page.setRecords(flowList); page.setRecords(flowList);

View File

@ -0,0 +1,238 @@
<template>
<div class="app-container">
<el-drawer
v-if="onOpen"
:visible.sync="onOpen"
ref="drawer"
direction="rtl"
size="60%"
@close="closeCallBack"
style="padding-left: 20px; padding-right: 20px"
>
<template slot="title">
<div>工程管理 {{ title }}</div>
</template>
<el-form
ref="form"
:model="form"
:rules="rules"
v-loading="loading"
label-width="120px"
style="padding-right: 35px"
>
<div class="canvas" ref="flowCanvas"></div>
<div class="maskLayer" />
<el-form-item label="所属项目" prop="businessKey">
<el-select
v-model="form.businessKey"
placeholder="请选择所属项目"
style="width: 100%"
filterable
:disabled="disPro"
@change="projectChage"
>
<el-option
v-for="(item, index) in projectOptions"
:key="index"
:label="item.projectName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="发起单位">
{{ deptName }}
</el-form-item>
<el-form-item label="发起人">
{{ nickName }}
</el-form-item>
<el-form-item label="审批事项">
{{ title }}
</el-form-item>
<el-form-item label="审批内容" prop="files">
<FileUpload
@input="fileInput"
:limit="9"
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
/>
</el-form-item>
<el-form-item label="申请说明" prop="remark">
<el-input
type="textarea"
v-model="form.remark"
placeholder="请输入申请说明"
rows="5"
/>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="submitForm"></el-button>
<el-button @click="doCanel"> </el-button>
</div>
</el-drawer>
</div>
</template>
<script>
import store from "@/store";
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import { getNextFlowNodeByStart } from "@/api/flowable/todo";
export default {
components: {},
props: {
closeCallBack: {
type: Function,
},
},
data() {
return {
//
onOpen: false,
//
loading: false,
//
title: "",
//
form: {
businessKey: "",
projectName: "",
files: "",
remark: "",
},
//
rules: {
businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
files: [{ required: true, message: "请上传申请内容", trigger: "blur" }],
remark: [
{ required: false, message: "请输入申请说明", trigger: "blur" },
{
max: 500,
message: "申请说明最多输入500字",
trigger: "blur",
},
],
},
projectOptions: null,
deptName: null,
nickName: null,
disPro: false,
bpmnViewer: null,
options: null,
taskTitle: null,
taskOpen: false,
};
},
computed: {},
watch: {},
created() {},
mounted() {},
beforeDestroy() {},
methods: {
//
initMyProject() {
//
this.$api.publics.getMyProjectList({}).then((response) => {
this.projectOptions = response.rows;
if (response.rows.length == 0) {
this.$message.error("未查询到和您关联项目,请联系子公司或管理员...");
} else if (response.rows.length == 1) {
//
this.form.businessKey = response.rows[0].id;
this.form.projectName = response.rows[0].projectName;
}
});
},
//
projectChage(val) {
let projectName = "";
this.projectOptions.forEach((item) => {
if ((item.id = val)) {
projectName = item.projectName;
return;
}
});
this.form.projectName = projectName;
},
doCanel() {
this.onOpen = false;
},
show(options) {
console.log(options);
this.options = options;
this.initMyProject();
this.title = options.name;
this.deptName = store.getters.dept.deptName;
this.nickName = store.getters.name;
const self = this;
this.onOpen = true;
flowXmlAndNode({ deployId: options.deploymentId }).then((res) => {
this.initFlowImage(res.data.xmlData);
});
},
async initFlowImage(data) {
try {
self.bpmnViewer = new BpmnViewer({
container: this.$refs.flowCanvas,
height: "150px",
});
await self.bpmnViewer.importXML(data);
//
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
} catch (err) {
console.error(err.message, err.warnings);
}
},
fileInput(files) {
let fileUrls = "";
if (files.length > 0) {
fileUrls = "";
files.forEach((item) => {
fileUrls += "," + item.url;
});
fileUrls = fileUrls.substring(1);
}
this.form.files = fileUrls;
},
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.loading = true;
// todo
// getNextFlowNodeByStart({
// deploymentId: this.options.deploymentId,
// variables: this.form,
// }).then((res) => {
// const data = res.data;
// if (data) {
// console.log(data);
// this.loading = false;
// }
// });
//
definitionStart(this.options.id, JSON.stringify(this.form)).then((res) => {
this.$modal.msgSuccess(res.msg);
this.loading = false;
//
this.$refs.drawer.closeDrawer();
});
}
});
},
},
};
</script>
<style>
.bjs-powered-by {
display: none !important;
}
.maskLayer {
width: 100%;
height: 150px;
position: absolute;
z-index: 9999;
top: 66px;
}
</style>

View File

@ -1,279 +0,0 @@
<template>
<div class="app-container">
<el-card
class="box-card"
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
>
<div slot="header" class="clearfix">
<span>{{ dict.label }}</span>
</div>
<div :key="o" class="text item">
{{ "列表内容 " + o }}
</div>
</el-card>
</div>
</template>
<script>
import {
getDeployment,
delDeployment,
addDeployment,
updateDeployment,
exportDeployment,
flowRecord,
} from "@/api/flowable/finished";
import { myProcessList, stopProcess } from "@/api/flowable/process";
import { listDefinition } from "@/api/flowable/definition";
export default {
name: "Deploy",
dicts: ["sys_process_category"],
components: {},
data() {
return {
//
loading: true,
processLoading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
processTotal: 0,
//
myProcessList: [],
//
title: "",
//
open: false,
src: "",
definitionList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
},
//
queryProcessParams: {
pageNum: 1,
pageSize: 10,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
},
//
form: {},
//
rules: {},
processCategoryList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询流程定义列表 */
getList() {
this.loading = true;
myProcessList(this.queryParams).then((response) => {
this.myProcessList = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
category: null,
key: null,
tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 搜索按钮操作 */
handleProcessQuery() {
this.queryProcessParams.pageNum = 1;
this.listDefinition();
},
/** 重置按钮操作 */
resetProcessQuery() {
this.resetForm("queryProcessForm");
this.handleProcessQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.procInsId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.open = true;
this.title = "发起流程";
this.listDefinition();
},
listDefinition() {
listDefinition(this.queryProcessParams).then((response) => {
this.definitionList = response.data.records;
this.processTotal = response.data.total;
this.processLoading = false;
});
},
/** 发起流程申请 */
handleStartProcess(row) {
this.$router.push({
path: "/flowable/task/myProcess/send/index",
query: {
deployId: row.deploymentId,
procDefId: row.id,
},
});
},
/** 取消流程申请 */
handleStop(row) {
const params = {
instanceId: row.procInsId,
};
stopProcess(params).then((res) => {
this.$modal.msgSuccess(res.msg);
this.getList();
});
},
/** 流程流转记录 */
handleFlowRecord(row) {
this.$router.push({
path: "/flowable/task/myProcess/detail/index",
query: {
procInsId: row.procInsId,
deployId: row.deployId,
taskId: row.taskId,
},
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getDeployment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改流程定义";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateDeployment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeployment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.procInsId || this.ids; //
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return delDeployment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return exportDeployment(queryParams);
})
.then((response) => {
this.download(response.msg);
});
},
},
};
</script>
<style>
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.box-card {
width: 28%;
margin-left: 3%;
}
</style>