@jetlinks-web/components 2.4.10 → 2.4.12
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/es/EditTable/EditTable.js +1 -1
- package/es/EditTable/FormItem.js +1 -1
- package/es/FullPage/FullPage.js +1 -1
- package/es/ProLayout/SiderMenu/SiderMenu.js +1 -0
- package/es/RadioButton/RadioButton.js +1 -1
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Advanced/index.js +47 -15
- package/es/Search/Item.js +2 -1
- package/es/Search/Search.js +1 -1
- package/es/Search/util.js +22 -0
- package/es/ValueItem/ValueItem.js +1 -1
- package/lib/EditTable/EditTable.js +1 -1
- package/lib/EditTable/FormItem.js +1 -1
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/ProLayout/SiderMenu/SiderMenu.js +1 -0
- package/lib/RadioButton/RadioButton.js +1 -1
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Advanced/index.js +47 -15
- package/lib/Search/Item.js +2 -1
- package/lib/Search/Search.js +1 -1
- package/lib/Search/util.js +23 -1
- package/lib/ValueItem/ValueItem.js +1 -1
- package/package.json +3 -3
|
@@ -241,7 +241,7 @@ const __sfc_main__ = Object.assign({
|
|
|
241
241
|
if (props.dataSource.length * props.cellHeight) {
|
|
242
242
|
_width = 17;
|
|
243
243
|
}
|
|
244
|
-
if (_optionalChain([tableBody, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.getViewScrollRef])) {
|
|
244
|
+
if (_optionalChain([tableBody, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.getViewScrollRef]) && props.dataSource.length) {
|
|
245
245
|
const viewScrollDom = _optionalChain([tableBody, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.getViewScrollRef, 'call', _6 => _6()]);
|
|
246
246
|
const bodyContainer = viewScrollDom.querySelector('.jetlinks-edit-table-body-container');
|
|
247
247
|
_width = viewScrollDom.offsetWidth - bodyContainer.offsetWidth;
|
package/es/EditTable/FormItem.js
CHANGED
|
@@ -48,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
48
48
|
"onFieldChange": "setup-const"
|
|
49
49
|
} */
|
|
50
50
|
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
51
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
51
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950759258"), n = n(), _popScopeId(), n);
|
|
52
52
|
const _hoisted_1 = { style: { "color": "#1d2129" } };
|
|
53
53
|
const _hoisted_2 = {
|
|
54
54
|
key: 0,
|
package/es/FullPage/FullPage.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
} */
|
|
10
10
|
import { defineComponent as _defineComponent } from 'vue';
|
|
11
11
|
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
12
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
12
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950761220"), n = n(), _popScopeId(), n);
|
|
13
13
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
14
14
|
import { ref, inject } from 'vue';
|
|
15
15
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -242,6 +242,7 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
242
242
|
},
|
|
243
243
|
'onUpdate:selectedKeys': handleSelect
|
|
244
244
|
}, null);
|
|
245
|
+
console.log('context', context.fixSiderbar);
|
|
245
246
|
return _createVNode(_Fragment, null, [context.fixSiderbar && _createVNode("div", {
|
|
246
247
|
"style": {
|
|
247
248
|
width: "".concat(sSideWidth.value, "px"),
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"onClick": "setup-const"
|
|
11
11
|
} */
|
|
12
12
|
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
13
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950766709"), n = n(), _popScopeId(), n);
|
|
14
14
|
const _hoisted_1 = ["onClick"];
|
|
15
15
|
const __sfc_main__ = Object.assign({
|
|
16
16
|
name: 'JRadioButton',
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} */
|
|
22
22
|
import { defineComponent as _defineComponent } from 'vue';
|
|
23
23
|
import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
24
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
24
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950771289"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
|
@@ -25,6 +25,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
25
25
|
"deleteKey": "props",
|
|
26
26
|
"routerMode": "props",
|
|
27
27
|
"style": "props",
|
|
28
|
+
"defaultValues": "props",
|
|
28
29
|
"SearchItem": "setup-const",
|
|
29
30
|
"optionsMapKey": "setup-maybe-ref",
|
|
30
31
|
"typeOptions": "setup-maybe-ref",
|
|
@@ -42,6 +43,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
42
43
|
"handleQData": "setup-maybe-ref",
|
|
43
44
|
"hasExpand": "setup-maybe-ref",
|
|
44
45
|
"termsParamsFormat": "setup-maybe-ref",
|
|
46
|
+
"termsToValue": "setup-maybe-ref",
|
|
45
47
|
"Select": "setup-maybe-ref",
|
|
46
48
|
"Button": "setup-maybe-ref",
|
|
47
49
|
"Form": "setup-maybe-ref",
|
|
@@ -59,6 +61,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
59
61
|
"compatible": "setup-ref",
|
|
60
62
|
"screenSize": "setup-ref",
|
|
61
63
|
"resetNumber": "setup-ref",
|
|
64
|
+
"isFirstHandleDefaultValues": "setup-let",
|
|
62
65
|
"searchItems": "setup-ref",
|
|
63
66
|
"termsData": "setup-reactive-const",
|
|
64
67
|
"columnOptionMap": "setup-ref",
|
|
@@ -71,6 +74,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
71
74
|
"reset": "setup-const",
|
|
72
75
|
"historyItemClick": "setup-const",
|
|
73
76
|
"handleUrlParams": "setup-const",
|
|
77
|
+
"handleDefaultValues": "setup-const",
|
|
74
78
|
"handleItems": "setup-const"
|
|
75
79
|
} */
|
|
76
80
|
import { defineComponent as _defineComponent } from 'vue';
|
|
@@ -100,7 +104,7 @@ import { useRouteQuery } from '@vueuse/router';
|
|
|
100
104
|
import { ref, reactive, watch, provide } from 'vue';
|
|
101
105
|
import SaveHistory from './SaveHistory.js';
|
|
102
106
|
import History from './History.js';
|
|
103
|
-
import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsFormat, } from '../util';
|
|
107
|
+
import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsFormat, termsToValue, } from '../util';
|
|
104
108
|
import { Select, Button, Form, FormItemRest } from 'ant-design-vue';
|
|
105
109
|
import { AIcon } from '../../../';
|
|
106
110
|
import { cloneDeep } from 'lodash-es';
|
|
@@ -151,9 +155,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
151
155
|
type: [String, Object],
|
|
152
156
|
default: undefined,
|
|
153
157
|
},
|
|
158
|
+
defaultValues: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: undefined,
|
|
161
|
+
}
|
|
154
162
|
},
|
|
155
163
|
emits: ["search"],
|
|
156
|
-
setup(__props, { emit: __emit }) {
|
|
164
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
157
165
|
const props = __props;
|
|
158
166
|
const searchRef = ref(null);
|
|
159
167
|
const searchRefContentRef = ref(null);
|
|
@@ -169,6 +177,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
169
177
|
// 当前组件宽度 true 大于1000
|
|
170
178
|
const screenSize = ref(true);
|
|
171
179
|
const resetNumber = ref(1);
|
|
180
|
+
let isFirstHandleDefaultValues = false;
|
|
172
181
|
const searchItems = ref([]); // 当前查询条件
|
|
173
182
|
const termsData = reactive({
|
|
174
183
|
terms: [
|
|
@@ -232,18 +241,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
232
241
|
resetNumber.value += 1;
|
|
233
242
|
emit('search', { terms: [] });
|
|
234
243
|
};
|
|
235
|
-
watch(width, (value) => {
|
|
236
|
-
if (value < 1000) {
|
|
237
|
-
layout.value = 'vertical';
|
|
238
|
-
screenSize.value = false;
|
|
239
|
-
compatible.value = value < 760;
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
layout.value = 'horizontal';
|
|
243
|
-
screenSize.value = true;
|
|
244
|
-
compatible.value = false;
|
|
245
|
-
}
|
|
246
|
-
}, { immediate: true });
|
|
247
244
|
const historyItemClick = (content) => {
|
|
248
245
|
try {
|
|
249
246
|
termsData.terms = _optionalChain([handleQData, 'call', _2 => _2(compatibleOldTerms(content)), 'optionalAccess', _3 => _3.terms]) || [];
|
|
@@ -267,6 +264,20 @@ const __sfc_main__ = _defineComponent({
|
|
|
267
264
|
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
268
265
|
}
|
|
269
266
|
};
|
|
267
|
+
/**
|
|
268
|
+
* 处理传入的默认值
|
|
269
|
+
*/
|
|
270
|
+
const handleDefaultValues = () => {
|
|
271
|
+
const defaultValues = props.defaultValues.terms.map((a) => {
|
|
272
|
+
a.terms.map((b) => {
|
|
273
|
+
return termsToValue(b, searchItems.value);
|
|
274
|
+
});
|
|
275
|
+
return a;
|
|
276
|
+
});
|
|
277
|
+
termsData.terms = _optionalChain([handleQData, 'call', _6 => _6(compatibleOldTerms(JSON.stringify({ terms: defaultValues }))), 'optionalAccess', _7 => _7.terms]) || [];
|
|
278
|
+
expand.value = hasExpand(termsData.terms);
|
|
279
|
+
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
280
|
+
};
|
|
270
281
|
/**
|
|
271
282
|
* 处理每项的key为Item组件所需要的key
|
|
272
283
|
*/
|
|
@@ -309,7 +320,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
309
320
|
}
|
|
310
321
|
});
|
|
311
322
|
submitData();
|
|
312
|
-
|
|
323
|
+
if (props.defaultValues && !isFirstHandleDefaultValues) {
|
|
324
|
+
handleDefaultValues();
|
|
325
|
+
isFirstHandleDefaultValues = true;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
handleUrlParams({ q: q.value, target: target.value });
|
|
329
|
+
}
|
|
313
330
|
};
|
|
314
331
|
watch(() => props.columns, () => {
|
|
315
332
|
termsData.terms = [
|
|
@@ -325,7 +342,22 @@ const __sfc_main__ = _defineComponent({
|
|
|
325
342
|
}, {
|
|
326
343
|
deep: true,
|
|
327
344
|
});
|
|
345
|
+
watch(width, (value) => {
|
|
346
|
+
if (value < 1000) {
|
|
347
|
+
layout.value = 'vertical';
|
|
348
|
+
screenSize.value = false;
|
|
349
|
+
compatible.value = value < 760;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
layout.value = 'horizontal';
|
|
353
|
+
screenSize.value = true;
|
|
354
|
+
compatible.value = false;
|
|
355
|
+
}
|
|
356
|
+
}, { immediate: true });
|
|
328
357
|
handleItems();
|
|
358
|
+
__expose({
|
|
359
|
+
setValues: handleDefaultValues,
|
|
360
|
+
});
|
|
329
361
|
return (_ctx, _cache) => {
|
|
330
362
|
return (_openBlock(), _createBlock(_unref(Form), {
|
|
331
363
|
model: termsData,
|
package/es/Search/Item.js
CHANGED
|
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
78
|
} */
|
|
79
79
|
import { defineComponent as _defineComponent } from 'vue';
|
|
80
80
|
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
81
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
81
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950768664"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
|
@@ -155,6 +155,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
155
155
|
* @param column {}
|
|
156
156
|
* @param options {}
|
|
157
157
|
* @param defaultTermType {}
|
|
158
|
+
* @param termFilter {}
|
|
158
159
|
*/
|
|
159
160
|
const getTermType = (type, column, options, defaultTermType, termFilter) => {
|
|
160
161
|
termTypeOptions.option = _optionalChain([options, 'optionalAccess', _10 => _10.length])
|
package/es/Search/Search.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
} */
|
|
44
44
|
import { defineComponent as _defineComponent } from 'vue';
|
|
45
45
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
46
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
46
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950769219"), n = n(), _popScopeId(), n);
|
|
47
47
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
48
48
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
49
49
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
package/es/Search/util.js
CHANGED
|
@@ -153,6 +153,7 @@ export var compatibleOldTerms = function compatibleOldTerms(q) {
|
|
|
153
153
|
terms: _terms
|
|
154
154
|
};
|
|
155
155
|
} catch (e) {
|
|
156
|
+
console.warn('[Pro Search Error] > ', e);
|
|
156
157
|
return {
|
|
157
158
|
terms: _terms
|
|
158
159
|
};
|
|
@@ -231,4 +232,25 @@ export var getTermOptions = function getTermOptions(type, column) {
|
|
|
231
232
|
break;
|
|
232
233
|
}
|
|
233
234
|
return keys.length ? getTermTypes(keys) : termType;
|
|
235
|
+
};
|
|
236
|
+
export var termsToValue = function termsToValue(targetItem, searchItems) {
|
|
237
|
+
if (['like', 'nlike'].includes(targetItem.termType) && !!targetItem.value) {
|
|
238
|
+
if (targetItem.value.startsWith('%') && targetItem.value.endsWith('%')) {
|
|
239
|
+
targetItem.value = targetItem.value.slice(1, -1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// 处理重命名
|
|
243
|
+
var searchItem = searchItems.filter(function (item) {
|
|
244
|
+
return item.rename;
|
|
245
|
+
}).find(function (item) {
|
|
246
|
+
if (item.rename === targetItem.column) {
|
|
247
|
+
targetItem.column = item.column;
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
return item.column === targetItem.column;
|
|
251
|
+
});
|
|
252
|
+
if (!targetItem.termType) {
|
|
253
|
+
targetItem.termType = getTermTypeFn(searchItem.type);
|
|
254
|
+
}
|
|
255
|
+
return targetItem;
|
|
234
256
|
};
|
|
@@ -241,7 +241,7 @@ const __sfc_main__ = Object.assign({
|
|
|
241
241
|
if (props.dataSource.length * props.cellHeight) {
|
|
242
242
|
_width = 17;
|
|
243
243
|
}
|
|
244
|
-
if (_optionalChain([tableBody, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.getViewScrollRef])) {
|
|
244
|
+
if (_optionalChain([tableBody, 'access', _2 => _2.value, 'optionalAccess', _3 => _3.getViewScrollRef]) && props.dataSource.length) {
|
|
245
245
|
const viewScrollDom = _optionalChain([tableBody, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.getViewScrollRef, 'call', _6 => _6()]);
|
|
246
246
|
const bodyContainer = viewScrollDom.querySelector('.jetlinks-edit-table-body-container');
|
|
247
247
|
_width = viewScrollDom.offsetWidth - bodyContainer.offsetWidth;
|
|
@@ -48,7 +48,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
48
48
|
"onFieldChange": "setup-const"
|
|
49
49
|
} */
|
|
50
50
|
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
51
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
51
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950759474"), n = n(), _popScopeId(), n);
|
|
52
52
|
const _hoisted_1 = { style: { "color": "#1d2129" } };
|
|
53
53
|
const _hoisted_2 = {
|
|
54
54
|
key: 0,
|
package/lib/FullPage/FullPage.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
} */
|
|
10
10
|
import { defineComponent as _defineComponent } from 'vue';
|
|
11
11
|
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
12
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
12
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950761270"), n = n(), _popScopeId(), n);
|
|
13
13
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
14
14
|
import { ref, inject } from 'vue';
|
|
15
15
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -251,6 +251,7 @@ var SiderMenu = function SiderMenu(props) {
|
|
|
251
251
|
},
|
|
252
252
|
'onUpdate:selectedKeys': handleSelect
|
|
253
253
|
}, null);
|
|
254
|
+
console.log('context', context.fixSiderbar);
|
|
254
255
|
return (0, _vue.createVNode)(_vue.Fragment, null, [context.fixSiderbar && (0, _vue.createVNode)("div", {
|
|
255
256
|
"style": {
|
|
256
257
|
width: "".concat(sSideWidth.value, "px"),
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"onClick": "setup-const"
|
|
11
11
|
} */
|
|
12
12
|
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
13
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
13
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950766775"), n = n(), _popScopeId(), n);
|
|
14
14
|
const _hoisted_1 = ["onClick"];
|
|
15
15
|
const __sfc_main__ = Object.assign({
|
|
16
16
|
name: 'JRadioButton',
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} */
|
|
22
22
|
import { defineComponent as _defineComponent } from 'vue';
|
|
23
23
|
import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
24
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
24
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950771368"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
|
@@ -25,6 +25,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
25
25
|
"deleteKey": "props",
|
|
26
26
|
"routerMode": "props",
|
|
27
27
|
"style": "props",
|
|
28
|
+
"defaultValues": "props",
|
|
28
29
|
"SearchItem": "setup-const",
|
|
29
30
|
"optionsMapKey": "setup-maybe-ref",
|
|
30
31
|
"typeOptions": "setup-maybe-ref",
|
|
@@ -42,6 +43,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
42
43
|
"handleQData": "setup-maybe-ref",
|
|
43
44
|
"hasExpand": "setup-maybe-ref",
|
|
44
45
|
"termsParamsFormat": "setup-maybe-ref",
|
|
46
|
+
"termsToValue": "setup-maybe-ref",
|
|
45
47
|
"Select": "setup-maybe-ref",
|
|
46
48
|
"Button": "setup-maybe-ref",
|
|
47
49
|
"Form": "setup-maybe-ref",
|
|
@@ -59,6 +61,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
59
61
|
"compatible": "setup-ref",
|
|
60
62
|
"screenSize": "setup-ref",
|
|
61
63
|
"resetNumber": "setup-ref",
|
|
64
|
+
"isFirstHandleDefaultValues": "setup-let",
|
|
62
65
|
"searchItems": "setup-ref",
|
|
63
66
|
"termsData": "setup-reactive-const",
|
|
64
67
|
"columnOptionMap": "setup-ref",
|
|
@@ -71,6 +74,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
71
74
|
"reset": "setup-const",
|
|
72
75
|
"historyItemClick": "setup-const",
|
|
73
76
|
"handleUrlParams": "setup-const",
|
|
77
|
+
"handleDefaultValues": "setup-const",
|
|
74
78
|
"handleItems": "setup-const"
|
|
75
79
|
} */
|
|
76
80
|
import { defineComponent as _defineComponent } from 'vue';
|
|
@@ -100,7 +104,7 @@ import { useRouteQuery } from '@vueuse/router';
|
|
|
100
104
|
import { ref, reactive, watch, provide } from 'vue';
|
|
101
105
|
import SaveHistory from './SaveHistory.js';
|
|
102
106
|
import History from './History.js';
|
|
103
|
-
import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsFormat, } from '../util';
|
|
107
|
+
import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsFormat, termsToValue, } from '../util';
|
|
104
108
|
import { Select, Button, Form, FormItemRest } from 'ant-design-vue';
|
|
105
109
|
import { AIcon } from '../../../';
|
|
106
110
|
import { cloneDeep } from 'lodash-es';
|
|
@@ -151,9 +155,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
151
155
|
type: [String, Object],
|
|
152
156
|
default: undefined,
|
|
153
157
|
},
|
|
158
|
+
defaultValues: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: undefined,
|
|
161
|
+
}
|
|
154
162
|
},
|
|
155
163
|
emits: ["search"],
|
|
156
|
-
setup(__props, { emit: __emit }) {
|
|
164
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
157
165
|
const props = __props;
|
|
158
166
|
const searchRef = ref(null);
|
|
159
167
|
const searchRefContentRef = ref(null);
|
|
@@ -169,6 +177,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
169
177
|
// 当前组件宽度 true 大于1000
|
|
170
178
|
const screenSize = ref(true);
|
|
171
179
|
const resetNumber = ref(1);
|
|
180
|
+
let isFirstHandleDefaultValues = false;
|
|
172
181
|
const searchItems = ref([]); // 当前查询条件
|
|
173
182
|
const termsData = reactive({
|
|
174
183
|
terms: [
|
|
@@ -232,18 +241,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
232
241
|
resetNumber.value += 1;
|
|
233
242
|
emit('search', { terms: [] });
|
|
234
243
|
};
|
|
235
|
-
watch(width, (value) => {
|
|
236
|
-
if (value < 1000) {
|
|
237
|
-
layout.value = 'vertical';
|
|
238
|
-
screenSize.value = false;
|
|
239
|
-
compatible.value = value < 760;
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
layout.value = 'horizontal';
|
|
243
|
-
screenSize.value = true;
|
|
244
|
-
compatible.value = false;
|
|
245
|
-
}
|
|
246
|
-
}, { immediate: true });
|
|
247
244
|
const historyItemClick = (content) => {
|
|
248
245
|
try {
|
|
249
246
|
termsData.terms = _optionalChain([handleQData, 'call', _2 => _2(compatibleOldTerms(content)), 'optionalAccess', _3 => _3.terms]) || [];
|
|
@@ -267,6 +264,20 @@ const __sfc_main__ = _defineComponent({
|
|
|
267
264
|
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
268
265
|
}
|
|
269
266
|
};
|
|
267
|
+
/**
|
|
268
|
+
* 处理传入的默认值
|
|
269
|
+
*/
|
|
270
|
+
const handleDefaultValues = () => {
|
|
271
|
+
const defaultValues = props.defaultValues.terms.map((a) => {
|
|
272
|
+
a.terms.map((b) => {
|
|
273
|
+
return termsToValue(b, searchItems.value);
|
|
274
|
+
});
|
|
275
|
+
return a;
|
|
276
|
+
});
|
|
277
|
+
termsData.terms = _optionalChain([handleQData, 'call', _6 => _6(compatibleOldTerms(JSON.stringify({ terms: defaultValues }))), 'optionalAccess', _7 => _7.terms]) || [];
|
|
278
|
+
expand.value = hasExpand(termsData.terms);
|
|
279
|
+
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
280
|
+
};
|
|
270
281
|
/**
|
|
271
282
|
* 处理每项的key为Item组件所需要的key
|
|
272
283
|
*/
|
|
@@ -309,7 +320,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
309
320
|
}
|
|
310
321
|
});
|
|
311
322
|
submitData();
|
|
312
|
-
|
|
323
|
+
if (props.defaultValues && !isFirstHandleDefaultValues) {
|
|
324
|
+
handleDefaultValues();
|
|
325
|
+
isFirstHandleDefaultValues = true;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
handleUrlParams({ q: q.value, target: target.value });
|
|
329
|
+
}
|
|
313
330
|
};
|
|
314
331
|
watch(() => props.columns, () => {
|
|
315
332
|
termsData.terms = [
|
|
@@ -325,7 +342,22 @@ const __sfc_main__ = _defineComponent({
|
|
|
325
342
|
}, {
|
|
326
343
|
deep: true,
|
|
327
344
|
});
|
|
345
|
+
watch(width, (value) => {
|
|
346
|
+
if (value < 1000) {
|
|
347
|
+
layout.value = 'vertical';
|
|
348
|
+
screenSize.value = false;
|
|
349
|
+
compatible.value = value < 760;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
layout.value = 'horizontal';
|
|
353
|
+
screenSize.value = true;
|
|
354
|
+
compatible.value = false;
|
|
355
|
+
}
|
|
356
|
+
}, { immediate: true });
|
|
328
357
|
handleItems();
|
|
358
|
+
__expose({
|
|
359
|
+
setValues: handleDefaultValues,
|
|
360
|
+
});
|
|
329
361
|
return (_ctx, _cache) => {
|
|
330
362
|
return (_openBlock(), _createBlock(_unref(Form), {
|
|
331
363
|
model: termsData,
|
package/lib/Search/Item.js
CHANGED
|
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
78
|
} */
|
|
79
79
|
import { defineComponent as _defineComponent } from 'vue';
|
|
80
80
|
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
81
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
81
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950768962"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
|
@@ -155,6 +155,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
155
155
|
* @param column {}
|
|
156
156
|
* @param options {}
|
|
157
157
|
* @param defaultTermType {}
|
|
158
|
+
* @param termFilter {}
|
|
158
159
|
*/
|
|
159
160
|
const getTermType = (type, column, options, defaultTermType, termFilter) => {
|
|
160
161
|
termTypeOptions.option = _optionalChain([options, 'optionalAccess', _10 => _10.length])
|
package/lib/Search/Search.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
} */
|
|
44
44
|
import { defineComponent as _defineComponent } from 'vue';
|
|
45
45
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
46
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
46
|
+
const _withScopeId = n => (_pushScopeId("data-v-1734950769356"), n = n(), _popScopeId(), n);
|
|
47
47
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
48
48
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
49
49
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
package/lib/Search/util.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.termsParamsFormat = exports.hasExpand = exports.handleQData = exports.handleParamsToString = exports.handleLikeValue = exports.getTermTypes = exports.getTermTypeFn = exports.getTermOptions = exports.filterTreeSelectNode = exports.filterSelectNode = exports.compatibleOldTerms = void 0;
|
|
7
|
+
exports.termsToValue = exports.termsParamsFormat = exports.hasExpand = exports.handleQData = exports.handleParamsToString = exports.handleLikeValue = exports.getTermTypes = exports.getTermTypeFn = exports.getTermOptions = exports.filterTreeSelectNode = exports.filterSelectNode = exports.compatibleOldTerms = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _lodashEs = require("lodash");
|
|
@@ -160,6 +160,7 @@ var compatibleOldTerms = exports.compatibleOldTerms = function compatibleOldTerm
|
|
|
160
160
|
terms: _terms
|
|
161
161
|
};
|
|
162
162
|
} catch (e) {
|
|
163
|
+
console.warn('[Pro Search Error] > ', e);
|
|
163
164
|
return {
|
|
164
165
|
terms: _terms
|
|
165
166
|
};
|
|
@@ -238,4 +239,25 @@ var getTermOptions = exports.getTermOptions = function getTermOptions(type, colu
|
|
|
238
239
|
break;
|
|
239
240
|
}
|
|
240
241
|
return keys.length ? getTermTypes(keys) : _setting.termType;
|
|
242
|
+
};
|
|
243
|
+
var termsToValue = exports.termsToValue = function termsToValue(targetItem, searchItems) {
|
|
244
|
+
if (['like', 'nlike'].includes(targetItem.termType) && !!targetItem.value) {
|
|
245
|
+
if (targetItem.value.startsWith('%') && targetItem.value.endsWith('%')) {
|
|
246
|
+
targetItem.value = targetItem.value.slice(1, -1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// 处理重命名
|
|
250
|
+
var searchItem = searchItems.filter(function (item) {
|
|
251
|
+
return item.rename;
|
|
252
|
+
}).find(function (item) {
|
|
253
|
+
if (item.rename === targetItem.column) {
|
|
254
|
+
targetItem.column = item.column;
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
return item.column === targetItem.column;
|
|
258
|
+
});
|
|
259
|
+
if (!targetItem.termType) {
|
|
260
|
+
targetItem.termType = getTermTypeFn(searchItem.type);
|
|
261
|
+
}
|
|
262
|
+
return targetItem;
|
|
241
263
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/components",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@ant-design/icons-vue": "^7.0.1",
|
|
20
20
|
"@vuemap/vue-amap": "^2.0.17",
|
|
21
21
|
"@vueuse/core": "^10.2.1",
|
|
22
|
-
"@vueuse/router": "^
|
|
22
|
+
"@vueuse/router": "^12.1.0",
|
|
23
23
|
"async-validator": "^4.2.5",
|
|
24
24
|
"echarts": "^5.4.3",
|
|
25
25
|
"markdown-it": "^14.1.0",
|
|
@@ -152,8 +152,8 @@
|
|
|
152
152
|
"webpack-dev-server": "^4.0.0",
|
|
153
153
|
"webpack-merge": "^5.0.0",
|
|
154
154
|
"webpackbar": "^5.0.2",
|
|
155
|
-
"@jetlinks-web/hooks": "^1.0.20",
|
|
156
155
|
"@jetlinks-web/constants": "^1.0.7",
|
|
156
|
+
"@jetlinks-web/hooks": "^1.0.20",
|
|
157
157
|
"@jetlinks-web/utils": "^1.2.5"
|
|
158
158
|
},
|
|
159
159
|
"publishConfig": {
|