From 90a74d8a52e078af5f05bde10c5d96e52cd0561b Mon Sep 17 00:00:00 2001
From: zichen1019 <1510748736@qq.com>
Date: Fri, 27 Aug 2021 21:20:47 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B=E7=BE=A4?=
=?UTF-8?q?=E7=BB=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/flow/definition.vue | 188 ++++++++++++++++++++--------------
1 file changed, 109 insertions(+), 79 deletions(-)
diff --git a/src/views/flow/definition.vue b/src/views/flow/definition.vue
index 03246b3..715e50f 100644
--- a/src/views/flow/definition.vue
+++ b/src/views/flow/definition.vue
@@ -30,12 +30,12 @@
@@ -93,7 +93,7 @@
-
+
-
+
- {{ link.name }}
+ {{ getLinkName(link) }}
@@ -202,10 +202,10 @@
/>
-
-
+
+
-
+
-
+
-
+
{
+ if (row.id) {
+ linkIds.push(row.id)
+ }
+ })
+ this.api({
+ url: '/definition',
+ method: 'delete',
+ params: {
+ ids: linkIds
+ }
+ }).then(data => {
+ this.$notify.sucess('操作成功')
+ this.$refs.tableData.selection.forEach(row => this.tableData.splice(this.tableData.indexOf(row), 1))
+ })
+ },
+ getLinkName(link) {
+ if (!this.linkLabelList.length) {
+ return
+ }
+ const linkLabel = this.linkLabelList.filter(row => row.value === link.nextName)[0]
+ if (!linkLabel) {
+ return
+ }
+ return linkLabel.name
+ },
+ getLinkListAll() {
+ this.api({
+ url: '/link/all',
+ method: 'get'
+ }).then(data => {
+ this.linkList = data
+ })
+ },
// 获取所有用户
getUserList() {
this.api({
@@ -398,15 +434,24 @@ export default {
this.sbzlList = data
})
},
- getBglxList() {
+ getDicDataList(typeCode) {
this.api({
url: '/dicData/getDicDataByTypeCode',
method: 'get',
params: {
- typeCode: 'REPORT_CLASS'
+ typeCode: typeCode
}
}).then((data) => {
- this.bglxList = data
+ switch (typeCode) {
+ case 'REPORT_CLASS':
+ this.modeList = data
+ break
+ case 'FLOW_LINK':
+ this.linkLabelList = data
+ break
+ default:
+ break
+ }
})
},
getJylbList() {
@@ -445,7 +490,7 @@ export default {
})
},
showCreate() {
- this.$set(this.formDefinition, 'bglx', 1)
+ this.$set(this.formDefinition, 'mode', 1)
this.dialogStatus = 'create'
this.dialogFormVisible = true
},
@@ -460,40 +505,23 @@ export default {
this.dialogStatus = 'update'
this.dialogFormVisible = true
},
- showUpdateMember($index, $link, row) {
- this.listLink = []
- this.bglx = this.list[$index].bglx
- this.formMember.definitionId = this.list[$index].id
- this.formMember.linkId = $link - 1
- let userIdArray = []
- try {
- if ($link === '2') {
- userIdArray = this.list[$index].userId.split(',')
- } else {
- if (this.list[$index].id === this.list[$index + 1].id) {
- userIdArray = this.list[$index + 1].userId.split(',')
- }
+ showUpdateMember($index, linkId) {
+ this.tableData = []
+ const row = this.list[$index]
+ this.memerTitle = row.name
+ this.definitionId = row.id
+ this.linkId = linkId
+ this.api({
+ url: '/member/all',
+ method: 'get',
+ params: {
+ definitionId: row.id,
+ linkId: linkId
}
- } catch (e) {
- //
- }
- const userId = []
- for (let i = 0; i < userIdArray.length; i++) {
- userId.push(parseInt(userIdArray[i]))
- }
- this.listMemberUser = userId
- this.dialogStatus = 'update'
- console.log(row)
- const arr = []
- arr.push(row)
- this.tableData = arr
- this.tableData.map((item) => {
- item.nickname = item.nickname.split(',')
- item.userId = item.userId.split(',')
+ }).then(data => {
+ this.tableData = data
+ this.dialogFormMemberVisible = true
})
- console.log(this.tableData[0].userId, arr)
-
- this.dialogFormMemberVisible = true
},
handleFilter() {
// 查询事件
@@ -555,12 +583,14 @@ export default {
})
},
updateLink() {
- this.formMember.userIds = this.listMemberUser
+ console.log(this.tableData)
const _vue = this
this.api({
- url: '/definition/updateGroupMember',
+ url: '/member/updateGroupMembers',
method: 'post',
- data: this.formMember
+ data: {
+ groupMembers: this.tableData
+ }
}).then(() => {
this.dialogFormMemberVisible = false
this.$message({
@@ -614,10 +644,10 @@ export default {
this.formDefinition = {}
this.neibuleibie = []
},
- formatterBglx(row) {
- const bglx = this.bglxList.filter((bglx) => bglx.value === row.bglx)
- if (bglx && bglx.length) {
- return bglx[0].name
+ formatterMode(row) {
+ const mode = this.modeList.filter((mode) => mode.value === row.mode)
+ if (mode && mode.length) {
+ return mode[0].name
} else {
return '未知'
}
@@ -657,7 +687,7 @@ export default {
// 判断当前元素与上一个元素是否相同
if (
data[i].departmentId === data[i - 1].departmentId &&
- data[i].bglx === data[i - 1].bglx &&
+ data[i].mode === data[i - 1].mode &&
data[i].shebeizhongleidaima === data[i - 1].shebeizhongleidaima &&
data[i].neibuleibie === data[i - 1].neibuleibie
) {