hd-idevvue3 3.0.2 → 3.0.4

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.
Files changed (147) hide show
  1. package/dist/assets/index.9c127719.css +1 -0
  2. package/dist/hd-idevvue3.mjs +3521 -3305
  3. package/dist/hd-idevvue3.umd.js +29 -29
  4. package/npminstall-debug.log +2 -10
  5. package/package.json +4 -2
  6. package/pnpm-lock.yaml +37 -4
  7. package/src/App.vue +11 -15
  8. package/src/assets/sound/notify.wav +0 -0
  9. package/src/demo/demo.vue +9 -10
  10. package/src/demo/dropdemo.vue +42 -43
  11. package/src/demo/extsets.vue +140 -39
  12. package/src/demo/formedit.vue +157 -145
  13. package/src/demo/hightquery.vue +263 -66
  14. package/src/demo/inlineedit.vue +129 -35
  15. package/src/demo/selfdrop.vue +32 -15
  16. package/src/directive/el-dragDialog/drag.js +13 -13
  17. package/src/directive/el-dragDialog/index.js +13 -13
  18. package/src/errorLog.js +3 -3
  19. package/src/hdcom/BigGrid.js +54 -48
  20. package/src/hdcom/BillShow.vue +84 -63
  21. package/src/hdcom/BillUpload.vue +144 -86
  22. package/src/hdcom/BtnRight.vue +26 -23
  23. package/src/hdcom/ErrHint.vue +36 -24
  24. package/src/hdcom/ExtendColumn.vue +97 -90
  25. package/src/hdcom/ExtendCommon.js +24 -13
  26. package/src/hdcom/ExtendForm.vue +107 -80
  27. package/src/hdcom/FacePicUpload.vue +59 -50
  28. package/src/hdcom/FaceRecTest.vue +87 -77
  29. package/src/hdcom/GridChart.vue +175 -162
  30. package/src/hdcom/GridExField.vue +328 -234
  31. package/src/hdcom/GridShow.vue +89 -39
  32. package/src/hdcom/HdAside.vue +192 -145
  33. package/src/hdcom/HdBtn.vue +44 -32
  34. package/src/hdcom/HdButton.vue +141 -117
  35. package/src/hdcom/HdComFaceRec.vue +80 -32
  36. package/src/hdcom/HdComGrid.vue +329 -229
  37. package/src/hdcom/HdComQuery.vue +179 -90
  38. package/src/hdcom/HdComQueryDetail.vue +159 -115
  39. package/src/hdcom/HdComSortDetail.vue +136 -130
  40. package/src/hdcom/HdDatePicker.vue +32 -16
  41. package/src/hdcom/HdDialog.vue +62 -44
  42. package/src/hdcom/HdDrop.vue +163 -138
  43. package/src/hdcom/HdFileUpload.vue +138 -119
  44. package/src/hdcom/HdFilterBox.vue +62 -62
  45. package/src/hdcom/HdFooter.vue +152 -119
  46. package/src/hdcom/HdForm.vue +276 -203
  47. package/src/hdcom/HdFormBtn.vue +81 -39
  48. package/src/hdcom/HdFormItem.vue +14 -10
  49. package/src/hdcom/HdGrid.vue +353 -156
  50. package/src/hdcom/HdGridEditBtn.vue +34 -20
  51. package/src/hdcom/HdGridExt.js +78 -47
  52. package/src/hdcom/HdGridSel.vue +227 -193
  53. package/src/hdcom/HdHeader.vue +149 -117
  54. package/src/hdcom/HdHotKey.vue +70 -67
  55. package/src/hdcom/HdInputHint.vue +40 -36
  56. package/src/hdcom/HdMain.vue +25 -27
  57. package/src/hdcom/HdMessage.vue +180 -171
  58. package/src/hdcom/HdNum.vue +67 -57
  59. package/src/hdcom/HdPopSel.vue +46 -24
  60. package/src/hdcom/HdRightMenu.vue +63 -61
  61. package/src/hdcom/HdSel/SelGridFieldcod.vue +46 -28
  62. package/src/hdcom/HdTableColumn.vue +156 -109
  63. package/src/hdcom/HdTempSave.vue +138 -116
  64. package/src/hdcom/HdTree.vue +89 -72
  65. package/src/hdcom/HdTreeTable/eval.js +8 -3
  66. package/src/hdcom/HdTreeTable/index.vue +229 -174
  67. package/src/hdcom/ImportExcel.vue +69 -34
  68. package/src/hdcom/index.js +39 -44
  69. package/src/idev.common.js +54 -47
  70. package/src/index.js +3 -6
  71. package/src/utils/HdQuery.js +25 -14
  72. package/src/utils/comutils.js +50 -28
  73. package/src/utils/gogocodeTransfer.js +59 -0
  74. package/src/utils/utils.js +30 -19
  75. package/src/vendor/Blob.js +187 -179
  76. package/src/vendor/Export2Excel.js +231 -220
  77. package/src/vendor/Export2Zip.js +25 -22
  78. package/src/views/layout/AppMain.vue +34 -32
  79. package/src/views/layout/HdLayout.vue +64 -52
  80. package/src/views/layout/header/ElasticSearch.vue +196 -159
  81. package/src/views/layout/header/HZRecorder.js +163 -135
  82. package/src/views/layout/header/HeaderSearch.vue +165 -145
  83. package/src/views/layout/header/Levelbar.vue +55 -49
  84. package/src/views/layout/header/MainHeader.vue +233 -189
  85. package/src/views/layout/header/Navbar.vue +74 -78
  86. package/src/views/layout/header/ScrollPane.vue +103 -81
  87. package/src/views/layout/header/TagsView.vue +169 -164
  88. package/src/views/layout/header/VocRec.vue +86 -78
  89. package/src/views/layout/header/changepswform.vue +98 -64
  90. package/src/views/layout/index.js +5 -7
  91. package/src/views/layout/menu/Hamburger.vue +63 -45
  92. package/src/views/layout/menu/HdMenu.vue +155 -118
  93. package/src/views/layout/menu/index.vue +21 -19
  94. package/src/views/privilege/commsg/commsg.vue +115 -41
  95. package/src/views/privilege/commsg/commsgOrgn.vue +40 -31
  96. package/src/views/privilege/commsg/commsgRole.vue +180 -109
  97. package/src/views/privilege/commsg/commsgform.vue +125 -101
  98. package/src/views/privilege/commsg/commsgiframe.vue +30 -23
  99. package/src/views/privilege/commsg/commsgto.vue +163 -84
  100. package/src/views/privilege/commsg/commsgtoform.vue +64 -58
  101. package/src/views/privilege/commsg/commsgtrans.vue +187 -115
  102. package/src/views/privilege/exfield/comexcolumn.vue +133 -43
  103. package/src/views/privilege/exfield/comexcolumnform.vue +85 -58
  104. package/src/views/privilege/exfield/comexfield.vue +15 -17
  105. package/src/views/privilege/exfield/comexfieldform.vue +71 -53
  106. package/src/views/privilege/exfield/comexfieldsub.vue +137 -46
  107. package/src/views/privilege/index.js +19 -20
  108. package/src/views/privilege/menu/comMenu.vue +49 -41
  109. package/src/views/privilege/menu/menu.vue +166 -49
  110. package/src/views/privilege/menu/menuinfo.vue +41 -34
  111. package/src/views/privilege/menu/rolelist.vue +78 -33
  112. package/src/views/privilege/menu/userlist.vue +76 -33
  113. package/src/views/privilege/mobile/authmobileupdate.vue +119 -43
  114. package/src/views/privilege/mobile/authmobileupdateform.vue +76 -46
  115. package/src/views/privilege/orgDept/authOrgn.vue +157 -65
  116. package/src/views/privilege/orgDept/authorgnform.vue +50 -38
  117. package/src/views/privilege/orgDept/orgDept.vue +38 -37
  118. package/src/views/privilege/orgDept/orgTree.vue +99 -88
  119. package/src/views/privilege/orgDept/orgnselect.vue +132 -111
  120. package/src/views/privilege/personDept/authuser.vue +197 -91
  121. package/src/views/privilege/personDept/authuserform.vue +123 -71
  122. package/src/views/privilege/personDept/facerec.vue +128 -83
  123. package/src/views/privilege/personDept/orgncascader.vue +134 -115
  124. package/src/views/privilege/personDept/personDept.vue +9 -7
  125. package/src/views/privilege/quartz/comquartzjob.vue +123 -38
  126. package/src/views/privilege/quartz/comquartzjobform.vue +67 -51
  127. package/src/views/privilege/quartz/comquartzlog.vue +116 -32
  128. package/src/views/privilege/role/btnRole.vue +123 -67
  129. package/src/views/privilege/role/menuRole.vue +65 -45
  130. package/src/views/privilege/role/orgnRole.vue +63 -41
  131. package/src/views/privilege/role/role.vue +26 -9
  132. package/src/views/privilege/role/rolelist.vue +114 -45
  133. package/src/views/privilege/role/roleselect.vue +34 -17
  134. package/src/views/privilege/search/comsearch.vue +164 -73
  135. package/src/views/privilege/search/menu.vue +38 -22
  136. package/src/views/privilege/syscode/syscode.vue +157 -69
  137. package/src/views/privilege/syscode/sysfield.vue +96 -43
  138. package/src/views/privilege/syscode/sysfieldframe.vue +30 -30
  139. package/src/views/privilege/syslog/menulog.vue +38 -22
  140. package/src/views/privilege/syslog/syslog.vue +145 -78
  141. package/src/views/privilege/syslog/syslogconfig.vue +91 -24
  142. package/src/views/privilege/syslog/syslogform.vue +45 -43
  143. package/src/views/privilege/syslog/syslogframe.vue +26 -26
  144. package/src/views/privilege/userRole/userRole.vue +187 -89
  145. package/vite.config.js +7 -0
  146. package/dist/assets/index.774ef40e.css +0 -1
  147. package/src/views/privilege.zip +0 -0
@@ -1,117 +1,173 @@
1
1
  <template>
2
2
  <el-container style="padding-top: 5px">
3
3
  <el-main>
4
- <hd-com-grid ref="grid" :hdQuery="hdQuery" :findUrl="findUrl"
5
- removeAllUrl="/webresources/login/privilege/AuthResource/removeBtn"
6
- findoneUrl="/webresources/login/privilege/AuthResource/findone"
7
- :saveoneUrl="saveoneUrl"
8
- noSets pageHide recHide notInit>
4
+ <hd-com-grid
5
+ ref="grid"
6
+ :hdQuery="hdQuery"
7
+ :findUrl="findUrl"
8
+ removeAllUrl="/webresources/login/privilege/AuthResource/removeBtn"
9
+ findoneUrl="/webresources/login/privilege/AuthResource/findone"
10
+ :saveoneUrl="saveoneUrl"
11
+ noSets
12
+ pageHide
13
+ recHide
14
+ notInit
15
+ >
9
16
  <div class="filter-container" slot="query">
10
- <el-button class="filter-item" @click="$refs.grid.doEdit('')" type="primary" keyType="add">{{$t('新增')}}
17
+ <el-button
18
+ class="filter-item"
19
+ @click="$refs.grid.doEdit('')"
20
+ type="primary"
21
+ keyType="add"
22
+ >{{ $t('新增') }}
11
23
  </el-button>
12
- <el-button class="filter-item" @click="$refs.grid.doRemoveAll()" type="danger" keyType="del">{{$t('删除')}}
24
+ <el-button
25
+ class="filter-item"
26
+ @click="$refs.grid.doRemoveAll()"
27
+ type="danger"
28
+ keyType="del"
29
+ >{{ $t('删除') }}
13
30
  </el-button>
14
- <el-button class="filter-item" @click="doInit()" type="danger">{{$t('按钮扫描')}}
31
+ <el-button class="filter-item" @click="doInit()" type="danger"
32
+ >{{ $t('按钮扫描') }}
15
33
  </el-button>
16
34
  </div>
17
35
  <el-table-column width="90" align="center" label="操作" fixed="right">
18
36
  <template slot-scope="scope">
19
- <hd-btn icon="el-icon-edit" hint="编辑" @click.stop="$refs.grid.doEdit(scope.row)" v-if="!scope.row.isEdit">{{$t('编辑')}}
37
+ <hd-btn
38
+ icon="el-icon-edit"
39
+ hint="编辑"
40
+ @click.stop="$refs.grid.doEdit(scope.row)"
41
+ v-if="!scope.row.isEdit"
42
+ >{{ $t('编辑') }}
20
43
  </hd-btn>
21
- <hd-btn hint="撤销" @click.stop="$refs.grid.doCancel(scope.row,scope.$index)" v-if="scope.row.isEdit">
22
- <svg-icon icon-class="undo"/>
44
+ <hd-btn
45
+ hint="撤销"
46
+ @click.stop="$refs.grid.doCancel(scope.row, scope.$index)"
47
+ v-if="scope.row.isEdit"
48
+ >
49
+ <svg-icon icon-class="undo" />
23
50
  </hd-btn>
24
- <hd-btn icon="el-icon-check" hint="保存" @click.stop="doSave(scope.row)" v-if="scope.row.isEdit">
51
+ <hd-btn
52
+ icon="el-icon-check"
53
+ hint="保存"
54
+ @click.stop="doSave(scope.row)"
55
+ v-if="scope.row.isEdit"
56
+ >
25
57
  </hd-btn>
26
58
  </template>
27
59
  </el-table-column>
28
60
  <el-table-column width="90" align="center" label="使用">
29
61
  <template slot-scope="scope">
30
- <el-switch v-model="scope.row.useFlg" active-value="1" inactive-value="0"
31
- @change="updateBtn(scope.row)"></el-switch>
62
+ <el-switch
63
+ v-model="scope.row.useFlg"
64
+ active-value="1"
65
+ inactive-value="0"
66
+ @change="updateBtn(scope.row)"
67
+ ></el-switch>
32
68
  </template>
33
69
  </el-table-column>
34
- <el-table-column width="120px" align="center" label="名称" prop="name" sortable>
70
+ <el-table-column
71
+ width="120px"
72
+ align="center"
73
+ label="名称"
74
+ prop="name"
75
+ sortable
76
+ >
35
77
  </el-table-column>
36
- <el-table-column width="220px" align="center" label="区分标识" prop="permissions" sortable>
78
+ <el-table-column
79
+ width="220px"
80
+ align="center"
81
+ label="区分标识"
82
+ prop="permissions"
83
+ sortable
84
+ >
37
85
  </el-table-column>
38
-
39
86
  </hd-com-grid>
40
87
  <component :is="menuUrl" v-show="false" ref="compurl"></component>
41
88
  </el-main>
42
89
  </el-container>
43
90
  </template>
91
+
44
92
  <script>
45
- export default {
46
- components: {},
47
- name: 'btnRole',
48
- data() {
49
- return {
50
- hdQuery: new HdQuery(this),
51
- findUrl: '',
52
- saveoneUrl: '',
53
- menuUrl: ''
54
- }
93
+ export default {
94
+ components: {},
95
+ name: 'btnRole',
96
+ data() {
97
+ return {
98
+ hdQuery: new HdQuery(this),
99
+ findUrl: '',
100
+ saveoneUrl: '',
101
+ menuUrl: '',
102
+ }
103
+ },
104
+ props: ['menu', 'roleId', 'imFromPro'], // imFromPro:import不能来自node_module,需要项目传入
105
+ mounted() {
106
+ this.initCom()
107
+ },
108
+ methods: {
109
+ doQuery() {
110
+ this.findUrl = `/webresources/login/privilege/AuthResource/showBtn?menuId=${this.menu.id}&roleId=${this.roleId}`
111
+ this.$refs.grid.doQuery()
55
112
  },
56
- props: ['menu', 'roleId', 'imFromPro'], // imFromPro:import不能来自node_module,需要项目传入
57
- mounted() {
58
- this.initCom()
113
+ doSave(row) {
114
+ this.saveoneUrl = `/webresources/login/privilege/AuthResource/saveBtn?menuId=${this.menu.id}`
115
+ this.$refs.grid.doSave(row)
59
116
  },
60
- methods: {
61
- doQuery() {
62
- this.findUrl = `/webresources/login/privilege/AuthResource/showBtn?menuId=${this.menu.id}&roleId=${this.roleId}`
63
- this.$refs.grid.doQuery()
64
- },
65
- doSave(row) {
66
- this.saveoneUrl = `/webresources/login/privilege/AuthResource/saveBtn?menuId=${this.menu.id}`
67
- this.$refs.grid.doSave(row)
68
- },
69
- initCom() {
70
- this.doQuery()// 这里列表展示
71
- this.$route.meta.btnRole = []
72
- this.menuUrl = () => this.imFromPro(this.menu.url)
73
- },
74
- doInit() {
75
- this.listLoading = true
76
- this.$http.post(`/webresources/login/privilege/AuthResource/initBtn?menuId=${this.menu.id}`, this.$route.meta.btnRole).then(response => {
117
+ initCom() {
118
+ this.doQuery() // 这里列表展示
119
+ this.$route.meta.btnRole = []
120
+ this.menuUrl = () => this.imFromPro(this.menu.url)
121
+ },
122
+ doInit() {
123
+ this.listLoading = true
124
+ this.$http
125
+ .post(
126
+ `/webresources/login/privilege/AuthResource/initBtn?menuId=${this.menu.id}`,
127
+ this.$route.meta.btnRole
128
+ )
129
+ .then((response) => {
77
130
  this.listLoading = false
78
131
  const data = response.data
79
132
  this.$message({
80
133
  type: data.code == '-1' ? 'error' : 'success',
81
134
  showClose: true,
82
135
  duration: 1500,
83
- message: data.message
136
+ message: data.message,
84
137
  })
85
138
  if (data.code == '-1') {
86
139
  return
87
140
  }
88
141
  this.doQuery()
89
142
  })
90
- },
91
- updateBtn(row) {
92
- this.$set(row, 'checked', row.checked)
93
- row.menuId = this.menu.id
94
- row.roleId = this.roleId
95
- this.$http.post(`/webresources/login/privilege/AuthResource/setBtn?menuId=${this.menu.id}&roleId=${this.roleId}&resourceId=${row.resourceId}&useFlg=${row.useFlg}`).then(response => {
143
+ },
144
+ updateBtn(row) {
145
+ this.$set(row, 'checked', row.checked)
146
+ row.menuId = this.menu.id
147
+ row.roleId = this.roleId
148
+ this.$http
149
+ .post(
150
+ `/webresources/login/privilege/AuthResource/setBtn?menuId=${this.menu.id}&roleId=${this.roleId}&resourceId=${row.resourceId}&useFlg=${row.useFlg}`
151
+ )
152
+ .then((response) => {
96
153
  const data = response.data
97
154
  this.$message({
98
155
  type: data.code == '-1' ? 'error' : 'success',
99
156
  message: data.message,
100
157
  showClose: true,
101
- duration: 1500
158
+ duration: 1500,
102
159
  })
103
160
  })
104
- }
105
161
  },
106
- watch: {// 初始化时,不会执行watch,所以需要在mounted
107
- 'menu.id': function () {
108
- this.initCom()
109
- },
110
- roleId: function () {
111
- this.initCom()
112
- }
113
- }
114
-
115
- }
116
-
162
+ },
163
+ watch: {
164
+ // 初始化时,不会执行watch,所以需要在mounted
165
+ 'menu.id': function () {
166
+ this.initCom()
167
+ },
168
+ roleId: function () {
169
+ this.initCom()
170
+ },
171
+ },
172
+ }
117
173
  </script>
@@ -1,64 +1,84 @@
1
1
  <template>
2
- <div style="height: 100%;">
3
- <el-button class="filter-item" type="success" @click="save" size="mini">{{$t('保存')}}</el-button>
4
- <hd-tree :data="hdTree" v-loading="listLoading" node-key="id" ref="menuTree"
5
- show-checkbox style="height: calc(100% - 30px);"></hd-tree>
2
+ <div style="height: 100%">
3
+ <el-button class="filter-item" type="success" @click="save" size="mini">{{
4
+ $t('保存')
5
+ }}</el-button>
6
+ <hd-tree
7
+ :data="hdTree"
8
+ v-loading="listLoading"
9
+ node-key="id"
10
+ ref="menuTree"
11
+ show-checkbox
12
+ style="height: calc(100% - 30px)"
13
+ ></hd-tree>
6
14
  </div>
7
15
  </template>
8
- <script>
9
16
 
10
- import btnRole from './btnRole'
17
+ <script>
18
+ import btnRole from './btnRole'
11
19
 
12
- import rolelist from './rolelist'
20
+ import rolelist from './rolelist'
13
21
 
14
- export default {
15
- components: {
16
- rolelist, btnRole
17
- },
18
- name: 'menuRole',
19
- data: function () {
20
- return {
21
- hdTree: [],
22
- listLoading: false
23
- }
24
- },
25
- mounted() { // 因为外层通过v-if控制
26
- this.doQuery()
27
- },
28
- methods: {
29
- doQuery() {
30
- this.listLoading = true
22
+ export default {
23
+ components: {
24
+ rolelist,
25
+ btnRole,
26
+ },
27
+ name: 'menuRole',
28
+ data: function () {
29
+ return {
30
+ hdTree: [],
31
+ listLoading: false,
32
+ }
33
+ },
34
+ mounted() {
35
+ // 因为外层通过v-if控制
36
+ this.doQuery()
37
+ },
38
+ methods: {
39
+ doQuery() {
40
+ this.listLoading = true
31
41
 
32
- this.$http.get(`../webresources/login/privilege/AuthRole/findtreeforrole?roleId=${this.roleId}`).then(response => {
42
+ this.$http
43
+ .get(
44
+ `../webresources/login/privilege/AuthRole/findtreeforrole?roleId=${this.roleId}`
45
+ )
46
+ .then((response) => {
33
47
  const data = response.data
34
48
  this.hdTree = data
35
49
  this.listLoading = false
36
50
  })
37
- },
38
- save() {
39
- const os = this.$refs.menuTree.getCheckedNodes()
40
- let privilegeIds = ''
41
- for (let i = 0; i < os.length; i++) {
42
- if (os[i].id == -1) { // 总根节点不处理
43
- continue
44
- }
45
- privilegeIds = privilegeIds + os[i].id + ','
51
+ },
52
+ save() {
53
+ const os = this.$refs.menuTree.getCheckedNodes()
54
+ let privilegeIds = ''
55
+ for (let i = 0; i < os.length; i++) {
56
+ if (os[i].id == -1) {
57
+ // 总根节点不处理
58
+ continue
46
59
  }
47
- this.$http.post(`../webresources/login/privilege/AuthRole/updatePermission/${this.roleId}`, {ids: privilegeIds}).then(response => {
60
+ privilegeIds = privilegeIds + os[i].id + ','
61
+ }
62
+ this.$http
63
+ .post(
64
+ `../webresources/login/privilege/AuthRole/updatePermission/${this.roleId}`,
65
+ { ids: privilegeIds }
66
+ )
67
+ .then((response) => {
48
68
  const data = response.data
49
69
  this.$message({
50
70
  type: data.code == '-1' ? 'error' : 'success',
51
- message: data.message
71
+ message: data.message,
52
72
  })
53
73
  })
54
- }
55
74
  },
56
- props: ['roleId'],
57
- watch: {
58
- // 如果 `roleId` 发生改变,这个函数就会运行
59
- roleId: function (newVal) {
60
- this.doQuery()
61
- }
62
- }
63
- }
75
+ },
76
+ props: ['roleId'],
77
+ watch: {
78
+ // 如果 `roleId` 发生改变,这个函数就会运行
79
+ roleId: function (newVal) {
80
+ this.doQuery()
81
+ },
82
+ },
83
+ }
64
84
  </script>
@@ -1,56 +1,78 @@
1
1
  <template>
2
- <div style="height: 100%;">
3
- <el-button @click="saveOrgnTree" class="filter-item" size="mini" type="success">{{$t('保存')}}</el-button>
4
- <hd-tree :data="hdTree" height="100%" node-key="id" ref="orgnTree" show-checkbox
5
- style="height: 100%" v-loading="listLoading"></hd-tree>
2
+ <div style="height: 100%">
3
+ <el-button
4
+ @click="saveOrgnTree"
5
+ class="filter-item"
6
+ size="mini"
7
+ type="success"
8
+ >{{ $t('保存') }}</el-button
9
+ >
10
+ <hd-tree
11
+ :data="hdTree"
12
+ height="100%"
13
+ node-key="id"
14
+ ref="orgnTree"
15
+ show-checkbox
16
+ style="height: 100%"
17
+ v-loading="listLoading"
18
+ ></hd-tree>
6
19
  </div>
7
20
  </template>
8
- <script>
9
21
 
10
- export default {
11
- name: 'orgnRole',
12
- data: function () {
13
- return {
14
- hdTree: [],
15
- listLoading: false
16
- }
17
- },
18
- mounted() {
19
- this.doQuery()
20
- },
21
- methods: {
22
- doQuery() {
23
- this.listLoading = true
24
- this.$http.get(`../webresources/login/privilege/AuthRole/findOrgnByRoleAndPrivilege?roleId=${this.roleId}&privilegeId=${this.menuId}`).then(response => {
22
+ <script>
23
+ export default {
24
+ name: 'orgnRole',
25
+ data: function () {
26
+ return {
27
+ hdTree: [],
28
+ listLoading: false,
29
+ }
30
+ },
31
+ mounted() {
32
+ this.doQuery()
33
+ },
34
+ methods: {
35
+ doQuery() {
36
+ this.listLoading = true
37
+ this.$http
38
+ .get(
39
+ `../webresources/login/privilege/AuthRole/findOrgnByRoleAndPrivilege?roleId=${this.roleId}&privilegeId=${this.menuId}`
40
+ )
41
+ .then((response) => {
25
42
  const data = response.data
26
43
  this.hdTree = data
27
44
  this.listLoading = false
28
45
  })
29
- },
30
- saveOrgnTree() {
31
- const os = this.$refs.orgnTree.getCheckedNodes(false)
32
- let orgIds = ''
33
- for (let i = 0; i < os.length; i++) {
34
- orgIds = orgIds + os[i].id + ','
35
- }
36
- this.$http.post(`../webresources/login/privilege/AuthRole/vue/updateRoleOrgn/${this.roleId}/${this.menuId}`, {ids: orgIds}).then(response => {
46
+ },
47
+ saveOrgnTree() {
48
+ const os = this.$refs.orgnTree.getCheckedNodes(false)
49
+ let orgIds = ''
50
+ for (let i = 0; i < os.length; i++) {
51
+ orgIds = orgIds + os[i].id + ','
52
+ }
53
+ this.$http
54
+ .post(
55
+ `../webresources/login/privilege/AuthRole/vue/updateRoleOrgn/${this.roleId}/${this.menuId}`,
56
+ { ids: orgIds }
57
+ )
58
+ .then((response) => {
37
59
  const data = response.data
38
60
  this.$message({
39
61
  type: data.code == '-1' ? 'error' : 'success',
40
- message: data.message
62
+ message: data.message,
41
63
  })
42
64
  })
43
- }
44
65
  },
45
- props: ['roleId', 'menuId'],
46
- watch: {
47
- // 都有值才适合查询
48
- roleId: function (newVal) {
49
- this.doQuery()
50
- },
51
- menuId: function (newVal) {
52
- this.doQuery()
53
- }
54
- }
55
- }
66
+ },
67
+ props: ['roleId', 'menuId'],
68
+ watch: {
69
+ // 都有值才适合查询
70
+ roleId: function (newVal) {
71
+ this.doQuery()
72
+ },
73
+ menuId: function (newVal) {
74
+ this.doQuery()
75
+ },
76
+ },
77
+ }
56
78
  </script>
@@ -6,25 +6,37 @@
6
6
  <el-main>
7
7
  <el-tabs v-model="activeName">
8
8
  <el-tab-pane :label="$t('菜单')" name="menu">
9
- <menuRole :roleId="roleId" v-if="activeName=='menu'&&roleId"></menuRole>
9
+ <menuRole
10
+ :roleId="roleId"
11
+ v-if="activeName == 'menu' && roleId"
12
+ ></menuRole>
10
13
  </el-tab-pane>
11
14
  <el-tab-pane :label="$t('数据')" name="data">
12
- <el-container v-if="activeName=='data'">
15
+ <el-container v-if="activeName == 'data'">
13
16
  <el-aside width="30%">
14
17
  <comMenu @selMenu="selMenu"></comMenu>
15
18
  </el-aside>
16
19
  <el-main>
17
- <orgnRole :roleId="roleId" :menuId="menu.id" v-if="roleId&&menu.url"></orgnRole>
20
+ <orgnRole
21
+ :roleId="roleId"
22
+ :menuId="menu.id"
23
+ v-if="roleId && menu.url"
24
+ ></orgnRole>
18
25
  </el-main>
19
26
  </el-container>
20
27
  </el-tab-pane>
21
28
  <el-tab-pane :label="$t('按钮')" name="btn">
22
- <el-container v-if="activeName=='btn'">
29
+ <el-container v-if="activeName == 'btn'">
23
30
  <el-aside width="30%">
24
31
  <comMenu @selMenu="selMenu"></comMenu>
25
32
  </el-aside>
26
33
  <el-main>
27
- <btnRole :roleId="roleId" :menu="menu" v-if="roleId&&menu.url" :imFromPro="imFromPro"></btnRole>
34
+ <btnRole
35
+ :roleId="roleId"
36
+ :menu="menu"
37
+ v-if="roleId && menu.url"
38
+ :imFromPro="imFromPro"
39
+ ></btnRole>
28
40
  </el-main>
29
41
  </el-container>
30
42
  </el-tab-pane>
@@ -32,6 +44,7 @@
32
44
  </el-main>
33
45
  </el-container>
34
46
  </template>
47
+
35
48
  <script>
36
49
  import btnRole from './btnRole'
37
50
  import rolelist from './rolelist'
@@ -41,14 +54,18 @@ import comMenu from '../menu/comMenu'
41
54
 
42
55
  export default {
43
56
  components: {
44
- orgnRole, rolelist, menuRole, btnRole, comMenu
57
+ orgnRole,
58
+ rolelist,
59
+ menuRole,
60
+ btnRole,
61
+ comMenu,
45
62
  },
46
63
  name: 'role',
47
64
  data() {
48
65
  return {
49
66
  roleId: null,
50
67
  menu: {},
51
- activeName: 'menu'
68
+ activeName: 'menu',
52
69
  }
53
70
  },
54
71
  props: ['imFromPro'], // imFromPro:import不能来自node_module,需要项目传入
@@ -61,7 +78,7 @@ export default {
61
78
  },
62
79
  selMenu(menu) {
63
80
  this.menu = menu
64
- }
65
- }
81
+ },
82
+ },
66
83
  }
67
84
  </script>