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
package/src/utils/aes.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import CryptoJS from
|
|
1
|
+
import CryptoJS from "crypto-js";
|
|
2
2
|
|
|
3
3
|
const secretKey = "2025202620272028"; // 密钥必须是16个字节
|
|
4
4
|
const ivKey = "2022202320242025"; // 向量必须是16个字节
|
|
5
5
|
|
|
6
6
|
// 加密函数
|
|
7
7
|
export function encrypt(text) {
|
|
8
|
-
return CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(secretKey), {
|
|
8
|
+
return CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(secretKey), {
|
|
9
|
+
iv: CryptoJS.enc.Utf8.parse(ivKey),
|
|
10
|
+
}).toString();
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
// 解密函数
|
|
12
14
|
export function decrypt(ciphertext) {
|
|
13
|
-
const bytes = CryptoJS.AES.decrypt(
|
|
15
|
+
const bytes = CryptoJS.AES.decrypt(
|
|
16
|
+
ciphertext,
|
|
17
|
+
CryptoJS.enc.Utf8.parse(secretKey),
|
|
18
|
+
{ iv: CryptoJS.enc.Utf8.parse(ivKey) }
|
|
19
|
+
);
|
|
14
20
|
return bytes.toString(CryptoJS.enc.Utf8);
|
|
15
21
|
}
|
package/src/utils/auth.js
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// webpack 只允许加载构建时已收集的模块。路径加载仅收集弹框约定目录/文件:
|
|
4
|
+
// dialog/**/*.vue、*Dialog.vue、*Dialog/index.vue(忽略大小写)。复杂场景可由调用方
|
|
5
|
+
// 直接传 component/componentLoader,避免递归收集全部业务页面。
|
|
6
|
+
const componentContext = require.context(
|
|
7
|
+
"../components",
|
|
8
|
+
true,
|
|
9
|
+
/(?:^|\/)(?:dialog\/.*\.vue|[^/]*dialog(?:\.vue|\/index\.vue))$/i,
|
|
10
|
+
"lazy"
|
|
11
|
+
);
|
|
12
|
+
const viewContext = require.context(
|
|
13
|
+
"../views",
|
|
14
|
+
true,
|
|
15
|
+
/(?:^|\/)(?:dialog\/.*\.vue|[^/]*dialog(?:\.vue|\/index\.vue))$/i,
|
|
16
|
+
"lazy"
|
|
17
|
+
);
|
|
18
|
+
|
|
5
19
|
const componentKeys = new Set(componentContext.keys());
|
|
6
20
|
const viewKeys = new Set(viewContext.keys());
|
|
7
21
|
|
|
8
22
|
function normalizePath(path) {
|
|
9
23
|
return String(path || "")
|
|
10
24
|
.trim()
|
|
11
|
-
.replace(
|
|
25
|
+
.replace(/\\/g, "/")
|
|
12
26
|
.replace(/[?#].*$/, "")
|
|
13
27
|
.replace(/^\.\//, "")
|
|
14
28
|
.replace(/^src\//, "")
|
|
@@ -20,9 +34,11 @@ function normalizePath(path) {
|
|
|
20
34
|
|
|
21
35
|
function getComponentLoader(path) {
|
|
22
36
|
const normalizedPath = normalizePath(path);
|
|
37
|
+
|
|
23
38
|
if (!normalizedPath) {
|
|
24
39
|
throw new Error("[componentDialog] componentPath 不能为空");
|
|
25
40
|
}
|
|
41
|
+
|
|
26
42
|
if (normalizedPath.split("/").includes("..")) {
|
|
27
43
|
throw new Error("[componentDialog] componentPath 不允许包含 ..");
|
|
28
44
|
}
|
|
@@ -30,6 +46,7 @@ function getComponentLoader(path) {
|
|
|
30
46
|
let context;
|
|
31
47
|
let contextKeys;
|
|
32
48
|
let relativePath;
|
|
49
|
+
|
|
33
50
|
if (normalizedPath.startsWith("components/")) {
|
|
34
51
|
context = componentContext;
|
|
35
52
|
contextKeys = componentKeys;
|
|
@@ -39,27 +56,46 @@ function getComponentLoader(path) {
|
|
|
39
56
|
contextKeys = viewKeys;
|
|
40
57
|
relativePath = normalizedPath.slice("views/".length);
|
|
41
58
|
} else {
|
|
42
|
-
throw new Error(
|
|
59
|
+
throw new Error(
|
|
60
|
+
"[componentDialog] 只允许加载 src/components 或 src/views 下的组件"
|
|
61
|
+
);
|
|
43
62
|
}
|
|
44
63
|
|
|
45
64
|
const candidates = /\.vue$/i.test(relativePath)
|
|
46
65
|
? [`./${relativePath}`]
|
|
47
66
|
: [`./${relativePath}.vue`, `./${relativePath}/index.vue`];
|
|
48
67
|
const componentKey = candidates.find((key) => contextKeys.has(key));
|
|
68
|
+
|
|
49
69
|
if (!componentKey) {
|
|
50
70
|
throw new Error(`[componentDialog] 找不到组件:${normalizedPath}`);
|
|
51
71
|
}
|
|
72
|
+
|
|
52
73
|
return () => Promise.resolve(context(componentKey));
|
|
53
74
|
}
|
|
54
75
|
|
|
55
76
|
async function loadComponent(path) {
|
|
56
|
-
const
|
|
77
|
+
const loader = getComponentLoader(path);
|
|
78
|
+
const componentModule = await loader();
|
|
57
79
|
return componentModule.default || componentModule;
|
|
58
80
|
}
|
|
59
81
|
|
|
82
|
+
async function resolveDialogComponent(options) {
|
|
83
|
+
if (options.component) {
|
|
84
|
+
return options.component.default || options.component;
|
|
85
|
+
}
|
|
86
|
+
if (typeof options.componentLoader === "function") {
|
|
87
|
+
const componentModule = await options.componentLoader();
|
|
88
|
+
return componentModule.default || componentModule;
|
|
89
|
+
}
|
|
90
|
+
return loadComponent(options.componentPath);
|
|
91
|
+
}
|
|
92
|
+
|
|
60
93
|
function callEvent(events, eventName, args) {
|
|
61
94
|
const handler = events[eventName];
|
|
62
|
-
|
|
95
|
+
|
|
96
|
+
if (typeof handler === "function") {
|
|
97
|
+
handler(...args);
|
|
98
|
+
}
|
|
63
99
|
}
|
|
64
100
|
|
|
65
101
|
function mountComponentDialog(component, options, parentVm) {
|
|
@@ -72,6 +108,7 @@ function mountComponentDialog(component, options, parentVm) {
|
|
|
72
108
|
events = {},
|
|
73
109
|
onClose,
|
|
74
110
|
} = options;
|
|
111
|
+
|
|
75
112
|
let hostInstance = null;
|
|
76
113
|
let destroyTimer = null;
|
|
77
114
|
let closeStarted = false;
|
|
@@ -81,42 +118,70 @@ function mountComponentDialog(component, options, parentVm) {
|
|
|
81
118
|
|
|
82
119
|
const centerDialog = () => {
|
|
83
120
|
if (!hostInstance || options.verticalCenter === false) return;
|
|
121
|
+
|
|
84
122
|
hostInstance.$nextTick(() => {
|
|
85
123
|
if (!hostInstance || !hostInstance.$el) return;
|
|
124
|
+
|
|
86
125
|
const hostElement = hostInstance.$el;
|
|
87
126
|
const dialogElement = hostElement.matches(".el-dialog")
|
|
88
127
|
? hostElement
|
|
89
128
|
: hostElement.querySelector(".el-dialog");
|
|
129
|
+
|
|
90
130
|
if (!dialogElement || !dialogElement.offsetHeight) return;
|
|
91
|
-
|
|
92
|
-
|
|
131
|
+
|
|
132
|
+
const viewportHeight
|
|
133
|
+
= window.innerHeight || document.documentElement.clientHeight;
|
|
134
|
+
const marginTop = Math.max(
|
|
135
|
+
(viewportHeight - dialogElement.offsetHeight) / 2,
|
|
136
|
+
0
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
dialogElement.style.marginTop = `${marginTop}px`;
|
|
93
140
|
});
|
|
94
141
|
};
|
|
95
142
|
|
|
96
143
|
const notifyClose = () => {
|
|
97
144
|
if (closeNotified) return;
|
|
145
|
+
|
|
98
146
|
closeNotified = true;
|
|
99
|
-
if (typeof onClose === "function")
|
|
147
|
+
if (typeof onClose === "function") {
|
|
148
|
+
onClose();
|
|
149
|
+
}
|
|
100
150
|
};
|
|
151
|
+
|
|
101
152
|
const removeHost = () => {
|
|
102
153
|
if (!hostInstance) return;
|
|
154
|
+
|
|
103
155
|
centerTimers.forEach((timer) => clearTimeout(timer));
|
|
104
|
-
if (resizeHandler)
|
|
105
|
-
|
|
156
|
+
if (resizeHandler) {
|
|
157
|
+
window.removeEventListener("resize", resizeHandler);
|
|
158
|
+
resizeHandler = null;
|
|
159
|
+
}
|
|
160
|
+
|
|
106
161
|
const element = hostInstance.$el;
|
|
107
162
|
hostInstance.$destroy();
|
|
108
|
-
|
|
163
|
+
|
|
164
|
+
if (element && element.parentNode) {
|
|
165
|
+
element.parentNode.removeChild(element);
|
|
166
|
+
}
|
|
167
|
+
|
|
109
168
|
hostInstance = null;
|
|
110
169
|
};
|
|
170
|
+
|
|
111
171
|
const destroy = () => {
|
|
112
172
|
if (closeStarted) return;
|
|
173
|
+
|
|
113
174
|
closeStarted = true;
|
|
114
175
|
notifyClose();
|
|
115
176
|
destroyTimer = setTimeout(removeHost, 300);
|
|
116
177
|
};
|
|
178
|
+
|
|
117
179
|
const forceDestroy = () => {
|
|
118
|
-
if (destroyTimer)
|
|
119
|
-
|
|
180
|
+
if (destroyTimer) {
|
|
181
|
+
clearTimeout(destroyTimer);
|
|
182
|
+
destroyTimer = null;
|
|
183
|
+
}
|
|
184
|
+
|
|
120
185
|
closeStarted = true;
|
|
121
186
|
notifyClose();
|
|
122
187
|
removeHost();
|
|
@@ -124,94 +189,151 @@ function mountComponentDialog(component, options, parentVm) {
|
|
|
124
189
|
|
|
125
190
|
const DialogHost = Vue.extend({
|
|
126
191
|
name: "DynamicComponentDialogHost",
|
|
192
|
+
|
|
127
193
|
provide() {
|
|
128
194
|
return provideValues;
|
|
129
195
|
},
|
|
196
|
+
|
|
130
197
|
data() {
|
|
131
|
-
return {
|
|
198
|
+
return {
|
|
199
|
+
visible: true,
|
|
200
|
+
};
|
|
132
201
|
},
|
|
202
|
+
|
|
133
203
|
methods: {
|
|
134
204
|
closeDialog() {
|
|
135
205
|
this.visible = false;
|
|
206
|
+
|
|
207
|
+
// 兼容项目中使用内部 showDialog 控制显隐的自带弹框组件。
|
|
136
208
|
const componentInstance = this.$refs.contentComponent;
|
|
137
|
-
if (
|
|
209
|
+
if (
|
|
210
|
+
componentInstance
|
|
211
|
+
&& Object.prototype.hasOwnProperty.call(componentInstance, "showDialog")
|
|
212
|
+
) {
|
|
138
213
|
componentInstance.showDialog = false;
|
|
139
214
|
}
|
|
215
|
+
|
|
140
216
|
destroy();
|
|
141
217
|
},
|
|
142
218
|
},
|
|
219
|
+
|
|
143
220
|
render(h) {
|
|
144
221
|
const childEvents = {};
|
|
222
|
+
|
|
145
223
|
Object.keys(events).forEach((eventName) => {
|
|
146
|
-
childEvents[eventName] = (...args) =>
|
|
224
|
+
childEvents[eventName] = (...args) => {
|
|
225
|
+
callEvent(events, eventName, args);
|
|
226
|
+
};
|
|
147
227
|
});
|
|
228
|
+
|
|
148
229
|
childEvents["update:visible"] = (visible) => {
|
|
149
230
|
callEvent(events, "update:visible", [visible]);
|
|
150
231
|
this.visible = visible;
|
|
151
|
-
|
|
232
|
+
|
|
233
|
+
if (visible === false) {
|
|
234
|
+
this.closeDialog();
|
|
235
|
+
}
|
|
152
236
|
};
|
|
237
|
+
|
|
238
|
+
// 兼容项目已有组件中的 visiable 拼写。
|
|
153
239
|
childEvents["update:visiable"] = (visible) => {
|
|
154
240
|
callEvent(events, "update:visiable", [visible]);
|
|
155
241
|
this.visible = visible;
|
|
156
|
-
|
|
242
|
+
|
|
243
|
+
if (visible === false) {
|
|
244
|
+
this.closeDialog();
|
|
245
|
+
}
|
|
157
246
|
};
|
|
247
|
+
|
|
158
248
|
childEvents.close = (...args) => {
|
|
159
249
|
callEvent(events, "close", args);
|
|
160
|
-
if (!wrapper)
|
|
250
|
+
if (!wrapper) {
|
|
251
|
+
this.closeDialog();
|
|
252
|
+
}
|
|
161
253
|
};
|
|
254
|
+
|
|
162
255
|
const componentNode = h(component, {
|
|
163
256
|
ref: "contentComponent",
|
|
164
|
-
props: { ...props, visible: this.visible, visiable: this.visible },
|
|
165
|
-
attrs,
|
|
166
|
-
on: childEvents,
|
|
167
|
-
});
|
|
168
|
-
if (!wrapper) return componentNode;
|
|
169
|
-
return h("el-dialog", {
|
|
170
257
|
props: {
|
|
171
|
-
|
|
172
|
-
width: "700px",
|
|
173
|
-
appendToBody: true,
|
|
174
|
-
closeOnClickModal: false,
|
|
175
|
-
...dialog,
|
|
258
|
+
...props,
|
|
176
259
|
visible: this.visible,
|
|
260
|
+
visiable: this.visible,
|
|
177
261
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
262
|
+
attrs,
|
|
263
|
+
on: childEvents,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
if (!wrapper) {
|
|
267
|
+
return componentNode;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return h(
|
|
271
|
+
"el-dialog",
|
|
272
|
+
{
|
|
273
|
+
props: {
|
|
274
|
+
title: "",
|
|
275
|
+
width: "700px",
|
|
276
|
+
appendToBody: true,
|
|
277
|
+
closeOnClickModal: false,
|
|
278
|
+
...dialog,
|
|
279
|
+
visible: this.visible,
|
|
280
|
+
},
|
|
281
|
+
on: {
|
|
282
|
+
"update:visible": (visible) => {
|
|
283
|
+
this.visible = visible;
|
|
284
|
+
},
|
|
285
|
+
close: destroy,
|
|
181
286
|
},
|
|
182
|
-
close: destroy,
|
|
183
287
|
},
|
|
184
|
-
|
|
288
|
+
[componentNode]
|
|
289
|
+
);
|
|
185
290
|
},
|
|
186
291
|
});
|
|
187
292
|
|
|
188
|
-
const parent
|
|
293
|
+
const parent
|
|
294
|
+
= parentVm
|
|
295
|
+
|| (typeof window !== "undefined" && window.$vueRoot
|
|
296
|
+
? window.$vueRoot
|
|
297
|
+
: null);
|
|
189
298
|
const instanceOptions = {};
|
|
299
|
+
|
|
190
300
|
if (parent) {
|
|
191
301
|
instanceOptions.parent = parent;
|
|
192
|
-
if (parent._i18n)
|
|
302
|
+
if (parent._i18n) {
|
|
303
|
+
instanceOptions.i18n = parent._i18n;
|
|
304
|
+
}
|
|
193
305
|
}
|
|
306
|
+
|
|
194
307
|
hostInstance = new DialogHost(instanceOptions);
|
|
195
308
|
hostInstance.$mount();
|
|
196
309
|
document.body.appendChild(hostInstance.$el);
|
|
310
|
+
|
|
197
311
|
if (options.verticalCenter !== false) {
|
|
198
312
|
resizeHandler = centerDialog;
|
|
199
313
|
window.addEventListener("resize", resizeHandler);
|
|
200
314
|
centerTimers.push(setTimeout(centerDialog, 0));
|
|
315
|
+
// 等待 el-dialog 进入动画及异步内容的首轮布局完成后再次校正。
|
|
201
316
|
centerTimers.push(setTimeout(centerDialog, 300));
|
|
202
317
|
}
|
|
318
|
+
|
|
203
319
|
return {
|
|
204
320
|
host: hostInstance,
|
|
205
321
|
instance: hostInstance.$refs.contentComponent,
|
|
206
322
|
close() {
|
|
207
|
-
if (hostInstance)
|
|
323
|
+
if (hostInstance) {
|
|
324
|
+
hostInstance.closeDialog();
|
|
325
|
+
}
|
|
208
326
|
},
|
|
209
327
|
destroy: forceDestroy,
|
|
210
328
|
recenter: centerDialog,
|
|
211
329
|
};
|
|
212
330
|
}
|
|
213
331
|
|
|
332
|
+
/**
|
|
333
|
+
* 按 Vue 源码路径、组件对象或异步 loader 打开组件弹框。
|
|
334
|
+
* wrapper=true 时用 el-dialog 包裹组件;false 时组件本身应为弹框。
|
|
335
|
+
*/
|
|
214
336
|
export async function openComponentDialog(options = {}, parentVm) {
|
|
215
|
-
const component = await
|
|
337
|
+
const component = await resolveDialogComponent(options);
|
|
216
338
|
return mountComponentDialog(component, options, parentVm);
|
|
217
339
|
}
|
package/src/utils/global.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**version-1.0*/
|
|
2
|
-
import indexUtil from "./index.js"
|
|
3
|
-
import setting from "@/settings.js"
|
|
2
|
+
import indexUtil from "./index.js";
|
|
3
|
+
import setting from "@/settings.js";
|
|
4
4
|
|
|
5
5
|
let treeScollx, treeScolly, treeScoll, initTreeRetractionEven;
|
|
6
6
|
|
|
7
7
|
let configUtil = {
|
|
8
8
|
indexUtil,
|
|
9
|
-
setting
|
|
9
|
+
setting,
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
function fc1(options) {
|
|
13
13
|
let that = options.target;
|
|
14
14
|
var $el = that.$el;
|
|
15
15
|
options = options || {};
|
|
16
|
-
var btn = options.dragBtn ? options.dragBtn :
|
|
16
|
+
var btn = options.dragBtn ? options.dragBtn : "#labBtn";
|
|
17
17
|
|
|
18
18
|
var x = $el.querySelector(btn);
|
|
19
19
|
if (x && x.innerHTML) {
|
|
20
|
-
var w,
|
|
20
|
+
var w,
|
|
21
|
+
A = !1,
|
|
21
22
|
H = document;
|
|
22
23
|
var px;
|
|
23
24
|
var npx;
|
|
24
25
|
|
|
25
|
-
|
|
26
26
|
px = options.prevDom || x.previousElementSibling;
|
|
27
27
|
npx = options.nextDom || x.nextElementSibling;
|
|
28
28
|
|
|
@@ -71,7 +71,7 @@ function fc1(options) {
|
|
|
71
71
|
}
|
|
72
72
|
w2 = ohw - w1;
|
|
73
73
|
if (w1 > ohw || w2 > ohw || w1 < 0 || w2 < 0) {
|
|
74
|
-
return !1
|
|
74
|
+
return !1;
|
|
75
75
|
}
|
|
76
76
|
if (w1 < z.prevMin) {
|
|
77
77
|
w1 = z.prevMin;
|
|
@@ -81,7 +81,7 @@ function fc1(options) {
|
|
|
81
81
|
w1 = ohw - w2;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
let p1 = parseInt(w1 * 100 / ohw);
|
|
84
|
+
let p1 = parseInt((w1 * 100) / ohw);
|
|
85
85
|
let p2 = 100 - p1;
|
|
86
86
|
|
|
87
87
|
px.style.width = p1 + "%";
|
|
@@ -89,7 +89,6 @@ function fc1(options) {
|
|
|
89
89
|
|
|
90
90
|
npx.style.width = p2 + "%";
|
|
91
91
|
npx.setAttribute("c-width", p2);
|
|
92
|
-
|
|
93
92
|
}
|
|
94
93
|
};
|
|
95
94
|
H.onmouseup = function (t) {
|
|
@@ -101,20 +100,20 @@ function fc1(options) {
|
|
|
101
100
|
H.onmouseup = null;
|
|
102
101
|
options.callback && options.callback();
|
|
103
102
|
};
|
|
104
|
-
}
|
|
103
|
+
};
|
|
105
104
|
}
|
|
106
|
-
}
|
|
105
|
+
}
|
|
107
106
|
|
|
108
107
|
function fc2(options) {
|
|
109
108
|
let that = options.target;
|
|
110
109
|
var $el = that.$el;
|
|
111
110
|
let obj = $el.querySelector(".tree-list");
|
|
112
111
|
if (obj) {
|
|
113
|
-
obj.style.width =
|
|
114
|
-
obj.style.overflow =
|
|
112
|
+
obj.style.width = "100%";
|
|
113
|
+
obj.style.overflow = "auto";
|
|
115
114
|
}
|
|
116
115
|
treeScollx(options);
|
|
117
|
-
}
|
|
116
|
+
}
|
|
118
117
|
|
|
119
118
|
function fc3(opts) {
|
|
120
119
|
let that = opts.target;
|
|
@@ -142,7 +141,7 @@ function fc3(opts) {
|
|
|
142
141
|
num1 = 6;
|
|
143
142
|
}
|
|
144
143
|
if (configUtil.indexUtil.hasClass(retraction, "retraction-on")) {
|
|
145
|
-
num1 = num1 *
|
|
144
|
+
num1 = num1 * -1;
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
var layuiCont = containter.querySelector(".layui-cont");
|
|
@@ -168,7 +167,7 @@ function fc3(opts) {
|
|
|
168
167
|
if (opts && opts.callback) {
|
|
169
168
|
opts.callback(t, a);
|
|
170
169
|
}
|
|
171
|
-
}
|
|
170
|
+
};
|
|
172
171
|
|
|
173
172
|
var todo1 = function () {
|
|
174
173
|
var cw1 = retraction.getAttribute("c-width");
|
|
@@ -193,7 +192,7 @@ function fc3(opts) {
|
|
|
193
192
|
layuiCont.style.width = "";
|
|
194
193
|
}
|
|
195
194
|
}
|
|
196
|
-
}
|
|
195
|
+
};
|
|
197
196
|
|
|
198
197
|
var toDoDragEvent = function () {
|
|
199
198
|
if (a == 1) {
|
|
@@ -207,7 +206,7 @@ function fc3(opts) {
|
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
|
-
}
|
|
209
|
+
};
|
|
211
210
|
if (a == 0) {
|
|
212
211
|
todo1();
|
|
213
212
|
}
|
|
@@ -238,7 +237,7 @@ function fc3(opts) {
|
|
|
238
237
|
toDo();
|
|
239
238
|
}, 300);
|
|
240
239
|
}
|
|
241
|
-
}
|
|
240
|
+
};
|
|
242
241
|
|
|
243
242
|
var leftBtn = containter.querySelector(".retraction-left .iconprev");
|
|
244
243
|
if (leftBtn) {
|
|
@@ -253,16 +252,17 @@ function fc3(opts) {
|
|
|
253
252
|
changeRetraction(rightBtn, 1, opts);
|
|
254
253
|
};
|
|
255
254
|
}
|
|
256
|
-
}
|
|
255
|
+
}
|
|
257
256
|
|
|
258
257
|
function fc4(options) {
|
|
259
258
|
let that = options.target;
|
|
260
259
|
var $el = that.$el;
|
|
261
|
-
var btn = options.dragBtn ? options.dragBtn :
|
|
260
|
+
var btn = options.dragBtn ? options.dragBtn : "#labBtn";
|
|
262
261
|
|
|
263
262
|
var x = $el.querySelector(btn);
|
|
264
263
|
if (x && x.innerHTML) {
|
|
265
|
-
var w,
|
|
264
|
+
var w,
|
|
265
|
+
A = !1,
|
|
266
266
|
H = document;
|
|
267
267
|
var px;
|
|
268
268
|
var npx;
|
|
@@ -279,8 +279,14 @@ function fc4(options) {
|
|
|
279
279
|
var npxw = npx.getBoundingClientRect().height;
|
|
280
280
|
var ohw = pxw + npxw;
|
|
281
281
|
|
|
282
|
-
let defalutPrevMinY =
|
|
283
|
-
|
|
282
|
+
let defalutPrevMinY =
|
|
283
|
+
configUtil.setting.defalutPrevMinY > pxw
|
|
284
|
+
? pxw
|
|
285
|
+
: configUtil.setting.defalutPrevMinY;
|
|
286
|
+
let defalutNextMinY =
|
|
287
|
+
configUtil.setting.defalutNextMinY > npxw
|
|
288
|
+
? npxw
|
|
289
|
+
: configUtil.setting.defalutNextMinY;
|
|
284
290
|
|
|
285
291
|
var z = {
|
|
286
292
|
prevMin: pxw,
|
|
@@ -321,7 +327,7 @@ function fc4(options) {
|
|
|
321
327
|
}
|
|
322
328
|
w2 = ohw - w1;
|
|
323
329
|
if (w1 > ohw || w2 > ohw || w1 < 0 || w2 < 0) {
|
|
324
|
-
return !1
|
|
330
|
+
return !1;
|
|
325
331
|
}
|
|
326
332
|
if (w1 < z.prevMin) {
|
|
327
333
|
w1 = z.prevMin;
|
|
@@ -331,7 +337,7 @@ function fc4(options) {
|
|
|
331
337
|
w1 = ohw - w2;
|
|
332
338
|
}
|
|
333
339
|
|
|
334
|
-
let p1 = parseInt(w1 * 100 / ohw);
|
|
340
|
+
let p1 = parseInt((w1 * 100) / ohw);
|
|
335
341
|
let p2 = 100 - p1;
|
|
336
342
|
|
|
337
343
|
if (options.rate === true) {
|
|
@@ -356,18 +362,13 @@ function fc4(options) {
|
|
|
356
362
|
H.onmouseup = null;
|
|
357
363
|
options.callback && options.callback();
|
|
358
364
|
};
|
|
359
|
-
}
|
|
365
|
+
};
|
|
360
366
|
}
|
|
361
|
-
}
|
|
367
|
+
}
|
|
362
368
|
|
|
363
369
|
treeScollx = fc1;
|
|
364
370
|
treeScoll = fc2;
|
|
365
371
|
initTreeRetractionEven = fc3;
|
|
366
372
|
treeScolly = fc4;
|
|
367
373
|
|
|
368
|
-
export {
|
|
369
|
-
treeScollx,
|
|
370
|
-
treeScolly,
|
|
371
|
-
treeScoll,
|
|
372
|
-
initTreeRetractionEven
|
|
373
|
-
};
|
|
374
|
+
export { treeScollx, treeScolly, treeScoll, initTreeRetractionEven };
|