@lambo-design/workflow-approve 1.0.0-beta.55 → 1.0.0-beta.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design/workflow-approve",
3
- "version": "1.0.0-beta.55",
3
+ "version": "1.0.0-beta.57",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -234,6 +234,8 @@ export default {
234
234
  }
235
235
  }
236
236
  })
237
+ } else if (self.helpBoxType === 'delegateTask'){
238
+ self.$emit('delegate-task-assignee', idSelectedArr[0]);
237
239
  } else {
238
240
  self.$emit('update-next-node-assignee', idSelectedArr[0], idSelectedArr[1], self.id);
239
241
  }
@@ -7,7 +7,7 @@
7
7
  @on-change="organChange($event)"
8
8
  placeholder="输入关键字查询" style="width:60em;">
9
9
  <OptionGroup label="组织">
10
- <Option v-for="(value, key) in organTree.orgenMap" :key="key" :value="`${key}:${value},1`">
10
+ <Option v-for="(value, key) in organTree.organMap" :key="key" :value="`${key}:${value},1`">
11
11
  <span>{{ value }}</span>
12
12
  </Option>
13
13
  </OptionGroup>
@@ -26,6 +26,11 @@
26
26
  <span>{{ value }}</span>
27
27
  </Option>
28
28
  </OptionGroup>
29
+ <OptionGroup label="组织类型" v-if="ucAdapterType === 'sc'">
30
+ <Option v-for="(value, key) in organTree.typeMap" :key="key" :value="`${key}:${value},5`" >
31
+ <span>{{value}}</span>
32
+ </Option>
33
+ </OptionGroup>
29
34
  </Select>
30
35
  <Button type="primary" :loading="loading" @click="organTreeRedisUpdate" style="float: right;">
31
36
  <span v-if="!loading">更新查询数据</span>
@@ -229,10 +234,11 @@ export default {
229
234
  organId: "",
230
235
  organModel: [],
231
236
  organTree: {
232
- orgenMap: {},
237
+ organMap: {},
233
238
  userMap: {},
234
239
  roleMap: {},
235
240
  postMap: {},
241
+ typeMap: {},
236
242
  },
237
243
  readingRangePost: [],
238
244
  treeUserValueCenter: [],
@@ -1159,20 +1165,32 @@ export default {
1159
1165
  depList = [...new Set(depList)];
1160
1166
  depList = depList.reverse();
1161
1167
  let bizTypeCode = depList[0] ? depList[0].bizTypeCode : ''
1162
- this.userNum = "1"
1163
1168
  if (bizTypeCode) {
1164
1169
  this.treeOrgTypeValue.push(depList[0])
1170
+ this.organModel.push(depList[0].bizTypeCode +":"+depList[0].typeName+","+"5");
1165
1171
  }
1166
1172
  })
1167
1173
  } else {
1168
- this.userNum = "1"
1169
1174
  let list = []
1170
1175
  uniqueArray.forEach(item => {
1171
1176
  if (item.bizTypeCode != info.bizTypeCode) {
1172
1177
  list.push(item)
1173
1178
  }
1174
1179
  })
1180
+ let typeList = []
1181
+ this.organModel.forEach(data => {
1182
+ let [value, type] = data.split(',')
1183
+ if (type && type !== '5'){
1184
+ typeList.push(data)
1185
+ } else {
1186
+ let typeCode = value.split(':')[0]
1187
+ if (typeCode !== info.bizTypeCode){
1188
+ typeList.push(data)
1189
+ }
1190
+ }
1191
+ })
1175
1192
  this.treeOrgTypeValue = list
1193
+ this.organModel = typeList
1176
1194
  }
1177
1195
 
1178
1196
  this.updateLength()
@@ -1493,6 +1511,7 @@ export default {
1493
1511
  })
1494
1512
  self.organModel = orgList
1495
1513
  self.noticeList = row
1514
+ self.noticeRoleNameList = row
1496
1515
  }
1497
1516
  this.updateLength()
1498
1517
  },
@@ -1555,93 +1574,17 @@ export default {
1555
1574
  this.updateLength()
1556
1575
  },
1557
1576
  organTreeRedis(row) {
1558
- const user = sessionStorage.getItem('userInfo');
1559
- const jsonArray = JSON.parse(user);
1560
- if (row == 'undefined' || row == "all") {
1561
-
1562
- ajax.get(this.smartFlowServerContext + "/manage/processDesign/getOrgan?orgId=" + (jsonArray.organId)
1563
- ).then(resp => {
1564
- if (resp.data.code === '200') {
1565
- this.organTree = resp.data.data;
1566
- }
1567
- })
1568
- } else {
1569
-
1570
- let orgPermScope = row.substring(2, row.indexOf(","))
1571
- orgPermScope = orgPermScope.split(';')
1572
-
1573
- let userPermScope = row.substring(row.indexOf("U:"))
1574
- userPermScope = userPermScope.substring(2, userPermScope.indexOf(","))
1575
- userPermScope = userPermScope.split(';')
1576
-
1577
- var rolePermScope = row.substring(row.indexOf("R:"))
1578
- rolePermScope = rolePermScope.substring(2, rolePermScope.indexOf(","))
1579
- rolePermScope = rolePermScope.split(';')
1580
-
1581
- let postPermScope = row.substring(row.indexOf("P:"))
1582
- postPermScope = postPermScope.substring(2, postPermScope.indexOf(","))
1583
- postPermScope = postPermScope.split(';')
1584
- ajax.get(this.upmsServerContext + "/manage/user/get/" + (jsonArray.accountUuid || jsonArray.userId))
1585
- .then(resp => {
1586
- this.organId = resp.data.data.organId
1587
- ajax.get(this.smartFlowServerContext + "/manage/processDesign/getOrgan?orgId=" + (jsonArray.organId)
1588
- ).then(resp => {
1589
- if (resp.data.code === '200') {
1590
- for (let key in resp.data.data.orgenMap) {
1591
- for (let i = 0; i < orgPermScope.length; i++) {
1592
- if (key == orgPermScope[i]) {
1593
- const dataArr = [[key, resp.data.data.orgenMap[key]]]
1594
-
1595
- for (let i = 0; i < dataArr.length; i++) {
1596
- const [key, value] = dataArr[i];
1597
- this.$set(this.organTree.orgenMap, key, value)
1598
- }
1599
- }
1600
- }
1601
- }
1602
- for (let key in resp.data.data.userMap) {
1603
- for (let i = 0; i < userPermScope.length; i++) {
1604
- if (key == userPermScope[i]) {
1605
- const dataArr = [[key, resp.data.data.userMap[key]]]
1606
- for (let i = 0; i < dataArr.length; i++) {
1607
- const [key, value] = dataArr[i];
1608
- this.$set(this.organTree.userMap, key, value)
1609
- }
1610
- }
1611
- }
1612
- }
1613
-
1614
- for (let key in resp.data.data.roleMap) {
1615
- for (let i = 0; i < rolePermScope.length; i++) {
1616
- if (key == rolePermScope[i]) {
1617
- const dataArr = [[key, resp.data.data.roleMap[key]]]
1618
-
1619
- for (let i = 0; i < dataArr.length; i++) {
1620
- const [key, value] = dataArr[i];
1621
- this.$set(this.organTree.roleMap, key, value)
1622
- }
1623
- }
1624
- }
1625
- }
1626
-
1627
- for (let key in resp.data.data.postMap) {
1628
- for (let i = 0; i < postPermScope.length; i++) {
1629
- if (key == postPermScope[i]) {
1630
- const dataArr = [[key, resp.data.data.postMap[key]]]
1631
-
1632
- for (let i = 0; i < dataArr.length; i++) {
1633
- const [key, value] = dataArr[i];
1634
- this.$set(this.organTree.postMap, key, value)
1635
- }
1636
- }
1637
- }
1638
- }
1639
- }
1640
- })
1641
-
1642
- })
1577
+ let params = {
1578
+ permScope: row,
1579
+ organTreeType: this.organTreeType,
1643
1580
  }
1644
-
1581
+ ajax.get(this.smartFlowServerContext + '/manage/processDesign/getQuickSelectionData', {params: params}).then(resp => {
1582
+ if (resp.data.code === '200') {
1583
+ this.organTree = resp.data.data
1584
+ }
1585
+ }).catch(err => {
1586
+ console.log(err);
1587
+ })
1645
1588
 
1646
1589
  },
1647
1590
  organChange(event) {
@@ -1650,10 +1593,12 @@ export default {
1650
1593
  let userValue = []
1651
1594
  let roleValue = []
1652
1595
  let postValue = []
1596
+ let typeValue = []
1653
1597
  let orgAdjustment = ""
1654
1598
  let userAdjustment = ""
1655
1599
  let roleAdjustment = ""
1656
1600
  let postAdjustment = ""
1601
+ let typeAdjustment = ""
1657
1602
  event.forEach(item => {
1658
1603
  let nameType = item.substring(item.indexOf(":") + 1)
1659
1604
  nameType = nameType.substring(nameType.indexOf(",") + 1)
@@ -1681,9 +1626,9 @@ export default {
1681
1626
  if (nameType == "3") {
1682
1627
  roleAdjustment = "3"
1683
1628
  this.organModel.push(item)
1684
- let user = item.substring(0, item.indexOf(","))
1685
- user = user.substring(user.indexOf(":") + 1)
1686
- roleValue.push(user)
1629
+ let role = item.substring(0, item.indexOf(","))
1630
+ role = role.replace(":", ",")
1631
+ roleValue.push(role)
1687
1632
  } else if (nameType != "3") {
1688
1633
  roleAdjustment = "3"
1689
1634
  }
@@ -1696,6 +1641,13 @@ export default {
1696
1641
  } else if (nameType != "4") {
1697
1642
  postAdjustment = "4"
1698
1643
  }
1644
+ if (nameType == "5") {
1645
+ typeAdjustment = "5"
1646
+ this.organModel.push(item)
1647
+ typeValue.push({typeName:item.substring(item.indexOf(":") + 1,item.indexOf(",")), bizTypeCode: item.substring(0, item.indexOf(":")), checked: true})
1648
+ } else if (nameType != "5"){
1649
+ typeAdjustment = "5"
1650
+ }
1699
1651
 
1700
1652
  // 执行需要的操作
1701
1653
  });
@@ -1704,121 +1656,71 @@ export default {
1704
1656
  userAdjustment = '2'
1705
1657
  roleAdjustment = '3'
1706
1658
  postAdjustment = '4'
1659
+ typeAdjustment = '5'
1707
1660
  this.noticeRoleList = []
1708
1661
  }
1709
- if (this.userNum != "1") {
1710
- if (orgAdjustment == "1") {
1711
- this.treeValueBM = orgValue
1712
- }
1713
- if (userAdjustment == "2") {
1714
- this.treeUserValue = userValue
1715
- }
1716
- if (roleAdjustment == "3") {
1717
- this.noticeRoleNameList = roleValue
1718
- }
1719
- if (postAdjustment == "4") {
1720
- this.treePostValue = postValue
1721
- }
1662
+ if (orgAdjustment == "1") {
1663
+ this.treeValueBM = this.updateCheckedData(orgValue, this.treeValueBM, 'code', this.organTree.organMap)
1664
+ }
1665
+ if (userAdjustment == "2") {
1666
+ this.treeUserValue = this.updateCheckedData(userValue, this.treeUserValue, 'id', this.organTree.userMap)
1667
+ }
1668
+ if (roleAdjustment == "3") {
1669
+ this.noticeRoleNameList = this.updateCheckedData(roleValue, this.noticeRoleNameList, 'id', this.organTree.roleMap)
1670
+ }
1671
+ if (postAdjustment == "4") {
1672
+ this.treePostValue = this.updateCheckedData(postValue, this.treePostValue, 'id', this.organTree.postMap)
1673
+ }
1674
+ if (typeAdjustment == "5") {
1675
+ this.treeOrgTypeValue = this.updateCheckedData(typeValue, this.treeOrgTypeValue, 'bizTypeCode', this.organTree.typeMap)
1722
1676
  }
1723
- this.userNum = "2"
1724
1677
  this.updateLength()
1725
1678
  },
1726
- organTreeRedisUpdate() {
1727
- const user = sessionStorage.getItem('userInfo');
1728
- const jsonArray = JSON.parse(user);
1729
- if (this.permScope == "all" || this.permScope == "undefined") {
1730
- this.loading = true;
1731
- ajax.get(this.smartFlowServerContext + "/manage/processDesign/getOrgan?orgId=" + (jsonArray.organId)
1732
- ).then(resp => {
1733
- if (resp.data.code === '200') {
1734
- this.organTree = resp.data.data;
1735
- this.loading = false;
1736
- } else {
1737
- this.loading = false;
1738
- }
1739
- })
1740
- } else {
1741
- this.loading = true;
1742
- let orgPermScope = this.permScope.substring(2, this.permScope.indexOf(","))
1743
- orgPermScope = orgPermScope.split(';')
1744
-
1745
- let userPermScope = this.permScope.substring(this.permScope.indexOf("U:"))
1746
- userPermScope = userPermScope.substring(2, userPermScope.indexOf(","))
1747
- userPermScope = userPermScope.split(';')
1748
-
1749
- let rolePermScope = this.permScope.substring(this.permScope.indexOf("R:"))
1750
- rolePermScope = rolePermScope.substring(2, rolePermScope.indexOf(","))
1751
- rolePermScope = rolePermScope.split(';')
1752
-
1753
- let postPermScope = this.permScope.substring(this.permScope.indexOf("P:"))
1754
- postPermScope = postPermScope.substring(2, postPermScope.indexOf(","))
1755
- postPermScope = postPermScope.split(';')
1756
- ajax.get(this.upmsServerContext + "/manage/user/get/" + (jsonArray.accountUuid || jsonArray.userId))
1757
- .then(resp => {
1758
- this.organId = resp.data.data.permitOrganId
1759
- ajax.get(this.smartFlowServerContext + "/manage/processDesign/getOrgan?orgId=" + this.organId
1760
- ).then(resp => {
1761
- if (resp.data.code === '200') {
1762
- for (let key in resp.data.data.orgenMap) {
1763
- for (let i = 0; i < orgPermScope.length; i++) {
1764
- if (key == orgPermScope[i]) {
1765
- const dataArr = [[key, resp.data.data.orgenMap[key]]]
1766
-
1767
- for (let i = 0; i < dataArr.length; i++) {
1768
- const [key, value] = dataArr[i];
1769
- this.$set(this.organTree.orgenMap, key, value)
1770
- }
1771
- }
1772
- }
1773
- }
1774
- for (let key in resp.data.data.userMap) {
1775
- for (let i = 0; i < userPermScope.length; i++) {
1776
- if (key == userPermScope[i]) {
1777
- const dataArr = [[key, resp.data.data.userMap[key]]]
1778
- for (let i = 0; i < dataArr.length; i++) {
1779
- const [key, value] = dataArr[i];
1780
- this.$set(this.organTree.userMap, key, value)
1781
- }
1782
- }
1783
- }
1784
- }
1785
-
1786
- for (let key in resp.data.data.roleMap) {
1787
- for (let i = 0; i < rolePermScope.length; i++) {
1788
- if (key == rolePermScope[i]) {
1789
- const dataArr = [[key, resp.data.data.roleMap[key]]]
1790
-
1791
- for (let i = 0; i < dataArr.length; i++) {
1792
- const [key, value] = dataArr[i];
1793
- this.$set(this.organTree.roleMap, key, value)
1794
- }
1795
- }
1796
- }
1797
- }
1798
-
1799
- for (let key in resp.data.data.postMap) {
1800
- for (let i = 0; i < postPermScope.length; i++) {
1801
- if (key == postPermScope[i]) {
1802
- const dataArr = [[key, resp.data.data.postMap[key]]]
1803
-
1804
- for (let i = 0; i < dataArr.length; i++) {
1805
- const [key, value] = dataArr[i];
1806
- this.$set(this.organTree.postMap, key, value)
1807
- }
1808
- }
1809
- }
1810
- }
1811
- this.loading = false;
1812
- this.$Message.success("更新查询数据成功!")
1813
- } else {
1814
- // this.$Message.error(resp.data.data);
1815
- console.log(resp.data.data);
1816
- this.loading = false;
1817
- }
1818
- })
1679
+ updateCheckedData(selectValue, treeValue, uniqueKey, selectMap){
1680
+ if (treeValue.length === 0){
1681
+ return selectValue
1682
+ }
1683
+ if (uniqueKey === 'id'){
1684
+ treeValue = treeValue.map(str => {
1685
+ const [id, name] = str.split(',');
1686
+ return { id: id.trim(), name: name.trim() };
1687
+ });
1688
+ selectValue = selectValue.map(str => {
1689
+ const [id, name] = str.split(',');
1690
+ return { id: id.trim(), name: name.trim() };
1691
+ });
1692
+ }
1819
1693
 
1820
- })
1694
+ //选择框有已选择列表没有的增加到已选择列表中
1695
+ selectValue.forEach(orgObj => {
1696
+ if (!this.isObjectInArray(treeValue, orgObj, uniqueKey)) {
1697
+ treeValue.push(orgObj);
1698
+ }
1699
+ });
1700
+ //已选择列表有选择框没有且包含在选择框所有数据中的,在已选择列表中删除
1701
+ treeValue = treeValue.filter(treeObj => {
1702
+ return !(!this.isObjectInArray(selectValue, treeObj, uniqueKey) && selectMap[treeObj[uniqueKey]]);
1703
+ });
1704
+ if (uniqueKey === 'id'){
1705
+ return treeValue.map(obj => `${obj.id},${obj.name}`)
1821
1706
  }
1707
+ return treeValue
1708
+ },
1709
+ isObjectInArray(array, obj, uniqueKey) {
1710
+ return array.some(item => item[uniqueKey] === obj[uniqueKey]);
1711
+ },
1712
+ organTreeRedisUpdate() {
1713
+ let params = {
1714
+ permScope: this.permScope,
1715
+ organTreeType: this.organTreeType,
1716
+ }
1717
+ ajax.get(this.smartFlowServerContext + '/manage/processDesign/getQuickSelectionData', {params: params}).then(resp => {
1718
+ if (resp.data.code === '200') {
1719
+ this.organTree = resp.data.data
1720
+ }
1721
+ }).catch(err => {
1722
+ console.log(err);
1723
+ })
1822
1724
  },
1823
1725
  readingRangeEmpty() {
1824
1726
  this.treeValueBM.forEach(item => {