|
@@ -29,11 +29,14 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="medium"
|
|
|
- @click="onSubmit"
|
|
|
+ @click="() => {}"
|
|
|
icon="el-icon-search"
|
|
|
>搜索</el-button
|
|
|
>
|
|
|
<el-button size="medium" icon="el-icon-refresh">重置</el-button>
|
|
|
+ <el-button type="info" size="medium" @click="toDetail"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -43,7 +46,7 @@
|
|
|
v-loading="loading"
|
|
|
:data="tableData"
|
|
|
border
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @selection-change="() => {}"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column
|
|
@@ -113,17 +116,14 @@
|
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- @click="handleFlowRecord(scope.row)"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
+ <el-button @click="(scope) => {}" type="text" size="small"
|
|
|
>详情</el-button
|
|
|
>
|
|
|
- <el-button @click="handleStop(scope.row)" type="text" size="small"
|
|
|
+ <el-button @click="() => {}" type="text" size="small"
|
|
|
>取消申请</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
+ @click="() => {}"
|
|
|
type="text"
|
|
|
size="small"
|
|
|
v-hasPermi="['system:deployment:remove']"
|
|
@@ -134,13 +134,13 @@
|
|
|
</el-table>
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
- <pagination
|
|
|
+ <!-- <pagination
|
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
@@ -164,6 +164,7 @@ export default {
|
|
|
dicts: ["bpm_type", "task_process_state"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
row: {}, //当前操作行数据
|
|
|
myForm: "", //自定义表单组件名
|
|
|
// 节点弹窗title
|
|
@@ -239,269 +240,13 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
- mounted() {
|
|
|
- this.getList();
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
methods: {
|
|
|
- // 获取列表数据
|
|
|
- getList() {
|
|
|
- processList(this.queryParams).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.tableData = res.rows.map((item) => item.resultMap);
|
|
|
- this.total = res.total;
|
|
|
- console.log(this.tableData);
|
|
|
- } else {
|
|
|
- this.$message.error("网络异常,请稍后再试");
|
|
|
- }
|
|
|
+ toDetail() {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/processMange/detail",
|
|
|
});
|
|
|
},
|
|
|
- // 获取表单数据
|
|
|
- async getFormData() {
|
|
|
- let formData = {};
|
|
|
- // switch (this.formType) {
|
|
|
- // case "dragForm":
|
|
|
- // try {
|
|
|
- // formData = await this.$refs.addFromRef.getData();
|
|
|
- // } catch (error) {
|
|
|
- // console.log(error);
|
|
|
- // this.$message.error("表单校验异常,请稍后重试");
|
|
|
- // return {};
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "designForm":
|
|
|
- // let temp = await this.$refs.myFormRef.getFormData();
|
|
|
- // if (!temp.flag) {
|
|
|
- // this.$message.error(temp.msg);
|
|
|
- // return {};
|
|
|
- // } else {
|
|
|
- // formData = temp.data;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
- let temp = await this.$refs.myFormRef?.getFormData();
|
|
|
- if (!temp?.flag) {
|
|
|
- this.$message.error(temp.msg);
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- formData = temp.data;
|
|
|
- }
|
|
|
- return formData;
|
|
|
- },
|
|
|
- // 重置弹窗数据
|
|
|
- resetDialogForm() {
|
|
|
- this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
|
|
|
- // k-form-build 数据
|
|
|
- this.dynamicData = {};
|
|
|
- this.defaultValue = {};
|
|
|
- this.jsonData = {};
|
|
|
- },
|
|
|
- // 打开运行节点弹窗
|
|
|
- async opneExecuteNode(row) {
|
|
|
- this.resetDialogForm();
|
|
|
- console.log(row);
|
|
|
- this.nodeTitle = row.benTaskNodeName;
|
|
|
- // let preFix = row.benTaskNodeName.split("-")[0];
|
|
|
- let preFix = row.benTaskNodeFormKey;
|
|
|
- let {
|
|
|
- benTaskNodeFormKey,
|
|
|
- benTaskNodeFormType,
|
|
|
- bepTaskPlanKey,
|
|
|
- bepTaskKey,
|
|
|
- bepTaskNodeKey,
|
|
|
- benTaskProcessKey,
|
|
|
- benmTaskAutomaticScriptTriggerType,
|
|
|
- bepTaskNodeNextKey,
|
|
|
- } = row;
|
|
|
- // 新的运行逻辑
|
|
|
- let payLoad = {
|
|
|
- taskNodeKey: bepTaskNodeNextKey,
|
|
|
- taskProcessKey: benTaskProcessKey,
|
|
|
- taskAutomaticScriptTriggerType: benmTaskAutomaticScriptTriggerType,
|
|
|
- taskPlanKey: bepTaskPlanKey,
|
|
|
- };
|
|
|
-
|
|
|
- // let formData = await getProcessNodeFormTemplate(payLoad);
|
|
|
- // console.log(formData);
|
|
|
- // if (benTaskNodeFormKey) {
|
|
|
- // if (benTaskNodeFormType == "dragForm") {
|
|
|
- // let templateInfo = formData.data[0]?.template;
|
|
|
- // //拖拽表单
|
|
|
- // this.formType = "dragForm";
|
|
|
- // this.jsonData = JSON.parse(templateInfo.dfVueTemplate);
|
|
|
- // this.tableName = templateInfo.dfTableName;
|
|
|
- // if (Object.keys(JSON.parse(templateInfo.dfFormSql)).length) {
|
|
|
- // this.dynamicData = JSON.parse(templateInfo.dfFormSql);
|
|
|
- // }
|
|
|
- // // await this.getDragFormInfo(benTaskNodeFormKey);
|
|
|
- // } else if (benTaskNodeFormType == "composeForm") {
|
|
|
- // //工艺组合表单
|
|
|
- // this.formType = "composeForm";
|
|
|
- // this.groupKey = benTaskNodeFormKey;
|
|
|
- // let queryPayload = {
|
|
|
- // row,
|
|
|
- // groupKey: benTaskNodeFormKey,
|
|
|
- // };
|
|
|
- // this.$nextTick(() => {
|
|
|
- // this.$refs.dialogRef.getLists(queryPayload);
|
|
|
- // });
|
|
|
- // }
|
|
|
- // } else if (preFix) {
|
|
|
- // //定制表单
|
|
|
- // this.formType = "designForm";
|
|
|
- // this.myForm = preFix;
|
|
|
- // }
|
|
|
- //定制表单
|
|
|
- this.formType = "designForm";
|
|
|
- this.myForm = preFix;
|
|
|
- let res = await getProcessNodeFormInfoData(payLoad);
|
|
|
- if (res.code == 200) {
|
|
|
- this.formData = res.data;
|
|
|
- } else {
|
|
|
- this.$message.error("网络异常,请稍后再试");
|
|
|
- }
|
|
|
-
|
|
|
- this.row = row; //记录当前行数据
|
|
|
- // if (!this.formType) return; //没有表单,直接掉运行逻辑
|
|
|
- this.open = true; // 打开弹窗
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.myFormRef?.resetForm();
|
|
|
- });
|
|
|
- // 根据当前节点绑定的表单信息查询对应的表单进行展示
|
|
|
- },
|
|
|
- // 运行节点按钮 确认运行回调
|
|
|
- async executeNode() {
|
|
|
- let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
|
|
|
- this.row;
|
|
|
- let { nodeId, nextNodeId } = this.getNextNodeKey(
|
|
|
- benTaskNodeKey,
|
|
|
- bepTaskProcessXmlContent
|
|
|
- );
|
|
|
- // 只有完成状态的可以运行
|
|
|
- if (this.formType == "composeForm") {
|
|
|
- let res = this.$refs.dialogRef.getComposeFormData();
|
|
|
- if (!res.isSuccess) {
|
|
|
- this.$message.warning("非完成状态节点不能运行!");
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- // return;
|
|
|
- let formData = await this.getFormData();
|
|
|
- if (!formData) return;
|
|
|
- formData.taskPlanKey = this.row.bepTaskPlanKey;
|
|
|
- let payLoad = {
|
|
|
- taskProcessKey: this.row.bepTaskKey, //当前任务流程编码
|
|
|
- taskNodeKey: nodeId, //当前执行节点唯一编码
|
|
|
- nextNodeKey: nextNodeId, //下一节点编码
|
|
|
- implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
|
|
|
- // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
|
|
|
- tableName: this.tableName,
|
|
|
- formDataMap: JSON.stringify(formData), //自定义表单组件收集的表单数据
|
|
|
- taskNodeType: this.backExceptionTaskList.includes(
|
|
|
- this.row.benTaskNodeFormKey
|
|
|
- )
|
|
|
- ? "backExceptionTask"
|
|
|
- : this.row.benTaskNodeType,
|
|
|
- };
|
|
|
- let fileXML = new File(
|
|
|
- [this.row.bepTaskProcessXmlContent],
|
|
|
- this.row.bepTaskKey + ".bpmn",
|
|
|
- {
|
|
|
- type: "text/bpmn",
|
|
|
- }
|
|
|
- );
|
|
|
- const subformData = new FormData();
|
|
|
- subformData.append("fileXML", fileXML);
|
|
|
- for (let key in payLoad) {
|
|
|
- subformData.append(key, payLoad[key] == null ? "" : payLoad[key]);
|
|
|
- }
|
|
|
- runProcessNodeExecution(subformData).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success("运行成功!");
|
|
|
- this.getList();
|
|
|
- this.open = false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取拖拽表单数据
|
|
|
- async getDragFormInfo(fid) {
|
|
|
- try {
|
|
|
- let res = await getForm(fid);
|
|
|
- console.log(res);
|
|
|
- if (res.code == 200) {
|
|
|
- this.jsonData = JSON.parse(res.data.dfVueTemplate);
|
|
|
- this.tableName = res.data.dfTableName;
|
|
|
- if (res.data.dfFormSql) {
|
|
|
- this.dynamicData = JSON.parse(res.data.dfFormSql);
|
|
|
- console.log(this.dynamicData);
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log(res);
|
|
|
- throw new Error(res);
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.log(error);
|
|
|
- this.$message.error("网络异常,请稍后再试");
|
|
|
- }
|
|
|
- },
|
|
|
- // 关闭运行节点弹窗
|
|
|
- closeExecuteNode(row) {
|
|
|
- this.open = false;
|
|
|
- },
|
|
|
- // 获取下一个节点的nodekey
|
|
|
- getNextNodeKey(nodeKey, xmlStr) {
|
|
|
- let xmlObj = this.xmlStr2XmlObj(xmlStr);
|
|
|
- let nodeSequence = getNodeSequence(xmlObj);
|
|
|
- return nodeSequence.find((item) => item.nodeId == nodeKey) || {};
|
|
|
- },
|
|
|
- // xml字符串转xml对象
|
|
|
- xmlStr2XmlObj(xmlStr) {
|
|
|
- var xmlObj = {};
|
|
|
- if (document.all) {
|
|
|
- var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
|
|
|
- xmlDom.loadXML(xmlStr);
|
|
|
- xmlObj = xmlDom;
|
|
|
- } else {
|
|
|
- xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml");
|
|
|
- }
|
|
|
- return xmlObj;
|
|
|
- },
|
|
|
- // 触发异常回调
|
|
|
- exceptionTrigger(row, scriptData) {
|
|
|
- let _this = this;
|
|
|
- this.$modal
|
|
|
- .confirm("是否确认触发<" + scriptData.scriptName + ">异常?")
|
|
|
- .then(function (val) {
|
|
|
- console.log(val);
|
|
|
- // 发送触发异常节点的请求
|
|
|
- let payLoad = {
|
|
|
- taskProcessKey: row.bepTaskKey,
|
|
|
- taskNodeKey: row.benTaskNodeKey,
|
|
|
- sysBpmNodeScriptVO: scriptData,
|
|
|
- };
|
|
|
- triggerExceptionNode(payLoad).then((res) => {
|
|
|
- console.log(res);
|
|
|
- if (res.code == 200) {
|
|
|
- _this.$message.success("触发成功");
|
|
|
- _this.open = false;
|
|
|
- _this.getList();
|
|
|
- } else {
|
|
|
- _this.$message.error("触发失败请稍后再试");
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- _this.open = false;
|
|
|
- _this.$message.info("取消成功");
|
|
|
- });
|
|
|
- },
|
|
|
- // 获取字典对应label
|
|
|
- getDictLabel(value, dictLsit = []) {
|
|
|
- return dictLsit.find((item) => {
|
|
|
- return item.value == value;
|
|
|
- })?.label;
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|