cnhis-design-vue 2.1.125 → 2.1.127

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +38 -17
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +26 -26
  4. package/es/button/index.js +2 -2
  5. package/es/captcha/index.js +3 -3
  6. package/es/card-reader-sdk/index.js +1 -1
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/ellipsis/index.js +1 -1
  12. package/es/fabric-chart/index.js +157 -63
  13. package/es/form-table/index.js +20 -20
  14. package/es/full-calendar/index.js +52 -52
  15. package/es/full-calendar/style.css +1 -1
  16. package/es/index/index.js +739 -399
  17. package/es/index/style.css +1 -1
  18. package/es/input/index.js +1 -1
  19. package/es/map/index.js +1 -1
  20. package/es/multi-chat/index.js +25 -25
  21. package/es/multi-chat-client/index.js +19 -19
  22. package/es/multi-chat-history/index.js +4 -4
  23. package/es/multi-chat-record/index.js +4 -4
  24. package/es/multi-chat-setting/index.js +20 -20
  25. package/es/multi-chat-sip/index.js +1 -1
  26. package/es/radio/index.js +1 -1
  27. package/es/scale-container/index.js +1 -1
  28. package/es/scale-view/index.js +27 -27
  29. package/es/select/index.js +4 -4
  30. package/es/select-label/index.js +3 -3
  31. package/es/select-person/index.js +2 -2
  32. package/es/select-tag/index.js +4 -4
  33. package/es/shortcut-setter/index.js +2 -2
  34. package/es/slider-tree/index.js +1 -1
  35. package/es/table-filter/index.js +397 -144
  36. package/es/tag/index.js +1 -1
  37. package/es/verification-code/index.js +2 -2
  38. package/lib/cui.common.js +793 -452
  39. package/lib/cui.umd.js +793 -452
  40. package/lib/cui.umd.min.js +16 -16
  41. package/package.json +2 -2
  42. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +65 -17
  43. package/packages/fabric-chart/src/mixins/drawExtracorporealCirculation.js +2 -6
  44. package/packages/fabric-chart/src/utils/index.js +8 -0
  45. package/packages/full-calendar/src/FullCalendar.vue +16 -11
  46. package/packages/full-calendar/src/components/ListTag.vue +6 -4
  47. package/packages/table-filter/src/components/render-widget/enums.js +39 -16
  48. package/packages/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +245 -31
  49. package/packages/table-filter/src/components/render-widget/index.vue +7 -4
  50. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +38 -11
  51. package/packages/table-filter/src/mixins/mixins.js +10 -8
  52. package/packages/table-filter/src/mixins/renderWidget.js +2 -2
@@ -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
- handler(e, this.search, props);
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 presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
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 presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
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
- let resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD');
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 resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
202
- return [resDate, resDate];
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
- } else if (['TODAY', 'TOMORROW', 'YESTERDAY'].includes(el.explicitDefaultVal)) {
640
- // 如果外显默认是 以上三个,展示一个框,时间不可选
641
- let [v] = value;
642
- this.$set(el, 'showFormat', 'YYYY-MM-DD');
643
- this.$set(el, 'showTime', false);
644
- this.$set(el, 'com', 'DayPicker');
645
- this.$set(el, 'value', v || moment());
646
- } else {
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
  },