cloud-web-corejs 1.1.0-dev.20 → 1.1.0-dev.22
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 +1 -1
- package/src/components/excelExport/conditionExportConfig.js +112 -0
- package/src/components/excelExport/exportType.js +8 -0
- package/src/components/excelExport/index.vue +7 -1
- package/src/components/excelExport/mixins.js +410 -259
- package/src/components/xform/form-designer/designer.js +0 -15
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +2 -1
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +163 -136
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +74 -9
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/empty-number-input.vue +51 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +27 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +33 -3
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +6 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +6 -6
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +4 -4
- package/src/components/xform/form-render/container-item/tab-item.vue +1 -1
- package/src/components/xform/form-render/fieldControlEngine.js +18 -0
- package/src/components/xform/form-render/fieldControlMixin.js +39 -29
- package/src/components/xform/form-render/index.vue +7 -4
- package/src/components/xform/form-render/indexMixin.js +26 -15
- package/src/components/xform/utils/util.js +0 -1
- package/src/views/user/home/default.vue +6 -3
- package/src/views/user/home/wjl/content.vue +3 -2
- package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +0 -285
- package/src/components/xform/form-render/formDynamicFieldMixin.js +0 -133
package/package.json
CHANGED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { getLogicParamValue } from "@base/api/user";
|
|
2
|
+
|
|
3
|
+
export const CONDITION_EXPORT_PARAM_CODE = "conditionExportParams";
|
|
4
|
+
export const CONDITION_EXPORT_SEARCH_COUNT_CODE
|
|
5
|
+
= "conditionExportSearchCount";
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_CONDITION_EXPORT_CONFIG = Object.freeze({
|
|
8
|
+
maxQueryTotal: 300000,
|
|
9
|
+
pageSize: 1000,
|
|
10
|
+
limitFileSize: 100000,
|
|
11
|
+
searchCount: true,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function parsePositiveInteger(value, fallback) {
|
|
15
|
+
let text = String(value == null ? "" : value).trim();
|
|
16
|
+
if (!/^\d+$/.test(text)) return fallback;
|
|
17
|
+
let result = Number(text);
|
|
18
|
+
if (!Number.isSafeInteger(result) || result <= 0) return fallback;
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 解析「最大查询总数;每页查询数量;单文件最大数据量」。每一项独立回落默认值,
|
|
24
|
+
* 避免一项填错导致另外两项已生效的配置也被丢弃。
|
|
25
|
+
*/
|
|
26
|
+
export function parseConditionExportParams(rawValue) {
|
|
27
|
+
let values = typeof rawValue === "string" ? rawValue.split(";") : [];
|
|
28
|
+
return {
|
|
29
|
+
maxQueryTotal: parsePositiveInteger(
|
|
30
|
+
values[0],
|
|
31
|
+
DEFAULT_CONDITION_EXPORT_CONFIG.maxQueryTotal
|
|
32
|
+
),
|
|
33
|
+
pageSize: parsePositiveInteger(
|
|
34
|
+
values[1],
|
|
35
|
+
DEFAULT_CONDITION_EXPORT_CONFIG.pageSize
|
|
36
|
+
),
|
|
37
|
+
limitFileSize: parsePositiveInteger(
|
|
38
|
+
values[2],
|
|
39
|
+
DEFAULT_CONDITION_EXPORT_CONFIG.limitFileSize
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function parseConditionExportSearchCount(rawValue, fallback = true) {
|
|
45
|
+
if (typeof rawValue === "boolean") return rawValue;
|
|
46
|
+
if (typeof rawValue !== "string") return fallback;
|
|
47
|
+
let value = rawValue.trim().toLowerCase();
|
|
48
|
+
if (value === "true") return true;
|
|
49
|
+
if (value === "false") return false;
|
|
50
|
+
return fallback;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function readLogicParam(paramCode) {
|
|
54
|
+
return getLogicParamValue({
|
|
55
|
+
data: { paramCode },
|
|
56
|
+
modal: false,
|
|
57
|
+
failMsg: false,
|
|
58
|
+
errorMsg: false,
|
|
59
|
+
})
|
|
60
|
+
.then((res) => (res && res.type === "success" ? res.objx : ""))
|
|
61
|
+
.catch(() => "");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 读取两条全局逻辑参数;接口异常时静默使用内置默认值。 */
|
|
65
|
+
export function loadConditionExportConfig() {
|
|
66
|
+
return Promise.all([
|
|
67
|
+
readLogicParam(CONDITION_EXPORT_PARAM_CODE),
|
|
68
|
+
readLogicParam(CONDITION_EXPORT_SEARCH_COUNT_CODE),
|
|
69
|
+
]).then(([paramsRaw, searchCountRaw]) => ({
|
|
70
|
+
...parseConditionExportParams(paramsRaw),
|
|
71
|
+
searchCount: parseConditionExportSearchCount(searchCountRaw, true),
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 从导出按钮 options 取出条件导出的三项覆盖值。空值转成 null,交给
|
|
77
|
+
* resolveConditionExportConfig 回落到全局逻辑参数。
|
|
78
|
+
*/
|
|
79
|
+
export function pickConditionExportOverrides(fieldOptions = {}) {
|
|
80
|
+
return {
|
|
81
|
+
pageSize: fieldOptions.exportPageSize || null,
|
|
82
|
+
maxQueryTotal: fieldOptions.maxQueryTotal || null,
|
|
83
|
+
limitFileSize: fieldOptions.limitFileSize || null,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 单次导出参数优先于全局逻辑参数。按钮参数与脚本参数在进入导出器前已经合并,且脚本
|
|
89
|
+
* 位于展开表达式右侧,所以这里读取到的 option 天然满足「脚本 > 按钮 > 全局」。
|
|
90
|
+
*/
|
|
91
|
+
export function resolveConditionExportConfig(globalConfig, option = {}) {
|
|
92
|
+
let base = globalConfig || DEFAULT_CONDITION_EXPORT_CONFIG;
|
|
93
|
+
let searchCountOverride
|
|
94
|
+
= option.conditionExportSearchCount !== undefined
|
|
95
|
+
? option.conditionExportSearchCount
|
|
96
|
+
: option.searchCount;
|
|
97
|
+
return {
|
|
98
|
+
maxQueryTotal: parsePositiveInteger(
|
|
99
|
+
option.maxQueryTotal,
|
|
100
|
+
base.maxQueryTotal
|
|
101
|
+
),
|
|
102
|
+
pageSize: parsePositiveInteger(option.pageSize, base.pageSize),
|
|
103
|
+
limitFileSize: parsePositiveInteger(
|
|
104
|
+
option.limitFileSize,
|
|
105
|
+
base.limitFileSize
|
|
106
|
+
),
|
|
107
|
+
searchCount: parseConditionExportSearchCount(
|
|
108
|
+
searchCountOverride,
|
|
109
|
+
base.searchCount
|
|
110
|
+
),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -39,6 +39,14 @@ export function isRowExport(type) {
|
|
|
39
39
|
return type === EXPORT_TYPE.SELECTED || type === EXPORT_TYPE.CURRENT;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* 是否条件导出。主表条件导出的历史 type 是 null/undefined;明细条件导出有独立类型。
|
|
44
|
+
* 明细选择导出虽然也走后端分页,但不受条件导出全局上限与查总数开关影响。
|
|
45
|
+
*/
|
|
46
|
+
export function isConditionExport(type) {
|
|
47
|
+
return type == null || type === EXPORT_TYPE.ITEM_CONDITION;
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
/**
|
|
43
51
|
* 是否必须先勾选行:空勾选要拦截,且以勾选行 id 作为查询条件。
|
|
44
52
|
* @param {String|null} type 导出模式。
|
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
<div class="export-box">
|
|
42
42
|
<div class="tips">
|
|
43
43
|
{{ $t2("导出中,请勿关闭当前窗口", "components.excelExport.tip") }}
|
|
44
|
+
<template v-if="conditionExportMode">
|
|
45
|
+
,{{
|
|
46
|
+
$t2("导出最大数据量", "components.excelExport.maxDataSize")
|
|
47
|
+
}}:{{ conditionExportConfig.maxQueryTotal
|
|
48
|
+
}}{{ $t2("条", "components.excelExport.rowUnit") }}
|
|
49
|
+
</template>
|
|
44
50
|
</div>
|
|
45
51
|
<el-progress
|
|
46
52
|
:text-inside="true"
|
|
@@ -62,7 +68,7 @@
|
|
|
62
68
|
<div class="fl import-count">
|
|
63
69
|
<span class="f-red doneNum">{{ doneSize }}</span>
|
|
64
70
|
/
|
|
65
|
-
<span class="dataSize">{{
|
|
71
|
+
<span class="dataSize">{{ exportTotalText }}</span>
|
|
66
72
|
</div>
|
|
67
73
|
<el-button type="primary" plain class="button-sty" @click="dialogClose2">
|
|
68
74
|
<i class="el-icon-close el-icon"></i>
|