@jetlinks-web/components 2.3.9 → 2.3.10
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/ConfigProvider/context.js +3 -0
- package/es/ConfigProvider/index.js +5 -2
- package/es/EditTable/FormItem.js +1 -1
- package/es/FullPage/FullPage.js +1 -1
- package/es/RadioButton/RadioButton.js +1 -1
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -3
- package/es/Search/Search.js +26 -6
- package/lib/ConfigProvider/context.js +3 -0
- package/lib/ConfigProvider/index.js +4 -1
- package/lib/EditTable/FormItem.js +1 -1
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/RadioButton/RadioButton.js +1 -1
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -3
- package/lib/Search/Search.js +26 -6
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { createVNode as _createVNode } from "vue";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import { defineComponent, provide, reactive, h } from 'vue';
|
|
4
4
|
import { configProps } from './context';
|
|
5
|
-
import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants';
|
|
5
|
+
import { ComponentsEnum, MAPConfig, SearchConfig } from '@jetlinks-web/constants';
|
|
6
6
|
import { ConfigProvider } from 'ant-design-vue';
|
|
7
7
|
import { omit } from 'lodash-es';
|
|
8
8
|
import Empty from '../Empty';
|
|
@@ -14,10 +14,13 @@ var JConfigProvider = defineComponent({
|
|
|
14
14
|
var slots = _ref.slots;
|
|
15
15
|
var _iconConfig = reactive(props.IconConfig || {});
|
|
16
16
|
var _mapConfig = reactive(props.MapConfig || {});
|
|
17
|
+
var _searchConfig = reactive(props.SearchConfig || {});
|
|
18
|
+
console.log('_searchConfig', _searchConfig);
|
|
17
19
|
provide(ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
|
|
18
20
|
provide(MAPConfig, _mapConfig); // 全局地图配置
|
|
21
|
+
provide(SearchConfig, _searchConfig); // 全局搜索配置
|
|
19
22
|
return function () {
|
|
20
|
-
return h(ConfigProvider, _objectSpread({}, omit(props, ['IconConfig', 'MapConfig'])), {
|
|
23
|
+
return h(ConfigProvider, _objectSpread({}, omit(props, ['IconConfig', 'MapConfig', 'SearchConfig'])), {
|
|
21
24
|
default: slots.default,
|
|
22
25
|
renderEmpty: function renderEmpty() {
|
|
23
26
|
var _slots$renderEmpty;
|
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-1726045323521"), 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
} */
|
|
7
7
|
import { defineComponent as _defineComponent } from 'vue';
|
|
8
8
|
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";
|
|
9
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
9
|
+
const _withScopeId = n => (_pushScopeId("data-v-1726045323657"), n = n(), _popScopeId(), n);
|
|
10
10
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
11
11
|
import { ref } from 'vue';
|
|
12
12
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -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-1726045324183"), 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-1726045325366"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
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-1726045324800"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
|
@@ -277,7 +277,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
277
277
|
value: item.column,
|
|
278
278
|
};
|
|
279
279
|
});
|
|
280
|
-
console.log(props.onlyValue);
|
|
281
280
|
if (!props.onlyValue) {
|
|
282
281
|
// 获取第一个值
|
|
283
282
|
const sortColumn = cloneDeep(props.columns);
|
|
@@ -317,7 +316,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
317
316
|
termsModel.value = undefined;
|
|
318
317
|
};
|
|
319
318
|
watch(() => props.columns, () => {
|
|
320
|
-
console.log(props.columns);
|
|
321
319
|
if (props.columns) {
|
|
322
320
|
handleItem();
|
|
323
321
|
}
|
package/es/Search/Search.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"labelWidth": "props",
|
|
8
8
|
"resetText": "props",
|
|
9
9
|
"submitText": "props",
|
|
10
|
+
"align": "props",
|
|
10
11
|
"JColumnsProps": "setup-maybe-ref",
|
|
11
12
|
"SearchItemData": "setup-maybe-ref",
|
|
12
13
|
"SearchProps": "setup-maybe-ref",
|
|
@@ -20,14 +21,20 @@
|
|
|
20
21
|
"reactive": "setup-const",
|
|
21
22
|
"ref": "setup-const",
|
|
22
23
|
"provide": "setup-const",
|
|
24
|
+
"watch": "setup-const",
|
|
25
|
+
"computed": "setup-const",
|
|
26
|
+
"inject": "setup-const",
|
|
23
27
|
"termsParamsFormat": "setup-maybe-ref",
|
|
24
28
|
"SearchItem": "setup-const",
|
|
25
29
|
"optionsMapKey": "setup-maybe-ref",
|
|
30
|
+
"SearchConfig": "setup-maybe-ref",
|
|
26
31
|
"props": "setup-reactive-const",
|
|
27
32
|
"columnOptionMap": "setup-ref",
|
|
28
33
|
"emit": "setup-const",
|
|
29
34
|
"terms": "setup-reactive-const",
|
|
30
35
|
"searchItems": "setup-ref",
|
|
36
|
+
"context": "setup-maybe-ref",
|
|
37
|
+
"footerStyles": "setup-ref",
|
|
31
38
|
"itemValueChange": "setup-const",
|
|
32
39
|
"handleItems": "setup-const",
|
|
33
40
|
"searchSubmit": "setup-const",
|
|
@@ -36,15 +43,16 @@
|
|
|
36
43
|
} */
|
|
37
44
|
import { defineComponent as _defineComponent } from 'vue';
|
|
38
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";
|
|
39
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
46
|
+
const _withScopeId = n => (_pushScopeId("data-v-1726045324908"), n = n(), _popScopeId(), n);
|
|
40
47
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
41
48
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
42
49
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
|
43
50
|
import { set } from 'lodash-es';
|
|
44
|
-
import { reactive, ref, provide } from 'vue';
|
|
51
|
+
import { reactive, ref, provide, watch, computed, inject } from 'vue';
|
|
45
52
|
import { termsParamsFormat } from './util';
|
|
46
53
|
import SearchItem from './Item.js';
|
|
47
54
|
import { optionsMapKey } from './setting';
|
|
55
|
+
import { SearchConfig } from '@jetlinks-web/constants';
|
|
48
56
|
const __sfc_main__ = _defineComponent({
|
|
49
57
|
...{
|
|
50
58
|
name: 'JSearch',
|
|
@@ -84,6 +92,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
84
92
|
type: String,
|
|
85
93
|
default: '搜索',
|
|
86
94
|
},
|
|
95
|
+
align: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'value'
|
|
98
|
+
}
|
|
87
99
|
},
|
|
88
100
|
emits: ["search"],
|
|
89
101
|
setup(__props, { emit: __emit }) {
|
|
@@ -93,6 +105,14 @@ const __sfc_main__ = _defineComponent({
|
|
|
93
105
|
// 当前查询条件
|
|
94
106
|
const terms = reactive({ terms: [] });
|
|
95
107
|
const searchItems = ref([]); // 当前查询条件列表
|
|
108
|
+
const context = inject(SearchConfig, { align: props.align });
|
|
109
|
+
const footerStyles = computed(() => {
|
|
110
|
+
const align = context.align || props.align;
|
|
111
|
+
if (align === 'value') {
|
|
112
|
+
return { paddingLeft: `${props.labelWidth + 8}px` };
|
|
113
|
+
}
|
|
114
|
+
return {};
|
|
115
|
+
});
|
|
96
116
|
provide(optionsMapKey, columnOptionMap);
|
|
97
117
|
const itemValueChange = (value, index) => {
|
|
98
118
|
set(terms.terms, [index], value);
|
|
@@ -159,7 +179,9 @@ const __sfc_main__ = _defineComponent({
|
|
|
159
179
|
emit('search', []);
|
|
160
180
|
}
|
|
161
181
|
};
|
|
162
|
-
|
|
182
|
+
watch(() => props.columns, () => {
|
|
183
|
+
handleItems();
|
|
184
|
+
}, { immediate: true, deep: true });
|
|
163
185
|
return (_ctx, _cache) => {
|
|
164
186
|
return (_openBlock(), _createBlock(_unref(Form), {
|
|
165
187
|
model: terms,
|
|
@@ -205,9 +227,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
205
227
|
}, () => [
|
|
206
228
|
_createElementVNode("div", {
|
|
207
229
|
class: "JSearch-footer--btns",
|
|
208
|
-
style: _normalizeStyle(
|
|
209
|
-
paddingLeft: `${__props.labelWidth + 8}px`,
|
|
210
|
-
})
|
|
230
|
+
style: _normalizeStyle(footerStyles.value)
|
|
211
231
|
}, [
|
|
212
232
|
_createVNode(_unref(Button), {
|
|
213
233
|
type: "stroke",
|
|
@@ -20,10 +20,13 @@ var JConfigProvider = (0, _vue.defineComponent)({
|
|
|
20
20
|
var slots = _ref.slots;
|
|
21
21
|
var _iconConfig = (0, _vue.reactive)(props.IconConfig || {});
|
|
22
22
|
var _mapConfig = (0, _vue.reactive)(props.MapConfig || {});
|
|
23
|
+
var _searchConfig = (0, _vue.reactive)(props.SearchConfig || {});
|
|
24
|
+
console.log('_searchConfig', _searchConfig);
|
|
23
25
|
(0, _vue.provide)(_constants.ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
|
|
24
26
|
(0, _vue.provide)(_constants.MAPConfig, _mapConfig); // 全局地图配置
|
|
27
|
+
(0, _vue.provide)(_constants.SearchConfig, _searchConfig); // 全局搜索配置
|
|
25
28
|
return function () {
|
|
26
|
-
return (0, _vue.h)(_antDesignVue.ConfigProvider, (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(props, ['IconConfig', 'MapConfig'])), {
|
|
29
|
+
return (0, _vue.h)(_antDesignVue.ConfigProvider, (0, _objectSpread2.default)({}, (0, _lodashEs.omit)(props, ['IconConfig', 'MapConfig', 'SearchConfig'])), {
|
|
27
30
|
default: slots.default,
|
|
28
31
|
renderEmpty: function renderEmpty() {
|
|
29
32
|
var _slots$renderEmpty;
|
|
@@ -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-1726045323499"), 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
} */
|
|
7
7
|
import { defineComponent as _defineComponent } from 'vue';
|
|
8
8
|
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";
|
|
9
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
9
|
+
const _withScopeId = n => (_pushScopeId("data-v-1726045323646"), n = n(), _popScopeId(), n);
|
|
10
10
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
11
11
|
import { ref } from 'vue';
|
|
12
12
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -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-1726045324194"), 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-1726045325353"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
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-1726045324741"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
|
@@ -277,7 +277,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
277
277
|
value: item.column,
|
|
278
278
|
};
|
|
279
279
|
});
|
|
280
|
-
console.log(props.onlyValue);
|
|
281
280
|
if (!props.onlyValue) {
|
|
282
281
|
// 获取第一个值
|
|
283
282
|
const sortColumn = cloneDeep(props.columns);
|
|
@@ -317,7 +316,6 @@ const __sfc_main__ = _defineComponent({
|
|
|
317
316
|
termsModel.value = undefined;
|
|
318
317
|
};
|
|
319
318
|
watch(() => props.columns, () => {
|
|
320
|
-
console.log(props.columns);
|
|
321
319
|
if (props.columns) {
|
|
322
320
|
handleItem();
|
|
323
321
|
}
|
package/lib/Search/Search.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"labelWidth": "props",
|
|
8
8
|
"resetText": "props",
|
|
9
9
|
"submitText": "props",
|
|
10
|
+
"align": "props",
|
|
10
11
|
"JColumnsProps": "setup-maybe-ref",
|
|
11
12
|
"SearchItemData": "setup-maybe-ref",
|
|
12
13
|
"SearchProps": "setup-maybe-ref",
|
|
@@ -20,14 +21,20 @@
|
|
|
20
21
|
"reactive": "setup-const",
|
|
21
22
|
"ref": "setup-const",
|
|
22
23
|
"provide": "setup-const",
|
|
24
|
+
"watch": "setup-const",
|
|
25
|
+
"computed": "setup-const",
|
|
26
|
+
"inject": "setup-const",
|
|
23
27
|
"termsParamsFormat": "setup-maybe-ref",
|
|
24
28
|
"SearchItem": "setup-const",
|
|
25
29
|
"optionsMapKey": "setup-maybe-ref",
|
|
30
|
+
"SearchConfig": "setup-maybe-ref",
|
|
26
31
|
"props": "setup-reactive-const",
|
|
27
32
|
"columnOptionMap": "setup-ref",
|
|
28
33
|
"emit": "setup-const",
|
|
29
34
|
"terms": "setup-reactive-const",
|
|
30
35
|
"searchItems": "setup-ref",
|
|
36
|
+
"context": "setup-maybe-ref",
|
|
37
|
+
"footerStyles": "setup-ref",
|
|
31
38
|
"itemValueChange": "setup-const",
|
|
32
39
|
"handleItems": "setup-const",
|
|
33
40
|
"searchSubmit": "setup-const",
|
|
@@ -36,15 +43,16 @@
|
|
|
36
43
|
} */
|
|
37
44
|
import { defineComponent as _defineComponent } from 'vue';
|
|
38
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";
|
|
39
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
46
|
+
const _withScopeId = n => (_pushScopeId("data-v-1726045324883"), n = n(), _popScopeId(), n);
|
|
40
47
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
41
48
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
42
49
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
|
43
50
|
import { set } from 'lodash-es';
|
|
44
|
-
import { reactive, ref, provide } from 'vue';
|
|
51
|
+
import { reactive, ref, provide, watch, computed, inject } from 'vue';
|
|
45
52
|
import { termsParamsFormat } from './util';
|
|
46
53
|
import SearchItem from './Item.js';
|
|
47
54
|
import { optionsMapKey } from './setting';
|
|
55
|
+
import { SearchConfig } from '@jetlinks-web/constants';
|
|
48
56
|
const __sfc_main__ = _defineComponent({
|
|
49
57
|
...{
|
|
50
58
|
name: 'JSearch',
|
|
@@ -84,6 +92,10 @@ const __sfc_main__ = _defineComponent({
|
|
|
84
92
|
type: String,
|
|
85
93
|
default: '搜索',
|
|
86
94
|
},
|
|
95
|
+
align: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: 'value'
|
|
98
|
+
}
|
|
87
99
|
},
|
|
88
100
|
emits: ["search"],
|
|
89
101
|
setup(__props, { emit: __emit }) {
|
|
@@ -93,6 +105,14 @@ const __sfc_main__ = _defineComponent({
|
|
|
93
105
|
// 当前查询条件
|
|
94
106
|
const terms = reactive({ terms: [] });
|
|
95
107
|
const searchItems = ref([]); // 当前查询条件列表
|
|
108
|
+
const context = inject(SearchConfig, { align: props.align });
|
|
109
|
+
const footerStyles = computed(() => {
|
|
110
|
+
const align = context.align || props.align;
|
|
111
|
+
if (align === 'value') {
|
|
112
|
+
return { paddingLeft: `${props.labelWidth + 8}px` };
|
|
113
|
+
}
|
|
114
|
+
return {};
|
|
115
|
+
});
|
|
96
116
|
provide(optionsMapKey, columnOptionMap);
|
|
97
117
|
const itemValueChange = (value, index) => {
|
|
98
118
|
set(terms.terms, [index], value);
|
|
@@ -159,7 +179,9 @@ const __sfc_main__ = _defineComponent({
|
|
|
159
179
|
emit('search', []);
|
|
160
180
|
}
|
|
161
181
|
};
|
|
162
|
-
|
|
182
|
+
watch(() => props.columns, () => {
|
|
183
|
+
handleItems();
|
|
184
|
+
}, { immediate: true, deep: true });
|
|
163
185
|
return (_ctx, _cache) => {
|
|
164
186
|
return (_openBlock(), _createBlock(_unref(Form), {
|
|
165
187
|
model: terms,
|
|
@@ -205,9 +227,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
205
227
|
}, () => [
|
|
206
228
|
_createElementVNode("div", {
|
|
207
229
|
class: "JSearch-footer--btns",
|
|
208
|
-
style: _normalizeStyle(
|
|
209
|
-
paddingLeft: `${__props.labelWidth + 8}px`,
|
|
210
|
-
})
|
|
230
|
+
style: _normalizeStyle(footerStyles.value)
|
|
211
231
|
}, [
|
|
212
232
|
_createVNode(_unref(Button), {
|
|
213
233
|
type: "stroke",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetlinks-web/components",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"webpack-dev-server": "^4.0.0",
|
|
153
153
|
"webpack-merge": "^5.0.0",
|
|
154
154
|
"webpackbar": "^5.0.2",
|
|
155
|
-
"@jetlinks-web/constants": "^1.0.
|
|
155
|
+
"@jetlinks-web/constants": "^1.0.4",
|
|
156
156
|
"@jetlinks-web/utils": "^1.2.1",
|
|
157
157
|
"@jetlinks-web/hooks": "^1.0.16"
|
|
158
158
|
},
|