From 247e6b7443d2a4999bea89b030553ed76c4d3923 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Mon, 10 Aug 2020 17:56:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=AE=A1=E7=90=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/apass-table.vue | 9 +- .../process-management/designer/index.vue | 272 ++++++++++++------ src/pages/workbench/fwgl/fwglList.vue | 11 +- 3 files changed, 200 insertions(+), 92 deletions(-) diff --git a/src/components/apass-table.vue b/src/components/apass-table.vue index cfdbada..570acee 100644 --- a/src/components/apass-table.vue +++ b/src/components/apass-table.vue @@ -499,10 +499,11 @@ export default { .more_action_list > li:first-child::before { content: ""; position: absolute; - top: -14px; - right: calc(50% - 14px); - width: 28px; - height: 14px; + top: -20px; + right: calc(50% - 20px); + width: 40px; + height: 20px; + /* background-color: red; */ } .more_action_list > li:first-child::after { content: ""; diff --git a/src/pages/workbench/component-center/process-management/designer/index.vue b/src/pages/workbench/component-center/process-management/designer/index.vue index 4998334..721fea2 100644 --- a/src/pages/workbench/component-center/process-management/designer/index.vue +++ b/src/pages/workbench/component-center/process-management/designer/index.vue @@ -31,8 +31,38 @@ ref="dialog" :title="dialogInfo.title" :msg="dialogInfo.msg" + :cancel-text="dialogInfo.cancelText" :submit="dialogInfo.submit" + :sunbmit-text="dialogInfo.sunbmitText" > + + + + + @@ -50,91 +80,90 @@ export default { filterList: [ { name: "服务领域", + prop: "service_domains", + data: [], }, { name: "工作区域", + prop: "workareas", + data: [], }, { name: "流程状态", + prop: "states", + data: [], }, ], listHeader: [], listData: [], listTotal: 0, dialogInfo: { + title: "", msg: "", + cancelText: "", submit: null, + sunbmitText: "", }, tempFilter: null, + copyTempItem: null, + copyTempItem_rules: { + newName: [ + { + required: true, + message: "请输入流程名称", + trigger: "blur", + }, + { + max: 16, + message: "长度小于16个字符", + trigger: "blur", + }, + ], + }, }), methods: { init(filter) { - console.log(filter); + let params = { + sectors: (filter.service_domains && filter.service_domains.map((item) => item.value).join(",")) || "", + workareas: (filter.workareas && filter.workareas.map((item) => item.value).join(",")) || "", + states: (filter.states && filter.states.map((item) => item.value).join(",")) || "", + page: filter.page, + page_size: filter.size, + }; + this.tempFilter = filter; - this.listTotal = 3; - this.listData = [ - { - id: "WF00000001", - name: "保安资格申请流程", - sectors_name: "经济建设", - create_time: "2021-01-01T00:00:00Z", - state: "0", - }, - { - id: "WF00000002", - name: "保安考试流程", - sectors_name: "经济建设", - create_time: "2021-01-01T00:00:00Z", - state: "1", - }, - { - id: "WF00000003", - name: "申请材料审核流程", - sectors_name: "经济建设", - create_time: "2021-01-01T00:00:00Z", - state: "2", - }, - ]; + this.$http + .get("/apaas/serviceapp/v3/workflows/list", { params }) + .then(({ data }) => { + if (data.success === 1) { + this.listTotal = data.total; + this.listData = data.data; + } + }) + .catch((error) => { + console.log(error); + }); }, initFilter() { - Promise.all([ - this.$http.get("/apaas/service/v3/service/manager/servtype"), - this.$http.get("/apaas/service/v3/service/manager/servarea"), - ]) - .then((response) => { - let filterList = response.map((item) => { - return { - name: item.body.data[0].type_name, - prop: item.body.data[0].type_code, - data: item.body.data.map((v) => ({ - name: v.name, - value: v.id, - })), - }; - }); + this.$http + .get("/apaas/serviceapp/v3/workflows/searchConditions") + .then(({ data }) => { + if (data.success === 1) { + let datas = data.data; + this.filterList.forEach((item) => { + let filter = datas[item.prop] || []; - this.filterList = [ - ...filterList, - { - name: "流程状态", - prop: "state", - data: [ - { - name: "已发布", - value: 2, - }, - { - name: "已部署", - value: 1, - }, - { - name: "未部署", - value: 0, - }, - ], - }, - ]; + this.$set( + item, + "data", + filter.map((item) => ({ + name: item.name, + value: item.id, + })) + ); + }); + } }) .catch((error) => { console.log(error); @@ -144,7 +173,7 @@ export default { this.listHeader = [ { label: "流程编号", - prop: "id", + prop: "workflows_code", width: 180, }, { @@ -155,7 +184,7 @@ export default { }, { label: "服务领域", - prop: "sectors_name", + prop: "sector_name", align: "center", width: 240, }, @@ -197,9 +226,17 @@ export default { }, ], moreActionList: [ + { + label: "取消发布", + callback: this.cancelPublishItem, + }, + { + label: "部署", + callback: this.deployItem, + }, { label: "取消部署", - callback: this.canceldeployItem, + callback: this.cancelDeployItem, }, { label: "复制", @@ -215,28 +252,96 @@ export default { }, refresh() { this.init(this.tempFilter); + }, // 刷新当前页列表 + showDialog() { + this.$refs.dialog.show(); }, - addNewProcess() { - console.log("addNewProcess"); - }, - detailItem(item) { - this.$router.push(`/progress/designer/detail/${item.id}`); + copyProcessShow() { + this.$refs.copyProcess.show(); }, - publishItem(item) { - console.log(`publish ${item.name}`); + copyProcessHide() { + this.$refs.copyProcess.hide(); + this.copyTempItem = null; }, + addNewProcess() { + this.$router.push("/progress/designs"); + }, // FIXME: 新建流程 editItem(item) { - console.log(`edit ${item.name}`); - }, - canceldeployItem(item) { - console.log(`cancel deploy ${item.name}`); - }, + this.$router.push("/progress/designs"); + }, // FIXME: 编辑流程 + detailItem(item) { + this.$router.push(`/progress/designer/detail/${item.workflows_id}`); + }, // TODO: 查看详情 + publishItem(item) { + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = `发布后流程后,流程将部署到工作区域并上架到服务超市,是否发布该流程?`; + this.dialogInfo.cancelText = "取消"; + this.dialogInfo.sunbmitText = "发布"; + this.dialogInfo.submit = () => { + console.log(`发布${item.name}`); + }; + this.showDialog(); + }, // TODO: 发布流程 + cancelPublishItem(item) { + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = `取消发布后,该流程服务将从服务超市下架,仅部署在工作区域${item.workarea_name}中,是否取消发布流程服务“${item.name}”?`; + this.dialogInfo.cancelText = "暂不"; + this.dialogInfo.sunbmitText = "取消发布"; + this.dialogInfo.submit = () => { + console.log(`取消发布${item.name}`); + }; + this.showDialog(); + }, // TODO: 取消发布流程 + deployItem(item) { + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = `部署流程后,流程将部署到工作区域,但不会上架到服务超市,是否部署该流程?`; + this.dialogInfo.cancelText = "取消"; + this.dialogInfo.sunbmitText = "部署"; + this.dialogInfo.submit = () => { + console.log(`部署${item.name}`); + }; + this.showDialog(); + }, // TODO: 部署流程 + cancelDeployItem(item) { + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = `取消部署后,该流程服务不能通过链接访问,是否取消部署流程服务“${item.name}”?`; + this.dialogInfo.cancelText = "取消"; + this.dialogInfo.sunbmitText = "取消部署"; + this.dialogInfo.submit = () => { + console.log(`取消部署${item.name}`); + }; + this.showDialog(); + }, // TODO: 取消流程 copyItem(item) { - console.log(`copy ${item.name}`); - }, + this.copyTempItem = { + ...item, + newName: "", + }; + this.copyProcessShow(); + }, // TODO: 复制流程 + cancelCopyProcess() { + this.copyProcessHide(); + }, // 复制流程-取消 + submitCopyProcess() { + this.$refs.detail_form.validate((valid) => { + if (valid) { + console.log(this.copyTempItem); + this.copyProcessHide(); + } else { + return false; + } + }); + }, // TODO: 复制流程-确定 deleteItem(item) { - console.log(`delete ${item.name}`); - }, + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = `您确定要删除流程服务“${item.name}”吗?`; + this.dialogInfo.cancelText = "取消"; + this.dialogInfo.sunbmitText = "确定"; + this.dialogInfo.submit = () => { + console.log(`删除${item.name}`); + }; + this.showDialog(); + }, // TODO: 删除流程 }, created() { this.initFilter(); @@ -249,4 +354,11 @@ export default { .process-designer-container { height: 100%; } +.apaas_detail_form { + text-align: left; + margin-top: 20px; +} +.apaas_detail_form .el-form-item { + margin: 0; +} diff --git a/src/pages/workbench/fwgl/fwglList.vue b/src/pages/workbench/fwgl/fwglList.vue index ecf1c69..e037ac4 100644 --- a/src/pages/workbench/fwgl/fwglList.vue +++ b/src/pages/workbench/fwgl/fwglList.vue @@ -106,7 +106,7 @@ :title="dialogInfo.title" :msg="dialogInfo.msg" :submit="dialogInfo.submit" - :sunbmitText="dialogInfo.sunbmitText" + :sunbmit-text="dialogInfo.sunbmitText" > { this.$http @@ -1433,7 +1432,6 @@ export default { this.dialogInfo.title = "是否确定下架服务"; this.dialogInfo.msg = "下架此服务会导致用户被迫暂停对服务的调用,下架前需向超级管理员发送通知,超级管理员通过后此服务将会从服务超市中下架。"; - this.dialogInfo.cancelText = "取消"; this.dialogInfo.sunbmitText = "发送通知"; this.dialogInfo.submit = () => { this.$http @@ -1467,7 +1465,6 @@ export default { soldUpItem(item) { this.dialogInfo.title = "提示"; this.dialogInfo.msg = "确认上架此服务吗?"; - this.dialogInfo.cancelText = ""; this.dialogInfo.sunbmitText = "确定"; this.dialogInfo.submit = () => { this.$http @@ -1501,7 +1498,6 @@ export default { this.dialogInfo.title = "提示"; this.dialogInfo.msg = "下架此服务会导致调用该服务的
用户被迫暂停对服务的调用"; - this.dialogInfo.cancelText = ""; this.dialogInfo.sunbmitText = "确定"; this.dialogInfo.submit = () => { this.$http @@ -1534,7 +1530,6 @@ export default { deleteItem(item) { this.dialogInfo.title = ""; this.dialogInfo.msg = "是否删除该条服务?"; - this.dialogInfo.cancelText = ""; this.dialogInfo.sunbmitText = ""; this.dialogInfo.submit = () => { this.$http -- 2.26.0