openatc-components 0.3.103 → 0.3.105

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.
@@ -631,11 +631,9 @@ export default {
631
631
  this.$message.error(msg)
632
632
  return
633
633
  }
634
- if (res.data.data.length > 0) {
635
- this.funcSort = 'thirdPartyFunc'
636
- this.thirdPartyControlMenu = getPermissionMenu(res.data.data)
637
- this.thirdPartyControl = getPermissionControl(res.data.data)
638
- }
634
+ this.funcSort = 'thirdPartyFunc'
635
+ this.thirdPartyControl = getPermissionControl(res.data.data)
636
+ this.thirdPartyControlMenu = getPermissionMenu(this.thirdPartyControl)
639
637
  })
640
638
  },
641
639
  handleGetData (data) {
@@ -18,7 +18,7 @@
18
18
  <div class="single-model-new"
19
19
  :style="{'backgroundColor': item.bgcolor}"
20
20
  @click="selectModel(item)"
21
- v-if="isHasPermission(item.permission)">
21
+ v-if="isHasPermission(item.permission) && (funcSort === 'allFunc' || (funcSort === 'thirdPartyFunc'&& thirdPartyControl.indexOf(item.id) !== -1))">
22
22
  <div class="closephase-icon">
23
23
  <OthersIconSvg :type="item.type" />
24
24
  </div>
@@ -79,8 +79,7 @@ export default {
79
79
  return {
80
80
  preselecttype: '',
81
81
  controllist: [],
82
- specialControl: [23, 22, 100, 24, 25],
83
- basicFuncControlId: [0, 1, 4, 5] // 基础功能包含的控制方式: 自主控制(手动下)、黄闪、步进、定周期
82
+ specialControl: [23, 24, 100]
84
83
  }
85
84
  },
86
85
  computed: {
@@ -186,7 +186,7 @@
186
186
  <el-tab-pane :label="$t('openatccomponents.overview.others')" name="others"
187
187
  v-if="(funcSort === 'allFunc' || (funcSort === 'thirdPartyFunc'&& thirdPartyControlMenu.indexOf('其他') !== -1))">
188
188
  <ControlModelGroup
189
- v-if="activeName === 'others' && funcSort === 'allFunc'"
189
+ v-if="activeName === 'others'"
190
190
  ref="ControlModelGroup"
191
191
  className="otherscontrol"
192
192
  othersControl
@@ -1,13 +1,21 @@
1
- const permissionMenuMap = new Map([[
2
- 'configer:manual:dwell', ['驻留控制']
1
+ // const permissionMenuMap = new Map([[
2
+ // 'configer:manual:dwell', ['驻留控制']
3
+ // ], [
4
+ // 'configer:manual:senior', ['特殊控制']
5
+ // ], [
6
+ // 'configer:manual:base', ['方案选择']
7
+ // ], [
8
+ // 'configer:manual:optimize', ['其他']
9
+ // ]])
10
+ const permissionControlMap = new Map([[
11
+ 'configer:manual:dwell', [4, 22, 25]
3
12
  ], [
4
- 'configer:manual:senior', ['特殊控制']
13
+ 'configer:manual:senior', [1, 2, 3]
5
14
  ], [
6
- 'configer:manual:base', ['方案选择']
15
+ 'configer:manual:base', [5, 6, 9, 10, 12, 19]
16
+ ], [
17
+ 'configer:manual:optimize', [23, 100, 24]
7
18
  ], [
8
- 'configer:manual:optimize', ['其他']
9
- ]])
10
- const permissionControlMap = new Map([[
11
19
  'configer:manual:dwell:step', [4]
12
20
  ], [
13
21
  'configer:manual:dwell:stage', [4]
@@ -41,16 +49,34 @@ const permissionControlMap = new Map([[
41
49
  'configer:manual:optimize:preempt', [24]
42
50
  ]])
43
51
 
44
- export function getPermissionMenu (permissionList) {
52
+ export function getPermissionMenu (thirdPartyControl) {
45
53
  // 按第三方平台角色的权限处理可显示的手动控制菜单
54
+ // let thirdPartyControlMenu = []
55
+ // for (let i = 0; i < permissionList.length; i++) {
56
+ // let per = permissionList[i].permission_code
57
+ // if (permissionMenuMap.get(per)) {
58
+ // thirdPartyControlMenu = thirdPartyControlMenu.concat(permissionMenuMap.get(per))
59
+ // }
60
+ // }
61
+ // console.log(thirdPartyControlMenu)
62
+ // return thirdPartyControlMenu
46
63
  let thirdPartyControlMenu = []
47
- for (let i = 0; i < permissionList.length; i++) {
48
- let per = permissionList[i].permission_code
49
- if (permissionMenuMap.get(per)) {
50
- thirdPartyControlMenu = thirdPartyControlMenu.concat(permissionMenuMap.get(per))
64
+ for (let i = 0; i < thirdPartyControl.length; i++) {
65
+ let control = thirdPartyControl[i]
66
+ if ([4, 22, 25].indexOf(control) !== -1) {
67
+ thirdPartyControlMenu = thirdPartyControlMenu.concat(['驻留控制'])
68
+ }
69
+ if ([1, 2, 3].indexOf(control) !== -1) {
70
+ thirdPartyControlMenu = thirdPartyControlMenu.concat(['特殊控制'])
71
+ }
72
+ if ([5, 6, 9, 10, 12, 19].indexOf(control) !== -1) {
73
+ thirdPartyControlMenu = thirdPartyControlMenu.concat(['方案选择'])
74
+ }
75
+ if ([23, 24, 100].indexOf(control) !== -1) {
76
+ thirdPartyControlMenu = thirdPartyControlMenu.concat(['其他'])
51
77
  }
52
78
  }
53
- console.log(thirdPartyControlMenu)
79
+ thirdPartyControlMenu = [...new Set(thirdPartyControlMenu)]
54
80
  return thirdPartyControlMenu
55
81
  }
56
82