cnhis-design-vue 2.1.79 → 2.1.80

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 (119) hide show
  1. package/CHANGELOG.md +38 -17
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +115 -95
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/ellipsis/index.js +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +9 -9
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +66 -66
  39. package/es/index/index.js +2794 -1422
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +76 -76
  51. package/es/multi-chat-client/index.js +70 -70
  52. package/es/multi-chat-history/index.js +4 -4
  53. package/es/multi-chat-record/index.js +14 -14
  54. package/es/multi-chat-setting/index.js +22 -22
  55. package/es/multi-chat-sip/index.js +1 -1
  56. package/es/notification/index.js +8 -8
  57. package/es/page-header/index.js +8 -8
  58. package/es/pagination/index.js +8 -8
  59. package/es/popconfirm/index.js +8 -8
  60. package/es/popover/index.js +8 -8
  61. package/es/progress/index.js +8 -8
  62. package/es/radio/index.js +9 -9
  63. package/es/rate/index.js +8 -8
  64. package/es/result/index.js +8 -8
  65. package/es/row/index.js +8 -8
  66. package/es/scale-container/index.js +1 -1
  67. package/es/scale-view/index.js +52 -50
  68. package/es/scale-view/style.css +1 -1
  69. package/es/select/index.js +12 -12
  70. package/es/select-label/index.js +36 -34
  71. package/es/select-label/style.css +1 -1
  72. package/es/select-person/index.js +2 -2
  73. package/es/shortcut-setter/index.js +10 -10
  74. package/es/skeleton/index.js +8 -8
  75. package/es/slider/index.js +8 -8
  76. package/es/space/index.js +8 -8
  77. package/es/spin/index.js +8 -8
  78. package/es/statistic/index.js +8 -8
  79. package/es/steps/index.js +8 -8
  80. package/es/switch/index.js +8 -8
  81. package/es/table-filter/index.js +2535 -1185
  82. package/es/table-filter/style.css +1 -1
  83. package/es/tabs/index.js +8 -8
  84. package/es/tag/index.js +9 -9
  85. package/es/time-picker/index.js +8 -8
  86. package/es/timeline/index.js +8 -8
  87. package/es/tooltip/index.js +8 -8
  88. package/es/transfer/index.js +8 -8
  89. package/es/tree/index.js +8 -8
  90. package/es/tree-select/index.js +8 -8
  91. package/es/upload/index.js +8 -8
  92. package/es/verification-code/index.js +2 -2
  93. package/lib/cui.common.js +3100 -1583
  94. package/lib/cui.umd.js +3100 -1583
  95. package/lib/cui.umd.min.js +54 -54
  96. package/package.json +1 -1
  97. package/packages/big-table/src/BigTable.vue +15 -3
  98. package/packages/big-table/src/assets/style/table-base.less +7 -4
  99. package/packages/select-label/select-label.vue +18 -2
  100. package/packages/table-filter/src/base-search-com/BaseSearch.vue +7 -15
  101. package/packages/table-filter/src/components/TextOverTooltip.vue +24 -11
  102. package/packages/table-filter/src/components/age-com/index.vue +3 -3
  103. package/packages/table-filter/src/components/checkbox-group/CheckboxGroup.vue +53 -0
  104. package/packages/table-filter/src/components/multi-select/multi-select.vue +7 -1
  105. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +5 -119
  106. package/packages/table-filter/src/components/range-age/index.vue +11 -12
  107. package/packages/table-filter/src/components/render-widget/components/DateRangeQuick.vue +212 -0
  108. package/packages/table-filter/src/components/render-widget/components/NumberRange.vue +145 -0
  109. package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +304 -0
  110. package/packages/table-filter/src/components/render-widget/components/index.js +4 -4
  111. package/packages/table-filter/src/components/render-widget/enums.js +27 -22
  112. package/packages/table-filter/src/components/render-widget/index.vue +38 -5
  113. package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +158 -0
  114. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +150 -45
  115. package/packages/table-filter/src/components/search-filter/SearchFilter.vue +3 -1
  116. package/packages/table-filter/src/mixins/mixins.js +192 -133
  117. package/packages/table-filter/src/mixins/out-quick-method.js +123 -0
  118. package/packages/table-filter/src/mixins/renderWidget.js +21 -13
  119. package/packages/table-filter/src/quick-search/QuickSearch.vue +144 -121
@@ -1,29 +1,34 @@
1
1
  export const WidgetTypeEnums = {
2
- INPUT_NUMBER: "NUMBER",
3
- INPUT: "TEXT",
4
- SELECT: "SELECT",
5
- DATE: "DATE",
6
- DATE_TIME: "DATETIME",
2
+ INPUT_NUMBER: 'NUMBER',
3
+ INPUT: 'TEXT',
4
+ SELECT: 'SELECT',
5
+ SELECT_DYNAMIC: 'SELECT_DYNAMIC',
6
+ DATE: 'DATE',
7
+ DATE_TIME: 'DATETIME',
7
8
  CHECKBOX_GROUP: 'CHECKBOX_GROUP',
8
- }
9
+ INPUT_NUMBER_RANGE: 'NUMBER_RANGE',
10
+ DATE_RANGE: 'DATE_RANGE',
11
+ DATETIME_RANGE: 'DATETIME_RANGE',
12
+ DATE_RANGE_QUICK: 'DATE_RANGE_QUICK'
13
+ };
9
14
 
10
15
  export const DatePresetValEnums = {
11
- CUSTOM: "CUSTOM", // 自定义输入,特殊处理
16
+ CUSTOM: 'CUSTOM', // 自定义输入,特殊处理
12
17
 
13
- NOW: "NOW",
14
- TODAY: "TODAY",
15
- TODAY_START: "TODAY_START",
16
- TODAY_END: "TODAY_END",
17
- TOMORROW: "TOMORROW",
18
- TOMORROW_START: "TOMORROW_START",
19
- TOMORROW_END: "TOMORROW_END",
20
- YESTERDAY: "YESTERDAY",
21
- YESTERDAY_START: "YESTERDAY_START",
22
- YESTERDAY_END: "YESTERDAY_END",
18
+ NOW: 'NOW',
19
+ TODAY: 'TODAY',
20
+ TODAY_START: 'TODAY_START',
21
+ TODAY_END: 'TODAY_END',
22
+ TOMORROW: 'TOMORROW',
23
+ TOMORROW_START: 'TOMORROW_START',
24
+ TOMORROW_END: 'TOMORROW_END',
25
+ YESTERDAY: 'YESTERDAY',
26
+ YESTERDAY_START: 'YESTERDAY_START',
27
+ YESTERDAY_END: 'YESTERDAY_END',
23
28
 
24
- WEEK_START: "THIS_WEEK_START",
25
- WEEK_END: "THIS_WEEK_END",
29
+ WEEK_START: 'THIS_WEEK_START',
30
+ WEEK_END: 'THIS_WEEK_END',
26
31
 
27
- MONTH_START: "THIS_MONTH_START",
28
- MONTH_END: "THIS_MONTH_END",
29
- };
32
+ MONTH_START: 'THIS_MONTH_START',
33
+ MONTH_END: 'THIS_MONTH_END'
34
+ };
@@ -1,16 +1,28 @@
1
1
  <script type="text/jsx">
2
2
  import { WidgetTypeEnums } from './enums';
3
3
  import { WidgetCfgMaps } from './widgetCfgMaps';
4
+ import { filterApiFn } from '../../mixins/mixins';
5
+ import dynamicMethod from './mixins/dynamic-method'
6
+ import { debounce } from "lodash";
4
7
 
5
8
  const UseSelfWidth = [WidgetTypeEnums.DATE, WidgetTypeEnums.DATE_TIME, WidgetTypeEnums.CHECKBOX_GROUP];
9
+ const unsetMinWidth = [WidgetTypeEnums.DATE, WidgetTypeEnums.DATE_TIME, WidgetTypeEnums.DATE_RANGE, WidgetTypeEnums.DATETIME_RANGE, WidgetTypeEnums.INPUT_NUMBER_RANGE];
6
10
 
7
11
  export default {
8
12
  props: {
9
13
  cfg: {
10
14
  type: Object,
11
15
  required: true,
12
- }
16
+ },
17
+ source: {
18
+ type: String
19
+ },
20
+ filterApiConfig: {
21
+ type: Object,
22
+ default: () => ({})
23
+ },
13
24
  },
25
+ mixins: [filterApiFn, dynamicMethod],
14
26
  model: {
15
27
  event: "update:value",
16
28
  prop: "value",
@@ -35,20 +47,35 @@ export default {
35
47
  this.$emit("outFilterChange");
36
48
  },
37
49
  getEleWidth(cfg) {
50
+ if(this.source === 'quickSearch') return '100%';
38
51
  const { widgetType } = cfg;
39
52
  if (UseSelfWidth.includes(widgetType)) return;
40
- return `${cfg.advanceColWidth||200}px`;
53
+ let defW = 200
54
+ if(cfg?.fieldType?.includes?.('DATE') && cfg?.widgetCfg?.rangeFilter) {
55
+ defW = 350
56
+ }
57
+ return `${cfg.advanceColWidth||defW}px`;
58
+ },
59
+ getEleMinWidth(cfg){
60
+ if(this.source !== 'quickSearch') return `${cfg.advanceColWidth|| 195}px`;
61
+ const { widgetType } = cfg;
62
+ if (!unsetMinWidth.includes(widgetType)) return;
63
+ return `unset`;
41
64
  },
42
65
  initComponentProps(cfg) {
43
- const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg } = cfg;
66
+ const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg, fieldType } = cfg;
44
67
  const { props, handlerProps } = WidgetCfgMaps.get(widgetType);
45
68
  let Props = { ...props };
46
69
  if (handlerProps) {
47
- Props = handlerProps(Props, { ...widgetCfg, title: alias || title });
70
+ Props = handlerProps(Props, { ...widgetCfg, title: alias || title, fieldType });
48
71
  }
49
72
  if (customPlaceholder) {
50
73
  Props.placeholder = customPlaceholder;
51
74
  }
75
+ if(widgetType === 'SELECT_DYNAMIC') {
76
+ Props.dropdownVisibleChangeRender = this.dropdownVisibleChangeRender;
77
+ Props.handleWordBookSearchRender = this.handleWordBookSearchRender;
78
+ }
52
79
  this.initialProps = Props;
53
80
  if (Props.value) {
54
81
  this.valueCp = Props.value;
@@ -62,6 +89,7 @@ export default {
62
89
  const { value } = cfg;
63
90
  const { component, style, eventsBySearch = [] } = WidgetCfgMaps.get(widgetType);
64
91
  const props = { ...this.initialProps, value };
92
+
65
93
 
66
94
  const EventsBySearch = eventsBySearch.reduce((evts, item) => {
67
95
  const { name, handler } = item;
@@ -77,10 +105,15 @@ export default {
77
105
  };
78
106
  }, {});
79
107
 
80
- return <component style={{ width: this.getEleWidth(cfg), ...style }} attrs={{...props}} componentCfg={{...cfg}} on={{...EventsBySearch}} vModel={this.valueCp} />
108
+ const setCfgCon = (val) => {
109
+ this.cfg.con = val;
110
+ }
111
+ let width = this.getEleWidth(cfg);
112
+ return <component attrs={{...props, source: this.source, componentCfg: this.cfg}} style={{ width, minWidth: this.getEleMinWidth(cfg), ...style }} on={{...EventsBySearch, setCfgCon}} vModel={this.valueCp} />
81
113
  }
82
114
  },
83
115
  created() {
116
+ this.handleWordBookSearchRender = debounce(this.handleWordBookSearchDef, 300)
84
117
  this.initComponentProps(this.cfg);
85
118
  },
86
119
  render() {
@@ -0,0 +1,158 @@
1
+ import vexutils from '@/utils/vexutils';
2
+
3
+ export default {
4
+ props: {},
5
+ data() {
6
+ return {};
7
+ },
8
+ methods: {
9
+ wordbookDataParamsRender(dynamicOptionInfo) {
10
+ let { dataSourceId, dataSourceType = 'WORDBOOK', filterKeys, autograph, defaultParams } = dynamicOptionInfo;
11
+ if (Array.isArray(filterKeys)) {
12
+ filterKeys = JSON.stringify(filterKeys);
13
+ }
14
+ const params = {
15
+ wordbookId: dataSourceId,
16
+ wordbookType: dataSourceType,
17
+ fieldKeys: filterKeys,
18
+ autograph
19
+ };
20
+ return params;
21
+ },
22
+ handleRenderFirstDef(item, rows) {
23
+ let { explicitDefaultVal, multiple } = item.widgetCfg;
24
+ let needSet = !item.initSearch && explicitDefaultVal;
25
+ if (!needSet) return;
26
+ let df = explicitDefaultVal;
27
+ let defval = [];
28
+ if (df === 'firstOption') {
29
+ let [v, k] = rows;
30
+ v && (defval = [v.myName]);
31
+ } else {
32
+ let f = rows.find(v => v.myName.includes(df));
33
+ if (f) {
34
+ defval = [f.myName];
35
+ }
36
+ }
37
+ item.value = multiple ? [...defval] : defval[0];
38
+ },
39
+ getWordbookDataRender(params, row) {
40
+ this.$set(row, 'fetchingWordbook', true);
41
+ return this.handleGetConfigApi(params, 'requestGetWordbookData')
42
+ .then(res => {
43
+ this.$set(row, 'fetchingWordbook', false);
44
+ if (typeof res.data === 'object') {
45
+ res.data.reqParams = params;
46
+ }
47
+ return res;
48
+ })
49
+ .catch(() => {
50
+ this.$set(row, 'fetchingWordbook', false);
51
+ });
52
+ },
53
+
54
+ formatWordbookDataRender(item, data, params) {
55
+ let searchPageConfig = {
56
+ page: 0,
57
+ hasNextPage: false,
58
+ isRequest: true,
59
+ keyword: params?.keyword || undefined,
60
+ asyncCount: undefined
61
+ },
62
+ resArr = [];
63
+ if (data && data.result === 'SUCCESS') {
64
+ let reqParams = data?.reqParams || {};
65
+ let { showKeys, valueKey } = item?.widgetCfg?.dynamicOptionInfo || {};
66
+ showKeys = Array.isArray(showKeys) ? showKeys : [showKeys];
67
+ let { page, hasNextPage, fieldList, rows = [] } = data.map;
68
+
69
+ // columnName title
70
+ // showKeys是 columnName 需要从fieldList中匹配住中文
71
+ let _showKeys_ = [];
72
+ showKeys.forEach(v => {
73
+ let mItem = fieldList.find(k => k.columnName === v);
74
+ if (mItem) {
75
+ _showKeys_.push(mItem.title);
76
+ }
77
+ });
78
+ this.$set(item, '_showKeys_', _showKeys_);
79
+
80
+ searchPageConfig = Object.assign(item.searchPageConfig || {}, {
81
+ page,
82
+ hasNextPage,
83
+ isRequest: true,
84
+ keyword: params?.keyword || undefined,
85
+ asyncCount: reqParams?.asyncCount || undefined
86
+ });
87
+ let rowsArr = rows.map(row => {
88
+ let showKeysStr = [];
89
+ // 取值是value, 展示是change_text
90
+ let valueKeyN = `_${valueKey}_`;
91
+ for (let key in row) {
92
+ let showVal = vexutils.stringToValue(row[key], 'change_text');
93
+ if (key === valueKey) {
94
+ row[valueKeyN] = vexutils.stringToValue(row[key]);
95
+ }
96
+ row[key] = showVal;
97
+ }
98
+ showKeys.forEach(s => {
99
+ // let str = vexutils.stringToValue(row[s]);
100
+ showKeysStr.push(row[s]);
101
+ });
102
+ // let name = vexutils.stringToValue(row[valueKey]);
103
+ let name = row[valueKeyN];
104
+ // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
105
+ if (typeof name === 'number') {
106
+ name = String(name);
107
+ }
108
+ return Object.assign(row, {
109
+ myName: name,
110
+ _show_title: showKeysStr.join(' ')
111
+ });
112
+ });
113
+ // 数组对象去重
114
+ let obj = {};
115
+ resArr = rowsArr.reduce((cur, next) => {
116
+ obj[next.myName] ? '' : (obj[next.myName] = true && cur.push(next));
117
+ return cur;
118
+ }, []);
119
+ } else {
120
+ this.$set(item, '_showKeys_', []);
121
+ }
122
+ return {
123
+ rows: resArr,
124
+ searchPageConfig
125
+ };
126
+ },
127
+ wordbookDataMethodRender(params, item) {
128
+ this.getWordbookDataRender(params, item).then(({ data }) => {
129
+ let { rows, searchPageConfig } = this.formatWordbookDataRender(item, data, params);
130
+ this.handleRenderFirstDef(item, rows);
131
+ this.$set(item, 'dataSource', rows);
132
+ this.$set(item, 'searchPageConfig', searchPageConfig);
133
+ });
134
+ },
135
+ async getWordbookFirstOptionRender(item) {
136
+ try {
137
+ let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
138
+ let { data } = (await this.getWordbookDataRender(params, item)) || {};
139
+ let { rows, searchPageConfig } = this.formatWordbookDataRender(item, data, params);
140
+ this.handleRenderFirstDef(item, rows);
141
+ this.$set(item, 'dataSource', rows);
142
+ this.$set(item, 'searchPageConfig', searchPageConfig);
143
+ } catch (err) {
144
+ console.log(err);
145
+ }
146
+ },
147
+ dropdownVisibleChangeRender(open, item) {
148
+ if (!open) return;
149
+ let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
150
+ this.wordbookDataMethodRender(params, item);
151
+ },
152
+ handleWordBookSearchDef(value, item, config = {}) {
153
+ let params = this.wordbookDataParamsRender(item.widgetCfg.dynamicOptionInfo);
154
+ let rp = { keyword: value, ...params, ...config };
155
+ this.wordbookDataMethodRender(rp, item);
156
+ }
157
+ }
158
+ };
@@ -1,92 +1,99 @@
1
1
  import { WidgetTypeEnums, DatePresetValEnums } from './enums';
2
2
  import { InputNumber, Input, DatePicker } from 'ant-design-vue';
3
- import { CheckboxGroup, Select } from './components';
3
+ import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic } from './components';
4
4
  import moment from 'moment';
5
5
  import { presetValToTimestamp } from './helpers/presetValToTimestamp';
6
6
 
7
- const SetDefVal = (defaultValue) => defaultValue
7
+ const SetDefVal = defaultValue => defaultValue;
8
8
 
9
9
  export const WidgetCfgMaps = new Map([
10
10
  [
11
- WidgetTypeEnums.INPUT_NUMBER,
11
+ WidgetTypeEnums.INPUT_NUMBER,
12
12
  {
13
13
  component: InputNumber,
14
14
  props: {
15
- allowClear: true,
15
+ allowClear: true
16
16
  },
17
- eventsBySearch: [{
18
- name: "keydown",
19
- handler(e, search) {
20
- if (e.key === 'Enter') {
21
- search();
17
+ eventsBySearch: [
18
+ {
19
+ name: 'keydown',
20
+ handler(e, search) {
21
+ if (e.key === 'Enter') {
22
+ search();
23
+ }
22
24
  }
23
25
  }
24
- }],
26
+ ],
25
27
  handlerProps(props, { title } = {}) {
26
- const Props = { ...props, placeholder: `输入${title}` };
28
+ const Props = { ...props, placeholder: `请输入${title}` };
27
29
  return Props;
28
30
  },
29
- setDefaultValue: SetDefVal,
31
+ setDefaultValue: SetDefVal
30
32
  }
31
33
  ],
32
34
  [
33
- WidgetTypeEnums.INPUT,
35
+ WidgetTypeEnums.INPUT,
34
36
  {
35
37
  component: Input,
36
38
  props: {
37
- allowClear: true,
39
+ allowClear: true
38
40
  },
39
- eventsBySearch: [{
40
- name: "keydown",
41
- handler(e, search) {
42
- if (e.key === 'Enter') {
43
- search();
41
+ eventsBySearch: [
42
+ {
43
+ name: 'keydown',
44
+ handler(e, search) {
45
+ if (e.key === 'Enter') {
46
+ search();
47
+ }
44
48
  }
45
49
  }
46
- }],
50
+ ],
47
51
  handlerProps(props, { title } = {}) {
48
- const Props = { ...props, placeholder: `搜索${title}` };
52
+ const Props = { ...props, placeholder: `请输入${title}` };
49
53
  return Props;
50
54
  },
51
- setDefaultValue: SetDefVal,
55
+ setDefaultValue: SetDefVal
52
56
  }
53
57
  ],
54
58
  [
55
- WidgetTypeEnums.SELECT,
59
+ WidgetTypeEnums.SELECT,
56
60
  {
57
61
  component: Select,
58
62
  props: {
59
63
  allowClear: true,
60
64
  options: [],
61
65
  showSearch: true,
62
- mode: "default",
63
- showArrow: true,
64
- },
65
- eventsBySearch: [{
66
- name: "change",
67
- handler(e, search, props) {
68
- const { mode } = props;
69
- if (mode !== 'multiple') {
70
- search();
66
+ mode: 'default',
67
+ showArrow: true
68
+ },
69
+ eventsBySearch: [
70
+ {
71
+ name: 'change',
72
+ handler(e, search, props) {
73
+ const { mode } = props;
74
+ if (mode !== 'multiple') {
75
+ search();
76
+ }
71
77
  }
72
78
  }
73
- }],
79
+ ],
74
80
  handlerProps(props, { valueList, multiple, title } = {}) {
75
81
  const Props = { ...props, placeholder: `请选择${title}` };
76
82
  if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
77
- if (multiple) Props.mode = "multiple";
83
+ if (multiple) Props.mode = 'multiple';
78
84
  return Props;
79
85
  },
80
- setDefaultValue: SetDefVal,
86
+ setDefaultValue: SetDefVal
81
87
  }
82
88
  ],
89
+
83
90
  [
84
- WidgetTypeEnums.DATE,
91
+ WidgetTypeEnums.DATE,
85
92
  {
86
93
  component: DatePicker,
87
94
  props: {
88
95
  allowClear: true,
89
- valueFormat: "YYYY-MM-DD HH:mm:ss"
96
+ valueFormat: 'YYYY-MM-DD HH:mm:ss'
90
97
  },
91
98
  handlerProps(props, { title } = {}) {
92
99
  const Props = { ...props, placeholder: `请选择${title}` };
@@ -94,20 +101,20 @@ export const WidgetCfgMaps = new Map([
94
101
  },
95
102
  setDefaultValue(defaultValue, defValueUnit) {
96
103
  if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
97
- return presetValToTimestamp(defValueUnit, "YYYY-MM-DD HH:mm:ss");
104
+ return presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
98
105
  }
99
106
  return defaultValue;
100
107
  }
101
108
  }
102
109
  ],
103
110
  [
104
- WidgetTypeEnums.DATE_TIME,
111
+ WidgetTypeEnums.DATE_TIME,
105
112
  {
106
113
  component: DatePicker,
107
114
  props: {
108
115
  allowClear: true,
109
- valueFormat: "YYYY-MM-DD HH:mm:ss",
110
- "show-time": { defaultValue: moment('00:00:00', 'HH:mm:ss') }
116
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
117
+ 'show-time': { defaultValue: moment('00:00:00', 'HH:mm:ss') }
111
118
  },
112
119
  handlerProps(props, { title } = {}) {
113
120
  const Props = { ...props, placeholder: `请选择${title}` };
@@ -115,7 +122,7 @@ export const WidgetCfgMaps = new Map([
115
122
  },
116
123
  setDefaultValue(defaultValue, defValueUnit) {
117
124
  if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
118
- return presetValToTimestamp(defValueUnit, "YYYY-MM-DD HH:mm:ss");
125
+ return presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
119
126
  }
120
127
  return defaultValue;
121
128
  }
@@ -127,14 +134,112 @@ export const WidgetCfgMaps = new Map([
127
134
  component: CheckboxGroup,
128
135
  props: {},
129
136
  style: {
130
- "line-height": "32px"
137
+ 'line-height': '32px'
138
+ },
139
+ handlerProps(props, { valueList, multiple } = {}) {
140
+ const Props = { ...props, multiple };
141
+ if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
142
+ return Props;
131
143
  },
144
+ setDefaultValue: SetDefVal
145
+ }
146
+ ],
147
+ [
148
+ WidgetTypeEnums.INPUT_NUMBER_RANGE,
149
+ {
150
+ component: NumberRange,
151
+ props: {},
132
152
  handlerProps(props, { valueList, multiple } = {}) {
133
153
  const Props = { ...props, multiple };
134
154
  if (Array.isArray(valueList)) Props.options = valueList.map(({ value, label }) => ({ value, label }));
135
155
  return Props;
136
156
  },
137
- setDefaultValue: SetDefVal,
157
+ setDefaultValue: SetDefVal
158
+ }
159
+ ],
160
+ [
161
+ WidgetTypeEnums.DATE_RANGE,
162
+ {
163
+ component: DatePicker.RangePicker,
164
+ props: {
165
+ allowClear: true,
166
+ valueFormat: 'YYYY-MM-DD'
167
+ },
168
+ handlerProps(props, { title } = {}) {
169
+ const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`] };
170
+ return Props;
171
+ },
172
+ setDefaultValue(defaultValue, defValueUnit) {
173
+ if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
174
+ let resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD');
175
+ return [resDate, resDate];
176
+ }
177
+ if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
178
+ return [];
179
+ }
180
+ return defaultValue;
181
+ }
182
+ }
183
+ ],
184
+ [
185
+ WidgetTypeEnums.DATETIME_RANGE,
186
+ {
187
+ component: DatePicker.RangePicker,
188
+ props: {
189
+ allowClear: true,
190
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
191
+ 'show-time': { defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] }
192
+ },
193
+ handlerProps(props, { title } = {}) {
194
+ const Props = { ...props, placeholder: [`起始${title}`, `截止${title}`] };
195
+ return Props;
196
+ },
197
+ setDefaultValue(defaultValue, defValueUnit) {
198
+ if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
199
+ let resDate = presetValToTimestamp(defValueUnit, 'YYYY-MM-DD HH:mm:ss');
200
+ return [resDate, resDate];
201
+ }
202
+ if (!defaultValue || (defaultValue && !Array.isArray(defaultValue))) {
203
+ return [];
204
+ }
205
+ return defaultValue;
206
+ }
207
+ }
208
+ ],
209
+ [
210
+ WidgetTypeEnums.DATE_RANGE_QUICK,
211
+ {
212
+ component: DateRangeQuick,
213
+ props: {},
214
+ handlerProps(props, { fieldType } = {}) {
215
+ const Props = { ...props, placeholderS: '开始时间', placeholderE: '结束时间', fieldType };
216
+ return Props;
217
+ },
218
+ setDefaultValue: SetDefVal
219
+ }
220
+ ],
221
+ [
222
+ WidgetTypeEnums.SELECT_DYNAMIC,
223
+ {
224
+ component: SelectDynamic,
225
+ props: {},
226
+ eventsBySearch: [
227
+ {
228
+ name: 'change',
229
+ handler(e, search, props) {
230
+ const { mode } = props;
231
+ if (mode !== 'multiple') {
232
+ search();
233
+ }
234
+ }
235
+ }
236
+ ],
237
+ handlerProps(props, { multiple, title } = {}) {
238
+ const Props = { ...props, placeholder: `请选择${title}` };
239
+ Props.mode = multiple ? 'multiple' : 'default';
240
+ return Props;
241
+ },
242
+ setDefaultValue: SetDefVal
138
243
  }
139
244
  ]
140
- ]);
245
+ ]);
@@ -42,6 +42,7 @@
42
42
  <script>
43
43
  import {Modal,Icon} from 'ant-design-vue'
44
44
  import SearchCondition from "../search-condition/SearchCondition.vue";
45
+ import svgIcon from '@/component/svg/index.vue';
45
46
  export default {
46
47
  name: "SearchFilter",
47
48
  props: {
@@ -69,7 +70,8 @@ export default {
69
70
  components: {
70
71
  SearchCondition,
71
72
  AModal:Modal,
72
- [Icon.name]:Icon
73
+ [Icon.name]:Icon,
74
+ svgIcon
73
75
  },
74
76
  watch: {
75
77
  visible(value) {