@jetlinks-web/components 2.4.12 → 2.4.14
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/AMap/Map.js +6 -2
- package/es/ConfigProvider/context.js +3 -0
- package/es/ConfigProvider/index.js +5 -2
- package/es/DragModal/DragModal.js +7 -3
- package/es/EditTable/FormItem.js +1 -1
- package/es/Empty/Empty.js +23 -13
- package/es/FullPage/FullPage.js +1 -1
- package/es/LocaleProvider/index.js +33 -0
- package/es/LocaleReciver/index.js +12 -0
- package/es/ProLayout/PageContainer/index.js +6 -2
- package/es/ProTable/Alert.js +11 -3
- package/es/ProTable/Pagination.js +10 -1
- package/es/ProTable/ProTable.js +8 -8
- package/es/ProTable/setting.js +2 -1
- package/es/RadioButton/RadioButton.js +1 -1
- package/es/Scrollbar/style/index.css +61 -0
- package/es/Scrollbar/style/index.js +1 -0
- package/es/Scrollbar/style/index.less +82 -0
- package/es/Search/Advanced/History.js +10 -6
- package/es/Search/Advanced/SaveHistory.js +15 -11
- package/es/Search/Advanced/index.js +11 -7
- package/es/Search/Item.js +15 -11
- package/es/Search/Search.js +7 -5
- package/es/Search/setting.js +63 -57
- package/es/Search/util.js +4 -4
- package/es/index.js +1 -0
- package/es/locale/en-US.js +77 -0
- package/es/locale/zh-CN.js +77 -0
- package/es/style/index.css +61 -0
- package/es/style/index.less +11 -10
- package/es/style.js +2 -1
- package/lib/AMap/Map.js +6 -2
- package/lib/ConfigProvider/context.js +3 -0
- package/lib/ConfigProvider/index.js +5 -2
- package/lib/DragModal/DragModal.js +7 -3
- package/lib/EditTable/FormItem.js +1 -1
- package/lib/Empty/Empty.js +23 -13
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/LocaleProvider/index.js +33 -0
- package/lib/LocaleReciver/index.js +19 -0
- package/lib/ProLayout/PageContainer/index.js +6 -1
- package/lib/ProTable/Alert.js +11 -3
- package/lib/ProTable/Pagination.js +10 -1
- package/lib/ProTable/ProTable.js +8 -8
- package/lib/ProTable/setting.js +2 -1
- package/lib/RadioButton/RadioButton.js +1 -1
- package/lib/Scrollbar/style/index.css +61 -0
- package/lib/Scrollbar/style/index.js +3 -0
- package/lib/Scrollbar/style/index.less +82 -0
- package/lib/Search/Advanced/History.js +10 -6
- package/lib/Search/Advanced/SaveHistory.js +15 -11
- package/lib/Search/Advanced/index.js +11 -7
- package/lib/Search/Item.js +15 -11
- package/lib/Search/Search.js +7 -5
- package/lib/Search/setting.js +63 -57
- package/lib/Search/util.js +4 -4
- package/lib/index.js +1 -0
- package/lib/locale/en-US.js +83 -0
- package/lib/locale/zh-CN.js +83 -0
- package/lib/style/components.less +1 -0
- package/lib/style/index.css +61 -0
- package/lib/style/index.less +11 -10
- package/lib/style.js +2 -1
- package/package.json +2 -2
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
"FormItemRest": "setup-maybe-ref",
|
|
15
15
|
"Popover": "setup-maybe-ref",
|
|
16
16
|
"message": "setup-maybe-ref",
|
|
17
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
17
18
|
"emit": "setup-const",
|
|
18
19
|
"props": "setup-reactive-const",
|
|
20
|
+
"contextLocale": "setup-maybe-ref",
|
|
19
21
|
"historyList": "setup-ref",
|
|
20
22
|
"historyVisible": "setup-ref",
|
|
21
23
|
"showEmpty": "setup-ref",
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"deleteHistory": "setup-const"
|
|
27
29
|
} */
|
|
28
30
|
import { defineComponent as _defineComponent } from 'vue';
|
|
29
|
-
import {
|
|
31
|
+
import { unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, withModifiers as _withModifiers } from "vue";
|
|
30
32
|
const _hoisted_1 = { class: "search-history-warp" };
|
|
31
33
|
const _hoisted_2 = {
|
|
32
34
|
key: 0,
|
|
@@ -42,6 +44,7 @@ import { computed, ref } from 'vue';
|
|
|
42
44
|
import { isFunction } from 'lodash-es';
|
|
43
45
|
import { AIcon, Empty, Ellipsis } from '../../../';
|
|
44
46
|
import { Popconfirm, Button, FormItemRest, Popover, message } from 'ant-design-vue';
|
|
47
|
+
import { useLocaleReceiver } from "../../LocaleReciver";
|
|
45
48
|
const __sfc_main__ = _defineComponent({
|
|
46
49
|
props: {
|
|
47
50
|
target: {
|
|
@@ -66,6 +69,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
66
69
|
setup(__props, { emit: __emit }) {
|
|
67
70
|
const emit = __emit;
|
|
68
71
|
const props = __props;
|
|
72
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
69
73
|
const historyList = ref([]);
|
|
70
74
|
const historyVisible = ref(false);
|
|
71
75
|
const showEmpty = computed(() => {
|
|
@@ -97,10 +101,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
97
101
|
const resp = await props.deleteRequest(props.target, item[props.deleteKey]);
|
|
98
102
|
historyVisible.value = false;
|
|
99
103
|
if (resp.success || resp.status === 200 || resp.code === 200) {
|
|
100
|
-
message.success(
|
|
104
|
+
message.success(contextLocale.value.advanced.saveHistory.success);
|
|
101
105
|
}
|
|
102
106
|
else {
|
|
103
|
-
message.error(
|
|
107
|
+
message.error(contextLocale.value.advanced.saveHistory.fail);
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
};
|
|
@@ -114,7 +118,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
114
118
|
"html-type": "submit"
|
|
115
119
|
}, {
|
|
116
120
|
default: _withCtx(() => [
|
|
117
|
-
_createTextVNode(
|
|
121
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.history.search), 1 /* TEXT */)
|
|
118
122
|
]),
|
|
119
123
|
_: 1 /* STABLE */
|
|
120
124
|
})
|
|
@@ -148,7 +152,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
148
152
|
}, 1024 /* DYNAMIC_SLOTS */)
|
|
149
153
|
], 8 /* PROPS */, _hoisted_3),
|
|
150
154
|
_createVNode(_unref(Popconfirm), {
|
|
151
|
-
title:
|
|
155
|
+
title: _unref(contextLocale).advanced.history.confirmDelete,
|
|
152
156
|
placement: "top",
|
|
153
157
|
onConfirm: ($event) => (deleteHistory(item))
|
|
154
158
|
}, {
|
|
@@ -158,7 +162,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
158
162
|
])
|
|
159
163
|
]),
|
|
160
164
|
_: 2 /* DYNAMIC */
|
|
161
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onConfirm"])
|
|
165
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "onConfirm"])
|
|
162
166
|
]));
|
|
163
167
|
}), 128 /* KEYED_FRAGMENT */))
|
|
164
168
|
]))
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"Textarea": "setup-maybe-ref",
|
|
12
12
|
"message": "setup-maybe-ref",
|
|
13
13
|
"isFunction": "setup-maybe-ref",
|
|
14
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
14
15
|
"props": "setup-reactive-const",
|
|
16
|
+
"contextLocale": "setup-maybe-ref",
|
|
15
17
|
"saveHistoryLoading": "setup-ref",
|
|
16
18
|
"visible": "setup-ref",
|
|
17
19
|
"formRef": "setup-ref",
|
|
@@ -20,8 +22,8 @@
|
|
|
20
22
|
"saveHistory": "setup-const"
|
|
21
23
|
} */
|
|
22
24
|
import { defineComponent as _defineComponent } from 'vue';
|
|
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-
|
|
25
|
+
import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
26
|
+
const _withScopeId = n => (_pushScopeId("data-v-1735798901714"), n = n(), _popScopeId(), n);
|
|
25
27
|
const _hoisted_1 = {
|
|
26
28
|
key: 0,
|
|
27
29
|
style: { "width": "240px" }
|
|
@@ -29,6 +31,7 @@ const _hoisted_1 = {
|
|
|
29
31
|
import { ref, reactive } from 'vue';
|
|
30
32
|
import { Form, Button, FormItem, Popover, Textarea, message } from 'ant-design-vue';
|
|
31
33
|
import { isFunction } from 'lodash-es';
|
|
34
|
+
import { useLocaleReceiver } from "../../LocaleReciver";
|
|
32
35
|
const __sfc_main__ = _defineComponent({
|
|
33
36
|
props: {
|
|
34
37
|
terms: {
|
|
@@ -47,6 +50,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
47
50
|
},
|
|
48
51
|
setup(__props) {
|
|
49
52
|
const props = __props;
|
|
53
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
50
54
|
const saveHistoryLoading = ref(false);
|
|
51
55
|
const visible = ref(false);
|
|
52
56
|
const formRef = ref();
|
|
@@ -73,11 +77,11 @@ const __sfc_main__ = _defineComponent({
|
|
|
73
77
|
const resp = await props.request(formData, props.target);
|
|
74
78
|
saveHistoryLoading.value = false;
|
|
75
79
|
if (resp.success || resp.status === 200 || resp.code === 200) {
|
|
76
|
-
message.success(
|
|
80
|
+
message.success(contextLocale.value.advanced.saveHistory.success);
|
|
77
81
|
visibleChange(false);
|
|
78
82
|
}
|
|
79
83
|
else {
|
|
80
|
-
message.error(
|
|
84
|
+
message.error(contextLocale.value.advanced.saveHistory.fail);
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
};
|
|
@@ -85,7 +89,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
85
89
|
return (_openBlock(), _createBlock(_unref(Popover), {
|
|
86
90
|
visible: visible.value,
|
|
87
91
|
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => ((visible).value = $event)),
|
|
88
|
-
title:
|
|
92
|
+
title: _unref(contextLocale).advanced.saveHistory.searchName,
|
|
89
93
|
trigger: "click",
|
|
90
94
|
placement: "bottom",
|
|
91
95
|
onVisibleChange: visibleChange
|
|
@@ -102,8 +106,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
102
106
|
_createVNode(_unref(FormItem), {
|
|
103
107
|
name: "name",
|
|
104
108
|
rules: [
|
|
105
|
-
{ required: true, message:
|
|
106
|
-
{ max: 64, message:
|
|
109
|
+
{ required: true, message: _unref(contextLocale).advanced.saveHistory.placeholder },
|
|
110
|
+
{ max: 64, message: _unref(contextLocale).advanced.saveHistory.ruleName },
|
|
107
111
|
]
|
|
108
112
|
}, {
|
|
109
113
|
default: _withCtx(() => [
|
|
@@ -115,7 +119,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
115
119
|
}, null, 8 /* PROPS */, ["value"])
|
|
116
120
|
]),
|
|
117
121
|
_: 1 /* STABLE */
|
|
118
|
-
})
|
|
122
|
+
}, 8 /* PROPS */, ["rules"])
|
|
119
123
|
]),
|
|
120
124
|
_: 1 /* STABLE */
|
|
121
125
|
}, 8 /* PROPS */, ["model"]),
|
|
@@ -127,7 +131,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
127
131
|
onClick: saveHistory
|
|
128
132
|
}, {
|
|
129
133
|
default: _withCtx(() => [
|
|
130
|
-
_createTextVNode(
|
|
134
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.saveHistory.save), 1 /* TEXT */)
|
|
131
135
|
]),
|
|
132
136
|
_: 1 /* STABLE */
|
|
133
137
|
}, 8 /* PROPS */, ["loading"])
|
|
@@ -140,13 +144,13 @@ const __sfc_main__ = _defineComponent({
|
|
|
140
144
|
type: "primary"
|
|
141
145
|
}, {
|
|
142
146
|
default: _withCtx(() => [
|
|
143
|
-
_createTextVNode(
|
|
147
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.saveHistory.save), 1 /* TEXT */)
|
|
144
148
|
]),
|
|
145
149
|
_: 1 /* STABLE */
|
|
146
150
|
})
|
|
147
151
|
]),
|
|
148
152
|
_: 1 /* STABLE */
|
|
149
|
-
}, 8 /* PROPS */, ["visible"]));
|
|
153
|
+
}, 8 /* PROPS */, ["visible", "title"]));
|
|
150
154
|
};
|
|
151
155
|
}
|
|
152
156
|
});
|
|
@@ -50,6 +50,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
50
50
|
"FormItemRest": "setup-maybe-ref",
|
|
51
51
|
"AIcon": "setup-maybe-ref",
|
|
52
52
|
"cloneDeep": "setup-maybe-ref",
|
|
53
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
54
|
+
"contextLocale": "setup-maybe-ref",
|
|
53
55
|
"props": "setup-reactive-const",
|
|
54
56
|
"searchRef": "setup-ref",
|
|
55
57
|
"searchRefContentRef": "setup-ref",
|
|
@@ -78,7 +80,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
80
|
"handleItems": "setup-const"
|
|
79
81
|
} */
|
|
80
82
|
import { defineComponent as _defineComponent } from 'vue';
|
|
81
|
-
import { createCommentVNode as _createCommentVNode, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, unref as _unref, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, withCtx as _withCtx, normalizeStyle as _normalizeStyle } from "vue";
|
|
83
|
+
import { createCommentVNode as _createCommentVNode, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, unref as _unref, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, normalizeClass as _normalizeClass, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, normalizeStyle as _normalizeStyle } from "vue";
|
|
82
84
|
const _hoisted_1 = { class: "left" };
|
|
83
85
|
const _hoisted_2 = { class: "left-items" };
|
|
84
86
|
const _hoisted_3 = {
|
|
@@ -91,7 +93,7 @@ const _hoisted_4 = {
|
|
|
91
93
|
};
|
|
92
94
|
const _hoisted_5 = { class: "right-items" };
|
|
93
95
|
const _hoisted_6 = { class: "JSearch-footer--btns" };
|
|
94
|
-
const _hoisted_7 =
|
|
96
|
+
const _hoisted_7 = { class: "more-text" };
|
|
95
97
|
const _hoisted_8 = { class: "JSearch-content single big pack-up" };
|
|
96
98
|
const _hoisted_9 = { class: "JSearch-items" };
|
|
97
99
|
const _hoisted_10 = { class: "left" };
|
|
@@ -108,6 +110,7 @@ import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsF
|
|
|
108
110
|
import { Select, Button, Form, FormItemRest } from 'ant-design-vue';
|
|
109
111
|
import { AIcon } from '../../../';
|
|
110
112
|
import { cloneDeep } from 'lodash-es';
|
|
113
|
+
import { useLocaleReceiver } from "../../LocaleReciver/index";
|
|
111
114
|
const __sfc_main__ = _defineComponent({
|
|
112
115
|
...{
|
|
113
116
|
name: 'JAdvancedSearch',
|
|
@@ -162,6 +165,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
162
165
|
},
|
|
163
166
|
emits: ["search"],
|
|
164
167
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
168
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
165
169
|
const props = __props;
|
|
166
170
|
const searchRef = ref(null);
|
|
167
171
|
const searchRefContentRef = ref(null);
|
|
@@ -430,7 +434,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
430
434
|
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => ((termsData.terms[1].type) = $event)),
|
|
431
435
|
class: "center-select",
|
|
432
436
|
style: { "width": "100px" },
|
|
433
|
-
options: _unref(typeOptions)
|
|
437
|
+
options: _unref(typeOptions)(_unref(contextLocale))
|
|
434
438
|
}, null, 8 /* PROPS */, ["value", "options"])
|
|
435
439
|
]))
|
|
436
440
|
: _createCommentVNode("v-if", true),
|
|
@@ -464,7 +468,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
464
468
|
onClick: reset
|
|
465
469
|
}, {
|
|
466
470
|
default: _withCtx(() => [
|
|
467
|
-
_createTextVNode(
|
|
471
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
|
|
468
472
|
]),
|
|
469
473
|
_: 1 /* STABLE */
|
|
470
474
|
}),
|
|
@@ -488,7 +492,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
488
492
|
onClick: expandChange
|
|
489
493
|
}, {
|
|
490
494
|
default: _withCtx(() => [
|
|
491
|
-
_hoisted_7,
|
|
495
|
+
_createElementVNode("span", _hoisted_7, _toDisplayString(_unref(contextLocale).advanced.more), 1 /* TEXT */),
|
|
492
496
|
_createVNode(_unref(AIcon), {
|
|
493
497
|
type: "DoubleRightOutlined",
|
|
494
498
|
class: _normalizeClass([
|
|
@@ -525,7 +529,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
525
529
|
onClick: reset
|
|
526
530
|
}, {
|
|
527
531
|
default: _withCtx(() => [
|
|
528
|
-
_createTextVNode(
|
|
532
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.reset), 1 /* TEXT */)
|
|
529
533
|
]),
|
|
530
534
|
_: 1 /* STABLE */
|
|
531
535
|
}),
|
|
@@ -534,7 +538,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
534
538
|
type: "primary"
|
|
535
539
|
}, {
|
|
536
540
|
default: _withCtx(() => [
|
|
537
|
-
_createTextVNode(
|
|
541
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).advanced.search), 1 /* TEXT */)
|
|
538
542
|
]),
|
|
539
543
|
_: 1 /* STABLE */
|
|
540
544
|
})
|
package/es/Search/Item.js
CHANGED
|
@@ -54,6 +54,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
54
54
|
"TimeRangePicker": "setup-maybe-ref",
|
|
55
55
|
"FormItem": "setup-maybe-ref",
|
|
56
56
|
"isPromise": "setup-maybe-ref",
|
|
57
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
58
|
+
"contextLocale": "setup-maybe-ref",
|
|
57
59
|
"props": "setup-reactive-const",
|
|
58
60
|
"emit": "setup-const",
|
|
59
61
|
"termsModel": "setup-reactive-const",
|
|
@@ -78,7 +80,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
80
|
} */
|
|
79
81
|
import { defineComponent as _defineComponent } from 'vue';
|
|
80
82
|
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-
|
|
83
|
+
const _withScopeId = n => (_pushScopeId("data-v-1735798901001"), n = n(), _popScopeId(), n);
|
|
82
84
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
85
|
const _hoisted_2 = {
|
|
84
86
|
key: 0,
|
|
@@ -92,6 +94,7 @@ import { cloneDeep, debounce, isArray, isFunction, omit } from 'lodash-es';
|
|
|
92
94
|
import { filterTreeSelectNode, filterSelectNode, getTermTypeFn, getTermOptions, getTermTypes, } from './util';
|
|
93
95
|
import { TreeSelect, Select, Input, InputNumber, DatePicker, TimePicker, InputPassword, RangePicker, TimeRangePicker, FormItem } from 'ant-design-vue';
|
|
94
96
|
import { isPromise } from '@jetlinks-web/utils';
|
|
97
|
+
import { useLocaleReceiver } from "../LocaleReciver/index";
|
|
95
98
|
const __sfc_main__ = _defineComponent({
|
|
96
99
|
props: {
|
|
97
100
|
columns: {
|
|
@@ -130,6 +133,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
130
133
|
},
|
|
131
134
|
emits: ["change"],
|
|
132
135
|
setup(__props, { emit: __emit }) {
|
|
136
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
133
137
|
const props = __props;
|
|
134
138
|
const emit = __emit;
|
|
135
139
|
const termsModel = reactive({
|
|
@@ -147,7 +151,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
147
151
|
const options = ref([]);
|
|
148
152
|
const columnOptions = ref([]);
|
|
149
153
|
const columnOptionMap = inject(optionsMapKey, new Map());
|
|
150
|
-
const termTypeOptions = reactive({ option: termType });
|
|
154
|
+
const termTypeOptions = reactive({ option: termType(contextLocale.value) });
|
|
151
155
|
const optionLoading = ref(false);
|
|
152
156
|
/**
|
|
153
157
|
* 根据类型切换默termType值
|
|
@@ -159,8 +163,8 @@ const __sfc_main__ = _defineComponent({
|
|
|
159
163
|
*/
|
|
160
164
|
const getTermType = (type, column, options, defaultTermType, termFilter) => {
|
|
161
165
|
termTypeOptions.option = _optionalChain([options, 'optionalAccess', _10 => _10.length])
|
|
162
|
-
? getTermTypes(options)
|
|
163
|
-
: getTermOptions(type, column);
|
|
166
|
+
? getTermTypes(options, contextLocale.value)
|
|
167
|
+
: getTermOptions(type, column, contextLocale.value);
|
|
164
168
|
if (_optionalChain([termFilter, 'optionalAccess', _11 => _11.length])) {
|
|
165
169
|
termTypeOptions.option = termTypeOptions.option.filter((item) => !termFilter.includes(item.value));
|
|
166
170
|
}
|
|
@@ -240,7 +244,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
240
244
|
termsModel.column = undefined;
|
|
241
245
|
termsModel.value = undefined;
|
|
242
246
|
termsModel.termType = undefined;
|
|
243
|
-
termTypeOptions.option = termType;
|
|
247
|
+
termTypeOptions.option = termType(contextLocale.value);
|
|
244
248
|
};
|
|
245
249
|
const columnChange = (value, isChange, changeValue = true) => {
|
|
246
250
|
const item = _optionalChain([columnOptionMap, 'access', _13 => _13.value, 'optionalAccess', _14 => _14.get, 'call', _15 => _15(value)]);
|
|
@@ -347,29 +351,29 @@ const __sfc_main__ = _defineComponent({
|
|
|
347
351
|
key: 0,
|
|
348
352
|
value: termsModel.type,
|
|
349
353
|
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((termsModel.type) = $event)),
|
|
350
|
-
options: _unref(typeOptions),
|
|
354
|
+
options: _unref(typeOptions)(_unref(contextLocale)),
|
|
351
355
|
style: { "width": "100%" },
|
|
352
356
|
onChange: valueChange
|
|
353
357
|
}, null, 8 /* PROPS */, ["value", "options"]))
|
|
354
|
-
: (_openBlock(), _createElementBlock("span", _hoisted_3, _toDisplayString(__props.index === 1 ?
|
|
358
|
+
: (_openBlock(), _createElementBlock("span", _hoisted_3, _toDisplayString(__props.index === 1 ? _unref(contextLocale).item.firstGroup : _unref(contextLocale).item.secondGroup), 1 /* TEXT */))
|
|
355
359
|
]))
|
|
356
360
|
: _createCommentVNode("v-if", true),
|
|
357
361
|
_createVNode(_unref(Select), {
|
|
358
362
|
value: termsModel.column,
|
|
359
363
|
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => ((termsModel.column) = $event)),
|
|
360
|
-
placeholder:
|
|
364
|
+
placeholder: _unref(contextLocale).item.placeholder,
|
|
361
365
|
class: "JSearch-item--column",
|
|
362
366
|
options: columnOptions.value,
|
|
363
367
|
onChange: columnChange
|
|
364
|
-
}, null, 8 /* PROPS */, ["value", "options"]),
|
|
368
|
+
}, null, 8 /* PROPS */, ["value", "placeholder", "options"]),
|
|
365
369
|
_createVNode(_unref(Select), {
|
|
366
370
|
value: termsModel.termType,
|
|
367
371
|
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => ((termsModel.termType) = $event)),
|
|
368
|
-
placeholder:
|
|
372
|
+
placeholder: _unref(contextLocale).item.placeholder,
|
|
369
373
|
class: "JSearch-item--termType",
|
|
370
374
|
options: termTypeOptions.option,
|
|
371
375
|
onChange: termTypeChange
|
|
372
|
-
}, null, 8 /* PROPS */, ["value", "options"])
|
|
376
|
+
}, null, 8 /* PROPS */, ["value", "placeholder", "options"])
|
|
373
377
|
], 64 /* STABLE_FRAGMENT */))
|
|
374
378
|
: (_openBlock(), _createElementBlock("div", {
|
|
375
379
|
key: 1,
|
package/es/Search/Search.js
CHANGED
|
@@ -28,7 +28,9 @@
|
|
|
28
28
|
"SearchItem": "setup-const",
|
|
29
29
|
"optionsMapKey": "setup-maybe-ref",
|
|
30
30
|
"SearchConfig": "setup-maybe-ref",
|
|
31
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
31
32
|
"props": "setup-reactive-const",
|
|
33
|
+
"contextLocale": "setup-maybe-ref",
|
|
32
34
|
"columnOptionMap": "setup-ref",
|
|
33
35
|
"emit": "setup-const",
|
|
34
36
|
"terms": "setup-reactive-const",
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
} */
|
|
44
46
|
import { defineComponent as _defineComponent } from 'vue';
|
|
45
47
|
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-
|
|
48
|
+
const _withScopeId = n => (_pushScopeId("data-v-1735798901153"), n = n(), _popScopeId(), n);
|
|
47
49
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
48
50
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
49
51
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
|
@@ -53,6 +55,7 @@ import { termsParamsFormat } from './util';
|
|
|
53
55
|
import SearchItem from './Item.js';
|
|
54
56
|
import { optionsMapKey } from './setting';
|
|
55
57
|
import { SearchConfig } from '../utils/constants';
|
|
58
|
+
import { useLocaleReceiver } from "../LocaleReciver/index";
|
|
56
59
|
const __sfc_main__ = _defineComponent({
|
|
57
60
|
...{
|
|
58
61
|
name: 'JSearch',
|
|
@@ -86,11 +89,9 @@ const __sfc_main__ = _defineComponent({
|
|
|
86
89
|
},
|
|
87
90
|
resetText: {
|
|
88
91
|
type: String,
|
|
89
|
-
default: '重置',
|
|
90
92
|
},
|
|
91
93
|
submitText: {
|
|
92
94
|
type: String,
|
|
93
|
-
default: '搜索',
|
|
94
95
|
},
|
|
95
96
|
align: {
|
|
96
97
|
type: String,
|
|
@@ -100,6 +101,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
100
101
|
emits: ["search"],
|
|
101
102
|
setup(__props, { emit: __emit }) {
|
|
102
103
|
const props = __props;
|
|
104
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
103
105
|
const columnOptionMap = ref(new Map());
|
|
104
106
|
const emit = __emit;
|
|
105
107
|
// 当前查询条件
|
|
@@ -234,7 +236,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
234
236
|
onClick: reset
|
|
235
237
|
}, {
|
|
236
238
|
default: _withCtx(() => [
|
|
237
|
-
_createTextVNode(_toDisplayString(__props.resetText), 1 /* TEXT */)
|
|
239
|
+
_createTextVNode(_toDisplayString(__props.resetText || _unref(contextLocale).search.reset), 1 /* TEXT */)
|
|
238
240
|
]),
|
|
239
241
|
_: 1 /* STABLE */
|
|
240
242
|
}),
|
|
@@ -245,7 +247,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
245
247
|
type: "primary"
|
|
246
248
|
}, {
|
|
247
249
|
default: _withCtx(() => [
|
|
248
|
-
_createTextVNode(_toDisplayString(__props.submitText), 1 /* TEXT */)
|
|
250
|
+
_createTextVNode(_toDisplayString(__props.submitText || _unref(contextLocale).search.search + '123123'), 1 /* TEXT */)
|
|
249
251
|
]),
|
|
250
252
|
_: 1 /* STABLE */
|
|
251
253
|
})
|
package/es/Search/setting.js
CHANGED
|
@@ -14,64 +14,70 @@ export var basicSearch = {
|
|
|
14
14
|
default: 'advanced'
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
export var typeOptions =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
17
|
+
export var typeOptions = function typeOptions(locale) {
|
|
18
|
+
return [{
|
|
19
|
+
label: locale.setting.or,
|
|
20
|
+
value: 'or'
|
|
21
|
+
}, {
|
|
22
|
+
label: locale.setting.and,
|
|
23
|
+
value: 'and'
|
|
24
|
+
}];
|
|
25
|
+
};
|
|
26
|
+
export var TermTypeMap = function TermTypeMap(locale) {
|
|
27
|
+
return {
|
|
28
|
+
EQ: {
|
|
29
|
+
label: '=',
|
|
30
|
+
value: 'eq'
|
|
31
|
+
},
|
|
32
|
+
NOT: {
|
|
33
|
+
label: '!=',
|
|
34
|
+
value: 'not'
|
|
35
|
+
},
|
|
36
|
+
LIKE: {
|
|
37
|
+
label: locale.setting.include,
|
|
38
|
+
value: 'like'
|
|
39
|
+
},
|
|
40
|
+
NLIKE: {
|
|
41
|
+
label: locale.setting.exclude,
|
|
42
|
+
value: 'nlike'
|
|
43
|
+
},
|
|
44
|
+
GT: {
|
|
45
|
+
label: '>',
|
|
46
|
+
value: 'gt'
|
|
47
|
+
},
|
|
48
|
+
GTE: {
|
|
49
|
+
label: '>=',
|
|
50
|
+
value: 'gte'
|
|
51
|
+
},
|
|
52
|
+
LT: {
|
|
53
|
+
label: '<',
|
|
54
|
+
value: 'lt'
|
|
55
|
+
},
|
|
56
|
+
LTE: {
|
|
57
|
+
label: '<=',
|
|
58
|
+
value: 'lte'
|
|
59
|
+
},
|
|
60
|
+
IN: {
|
|
61
|
+
label: locale.setting.in,
|
|
62
|
+
value: 'in'
|
|
63
|
+
},
|
|
64
|
+
NIN: {
|
|
65
|
+
label: locale.setting.notIn,
|
|
66
|
+
value: 'nin'
|
|
67
|
+
},
|
|
68
|
+
BTW: {
|
|
69
|
+
label: locale.setting.between,
|
|
70
|
+
value: 'btw'
|
|
71
|
+
},
|
|
72
|
+
NBTW: {
|
|
73
|
+
label: locale.setting.notBetween,
|
|
74
|
+
value: 'nbtw'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export var termType = function termType(locale) {
|
|
79
|
+
return Object.values(TermTypeMap(locale));
|
|
73
80
|
};
|
|
74
|
-
export var termType = Object.values(TermTypeMap);
|
|
75
81
|
export var componentType = {
|
|
76
82
|
input: 'input',
|
|
77
83
|
inputNumber: 'inputNumber',
|
package/es/Search/util.js
CHANGED
|
@@ -201,12 +201,12 @@ export var getTermTypeFn = function getTermTypeFn(type) {
|
|
|
201
201
|
return 'like';
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
export var getTermTypes = function getTermTypes(types) {
|
|
205
|
-
return termType.filter(function (item) {
|
|
204
|
+
export var getTermTypes = function getTermTypes(types, locale) {
|
|
205
|
+
return termType(locale).filter(function (item) {
|
|
206
206
|
return types.includes(item.value);
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
|
-
export var getTermOptions = function getTermOptions(type, column) {
|
|
209
|
+
export var getTermOptions = function getTermOptions(type, column, locale) {
|
|
210
210
|
var keys = [];
|
|
211
211
|
switch (type) {
|
|
212
212
|
case 'select':
|
|
@@ -231,7 +231,7 @@ export var getTermOptions = function getTermOptions(type, column) {
|
|
|
231
231
|
// : ['like', 'nlike'];
|
|
232
232
|
break;
|
|
233
233
|
}
|
|
234
|
-
return keys.length ? getTermTypes(keys) : termType;
|
|
234
|
+
return keys.length ? getTermTypes(keys, locale) : termType(locale);
|
|
235
235
|
};
|
|
236
236
|
export var termsToValue = function termsToValue(targetItem, searchItems) {
|
|
237
237
|
if (['like', 'nlike'].includes(targetItem.termType) && !!targetItem.value) {
|
package/es/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as components from './components';
|
|
3
3
|
export * from './components';
|
|
4
4
|
export var install = function install(app) {
|
|
5
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5
6
|
Object.keys(components).forEach(function (key) {
|
|
6
7
|
var component = components[key];
|
|
7
8
|
if (component.install) {
|