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
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<template v-for="(value, type) in paperTypes">
|
|
7
7
|
<el-button
|
|
8
8
|
size="mini"
|
|
9
|
+
class="button-sty"
|
|
9
10
|
:type="curPaperType === type ? 'primary' : ' '"
|
|
10
11
|
@click="setPaper(type, value)"
|
|
11
12
|
:key="type"
|
|
@@ -88,13 +89,14 @@
|
|
|
88
89
|
<el-button type="warning" class="button-sty" icon="el-icon-view" @click="preView"
|
|
89
90
|
>预览</el-button
|
|
90
91
|
>
|
|
91
|
-
<el-popover width="
|
|
92
|
+
<el-popover width="219" v-model="visible" @confirm="clearPaper">
|
|
92
93
|
<p><i class="el-icon-warning-outline f-red"></i> 是否确认清空??</p>
|
|
93
94
|
<div style="text-align: right; margin: 0">
|
|
94
|
-
<el-button size="mini" type="
|
|
95
|
+
<el-button size="mini" type="primary" plain @click="visible = false" class="button-sty">取消</el-button>
|
|
95
96
|
<el-button
|
|
96
97
|
type="primary"
|
|
97
98
|
size="mini"
|
|
99
|
+
class="button-sty"
|
|
98
100
|
@click="
|
|
99
101
|
clearPaper();
|
|
100
102
|
visible = false;
|
|
@@ -430,4 +432,7 @@ export default {
|
|
|
430
432
|
overflow-x: auto;
|
|
431
433
|
overflow-y: auto;
|
|
432
434
|
}
|
|
435
|
+
button.el-button{
|
|
436
|
+
&.button-sty{color:#FFF;font-size: 12px;line-height: 26px;padding:0 12px;}
|
|
437
|
+
}
|
|
433
438
|
</style>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function parseExportContent(content) {
|
|
2
|
+
if (!content) {
|
|
3
|
+
return { list: [], isArray: true };
|
|
4
|
+
}
|
|
5
|
+
try {
|
|
6
|
+
const parsed = JSON.parse(content);
|
|
7
|
+
if (Array.isArray(parsed)) {
|
|
8
|
+
return { list: parsed, isArray: true };
|
|
9
|
+
}
|
|
10
|
+
return { list: [parsed], isArray: false };
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return { list: [], isArray: true, invalid: true };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function uniqueFileName(fileName, usedNames) {
|
|
17
|
+
if (!usedNames[fileName]) {
|
|
18
|
+
usedNames[fileName] = 1;
|
|
19
|
+
return fileName;
|
|
20
|
+
}
|
|
21
|
+
usedNames[fileName] += 1;
|
|
22
|
+
return `${fileName}_${usedNames[fileName]}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ARCHIVE_TYPE = {
|
|
26
|
+
FORM_SCRIPT: "formScript",
|
|
27
|
+
FORM_TEMPLATE: "formTemplate",
|
|
28
|
+
TABLE: "table",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const ARCHIVE_URL_MAP = [
|
|
32
|
+
{ match: "/form_develop/exportFormScript", type: ARCHIVE_TYPE.FORM_SCRIPT },
|
|
33
|
+
{ match: "/form_develop/exportFormTemplate", type: ARCHIVE_TYPE.FORM_TEMPLATE },
|
|
34
|
+
{ match: "/form_develop/exportSzTaMb", type: ARCHIVE_TYPE.TABLE },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export function getExportArchiveType(url) {
|
|
38
|
+
if (!url) return null;
|
|
39
|
+
const config = ARCHIVE_URL_MAP.find((item) => url.includes(item.match));
|
|
40
|
+
return config ? config.type : null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getFormScriptFileName(scriptCode, formCode) {
|
|
44
|
+
const code = scriptCode || "script";
|
|
45
|
+
return formCode ? `S&${code}&${formCode}` : `S&${code}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function buildFormTemplateScriptExtras(item) {
|
|
49
|
+
const formCode = item.formCode || "form";
|
|
50
|
+
const usedNames = {};
|
|
51
|
+
|
|
52
|
+
return (item.formScriptDTOs || []).reduce((files, scriptItem) => {
|
|
53
|
+
if (!scriptItem) return files;
|
|
54
|
+
files.push({
|
|
55
|
+
fileName: uniqueFileName(
|
|
56
|
+
getFormScriptFileName(scriptItem.scriptCode, scriptItem.formCode || formCode),
|
|
57
|
+
usedNames
|
|
58
|
+
),
|
|
59
|
+
content: JSON.stringify(scriptItem, null, 2),
|
|
60
|
+
});
|
|
61
|
+
return files;
|
|
62
|
+
}, []);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function buildArchiveResult(item, archiveType) {
|
|
66
|
+
switch (archiveType) {
|
|
67
|
+
case ARCHIVE_TYPE.FORM_SCRIPT:
|
|
68
|
+
return {
|
|
69
|
+
mainContent: JSON.stringify(item, null, 2),
|
|
70
|
+
mainFileName: getFormScriptFileName(item.scriptCode, item.formCode),
|
|
71
|
+
extraFiles: [],
|
|
72
|
+
};
|
|
73
|
+
case ARCHIVE_TYPE.FORM_TEMPLATE: {
|
|
74
|
+
const extraFiles = buildFormTemplateScriptExtras(item);
|
|
75
|
+
const formTemplate = {
|
|
76
|
+
...item,
|
|
77
|
+
formScriptDTOs: null,
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
mainContent: JSON.stringify(formTemplate, null, 2),
|
|
81
|
+
mainFileName: `F&${item.formCode || "form"}`,
|
|
82
|
+
extraFiles,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case ARCHIVE_TYPE.TABLE:
|
|
86
|
+
return {
|
|
87
|
+
mainContent: JSON.stringify(item, null, 2),
|
|
88
|
+
mainFileName: `T&${item.taBm || "table"}`,
|
|
89
|
+
extraFiles: [],
|
|
90
|
+
};
|
|
91
|
+
default:
|
|
92
|
+
return {
|
|
93
|
+
mainContent: JSON.stringify(item, null, 2),
|
|
94
|
+
mainFileName: null,
|
|
95
|
+
extraFiles: [],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function processArchiveExport(content, archiveType) {
|
|
101
|
+
const { list, invalid } = parseExportContent(content);
|
|
102
|
+
if (invalid || !list.length) {
|
|
103
|
+
return { mainContent: content, mainFileName: null, extraFiles: [] };
|
|
104
|
+
}
|
|
105
|
+
return buildArchiveResult(list[0], archiveType);
|
|
106
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
const moudule = {};
|
|
2
|
-
import vue from "vue"
|
|
3
|
-
import excelImport from
|
|
2
|
+
import vue from "vue";
|
|
3
|
+
import excelImport from "./index.vue";
|
|
4
4
|
import exportDialog from "./exportDialog.vue";
|
|
5
|
-
import {getBdEnv} from "@base/api/user";
|
|
6
|
-
import {encrypt
|
|
7
|
-
|
|
5
|
+
import { getBdEnv } from "@base/api/user";
|
|
6
|
+
import { encrypt } from "@base/utils/aes";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
getExportArchiveType,
|
|
9
|
+
processArchiveExport,
|
|
10
|
+
} from "./exportUtil";
|
|
11
|
+
|
|
12
|
+
import { getToken } from "../../utils/auth";
|
|
11
13
|
|
|
12
14
|
let configUtil = {
|
|
13
15
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
14
|
-
getToken
|
|
16
|
+
getToken,
|
|
15
17
|
};
|
|
16
18
|
const ExcelImportInstance = vue.extend(excelImport);
|
|
17
19
|
const ExportDialogInstance = vue.extend(exportDialog);
|
|
@@ -19,9 +21,9 @@ const initInstance = function (containter, flag) {
|
|
|
19
21
|
// 实例化vue实例
|
|
20
22
|
let currentInstance;
|
|
21
23
|
if (flag == 1) {
|
|
22
|
-
currentInstance = new ExcelImportInstance({i18n: window.$vueRoot._i18n});
|
|
24
|
+
currentInstance = new ExcelImportInstance({ i18n: window.$vueRoot._i18n });
|
|
23
25
|
} else {
|
|
24
|
-
currentInstance = new ExportDialogInstance({i18n: window.$vueRoot._i18n});
|
|
26
|
+
currentInstance = new ExportDialogInstance({ i18n: window.$vueRoot._i18n });
|
|
25
27
|
}
|
|
26
28
|
let dom = currentInstance.$mount().$el;
|
|
27
29
|
containter.appendChild(dom);
|
|
@@ -34,9 +36,9 @@ function toDo(options) {
|
|
|
34
36
|
let vueTarget = this && this.$el ? this : window.$vueRoot;
|
|
35
37
|
let currentInstance = initInstance(containter, 1);
|
|
36
38
|
currentInstance.param = {};
|
|
37
|
-
Object.assign(currentInstance.param, {vue: vueTarget}, options);
|
|
39
|
+
Object.assign(currentInstance.param, { vue: vueTarget }, options);
|
|
38
40
|
return currentInstance.exc();
|
|
39
|
-
}
|
|
41
|
+
}
|
|
40
42
|
|
|
41
43
|
function openExportDialog(options, callback) {
|
|
42
44
|
// let containter = this && this.$el ? this.$el : document.body;
|
|
@@ -44,9 +46,11 @@ function openExportDialog(options, callback) {
|
|
|
44
46
|
let vueTarget = this && this.$el ? this : window.$vueRoot;
|
|
45
47
|
let currentInstance = initInstance(containter, 2);
|
|
46
48
|
currentInstance.param = {};
|
|
47
|
-
Object.assign(currentInstance.param, {vue: vueTarget}, options, {
|
|
49
|
+
Object.assign(currentInstance.param, { vue: vueTarget }, options, {
|
|
50
|
+
confirm: callback,
|
|
51
|
+
});
|
|
48
52
|
// return currentInstance.exc();
|
|
49
|
-
}
|
|
53
|
+
}
|
|
50
54
|
|
|
51
55
|
// 定义插件对象
|
|
52
56
|
// vue的install方法,用于定义vue插件
|
|
@@ -55,77 +59,98 @@ moudule.install = function (Vue) {
|
|
|
55
59
|
Vue.prototype.$jsonImport = toDo;
|
|
56
60
|
|
|
57
61
|
Vue.prototype.$jsonExport = async function (options) {
|
|
58
|
-
let reqData = {};
|
|
59
62
|
let targetRef = options.targetRef;
|
|
60
63
|
let abcEnabled = options.abcEnabled !== false;
|
|
61
64
|
let editAuth = options.editAuth;
|
|
62
65
|
let selectTypeAuth = options.selectTypeAuth;
|
|
63
66
|
let that = this;
|
|
64
67
|
|
|
65
|
-
let ids = []
|
|
68
|
+
let ids = [];
|
|
66
69
|
if (options.data) {
|
|
67
|
-
ids = options.data
|
|
70
|
+
ids = options.data;
|
|
68
71
|
} else if (targetRef) {
|
|
69
|
-
let url = options
|
|
72
|
+
let url = options;
|
|
70
73
|
let checkRows = this.$refs[targetRef].getCheckboxRecords(true);
|
|
71
74
|
if (!checkRows.length) {
|
|
72
|
-
this.$baseAlert(this.$t1(
|
|
73
|
-
return
|
|
75
|
+
this.$baseAlert(this.$t1("请选择需要导出的数据"));
|
|
76
|
+
return;
|
|
74
77
|
}
|
|
75
|
-
ids = checkRows.map(item => item.id);
|
|
78
|
+
ids = checkRows.map((item) => item.id);
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
let handle = function (abc) {
|
|
79
82
|
let reqData = {
|
|
80
|
-
ids
|
|
81
|
-
}
|
|
83
|
+
ids,
|
|
84
|
+
};
|
|
82
85
|
if (abc) {
|
|
83
86
|
reqData.abc = abc;
|
|
84
87
|
}
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
if (options.plaintext) {
|
|
89
|
+
reqData.plaintext = options.plaintext;
|
|
87
90
|
}
|
|
91
|
+
let data = {
|
|
92
|
+
datas: encrypt(JSON.stringify(reqData)),
|
|
93
|
+
};
|
|
88
94
|
|
|
89
95
|
that.$http({
|
|
90
96
|
url: options.url,
|
|
91
97
|
method: `post`,
|
|
92
98
|
data: data,
|
|
93
99
|
isLoading: true,
|
|
94
|
-
success: res => {
|
|
95
|
-
let content = res.objx
|
|
100
|
+
success: (res) => {
|
|
101
|
+
let content = res.objx;
|
|
96
102
|
if (content && content !== "[]") {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
const archiveType = options.plaintext
|
|
104
|
+
&& getExportArchiveType(options.url);
|
|
105
|
+
|
|
106
|
+
if (archiveType) {
|
|
107
|
+
const processed = processArchiveExport(content, archiveType);
|
|
108
|
+
downloadTxt(processed.mainFileName, processed.mainContent);
|
|
109
|
+
(processed.extraFiles || []).forEach((file, index) => {
|
|
110
|
+
setTimeout(() => {
|
|
111
|
+
downloadTxt(file.fileName, file.content);
|
|
112
|
+
}, (index + 1) * 300);
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
let fileName = options.fileName;
|
|
116
|
+
if (!fileName) {
|
|
117
|
+
const timeStr = res.time
|
|
118
|
+
.replaceAll(":", "")
|
|
119
|
+
.replaceAll("-", "")
|
|
120
|
+
.replaceAll(" ", "");
|
|
121
|
+
fileName = `${options.title}(${timeStr})`;
|
|
122
|
+
}
|
|
123
|
+
downloadTxt(fileName, content);
|
|
124
|
+
}
|
|
100
125
|
} else {
|
|
101
|
-
this.$baseAlert(this.$t1(
|
|
126
|
+
this.$baseAlert(this.$t1("不存在需要导出的数据"));
|
|
102
127
|
}
|
|
103
|
-
}
|
|
128
|
+
},
|
|
104
129
|
});
|
|
105
|
-
}
|
|
130
|
+
};
|
|
106
131
|
let isDev = true;
|
|
107
132
|
if (abcEnabled) {
|
|
108
133
|
await getBdEnv({
|
|
109
134
|
isLoading: true,
|
|
110
|
-
success: res => {
|
|
111
|
-
isDev = res.objx == "dev"
|
|
112
|
-
}
|
|
135
|
+
success: (res) => {
|
|
136
|
+
isDev = res.objx == "dev";
|
|
137
|
+
},
|
|
113
138
|
});
|
|
114
139
|
}
|
|
115
140
|
if (isDev && abcEnabled && editAuth === 1 && selectTypeAuth == 1) {
|
|
116
141
|
openExportDialog(options, (abc) => {
|
|
117
|
-
handle(abc)
|
|
118
|
-
})
|
|
142
|
+
handle(abc);
|
|
143
|
+
});
|
|
119
144
|
} else {
|
|
120
|
-
this.$baseConfirm(this.$t1(
|
|
121
|
-
let abc = null
|
|
145
|
+
this.$baseConfirm(this.$t1("您确定要导出吗?")).then(() => {
|
|
146
|
+
let abc = null;
|
|
122
147
|
if (abcEnabled) {
|
|
123
148
|
if (isDev) {
|
|
124
149
|
if (!editAuth || !selectTypeAuth) {
|
|
125
|
-
abc = "B"
|
|
150
|
+
abc = "B";
|
|
126
151
|
}
|
|
127
152
|
} else {
|
|
128
|
-
abc = "A"
|
|
153
|
+
abc = "A";
|
|
129
154
|
}
|
|
130
155
|
}
|
|
131
156
|
handle(abc);
|
|
@@ -136,13 +161,13 @@ moudule.install = function (Vue) {
|
|
|
136
161
|
|
|
137
162
|
function downloadTxt(fileName, content) {
|
|
138
163
|
// 创建Blob对象
|
|
139
|
-
const blob = new Blob([content], {type:
|
|
164
|
+
const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
|
|
140
165
|
// 创建URL
|
|
141
166
|
const url = URL.createObjectURL(blob);
|
|
142
167
|
// 创建a标签
|
|
143
|
-
const link = document.createElement(
|
|
168
|
+
const link = document.createElement("a");
|
|
144
169
|
link.href = url;
|
|
145
|
-
link.setAttribute(
|
|
170
|
+
link.setAttribute("download", fileName + ".txt");
|
|
146
171
|
document.body.appendChild(link);
|
|
147
172
|
// 触发下载
|
|
148
173
|
link.click();
|
|
@@ -156,11 +181,11 @@ function download(ippaaapp, uuid) {
|
|
|
156
181
|
let params = {
|
|
157
182
|
// n: fileName
|
|
158
183
|
};
|
|
159
|
-
params[
|
|
184
|
+
params["access_token"] = getToken();
|
|
160
185
|
|
|
161
|
-
let form = document.createElement(
|
|
186
|
+
let form = document.createElement("form");
|
|
162
187
|
|
|
163
|
-
let randomNum =
|
|
188
|
+
let randomNum = new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
164
189
|
let formId = "formId-" + randomNum;
|
|
165
190
|
let formName = "formName-" + randomNum;
|
|
166
191
|
|
|
@@ -170,8 +195,8 @@ function download(ippaaapp, uuid) {
|
|
|
170
195
|
document.body.appendChild(form);
|
|
171
196
|
for (let obj in params) {
|
|
172
197
|
if (params.hasOwnProperty(obj)) {
|
|
173
|
-
let input = document.createElement(
|
|
174
|
-
input.tpye =
|
|
198
|
+
let input = document.createElement("input");
|
|
199
|
+
input.tpye = "hidden";
|
|
175
200
|
input.name = obj;
|
|
176
201
|
input.value = params[obj];
|
|
177
202
|
form.appendChild(input);
|