cnhis-design-vue 2.1.128 → 2.1.130
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/CHANGELOG.md +66 -1
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +1631 -338
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +22 -22
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/card-reader-sdk/index.js +57 -23
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/direct/index.js +16 -16
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +320 -146
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +698 -697
- package/es/full-calendar/index.js +52 -52
- package/es/full-calendar/style.css +1 -1
- package/es/grid/index.js +0 -1
- package/es/index/index.js +1977 -1269
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +76 -76
- package/es/multi-chat-client/index.js +70 -70
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-container/index.js +386 -385
- package/es/scale-view/index.js +27 -27
- package/es/select/index.js +12 -12
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +10 -10
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/slider-tree/index.js +9 -9
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +521 -230
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +2106 -1304
- package/lib/cui.umd.js +2106 -1304
- package/lib/cui.umd.min.js +48 -48
- package/package.json +1 -1
- package/packages/big-table/index.js +4 -0
- package/packages/big-table/src/BigTable.vue +6 -8
- package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +81 -7
- package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +63 -7
- package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +21 -0
- package/packages/big-table/src/utils/headerFilter.js +2 -1
- package/packages/card-reader-sdk/src/cardReaderSDK.js +12 -0
- package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +4 -1
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +12 -8
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +137 -49
- package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +2 -6
- package/packages/fabric-chart/src/utils/index.js +9 -1
- package/packages/full-calendar/src/FullCalendar.vue +16 -11
- package/packages/full-calendar/src/components/ListTag.vue +6 -4
- package/packages/grid/src/grid.js +2 -3
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +27 -4
- package/packages/table-filter/src/components/render-widget/enums.js +39 -16
- package/packages/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +245 -31
- package/packages/table-filter/src/components/render-widget/index.vue +7 -4
- package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +38 -11
- package/packages/table-filter/src/mixins/mixins.js +10 -8
- package/packages/table-filter/src/mixins/renderWidget.js +2 -2
- package/packages/table-filter/src/quick-search/QuickSearch.vue +26 -4
|
@@ -1,68 +1,282 @@
|
|
|
1
1
|
import { DatePresetValEnums } from '../enums';
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
|
|
4
|
+
const isPastTime = type => {
|
|
5
|
+
return type === 'DATETIME_PAST';
|
|
6
|
+
};
|
|
7
|
+
const isFutureTime = type => {
|
|
8
|
+
return type === 'DATETIME_FUTURE';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const nowTime = moment();
|
|
12
|
+
|
|
4
13
|
const Maps = new Map([
|
|
14
|
+
[DatePresetValEnums.NOW, () => moment()],
|
|
15
|
+
[DatePresetValEnums.TODAY, () => [moment().startOf('day'), moment().endOf('day')]],
|
|
16
|
+
[DatePresetValEnums.TODAY_START, () => moment().startOf('day')],
|
|
17
|
+
[DatePresetValEnums.TODAY_END, () => moment().endOf('day')],
|
|
5
18
|
[
|
|
6
|
-
DatePresetValEnums.
|
|
7
|
-
() =>
|
|
19
|
+
DatePresetValEnums.TOMORROW,
|
|
20
|
+
() => [
|
|
21
|
+
moment()
|
|
22
|
+
.add(1, 'days')
|
|
23
|
+
.startOf('day'),
|
|
24
|
+
moment()
|
|
25
|
+
.add(1, 'days')
|
|
26
|
+
.endOf('day')
|
|
27
|
+
]
|
|
8
28
|
],
|
|
9
29
|
[
|
|
10
|
-
DatePresetValEnums.
|
|
11
|
-
() =>
|
|
30
|
+
DatePresetValEnums.TOMORROW_START,
|
|
31
|
+
() =>
|
|
32
|
+
moment()
|
|
33
|
+
.add(1, 'days')
|
|
34
|
+
.startOf('day')
|
|
12
35
|
],
|
|
13
36
|
[
|
|
14
|
-
DatePresetValEnums.
|
|
15
|
-
() =>
|
|
37
|
+
DatePresetValEnums.TOMORROW_END,
|
|
38
|
+
() =>
|
|
39
|
+
moment()
|
|
40
|
+
.add(1, 'days')
|
|
41
|
+
.endOf('day')
|
|
16
42
|
],
|
|
17
43
|
[
|
|
18
|
-
DatePresetValEnums.
|
|
19
|
-
() =>
|
|
44
|
+
DatePresetValEnums.YESTERDAY,
|
|
45
|
+
() => [
|
|
46
|
+
moment()
|
|
47
|
+
.subtract(1, 'days')
|
|
48
|
+
.startOf('day'),
|
|
49
|
+
moment()
|
|
50
|
+
.subtract(1, 'days')
|
|
51
|
+
.endOf('day')
|
|
52
|
+
]
|
|
20
53
|
],
|
|
21
54
|
[
|
|
22
|
-
DatePresetValEnums.
|
|
23
|
-
() =>
|
|
55
|
+
DatePresetValEnums.YESTERDAY_START,
|
|
56
|
+
() =>
|
|
57
|
+
moment()
|
|
58
|
+
.subtract(1, 'days')
|
|
59
|
+
.startOf('day')
|
|
24
60
|
],
|
|
25
61
|
[
|
|
26
|
-
DatePresetValEnums.
|
|
27
|
-
() =>
|
|
62
|
+
DatePresetValEnums.YESTERDAY_END,
|
|
63
|
+
() =>
|
|
64
|
+
moment()
|
|
65
|
+
.subtract(1, 'days')
|
|
66
|
+
.endOf('day')
|
|
28
67
|
],
|
|
68
|
+
// week
|
|
69
|
+
[DatePresetValEnums.WEEK_START, () => moment().startOf('week')],
|
|
70
|
+
[DatePresetValEnums.WEEK_END, () => moment().endOf('week')],
|
|
71
|
+
|
|
29
72
|
[
|
|
30
|
-
DatePresetValEnums.
|
|
31
|
-
|
|
73
|
+
DatePresetValEnums.THIS_WEEK,
|
|
74
|
+
type => {
|
|
75
|
+
let start = moment().startOf('week');
|
|
76
|
+
let end = moment().endOf('week');
|
|
77
|
+
if (isPastTime(type)) {
|
|
78
|
+
end = nowTime;
|
|
79
|
+
}
|
|
80
|
+
if (isFutureTime(type)) {
|
|
81
|
+
start = nowTime;
|
|
82
|
+
}
|
|
83
|
+
return [start, end];
|
|
84
|
+
}
|
|
32
85
|
],
|
|
33
86
|
[
|
|
34
|
-
DatePresetValEnums.
|
|
35
|
-
() =>
|
|
87
|
+
DatePresetValEnums.NEXT_WEEK,
|
|
88
|
+
() => [
|
|
89
|
+
moment()
|
|
90
|
+
.add(1, 'weeks')
|
|
91
|
+
.startOf('week'),
|
|
92
|
+
moment()
|
|
93
|
+
.add(1, 'weeks')
|
|
94
|
+
.endOf('week')
|
|
95
|
+
]
|
|
36
96
|
],
|
|
37
97
|
[
|
|
38
|
-
DatePresetValEnums.
|
|
39
|
-
() =>
|
|
98
|
+
DatePresetValEnums.LAST_WEEK,
|
|
99
|
+
() => [
|
|
100
|
+
moment()
|
|
101
|
+
.subtract(1, 'weeks')
|
|
102
|
+
.startOf('week'),
|
|
103
|
+
moment()
|
|
104
|
+
.subtract(1, 'weeks')
|
|
105
|
+
.endOf('week')
|
|
106
|
+
]
|
|
40
107
|
],
|
|
41
108
|
[
|
|
42
|
-
DatePresetValEnums.
|
|
43
|
-
|
|
109
|
+
DatePresetValEnums.PAST_WEEK,
|
|
110
|
+
type => {
|
|
111
|
+
let start = moment()
|
|
112
|
+
.subtract(7, 'days')
|
|
113
|
+
.startOf('day');
|
|
114
|
+
let end = moment().endOf('day');
|
|
115
|
+
if (isPastTime(type)) {
|
|
116
|
+
end = nowTime;
|
|
117
|
+
}
|
|
118
|
+
return [start, end];
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
// month
|
|
122
|
+
[
|
|
123
|
+
DatePresetValEnums.THIS_MONTH,
|
|
124
|
+
type => {
|
|
125
|
+
let start = moment().startOf('month');
|
|
126
|
+
let end = moment().endOf('month');
|
|
127
|
+
if (isPastTime(type)) {
|
|
128
|
+
end = nowTime;
|
|
129
|
+
}
|
|
130
|
+
if (isFutureTime(type)) {
|
|
131
|
+
start = nowTime;
|
|
132
|
+
}
|
|
133
|
+
return [start, end];
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
[DatePresetValEnums.MONTH_START, () => moment().startOf('month')],
|
|
137
|
+
[DatePresetValEnums.MONTH_END, () => moment().endOf('month')],
|
|
138
|
+
[
|
|
139
|
+
DatePresetValEnums.NEXT_MONTH,
|
|
140
|
+
() => [
|
|
141
|
+
moment()
|
|
142
|
+
.add(1, 'months')
|
|
143
|
+
.startOf('month'),
|
|
144
|
+
moment()
|
|
145
|
+
.add(1, 'months')
|
|
146
|
+
.endOf('month')
|
|
147
|
+
]
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
DatePresetValEnums.LAST_MONTH,
|
|
151
|
+
() => [
|
|
152
|
+
moment()
|
|
153
|
+
.subtract(1, 'months')
|
|
154
|
+
.startOf('month'),
|
|
155
|
+
moment()
|
|
156
|
+
.subtract(1, 'months')
|
|
157
|
+
.endOf('month')
|
|
158
|
+
]
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
DatePresetValEnums.PAST_MONTH,
|
|
162
|
+
type => {
|
|
163
|
+
let start = moment()
|
|
164
|
+
.subtract(30, 'days')
|
|
165
|
+
.startOf('day');
|
|
166
|
+
let end = moment().endOf('day');
|
|
167
|
+
if (isPastTime(type)) {
|
|
168
|
+
end = nowTime;
|
|
169
|
+
}
|
|
170
|
+
return [start, end];
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
// quarter
|
|
174
|
+
[
|
|
175
|
+
DatePresetValEnums.THIS_QUARTER,
|
|
176
|
+
type => {
|
|
177
|
+
let start = moment().startOf('quarter');
|
|
178
|
+
let end = moment().endOf('quarter');
|
|
179
|
+
if (isPastTime(type)) {
|
|
180
|
+
end = nowTime;
|
|
181
|
+
}
|
|
182
|
+
if (isFutureTime(type)) {
|
|
183
|
+
start = nowTime;
|
|
184
|
+
}
|
|
185
|
+
return [start, end];
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
DatePresetValEnums.NEXT_QUARTER,
|
|
190
|
+
() => [
|
|
191
|
+
moment()
|
|
192
|
+
.add(1, 'quarters')
|
|
193
|
+
.startOf('quarter'),
|
|
194
|
+
moment()
|
|
195
|
+
.add(1, 'quarters')
|
|
196
|
+
.endOf('quarter')
|
|
197
|
+
]
|
|
44
198
|
],
|
|
45
199
|
[
|
|
46
|
-
DatePresetValEnums.
|
|
47
|
-
() =>
|
|
200
|
+
DatePresetValEnums.LAST_QUARTER,
|
|
201
|
+
() => [
|
|
202
|
+
moment()
|
|
203
|
+
.subtract(1, 'quarters')
|
|
204
|
+
.startOf('quarter'),
|
|
205
|
+
moment()
|
|
206
|
+
.subtract(1, 'quarters')
|
|
207
|
+
.endOf('quarter')
|
|
208
|
+
]
|
|
48
209
|
],
|
|
210
|
+
[DatePresetValEnums.QUARTER_START, () => moment().startOf('quarter')],
|
|
211
|
+
[DatePresetValEnums.QUARTER_END, () => moment().endOf('quarter')],
|
|
212
|
+
// year
|
|
49
213
|
[
|
|
50
|
-
DatePresetValEnums.
|
|
51
|
-
|
|
214
|
+
DatePresetValEnums.THIS_YEAR,
|
|
215
|
+
type => {
|
|
216
|
+
let start = moment().startOf('year');
|
|
217
|
+
let end = moment().endOf('year');
|
|
218
|
+
if (isPastTime(type)) {
|
|
219
|
+
end = nowTime;
|
|
220
|
+
}
|
|
221
|
+
if (isFutureTime(type)) {
|
|
222
|
+
start = nowTime;
|
|
223
|
+
}
|
|
224
|
+
return [start, end];
|
|
225
|
+
}
|
|
52
226
|
],
|
|
227
|
+
[DatePresetValEnums.YEAR_START, () => moment().startOf('year')],
|
|
228
|
+
[DatePresetValEnums.YEAR_END, () => moment().endOf('year')],
|
|
53
229
|
[
|
|
54
|
-
DatePresetValEnums.
|
|
55
|
-
() =>
|
|
230
|
+
DatePresetValEnums.NEXT_YEAR,
|
|
231
|
+
() => [
|
|
232
|
+
moment()
|
|
233
|
+
.add(1, 'years')
|
|
234
|
+
.startOf('year'),
|
|
235
|
+
moment()
|
|
236
|
+
.add(1, 'years')
|
|
237
|
+
.endOf('year')
|
|
238
|
+
]
|
|
56
239
|
],
|
|
57
240
|
[
|
|
58
|
-
DatePresetValEnums.
|
|
59
|
-
() =>
|
|
241
|
+
DatePresetValEnums.LAST_YEAR,
|
|
242
|
+
() => [
|
|
243
|
+
moment()
|
|
244
|
+
.subtract(1, 'years')
|
|
245
|
+
.startOf('year'),
|
|
246
|
+
moment()
|
|
247
|
+
.subtract(1, 'years')
|
|
248
|
+
.endOf('year')
|
|
249
|
+
]
|
|
60
250
|
],
|
|
61
|
-
|
|
251
|
+
[
|
|
252
|
+
DatePresetValEnums.PAST_HALF_YEAR,
|
|
253
|
+
type => {
|
|
254
|
+
let start = moment()
|
|
255
|
+
.subtract(182, 'days')
|
|
256
|
+
.startOf('day');
|
|
257
|
+
let end = moment().endOf('day');
|
|
258
|
+
if (isPastTime(type)) {
|
|
259
|
+
end = nowTime;
|
|
260
|
+
}
|
|
261
|
+
return [start, end];
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
]);
|
|
62
265
|
|
|
63
|
-
|
|
266
|
+
const presetValToTimestamp = (presetVal, format = 'x', openSetting) => {
|
|
64
267
|
if (!Maps.has(presetVal)) return;
|
|
65
268
|
const fun = Maps.get(presetVal);
|
|
269
|
+
const funVal = fun(openSetting);
|
|
270
|
+
|
|
271
|
+
const isX = format === 'x' || format === 'X';
|
|
272
|
+
if (funVal && Array.isArray(funVal)) {
|
|
273
|
+
return funVal.map(v => {
|
|
274
|
+
const val = v.format(format);
|
|
275
|
+
return isX ? Number(val) : val;
|
|
276
|
+
});
|
|
277
|
+
}
|
|
66
278
|
const val = fun().format(format);
|
|
67
|
-
return
|
|
279
|
+
return isX ? Number(val) : val;
|
|
68
280
|
};
|
|
281
|
+
|
|
282
|
+
export { presetValToTimestamp };
|
|
@@ -75,11 +75,11 @@ export default {
|
|
|
75
75
|
return `unset`;
|
|
76
76
|
},
|
|
77
77
|
initComponentProps(cfg) {
|
|
78
|
-
const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg, fieldType, explicitRequired } = cfg;
|
|
78
|
+
const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg, fieldType, explicitRequired, optionSetting } = cfg;
|
|
79
79
|
const { props, handlerProps } = WidgetCfgMaps.get(widgetType);
|
|
80
80
|
let Props = { ...props };
|
|
81
81
|
if (handlerProps) {
|
|
82
|
-
Props = handlerProps(Props, { ...widgetCfg, title: alias || title, fieldType, isQuick: this.isQuick, explicitRequired });
|
|
82
|
+
Props = handlerProps(Props, { ...widgetCfg, title: alias || title, fieldType, isQuick: this.isQuick, explicitRequired, optionSetting });
|
|
83
83
|
}
|
|
84
84
|
if (customPlaceholder) {
|
|
85
85
|
Props.placeholder = customPlaceholder;
|
|
@@ -107,11 +107,13 @@ export default {
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
const EventsBySearch = eventsBySearch.reduce((evts, item) => {
|
|
110
|
-
const { name, handler } = item;
|
|
110
|
+
const { name, handler, isDebounce } = item;
|
|
111
111
|
let eventHandler = this.search;
|
|
112
112
|
if (handler) {
|
|
113
113
|
eventHandler = (e) => {
|
|
114
|
-
|
|
114
|
+
// 搜索框需要防抖
|
|
115
|
+
let curMethod = isDebounce ? this.debounceSearch : this.search
|
|
116
|
+
handler(e, curMethod, props, cfg);
|
|
115
117
|
};
|
|
116
118
|
}
|
|
117
119
|
return {
|
|
@@ -129,6 +131,7 @@ export default {
|
|
|
129
131
|
},
|
|
130
132
|
created() {
|
|
131
133
|
this.handleWordBookSearchRender = debounce(this.handleWordBookSearchDef, 300)
|
|
134
|
+
this.debounceSearch = debounce(this.search, 300)
|
|
132
135
|
this.initComponentProps(this.cfg);
|
|
133
136
|
},
|
|
134
137
|
render() {
|
|
@@ -6,6 +6,21 @@ import { presetValToTimestamp } from './helpers/presetValToTimestamp';
|
|
|
6
6
|
|
|
7
7
|
const SetDefVal = defaultValue => defaultValue;
|
|
8
8
|
|
|
9
|
+
// 日期默认值
|
|
10
|
+
const handleDateDef = (defaultValue, defValueUnit, { format, rangeFilter, optionSetting }) => {
|
|
11
|
+
let resDate = presetValToTimestamp(defValueUnit, format, optionSetting);
|
|
12
|
+
if (rangeFilter) {
|
|
13
|
+
// 范围
|
|
14
|
+
if (!resDate) return [];
|
|
15
|
+
if (!Array.isArray(resDate)) return [resDate, resDate];
|
|
16
|
+
} else {
|
|
17
|
+
// 非范围
|
|
18
|
+
if (!resDate) return null;
|
|
19
|
+
if (resDate && Array.isArray(resDate) && resDate[0]) return resDate[0];
|
|
20
|
+
}
|
|
21
|
+
return resDate;
|
|
22
|
+
};
|
|
23
|
+
|
|
9
24
|
export const WidgetCfgMaps = new Map([
|
|
10
25
|
[
|
|
11
26
|
WidgetTypeEnums.INPUT_NUMBER,
|
|
@@ -97,9 +112,9 @@ export const WidgetCfgMaps = new Map([
|
|
|
97
112
|
const Props = { ...props, placeholder: `请选择${title}`, allowClear };
|
|
98
113
|
return Props;
|
|
99
114
|
},
|
|
100
|
-
setDefaultValue(defaultValue, defValueUnit) {
|
|
115
|
+
setDefaultValue(defaultValue, defValueUnit, { rangeFilter, optionSetting }) {
|
|
101
116
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
102
|
-
return
|
|
117
|
+
return handleDateDef(defaultValue, defValueUnit, { rangeFilter, optionSetting, format: 'YYYY-MM-DD' });
|
|
103
118
|
}
|
|
104
119
|
return defaultValue;
|
|
105
120
|
}
|
|
@@ -118,9 +133,9 @@ export const WidgetCfgMaps = new Map([
|
|
|
118
133
|
const Props = { ...props, placeholder: `请选择${title}`, allowClear };
|
|
119
134
|
return Props;
|
|
120
135
|
},
|
|
121
|
-
setDefaultValue(defaultValue, defValueUnit) {
|
|
136
|
+
setDefaultValue(defaultValue, defValueUnit, { rangeFilter, optionSetting }) {
|
|
122
137
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
123
|
-
return
|
|
138
|
+
return handleDateDef(defaultValue, defValueUnit, { rangeFilter, optionSetting, format: 'YYYY-MM-DD HH:mm:ss' });
|
|
124
139
|
}
|
|
125
140
|
return defaultValue;
|
|
126
141
|
}
|
|
@@ -171,10 +186,9 @@ export const WidgetCfgMaps = new Map([
|
|
|
171
186
|
const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`], allowClear };
|
|
172
187
|
return Props;
|
|
173
188
|
},
|
|
174
|
-
setDefaultValue(defaultValue, defValueUnit) {
|
|
189
|
+
setDefaultValue(defaultValue, defValueUnit, { rangeFilter, optionSetting }) {
|
|
175
190
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
176
|
-
|
|
177
|
-
return [resDate, resDate];
|
|
191
|
+
return handleDateDef(defaultValue, defValueUnit, { rangeFilter, optionSetting, format: 'YYYY-MM-DD' });
|
|
178
192
|
}
|
|
179
193
|
if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
|
|
180
194
|
return [];
|
|
@@ -196,10 +210,10 @@ export const WidgetCfgMaps = new Map([
|
|
|
196
210
|
const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`], allowClear };
|
|
197
211
|
return Props;
|
|
198
212
|
},
|
|
199
|
-
setDefaultValue(defaultValue, defValueUnit) {
|
|
213
|
+
setDefaultValue(defaultValue, defValueUnit, { rangeFilter, optionSetting }) {
|
|
200
214
|
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
201
|
-
let
|
|
202
|
-
return
|
|
215
|
+
let res = handleDateDef(defaultValue, defValueUnit, { rangeFilter, optionSetting, format: 'YYYY-MM-DD HH:mm:ss' });
|
|
216
|
+
return res;
|
|
203
217
|
}
|
|
204
218
|
if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
|
|
205
219
|
return [];
|
|
@@ -213,10 +227,23 @@ export const WidgetCfgMaps = new Map([
|
|
|
213
227
|
{
|
|
214
228
|
component: DateRangeQuick,
|
|
215
229
|
props: {},
|
|
216
|
-
handlerProps(props, { fieldType, explicitRequired } = {}) {
|
|
230
|
+
handlerProps(props, { fieldType, explicitRequired, title } = {}) {
|
|
217
231
|
const allowClear = explicitRequired != 1;
|
|
218
232
|
let str = fieldType === 'DATE' ? '日期' : '时间';
|
|
219
233
|
const Props = { ...props, placeholderS: `开始${str}`, placeholderE: `结束${str}`, fieldType, allowClear };
|
|
234
|
+
// 非范围类
|
|
235
|
+
if (!props.rangeFilter) {
|
|
236
|
+
const valueFormat = fieldType === 'DATE' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss';
|
|
237
|
+
const showTime = fieldType === 'DATE' ? false : { defaultValue: moment('00:00:00', 'HH:mm:ss') };
|
|
238
|
+
const placeholder = `请选择${title}`;
|
|
239
|
+
Object.assign(Props, {
|
|
240
|
+
allowClear: true,
|
|
241
|
+
valueFormat,
|
|
242
|
+
showToday: false,
|
|
243
|
+
showTime,
|
|
244
|
+
placeholder
|
|
245
|
+
});
|
|
246
|
+
}
|
|
220
247
|
return Props;
|
|
221
248
|
},
|
|
222
249
|
setDefaultValue: SetDefVal
|
|
@@ -636,14 +636,16 @@ export const outQuickSearchFn = {
|
|
|
636
636
|
if (attr === 'BIRTHDAY') {
|
|
637
637
|
this.$set(el, 'showFormat', 'MM-DD');
|
|
638
638
|
this.$set(el, 'showTime', false);
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
639
|
+
}
|
|
640
|
+
// else if (['TODAY', 'TOMORROW', 'YESTERDAY'].includes(el.explicitDefaultVal)) {
|
|
641
|
+
// // 如果外显默认是 以上三个,展示一个框,时间不可选
|
|
642
|
+
// let [v] = value;
|
|
643
|
+
// this.$set(el, 'showFormat', 'YYYY-MM-DD');
|
|
644
|
+
// this.$set(el, 'showTime', false);
|
|
645
|
+
// this.$set(el, 'com', 'DayPicker');
|
|
646
|
+
// this.$set(el, 'value', v || moment());
|
|
647
|
+
// }
|
|
648
|
+
else {
|
|
647
649
|
this.$set(el, 'showFormat', 'YYYY-MM-DD HH:mm:ss');
|
|
648
650
|
this.$set(el, 'showTime', true);
|
|
649
651
|
}
|
|
@@ -23,12 +23,12 @@ export default {
|
|
|
23
23
|
return cfg.widgetCfg?.isRender;
|
|
24
24
|
},
|
|
25
25
|
getDefValByRenderWidget(cfg) {
|
|
26
|
-
const { widgetType, defaultValue, defValueUnit } = cfg.widgetCfg || {};
|
|
26
|
+
const { widgetType, defaultValue, defValueUnit, rangeFilter } = cfg.widgetCfg || {};
|
|
27
27
|
const Widget = WidgetCfgMaps.get(widgetType);
|
|
28
28
|
let defVal;
|
|
29
29
|
if (Widget) {
|
|
30
30
|
const { setDefaultValue } = Widget;
|
|
31
|
-
if (setDefaultValue) defVal = setDefaultValue(defaultValue, defValueUnit);
|
|
31
|
+
if (setDefaultValue) defVal = setDefaultValue(defaultValue, defValueUnit, { rangeFilter, openSetting: cfg?.optionSetting });
|
|
32
32
|
}
|
|
33
33
|
return defVal;
|
|
34
34
|
},
|
|
@@ -618,17 +618,20 @@
|
|
|
618
618
|
class="edit-tag"
|
|
619
619
|
v-for="(item, index) in parentNames"
|
|
620
620
|
:key="index"
|
|
621
|
-
@dblclick="e => editParentName(e, item)"
|
|
621
|
+
@dblclick="e => editParentName(e, item, index)"
|
|
622
622
|
@click="handleParentNameSelect(item, index)"
|
|
623
623
|
:class="{ 'edit-tag-select': item.selected && item.disabled }"
|
|
624
624
|
>
|
|
625
625
|
<a-input
|
|
626
|
+
:ref="`${item.value}-${index}`"
|
|
626
627
|
style="width: 100px"
|
|
627
628
|
:value="item"
|
|
628
629
|
:disabled="item.disabled"
|
|
629
630
|
@blur="() => (item.disabled = true)"
|
|
630
631
|
v-model="item.value"
|
|
632
|
+
:maxLength="10"
|
|
631
633
|
/>
|
|
634
|
+
<div v-if="item.disabled" class="disabled-mask" @click="maskClick"></div>
|
|
632
635
|
<a-icon slot="suffix" type="close" @click="handleParentNamesRemove(index, item)" />
|
|
633
636
|
</div>
|
|
634
637
|
<template v-if="!parentNamesHasAdd">
|
|
@@ -1044,7 +1047,7 @@ export default create({
|
|
|
1044
1047
|
this.$set(this.quickSearch[index], "value", i);
|
|
1045
1048
|
}
|
|
1046
1049
|
} else {
|
|
1047
|
-
|
|
1050
|
+
this.$set(this.quickSearch[index], "value", value);
|
|
1048
1051
|
}
|
|
1049
1052
|
} else {
|
|
1050
1053
|
this.clearQuickItem(item, index)
|
|
@@ -1635,10 +1638,13 @@ export default create({
|
|
|
1635
1638
|
});
|
|
1636
1639
|
this.addVal = "";
|
|
1637
1640
|
},
|
|
1638
|
-
editParentName(e, item) {
|
|
1641
|
+
editParentName(e, item, index) {
|
|
1639
1642
|
item.disabled = false;
|
|
1643
|
+
let inputRef = `${item.value}-${index}`
|
|
1644
|
+
let inputDom = this.$refs[inputRef]?.[0]
|
|
1645
|
+
if(!inputDom) return;
|
|
1640
1646
|
setTimeout(() => {
|
|
1641
|
-
|
|
1647
|
+
inputDom.focus();
|
|
1642
1648
|
}, 0);
|
|
1643
1649
|
},
|
|
1644
1650
|
handleParentNameSelect(item, index) {
|
|
@@ -1650,6 +1656,7 @@ export default create({
|
|
|
1650
1656
|
});
|
|
1651
1657
|
item.selected = !item.selected;
|
|
1652
1658
|
},
|
|
1659
|
+
maskClick() {},
|
|
1653
1660
|
handleParentNamesRemove(index, item) {
|
|
1654
1661
|
this.handleParent(index, item);
|
|
1655
1662
|
},
|
|
@@ -2214,6 +2221,21 @@ export default create({
|
|
|
2214
2221
|
display: inline-block;
|
|
2215
2222
|
margin-right: 10px;
|
|
2216
2223
|
margin-bottom: 10px;
|
|
2224
|
+
.disabled-mask {
|
|
2225
|
+
position: absolute;
|
|
2226
|
+
right: 0;
|
|
2227
|
+
left: 0;
|
|
2228
|
+
top: 0;
|
|
2229
|
+
bottom: 0;
|
|
2230
|
+
border-radius: 4px;
|
|
2231
|
+
}
|
|
2232
|
+
.anticon-close {
|
|
2233
|
+
position: absolute;
|
|
2234
|
+
right: 5px;
|
|
2235
|
+
line-height: 36px;
|
|
2236
|
+
color: #2d7aff;
|
|
2237
|
+
font-size: 12px;
|
|
2238
|
+
}
|
|
2217
2239
|
.add-parent {
|
|
2218
2240
|
border-color: #d9d9d9;
|
|
2219
2241
|
}
|