cloud-web-corejs 1.0.280 → 1.1.0-dev.10

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 (193) hide show
  1. package/package.json +6 -2
  2. package/src/components/VabUpload/image-viewer.vue +442 -442
  3. package/src/components/VabUpload/index.vue +45 -3
  4. package/src/components/VabUpload/mixins.js +174 -34
  5. package/src/components/VabUpload/previewGroup.js +128 -0
  6. package/src/components/VabUpload/view.vue +248 -209
  7. package/src/components/baseTabs/mixins.js +181 -181
  8. package/src/components/bizTab/BizBillActions.vue +129 -0
  9. package/src/components/bizTab/BizTabListPage.vue +391 -0
  10. package/src/components/bizTab/README.md +378 -0
  11. package/src/components/bizTab/billTableUtil.js +48 -0
  12. package/src/components/bizTab/billValidators.js +136 -0
  13. package/src/components/bizTab/bizBillDetailMixin.js +705 -0
  14. package/src/components/bizTab/index.js +24 -0
  15. package/src/components/excelExport/exportFieldDialog.vue +23 -12
  16. package/src/components/excelExport/exportItemConfigUtil.js +30 -0
  17. package/src/components/excelExport/mixins.js +3 -3
  18. package/src/components/excelImport/index.vue +156 -156
  19. package/src/components/jsonImport/index.vue +1 -1
  20. package/src/components/langImport/index.vue +1 -1
  21. package/src/components/mobile/statusTag/mixins.js +1 -61
  22. package/src/components/mobile/wf/addTaskUserdialog.vue +23 -3
  23. package/src/components/mobile/wf/content.vue +1705 -1556
  24. package/src/components/mobile/wf/deleteTaskUserDialog.vue +22 -3
  25. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +8 -6
  26. package/src/components/mobile/wf/selectUserDialog.vue +122 -0
  27. package/src/components/mobile/wf/setCandidateDialog.vue +25 -4
  28. package/src/components/mobile/wf/urgingDialog.vue +26 -3
  29. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  30. package/src/components/obsUpload/index.vue +1 -1
  31. package/src/components/table/config.js +78 -78
  32. package/src/components/table/index.js +1276 -1276
  33. package/src/components/table/plugins/cell-area/index.js +1055 -0
  34. package/src/components/table/plugins/cell-area/index.scss +77 -0
  35. package/src/components/table/plugins/cell-area/util.js +224 -0
  36. package/src/components/table/tableForm.vue +330 -330
  37. package/src/components/table/tableFormMixin.js +318 -318
  38. package/src/components/table/vxeFilter/index.js +163 -163
  39. package/src/components/table/vxeFilter/mixin.js +316 -316
  40. package/src/components/wf/content.vue +1188 -1188
  41. package/src/components/wf/wf.js +40 -20
  42. package/src/components/wf/wfActionDropdown.vue +1 -1
  43. package/src/components/wf/wfActionItems.js +1 -1
  44. package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +528 -0
  45. package/src/components/xform/docs/2026-08 xform H5 P1 /345/256/236/347/216/260/350/247/204/346/240/274.md" +412 -0
  46. package/src/components/xform/docs/2026-08 xform H5 P2 /345/256/236/347/216/260/350/247/204/346/240/274.md" +287 -0
  47. package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +400 -0
  48. package/src/components/xform/form-designer/designer.js +51 -52
  49. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +269 -269
  50. package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +18 -2
  51. package/src/components/xform/form-designer/form-widget/container-widget/detail-temp-widget.vue +132 -0
  52. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +250 -250
  53. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +23 -2
  54. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +30 -1
  55. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +319 -320
  56. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +365 -365
  57. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +185 -185
  58. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +554 -555
  59. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +409 -409
  60. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +150 -132
  61. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +114 -114
  62. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +154 -154
  63. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +47 -1
  64. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +178 -178
  65. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -77
  66. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +6 -0
  67. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +139 -139
  68. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  69. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +106 -106
  70. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +134 -134
  71. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -2
  72. package/src/components/xform/form-designer/indexMixin.js +35 -1
  73. package/src/components/xform/form-designer/setting-panel/form-setting.vue +39 -39
  74. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +10 -10
  75. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +438 -432
  76. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +2103 -2103
  77. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +90 -0
  78. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +82 -82
  79. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +833 -846
  80. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +8 -8
  81. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +137 -137
  82. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +43 -43
  84. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +43 -43
  85. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -96
  86. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +51 -0
  87. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +42 -42
  88. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +43 -43
  89. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +158 -158
  90. package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
  91. package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
  92. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +188 -188
  93. package/src/components/xform/form-designer/setting-panel/property-editor/styleTempClass-editor.vue +51 -0
  94. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +347 -347
  95. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +12 -0
  96. package/src/components/xform/form-designer/toolbar-panel/index.vue +884 -874
  97. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +14 -0
  98. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  99. package/src/components/xform/form-designer/widget-panel/indexMixin.js +30 -6
  100. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +112 -4
  101. package/src/components/xform/form-render/container-item/data-table-mixin.js +151 -93
  102. package/src/components/xform/form-render/container-item/detail-h5-item.vue +204 -34
  103. package/src/components/xform/form-render/container-item/detail-temp-item.vue +110 -0
  104. package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
  105. package/src/components/xform/form-render/container-item/list-h5-item.vue +1913 -1699
  106. package/src/components/xform/form-render/index.vue +153 -147
  107. package/src/components/xform/form-render/indexMixin.js +35 -3
  108. package/src/components/xform/lang/en-US.js +14 -0
  109. package/src/components/xform/lang/zh-CN.js +17 -0
  110. package/src/components/xform/mixins/defaultHandle.js +707 -707
  111. package/src/components/xform/styles/h5.scss +2238 -0
  112. package/src/components/xform/utils/textMaskUtil.js +182 -179
  113. package/src/components/xform/utils/treeTableUtil.js +1292 -1265
  114. package/src/components/xform/utils/util.js +56 -11
  115. package/src/directive/append-to-body/index.js +48 -0
  116. package/src/index.js +13 -4
  117. package/src/layout/components/Sidebar/default.vue +1655 -1655
  118. package/src/layout/components/extractedCode/viewDialog.vue +7 -7
  119. package/src/router/index.js +48 -27
  120. package/src/router/modules/customer.js +71 -14
  121. package/src/store/modules/permission.js +17 -18
  122. package/src/utils/assetUrl.js +19 -0
  123. package/src/utils/pdfUtil.js +429 -429
  124. package/src/utils/resolveViewComponent.js +142 -16
  125. package/src/utils/vab.js +1283 -1279
  126. package/src/views/bd/project/branch/bd_branch/edit.vue +145 -0
  127. package/src/views/bd/project/branch/bd_branch/list.vue +72 -0
  128. package/src/views/bd/project/branch/bd_branch/menuKindDialog.vue +106 -0
  129. package/src/views/bd/project/branch/bd_branch/mixins/edit.js +189 -0
  130. package/src/views/bd/project/branch/bd_branch/mixins/list.js +124 -0
  131. package/src/views/bd/project/branch/bd_branch/mixins/menuKindDialog.js +85 -0
  132. package/src/views/bd/project/branch/form_script/list.vue +31 -0
  133. package/src/views/bd/project/branch/form_template/list.vue +30 -0
  134. package/src/views/bd/project/branch/menu_kind/list.vue +31 -0
  135. package/src/views/bd/project/common/form_script/list.vue +16 -0
  136. package/src/views/bd/project/common/form_template/list.vue +15 -0
  137. package/src/views/bd/project/common/menu_kind/list.vue +15 -0
  138. package/src/views/bd/project/core/branchContext.js +100 -0
  139. package/src/views/bd/project/core/branchPage.js +78 -0
  140. package/src/views/bd/project/core/branchPageWrap.vue +225 -0
  141. package/src/views/bd/project/core/branchScope.js +44 -0
  142. package/src/views/bd/project/core/branchSearchPage.js +285 -0
  143. package/src/views/bd/project/core/branchSelect.vue +85 -0
  144. package/src/views/bd/project/core/branchTreeBar.vue +81 -0
  145. package/src/views/bd/project/core/httpBranchPatch.js +58 -0
  146. package/src/views/bd/project/datatable/menu_kind/list.vue +15 -0
  147. package/src/views/bd/project/datatable/table_model/list.vue +15 -0
  148. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  149. package/src/views/bd/setting/form_template/edit.vue +378 -356
  150. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  151. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  152. package/src/views/bd/setting/form_template/list.vue +304 -303
  153. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  154. package/src/views/bd/setting/form_template/mixins/list.js +748 -721
  155. package/src/views/bd/setting/table_model/edit.vue +1066 -1066
  156. package/src/views/bd/setting/table_model/mixins/edit.js +1455 -1455
  157. package/src/views/bd/setting/table_model/mixins/zdDialog.js +148 -148
  158. package/src/views/demo/bizTab/bill/billConfig.js +41 -0
  159. package/src/views/demo/bizTab/bill/detail.vue +436 -0
  160. package/src/views/demo/bizTab/bill/list.vue +288 -0
  161. package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
  162. package/src/views/demo/bizTab/simple/billApi.js +123 -0
  163. package/src/views/demo/bizTab/simple/detail.vue +407 -0
  164. package/src/views/demo/bizTab/simple/list.vue +217 -0
  165. package/src/views/demo/bizTab/standalone/index.vue +121 -0
  166. package/src/views/demo/bizTab/wf/billConfig.js +44 -0
  167. package/src/views/demo/bizTab/wf/detail.vue +661 -0
  168. package/src/views/demo/bizTab/wf/list.vue +242 -0
  169. package/src/views/support/form-dialog-demo/demoPickerDialog.vue +72 -0
  170. package/src/views/support/form-dialog-demo/index.vue +537 -0
  171. package/src/views/user/file_view_ins/list.vue +970 -970
  172. package/src/views/user/form/vform/designer.vue +823 -821
  173. package/src/views/user/home/default.vue +1117 -1117
  174. package/src/views/user/home/default2.vue +1 -1
  175. package/src/views/user/home/index.vue +103 -101
  176. package/src/views/user/home/wjl/content.vue +1569 -0
  177. package/src/views/user/notify_message/dialog.vue +139 -137
  178. package/src/views/user/outLink/cc_form_view.vue +188 -0
  179. package/src/views/user/outLink/form_view.vue +202 -202
  180. package/src/views/user/outLink/index.vue +110 -110
  181. package/src/views/user/outLink/view.vue +3 -3
  182. package/src/views/user/role/edit.vue +632 -632
  183. package/src/views/user/role/list.vue +260 -260
  184. package/src/views/user/wf/iframe/index.vue +51 -51
  185. package/src/views/user/wf/iframe/index2.vue +64 -64
  186. package/src/views/user/wf/wf_manage/list.vue +1112 -1116
  187. package/src/views/user/wf/wf_manage/list2.vue +871 -875
  188. package/src/views/user/wf/wf_manage/wfContentDialog.vue +134 -131
  189. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
  190. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +0 -106
  191. package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +0 -99
  192. package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1340
  193. package/src/utils/wf.js +0 -766
@@ -1,632 +1,632 @@
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
11
- type="primary"
12
- plain
13
- class="button-sty"
14
- @click="$baseReload()"
15
- icon="el-icon-refresh-right"
16
- >
17
- {{ $t1("重置") }}
18
- </el-button>
19
- <el-button
20
- type="primary"
21
- class="button-sty"
22
- icon="el-icon-check"
23
- @click="saveData"
24
- >{{ $t1("保存") }}
25
- </el-button>
26
- </div>
27
- </div>
28
- <baseTabs>
29
- <baseTabPane :label="$t1('基本信息')">
30
- <template #default>
31
- <table class="table-detail">
32
- <tbody>
33
- <tr>
34
- <th>
35
- <em class="f-red">*</em>
36
- {{ $t1("用户角色") }}
37
- </th>
38
- <td>
39
- <el-form-item
40
- prop="name"
41
- :rules="[{ required: true, trigger: 'blur' }]"
42
- v-if="!role.systems"
43
- >
44
- <el-input
45
- type="text"
46
- autocomplete="off"
47
- v-model="role.name"
48
- clearable
49
- />
50
- </el-form-item>
51
- <template v-else>
52
- {{ role.name }}
53
- </template>
54
- </td>
55
- <th>{{ $t1("角色编码") }}</th>
56
- <td>
57
- <el-form-item
58
- prop="code"
59
- :rules="[{ required: false, trigger: 'blur' }]"
60
- v-if="!dataId"
61
- >
62
- <el-input
63
- type="text"
64
- autocomplete="off"
65
- v-model="role.code"
66
- clearable
67
- />
68
- </el-form-item>
69
- <template v-else>
70
- {{ role.code }}
71
- </template>
72
- </td>
73
- <th>{{ $t1("角色描述") }}</th>
74
- <td>
75
- <el-form-item
76
- prop="description"
77
- :rules="[{ required: false, trigger: 'blur' }]"
78
- >
79
- <el-input
80
- type="text"
81
- autocomplete="off"
82
- v-model="role.description"
83
- clearable
84
- />
85
- </el-form-item>
86
- </td>
87
- <th>{{ $t1("是否内置") }}</th>
88
- <td>
89
- <template v-if="role.systems">
90
- {{ $t1("是") }}
91
- </template>
92
- <template v-else>
93
- {{ $t1("否") }}
94
- </template>
95
- </td>
96
- </tr>
97
- <tr>
98
- <th>{{ $t1("创建人") }}</th>
99
- <td>{{ role._createBy }}</td>
100
- <th>{{ $t1("创建时间") }}</th>
101
- <td>{{ role.createDate }}</td>
102
- <th>{{ $t1("更新人") }}</th>
103
- <td>{{ role._modifyBy }}</td>
104
- <th>{{ $t1("更新时间") }}</th>
105
- <td>{{ role.modifyDate }}</td>
106
- </tr>
107
- </tbody>
108
- </table>
109
- </template>
110
- </baseTabPane>
111
- <baseTabPane :label="$t1('菜单信息')">
112
- <template #default>
113
- <div class="role-box">
114
- <div class="item" v-for="item in basicMenus" :key="item.id">
115
- <div class="t">
116
- {{ item.menuName }}
117
- <i
118
- class="fr"
119
- @click="$set(item, 'visibleRole', !item.visibleRole)"
120
- :class="
121
- !item.visibleRole
122
- ? 'el-icon-arrow-up'
123
- : 'el-icon-arrow-down'
124
- "
125
- ></i>
126
- </div>
127
- <div class="c" :class="{ hide: item.visibleRole }">
128
- <div v-for="subItem in item.children" :key="subItem.id">
129
- <div class="c-2nd">
130
- <el-checkbox
131
- :label="subItem.menuName"
132
- v-model="subItem.hasAuth"
133
- @change="selectAll(subItem)"
134
- ></el-checkbox>
135
- </div>
136
- <div class="c-3rd">
137
- <div
138
- class="c-item"
139
- v-for="(thrItem, index3) in subItem.children"
140
- :key="thrItem.id"
141
- >
142
- <div class="name">
143
- <el-checkbox
144
- :label="thrItem.menuName"
145
- v-model="thrItem.hasAuth"
146
- @change="cancelSelect(subItem, index3)"
147
- ></el-checkbox>
148
- </div>
149
- <div class="c-4th">
150
- <el-checkbox
151
- v-for="(fourthItem, index4) in thrItem.children"
152
- :key="fourthItem.id"
153
- :label="fourthItem.menuName"
154
- v-model="fourthItem.hasAuth"
155
- @change="changeBtnSelect(subItem, index3, index4)"
156
- ></el-checkbox>
157
- <authConfig
158
- v-if="thrItem.checkPermission"
159
- :formData="thrItem"
160
- ></authConfig>
161
- </div>
162
- </div>
163
- <authConfig
164
- v-if="subItem.checkPermission"
165
- :formData="subItem"
166
- ></authConfig>
167
- </div>
168
- </div>
169
- </div>
170
- </div>
171
- <div class="item">
172
- <div class="t">
173
- {{ $t1("首页设置") }}
174
- <i
175
- class="fr"
176
- @click="visibleHome = !visibleHome"
177
- :class="
178
- !visibleHome ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
179
- "
180
- ></i>
181
- </div>
182
- <div class="c" :class="{ hide: visibleHome }">
183
- <div>
184
- <div class="c-3rd">
185
- <div class="c-item">
186
- <el-checkbox
187
- v-for="homeItem in homeMenus"
188
- :key="homeItem.id"
189
- :label="homeItem.menuName"
190
- v-model="homeItem.hasAuth"
191
- @change="$forceUpdate()"
192
- ></el-checkbox>
193
- </div>
194
- </div>
195
- </div>
196
- </div>
197
- </div>
198
- </div>
199
- </template>
200
- </baseTabPane>
201
- <baseTabPane :label="$t1('移动端菜单信息')">
202
- <template #default>
203
- <div class="role-box">
204
- <div
205
- class="item"
206
- v-for="(item, index) in allMobileMenus"
207
- :key="index"
208
- >
209
- <div class="t">
210
- {{ item.menuName }}
211
- <i
212
- class="fr"
213
- @click="$set(item, 'visibleRole', !item.visibleRole)"
214
- :class="
215
- !item.visibleRole
216
- ? 'el-icon-arrow-up'
217
- : 'el-icon-arrow-down'
218
- "
219
- ></i>
220
- </div>
221
- <div class="c" :class="{ hide: item.visibleRole }">
222
- <div>
223
- <div class="c-2nd" style="width: 100%">
224
- <el-checkbox
225
- v-for="(subItem, index2) in item.children"
226
- :key="index2"
227
- :label="subItem.menuName"
228
- v-model="subItem.hasAuth"
229
- @change="selectAll(subItem)"
230
- ></el-checkbox>
231
- </div>
232
- </div>
233
- </div>
234
- </div>
235
- </div>
236
- </template>
237
- </baseTabPane>
238
- </baseTabs>
239
- </el-form>
240
- </div>
241
- </template>
242
-
243
- <script>
244
- import authConfig from "./authConfig.vue";
245
- export default {
246
- name: "roleEdit",
247
- props: ["_dataId"],
248
- components: {
249
- authConfig,
250
- },
251
- data() {
252
- return {
253
- tabIndex: 0,
254
- isEdit: false,
255
- dataId: "",
256
- role: {
257
- menus: [],
258
- mobileMenuIds: [],
259
- menuRolePermDTOs: [],
260
- menuRolePermOrgDTOs: [],
261
- },
262
- allMenus: [],
263
- allMobileMenus: [],
264
- showCompanyDialog: false,
265
- cParam: { selectMulti: false },
266
- visibleHome: false,
267
- };
268
- },
269
- computed: {
270
- basicMenus() {
271
- return this.allMenus.filter((menu) => menu.type != 2);
272
- },
273
- homeMenus() {
274
- return this.allMenus.filter((menu) => menu.type == 2);
275
- },
276
- },
277
- created() {
278
- if (this._dataId) this.dataId = this._dataId;
279
- },
280
- mounted() {
281
- var that = this;
282
- this.getData();
283
- },
284
- methods: {
285
- getData() {
286
- if (this.dataId) {
287
- this.isEdit = true;
288
- this.$commonHttp({
289
- url: USER_PREFIX + `/role/get`,
290
- method: `post`,
291
- data: {
292
- id: this.dataId,
293
- },
294
- isLoading: true,
295
- modalStrictly: true,
296
- success: (res) => {
297
- let role = res.objx || {};
298
- this.getPermissionData((rows, orgRows) => {
299
- role.menuRolePermDTOs = rows;
300
- role.menuRolePermOrgDTOs = orgRows;
301
- this.role = role;
302
- this.initMenuData();
303
- });
304
- },
305
- });
306
- } else {
307
- this.initMenuData();
308
- }
309
- },
310
- getPermissionData(callback) {
311
- this.$http({
312
- url: USER_PREFIX + `/menu_role_perm/listPerms`,
313
- method: `post`,
314
- data: {
315
- id: this.dataId,
316
- },
317
- isLoading: true,
318
- modalStrictly: true,
319
- success: (res) => {
320
- let rows = res.objx || [];
321
- this.getListPermOrgs((orgRows) => {
322
- callback(rows, orgRows);
323
- });
324
- },
325
- });
326
- },
327
- getListPermOrgs(callback) {
328
- this.$http({
329
- url: USER_PREFIX + `/menu_role_perm/listPermOrgs`,
330
- method: `post`,
331
- data: {
332
- id: this.dataId,
333
- },
334
- isLoading: true,
335
- modalStrictly: true,
336
- success: (res) => {
337
- let rows = res.objx || [];
338
- callback(rows);
339
- },
340
- });
341
- },
342
- saveData() {
343
- this.$refs.editForm.$baseValidate((valid) => {
344
- if (valid) {
345
- this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
346
- var url =
347
- USER_PREFIX + (this.isEdit ? `/role/update` : `/role/save`);
348
- let formData = this.role;
349
- formData.menuIds = this.getMenuFormData();
350
- formData.mobileMenuIds = this.getMobileMenuFormData();
351
-
352
- //处理权限数据
353
- this.handleDataBeforeSubmit();
354
-
355
- this.$http({
356
- url: url,
357
- method: `post`,
358
- data: formData,
359
- isLoading: true,
360
- success: (res) => {
361
- this.$message({
362
- message: res.content,
363
- type: "success",
364
- duration: 500,
365
- onClose: (t) => {
366
- if (this.isEdit) {
367
- this.$baseReload();
368
- } else {
369
- this.$baseReload({
370
- updateParam: {
371
- _dataId: res.objx,
372
- },
373
- });
374
- }
375
- },
376
- });
377
- },
378
- });
379
- });
380
- }
381
- });
382
- },
383
- initMenuData(menus) {
384
- this.$http({
385
- url: USER_PREFIX + "/menu/getAll",
386
- method: "POST",
387
- isLoading: true,
388
- modalStrictly: true,
389
- success: (res) => {
390
- let menus = res.objx || [];
391
- this.handleRoles(menus, this.role.menuIds || []);
392
- this.allMenus = menus;
393
- },
394
- });
395
- this.$http({
396
- url: USER_PREFIX + "/mobile_menu/getAll",
397
- method: "POST",
398
- isLoading: true,
399
- modalStrictly: true,
400
- success: (res) => {
401
- let menus = res.objx || [];
402
- this.handleMobileRoles(menus, this.role.mobileMenuIds || []);
403
- this.allMobileMenus = menus;
404
- },
405
- });
406
- },
407
- selectAll(subItem) {
408
- //subItem.hasAuth = !subItem.hasAuth;
409
- let res = subItem.hasAuth;
410
- if (subItem.children) {
411
- subItem.children.forEach(function (thrItem) {
412
- thrItem.hasAuth = res;
413
- if (thrItem.children) {
414
- thrItem.children.forEach(function (fourthItem) {
415
- fourthItem.hasAuth = res;
416
- });
417
- }
418
- });
419
- }
420
- this.$forceUpdate();
421
- },
422
- cancelSelect(subItem, index3) {
423
- let citem = subItem.children[index3];
424
- // citem.hasAuth = !citem.hasAuth;
425
- let res = citem.hasAuth;
426
- let isCheckSubItem = false;
427
- subItem.children.forEach(function (thrItem) {
428
- if (thrItem.hasAuth) {
429
- isCheckSubItem = true;
430
- }
431
- });
432
- if (citem.type !== 1) {
433
- subItem.hasAuth = isCheckSubItem;
434
- } else {
435
- if (isCheckSubItem) subItem.hasAuth = true;
436
- }
437
-
438
- if (citem.children) {
439
- citem.children.forEach(function (fourthItem) {
440
- fourthItem.hasAuth = res;
441
- });
442
- }
443
- this.$forceUpdate();
444
- },
445
- changeBtnSelect(subItem, index3, index4) {
446
- let citem = subItem.children[index3].children[index4];
447
- // citem.hasAuth = !citem.hasAuth;
448
- let res = citem.hasAuth;
449
- let isCheckthrItem = false;
450
- subItem.children[index3].children.forEach(function (fourthItem) {
451
- if (fourthItem.hasAuth) {
452
- isCheckthrItem = true;
453
- }
454
- });
455
-
456
- let isCheckSubItem = false;
457
- subItem.children.forEach(function (thrItem) {
458
- if (thrItem.hasAuth) {
459
- isCheckSubItem = true;
460
- }
461
- });
462
- subItem.hasAuth = isCheckSubItem;
463
- this.$forceUpdate();
464
- },
465
- getMenuFormData(item, menuRolePermDTOs, menuRolePermOrgDTOs) {
466
- let selectIds = [];
467
- let menus = this.allMenus;
468
- menus.forEach(function (item) {
469
- if (item.type != 2 || item.hasAuth) {
470
- selectIds.push(item.id);
471
- }
472
- if (item.children) {
473
- item.children.forEach(function (subItem) {
474
- if (subItem.hasAuth) {
475
- selectIds.push(subItem.id);
476
- }
477
- if (subItem.children) {
478
- subItem.children.forEach(function (thrItem) {
479
- if (thrItem.hasAuth) {
480
- selectIds.push(thrItem.id);
481
- }
482
- if (thrItem.children) {
483
- thrItem.children.forEach(function (fourthItem) {
484
- if (fourthItem.hasAuth) {
485
- selectIds.push(fourthItem.id);
486
- }
487
- });
488
- }
489
- });
490
- }
491
- });
492
- }
493
- });
494
- return selectIds;
495
- },
496
- handlePermission(item, menuRolePermDTOs, menuRolePermOrgDTOs) {
497
- if (item.checkPermission) {
498
- if (item.permissions) {
499
- menuRolePermDTOs.push({
500
- menus: item.id,
501
- permissions: item.permissions,
502
- });
503
-
504
- if (item.permissions === 2 && item.menuRolePermOrgDTOs.length) {
505
- menuRolePermOrgDTOs.push(...item.menuRolePermOrgDTOs);
506
- }
507
- }
508
- }
509
- },
510
- handleDataBeforeSubmit() {
511
- let menuRolePermDTOs = [];
512
- let menuRolePermOrgDTOs = [];
513
- let that = this;
514
- let menus = this.allMenus;
515
- menus.forEach(function (item) {
516
- that.handlePermission(item, menuRolePermDTOs, menuRolePermOrgDTOs);
517
- if (item.children) {
518
- item.children.forEach(function (subItem) {
519
- that.handlePermission(
520
- subItem,
521
- menuRolePermDTOs,
522
- menuRolePermOrgDTOs
523
- );
524
- if (subItem.children) {
525
- subItem.children.forEach(function (thrItem) {
526
- that.handlePermission(
527
- thrItem,
528
- menuRolePermDTOs,
529
- menuRolePermOrgDTOs
530
- );
531
- });
532
- }
533
- });
534
- }
535
- });
536
- this.role.menuRolePermDTOs = menuRolePermDTOs;
537
- this.role.menuRolePermOrgDTOs = menuRolePermOrgDTOs;
538
- },
539
- getMobileMenuFormData() {
540
- let selectIds = [];
541
- let menus = this.allMobileMenus;
542
- menus.forEach(function (item) {
543
- if (item.type != 2 || item.hasAuth) {
544
- selectIds.push(item.id);
545
- }
546
- if (item.children) {
547
- item.children.forEach(function (subItem) {
548
- if (subItem.hasAuth) {
549
- selectIds.push(subItem.id);
550
- }
551
- if (subItem.children) {
552
- subItem.children.forEach(function (thrItem) {
553
- if (thrItem.hasAuth) {
554
- selectIds.push(thrItem.id);
555
- }
556
- if (thrItem.children) {
557
- thrItem.children.forEach(function (fourthItem) {
558
- if (fourthItem.hasAuth) {
559
- selectIds.push(fourthItem.id);
560
- }
561
- });
562
- }
563
- });
564
- }
565
- });
566
- }
567
- });
568
- return selectIds;
569
- },
570
- handleRoles(rows, menuIds) {
571
- let menuRolePermDTOs = this.role.menuRolePermDTOs || [];
572
- let menuRolePermOrgDTOs = this.role.menuRolePermOrgDTOs || [];
573
- let newRows = [];
574
- for (let i = 0; i < rows.length; i++) {
575
- let row = rows[i];
576
- let permissions = null;
577
- let permOrgDTOs = [];
578
- if (row.checkPermission) {
579
- menuRolePermDTOs.find((item) => {
580
- if (item.menus == row.id) {
581
- permissions = item.permissions;
582
- return true;
583
- }
584
- return false;
585
- });
586
-
587
- menuRolePermOrgDTOs.forEach((item) => {
588
- if (item.menus == row.id) {
589
- permOrgDTOs.push(item);
590
- }
591
- });
592
- }
593
-
594
- row.permissions = permissions;
595
- row.menuRolePermOrgDTOs = permOrgDTOs;
596
- if (menuIds.includes(row.id)) {
597
- row.hasAuth = true;
598
- } else {
599
- row.hasAuth = false;
600
- }
601
- newRows.push(row);
602
- if (row.children) {
603
- let cRows = this.handleRoles(row.children, menuIds);
604
- if (cRows) {
605
- newRows = newRows.concat(cRows);
606
- }
607
- }
608
- }
609
- return newRows;
610
- },
611
- handleMobileRoles(rows, menuIds) {
612
- let newRows = [];
613
- for (let i = 0; i < rows.length; i++) {
614
- let row = rows[i];
615
- if (menuIds.includes(row.id)) {
616
- row.hasAuth = true;
617
- } else {
618
- row.hasAuth = false;
619
- }
620
- newRows.push(row);
621
- if (row.children) {
622
- let cRows = this.handleMobileRoles(row.children, menuIds);
623
- if (cRows) {
624
- newRows = newRows.concat(cRows);
625
- }
626
- }
627
- }
628
- return newRows;
629
- },
630
- },
631
- };
632
- </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
11
+ type="primary"
12
+ plain
13
+ class="button-sty"
14
+ @click="$baseReload()"
15
+ icon="el-icon-refresh-right"
16
+ >
17
+ {{ $t1("重置") }}
18
+ </el-button>
19
+ <el-button
20
+ type="primary"
21
+ class="button-sty"
22
+ icon="el-icon-check"
23
+ @click="saveData"
24
+ >{{ $t1("保存") }}
25
+ </el-button>
26
+ </div>
27
+ </div>
28
+ <baseTabs>
29
+ <baseTabPane :label="$t1('基本信息')">
30
+ <template #default>
31
+ <table class="table-detail">
32
+ <tbody>
33
+ <tr>
34
+ <th>
35
+ <em class="f-red">*</em>
36
+ {{ $t1("用户角色") }}
37
+ </th>
38
+ <td>
39
+ <el-form-item
40
+ prop="name"
41
+ :rules="[{ required: true, trigger: 'blur' }]"
42
+ v-if="!role.systems"
43
+ >
44
+ <el-input
45
+ type="text"
46
+ autocomplete="off"
47
+ v-model="role.name"
48
+ clearable
49
+ />
50
+ </el-form-item>
51
+ <template v-else>
52
+ {{ role.name }}
53
+ </template>
54
+ </td>
55
+ <th>{{ $t1("角色编码") }}</th>
56
+ <td>
57
+ <el-form-item
58
+ prop="code"
59
+ :rules="[{ required: false, trigger: 'blur' }]"
60
+ v-if="!dataId"
61
+ >
62
+ <el-input
63
+ type="text"
64
+ autocomplete="off"
65
+ v-model="role.code"
66
+ clearable
67
+ />
68
+ </el-form-item>
69
+ <template v-else>
70
+ {{ role.code }}
71
+ </template>
72
+ </td>
73
+ <th>{{ $t1("角色描述") }}</th>
74
+ <td>
75
+ <el-form-item
76
+ prop="description"
77
+ :rules="[{ required: false, trigger: 'blur' }]"
78
+ >
79
+ <el-input
80
+ type="text"
81
+ autocomplete="off"
82
+ v-model="role.description"
83
+ clearable
84
+ />
85
+ </el-form-item>
86
+ </td>
87
+ <th>{{ $t1("是否内置") }}</th>
88
+ <td>
89
+ <template v-if="role.systems">
90
+ {{ $t1("是") }}
91
+ </template>
92
+ <template v-else>
93
+ {{ $t1("否") }}
94
+ </template>
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <th>{{ $t1("创建人") }}</th>
99
+ <td>{{ role._createBy }}</td>
100
+ <th>{{ $t1("创建时间") }}</th>
101
+ <td>{{ role.createDate }}</td>
102
+ <th>{{ $t1("更新人") }}</th>
103
+ <td>{{ role._modifyBy }}</td>
104
+ <th>{{ $t1("更新时间") }}</th>
105
+ <td>{{ role.modifyDate }}</td>
106
+ </tr>
107
+ </tbody>
108
+ </table>
109
+ </template>
110
+ </baseTabPane>
111
+ <baseTabPane :label="$t1('菜单信息')">
112
+ <template #default>
113
+ <div class="role-box">
114
+ <div class="item" v-for="item in basicMenus" :key="item.id">
115
+ <div class="t">
116
+ {{ item.menuName }}
117
+ <i
118
+ class="fr"
119
+ @click="$set(item, 'visibleRole', !item.visibleRole)"
120
+ :class="
121
+ !item.visibleRole
122
+ ? 'el-icon-arrow-up'
123
+ : 'el-icon-arrow-down'
124
+ "
125
+ ></i>
126
+ </div>
127
+ <div class="c" :class="{ hide: item.visibleRole }">
128
+ <div v-for="subItem in item.children" :key="subItem.id">
129
+ <div class="c-2nd">
130
+ <el-checkbox
131
+ :label="subItem.menuName"
132
+ v-model="subItem.hasAuth"
133
+ @change="selectAll(subItem)"
134
+ ></el-checkbox>
135
+ </div>
136
+ <div class="c-3rd">
137
+ <div
138
+ class="c-item"
139
+ v-for="(thrItem, index3) in subItem.children"
140
+ :key="thrItem.id"
141
+ >
142
+ <div class="name">
143
+ <el-checkbox
144
+ :label="thrItem.menuName"
145
+ v-model="thrItem.hasAuth"
146
+ @change="cancelSelect(subItem, index3)"
147
+ ></el-checkbox>
148
+ </div>
149
+ <div class="c-4th">
150
+ <el-checkbox
151
+ v-for="(fourthItem, index4) in thrItem.children"
152
+ :key="fourthItem.id"
153
+ :label="fourthItem.menuName"
154
+ v-model="fourthItem.hasAuth"
155
+ @change="changeBtnSelect(subItem, index3, index4)"
156
+ ></el-checkbox>
157
+ <authConfig
158
+ v-if="thrItem.checkPermission"
159
+ :formData="thrItem"
160
+ ></authConfig>
161
+ </div>
162
+ </div>
163
+ <authConfig
164
+ v-if="subItem.checkPermission"
165
+ :formData="subItem"
166
+ ></authConfig>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ <div class="item">
172
+ <div class="t">
173
+ {{ $t1("首页设置") }}
174
+ <i
175
+ class="fr"
176
+ @click="visibleHome = !visibleHome"
177
+ :class="
178
+ !visibleHome ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
179
+ "
180
+ ></i>
181
+ </div>
182
+ <div class="c" :class="{ hide: visibleHome }">
183
+ <div>
184
+ <div class="c-3rd">
185
+ <div class="c-item">
186
+ <el-checkbox
187
+ v-for="homeItem in homeMenus"
188
+ :key="homeItem.id"
189
+ :label="homeItem.menuName"
190
+ v-model="homeItem.hasAuth"
191
+ @change="$forceUpdate()"
192
+ ></el-checkbox>
193
+ </div>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </template>
200
+ </baseTabPane>
201
+ <baseTabPane :label="$t1('移动端菜单信息')">
202
+ <template #default>
203
+ <div class="role-box">
204
+ <div
205
+ class="item"
206
+ v-for="(item, index) in allMobileMenus"
207
+ :key="index"
208
+ >
209
+ <div class="t">
210
+ {{ item.menuName }}
211
+ <i
212
+ class="fr"
213
+ @click="$set(item, 'visibleRole', !item.visibleRole)"
214
+ :class="
215
+ !item.visibleRole
216
+ ? 'el-icon-arrow-up'
217
+ : 'el-icon-arrow-down'
218
+ "
219
+ ></i>
220
+ </div>
221
+ <div class="c" :class="{ hide: item.visibleRole }">
222
+ <div>
223
+ <div class="c-2nd" style="width: 100%">
224
+ <el-checkbox
225
+ v-for="(subItem, index2) in item.children"
226
+ :key="index2"
227
+ :label="subItem.menuName"
228
+ v-model="subItem.hasAuth"
229
+ @change="selectAll(subItem)"
230
+ ></el-checkbox>
231
+ </div>
232
+ </div>
233
+ </div>
234
+ </div>
235
+ </div>
236
+ </template>
237
+ </baseTabPane>
238
+ </baseTabs>
239
+ </el-form>
240
+ </div>
241
+ </template>
242
+
243
+ <script>
244
+ import authConfig from "./authConfig.vue";
245
+ export default {
246
+ name: "roleEdit",
247
+ props: ["_dataId"],
248
+ components: {
249
+ authConfig,
250
+ },
251
+ data() {
252
+ return {
253
+ tabIndex: 0,
254
+ isEdit: false,
255
+ dataId: "",
256
+ role: {
257
+ menus: [],
258
+ mobileMenuIds: [],
259
+ menuRolePermDTOs: [],
260
+ menuRolePermOrgDTOs: [],
261
+ },
262
+ allMenus: [],
263
+ allMobileMenus: [],
264
+ showCompanyDialog: false,
265
+ cParam: { selectMulti: false },
266
+ visibleHome: false,
267
+ };
268
+ },
269
+ computed: {
270
+ basicMenus() {
271
+ return this.allMenus.filter((menu) => menu.type != 2);
272
+ },
273
+ homeMenus() {
274
+ return this.allMenus.filter((menu) => menu.type == 2);
275
+ },
276
+ },
277
+ created() {
278
+ if (this._dataId) this.dataId = this._dataId;
279
+ },
280
+ mounted() {
281
+ var that = this;
282
+ this.getData();
283
+ },
284
+ methods: {
285
+ getData() {
286
+ if (this.dataId) {
287
+ this.isEdit = true;
288
+ this.$commonHttp({
289
+ url: USER_PREFIX + `/role/get`,
290
+ method: `post`,
291
+ data: {
292
+ id: this.dataId,
293
+ },
294
+ isLoading: true,
295
+ modalStrictly: true,
296
+ success: (res) => {
297
+ let role = res.objx || {};
298
+ this.getPermissionData((rows, orgRows) => {
299
+ role.menuRolePermDTOs = rows;
300
+ role.menuRolePermOrgDTOs = orgRows;
301
+ this.role = role;
302
+ this.initMenuData();
303
+ });
304
+ },
305
+ });
306
+ } else {
307
+ this.initMenuData();
308
+ }
309
+ },
310
+ getPermissionData(callback) {
311
+ this.$http({
312
+ url: USER_PREFIX + `/menu_role_perm/listPerms`,
313
+ method: `post`,
314
+ data: {
315
+ id: this.dataId,
316
+ },
317
+ isLoading: true,
318
+ modalStrictly: true,
319
+ success: (res) => {
320
+ let rows = res.objx || [];
321
+ this.getListPermOrgs((orgRows) => {
322
+ callback(rows, orgRows);
323
+ });
324
+ },
325
+ });
326
+ },
327
+ getListPermOrgs(callback) {
328
+ this.$http({
329
+ url: USER_PREFIX + `/menu_role_perm/listPermOrgs`,
330
+ method: `post`,
331
+ data: {
332
+ id: this.dataId,
333
+ },
334
+ isLoading: true,
335
+ modalStrictly: true,
336
+ success: (res) => {
337
+ let rows = res.objx || [];
338
+ callback(rows);
339
+ },
340
+ });
341
+ },
342
+ saveData() {
343
+ this.$refs.editForm.$baseValidate((valid) => {
344
+ if (valid) {
345
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
346
+ var url =
347
+ USER_PREFIX + (this.isEdit ? `/role/update` : `/role/save`);
348
+ let formData = this.role;
349
+ formData.menuIds = this.getMenuFormData();
350
+ formData.mobileMenuIds = this.getMobileMenuFormData();
351
+
352
+ //处理权限数据
353
+ this.handleDataBeforeSubmit();
354
+
355
+ this.$http({
356
+ url: url,
357
+ method: `post`,
358
+ data: formData,
359
+ isLoading: true,
360
+ success: (res) => {
361
+ this.$message({
362
+ message: res.content,
363
+ type: "success",
364
+ duration: 500,
365
+ onClose: (t) => {
366
+ if (this.isEdit) {
367
+ this.$baseReload();
368
+ } else {
369
+ this.$baseReload({
370
+ updateParam: {
371
+ _dataId: res.objx,
372
+ },
373
+ });
374
+ }
375
+ },
376
+ });
377
+ },
378
+ });
379
+ });
380
+ }
381
+ });
382
+ },
383
+ initMenuData(menus) {
384
+ this.$http({
385
+ url: USER_PREFIX + "/menu/getAll",
386
+ method: "POST",
387
+ isLoading: true,
388
+ modalStrictly: true,
389
+ success: (res) => {
390
+ let menus = res.objx || [];
391
+ this.handleRoles(menus, this.role.menuIds || []);
392
+ this.allMenus = menus;
393
+ },
394
+ });
395
+ this.$http({
396
+ url: USER_PREFIX + "/mobile_menu/getAll",
397
+ method: "POST",
398
+ isLoading: true,
399
+ modalStrictly: true,
400
+ success: (res) => {
401
+ let menus = res.objx || [];
402
+ this.handleMobileRoles(menus, this.role.mobileMenuIds || []);
403
+ this.allMobileMenus = menus;
404
+ },
405
+ });
406
+ },
407
+ selectAll(subItem) {
408
+ //subItem.hasAuth = !subItem.hasAuth;
409
+ let res = subItem.hasAuth;
410
+ if (subItem.children) {
411
+ subItem.children.forEach(function (thrItem) {
412
+ thrItem.hasAuth = res;
413
+ if (thrItem.children) {
414
+ thrItem.children.forEach(function (fourthItem) {
415
+ fourthItem.hasAuth = res;
416
+ });
417
+ }
418
+ });
419
+ }
420
+ this.$forceUpdate();
421
+ },
422
+ cancelSelect(subItem, index3) {
423
+ let citem = subItem.children[index3];
424
+ // citem.hasAuth = !citem.hasAuth;
425
+ let res = citem.hasAuth;
426
+ let isCheckSubItem = false;
427
+ subItem.children.forEach(function (thrItem) {
428
+ if (thrItem.hasAuth) {
429
+ isCheckSubItem = true;
430
+ }
431
+ });
432
+ if (citem.type !== 1) {
433
+ subItem.hasAuth = isCheckSubItem;
434
+ } else {
435
+ if (isCheckSubItem) subItem.hasAuth = true;
436
+ }
437
+
438
+ if (citem.children) {
439
+ citem.children.forEach(function (fourthItem) {
440
+ fourthItem.hasAuth = res;
441
+ });
442
+ }
443
+ this.$forceUpdate();
444
+ },
445
+ changeBtnSelect(subItem, index3, index4) {
446
+ let citem = subItem.children[index3].children[index4];
447
+ // citem.hasAuth = !citem.hasAuth;
448
+ let res = citem.hasAuth;
449
+ let isCheckthrItem = false;
450
+ subItem.children[index3].children.forEach(function (fourthItem) {
451
+ if (fourthItem.hasAuth) {
452
+ isCheckthrItem = true;
453
+ }
454
+ });
455
+
456
+ let isCheckSubItem = false;
457
+ subItem.children.forEach(function (thrItem) {
458
+ if (thrItem.hasAuth) {
459
+ isCheckSubItem = true;
460
+ }
461
+ });
462
+ subItem.hasAuth = isCheckSubItem;
463
+ this.$forceUpdate();
464
+ },
465
+ getMenuFormData(item, menuRolePermDTOs, menuRolePermOrgDTOs) {
466
+ let selectIds = [];
467
+ let menus = this.allMenus;
468
+ menus.forEach(function (item) {
469
+ if (item.type != 2 || item.hasAuth) {
470
+ selectIds.push(item.id);
471
+ }
472
+ if (item.children) {
473
+ item.children.forEach(function (subItem) {
474
+ if (subItem.hasAuth) {
475
+ selectIds.push(subItem.id);
476
+ }
477
+ if (subItem.children) {
478
+ subItem.children.forEach(function (thrItem) {
479
+ if (thrItem.hasAuth) {
480
+ selectIds.push(thrItem.id);
481
+ }
482
+ if (thrItem.children) {
483
+ thrItem.children.forEach(function (fourthItem) {
484
+ if (fourthItem.hasAuth) {
485
+ selectIds.push(fourthItem.id);
486
+ }
487
+ });
488
+ }
489
+ });
490
+ }
491
+ });
492
+ }
493
+ });
494
+ return selectIds;
495
+ },
496
+ handlePermission(item, menuRolePermDTOs, menuRolePermOrgDTOs) {
497
+ if (item.checkPermission) {
498
+ if (item.permissions) {
499
+ menuRolePermDTOs.push({
500
+ menus: item.id,
501
+ permissions: item.permissions,
502
+ });
503
+
504
+ if (item.permissions === 2 && item.menuRolePermOrgDTOs.length) {
505
+ menuRolePermOrgDTOs.push(...item.menuRolePermOrgDTOs);
506
+ }
507
+ }
508
+ }
509
+ },
510
+ handleDataBeforeSubmit() {
511
+ let menuRolePermDTOs = [];
512
+ let menuRolePermOrgDTOs = [];
513
+ let that = this;
514
+ let menus = this.allMenus;
515
+ menus.forEach(function (item) {
516
+ that.handlePermission(item, menuRolePermDTOs, menuRolePermOrgDTOs);
517
+ if (item.children) {
518
+ item.children.forEach(function (subItem) {
519
+ that.handlePermission(
520
+ subItem,
521
+ menuRolePermDTOs,
522
+ menuRolePermOrgDTOs
523
+ );
524
+ if (subItem.children) {
525
+ subItem.children.forEach(function (thrItem) {
526
+ that.handlePermission(
527
+ thrItem,
528
+ menuRolePermDTOs,
529
+ menuRolePermOrgDTOs
530
+ );
531
+ });
532
+ }
533
+ });
534
+ }
535
+ });
536
+ this.role.menuRolePermDTOs = menuRolePermDTOs;
537
+ this.role.menuRolePermOrgDTOs = menuRolePermOrgDTOs;
538
+ },
539
+ getMobileMenuFormData() {
540
+ let selectIds = [];
541
+ let menus = this.allMobileMenus;
542
+ menus.forEach(function (item) {
543
+ if (item.type != 2 || item.hasAuth) {
544
+ selectIds.push(item.id);
545
+ }
546
+ if (item.children) {
547
+ item.children.forEach(function (subItem) {
548
+ if (subItem.hasAuth) {
549
+ selectIds.push(subItem.id);
550
+ }
551
+ if (subItem.children) {
552
+ subItem.children.forEach(function (thrItem) {
553
+ if (thrItem.hasAuth) {
554
+ selectIds.push(thrItem.id);
555
+ }
556
+ if (thrItem.children) {
557
+ thrItem.children.forEach(function (fourthItem) {
558
+ if (fourthItem.hasAuth) {
559
+ selectIds.push(fourthItem.id);
560
+ }
561
+ });
562
+ }
563
+ });
564
+ }
565
+ });
566
+ }
567
+ });
568
+ return selectIds;
569
+ },
570
+ handleRoles(rows, menuIds) {
571
+ let menuRolePermDTOs = this.role.menuRolePermDTOs || [];
572
+ let menuRolePermOrgDTOs = this.role.menuRolePermOrgDTOs || [];
573
+ let newRows = [];
574
+ for (let i = 0; i < rows.length; i++) {
575
+ let row = rows[i];
576
+ let permissions = null;
577
+ let permOrgDTOs = [];
578
+ if (row.checkPermission) {
579
+ menuRolePermDTOs.find((item) => {
580
+ if (item.menus == row.id) {
581
+ permissions = item.permissions;
582
+ return true;
583
+ }
584
+ return false;
585
+ });
586
+
587
+ menuRolePermOrgDTOs.forEach((item) => {
588
+ if (item.menus == row.id) {
589
+ permOrgDTOs.push(item);
590
+ }
591
+ });
592
+ }
593
+
594
+ row.permissions = permissions;
595
+ row.menuRolePermOrgDTOs = permOrgDTOs;
596
+ if (menuIds.includes(row.id)) {
597
+ row.hasAuth = true;
598
+ } else {
599
+ row.hasAuth = false;
600
+ }
601
+ newRows.push(row);
602
+ if (row.children) {
603
+ let cRows = this.handleRoles(row.children, menuIds);
604
+ if (cRows) {
605
+ newRows = newRows.concat(cRows);
606
+ }
607
+ }
608
+ }
609
+ return newRows;
610
+ },
611
+ handleMobileRoles(rows, menuIds) {
612
+ let newRows = [];
613
+ for (let i = 0; i < rows.length; i++) {
614
+ let row = rows[i];
615
+ if (menuIds.includes(row.id)) {
616
+ row.hasAuth = true;
617
+ } else {
618
+ row.hasAuth = false;
619
+ }
620
+ newRows.push(row);
621
+ if (row.children) {
622
+ let cRows = this.handleMobileRoles(row.children, menuIds);
623
+ if (cRows) {
624
+ newRows = newRows.concat(cRows);
625
+ }
626
+ }
627
+ }
628
+ return newRows;
629
+ },
630
+ },
631
+ };
632
+ </script>