diff --git a/src/components/work-flow/super-flow.vue b/src/components/work-flow/super-flow.vue index 767cc539c1d667675f2c0eedbd7ffaa6c3228918..9c207e3c729e7af5aa4ce1c415acf80d1e1eefe8 100644 --- a/src/components/work-flow/super-flow.vue +++ b/src/components/work-flow/super-flow.vue @@ -14,37 +14,16 @@

节点类型

请拖拽添加到流程中

-
+
{{item.label}}
- + @@ -63,25 +42,18 @@

接口插件

-
+

流程服务

-
+

超时管理

- +

节点编号:

{{ nodeParams(nodeItem.id).node_code }}

@@ -95,14 +67,7 @@
- +
@@ -111,46 +76,16 @@
服务地址:
- + - + 连接测试
- +
@@ -165,12 +100,7 @@
授权方式:
- +
@@ -186,47 +116,9 @@
请求参数信息填写:
- +
返回参数信息填写:
- +
测试服务信息:
@@ -243,6 +135,65 @@
+ +
+
+ + 配置流程服务插件后,该节点可调用流程服务,并在此节点触发该流程。 +
+

我的服务:

+

+ + + +

+ +
+
+ +
+
+ + 添加超时管理插件后,根据配置该节点超时后会发送消息给请求方。 +
+

超时设置:

+
+
+
+
最大时长
+ + + + +
+
+ 超时提醒 +
+
+
+
+
+
+
最大时长
+ + + + +
+
+ 超时提醒 +
+
+
+ +
+
@@ -251,12 +202,12 @@ import CesTable from "@/components/table/table-um"; import Codes from "@/components/general/codes"; const drawerType = { node: 0, - link: 1, + link: 1 }; export default { components: { CesTable, - Codes, + Codes }, data() { return { @@ -297,14 +248,14 @@ export default { } else { this.$refs.linkSetting.clearValidate(); } - }, + } }, linkSetting: { - desc: "", + desc: "" }, nodeSetting: { name: "", - desc: "", + desc: "" }, dragConf: { isDown: false, @@ -314,7 +265,7 @@ export default { clientX: 0, clientY: 0, ele: null, - info: null, + info: null }, nodeItemList: [ { @@ -325,9 +276,9 @@ export default { meta: { label: "普通节点", name: "普通节点", - type: 3, - }, - }, + type: 3 + } + } }, { label: "开始", @@ -337,9 +288,9 @@ export default { meta: { label: "开始", name: "开始", - type: 1, - }, - }, + type: 1 + } + } }, { label: "结束", @@ -349,27 +300,27 @@ export default { meta: { label: "结束", name: "结束", - type: 2, - }, - }, - }, + type: 2 + } + } + } ], nodeParamsList: [], linkMenu: [ [ { label: "删除", - selected: (link) => { + selected: link => { console.log(link); link.remove(); - }, - }, - ], + } + } + ] ], dialog_general: false, nodeItem: { id: "", - name: "", + name: "" }, node_name: "", show_options_pop: false, @@ -378,7 +329,7 @@ export default { { label: "GET", value: 1 }, { label: "POST", value: 2 }, { label: "PUT", value: 3 }, - { label: "DELETE", value: 4 }, + { label: "DELETE", value: 4 } ], select: 1, serviceUrl: "", @@ -391,9 +342,9 @@ export default { label: "请求字段编码", prop: "requestEncoding", type: "input", - align: "left", + align: "left" }, - { label: "请求值", prop: "requestValue", type: "input", align: "left" }, + { label: "请求值", prop: "requestValue", type: "input", align: "left" } ], datasSj: [], optionsSq: [{ label: "Bearer Token", value: "Bearer" }], @@ -407,13 +358,13 @@ export default { prop: "show_type", type: "", align: "left", - width: "140", + width: "140" }, { label: "字段名称*", prop: "label", type: "input", - align: "left", + align: "left" }, { label: "是否必须*", @@ -421,13 +372,10 @@ export default { type: "select", align: "left", width: 100, - selectArr: [ - { label: "是", value: 1 }, - { label: "否", value: 0 }, - ], - hasDefault: true, + selectArr: [{ label: "是", value: 1 }, { label: "否", value: 0 }], + hasDefault: true }, - { label: "字段说明", prop: "descript", type: "input", align: "left" }, + { label: "字段说明", prop: "descript", type: "input", align: "left" } ], sjfwFhcstx: [ { label: "字段编码", prop: "name", type: "", align: "left" }, @@ -437,14 +385,34 @@ export default { label: "字段名称*", prop: "label", type: "input", - align: "left", + align: "left" }, - { label: "字段说明", prop: "descript", type: "input", align: "left" }, + { label: "字段说明", prop: "descript", type: "input", align: "left" } ], datasQqcs: [], datasFhcs: [], resSuccess: false, resultShow: false, + dataType: "", + body_fields: [], + param_fields: [], + request_fields: [], + response_fields: [], + dialog_process: false, + my_service_list: [], + service: "", + dialog_timeout: false, + durationOptions: [ + { value: 1, label: "分钟" }, + { value: 2, label: "小时" }, + { value: 3, label: "天" } + ], + max_time_0: undefined, + max_time_1: undefined, + max_time_type_0: 1, + max_time_type_1: 1, + max_time_check_0: false, + max_time_check_1: false }; }, mounted() { @@ -479,7 +447,7 @@ export default { top, right, bottom, - left, + left } = this.$refs.flowContainer.getBoundingClientRect(); // 判断鼠标是否进入 flow container if ( @@ -511,10 +479,10 @@ export default { console.log(query); this.$refs.superFlow.addNode({ coordinate, - ...query, + ...query }); if ( - this.nodeParamsList.findIndex((item) => { + this.nodeParamsList.findIndex(item => { return item.id == query.meta.id; }) == -1 ) { @@ -524,21 +492,21 @@ export default { label: "开始", name: "开始", type: 1, - id: query.meta.id, + id: query.meta.id }; } else if (conf.info.meta.type == 2) { obj = { label: "结束", name: "结束", type: 2, - id: query.meta.id, + id: query.meta.id }; } else if (conf.info.meta.type == 3) { obj = { label: "普通节点", name: "普通节点", type: 3, - id: query.meta.id, + id: query.meta.id }; } this.nodeParamsList.push(obj); @@ -563,7 +531,7 @@ export default { clientY: clientY, info, ele, - isDown: true, + isDown: true }); ele.style.position = "fixed"; ele.style.margin = "0"; @@ -578,14 +546,14 @@ export default { }, blurItem() { this.nodeItem = { - id: "", + id: "" }; console.log(this.nodeItem); }, getData() { return { obj: this.$refs.superFlow.toJSON(), - params: this.nodeParamsList, + params: this.nodeParamsList }; }, handleChange() {}, @@ -597,14 +565,14 @@ export default { } else { self.$message({ message: "开始和结束节点不可被编辑", - type: "warning", + type: "warning" }); return false; } } else { self.$message({ message: "请选择节点", - type: "warning", + type: "warning" }); return false; } @@ -612,7 +580,7 @@ export default { showGeneralSettings() { if (this.checkNodeCouldEdit()) { let self = this; - self.node_name = self.nodeParamsList.find((item) => { + self.node_name = self.nodeParamsList.find(item => { return item.id == self.nodeItem.id; }).name; self.dialog_general = true; @@ -622,7 +590,7 @@ export default { this.dialog_interface = true; }, nodeParams(id) { - let index = this.nodeParamsList.findIndex((item) => { + let index = this.nodeParamsList.findIndex(item => { return item.id == id; }); if (index != -1) { @@ -637,7 +605,7 @@ export default { generalSubmit() { let self = this; if (self.nodeItem.type == 3) { - let index = self.nodeParamsList.findIndex((item) => { + let index = self.nodeParamsList.findIndex(item => { return item.id == self.nodeItem.id; }); if (index != -1) { @@ -645,7 +613,7 @@ export default { } else { self.$message({ message: "修改失败", - type: "error", + type: "error" }); } } @@ -716,9 +684,9 @@ export default { body: bodys, content_type: contentType, data_service_type1: 5, - data_service_type2: 12, + data_service_type2: 12 }; - this.$api.workbench.fwzcFwcs(query).then((response) => { + this.$api.workbench.fwzcFwcs(query).then(response => { if (response.data.success == 1) { let data = response.data.data; this.body_fields = data.body_fields; @@ -744,36 +712,78 @@ export default { this.dialog_interface = false; }, interfaceSubmit() { - let requestData = this.$refs.fwcs_sjfw_qqcs.getTableData(); - let responseData = this.$refs.fwcs_sjfw_fhcs.getTableData(); - this.requestRules = 0; - this.responseRules = 0; - this.checkTable(requestData, 0); - this.checkTable(responseData, 1); - if (this.requestRules == 0 && this.responseRules == 0) { - this.request_fields = requestData; - this.response_fields = responseData; - let self = this; - let index = this.nodeParamsList.findIndex((item) => { - return (item.id = self.nodeItem.id); - }); - self.nodeParamsList[index].plugins.push({ - plugin_type: 1, - url: self.serviceUrl, - req_type: Number(self.select), - auth_method: self.sqfsVal, - auth_token: self.tokenVal, - query_fields: "this is response_fields value1", - body_fields: "this is response_fields value1", - response_fields: "this is response_fields value1", - }); - } else if (this.requestRules != 0) { - this.$message.error("请完善请求参数信息中的字段名称"); - } else if (this.responseRules != 0) { - this.$message.error("请完善返回参数信息中的字段名称"); + if (this.resSuccess) { + let requestData = this.$refs.fwcs_sjfw_qqcs.getTableData(); + let responseData = this.$refs.fwcs_sjfw_fhcs.getTableData(); + this.requestRules = 0; + this.responseRules = 0; + this.checkTable(requestData, 0); + this.checkTable(responseData, 1); + if (this.requestRules == 0 && this.responseRules == 0) { + this.request_fields = requestData; + this.response_fields = responseData; + let self = this; + let index = this.nodeParamsList.findIndex(item => { + return (item.id = self.nodeItem.id); + }); + self.nodeParamsList[index].plugins.push({ + plugin_type: 1, + url: self.serviceUrl, + req_type: Number(self.select), + auth_method: self.sqfsVal, + auth_token: self.tokenVal, + query_fields: + self.dataType == "body" ? self.request_fields : self.body_fields, + body_fields: + self.dataType == "param" + ? self.request_fields + : self.param_fields, + response_fields: self.response_fields + }); + console.log(self.nodeParamsList); + self.dialog_interface = false; + } else if (this.requestRules != 0) { + this.$message.error("请完善请求参数信息中的字段名称"); + } else if (this.responseRules != 0) { + this.$message.error("请完善返回参数信息中的字段名称"); + } + } else { + this.$message.error("请保证接口有效"); } }, - }, + checkTable(arr, rule) { + let self = this; + for (let i = 0; i < arr.length; i++) { + if (arr[i].name && arr[i].name != "") { + if (!arr[i].label || arr[i].label == "") { + if (rule == 0) { + this.requestRules = 1; + } else if (rule == 1) { + this.responseRules = 1; + } + return false; + } + } + if (arr[i].children && arr[i].children.length != 0) { + self.checkTable(arr[i].children, rule); + } + } + }, + showProcessService() { + this.dialog_process = true; + }, + processCancel() { + this.dialog_process = false; + }, + processSubmit() {}, + showTimeoutManagement() { + this.dialog_timeout = true; + }, + timeoutCancel() { + this.dialog_timeout = false; + }, + timeoutSubmit() {} + } }; @@ -1034,6 +1044,71 @@ export default { margin: 30px 15px 10px; font-size: 14px; } + .skcs_jg { + height: 100px; + display: flex; + align-items: center; + justify-content: center; + color: #0f2683; + font-size: 20px; + .skcs_jg_img { + position: relative; + top: 3px; + } + } + } +} +.process_service { + font-size: 14px; + text-align: left; + .process_msg { + font-size: 12px; + color: #58617a; + width: 430px; + margin: 0 auto; + padding: 10px 0; + background-color: #f4f7fc; + border-radius: 8px; + text-align: center; + } + .process_title { + margin: 20px 0 10px; + padding-left: 10px; + } + .process_val { + margin-bottom: 30px; + padding-left: 10px; + } + .process_input { + margin-bottom: 50px; + } +} +.timeout_service { + font-size: 14px; + text-align: left; + .timeout_msg { + font-size: 12px; + color: #58617a; + width: 430px; + margin: 0 auto; + padding: 10px 0; + background-color: #f4f7fc; + border-radius: 8px; + text-align: center; + } + .timeout_title { + margin: 20px 0 10px; + padding-left: 10px; + } + .timeout_val { + margin-bottom: 30px; + padding-left: 10px; + } + .timeout_input { + margin-bottom: 20px; + } + .margin_high { + margin-bottom: 50px; } } .dia_footer { @@ -1139,4 +1214,51 @@ export default { .interface_plugin .el-tabs__header .el-tabs__item:hover { color: #e56600; } +.timeout_input { + .timeout_row { + display: flex; + .timeout_input_group { + width: 300px; + display: flex; + .input_left { + display: inline-block; + width: 90px; + height: 40px; + padding: 0 0 0 15px; + background-color: #edeef4; + border: 1px #e3e5ef solid; + color: #8890a7; + border-radius: 8px 0 0 8px; + line-height: 40px; + font-size: 14px; + } + .el-input-number { + flex: 1; + .el-input__inner { + border-radius: 0; + color: #242c43; + } + } + .input_right_select.el-select { + width: 80px; + } + .input_right_select.el-select .el-input { + width: 80px; + background-color: #0f2683; + color: #ffffff; + border-radius: 0 8px 8px 0; + } + .input_right_select .el-input .el-input__inner { + background-color: #0f2683; + color: #ffffff; + border: none; + } + } + .timeout_check { + margin-left: 20px; + line-height: 40px; + font-size: 16px; + } + } +} \ No newline at end of file diff --git a/src/pages/workbench/component-center/process-management/process-design/index.vue b/src/pages/workbench/component-center/process-management/process-design/index.vue index c7f28f014ff444a9ec09bc6e062855bf68bac247..568621439cc40918257849c774b4861741a37dd0 100644 --- a/src/pages/workbench/component-center/process-management/process-design/index.vue +++ b/src/pages/workbench/component-center/process-management/process-design/index.vue @@ -7,44 +7,23 @@ {{ $t("lang.new") }} - - + +
- +

流程名称:

- +

工作区域:

- +
- +

流程描述:

- +
- +
- +