cloud-web-corejs 1.0.258 → 1.0.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +32 -25
- package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
- package/src/components/VabUpload/index.js +22 -2
- package/src/components/VabUpload/index.vue +242 -231
- package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
- package/src/components/VabUpload/mixins.js +1971 -1829
- package/src/components/VabUpload/privateProfileDialog.vue +2 -2
- package/src/components/baseArea/index.vue +1628 -0
- package/src/components/baseInputExport/mixins.js +48 -31
- package/src/components/baseInputNumber/index.vue +9 -9
- package/src/components/baseTabs/index.vue +16 -8
- package/src/components/code-editor/async.js +29 -0
- package/src/components/code-editor/index.vue +93 -4
- package/src/components/errorMsg/index.js +10 -9
- package/src/components/errorMsg/mixins.js +25 -23
- package/src/components/excelExport/exportFieldDialog.vue +40 -18
- package/src/components/excelExport/index.js +62 -3
- package/src/components/excelExport/index.vue +2 -1
- package/src/components/excelExport/mixins.js +496 -340
- package/src/components/excelImport/index.js +69 -7
- package/src/components/excelImport/mixins.js +841 -9
- package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
- package/src/components/fileLibrary/fileHistoryDialog.vue +1 -1
- package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -298
- package/src/components/fileLibrary/fileObjAuthEdit.vue +1 -1
- package/src/components/fileLibrary/filterDialog.vue +1 -1
- package/src/components/fileLibrary/index.vue +1109 -1110
- package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
- package/src/components/fileLibrary/propertiesDialog.vue +190 -190
- package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
- package/src/components/formOplog/mixins.js +85 -80
- package/src/components/hiprint/view/design/index.vue +7 -2
- package/src/components/jsonImport/exportUtil.js +106 -0
- package/src/components/jsonImport/index.js +75 -50
- package/src/components/jsonImport/mixins.js +350 -348
- package/src/components/langImport/mixins.js +502 -500
- package/src/components/micro-view-host/contract.js +66 -0
- package/src/components/micro-view-host/index.vue +148 -0
- package/src/components/mobile/file/index.vue +10 -0
- package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +51 -47
- package/src/components/obsUpload/index.vue +234 -231
- package/src/components/obsUpload/mixins.js +1542 -1476
- package/src/components/onlineTalk/talkUserDialog.vue +1 -1
- package/src/components/table/CellSlot.vue +12 -10
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +1208 -1
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +38 -40
- package/src/components/table/vxeFilter/index.js +153 -2
- package/src/components/table/vxeFilter/mixin.js +305 -3
- package/src/components/tempStorage/tempStorageDialog.vue +1 -1
- package/src/components/vb-tabs/x-tabs.vue +10 -5
- package/src/components/wf/addTaskUserdialog.vue +1 -1
- package/src/components/wf/mixins/setCandidateDialog.js +217 -217
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
- package/src/components/wf/wf.js +2224 -2203
- package/src/components/wf/wfUtil.js +2 -1
- package/src/components/xform/docs/2026-08 /345/210/227/350/241/250/345/257/274/345/207/272/350/204/261/346/225/217/345/210/227/345/211/224/351/231/244/350/220/275/345/234/260/346/226/207/346/241/243.md" +173 -0
- package/src/components/xform/form-designer/designer.js +1 -0
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +110 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +282 -1
- package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -0
- package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +119 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +14 -0
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -73
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +451 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +157 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/utc-transform-mixin.js +75 -0
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +112 -0
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +149 -0
- package/src/components/xform/form-designer/form-widget/indexMixin.js +179 -1
- package/src/components/xform/form-designer/indexMixin.js +823 -1
- package/src/components/xform/form-designer/refMixinDesign.js +27 -1
- package/src/components/xform/form-designer/setting-panel/action-button-config-dialog.vue +241 -0
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +601 -0
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +6 -0
- package/src/components/xform/form-designer/setting-panel/index.vue +314 -309
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +324 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +8 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +8 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +25 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +20 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +199 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-baseAttachment/baseAttachment-fileTypes-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +157 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +55 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/vabUpload-fileTypes-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesEditorMixin.js +116 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/utcTransformEnabled-editor.vue +19 -0
- package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +186 -0
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +566 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
- package/src/components/xform/form-render/compareDelList.vue +83 -0
- package/src/components/xform/form-render/compareView.vue +76 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +378 -1
- package/src/components/xform/form-render/container-item/data-table-mixin.js +35 -0
- package/src/components/xform/form-render/container-item/detail-item.vue +41 -0
- package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +416 -0
- package/src/components/xform/form-render/container-item/list-h5-item.vue +12 -0
- package/src/components/xform/form-render/dynamicDialogRender.js +195 -1
- package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
- package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
- package/src/components/xform/form-render/refMixin.js +29 -1
- package/src/components/xform/mixins/scriptHttp.js +172 -1
- package/src/components/xform/utils/dynamicSchemaUtil.js +361 -0
- package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
- package/src/components/xform/utils/textMaskUtil.js +179 -0
- package/src/components/xform/utils/treeTableUtil.js +1265 -0
- package/src/components/xform/utils/util.js +1 -0
- package/src/components/xform/utils/validators.js +133 -1
- package/src/directive/LimitNumber/index.js +143 -124
- package/src/microRouter/index.js +447 -0
- package/src/mixins/tableTree/index.js +77 -14
- package/src/permission.js +132 -107
- package/src/public-path.js +38 -0
- package/src/router/index.js +3 -3
- package/src/store/modules/micro.js +57 -0
- package/src/store/modules/permission.js +535 -371
- package/src/store/modules/tagsView.js +38 -21
- package/src/store/modules/user.js +409 -370
- package/src/utils/aes.js +9 -3
- package/src/utils/auth.js +1 -1
- package/src/utils/componentDialog.js +162 -40
- package/src/utils/global.js +35 -34
- package/src/utils/index.js +579 -579
- package/src/utils/keepAlive.js +8 -4
- package/src/utils/lazyPlugin.js +66 -0
- package/src/utils/menuAdapter.js +277 -0
- package/src/utils/repeatOpen.js +48 -0
- package/src/utils/request.js +417 -395
- package/src/utils/resolveViewComponent.js +203 -0
- package/src/utils/vab.js +14 -3
- package/src/utils/validate.js +104 -106
- package/src/views/bd/setting/bd_attach_setting/dialog.vue +1 -1
- package/src/views/bd/setting/bd_attach_setting/list.vue +1 -1
- package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
- package/src/views/bd/setting/bd_company_env/list.vue +1 -1
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +488 -489
- package/src/views/bd/setting/form_import_log/list.vue +1 -1
- package/src/views/bd/setting/form_script/dialog.vue +1 -1
- package/src/views/bd/setting/form_script/form_list.vue +174 -166
- package/src/views/bd/setting/form_script/list.vue +1 -1
- package/src/views/bd/setting/form_script/list1.vue +1 -1
- package/src/views/bd/setting/form_script/mixins/form_list.js +330 -322
- package/src/views/bd/setting/form_template/dialog.vue +1 -1
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +172 -171
- package/src/views/bd/setting/form_template/ftHistoryDialog.vue +1 -1
- package/src/views/bd/setting/form_template/itemList.vue +1 -1
- package/src/views/bd/setting/form_template/list.vue +3 -3
- package/src/views/bd/setting/form_template/mixins/edit.js +3 -3
- package/src/views/bd/setting/form_template/mixins/list.js +3 -3
- package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
- package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -3
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -254
- package/src/views/bd/setting/form_template/wf_list.vue +3 -3
- package/src/views/bd/setting/logic_param/edit.vue +20 -20
- package/src/views/bd/setting/logic_param/list.vue +1 -1
- package/src/views/bd/setting/menu_kind/dialog.vue +1 -1
- package/src/views/bd/setting/menu_kind/list.vue +1 -1
- package/src/views/bd/setting/push_data/list.vue +1 -1
- package/src/views/bd/setting/push_data_h/list.vue +1 -1
- package/src/views/bd/setting/request_async_setting/list.vue +1 -1
- package/src/views/bd/setting/request_setting/list.vue +1 -1
- package/src/views/bd/setting/table_model/dialog.vue +1 -1
- package/src/views/bd/setting/table_model/list.vue +1 -1
- package/src/views/bd/setting/table_model/zdDialog.vue +1 -1
- package/src/views/user/access_log/list.vue +1 -1
- package/src/views/user/access_log/list2.vue +1 -1
- package/src/views/user/api_request/list.vue +1 -1
- package/src/views/user/area/dialog.vue +1 -1
- package/src/views/user/area/list.vue +1 -1
- package/src/views/user/bill_setting/list.vue +1 -1
- package/src/views/user/bill_setting/userDialog.vue +1 -1
- package/src/views/user/code_rules/list.vue +1 -1
- package/src/views/user/commMenu/index.vue +2 -2
- package/src/views/user/common_attribute/list.vue +2 -2
- package/src/views/user/common_script/list.vue +1 -1
- package/src/views/user/company_info/dialog.vue +1 -1
- package/src/views/user/country/dialog.vue +1 -1
- package/src/views/user/country/list.vue +1 -1
- package/src/views/user/data_type_setting/dialog.vue +1 -1
- package/src/views/user/extend_datasource/dialog.vue +4 -1
- package/src/views/user/extend_datasource/edit.vue +2 -1
- package/src/views/user/extend_datasource/list.vue +4 -1
- package/src/views/user/fieldTranslation/list.vue +1 -1
- package/src/views/user/field_values_invisible/list.vue +1 -1
- package/src/views/user/file_type/list.vue +1 -1
- package/src/views/user/file_view_area/list.vue +1 -1
- package/src/views/user/file_view_ins/list.vue +22 -1
- package/src/views/user/form/view/list.vue +64 -1
- package/src/views/user/groups/dialog.vue +1 -1
- package/src/views/user/groups/list.vue +1 -1
- package/src/views/user/home/default.vue +2 -2
- package/src/views/user/home/default2.vue +1158 -1148
- package/src/views/user/home/index.vue +3 -10
- package/src/views/user/lang_tag/dialog.vue +1 -1
- package/src/views/user/lang_tag/list.vue +1 -1
- package/src/views/user/language_setting/list.vue +1 -1
- package/src/views/user/login/default.vue +0 -8
- package/src/views/user/login/indexMixin.js +547 -556
- package/src/views/user/menu/list.vue +25 -2
- package/src/views/user/menuFallback/index.vue +123 -0
- package/src/views/user/mobile_menu/list.vue +1 -1
- package/src/views/user/notify_message/dialog.vue +22 -1
- package/src/views/user/notify_message/list.vue +1 -1
- package/src/views/user/notify_template/list.vue +1 -1
- package/src/views/user/notify_template/list2.vue +1 -1
- package/src/views/user/oplog/list.vue +1 -1
- package/src/views/user/outLink/form_view.vue +5 -14
- package/src/views/user/outLink/index.vue +6 -1
- package/src/views/user/outLink/view.vue +5 -13
- package/src/views/user/position/dialog.vue +1 -1
- package/src/views/user/position/list.vue +1 -1
- package/src/views/user/project_tag/dialog.vue +1 -1
- package/src/views/user/project_tag/list.vue +1 -1
- package/src/views/user/push_setting/list.vue +1 -1
- package/src/views/user/request_setting/list.vue +1 -1
- package/src/views/user/role/dialog.vue +1 -1
- package/src/views/user/role/list.vue +1 -1
- package/src/views/user/sale_org/dialog.vue +1 -1
- package/src/views/user/sale_org/list.vue +1 -1
- package/src/views/user/system_notice/list.vue +1 -1
- package/src/views/user/system_parameter/list.vue +1 -1
- package/src/views/user/user/dialog.vue +1 -1
- package/src/views/user/user/edit.vue +306 -159
- package/src/views/user/user/form_dialog.vue +1 -1
- package/src/views/user/user/form_list.vue +1 -1
- package/src/views/user/user/list.vue +2 -2
- package/src/views/user/user_log_classify/list.vue +1 -1
- package/src/views/user/wf/iframe/index.vue +6 -1
- package/src/views/user/wf/iframe/index2.vue +6 -1
- package/src/views/user/wf/wfReport/index.vue +12 -6
- package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -2
- package/src/views/user/wf/wf_manage/list.vue +97 -24
- package/src/views/user/wf/wf_manage/list2.vue +875 -0
- package/src/views/user/wf/wf_manage/wfContentDialog.vue +23 -1
- package/src/views/user/wf/wf_obj_config/dialog.vue +1 -1
- package/src/views/user/wf/wf_obj_config/list.vue +1 -1
- package/src/views/user/wf/wf_obj_config/list_form.vue +1 -1
- package/src/views/user/wf/wf_transfer_setting/list.vue +1 -1
- package/src/views/user/workbench_menu/list.vue +1 -1
|
@@ -1,371 +1,535 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
1
|
+
import { constantRoutes } from "@base/router";
|
|
2
|
+
import { asyncRoutes, sidebarRoutes } from "@base/router/modules/system";
|
|
3
|
+
import Layout from "@/layout";
|
|
4
|
+
import { getRouters } from "../../api/menu";
|
|
5
|
+
import router from "@base/router";
|
|
6
|
+
import storeConfig from "../config/index";
|
|
7
|
+
import settings from "@/settings";
|
|
8
|
+
import {
|
|
9
|
+
resolveComponentPath,
|
|
10
|
+
resolveOwner,
|
|
11
|
+
dispatchMenus,
|
|
12
|
+
} from "@base/utils/menuAdapter";
|
|
13
|
+
import {
|
|
14
|
+
getAppRegistry,
|
|
15
|
+
registerSubApps,
|
|
16
|
+
buildSubAppRoutes,
|
|
17
|
+
} from "@base/microRouter";
|
|
18
|
+
import MenuFallback from "@base/views/user/menuFallback/index.vue";
|
|
19
|
+
|
|
20
|
+
// qiankun 宿主态(仅 settings.microMainEnabled 的主应用登录后填充)
|
|
21
|
+
let hostRegistryApps = [];
|
|
22
|
+
let hostMicroRoutes = [];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 本应用(渲染方)在微前端命名空间里的身份。
|
|
26
|
+
* 子应用取 settings.appCode(派生自各自 WEB_PREFIX);主应用 appCode 恒空,
|
|
27
|
+
* 但它的身份就是 WEB_PREFIX 去斜杠(/sys → sys)——故回落 WEB_PREFIX 派生。
|
|
28
|
+
* 用于:① 宿主自排除(不装载自己);② 组件路径解析剥归属前缀,使
|
|
29
|
+
* /micro/sys/base/user/user/list 等同于 /base/user/user/list(主应用把归属自己的
|
|
30
|
+
* 访问路径剥掉 /micro/<自己> 两段后按常规解析)。
|
|
31
|
+
*/
|
|
32
|
+
function getOwnAppCode() {
|
|
33
|
+
return settings.appCode || (window.WEB_PREFIX || "").replace(/^\/+/, "");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 子应用被"本地调试覆盖"装载时置 true:启用按访问路径直接解析组件的兜底路由,
|
|
37
|
+
// 使联调期可用 URL 直达尚未配置菜单的页面。正式注册表装载时恒为 false——
|
|
38
|
+
// 菜单即权限边界,不能让任意路径都能打开组件
|
|
39
|
+
let debugPathEnabled = false;
|
|
40
|
+
|
|
41
|
+
// 按路径解析出的异步组件工厂按路径缓存:Vue 2 依工厂函数标识做结果缓存,
|
|
42
|
+
// 每次 render 新建工厂会导致重复请求同一 chunk
|
|
43
|
+
let debugPathFactories = {};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 调试兜底路由:把当前访问路径当作菜单 url 走同一套组件解析
|
|
47
|
+
* (剥归属前缀 → /base 命名空间 → loadView),解析不出则落 menuFallback 提示页。
|
|
48
|
+
*/
|
|
49
|
+
function createDebugPathRoute() {
|
|
50
|
+
return {
|
|
51
|
+
path: "*",
|
|
52
|
+
name: "microDebugPath",
|
|
53
|
+
meta: { title: "调试直达", microDebugPath: true },
|
|
54
|
+
component: {
|
|
55
|
+
name: "microDebugPathView",
|
|
56
|
+
render(h) {
|
|
57
|
+
const path = (this.$route && this.$route.path) || "";
|
|
58
|
+
const componentPath = resolveComponentPath(
|
|
59
|
+
{ url: path },
|
|
60
|
+
getOwnAppCode()
|
|
61
|
+
);
|
|
62
|
+
if (!componentPath) {
|
|
63
|
+
return h(MenuFallback, { props: { componentPath: path } });
|
|
64
|
+
}
|
|
65
|
+
if (!debugPathFactories[componentPath]) {
|
|
66
|
+
debugPathFactories[componentPath] = loadView(componentPath);
|
|
67
|
+
}
|
|
68
|
+
return h(debugPathFactories[componentPath], { key: path });
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 下发给子应用的登录信息快照(props.userInfo,协议第 5 节);注册时快照,非实时
|
|
75
|
+
function buildUserInfoSnapshot(userState = {}) {
|
|
76
|
+
return {
|
|
77
|
+
userId: userState.userId,
|
|
78
|
+
loginAccount: userState.loginAccount,
|
|
79
|
+
name: userState.name,
|
|
80
|
+
nickName: userState.nickName,
|
|
81
|
+
companyCode: userState.companyCode,
|
|
82
|
+
companyInfoId: userState.companyInfoId,
|
|
83
|
+
roles: userState.roles || [],
|
|
84
|
+
userFlag: userState.userFlag,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let modules = {};
|
|
89
|
+
|
|
90
|
+
// loadView 失败兜底:独立运行点到别家应用的菜单 / 菜单配置错误时展示提示页
|
|
91
|
+
function createFallbackComponent(view, error) {
|
|
92
|
+
return {
|
|
93
|
+
name: "menuLoadFallback",
|
|
94
|
+
render(h) {
|
|
95
|
+
return h(MenuFallback, {
|
|
96
|
+
props: {
|
|
97
|
+
componentPath: view || "",
|
|
98
|
+
loadError: (error && (error.message || String(error))) || "",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let configUtl = {
|
|
106
|
+
asyncRoutes,
|
|
107
|
+
constantRoutes,
|
|
108
|
+
sidebarRoutes,
|
|
109
|
+
Layout,
|
|
110
|
+
getRouters,
|
|
111
|
+
loadView: function (view) {
|
|
112
|
+
return (resolve) => {
|
|
113
|
+
const fail = (e) => resolve(createFallbackComponent(view, e));
|
|
114
|
+
try {
|
|
115
|
+
if (view) {
|
|
116
|
+
let t = "@base/views";
|
|
117
|
+
// let t2 = "@/components"
|
|
118
|
+
if (view.startsWith(t)) {
|
|
119
|
+
let path = view.substr(t.length);
|
|
120
|
+
return require(["../../views" + path], resolve, fail);
|
|
121
|
+
} /* else if (view.startsWith(t2)) {
|
|
122
|
+
let path = view.substr(t2.length);
|
|
123
|
+
return require(['@/components' + path], resolve, fail);
|
|
124
|
+
} */
|
|
125
|
+
}
|
|
126
|
+
return require(["@/views" + view], resolve, fail);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
fail(e);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const loadView = (view) => {
|
|
135
|
+
// 路由懒加载
|
|
136
|
+
if (view) {
|
|
137
|
+
let tIndex = view.lastIndexOf("?");
|
|
138
|
+
let newView = view;
|
|
139
|
+
if (tIndex >= 0) {
|
|
140
|
+
newView = view.substring(0, tIndex);
|
|
141
|
+
}
|
|
142
|
+
return configUtl.loadView(newView);
|
|
143
|
+
} else {
|
|
144
|
+
return () => {};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Use meta.role to determine if the current user has permission
|
|
150
|
+
* @param roles
|
|
151
|
+
* @param route
|
|
152
|
+
*/
|
|
153
|
+
function hasPermission(roles, route) {
|
|
154
|
+
if (route.meta && route.meta.roles) {
|
|
155
|
+
return roles.some((role) => route.meta.roles.includes(role));
|
|
156
|
+
} else {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Filter asynchronous routing tables by recursion
|
|
163
|
+
* @param routes asyncRoutes
|
|
164
|
+
* @param roles
|
|
165
|
+
*/
|
|
166
|
+
function filterAsyncRoutes(routes, roles) {
|
|
167
|
+
const res = [];
|
|
168
|
+
|
|
169
|
+
routes.forEach((route) => {
|
|
170
|
+
const tmp = {
|
|
171
|
+
...route,
|
|
172
|
+
};
|
|
173
|
+
if (hasPermission(roles, tmp)) {
|
|
174
|
+
if (tmp.children) {
|
|
175
|
+
tmp.children = filterAsyncRoutes(tmp.children, roles);
|
|
176
|
+
}
|
|
177
|
+
res.push(tmp);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return res;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const state = {
|
|
184
|
+
routes: [],
|
|
185
|
+
addRoutes: [],
|
|
186
|
+
sidebarRouters: [],
|
|
187
|
+
// 注册表里的别家 appCode 列表(宿主/独立运行时填充),
|
|
188
|
+
// menuFallback 据此判定"归属别家应用",避免把普通组件加载失败误判成别家菜单
|
|
189
|
+
registryAppCodes: [],
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const mutations = {
|
|
193
|
+
SET_ROUTES: (state, routes) => {
|
|
194
|
+
state.addRoutes = routes;
|
|
195
|
+
state.routes = configUtl.constantRoutes.concat(routes);
|
|
196
|
+
},
|
|
197
|
+
SET_SIDEBAR_ROUTERS: (state, routers) => {
|
|
198
|
+
state.sidebarRouters = routers;
|
|
199
|
+
},
|
|
200
|
+
SET_REGISTRY_APP_CODES: (state, appCodes) => {
|
|
201
|
+
state.registryAppCodes = appCodes || [];
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const actions = {
|
|
206
|
+
generateRoutes(opt, roles) {
|
|
207
|
+
let commit = opt.commit;
|
|
208
|
+
return new Promise((resolve) => {
|
|
209
|
+
let accessedRoutes;
|
|
210
|
+
if (roles.includes("admin")) {
|
|
211
|
+
accessedRoutes = configUtl.asyncRoutes || [];
|
|
212
|
+
} else {
|
|
213
|
+
accessedRoutes = filterAsyncRoutes(configUtl.asyncRoutes, roles);
|
|
214
|
+
}
|
|
215
|
+
commit("SET_SIDEBAR_ROUTERS", configUtl.sidebarRoutes || []);
|
|
216
|
+
resolve(accessedRoutes);
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
generateRoutes2(opt, user) {
|
|
220
|
+
let commit = opt.commit;
|
|
221
|
+
let dispatch = opt.dispatch;
|
|
222
|
+
let isBdAdmin = opt.rootGetters.isBdAdmin;
|
|
223
|
+
return new Promise((resolve) => {
|
|
224
|
+
if (!isBdAdmin) {
|
|
225
|
+
configUtl.getRouters({
|
|
226
|
+
success: (res) => {
|
|
227
|
+
var rows = res.objx || [];
|
|
228
|
+
dispatch("setupHostAndRoutes", rows).then((accessedRoutes) => {
|
|
229
|
+
resolve(accessedRoutes);
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
let flag = user?.flag ?? null;
|
|
235
|
+
let userFlagMenuMap = storeConfig?.userFlagMenuMap || {};
|
|
236
|
+
let rows = userFlagMenuMap[flag] || [];
|
|
237
|
+
dispatch("setupHostAndRoutes", rows).then((accessedRoutes) => {
|
|
238
|
+
resolve(accessedRoutes);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
// qiankun 宿主编排:拉注册表 → 按归属切分 → 注册子应用,再走常规路由生成。
|
|
244
|
+
// 非宿主(未开 microMainEnabled / 自身被 qiankun 挂载)直接透传。
|
|
245
|
+
setupHostAndRoutes({ dispatch, commit, rootState }, rows = []) {
|
|
246
|
+
let isHost =
|
|
247
|
+
settings.microMainEnabled === true && !window.__POWERED_BY_QIANKUN__;
|
|
248
|
+
if (!isHost) {
|
|
249
|
+
return dispatch("setSidebarRoute", rows);
|
|
250
|
+
}
|
|
251
|
+
return getAppRegistry().then((apps) => {
|
|
252
|
+
// 自排除:自身也在注册表时(子应用开宿主形态互访别家应用)不装载自己,
|
|
253
|
+
// 否则会自嵌套且自身菜单被误判为"派发给子应用"而跳过本地路由。
|
|
254
|
+
// 主应用 appCode 恒为空(WEB_PREFIX===MAIN_WEB_PREFIX 不派生),但它在注册表里的
|
|
255
|
+
// 身份是 WEB_PREFIX 去斜杠(/sys → sys)——故回落到 WEB_PREFIX 派生,
|
|
256
|
+
// 否则注册表误配了主应用自身条目时排不掉、导致主应用自嵌套。
|
|
257
|
+
let ownAppCode = getOwnAppCode();
|
|
258
|
+
hostRegistryApps = (apps || []).filter(
|
|
259
|
+
(app) => app.appCode !== ownAppCode
|
|
260
|
+
);
|
|
261
|
+
commit(
|
|
262
|
+
"SET_REGISTRY_APP_CODES",
|
|
263
|
+
hostRegistryApps.map((app) => app.appCode)
|
|
264
|
+
);
|
|
265
|
+
let subAppMenus = dispatchMenus(rows, hostRegistryApps);
|
|
266
|
+
hostMicroRoutes = buildSubAppRoutes(hostRegistryApps, subAppMenus);
|
|
267
|
+
if (hostRegistryApps.length) {
|
|
268
|
+
registerSubApps(hostRegistryApps, {
|
|
269
|
+
subAppMenus,
|
|
270
|
+
userInfo: buildUserInfoSnapshot(rootState.user),
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return dispatch("setSidebarRoute", rows);
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
// qiankun 子应用模式:主应用经 props 下发菜单,替代 getRouters 自拉
|
|
277
|
+
generateRoutesFromProps({ dispatch, rootState }, menus = []) {
|
|
278
|
+
// 调试覆盖装载时允许 URL 直达未配菜单的页面(handleMenuRoutes 追加兜底路由)
|
|
279
|
+
debugPathEnabled = !!(rootState.micro && rootState.micro.debug);
|
|
280
|
+
return dispatch("setSidebarRoute", menus);
|
|
281
|
+
},
|
|
282
|
+
setSidebarRoute({ commit, dispatch }, rows = []) {
|
|
283
|
+
return new Promise((resolve) => {
|
|
284
|
+
let accessedRoutes =
|
|
285
|
+
handleMenuRoutes(JSON.parse(JSON.stringify(rows))) || [];
|
|
286
|
+
let nsidebarRoutes =
|
|
287
|
+
handleSidebarRoutes(JSON.parse(JSON.stringify(rows))) || [];
|
|
288
|
+
commit("SET_SIDEBAR_ROUTERS", nsidebarRoutes);
|
|
289
|
+
commit("SET_ROUTES", accessedRoutes);
|
|
290
|
+
router.addRoutes(accessedRoutes); // 动态添加可访问路由表
|
|
291
|
+
resolve(accessedRoutes);
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
function getUrlParams(url) {
|
|
297
|
+
let urlStr = url.split("?")[1];
|
|
298
|
+
const urlSearchParams = new URLSearchParams(urlStr);
|
|
299
|
+
const result = Object.fromEntries(urlSearchParams.entries());
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// 宿主态下归属子应用的菜单不生成本地组件路由(否则会遮住 /micro/appCode/* 通配路由),
|
|
304
|
+
// 由子应用经 qiankun 渲染;侧边栏 handleSidebarRoutes 仍保留全量。
|
|
305
|
+
// 例外(B):来源为 base 的包内组件本应用本地就有,resolveComponentPath 会解析成 @base/…,
|
|
306
|
+
// 此时不派发、本地渲染,省去为一个共享组件装载整个子应用。
|
|
307
|
+
function isDelegatedToSubApp(route) {
|
|
308
|
+
if (hostRegistryApps.length === 0) return false;
|
|
309
|
+
if (!resolveOwner(route, hostRegistryApps)) return false;
|
|
310
|
+
const localPath = resolveComponentPath(route, getOwnAppCode());
|
|
311
|
+
// 解析出本地组件路径(@base/views 或 @/views)→ 本地渲染,不派发
|
|
312
|
+
if (localPath && localPath.charAt(0) === "@") return false;
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function handleMenuRoutes(routes) {
|
|
317
|
+
var sidebarRoutes = {
|
|
318
|
+
path: "",
|
|
319
|
+
component: configUtl.Layout,
|
|
320
|
+
};
|
|
321
|
+
var children = [];
|
|
322
|
+
routes.forEach((route1, index1) => {
|
|
323
|
+
let item1 = createRoute3(route1);
|
|
324
|
+
if (item1 && item1.path && !isDelegatedToSubApp(route1)) {
|
|
325
|
+
children.push(item1);
|
|
326
|
+
}
|
|
327
|
+
if (route1.children) {
|
|
328
|
+
route1.children.forEach((route2, index2) => {
|
|
329
|
+
let item2 = createRoute3(route2);
|
|
330
|
+
if (item2 && item2.path && !isDelegatedToSubApp(route2)) {
|
|
331
|
+
children.push(item2);
|
|
332
|
+
}
|
|
333
|
+
if (route2.children) {
|
|
334
|
+
route2.children.forEach((route3, index3) => {
|
|
335
|
+
let item = createRoute3(route3);
|
|
336
|
+
if (item && item.path && !isDelegatedToSubApp(route3)) {
|
|
337
|
+
children.push(item);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// 每个子应用一条通配路由,位于全局 * 兜底之前
|
|
346
|
+
hostMicroRoutes.forEach((microRoute) => {
|
|
347
|
+
children.push(microRoute);
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
// 调试兜底放在全局 * → /404 之前,未配菜单的路径由它按路径解析组件
|
|
351
|
+
if (debugPathEnabled) {
|
|
352
|
+
children.push(createDebugPathRoute());
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
sidebarRoutes.children = children;
|
|
356
|
+
var result = [sidebarRoutes];
|
|
357
|
+
result.push({
|
|
358
|
+
path: "*",
|
|
359
|
+
redirect: "/404",
|
|
360
|
+
hidden: true,
|
|
361
|
+
});
|
|
362
|
+
return result;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function createRoute3(route3, flag) {
|
|
366
|
+
let item = null;
|
|
367
|
+
if (route3.type == 0) {
|
|
368
|
+
//普通菜单
|
|
369
|
+
let componentPath;
|
|
370
|
+
let menuCode;
|
|
371
|
+
let param = null;
|
|
372
|
+
let url = "";
|
|
373
|
+
let path = "";
|
|
374
|
+
if (route3.url) {
|
|
375
|
+
url = route3.url;
|
|
376
|
+
path = route3.route || route3.url;
|
|
377
|
+
let str = "/report/vform/render/";
|
|
378
|
+
if (path.indexOf(str) == 0) {
|
|
379
|
+
componentPath = "/report/vform/render";
|
|
380
|
+
menuCode = "vform_render";
|
|
381
|
+
} else {
|
|
382
|
+
let pIndex = path.indexOf("?");
|
|
383
|
+
if (pIndex > 0) {
|
|
384
|
+
param = getUrlParams(path);
|
|
385
|
+
path = path.substring(0, pIndex);
|
|
386
|
+
}
|
|
387
|
+
// 三步解析第 3 步:/base/ 命名空间转 @base/views;访问路径首段为本应用(含主应用 WEB_PREFIX 身份)时剥 /micro/<自己>
|
|
388
|
+
componentPath = resolveComponentPath(route3, getOwnAppCode());
|
|
389
|
+
menuCode = route3.menuCode;
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
componentPath = "";
|
|
393
|
+
menuCode = route3.menuCode;
|
|
394
|
+
}
|
|
395
|
+
if (path && path.startsWith("@")) {
|
|
396
|
+
// path = "/" + path;
|
|
397
|
+
path = null;
|
|
398
|
+
componentPath = "";
|
|
399
|
+
}
|
|
400
|
+
item = {
|
|
401
|
+
id: route3.id,
|
|
402
|
+
menuName: route3.menuName,
|
|
403
|
+
menuEnName: route3.menuEnName || null,
|
|
404
|
+
menuCode: route3.menuCode,
|
|
405
|
+
menuImg: route3.menuImg,
|
|
406
|
+
treePathName: route3.treePathName,
|
|
407
|
+
type: route3.type,
|
|
408
|
+
url: path,
|
|
409
|
+
path: path,
|
|
410
|
+
linkType: route3.type,
|
|
411
|
+
component: loadView(componentPath),
|
|
412
|
+
name: menuCode,
|
|
413
|
+
meta: {
|
|
414
|
+
title: route3.menuName,
|
|
415
|
+
enTitle: route3.menuEnName || null,
|
|
416
|
+
treePathName: route3.treePathName,
|
|
417
|
+
param: param,
|
|
418
|
+
repeatOpen: route3.repeatOpen,
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
if (flag !== 1) {
|
|
422
|
+
item.component = loadView(componentPath);
|
|
423
|
+
}
|
|
424
|
+
} else if (route3.type == 3) {
|
|
425
|
+
//外部菜单
|
|
426
|
+
let menuCode = route3.menuCode;
|
|
427
|
+
let componentPath = "@base/views/user/outLink/index";
|
|
428
|
+
let path = route3.route || "/user/outLink/index" + "/" + menuCode;
|
|
429
|
+
item = {
|
|
430
|
+
id: route3.id,
|
|
431
|
+
menuName: route3.menuName,
|
|
432
|
+
menuEnName: route3.menuEnName || null,
|
|
433
|
+
menuCode: route3.menuCode,
|
|
434
|
+
menuImg: route3.menuImg,
|
|
435
|
+
treePathName: route3.treePathName,
|
|
436
|
+
type: route3.type,
|
|
437
|
+
url: path,
|
|
438
|
+
path: path,
|
|
439
|
+
outLink: route3.url || "",
|
|
440
|
+
linkType: route3.type,
|
|
441
|
+
route: route3.route,
|
|
442
|
+
name: "outLink",
|
|
443
|
+
meta: {
|
|
444
|
+
title: route3.menuName,
|
|
445
|
+
enTitle: route3.menuName || null,
|
|
446
|
+
treePathName: route3.treePathName,
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
if (flag !== 1) {
|
|
450
|
+
item.component = loadView(componentPath);
|
|
451
|
+
}
|
|
452
|
+
} else if (route3.type == 4) {
|
|
453
|
+
//第三方地址
|
|
454
|
+
if (flag == 1) {
|
|
455
|
+
item = route3;
|
|
456
|
+
item.path = route3.url;
|
|
457
|
+
item.linkType = route3.type;
|
|
458
|
+
item.meta = {
|
|
459
|
+
title: route3.menuName,
|
|
460
|
+
enTitle: route3.menuEnName || null,
|
|
461
|
+
treePathName: route3.treePathName,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
} else if (route3.type == 5) {
|
|
465
|
+
//动态表单
|
|
466
|
+
let menuCode = route3.menuCode;
|
|
467
|
+
let componentPath = "@base/views/user/form/view/list";
|
|
468
|
+
let url = route3.route || route3.url;
|
|
469
|
+
item = {
|
|
470
|
+
id: route3.id,
|
|
471
|
+
menuName: route3.menuName,
|
|
472
|
+
menuEnName: route3.menuEnName || null,
|
|
473
|
+
menuCode: route3.menuCode,
|
|
474
|
+
menuImg: route3.menuImg,
|
|
475
|
+
treePathName: route3.treePathName,
|
|
476
|
+
type: route3.type,
|
|
477
|
+
url: url,
|
|
478
|
+
path: url,
|
|
479
|
+
linkType: route3.type,
|
|
480
|
+
name: "form_view:list",
|
|
481
|
+
meta: {
|
|
482
|
+
title: route3.menuName,
|
|
483
|
+
enTitle: route3.menuEnName || null,
|
|
484
|
+
treePathName: route3.treePathName,
|
|
485
|
+
repeatOpen: route3.repeatOpen,
|
|
486
|
+
},
|
|
487
|
+
};
|
|
488
|
+
if (flag !== 1) {
|
|
489
|
+
item.component = loadView(componentPath);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return item;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function handleSidebarRoutes(routes) {
|
|
496
|
+
return routes
|
|
497
|
+
.map((route1) => {
|
|
498
|
+
let item1 = createRoute3(route1, 1);
|
|
499
|
+
if (item1) {
|
|
500
|
+
let children1 = [];
|
|
501
|
+
if (route1.children) {
|
|
502
|
+
route1.children.forEach((route2, index2) => {
|
|
503
|
+
let item2 = createRoute3(route2, 1);
|
|
504
|
+
if (item2) {
|
|
505
|
+
let children2 = [];
|
|
506
|
+
if (route2.children) {
|
|
507
|
+
route2.children.forEach((route3, index3) => {
|
|
508
|
+
let item3 = createRoute3(route3, 1);
|
|
509
|
+
if (item3) {
|
|
510
|
+
children2.push(item3);
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
item2.children = children2;
|
|
515
|
+
children1.push(item2);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
item1.children = children1;
|
|
521
|
+
}
|
|
522
|
+
return item1;
|
|
523
|
+
})
|
|
524
|
+
.filter((route) => route != null);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
modules = {
|
|
528
|
+
namespaced: true,
|
|
529
|
+
state,
|
|
530
|
+
mutations,
|
|
531
|
+
actions,
|
|
532
|
+
filterAsyncRoutes,
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
export default modules;
|