@jetlinks-web/components 2.0.2 → 2.0.3
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 +124 -0
- package/es/AMap/index.js +2 -0
- package/es/AMap/util.js +56 -0
- package/es/BadgeStatus/Badge.js +54 -0
- package/es/BadgeStatus/color.js +21 -0
- package/es/BadgeStatus/index.js +3 -0
- package/es/CardSelect/CardSelect.js +123 -0
- package/es/CardSelect/index.js +2 -0
- package/es/CheckButton/CheckButton.js +121 -0
- package/es/CheckButton/index.js +2 -0
- package/es/ConfigProvider/context.js +12 -0
- package/es/ConfigProvider/index.js +31 -0
- package/es/Echarts/Echarts.js +47 -0
- package/es/Echarts/index.js +2 -0
- package/es/Ellipsis/Ellipsis.js +189 -0
- package/es/Ellipsis/index.js +2 -0
- package/es/Empty/Empty.js +56 -0
- package/es/Empty/image.js +2 -0
- package/es/Empty/index.js +2 -0
- package/es/FullPage/FullPage.js +31 -0
- package/es/FullPage/index.js +2 -0
- package/es/Icon/icon.js +42 -0
- package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
- package/es/MonacoEditor/Monaco.js +238 -0
- package/es/MonacoEditor/index.js +2 -0
- package/es/PermissionButton/index.js +117 -0
- package/es/ProLayout/Basic/BasicLayout.js +259 -0
- package/es/ProLayout/Basic/Header.js +97 -0
- package/es/ProLayout/PageContainer/index.js +324 -0
- package/es/ProLayout/PageContainer/typings.js +1 -0
- package/es/ProLayout/RouteContext.js +22 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/typings.js +1 -0
- package/es/ProLayout/TopHeader/index.js +163 -0
- package/es/ProLayout/defaultSettings.js +66 -0
- package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
- package/{src → es}/ProLayout/style/default.less +4 -4
- package/es/ProLayout/style/index.js +1 -0
- package/es/ProLayout/typings.js +1 -0
- package/es/ProLayout/util.js +61 -0
- package/es/ProTable/index.js +411 -0
- package/es/ProTable/proTableTypes.js +11 -0
- package/es/ProTable/style/index.css +65 -0
- package/es/ProTable/style/index.js +1 -0
- package/es/Scrollbar/Bar.js +114 -0
- package/es/Scrollbar/Scrollbar.js +212 -0
- package/es/Scrollbar/Thumb.js +189 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +2 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +30 -0
- package/es/Search/Advanced/History.js +183 -0
- package/es/Search/Advanced/SaveHistory.js +153 -0
- package/es/Search/Advanced/index.js +520 -0
- package/es/Search/Item.js +497 -0
- package/es/Search/Search.js +249 -0
- package/es/Search/hooks/index.js +1 -0
- package/es/Search/hooks/useSearchItems.js +40 -0
- package/es/Search/index.js +4 -0
- package/es/Search/setting.js +91 -0
- package/es/Search/style/Item.less +33 -0
- package/es/Search/style/Search.less +179 -0
- package/es/Search/style/index.js +2 -0
- package/es/Search/typing.js +1 -0
- package/es/Search/util.js +234 -0
- package/es/ValueItem/ValueItem.js +233 -0
- package/es/ValueItem/index.js +2 -0
- package/es/ValueItem/util.js +16 -0
- package/es/index.js +24 -0
- package/es/style/index.js +3 -0
- package/es/style/variable.css +0 -0
- package/{src → es}/style/variable.less +0 -2
- package/es/style.js +3 -0
- package/lib/AMap/Map.js +124 -0
- package/lib/AMap/index.js +9 -0
- package/lib/AMap/util.js +62 -0
- package/lib/BadgeStatus/Badge.js +54 -0
- package/lib/BadgeStatus/color.js +27 -0
- package/lib/BadgeStatus/index.js +22 -0
- package/lib/CardSelect/CardSelect.js +123 -0
- package/lib/CardSelect/index.js +9 -0
- package/lib/CheckButton/CheckButton.js +121 -0
- package/lib/CheckButton/index.js +9 -0
- package/lib/ConfigProvider/context.js +19 -0
- package/lib/ConfigProvider/index.js +37 -0
- package/lib/Echarts/Echarts.js +47 -0
- package/lib/Echarts/index.js +9 -0
- package/lib/Ellipsis/Ellipsis.js +189 -0
- package/lib/Ellipsis/index.js +9 -0
- package/lib/Empty/Empty.js +56 -0
- package/lib/Empty/image.js +8 -0
- package/lib/Empty/index.js +9 -0
- package/lib/FullPage/FullPage.js +31 -0
- package/lib/FullPage/index.js +9 -0
- package/lib/Icon/icon.js +52 -0
- package/lib/Icon/index.js +9 -0
- package/lib/MonacoEditor/Monaco.js +238 -0
- package/lib/MonacoEditor/index.js +9 -0
- package/lib/PermissionButton/index.js +124 -0
- package/lib/ProLayout/Basic/BasicLayout.js +268 -0
- package/lib/ProLayout/Basic/BasicLayout.less +66 -0
- package/lib/ProLayout/Basic/Header.js +103 -0
- package/lib/ProLayout/Basic/Header.less +8 -0
- package/lib/ProLayout/PageContainer/index.js +327 -0
- package/lib/ProLayout/PageContainer/index.less +103 -0
- package/lib/ProLayout/PageContainer/typings.js +5 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
- package/lib/ProLayout/SiderMenu/index.js +20 -0
- package/lib/ProLayout/SiderMenu/index.less +212 -0
- package/lib/ProLayout/SiderMenu/typings.js +5 -0
- package/lib/ProLayout/TopHeader/index.js +168 -0
- package/lib/ProLayout/TopHeader/index.less +174 -0
- package/lib/ProLayout/defaultSettings.js +72 -0
- package/lib/ProLayout/index.js +16 -0
- package/lib/ProLayout/style/default.less +4 -0
- package/lib/ProLayout/style/index.js +3 -0
- package/lib/ProLayout/style/style.less +7 -0
- package/lib/ProLayout/typings.js +5 -0
- package/lib/ProLayout/util.js +72 -0
- package/lib/ProTable/index.js +417 -0
- package/lib/ProTable/proTableTypes.js +17 -0
- package/lib/ProTable/style/index.css +65 -0
- package/lib/ProTable/style/index.js +3 -0
- package/lib/ProTable/style/index.less +92 -0
- package/lib/Scrollbar/Bar.js +114 -0
- package/lib/Scrollbar/Scrollbar.js +212 -0
- package/lib/Scrollbar/Thumb.js +189 -0
- package/lib/Scrollbar/constants.js +7 -0
- package/lib/Scrollbar/index.js +9 -0
- package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
- package/lib/Scrollbar/thumbProps.js +16 -0
- package/lib/Scrollbar/util.js +37 -0
- package/lib/Search/Advanced/History.js +183 -0
- package/lib/Search/Advanced/SaveHistory.js +153 -0
- package/lib/Search/Advanced/index.js +520 -0
- package/lib/Search/Item.js +497 -0
- package/lib/Search/Search.js +249 -0
- package/lib/Search/hooks/index.js +16 -0
- package/lib/Search/hooks/useSearchItems.js +47 -0
- package/lib/Search/index.js +16 -0
- package/lib/Search/setting.js +97 -0
- package/lib/Search/style/Item.less +33 -0
- package/lib/Search/style/Search.less +179 -0
- package/lib/Search/style/index.js +4 -0
- package/lib/Search/typing.js +5 -0
- package/lib/Search/util.js +241 -0
- package/lib/ValueItem/ValueItem.js +233 -0
- package/lib/ValueItem/index.js +9 -0
- package/lib/ValueItem/util.js +22 -0
- package/lib/index.js +158 -0
- package/lib/style/components.less +1 -0
- package/lib/style/index.js +4 -0
- package/lib/style/variable.css +0 -0
- package/lib/style/variable.less +2 -0
- package/lib/style.js +5 -0
- package/package.json +122 -13
- package/index.ts +0 -64
- package/src/AMap/Map.vue +0 -110
- package/src/AMap/index.ts +0 -1
- package/src/AMap/util.ts +0 -56
- package/src/BadgeStatus/Badge.vue +0 -41
- package/src/BadgeStatus/color.ts +0 -25
- package/src/BadgeStatus/index.ts +0 -4
- package/src/CardSelect/CardSelect.vue +0 -136
- package/src/CardSelect/index.ts +0 -3
- package/src/CheckButton/CheckButton.vue +0 -146
- package/src/CheckButton/index.md +0 -27
- package/src/CheckButton/index.ts +0 -3
- package/src/ConfigProvider/context.ts +0 -17
- package/src/ConfigProvider/index.tsx +0 -42
- package/src/Echarts/Echarts.vue +0 -43
- package/src/Echarts/index.ts +0 -3
- package/src/Ellipsis/Ellipsis.vue +0 -182
- package/src/Ellipsis/index.ts +0 -3
- package/src/Empty/Empty.vue +0 -43
- package/src/Empty/image.ts +0 -3
- package/src/Empty/index.ts +0 -2
- package/src/FullPage/FullPage.vue +0 -30
- package/src/FullPage/index.ts +0 -3
- package/src/Icon/icon.tsx +0 -40
- package/src/MonacoEditor/Monaco.vue +0 -242
- package/src/MonacoEditor/index.md +0 -26
- package/src/MonacoEditor/index.ts +0 -2
- package/src/PermissionButton/index.tsx +0 -110
- package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
- package/src/ProLayout/Basic/Header.tsx +0 -115
- package/src/ProLayout/PageContainer/index.tsx +0 -441
- package/src/ProLayout/PageContainer/typings.ts +0 -56
- package/src/ProLayout/RouteContext.ts +0 -87
- package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
- package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
- package/src/ProLayout/SiderMenu/index.ts +0 -2
- package/src/ProLayout/SiderMenu/typings.ts +0 -49
- package/src/ProLayout/TopHeader/index.tsx +0 -210
- package/src/ProLayout/defaultSettings.ts +0 -106
- package/src/ProLayout/style/index.ts +0 -1
- package/src/ProLayout/typings.ts +0 -87
- package/src/ProLayout/util.ts +0 -64
- package/src/ProTable/index.md +0 -53
- package/src/ProTable/index.tsx +0 -551
- package/src/ProTable/proTableTypes.ts +0 -70
- package/src/ProTable/style/index.ts +0 -1
- package/src/Scrollbar/Bar.vue +0 -75
- package/src/Scrollbar/Scrollbar.vue +0 -260
- package/src/Scrollbar/Thumb.vue +0 -163
- package/src/Scrollbar/constants.ts +0 -10
- package/src/Scrollbar/index.ts +0 -4
- package/src/Scrollbar/thumb.ts +0 -16
- package/src/Scrollbar/util.ts +0 -38
- package/src/Search/Advanced/History.vue +0 -140
- package/src/Search/Advanced/SaveHistory.vue +0 -108
- package/src/Search/Advanced/index.vue +0 -435
- package/src/Search/Item.vue +0 -525
- package/src/Search/Search.vue +0 -398
- package/src/Search/hooks/index.ts +0 -1
- package/src/Search/hooks/useSearchItems.ts +0 -68
- package/src/Search/index.md +0 -57
- package/src/Search/index.ts +0 -5
- package/src/Search/setting.ts +0 -55
- package/src/Search/typing.ts +0 -76
- package/src/Search/util.ts +0 -263
- package/src/ValueItem/ValueItem.vue +0 -192
- package/src/ValueItem/index.ts +0 -3
- package/src/ValueItem/util.ts +0 -16
- package/src/style/index.ts +0 -3
- /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
- /package/{src → es}/ProLayout/Basic/Header.less +0 -0
- /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
- /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
- /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
- /package/{src → es}/ProLayout/style/style.less +0 -0
- /package/{src → es}/ProTable/style/index.less +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"columns": "props",
|
|
3
|
+
"type": "props",
|
|
4
|
+
"column": "props",
|
|
5
|
+
"style": "props",
|
|
6
|
+
"class": "props",
|
|
7
|
+
"labelWidth": "props",
|
|
8
|
+
"resetText": "props",
|
|
9
|
+
"submitText": "props",
|
|
10
|
+
"JColumnsProps": "setup-maybe-ref",
|
|
11
|
+
"SearchItemData": "setup-maybe-ref",
|
|
12
|
+
"SearchProps": "setup-maybe-ref",
|
|
13
|
+
"Terms": "setup-maybe-ref",
|
|
14
|
+
"Button": "setup-maybe-ref",
|
|
15
|
+
"Row": "setup-maybe-ref",
|
|
16
|
+
"Col": "setup-maybe-ref",
|
|
17
|
+
"Form": "setup-maybe-ref",
|
|
18
|
+
"FormItemRest": "setup-maybe-ref",
|
|
19
|
+
"set": "setup-maybe-ref",
|
|
20
|
+
"reactive": "setup-const",
|
|
21
|
+
"ref": "setup-const",
|
|
22
|
+
"provide": "setup-const",
|
|
23
|
+
"termsParamsFormat": "setup-maybe-ref",
|
|
24
|
+
"SearchItem": "setup-const",
|
|
25
|
+
"optionsMapKey": "setup-maybe-ref",
|
|
26
|
+
"props": "setup-reactive-const",
|
|
27
|
+
"columnOptionMap": "setup-ref",
|
|
28
|
+
"emit": "setup-const",
|
|
29
|
+
"terms": "setup-reactive-const",
|
|
30
|
+
"searchItems": "setup-ref",
|
|
31
|
+
"itemValueChange": "setup-const",
|
|
32
|
+
"handleItems": "setup-const",
|
|
33
|
+
"searchSubmit": "setup-const",
|
|
34
|
+
"resetNumber": "setup-ref",
|
|
35
|
+
"reset": "setup-const"
|
|
36
|
+
} */
|
|
37
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
38
|
+
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-1712546547883"), n = n(), _popScopeId(), n);
|
|
40
|
+
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
41
|
+
const _hoisted_2 = { class: "JSearch-items" };
|
|
42
|
+
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
|
43
|
+
import { set } from 'lodash-es';
|
|
44
|
+
import { reactive, ref, provide } from 'vue';
|
|
45
|
+
import { termsParamsFormat } from './util';
|
|
46
|
+
import SearchItem from './Item.js';
|
|
47
|
+
import { optionsMapKey } from './setting';
|
|
48
|
+
const __sfc_main__ = _defineComponent({
|
|
49
|
+
props: {
|
|
50
|
+
columns: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => [],
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'terms',
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
column: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 4,
|
|
63
|
+
},
|
|
64
|
+
style: {
|
|
65
|
+
type: [String, Object],
|
|
66
|
+
default: undefined,
|
|
67
|
+
},
|
|
68
|
+
class: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '',
|
|
71
|
+
},
|
|
72
|
+
labelWidth: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 40,
|
|
75
|
+
},
|
|
76
|
+
resetText: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: '重置',
|
|
79
|
+
},
|
|
80
|
+
submitText: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: '搜索',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
emits: ["search"],
|
|
86
|
+
setup(__props, { emit: __emit }) {
|
|
87
|
+
const props = __props;
|
|
88
|
+
const columnOptionMap = ref(new Map());
|
|
89
|
+
const emit = __emit;
|
|
90
|
+
// 当前查询条件
|
|
91
|
+
const terms = reactive({ terms: [] });
|
|
92
|
+
const searchItems = ref([]); // 当前查询条件列表
|
|
93
|
+
provide(optionsMapKey, columnOptionMap);
|
|
94
|
+
const itemValueChange = (value, index) => {
|
|
95
|
+
set(terms.terms, [index], value);
|
|
96
|
+
};
|
|
97
|
+
const handleItems = (reset = false) => {
|
|
98
|
+
searchItems.value = [];
|
|
99
|
+
terms.terms = [];
|
|
100
|
+
columnOptionMap.value.clear();
|
|
101
|
+
let hasSearch = false;
|
|
102
|
+
props.columns.forEach((item, index) => {
|
|
103
|
+
if (item.search && Object.keys(item.search).length) {
|
|
104
|
+
columnOptionMap.value.set(item.dataIndex, item.search);
|
|
105
|
+
// 默认值
|
|
106
|
+
const { search } = item;
|
|
107
|
+
let defaultTerms = null;
|
|
108
|
+
// 包含defaultValue 或者 defaultOnceValue
|
|
109
|
+
if (search.defaultValue !== undefined ||
|
|
110
|
+
search.defaultTermType ||
|
|
111
|
+
search.defaultOnceValue) {
|
|
112
|
+
const _value = search.defaultValue || reset
|
|
113
|
+
? search.defaultValue
|
|
114
|
+
: search.defaultOnceValue;
|
|
115
|
+
defaultTerms = {
|
|
116
|
+
type: 'and',
|
|
117
|
+
value: _value,
|
|
118
|
+
termType: search.defaultTermType || 'like',
|
|
119
|
+
column: item.dataIndex,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (search.defaultValue !== undefined ||
|
|
123
|
+
search.defaultOnceValue !== undefined) {
|
|
124
|
+
hasSearch = true;
|
|
125
|
+
}
|
|
126
|
+
terms.terms.push(defaultTerms);
|
|
127
|
+
searchItems.value.push({
|
|
128
|
+
...item.search,
|
|
129
|
+
sortIndex: item.search.first ? 0 : index + 1,
|
|
130
|
+
title: item.title,
|
|
131
|
+
column: item.dataIndex,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
if (hasSearch) {
|
|
136
|
+
searchSubmit();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* 提交
|
|
141
|
+
*/
|
|
142
|
+
const searchSubmit = () => {
|
|
143
|
+
emit('search', termsParamsFormat(terms.terms, columnOptionMap.value, 'low', props.type));
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* 重置查询
|
|
147
|
+
*/
|
|
148
|
+
const resetNumber = ref(1);
|
|
149
|
+
const reset = () => {
|
|
150
|
+
resetNumber.value += 1;
|
|
151
|
+
handleItems(true);
|
|
152
|
+
if (props.type == 'object') {
|
|
153
|
+
emit('search', {});
|
|
154
|
+
}
|
|
155
|
+
else if (props.type == 'terms') {
|
|
156
|
+
emit('search', []);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
handleItems();
|
|
160
|
+
return (_ctx, _cache) => {
|
|
161
|
+
return (_openBlock(), _createBlock(_unref(Form), {
|
|
162
|
+
model: terms,
|
|
163
|
+
onFinish: searchSubmit
|
|
164
|
+
}, {
|
|
165
|
+
default: _withCtx(() => [
|
|
166
|
+
_createElementVNode("div", {
|
|
167
|
+
class: _normalizeClass(['JSearch-warp', props.class]),
|
|
168
|
+
style: _normalizeStyle(__props.style)
|
|
169
|
+
}, [
|
|
170
|
+
_createElementVNode("div", _hoisted_1, [
|
|
171
|
+
_createElementVNode("div", _hoisted_2, [
|
|
172
|
+
_createVNode(_unref(Row), { gutter: [16, 16] }, {
|
|
173
|
+
default: _withCtx(() => [
|
|
174
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(searchItems.value, (item, index) => {
|
|
175
|
+
return (_openBlock(), _createBlock(_unref(Col), {
|
|
176
|
+
key: index + '_' + item.column,
|
|
177
|
+
span: item.span || 24 / __props.column
|
|
178
|
+
}, {
|
|
179
|
+
default: _withCtx(() => [
|
|
180
|
+
_createVNode(SearchItem, {
|
|
181
|
+
"only-value": true,
|
|
182
|
+
expand: false,
|
|
183
|
+
index: index + 1,
|
|
184
|
+
columns: searchItems.value,
|
|
185
|
+
"component-props": item.componentProps,
|
|
186
|
+
"terms-item": terms.terms[index],
|
|
187
|
+
reset: resetNumber.value,
|
|
188
|
+
"label-width": __props.labelWidth,
|
|
189
|
+
onChange: (v) => itemValueChange(v, index)
|
|
190
|
+
}, null, 8 /* PROPS */, ["index", "columns", "component-props", "terms-item", "reset", "label-width", "onChange"])
|
|
191
|
+
]),
|
|
192
|
+
_: 2 /* DYNAMIC */
|
|
193
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["span"]));
|
|
194
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
195
|
+
_createVNode(_unref(Col), {
|
|
196
|
+
span: 24 / __props.column
|
|
197
|
+
}, {
|
|
198
|
+
default: _withCtx(() => [
|
|
199
|
+
_renderSlot(_ctx.$slots, "footerRender", {
|
|
200
|
+
reset: reset,
|
|
201
|
+
submit: searchSubmit
|
|
202
|
+
}, () => [
|
|
203
|
+
_createElementVNode("div", {
|
|
204
|
+
class: "JSearch-footer--btns",
|
|
205
|
+
style: _normalizeStyle({
|
|
206
|
+
paddingLeft: `${__props.labelWidth + 8}px`,
|
|
207
|
+
})
|
|
208
|
+
}, [
|
|
209
|
+
_createVNode(_unref(Button), {
|
|
210
|
+
type: "stroke",
|
|
211
|
+
onClick: reset
|
|
212
|
+
}, {
|
|
213
|
+
default: _withCtx(() => [
|
|
214
|
+
_createTextVNode(_toDisplayString(__props.resetText), 1 /* TEXT */)
|
|
215
|
+
]),
|
|
216
|
+
_: 1 /* STABLE */
|
|
217
|
+
}),
|
|
218
|
+
_createVNode(_unref(FormItemRest), null, {
|
|
219
|
+
default: _withCtx(() => [
|
|
220
|
+
_createVNode(_unref(Button), {
|
|
221
|
+
"html-type": "submit",
|
|
222
|
+
type: "primary"
|
|
223
|
+
}, {
|
|
224
|
+
default: _withCtx(() => [
|
|
225
|
+
_createTextVNode(_toDisplayString(__props.submitText), 1 /* TEXT */)
|
|
226
|
+
]),
|
|
227
|
+
_: 1 /* STABLE */
|
|
228
|
+
})
|
|
229
|
+
]),
|
|
230
|
+
_: 1 /* STABLE */
|
|
231
|
+
})
|
|
232
|
+
], 4 /* STYLE */)
|
|
233
|
+
])
|
|
234
|
+
]),
|
|
235
|
+
_: 3 /* FORWARDED */
|
|
236
|
+
}, 8 /* PROPS */, ["span"])
|
|
237
|
+
]),
|
|
238
|
+
_: 3 /* FORWARDED */
|
|
239
|
+
})
|
|
240
|
+
])
|
|
241
|
+
])
|
|
242
|
+
], 6 /* CLASS, STYLE */)
|
|
243
|
+
]),
|
|
244
|
+
_: 3 /* FORWARDED */
|
|
245
|
+
}, 8 /* PROPS */, ["model"]));
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSearchItems';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { sortBy } from 'lodash-es';
|
|
4
|
+
var hasDefaultValue = function hasDefaultValue(item) {
|
|
5
|
+
return item.defaultValue !== undefined || item.defaultTermType || item.defaultOnceValue;
|
|
6
|
+
};
|
|
7
|
+
export var useSearchItems = function useSearchItems(columns, options) {
|
|
8
|
+
var items = ref([]);
|
|
9
|
+
var optionsMap = ref(new Map());
|
|
10
|
+
var handleColumns = function handleColumns() {
|
|
11
|
+
var _items = [];
|
|
12
|
+
var values = [];
|
|
13
|
+
columns.forEach(function (item, index) {
|
|
14
|
+
var search = item.search;
|
|
15
|
+
if (search && Object.keys(search).length) {
|
|
16
|
+
optionsMap.value.set(item.dataIndex, search);
|
|
17
|
+
if (hasDefaultValue(search)) {
|
|
18
|
+
var _value = search.defaultValue || search.defaultOnceValue;
|
|
19
|
+
values.push({
|
|
20
|
+
type: 'and',
|
|
21
|
+
value: _value,
|
|
22
|
+
termType: search.defaultTermType || 'like',
|
|
23
|
+
column: item.dataIndex
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
_items.push(_objectSpread(_objectSpread({}, item.search), {}, {
|
|
27
|
+
sortIndex: item.search.first ? 0 : index + 1,
|
|
28
|
+
column: item.dataIndex
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
items.value = sortBy(_items, 'sortIndex');
|
|
33
|
+
options === null || options === void 0 ? void 0 : options.getDefaultValue(values);
|
|
34
|
+
};
|
|
35
|
+
handleColumns();
|
|
36
|
+
return {
|
|
37
|
+
searchItems: items,
|
|
38
|
+
searchOptionsMap: optionsMap
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import 'vue';
|
|
2
|
+
import './typing';
|
|
3
|
+
export var optionsMapKey = Symbol('searchOptionsMap');
|
|
4
|
+
export var basicSearch = {
|
|
5
|
+
columns: {
|
|
6
|
+
type: Array,
|
|
7
|
+
default: function _default() {
|
|
8
|
+
return [];
|
|
9
|
+
},
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
type: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'advanced'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export var typeOptions = [{
|
|
18
|
+
label: '或者',
|
|
19
|
+
value: 'or'
|
|
20
|
+
}, {
|
|
21
|
+
label: '并且',
|
|
22
|
+
value: 'and'
|
|
23
|
+
}];
|
|
24
|
+
export var TermTypeMap = {
|
|
25
|
+
EQ: {
|
|
26
|
+
label: '=',
|
|
27
|
+
value: 'eq'
|
|
28
|
+
},
|
|
29
|
+
NOT: {
|
|
30
|
+
label: '!=',
|
|
31
|
+
value: 'not'
|
|
32
|
+
},
|
|
33
|
+
LIKE: {
|
|
34
|
+
label: '包含',
|
|
35
|
+
value: 'like'
|
|
36
|
+
},
|
|
37
|
+
NLIKE: {
|
|
38
|
+
label: '不包含',
|
|
39
|
+
value: 'nlike'
|
|
40
|
+
},
|
|
41
|
+
GT: {
|
|
42
|
+
label: '>',
|
|
43
|
+
value: 'gt'
|
|
44
|
+
},
|
|
45
|
+
GTE: {
|
|
46
|
+
label: '>=',
|
|
47
|
+
value: 'gte'
|
|
48
|
+
},
|
|
49
|
+
LT: {
|
|
50
|
+
label: '<',
|
|
51
|
+
value: 'lt'
|
|
52
|
+
},
|
|
53
|
+
LTE: {
|
|
54
|
+
label: '<=',
|
|
55
|
+
value: 'lte'
|
|
56
|
+
},
|
|
57
|
+
IN: {
|
|
58
|
+
label: '在...之中',
|
|
59
|
+
value: 'in'
|
|
60
|
+
},
|
|
61
|
+
NIN: {
|
|
62
|
+
label: '不在...之中',
|
|
63
|
+
value: 'nin'
|
|
64
|
+
},
|
|
65
|
+
BTW: {
|
|
66
|
+
label: '在...之间',
|
|
67
|
+
value: 'btw'
|
|
68
|
+
},
|
|
69
|
+
NBTW: {
|
|
70
|
+
label: '不在...之间',
|
|
71
|
+
value: 'nbtw'
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export var termType = Object.values(TermTypeMap);
|
|
75
|
+
export var componentType = {
|
|
76
|
+
input: 'input',
|
|
77
|
+
inputNumber: 'inputNumber',
|
|
78
|
+
password: 'password',
|
|
79
|
+
switch: 'switch',
|
|
80
|
+
radio: 'radio',
|
|
81
|
+
checkbox: 'checkbox',
|
|
82
|
+
time: 'time',
|
|
83
|
+
date: 'date',
|
|
84
|
+
timeRange: 'timeRange',
|
|
85
|
+
rangePicker: 'rangePicker',
|
|
86
|
+
treeSelect: 'treeSelect',
|
|
87
|
+
upload: 'upload',
|
|
88
|
+
tree: 'tree',
|
|
89
|
+
select: 'select',
|
|
90
|
+
component: 'component'
|
|
91
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.JSearch-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 16px;
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
.JSearch-item--type {
|
|
7
|
+
width: 90px;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
> span {
|
|
10
|
+
line-height: 34px;
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.JSearch-item--column {
|
|
16
|
+
width: 130px;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.JSearch-item--termType {
|
|
21
|
+
width: 110px;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
.JSearch-item--label {
|
|
25
|
+
min-width: 40px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.JSearch-item--value {
|
|
29
|
+
display: flex;
|
|
30
|
+
width: 0;
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
@import '../../style/variable.less';
|
|
2
|
+
.JSearch-warp {
|
|
3
|
+
padding: 24px;
|
|
4
|
+
background-color: #fff;
|
|
5
|
+
margin-bottom: 24px;
|
|
6
|
+
|
|
7
|
+
.pack-up {
|
|
8
|
+
.JSearch-items {
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
|
|
11
|
+
.left {
|
|
12
|
+
min-width: 380px;
|
|
13
|
+
max-width: 580px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.senior {
|
|
19
|
+
> .JSearch-content {
|
|
20
|
+
display: flex;
|
|
21
|
+
.JSearch-footer {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 64px;
|
|
24
|
+
position: relative;
|
|
25
|
+
|
|
26
|
+
.more-btn {
|
|
27
|
+
.more-text {
|
|
28
|
+
padding-right: 24px;
|
|
29
|
+
}
|
|
30
|
+
.more-icon {
|
|
31
|
+
transition: transform 0.3s;
|
|
32
|
+
transform: rotateZ(90deg);
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
|
|
35
|
+
&.more-up {
|
|
36
|
+
transform: rotateZ(-90deg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.expand {
|
|
42
|
+
margin-top: 16px;
|
|
43
|
+
width: 100%;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.JSearch-footer--btns {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: 12px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.items-expand {
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 16px;
|
|
56
|
+
|
|
57
|
+
.left,
|
|
58
|
+
& .right {
|
|
59
|
+
min-width: 0;
|
|
60
|
+
flex: 1 1 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.left-items,
|
|
64
|
+
& .right-items {
|
|
65
|
+
display: flex;
|
|
66
|
+
gap: 16px;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.center {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.vertical {
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
.center {
|
|
79
|
+
flex-direction: row;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.senior-expand {
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.small {
|
|
90
|
+
gap: 12px;
|
|
91
|
+
.JSearch-footer {
|
|
92
|
+
gap: 4px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.JSearch-content {
|
|
99
|
+
&.simple {
|
|
100
|
+
.JSearch-footer--btns {
|
|
101
|
+
display: flex;
|
|
102
|
+
gap: 12px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.JSearch-item {
|
|
106
|
+
gap: 8px;
|
|
107
|
+
|
|
108
|
+
.JSearch-item--label {
|
|
109
|
+
text-align: right;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.no-radius {
|
|
116
|
+
border-radius: 0;
|
|
117
|
+
border-color: #f1f1f1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.search-history-warp {
|
|
121
|
+
position: relative;
|
|
122
|
+
|
|
123
|
+
.search-history-button {
|
|
124
|
+
padding-right: 32px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.search-history-button-icon {
|
|
128
|
+
position: absolute;
|
|
129
|
+
width: 24px;
|
|
130
|
+
height: 18px;
|
|
131
|
+
right: 6px;
|
|
132
|
+
top: 8px;
|
|
133
|
+
color: #fff;
|
|
134
|
+
line-height: 18px;
|
|
135
|
+
text-align: center;
|
|
136
|
+
font-weight: bold;
|
|
137
|
+
> span {
|
|
138
|
+
font-size: 14px;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.search-history-empty {
|
|
145
|
+
padding: 12px 12px 6px 12px;
|
|
146
|
+
background-color: #fff;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.search-history-items {
|
|
150
|
+
width: 120px;
|
|
151
|
+
max-height: 300px;
|
|
152
|
+
overflow-y: auto;
|
|
153
|
+
.search-history-item {
|
|
154
|
+
display: flex;
|
|
155
|
+
padding: 4px 0px 4px 4px;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 4px;
|
|
158
|
+
|
|
159
|
+
&:hover {
|
|
160
|
+
background-color: #f1f1f1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.history-item--title {
|
|
164
|
+
width: calc(100% - 30px);
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.delete {
|
|
169
|
+
padding: 0 6px;
|
|
170
|
+
flex: 0 0 28px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.search-history-list-pop {
|
|
176
|
+
.ant-popover-inner-content {
|
|
177
|
+
padding: 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|