cloud-web-corejs 1.0.270 → 1.0.272
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/xform/form-designer/form-widget/field-widget/date-widget.vue +5 -1
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +6 -0
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +29 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +3 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +20 -10
package/package.json
CHANGED
|
@@ -25,11 +25,12 @@ import FormItemWrapper from './form-item-wrapper'
|
|
|
25
25
|
import emitter from '../../../../../components/xform/utils/emitter'
|
|
26
26
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
27
27
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
28
|
+
import dateLimitMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin";
|
|
28
29
|
|
|
29
30
|
export default {
|
|
30
31
|
name: "date-widget",
|
|
31
32
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
32
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
33
|
+
mixins: [emitter, fieldMixin, i18n, dateLimitMixin],
|
|
33
34
|
props: {
|
|
34
35
|
field: Object,
|
|
35
36
|
parentWidget: Object,
|
|
@@ -95,6 +96,9 @@ export default {
|
|
|
95
96
|
}
|
|
96
97
|
}]
|
|
97
98
|
}
|
|
99
|
+
|
|
100
|
+
//须在 handleOnCreated 之后:脚本里设的 field.options.minDate 不是响应式的,靠此处顺序读取
|
|
101
|
+
this.initDateLimitPickerOptions()
|
|
98
102
|
},
|
|
99
103
|
|
|
100
104
|
mounted() {
|
package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js
CHANGED
|
@@ -58,6 +58,12 @@ export default {
|
|
|
58
58
|
if (val === null || val === undefined || val === "") {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
+
if (val instanceof Date) {
|
|
62
|
+
return isNaN(val.getTime()) ? null : val.getTime();
|
|
63
|
+
}
|
|
64
|
+
if (typeof val === "number") {
|
|
65
|
+
return isNaN(val) ? null : val;
|
|
66
|
+
}
|
|
61
67
|
const date = new Date(String(val).replace(/-/g, "/"));
|
|
62
68
|
return isNaN(date.getTime()) ? null : date.getTime();
|
|
63
69
|
},
|
|
@@ -8,12 +8,31 @@
|
|
|
8
8
|
:parent-list="parentList"
|
|
9
9
|
:index-of-parent-list="indexOfParentList"
|
|
10
10
|
>
|
|
11
|
+
<el-dropdown
|
|
12
|
+
v-if="field.options.exportItemConditionEnabled"
|
|
13
|
+
trigger="hover"
|
|
14
|
+
:disabled="field.options.disabled"
|
|
15
|
+
>
|
|
16
|
+
<el-button :type="field.options.type" class="button-sty" size="mini">
|
|
17
|
+
<span>{{ getI18nLabel(field.options.label) }}</span
|
|
18
|
+
><span class="line"></span> <i class="el-icon-arrow-down el-icon--right"></i>
|
|
19
|
+
</el-button>
|
|
20
|
+
<el-dropdown-menu slot="dropdown">
|
|
21
|
+
<el-dropdown-item icon="el-icon-upload2" @click.native="toConditionExport">
|
|
22
|
+
{{ getI18nLabel("条件导出") }}
|
|
23
|
+
</el-dropdown-item>
|
|
24
|
+
<el-dropdown-item icon="el-icon-upload2" @click.native="toSelectedExport">
|
|
25
|
+
{{ getI18nLabel("选择导出") }}
|
|
26
|
+
</el-dropdown-item>
|
|
27
|
+
</el-dropdown-menu>
|
|
28
|
+
</el-dropdown>
|
|
11
29
|
<el-button
|
|
30
|
+
v-else
|
|
12
31
|
:type="field.options.type"
|
|
13
32
|
class="button-sty"
|
|
14
33
|
size="mini"
|
|
15
34
|
icon="el-icon-upload2"
|
|
16
|
-
@click="
|
|
35
|
+
@click="toSelectedExport"
|
|
17
36
|
:disabled="field.options.disabled"
|
|
18
37
|
>{{ getI18nLabel(field.options.label) }}
|
|
19
38
|
</el-button>
|
|
@@ -24,6 +43,7 @@ import emitter from "../../../utils/emitter";
|
|
|
24
43
|
import i18n from "../../../utils/i18n";
|
|
25
44
|
import fieldMixin from "./fieldMixin";
|
|
26
45
|
import StaticContentWrapper from "./static-content-wrapper.vue";
|
|
46
|
+
import { EXPORT_TYPE } from "../../../../excelExport/exportType";
|
|
27
47
|
|
|
28
48
|
export default {
|
|
29
49
|
name: "select-export-item-button-widget",
|
|
@@ -66,6 +86,14 @@ export default {
|
|
|
66
86
|
},
|
|
67
87
|
|
|
68
88
|
methods: {
|
|
89
|
+
/** 明细·条件导出:按当前搜索条件导出,无需勾选。仅在开启「支持条件导出」时可达。 */
|
|
90
|
+
toConditionExport() {
|
|
91
|
+
this.toDo(EXPORT_TYPE.ITEM_CONDITION);
|
|
92
|
+
},
|
|
93
|
+
/** 明细·选择导出:以勾选行为范围,历史默认行为。 */
|
|
94
|
+
toSelectedExport() {
|
|
95
|
+
this.toDo(EXPORT_TYPE.ITEM_SELECTED);
|
|
96
|
+
},
|
|
69
97
|
toDo(type = null) {
|
|
70
98
|
if (this.designState) {
|
|
71
99
|
return;
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
<el-form-item label="表格唯一名称">
|
|
10
10
|
<el-input v-model="optionModel.tableRef"></el-input>
|
|
11
11
|
</el-form-item>
|
|
12
|
+
<el-form-item label="支持条件导出">
|
|
13
|
+
<el-switch v-model="optionModel.exportItemConditionEnabled"></el-switch>
|
|
14
|
+
</el-form-item>
|
|
12
15
|
<el-form-item label="导出列表显示图片">
|
|
13
16
|
<el-switch
|
|
14
17
|
v-model="optionModel.showImageAtTable"
|
|
@@ -22,6 +22,11 @@ import {
|
|
|
22
22
|
} from "../../../../components/xform/utils/util";
|
|
23
23
|
import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
|
|
24
24
|
import { applyColumnLabelIcon } from "../../../../components/xform/utils/tableColumnHelper";
|
|
25
|
+
import {
|
|
26
|
+
EXPORT_TYPE,
|
|
27
|
+
isItemExport,
|
|
28
|
+
requiresCheckedRows,
|
|
29
|
+
} from "../../../../components/excelExport/exportType";
|
|
25
30
|
|
|
26
31
|
let modules = {};
|
|
27
32
|
const baseRefUtil = {
|
|
@@ -1505,8 +1510,10 @@ modules = {
|
|
|
1505
1510
|
let originOption = $grid.params.originOption;
|
|
1506
1511
|
let formData = {};
|
|
1507
1512
|
|
|
1508
|
-
|
|
1509
|
-
|
|
1513
|
+
// 明细·选择导出已按勾选行 id 精确定位,再叠加主表搜索条件既无意义、又可能
|
|
1514
|
+
// 与明细口径的字段名冲突造成双重过滤,故只有它排除搜索条件;
|
|
1515
|
+
// 明细·条件导出与主表条件导出一样,必须带上搜索条件。
|
|
1516
|
+
if (customParam?.exportParam?.type !== EXPORT_TYPE.ITEM_SELECTED) {
|
|
1510
1517
|
formData = tableOption.param ? tableOption.param() || {} : {};
|
|
1511
1518
|
}
|
|
1512
1519
|
const queryParams = Object.assign({}, formData);
|
|
@@ -1960,7 +1967,8 @@ modules = {
|
|
|
1960
1967
|
let scriptCode = this.getScriptCode();
|
|
1961
1968
|
let accessParam = {};
|
|
1962
1969
|
let otherParam = {};
|
|
1963
|
-
|
|
1970
|
+
let exportType = customParam?.exportParam?.type;
|
|
1971
|
+
if (isItemExport(exportType)) {
|
|
1964
1972
|
let $grid = this.getGridTable();
|
|
1965
1973
|
let originOption = $grid.params.originOption;
|
|
1966
1974
|
let exportItemConfig = originOption.exportItemConfig || {};
|
|
@@ -1980,14 +1988,16 @@ modules = {
|
|
|
1980
1988
|
otherParam.attachmentType = result;
|
|
1981
1989
|
}
|
|
1982
1990
|
}
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1991
|
+
if (exportItemConfig.param) {
|
|
1992
|
+
accessParam = exportItemConfig.param() || {};
|
|
1993
|
+
}
|
|
1994
|
+
// 只有选择模式以勾选行 id 为过滤条件;条件模式下由搜索条件 + exportItemParam 决定范围,
|
|
1995
|
+
// 写入空的 ids 会被后端当成"无匹配"。
|
|
1996
|
+
if (requiresCheckedRows(exportType)) {
|
|
1997
|
+
accessParam.ids = $grid.getCheckboxRecords(true).map((item) => {
|
|
1998
|
+
return item.id;
|
|
1999
|
+
});
|
|
1989
2000
|
}
|
|
1990
|
-
accessParam.ids = ids;
|
|
1991
2001
|
} else {
|
|
1992
2002
|
accessParam = this.getAccessParam() || {};
|
|
1993
2003
|
let attachmentType = this.getAttachmentType();
|