cloud-web-corejs 1.0.18 → 1.0.19

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 (186) hide show
  1. package/package.json +2 -1
  2. package/src/components/jsonImport/index.js +3 -1
  3. package/src/components/jsonImport/mixins.js +16 -16
  4. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1 -1
  5. package/src/layout/components/Sidebar/default.vue +10 -4
  6. package/src/router/modules/customer.js +8 -8
  7. package/src/utils/aes.js +1 -0
  8. package/src/views/bd/setting/bd_attach_setting/dialog.vue +4 -4
  9. package/src/views/bd/setting/bd_attach_setting/edit.vue +3 -3
  10. package/src/views/bd/setting/bd_attach_setting/list.vue +3 -3
  11. package/src/views/bd/setting/form_script/dialog.vue +14 -12
  12. package/src/views/bd/setting/form_script/edit.vue +5 -4
  13. package/src/views/bd/setting/form_script/edit1.vue +3 -3
  14. package/src/views/bd/setting/form_script/form_list.vue +3 -3
  15. package/src/views/bd/setting/form_script/list.vue +4 -4
  16. package/src/views/bd/setting/form_script/list1.vue +4 -4
  17. package/src/views/bd/setting/form_script/list2.vue +1 -1
  18. package/src/views/bd/setting/form_template/dialog.vue +24 -17
  19. package/src/views/bd/setting/form_template/edit.vue +3 -3
  20. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +1 -1
  21. package/src/views/bd/setting/form_template/ftHistoryDialog.vue +5 -5
  22. package/src/views/bd/setting/form_template/itemEdit.vue +3 -3
  23. package/src/views/bd/setting/form_template/itemList.vue +3 -3
  24. package/src/views/bd/setting/form_template/list.vue +4 -4
  25. package/src/views/bd/setting/form_template/preformDialog.vue +2 -2
  26. package/src/views/bd/setting/menu_kind/authDialog.vue +2 -2
  27. package/src/views/bd/setting/menu_kind/dialog.vue +23 -16
  28. package/src/views/bd/setting/menu_kind/list.vue +3 -3
  29. package/src/views/bd/setting/table_model/dialog.vue +4 -4
  30. package/src/views/bd/setting/table_model/edit.vue +1123 -1123
  31. package/src/views/bd/setting/table_model/list.vue +4 -4
  32. package/src/views/bd/setting/table_model/zdDialog.vue +4 -4
  33. package/src/views/mobile/user/area/dialog.vue +3 -2
  34. package/src/views/mobile/user/user/dialog.vue +3 -2
  35. package/src/views/support/export_template/edit.vue +4 -4
  36. package/src/views/support/export_template/list.vue +12 -12
  37. package/src/views/user/access_log/edit.vue +2 -2
  38. package/src/views/user/access_log/list.vue +8 -8
  39. package/src/views/user/access_log/statistics_list.vue +16 -11
  40. package/src/views/user/api_request/edit.vue +7 -4
  41. package/src/views/user/api_request/list.vue +7 -5
  42. package/src/views/user/area/dialog.vue +4 -4
  43. package/src/views/user/area_attribute/configDialog.vue +319 -319
  44. package/src/views/user/area_attribute/edit.vue +2 -2
  45. package/src/views/user/area_attribute/list.vue +1 -1
  46. package/src/views/user/attachment/uploadDialog.vue +11 -11
  47. package/src/views/user/bill_setting/edit.vue +6 -5
  48. package/src/views/user/bill_setting/h5_ModifyDialog.vue +5 -3
  49. package/src/views/user/bill_setting/h5_view.vue +4 -4
  50. package/src/views/user/bill_setting/itemViewDialog.vue +1 -1
  51. package/src/views/user/bill_setting/list.vue +5 -4
  52. package/src/views/user/bill_setting/queryDialog.vue +3 -3
  53. package/src/views/user/bill_setting/render.vue +6 -6
  54. package/src/views/user/bill_setting/template2.json +44 -11
  55. package/src/views/user/bill_setting/userDialog.vue +4 -4
  56. package/src/views/user/code_rules/edit.vue +3 -3
  57. package/src/views/user/code_rules/list.vue +3 -3
  58. package/src/views/user/commMenu/index.vue +2 -2
  59. package/src/views/user/common_attribute/edit.vue +3 -3
  60. package/src/views/user/common_attribute/itemEdit.vue +3 -3
  61. package/src/views/user/common_attribute/list.vue +3 -3
  62. package/src/views/user/common_script/edit.vue +5 -4
  63. package/src/views/user/common_script/list.vue +14 -13
  64. package/src/views/user/company_info/dialog.vue +138 -131
  65. package/src/views/user/company_info/edit.vue +2 -2
  66. package/src/views/user/company_info/view.vue +1 -1
  67. package/src/views/user/country/dialog.vue +6 -6
  68. package/src/views/user/country/edit.vue +8 -7
  69. package/src/views/user/country/list.vue +170 -160
  70. package/src/views/user/data_type_setting/dialog.vue +10 -7
  71. package/src/views/user/data_type_setting/editDialog.vue +12 -11
  72. package/src/views/user/ea/eagroup/eaobj_list.vue +331 -310
  73. package/src/views/user/ea/eagroup/edit.vue +492 -475
  74. package/src/views/user/ea/eaobj/edit.vue +153 -148
  75. package/src/views/user/ea/eaobj/list.vue +147 -135
  76. package/src/views/user/error-page/401.vue +42 -34
  77. package/src/views/user/error-page/404.vue +19 -3
  78. package/src/views/user/extend_datasource/dialog.vue +124 -116
  79. package/src/views/user/extend_datasource/edit.vue +5 -4
  80. package/src/views/user/extend_datasource/list.vue +3 -3
  81. package/src/views/user/fieldTranslation/editDialog.vue +2 -2
  82. package/src/views/user/fieldTranslation/list.vue +4 -3
  83. package/src/views/user/field_values_invisible/edit.vue +85 -83
  84. package/src/views/user/field_values_invisible/list.vue +32 -21
  85. package/src/views/user/file_type/edit.vue +3 -3
  86. package/src/views/user/file_type/list.vue +7 -4
  87. package/src/views/user/file_type/userEdit.vue +188 -188
  88. package/src/views/user/file_view_area/edit.vue +3 -3
  89. package/src/views/user/file_view_area/itemEdit.vue +168 -165
  90. package/src/views/user/file_view_area/list.vue +3 -3
  91. package/src/views/user/file_view_ins/list.vue +55 -36
  92. package/src/views/user/file_view_ins/propertiesDialog.vue +218 -218
  93. package/src/views/user/form/form_ins_list/edit.vue +421 -421
  94. package/src/views/user/form/form_template/dialog.vue +24 -17
  95. package/src/views/user/form/form_template/edit.vue +7 -4
  96. package/src/views/user/form/form_template/itemEdit.vue +3 -3
  97. package/src/views/user/form/form_template/itemList.vue +3 -3
  98. package/src/views/user/form/form_template/list.vue +5 -4
  99. package/src/views/user/form/form_template_field/dialog.vue +11 -8
  100. package/src/views/user/form/form_type/dialog.vue +134 -127
  101. package/src/views/user/form/form_type/edit.vue +4 -4
  102. package/src/views/user/form/form_type/editDialog.vue +10 -9
  103. package/src/views/user/form/form_type/list.vue +128 -118
  104. package/src/views/user/form/report_requestaccess/dialog.vue +106 -99
  105. package/src/views/user/form/report_requestaccess/edit.vue +272 -234
  106. package/src/views/user/form/report_requestaccess/list.vue +29 -18
  107. package/src/views/user/form/vform/designer.vue +164 -164
  108. package/src/views/user/form/vform/formFieldMapping.js +151 -169
  109. package/src/views/user/form/vform/out_render.vue +3 -2
  110. package/src/views/user/form/vform/render.vue +2 -2
  111. package/src/views/user/form/view/edit.vue +7 -7
  112. package/src/views/user/form/view/list.vue +2 -2
  113. package/src/views/user/home/distributor.vue +374 -118
  114. package/src/views/user/home/index.vue +1 -1
  115. package/src/views/user/language_setting/edit.vue +167 -166
  116. package/src/views/user/language_setting/list.vue +3 -3
  117. package/src/views/user/ledger_library/list.vue +2 -2
  118. package/src/views/user/ledger_library/private_list.vue +3 -3
  119. package/src/views/user/login/auth-redirect.vue +1 -1
  120. package/src/views/user/login/index.vue +1 -1
  121. package/src/views/user/login/indexMixin.js +4 -1
  122. package/src/views/user/menu/list.vue +3 -3
  123. package/src/views/user/mobile_menu/list.vue +2 -2
  124. package/src/views/user/notify_message/dialog.vue +8 -6
  125. package/src/views/user/notify_message/list.vue +4 -3
  126. package/src/views/user/notify_template/edit.vue +185 -185
  127. package/src/views/user/notify_template/list.vue +4 -4
  128. package/src/views/user/oplog/edit.vue +108 -103
  129. package/src/views/user/oplog/list.vue +3 -3
  130. package/src/views/user/outLink/form_view.vue +144 -143
  131. package/src/views/user/outLink/index.vue +7 -5
  132. package/src/views/user/outLink/view.vue +119 -117
  133. package/src/views/user/position/dialog.vue +145 -138
  134. package/src/views/user/position/edit.vue +4 -4
  135. package/src/views/user/position/list.vue +170 -160
  136. package/src/views/user/project_tag/dialog.vue +5 -5
  137. package/src/views/user/project_tag/edit.vue +3 -3
  138. package/src/views/user/project_tag/list.vue +3 -3
  139. package/src/views/user/push_setting/edit.vue +7 -4
  140. package/src/views/user/push_setting/list.vue +44 -34
  141. package/src/views/user/redirect/index.vue +4 -4
  142. package/src/views/user/role/dialog.vue +10 -7
  143. package/src/views/user/role/edit.vue +427 -427
  144. package/src/views/user/role/list.vue +125 -114
  145. package/src/views/user/sale_org/dialog.vue +3 -3
  146. package/src/views/user/sale_org/list.vue +11 -11
  147. package/src/views/user/sale_org/moveDialog.vue +2 -2
  148. package/src/views/user/sale_org_net/list.vue +9 -9
  149. package/src/views/user/system_notice/edit.vue +184 -184
  150. package/src/views/user/system_notice/list.vue +156 -145
  151. package/src/views/user/system_parameter/edit.vue +140 -137
  152. package/src/views/user/system_parameter/list.vue +131 -120
  153. package/src/views/user/user/dialog.vue +31 -24
  154. package/src/views/user/user/edit.vue +1021 -1019
  155. package/src/views/user/user/form_edit.vue +481 -483
  156. package/src/views/user/user/form_list.vue +5 -5
  157. package/src/views/user/user/info.vue +271 -256
  158. package/src/views/user/user/infoContent.vue +12 -11
  159. package/src/views/user/user/infoEdit.vue +111 -92
  160. package/src/views/user/user/inner_list.vue +1 -1
  161. package/src/views/user/user/list.vue +55 -50
  162. package/src/views/user/user/list2.vue +1 -1
  163. package/src/views/user/user/modifyPasswordDialog.vue +3 -3
  164. package/src/views/user/user/out_list.vue +1 -1
  165. package/src/views/user/wf/formCustDialog/list.vue +13 -15
  166. package/src/views/user/wf/iframe/index.vue +12 -12
  167. package/src/views/user/wf/iframe/index2.vue +2 -2
  168. package/src/views/user/wf/wf_auto_submit_data/edit.vue +1 -1
  169. package/src/views/user/wf/wf_auto_submit_data/edith.vue +1 -1
  170. package/src/views/user/wf/wf_auto_submit_data/list.vue +8 -6
  171. package/src/views/user/wf/wf_diy_attribute/edit.vue +5 -5
  172. package/src/views/user/wf/wf_manage/list.vue +5 -4
  173. package/src/views/user/wf/wf_obj_config/activiti_wf.vue +11 -10
  174. package/src/views/user/wf/wf_obj_config/dialog.vue +10 -7
  175. package/src/views/user/wf/wf_obj_config/edit.vue +7 -4
  176. package/src/views/user/wf/wf_obj_config/edit_form.vue +70 -63
  177. package/src/views/user/wf/wf_obj_config/itemEdit.vue +3 -3
  178. package/src/views/user/wf/wf_obj_config/itemEdit_form.vue +3 -3
  179. package/src/views/user/wf/wf_obj_config/list.vue +4 -4
  180. package/src/views/user/wf/wf_obj_config/list_form.vue +22 -22
  181. package/src/views/user/wf/wf_param/edit.vue +4 -4
  182. package/src/views/user/wf/wf_work_calendar/components/calendar.vue +27 -13
  183. package/src/views/user/wf/wf_work_calendar/components/calendar2.vue +25 -10
  184. package/src/views/user/wf/wf_work_calendar/configDialog.vue +8 -5
  185. package/src/views/user/wf/wf_work_calendar/date.js +10 -10
  186. package/src/views/user/wf/wf_work_calendar/list.vue +9 -4
@@ -1,427 +1,427 @@
1
- <template>
2
- <div class="detail-wrap">
3
- <el-form ref="editForm" :model="role">
4
- <div class="d-header clearfix">
5
- <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? '查看' : '新增' }}用户角色
8
- </div>
9
- <div class="fr">
10
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">重置
11
- </el-button>
12
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">保存</el-button>
13
- </div>
14
- </div>
15
- <baseTabs>
16
- <baseTabPane label="基本信息">
17
- <template #default>
18
- <table class="table-detail">
19
- <tbody>
20
- <tr>
21
- <th>
22
- <em class="f-red">*</em>
23
- 用户角色
24
- </th>
25
- <td>
26
- <el-form-item prop="name" :rules="[{ required: true, trigger: 'blur' }]" v-if="!role.systems">
27
- <el-input type="text" autocomplete="off" v-model="role.name" clearable/>
28
- </el-form-item>
29
- <template v-else>
30
- {{ role.name }}
31
- </template>
32
- </td>
33
- <th>角色编码</th>
34
- <td>
35
- <el-form-item prop="code" :rules="[{ required: false, trigger: 'blur' }]" v-if="!dataId">
36
- <el-input type="text" autocomplete="off" v-model="role.code" clearable/>
37
- </el-form-item>
38
- <template v-else>
39
- {{ role.code }}
40
- </template>
41
- </td>
42
- <th>角色描述</th>
43
- <td>
44
- <el-form-item prop="description" :rules="[{ required: false, trigger: 'blur' }]">
45
- <el-input type="text" autocomplete="off" v-model="role.description" clearable/>
46
- </el-form-item>
47
- </td>
48
- <th>是否内置</th>
49
- <td>
50
- <template v-if="role.systems">
51
-
52
- </template>
53
- <template v-else>
54
-
55
- </template>
56
- </td>
57
- </tr>
58
- <tr>
59
- <th>创建人</th>
60
- <td>{{ role.createBy }}</td>
61
- <th>创建时间</th>
62
- <td>{{ role.createDate }}</td>
63
- <th>更新人</th>
64
- <td>{{ role.modifyBy }}</td>
65
- <th>更新时间</th>
66
- <td>{{ role.modifyDate }}</td>
67
- </tr>
68
- </tbody>
69
- </table>
70
- </template>
71
- </baseTabPane>
72
- <baseTabPane label="菜单信息">
73
- <template #default>
74
- <div class="role-box">
75
- <div class="item" v-for="item in basicMenus" :key="item.id">
76
- <div class="t">
77
- {{ item.menuName }}
78
- <i class="fr" @click="$set(item, 'visibleRole', !item.visibleRole)"
79
- :class="!item.visibleRole?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
80
- </div>
81
- <div class="c" :class="{ hide: item.visibleRole }">
82
- <div v-for="subItem in item.children" :key="subItem.id">
83
- <div class="c-2nd">
84
- <el-checkbox :label="subItem.menuName" v-model="subItem.hasAuth"
85
- @change="selectAll(subItem)"></el-checkbox>
86
- </div>
87
- <div class="c-3rd">
88
- <div class="c-item" v-for="(thrItem, index3) in subItem.children" :key="thrItem.id">
89
- <div class="name">
90
- <el-checkbox :label="thrItem.menuName" v-model="thrItem.hasAuth"
91
- @change="cancelSelect(subItem, index3)"></el-checkbox>
92
- </div>
93
- <div class="c-4th">
94
- <el-checkbox
95
- v-for="(fourthItem, index4) in thrItem.children"
96
- :key="fourthItem.id"
97
- :label="fourthItem.menuName"
98
- v-model="fourthItem.hasAuth"
99
- @change="changeBtnSelect(subItem, index3, index4)"
100
- ></el-checkbox>
101
- </div>
102
- </div>
103
- </div>
104
- </div>
105
- </div>
106
- </div>
107
- <div class="item">
108
- <div class="t">
109
- 首页设置
110
- <i class="fr" @click="visibleHome = !visibleHome"
111
- :class="!visibleHome?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
112
- </div>
113
- <div class="c" :class="{ hide: visibleHome }">
114
- <div>
115
- <div class="c-3rd">
116
- <div class="c-item">
117
- <el-checkbox v-for="homeItem in homeMenus" :key="homeItem.id" :label="homeItem.menuName"
118
- v-model="homeItem.hasAuth" @change="$forceUpdate()"></el-checkbox>
119
- </div>
120
- </div>
121
- </div>
122
- </div>
123
- </div>
124
- </div>
125
- </template>
126
- </baseTabPane>
127
- <baseTabPane label="移动端菜单信息">
128
- <template #default>
129
- <div class="role-box">
130
- <div class="item" v-for="(item,index) in allMobileMenus" :key="index">
131
- <div class="t">
132
- {{ item.menuName }}
133
- <i class="fr" @click="$set(item, 'visibleRole', !item.visibleRole)"
134
- :class="!item.visibleRole?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
135
- </div>
136
- <div class="c" :class="{ hide: item.visibleRole }">
137
- <div>
138
- <div class="c-2nd" style="width: 100%">
139
- <el-checkbox v-for="(subItem,index2) in item.children" :key="index2" :label="subItem.menuName"
140
- v-model="subItem.hasAuth"
141
- @change="selectAll(subItem)"></el-checkbox>
142
- </div>
143
- </div>
144
- </div>
145
- </div>
146
- </div>
147
- </template>
148
- </baseTabPane>
149
- </baseTabs>
150
- </el-form>
151
- </div>
152
- </template>
153
-
154
- <script>
155
- export default {
156
- name: 'roleEdit',
157
- props: ['_dataId'],
158
- components: {},
159
- data() {
160
- return {
161
- tabIndex: 0,
162
- isEdit: false,
163
- dataId: '',
164
- role: {
165
- menus: [],
166
- mobileMenuIds: []
167
- },
168
- allMenus: [],
169
- allMobileMenus: [],
170
- showCompanyDialog: false,
171
- cParam: {selectMulti: false},
172
- visibleHome: false
173
- };
174
- },
175
- computed: {
176
- basicMenus() {
177
- return this.allMenus.filter(menu => menu.type != 2);
178
- },
179
- homeMenus() {
180
- return this.allMenus.filter(menu => menu.type == 2);
181
- }
182
- },
183
- created() {
184
- if (this._dataId) this.dataId = this._dataId;
185
- },
186
- mounted() {
187
- var that = this;
188
- this.getData();
189
- },
190
- methods: {
191
- getData() {
192
- if (this.dataId) {
193
- this.isEdit = true;
194
- this.$commonHttp({
195
- url: USER_PREFIX + `/role/get`,
196
- method: `post`,
197
- data: {
198
- id: this.dataId
199
- },
200
- isLoading: true,
201
- modalStrictly: true,
202
- success: res => {
203
- this.role = res.objx || {};
204
- this.initMenuData();
205
- }
206
- });
207
- } else {
208
- this.initMenuData();
209
- }
210
- },
211
- saveData() {
212
- this.$refs.editForm.$baseValidate(valid => {
213
- if (valid) {
214
- this.$baseConfirm('您确定要保存吗?').then(() => {
215
- var url = USER_PREFIX + (this.isEdit ? `/role/update` : `/role/save`);
216
- let formData = this.role;
217
- formData.menuIds = this.getMenuFormData();
218
- formData.mobileMenuIds = this.getMobileMenuFormData();
219
-
220
- this.$http({
221
- url: url,
222
- method: `post`,
223
- data: formData,
224
- isLoading: true,
225
- success: res => {
226
- this.$message({
227
- message: res.content,
228
- type: 'success',
229
- duration: 500,
230
- onClose: t => {
231
- if (this.isEdit) {
232
- this.$baseReload();
233
- } else {
234
- this.$baseReload({
235
- updateParam: {
236
- _dataId: res.objx
237
- }
238
- });
239
- }
240
- }
241
- });
242
- }
243
- });
244
- });
245
- }
246
- });
247
- },
248
- initMenuData(menus) {
249
- this.$http({
250
- url: USER_PREFIX + '/menu/getAll',
251
- method: 'POST',
252
- isLoading: true,
253
- modalStrictly: true,
254
- success: res => {
255
- let menus = res.objx || [];
256
- this.handleRoles(menus, this.role.menuIds || []);
257
- this.allMenus = menus;
258
- }
259
- });
260
- this.$http({
261
- url: USER_PREFIX + '/mobile_menu/getAll',
262
- method: 'POST',
263
- isLoading: true,
264
- modalStrictly: true,
265
- success: res => {
266
- let menus = res.objx || [];
267
- this.handleMobileRoles(menus, this.role.mobileMenuIds || []);
268
- this.allMobileMenus = menus;
269
- }
270
- });
271
- },
272
- selectAll(subItem) {
273
- //subItem.hasAuth = !subItem.hasAuth;
274
- let res = subItem.hasAuth;
275
- if (subItem.children) {
276
- subItem.children.forEach(function (thrItem) {
277
- thrItem.hasAuth = res;
278
- if (thrItem.children) {
279
- thrItem.children.forEach(function (fourthItem) {
280
- fourthItem.hasAuth = res;
281
- });
282
- }
283
- });
284
- }
285
- this.$forceUpdate();
286
- },
287
- cancelSelect(subItem, index3) {
288
- let citem = subItem.children[index3];
289
- // citem.hasAuth = !citem.hasAuth;
290
- let res = citem.hasAuth;
291
- let isCheckSubItem = false;
292
- subItem.children.forEach(function (thrItem) {
293
- if (thrItem.hasAuth) {
294
- isCheckSubItem = true;
295
- }
296
- });
297
- subItem.hasAuth = isCheckSubItem;
298
- if (citem.children) {
299
- citem.children.forEach(function (fourthItem) {
300
- fourthItem.hasAuth = res;
301
- });
302
- }
303
- this.$forceUpdate();
304
- },
305
- changeBtnSelect(subItem, index3, index4) {
306
- let citem = subItem.children[index3].children[index4];
307
- // citem.hasAuth = !citem.hasAuth;
308
- let res = citem.hasAuth;
309
- let isCheckthrItem = false;
310
- subItem.children[index3].children.forEach(function (fourthItem) {
311
- if (fourthItem.hasAuth) {
312
- isCheckthrItem = true;
313
- }
314
- });
315
-
316
- let isCheckSubItem = false;
317
- subItem.children.forEach(function (thrItem) {
318
- if (thrItem.hasAuth) {
319
- isCheckSubItem = true;
320
- }
321
- });
322
- subItem.hasAuth = isCheckSubItem;
323
- this.$forceUpdate();
324
- },
325
- getMenuFormData() {
326
- let selectIds = [];
327
- let menus = this.allMenus;
328
- menus.forEach(function (item) {
329
- if (item.type != 2 || item.hasAuth) {
330
- selectIds.push(item.id);
331
- }
332
- if (item.children) {
333
- item.children.forEach(function (subItem) {
334
- if (subItem.hasAuth) {
335
- selectIds.push(subItem.id);
336
- }
337
- if (subItem.children) {
338
- subItem.children.forEach(function (thrItem) {
339
- if (thrItem.hasAuth) {
340
- selectIds.push(thrItem.id);
341
- }
342
- if (thrItem.children) {
343
- thrItem.children.forEach(function (fourthItem) {
344
- if (fourthItem.hasAuth) {
345
- selectIds.push(fourthItem.id);
346
- }
347
- });
348
- }
349
- });
350
- }
351
- });
352
- }
353
- });
354
- return selectIds;
355
- },
356
- getMobileMenuFormData() {
357
- let selectIds = [];
358
- let menus = this.allMobileMenus;
359
- menus.forEach(function (item) {
360
- if (item.type != 2 || item.hasAuth) {
361
- selectIds.push(item.id);
362
- }
363
- if (item.children) {
364
- item.children.forEach(function (subItem) {
365
- if (subItem.hasAuth) {
366
- selectIds.push(subItem.id);
367
- }
368
- if (subItem.children) {
369
- subItem.children.forEach(function (thrItem) {
370
- if (thrItem.hasAuth) {
371
- selectIds.push(thrItem.id);
372
- }
373
- if (thrItem.children) {
374
- thrItem.children.forEach(function (fourthItem) {
375
- if (fourthItem.hasAuth) {
376
- selectIds.push(fourthItem.id);
377
- }
378
- });
379
- }
380
- });
381
- }
382
- });
383
- }
384
- });
385
- return selectIds;
386
- },
387
- handleRoles(rows, menuIds) {
388
- let newRows = [];
389
- for (let i = 0; i < rows.length; i++) {
390
- let row = rows[i];
391
- if (menuIds.includes(row.id)) {
392
- row.hasAuth = true;
393
- } else {
394
- row.hasAuth = false;
395
- }
396
- newRows.push(row);
397
- if (row.children) {
398
- let cRows = this.handleRoles(row.children, menuIds);
399
- if (cRows) {
400
- newRows = newRows.concat(cRows);
401
- }
402
- }
403
- }
404
- return newRows;
405
- },
406
- handleMobileRoles(rows, menuIds) {
407
- let newRows = [];
408
- for (let i = 0; i < rows.length; i++) {
409
- let row = rows[i];
410
- if (menuIds.includes(row.id)) {
411
- row.hasAuth = true;
412
- } else {
413
- row.hasAuth = false;
414
- }
415
- newRows.push(row);
416
- if (row.children) {
417
- let cRows = this.handleMobileRoles(row.children, menuIds);
418
- if (cRows) {
419
- newRows = newRows.concat(cRows);
420
- }
421
- }
422
- }
423
- return newRows;
424
- }
425
- }
426
- };
427
- </script>
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="role">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info"/>
7
+ {{ dataId ? $t1('查看') : $t1('新增') }} 用户角色
8
+ </div>
9
+ <div class="fr">
10
+ <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">{{$t1('重置')}}
11
+ </el-button>
12
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{$t1('保存')}}</el-button>
13
+ </div>
14
+ </div>
15
+ <baseTabs>
16
+ <baseTabPane :label="$t1('基本信息')">
17
+ <template #default>
18
+ <table class="table-detail">
19
+ <tbody>
20
+ <tr>
21
+ <th>
22
+ <em class="f-red">*</em>
23
+ 用户角色
24
+ </th>
25
+ <td>
26
+ <el-form-item prop="name" :rules="[{ required: true, trigger: 'blur' }]" v-if="!role.systems">
27
+ <el-input type="text" autocomplete="off" v-model="role.name" clearable/>
28
+ </el-form-item>
29
+ <template v-else>
30
+ {{ role.name }}
31
+ </template>
32
+ </td>
33
+ <th>角色编码</th>
34
+ <td>
35
+ <el-form-item prop="code" :rules="[{ required: false, trigger: 'blur' }]" v-if="!dataId">
36
+ <el-input type="text" autocomplete="off" v-model="role.code" clearable/>
37
+ </el-form-item>
38
+ <template v-else>
39
+ {{ role.code }}
40
+ </template>
41
+ </td>
42
+ <th>角色描述</th>
43
+ <td>
44
+ <el-form-item prop="description" :rules="[{ required: false, trigger: 'blur' }]">
45
+ <el-input type="text" autocomplete="off" v-model="role.description" clearable/>
46
+ </el-form-item>
47
+ </td>
48
+ <th>是否内置</th>
49
+ <td>
50
+ <template v-if="role.systems">
51
+
52
+ </template>
53
+ <template v-else>
54
+
55
+ </template>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <th>创建人</th>
60
+ <td>{{ role.createBy }}</td>
61
+ <th>创建时间</th>
62
+ <td>{{ role.createDate }}</td>
63
+ <th>更新人</th>
64
+ <td>{{ role.modifyBy }}</td>
65
+ <th>更新时间</th>
66
+ <td>{{ role.modifyDate }}</td>
67
+ </tr>
68
+ </tbody>
69
+ </table>
70
+ </template>
71
+ </baseTabPane>
72
+ <baseTabPane label="菜单信息">
73
+ <template #default>
74
+ <div class="role-box">
75
+ <div class="item" v-for="item in basicMenus" :key="item.id">
76
+ <div class="t">
77
+ {{ item.menuName }}
78
+ <i class="fr" @click="$set(item, 'visibleRole', !item.visibleRole)"
79
+ :class="!item.visibleRole?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
80
+ </div>
81
+ <div class="c" :class="{ hide: item.visibleRole }">
82
+ <div v-for="subItem in item.children" :key="subItem.id">
83
+ <div class="c-2nd">
84
+ <el-checkbox :label="subItem.menuName" v-model="subItem.hasAuth"
85
+ @change="selectAll(subItem)"></el-checkbox>
86
+ </div>
87
+ <div class="c-3rd">
88
+ <div class="c-item" v-for="(thrItem, index3) in subItem.children" :key="thrItem.id">
89
+ <div class="name">
90
+ <el-checkbox :label="thrItem.menuName" v-model="thrItem.hasAuth"
91
+ @change="cancelSelect(subItem, index3)"></el-checkbox>
92
+ </div>
93
+ <div class="c-4th">
94
+ <el-checkbox
95
+ v-for="(fourthItem, index4) in thrItem.children"
96
+ :key="fourthItem.id"
97
+ :label="fourthItem.menuName"
98
+ v-model="fourthItem.hasAuth"
99
+ @change="changeBtnSelect(subItem, index3, index4)"
100
+ ></el-checkbox>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ <div class="item">
108
+ <div class="t">
109
+ 首页设置
110
+ <i class="fr" @click="visibleHome = !visibleHome"
111
+ :class="!visibleHome?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
112
+ </div>
113
+ <div class="c" :class="{ hide: visibleHome }">
114
+ <div>
115
+ <div class="c-3rd">
116
+ <div class="c-item">
117
+ <el-checkbox v-for="homeItem in homeMenus" :key="homeItem.id" :label="homeItem.menuName"
118
+ v-model="homeItem.hasAuth" @change="$forceUpdate()"></el-checkbox>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </template>
126
+ </baseTabPane>
127
+ <baseTabPane label="移动端菜单信息">
128
+ <template #default>
129
+ <div class="role-box">
130
+ <div class="item" v-for="(item,index) in allMobileMenus" :key="index">
131
+ <div class="t">
132
+ {{ item.menuName }}
133
+ <i class="fr" @click="$set(item, 'visibleRole', !item.visibleRole)"
134
+ :class="!item.visibleRole?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
135
+ </div>
136
+ <div class="c" :class="{ hide: item.visibleRole }">
137
+ <div>
138
+ <div class="c-2nd" style="width: 100%">
139
+ <el-checkbox v-for="(subItem,index2) in item.children" :key="index2" :label="subItem.menuName"
140
+ v-model="subItem.hasAuth"
141
+ @change="selectAll(subItem)"></el-checkbox>
142
+ </div>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </template>
148
+ </baseTabPane>
149
+ </baseTabs>
150
+ </el-form>
151
+ </div>
152
+ </template>
153
+
154
+ <script>
155
+ export default {
156
+ name: 'roleEdit',
157
+ props: ['_dataId'],
158
+ components: {},
159
+ data() {
160
+ return {
161
+ tabIndex: 0,
162
+ isEdit: false,
163
+ dataId: '',
164
+ role: {
165
+ menus: [],
166
+ mobileMenuIds: []
167
+ },
168
+ allMenus: [],
169
+ allMobileMenus: [],
170
+ showCompanyDialog: false,
171
+ cParam: {selectMulti: false},
172
+ visibleHome: false
173
+ };
174
+ },
175
+ computed: {
176
+ basicMenus() {
177
+ return this.allMenus.filter(menu => menu.type != 2);
178
+ },
179
+ homeMenus() {
180
+ return this.allMenus.filter(menu => menu.type == 2);
181
+ }
182
+ },
183
+ created() {
184
+ if (this._dataId) this.dataId = this._dataId;
185
+ },
186
+ mounted() {
187
+ var that = this;
188
+ this.getData();
189
+ },
190
+ methods: {
191
+ getData() {
192
+ if (this.dataId) {
193
+ this.isEdit = true;
194
+ this.$commonHttp({
195
+ url: USER_PREFIX + `/role/get`,
196
+ method: `post`,
197
+ data: {
198
+ id: this.dataId
199
+ },
200
+ isLoading: true,
201
+ modalStrictly: true,
202
+ success: res => {
203
+ this.role = res.objx || {};
204
+ this.initMenuData();
205
+ }
206
+ });
207
+ } else {
208
+ this.initMenuData();
209
+ }
210
+ },
211
+ saveData() {
212
+ this.$refs.editForm.$baseValidate(valid => {
213
+ if (valid) {
214
+ this.$baseConfirm('您确定要保存吗?').then(() => {
215
+ var url = USER_PREFIX + (this.isEdit ? `/role/update` : `/role/save`);
216
+ let formData = this.role;
217
+ formData.menuIds = this.getMenuFormData();
218
+ formData.mobileMenuIds = this.getMobileMenuFormData();
219
+
220
+ this.$http({
221
+ url: url,
222
+ method: `post`,
223
+ data: formData,
224
+ isLoading: true,
225
+ success: res => {
226
+ this.$message({
227
+ message: res.content,
228
+ type: 'success',
229
+ duration: 500,
230
+ onClose: t => {
231
+ if (this.isEdit) {
232
+ this.$baseReload();
233
+ } else {
234
+ this.$baseReload({
235
+ updateParam: {
236
+ _dataId: res.objx
237
+ }
238
+ });
239
+ }
240
+ }
241
+ });
242
+ }
243
+ });
244
+ });
245
+ }
246
+ });
247
+ },
248
+ initMenuData(menus) {
249
+ this.$http({
250
+ url: USER_PREFIX + '/menu/getAll',
251
+ method: 'POST',
252
+ isLoading: true,
253
+ modalStrictly: true,
254
+ success: res => {
255
+ let menus = res.objx || [];
256
+ this.handleRoles(menus, this.role.menuIds || []);
257
+ this.allMenus = menus;
258
+ }
259
+ });
260
+ this.$http({
261
+ url: USER_PREFIX + '/mobile_menu/getAll',
262
+ method: 'POST',
263
+ isLoading: true,
264
+ modalStrictly: true,
265
+ success: res => {
266
+ let menus = res.objx || [];
267
+ this.handleMobileRoles(menus, this.role.mobileMenuIds || []);
268
+ this.allMobileMenus = menus;
269
+ }
270
+ });
271
+ },
272
+ selectAll(subItem) {
273
+ //subItem.hasAuth = !subItem.hasAuth;
274
+ let res = subItem.hasAuth;
275
+ if (subItem.children) {
276
+ subItem.children.forEach(function (thrItem) {
277
+ thrItem.hasAuth = res;
278
+ if (thrItem.children) {
279
+ thrItem.children.forEach(function (fourthItem) {
280
+ fourthItem.hasAuth = res;
281
+ });
282
+ }
283
+ });
284
+ }
285
+ this.$forceUpdate();
286
+ },
287
+ cancelSelect(subItem, index3) {
288
+ let citem = subItem.children[index3];
289
+ // citem.hasAuth = !citem.hasAuth;
290
+ let res = citem.hasAuth;
291
+ let isCheckSubItem = false;
292
+ subItem.children.forEach(function (thrItem) {
293
+ if (thrItem.hasAuth) {
294
+ isCheckSubItem = true;
295
+ }
296
+ });
297
+ subItem.hasAuth = isCheckSubItem;
298
+ if (citem.children) {
299
+ citem.children.forEach(function (fourthItem) {
300
+ fourthItem.hasAuth = res;
301
+ });
302
+ }
303
+ this.$forceUpdate();
304
+ },
305
+ changeBtnSelect(subItem, index3, index4) {
306
+ let citem = subItem.children[index3].children[index4];
307
+ // citem.hasAuth = !citem.hasAuth;
308
+ let res = citem.hasAuth;
309
+ let isCheckthrItem = false;
310
+ subItem.children[index3].children.forEach(function (fourthItem) {
311
+ if (fourthItem.hasAuth) {
312
+ isCheckthrItem = true;
313
+ }
314
+ });
315
+
316
+ let isCheckSubItem = false;
317
+ subItem.children.forEach(function (thrItem) {
318
+ if (thrItem.hasAuth) {
319
+ isCheckSubItem = true;
320
+ }
321
+ });
322
+ subItem.hasAuth = isCheckSubItem;
323
+ this.$forceUpdate();
324
+ },
325
+ getMenuFormData() {
326
+ let selectIds = [];
327
+ let menus = this.allMenus;
328
+ menus.forEach(function (item) {
329
+ if (item.type != 2 || item.hasAuth) {
330
+ selectIds.push(item.id);
331
+ }
332
+ if (item.children) {
333
+ item.children.forEach(function (subItem) {
334
+ if (subItem.hasAuth) {
335
+ selectIds.push(subItem.id);
336
+ }
337
+ if (subItem.children) {
338
+ subItem.children.forEach(function (thrItem) {
339
+ if (thrItem.hasAuth) {
340
+ selectIds.push(thrItem.id);
341
+ }
342
+ if (thrItem.children) {
343
+ thrItem.children.forEach(function (fourthItem) {
344
+ if (fourthItem.hasAuth) {
345
+ selectIds.push(fourthItem.id);
346
+ }
347
+ });
348
+ }
349
+ });
350
+ }
351
+ });
352
+ }
353
+ });
354
+ return selectIds;
355
+ },
356
+ getMobileMenuFormData() {
357
+ let selectIds = [];
358
+ let menus = this.allMobileMenus;
359
+ menus.forEach(function (item) {
360
+ if (item.type != 2 || item.hasAuth) {
361
+ selectIds.push(item.id);
362
+ }
363
+ if (item.children) {
364
+ item.children.forEach(function (subItem) {
365
+ if (subItem.hasAuth) {
366
+ selectIds.push(subItem.id);
367
+ }
368
+ if (subItem.children) {
369
+ subItem.children.forEach(function (thrItem) {
370
+ if (thrItem.hasAuth) {
371
+ selectIds.push(thrItem.id);
372
+ }
373
+ if (thrItem.children) {
374
+ thrItem.children.forEach(function (fourthItem) {
375
+ if (fourthItem.hasAuth) {
376
+ selectIds.push(fourthItem.id);
377
+ }
378
+ });
379
+ }
380
+ });
381
+ }
382
+ });
383
+ }
384
+ });
385
+ return selectIds;
386
+ },
387
+ handleRoles(rows, menuIds) {
388
+ let newRows = [];
389
+ for (let i = 0; i < rows.length; i++) {
390
+ let row = rows[i];
391
+ if (menuIds.includes(row.id)) {
392
+ row.hasAuth = true;
393
+ } else {
394
+ row.hasAuth = false;
395
+ }
396
+ newRows.push(row);
397
+ if (row.children) {
398
+ let cRows = this.handleRoles(row.children, menuIds);
399
+ if (cRows) {
400
+ newRows = newRows.concat(cRows);
401
+ }
402
+ }
403
+ }
404
+ return newRows;
405
+ },
406
+ handleMobileRoles(rows, menuIds) {
407
+ let newRows = [];
408
+ for (let i = 0; i < rows.length; i++) {
409
+ let row = rows[i];
410
+ if (menuIds.includes(row.id)) {
411
+ row.hasAuth = true;
412
+ } else {
413
+ row.hasAuth = false;
414
+ }
415
+ newRows.push(row);
416
+ if (row.children) {
417
+ let cRows = this.handleMobileRoles(row.children, menuIds);
418
+ if (cRows) {
419
+ newRows = newRows.concat(cRows);
420
+ }
421
+ }
422
+ }
423
+ return newRows;
424
+ }
425
+ }
426
+ };
427
+ </script>