@jetlinks-web/components 3.1.7 → 3.1.9

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.
@@ -1,9 +1,3 @@
1
- function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
2
- return lhs;
3
- }
4
- else {
5
- return rhsFn();
6
- } }
7
1
  function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
8
2
  const op = ops[i];
9
3
  const fn = ops[i + 1];
@@ -22,34 +16,31 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
22
16
  } return value; }
23
17
  /* Analyzed bindings: {
24
18
  "searchKey": "props",
25
- "AutoComplete": "setup-maybe-ref",
26
- "autoCompleteProps": "setup-maybe-ref",
19
+ "Select": "setup-maybe-ref",
20
+ "selectProps": "setup-maybe-ref",
27
21
  "ref": "setup-const",
28
22
  "watch": "setup-const",
29
23
  "computed": "setup-const",
30
- "omit": "setup-maybe-ref",
31
24
  "props": "setup-reactive-const",
32
25
  "emit": "setup-const",
33
- "displayText": "setup-ref",
34
- "selectedValue": "setup-ref",
35
- "keyword": "setup-ref",
36
- "filteredOptions": "setup-ref",
37
- "onSearch": "setup-const",
38
- "onSelect": "setup-const",
39
- "onChange": "setup-const"
26
+ "myValue": "setup-ref",
27
+ "_label": "setup-ref",
28
+ "handleChange": "setup-const",
29
+ "_options": "setup-ref",
30
+ "handleSearch": "setup-const",
31
+ "onSelect": "setup-const"
40
32
  } */
41
33
  import { defineComponent as _defineComponent } from 'vue';
42
- import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
43
- import { AutoComplete } from 'ant-design-vue';
44
- import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
34
+ import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue";
35
+ import { Select } from 'ant-design-vue';
36
+ import { selectProps } from 'ant-design-vue/lib/select';
45
37
  import { ref, watch, computed } from 'vue';
46
- import { omit } from "lodash-es";
47
38
  const __sfc_main__ = _defineComponent({
48
39
  ...{
49
40
  name: 'JAutoComplete'
50
41
  },
51
42
  props: {
52
- ...autoCompleteProps(),
43
+ ...selectProps(),
53
44
  searchKey: {
54
45
  type: String,
55
46
  default: 'label',
@@ -59,67 +50,50 @@ const __sfc_main__ = _defineComponent({
59
50
  setup(__props, { emit: __emit }) {
60
51
  const props = __props;
61
52
  const emit = __emit;
62
- const displayText = ref();
63
- const selectedValue = ref();
64
- const keyword = ref('');
65
- const filteredOptions = computed(() => {
66
- if (!keyword.value)
53
+ const myValue = ref();
54
+ const _label = ref();
55
+ const handleChange = (e) => {
56
+ if (e.length === 0) {
57
+ myValue.value = undefined;
58
+ emit('update:value', undefined);
59
+ }
60
+ };
61
+ const _options = computed(() => {
62
+ const item = props.options.find(option => option.value === myValue.value);
63
+ if (item || !myValue.value) {
64
+ _label.value = _optionalChain([item, 'optionalAccess', _ => _.label]);
67
65
  return props.options;
68
- return props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
69
- .includes(keyword.value));
66
+ }
67
+ _label.value = myValue.value;
68
+ return [
69
+ { label: myValue.value, value: myValue.value },
70
+ ...props.options
71
+ ];
70
72
  });
71
- /**
72
- * 根据关键词提示
73
- * @param searchText 关键词
74
- */
75
- const onSearch = (searchText) => {
76
- keyword.value = searchText;
77
- // _options.value = props.options?.filter(
78
- // (item) => !!item[props.searchKey]?.includes(searchText),
79
- // ) || [];
80
- // if (!_options.value.length) {
81
- // _options.value.unshift({ label: searchText, value: searchText });
82
- // }
73
+ const handleSearch = (e) => {
74
+ myValue.value = e;
83
75
  };
84
76
  const onSelect = (val, option) => {
85
- displayText.value = option.label;
77
+ myValue.value = val;
86
78
  emit('update:value', val);
87
79
  emit('select', val, option);
88
80
  };
89
- const onChange = (val) => {
90
- displayText.value = val;
91
- keyword.value = val;
92
- emit('update:value', '');
93
- };
94
81
  watch(() => props.value, (val) => {
95
- if (!val) {
96
- displayText.value = '';
97
- }
98
- else {
99
- const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
100
- displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
101
- }
82
+ myValue.value = val;
102
83
  }, { immediate: true });
103
84
  return (_ctx, _cache) => {
104
- return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
85
+ return (_openBlock(), _createBlock(_unref(Select), _mergeProps({
86
+ value: myValue.value,
87
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((myValue).value = $event)),
88
+ allowClear: ""
89
+ }, props, {
90
+ options: _options.value,
91
+ mode: "tags",
105
92
  style: { "width": "100%" },
106
- value: displayText.value,
107
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
108
- options: filteredOptions.value,
109
- onSearch: onSearch,
110
- onChange: onChange,
111
- onSelect: onSelect
112
- }), {
113
- option: _withCtx(({ value, label }) => [
114
- _renderSlot(_ctx.$slots, "option", { value: value }, () => [
115
- _createTextVNode(_toDisplayString(label || value), 1 /* TEXT */)
116
- ])
117
- ]),
118
- default: _withCtx(() => [
119
- _renderSlot(_ctx.$slots, "default")
120
- ]),
121
- _: 3 /* FORWARDED */
122
- }, 16 /* FULL_PROPS */, ["value", "options"]));
93
+ onSelect: onSelect,
94
+ onSearch: handleSearch,
95
+ onChange: handleChange
96
+ }), null, 16 /* FULL_PROPS */, ["value", "options"]));
123
97
  };
124
98
  }
125
99
  });
package/es/Search/Item.js CHANGED
@@ -28,6 +28,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
28
28
  "reactive": "setup-const",
29
29
  "watch": "setup-const",
30
30
  "isRef": "setup-const",
31
+ "nextTick": "setup-const",
31
32
  "Select": "setup-maybe-ref",
32
33
  "componentProps": "setup-maybe-ref",
33
34
  "componentType": "setup-maybe-ref",
@@ -50,7 +51,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
50
51
  "columnsValues": "setup-maybe-ref",
51
52
  "targetComponents": "setup-ref",
52
53
  "valueOptions": "setup-ref",
53
- "btwKeys": "setup-const",
54
+ "btwKeys": "setup-ref",
54
55
  "prefixCls": "setup-ref",
55
56
  "wrapSSR": "setup-maybe-ref",
56
57
  "hashId": "setup-maybe-ref",
@@ -62,7 +63,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
62
63
  "onTypeChange": "setup-const",
63
64
  "onColumnChange": "setup-const",
64
65
  "onTermTypeChange": "setup-const",
65
- "onValueChange": "setup-const"
66
+ "onValueChange": "setup-const",
67
+ "handleTermsModelValue": "setup-const"
66
68
  } */
67
69
  import { defineComponent as _defineComponent } from 'vue';
68
70
  import { unref as _unref, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createVNode as _createVNode, Fragment as _Fragment, resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue";
@@ -72,7 +74,7 @@ const _hoisted_1 = {
72
74
  };
73
75
  const _hoisted_2 = { key: 1 };
74
76
  const _hoisted_3 = { class: "JSearch-item--value" };
75
- import { computed, ref, reactive, watch, isRef } from 'vue';
77
+ import { computed, ref, reactive, watch, isRef, } from 'vue';
76
78
  import { Select } from 'ant-design-vue';
77
79
  import { componentProps, componentType, typeOptions } from "./setting";
78
80
  import { getTermOptions, getItemDefaultValue } from "./util";
@@ -132,7 +134,13 @@ const __sfc_main__ = _defineComponent({
132
134
  const columnsValues = useDefaultValue();
133
135
  const targetComponents = ref({});
134
136
  const valueOptions = ref();
135
- const btwKeys = ['in', 'nin'];
137
+ const btwKeys = computed(() => {
138
+ const record = findItemByColumn();
139
+ if (record.search.isBtw && Array.isArray(record.search.isBtw)) {
140
+ return [...record.search.isBtw, 'in', 'nin'];
141
+ }
142
+ return ['in', 'nin'];
143
+ });
136
144
  const prefixCls = computed(() => 'JSearch');
137
145
  const [wrapSSR, hashId] = useSearchStyle(prefixCls);
138
146
  const termTypeOptions = computed(() => {
@@ -187,12 +195,12 @@ const __sfc_main__ = _defineComponent({
187
195
  onValueChange();
188
196
  };
189
197
  const onTermTypeChange = () => {
190
- const isBtw = btwKeys.includes(termsModel.termType);
191
- if (!isBtw && Array.isArray(termsModel.value)) {
198
+ const isBtw = btwKeys.value.includes(termsModel.termType);
199
+ if (!isBtw && termsModel.value && Array.isArray(termsModel.value)) {
192
200
  termsModel.value = termsModel.value[0];
193
201
  onValueChange();
194
202
  }
195
- else if (isBtw && !Array.isArray(termsModel.value)) {
203
+ else if (isBtw && termsModel.value && !Array.isArray(termsModel.value)) {
196
204
  termsModel.value = [termsModel.value];
197
205
  onValueChange();
198
206
  }
@@ -201,21 +209,41 @@ const __sfc_main__ = _defineComponent({
201
209
  const onValueChange = () => {
202
210
  emit('update:value', termsModel.value);
203
211
  };
204
- watch(() => termsModel.termType, () => {
205
- const isBtw = btwKeys.includes(termsModel.termType);
212
+ const handleTermsModelValue = (isBtw) => {
213
+ if (isBtw) {
214
+ if (termsModel.value && !Array.isArray(termsModel.value)) {
215
+ termsModel.value = [termsModel.value];
216
+ }
217
+ else if (!termsModel.value) {
218
+ termsModel.value = [];
219
+ }
220
+ }
221
+ else {
222
+ if (termsModel.value && Array.isArray(termsModel.value)) {
223
+ termsModel.value = termsModel.value[0];
224
+ }
225
+ else if (!termsModel.value) {
226
+ termsModel.value = undefined;
227
+ }
228
+ }
229
+ };
230
+ watch(() => [targetComponents.value.name, termsModel.termType], () => {
231
+ const isBtw = btwKeys.value.includes(termsModel.termType);
206
232
  if (targetComponents.value.type === componentType.treeSelect) {
207
233
  targetComponents.value.props = {
208
234
  ...targetComponents.value.props,
209
235
  multiple: isBtw,
210
236
  };
237
+ handleTermsModelValue(isBtw);
211
238
  }
212
239
  else if (targetComponents.value.type === componentType.select) {
213
240
  targetComponents.value.props = {
214
241
  ...targetComponents.value.props,
215
242
  mode: isBtw ? 'multiple' : 'combobox',
216
243
  };
244
+ handleTermsModelValue(isBtw);
217
245
  }
218
- }, { immediate: true });
246
+ }, { immediate: true, deep: true });
219
247
  watch(() => [termsModel.column, columnsMap.value], async () => {
220
248
  // 根据column从map中获取record,再解析search属性
221
249
  const record = findItemByColumn();
@@ -158,7 +158,8 @@ export var componentProps = function componentProps(record) {
158
158
  type: type,
159
159
  name: DatePicker,
160
160
  props: _objectSpread({
161
- valueFormat: 'YYYY-MM-DD HH:mm:ss'
161
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
162
+ showTime: true
162
163
  }, _props)
163
164
  };
164
165
  case componentType.timeRange:
@@ -11,7 +11,7 @@ var _flattenTree = function flattenTree(tree) {
11
11
  return _objectSpread({}, omit(i, 'children'));
12
12
  });
13
13
  var flatNode = _objectSpread(_objectSpread({}, omit(item, 'children')), {}, {
14
- children: _children,
14
+ _children: _children,
15
15
  level: level,
16
16
  parentId: parentId,
17
17
  expanded: false,
@@ -1,9 +1,3 @@
1
- function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) {
2
- return lhs;
3
- }
4
- else {
5
- return rhsFn();
6
- } }
7
1
  function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
8
2
  const op = ops[i];
9
3
  const fn = ops[i + 1];
@@ -22,34 +16,31 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
22
16
  } return value; }
23
17
  /* Analyzed bindings: {
24
18
  "searchKey": "props",
25
- "AutoComplete": "setup-maybe-ref",
26
- "autoCompleteProps": "setup-maybe-ref",
19
+ "Select": "setup-maybe-ref",
20
+ "selectProps": "setup-maybe-ref",
27
21
  "ref": "setup-const",
28
22
  "watch": "setup-const",
29
23
  "computed": "setup-const",
30
- "omit": "setup-maybe-ref",
31
24
  "props": "setup-reactive-const",
32
25
  "emit": "setup-const",
33
- "displayText": "setup-ref",
34
- "selectedValue": "setup-ref",
35
- "keyword": "setup-ref",
36
- "filteredOptions": "setup-ref",
37
- "onSearch": "setup-const",
38
- "onSelect": "setup-const",
39
- "onChange": "setup-const"
26
+ "myValue": "setup-ref",
27
+ "_label": "setup-ref",
28
+ "handleChange": "setup-const",
29
+ "_options": "setup-ref",
30
+ "handleSearch": "setup-const",
31
+ "onSelect": "setup-const"
40
32
  } */
41
33
  import { defineComponent as _defineComponent } from 'vue';
42
- import { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
43
- import { AutoComplete } from 'ant-design-vue';
44
- import { autoCompleteProps } from 'ant-design-vue/lib/auto-complete';
34
+ import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from "vue";
35
+ import { Select } from 'ant-design-vue';
36
+ import { selectProps } from 'ant-design-vue/lib/select';
45
37
  import { ref, watch, computed } from 'vue';
46
- import { omit } from "lodash-es";
47
38
  const __sfc_main__ = _defineComponent({
48
39
  ...{
49
40
  name: 'JAutoComplete'
50
41
  },
51
42
  props: {
52
- ...autoCompleteProps(),
43
+ ...selectProps(),
53
44
  searchKey: {
54
45
  type: String,
55
46
  default: 'label',
@@ -59,67 +50,50 @@ const __sfc_main__ = _defineComponent({
59
50
  setup(__props, { emit: __emit }) {
60
51
  const props = __props;
61
52
  const emit = __emit;
62
- const displayText = ref();
63
- const selectedValue = ref();
64
- const keyword = ref('');
65
- const filteredOptions = computed(() => {
66
- if (!keyword.value)
53
+ const myValue = ref();
54
+ const _label = ref();
55
+ const handleChange = (e) => {
56
+ if (e.length === 0) {
57
+ myValue.value = undefined;
58
+ emit('update:value', undefined);
59
+ }
60
+ };
61
+ const _options = computed(() => {
62
+ const item = props.options.find(option => option.value === myValue.value);
63
+ if (item || !myValue.value) {
64
+ _label.value = _optionalChain([item, 'optionalAccess', _ => _.label]);
67
65
  return props.options;
68
- return props.options.filter(opt => String(_nullishCoalesce(opt[props.searchKey], () => ('')))
69
- .includes(keyword.value));
66
+ }
67
+ _label.value = myValue.value;
68
+ return [
69
+ { label: myValue.value, value: myValue.value },
70
+ ...props.options
71
+ ];
70
72
  });
71
- /**
72
- * 根据关键词提示
73
- * @param searchText 关键词
74
- */
75
- const onSearch = (searchText) => {
76
- keyword.value = searchText;
77
- // _options.value = props.options?.filter(
78
- // (item) => !!item[props.searchKey]?.includes(searchText),
79
- // ) || [];
80
- // if (!_options.value.length) {
81
- // _options.value.unshift({ label: searchText, value: searchText });
82
- // }
73
+ const handleSearch = (e) => {
74
+ myValue.value = e;
83
75
  };
84
76
  const onSelect = (val, option) => {
85
- displayText.value = option.label;
77
+ myValue.value = val;
86
78
  emit('update:value', val);
87
79
  emit('select', val, option);
88
80
  };
89
- const onChange = (val) => {
90
- displayText.value = val;
91
- keyword.value = val;
92
- emit('update:value', '');
93
- };
94
81
  watch(() => props.value, (val) => {
95
- if (!val) {
96
- displayText.value = '';
97
- }
98
- else {
99
- const found = _optionalChain([props, 'access', _2 => _2.options, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((opt) => opt.value === val)]);
100
- displayText.value = _nullishCoalesce(_optionalChain([found, 'optionalAccess', _5 => _5.label]), () => (''));
101
- }
82
+ myValue.value = val;
102
83
  }, { immediate: true });
103
84
  return (_ctx, _cache) => {
104
- return (_openBlock(), _createBlock(_unref(AutoComplete), _mergeProps({ ..._unref(omit)(props, ['onSelect']) }, {
85
+ return (_openBlock(), _createBlock(_unref(Select), _mergeProps({
86
+ value: myValue.value,
87
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((myValue).value = $event)),
88
+ allowClear: ""
89
+ }, props, {
90
+ options: _options.value,
91
+ mode: "tags",
105
92
  style: { "width": "100%" },
106
- value: displayText.value,
107
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((displayText).value = $event)),
108
- options: filteredOptions.value,
109
- onSearch: onSearch,
110
- onChange: onChange,
111
- onSelect: onSelect
112
- }), {
113
- option: _withCtx(({ value, label }) => [
114
- _renderSlot(_ctx.$slots, "option", { value: value }, () => [
115
- _createTextVNode(_toDisplayString(label || value), 1 /* TEXT */)
116
- ])
117
- ]),
118
- default: _withCtx(() => [
119
- _renderSlot(_ctx.$slots, "default")
120
- ]),
121
- _: 3 /* FORWARDED */
122
- }, 16 /* FULL_PROPS */, ["value", "options"]));
93
+ onSelect: onSelect,
94
+ onSearch: handleSearch,
95
+ onChange: handleChange
96
+ }), null, 16 /* FULL_PROPS */, ["value", "options"]));
123
97
  };
124
98
  }
125
99
  });
@@ -28,6 +28,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
28
28
  "reactive": "setup-const",
29
29
  "watch": "setup-const",
30
30
  "isRef": "setup-const",
31
+ "nextTick": "setup-const",
31
32
  "Select": "setup-maybe-ref",
32
33
  "componentProps": "setup-maybe-ref",
33
34
  "componentType": "setup-maybe-ref",
@@ -50,7 +51,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
50
51
  "columnsValues": "setup-maybe-ref",
51
52
  "targetComponents": "setup-ref",
52
53
  "valueOptions": "setup-ref",
53
- "btwKeys": "setup-const",
54
+ "btwKeys": "setup-ref",
54
55
  "prefixCls": "setup-ref",
55
56
  "wrapSSR": "setup-maybe-ref",
56
57
  "hashId": "setup-maybe-ref",
@@ -62,7 +63,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
62
63
  "onTypeChange": "setup-const",
63
64
  "onColumnChange": "setup-const",
64
65
  "onTermTypeChange": "setup-const",
65
- "onValueChange": "setup-const"
66
+ "onValueChange": "setup-const",
67
+ "handleTermsModelValue": "setup-const"
66
68
  } */
67
69
  import { defineComponent as _defineComponent } from 'vue';
68
70
  import { unref as _unref, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, createVNode as _createVNode, Fragment as _Fragment, resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue";
@@ -72,7 +74,7 @@ const _hoisted_1 = {
72
74
  };
73
75
  const _hoisted_2 = { key: 1 };
74
76
  const _hoisted_3 = { class: "JSearch-item--value" };
75
- import { computed, ref, reactive, watch, isRef } from 'vue';
77
+ import { computed, ref, reactive, watch, isRef, } from 'vue';
76
78
  import { Select } from 'ant-design-vue';
77
79
  import { componentProps, componentType, typeOptions } from "./setting";
78
80
  import { getTermOptions, getItemDefaultValue } from "./util";
@@ -132,7 +134,13 @@ const __sfc_main__ = _defineComponent({
132
134
  const columnsValues = useDefaultValue();
133
135
  const targetComponents = ref({});
134
136
  const valueOptions = ref();
135
- const btwKeys = ['in', 'nin'];
137
+ const btwKeys = computed(() => {
138
+ const record = findItemByColumn();
139
+ if (record.search.isBtw && Array.isArray(record.search.isBtw)) {
140
+ return [...record.search.isBtw, 'in', 'nin'];
141
+ }
142
+ return ['in', 'nin'];
143
+ });
136
144
  const prefixCls = computed(() => 'JSearch');
137
145
  const [wrapSSR, hashId] = useSearchStyle(prefixCls);
138
146
  const termTypeOptions = computed(() => {
@@ -187,12 +195,12 @@ const __sfc_main__ = _defineComponent({
187
195
  onValueChange();
188
196
  };
189
197
  const onTermTypeChange = () => {
190
- const isBtw = btwKeys.includes(termsModel.termType);
191
- if (!isBtw && Array.isArray(termsModel.value)) {
198
+ const isBtw = btwKeys.value.includes(termsModel.termType);
199
+ if (!isBtw && termsModel.value && Array.isArray(termsModel.value)) {
192
200
  termsModel.value = termsModel.value[0];
193
201
  onValueChange();
194
202
  }
195
- else if (isBtw && !Array.isArray(termsModel.value)) {
203
+ else if (isBtw && termsModel.value && !Array.isArray(termsModel.value)) {
196
204
  termsModel.value = [termsModel.value];
197
205
  onValueChange();
198
206
  }
@@ -201,21 +209,41 @@ const __sfc_main__ = _defineComponent({
201
209
  const onValueChange = () => {
202
210
  emit('update:value', termsModel.value);
203
211
  };
204
- watch(() => termsModel.termType, () => {
205
- const isBtw = btwKeys.includes(termsModel.termType);
212
+ const handleTermsModelValue = (isBtw) => {
213
+ if (isBtw) {
214
+ if (termsModel.value && !Array.isArray(termsModel.value)) {
215
+ termsModel.value = [termsModel.value];
216
+ }
217
+ else if (!termsModel.value) {
218
+ termsModel.value = [];
219
+ }
220
+ }
221
+ else {
222
+ if (termsModel.value && Array.isArray(termsModel.value)) {
223
+ termsModel.value = termsModel.value[0];
224
+ }
225
+ else if (!termsModel.value) {
226
+ termsModel.value = undefined;
227
+ }
228
+ }
229
+ };
230
+ watch(() => [targetComponents.value.name, termsModel.termType], () => {
231
+ const isBtw = btwKeys.value.includes(termsModel.termType);
206
232
  if (targetComponents.value.type === componentType.treeSelect) {
207
233
  targetComponents.value.props = {
208
234
  ...targetComponents.value.props,
209
235
  multiple: isBtw,
210
236
  };
237
+ handleTermsModelValue(isBtw);
211
238
  }
212
239
  else if (targetComponents.value.type === componentType.select) {
213
240
  targetComponents.value.props = {
214
241
  ...targetComponents.value.props,
215
242
  mode: isBtw ? 'multiple' : 'combobox',
216
243
  };
244
+ handleTermsModelValue(isBtw);
217
245
  }
218
- }, { immediate: true });
246
+ }, { immediate: true, deep: true });
219
247
  watch(() => [termsModel.column, columnsMap.value], async () => {
220
248
  // 根据column从map中获取record,再解析search属性
221
249
  const record = findItemByColumn();
@@ -165,7 +165,8 @@ var componentProps = exports.componentProps = function componentProps(record) {
165
165
  type: type,
166
166
  name: _antDesignVue.DatePicker,
167
167
  props: (0, _objectSpread2.default)({
168
- valueFormat: 'YYYY-MM-DD HH:mm:ss'
168
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
169
+ showTime: true
169
170
  }, _props)
170
171
  };
171
172
  case componentType.timeRange:
@@ -19,7 +19,7 @@ var _flattenTree = exports.flattenTree = function flattenTree(tree) {
19
19
  return (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(i, 'children'));
20
20
  });
21
21
  var flatNode = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodashEs.omit)(item, 'children')), {}, {
22
- children: _children,
22
+ _children: _children,
23
23
  level: level,
24
24
  parentId: parentId,
25
25
  expanded: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetlinks-web/components",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -155,8 +155,8 @@
155
155
  "webpack-merge": "^5.0.0",
156
156
  "webpackbar": "^5.0.2",
157
157
  "@jetlinks-web/constants": "^1.0.9",
158
- "@jetlinks-web/utils": "^1.2.12",
159
- "@jetlinks-web/hooks": "^1.1.1"
158
+ "@jetlinks-web/hooks": "^1.1.1",
159
+ "@jetlinks-web/utils": "^1.2.12"
160
160
  },
161
161
  "publishConfig": {
162
162
  "registry": "https://registry.npmjs.org/",