@jetlinks-web/components 3.0.0-rc → 3.0.0
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/AutoComplete/AutoComplete.js +13 -9
- package/es/BadgeStatus/Badge.js +1 -2
- package/es/BadgeStatus/color.js +3 -3
- package/es/CardSelect/CardSelect.js +23 -13
- package/es/CardSelect/style/index.js +25 -1
- package/es/CheckButton/CheckButton.js +12 -4
- package/es/CheckButton/style/index.js +41 -1
- package/es/DragModal/DragModal.js +14 -8
- package/es/DragModal/style/index.js +64 -1
- package/es/EditTable/Body.js +10 -3
- package/es/EditTable/EditTable.js +13 -7
- package/es/EditTable/FormItem.js +18 -19
- package/es/EditTable/Header.js +16 -6
- package/es/EditTable/components/ContextMenu/Menu.js +11 -5
- package/es/EditTable/components/Search/search.js +1 -2
- package/es/EditTable/components/Search/sort.js +1 -3
- package/es/EditTable/group.js +23 -18
- package/es/EditTable/hooks/useValidate.js +1 -1
- package/es/EditTable/style/body.js +53 -0
- package/es/EditTable/style/form.js +24 -0
- package/es/EditTable/style/group.js +25 -0
- package/es/EditTable/style/header.js +58 -0
- package/es/EditTable/style/index.js +42 -1
- package/es/EditTable/style/menu.js +27 -0
- package/es/EditTable/style/table.js +46 -0
- package/es/EditTable/utils.js +30 -3
- package/es/Ellipsis/Ellipsis.js +10 -2
- package/es/Ellipsis/style/index.js +24 -1
- package/es/FullPage/FullPage.js +1 -2
- package/es/LocaleProvider/index.js +1 -2
- package/es/PermissionButton/index.js +3 -4
- package/es/ProLayout/Basic/BasicLayout.js +45 -41
- package/es/ProLayout/Basic/BasicLayoutStyle.js +39 -0
- package/es/ProLayout/Basic/Header.js +3 -7
- package/es/ProLayout/Basic/HeaderStyle.js +10 -0
- package/es/ProLayout/PageContainer/index.js +21 -17
- package/es/ProLayout/PageContainer/style.js +46 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +13 -37
- package/es/ProLayout/SiderMenu/SiderMenu.js +24 -36
- package/es/ProLayout/SiderMenu/style.js +166 -0
- package/es/ProLayout/TopHeader/index.js +13 -12
- package/es/ProLayout/TopHeader/style.js +126 -0
- package/es/ProLayout/style/index.js +7 -1
- package/es/ProLayout/util.js +5 -5
- package/es/ProTable/Alert.js +12 -4
- package/es/ProTable/Content.js +108 -28
- package/es/ProTable/Header.js +21 -11
- package/es/ProTable/Pagination.js +12 -4
- package/es/ProTable/ProTable.js +42 -26
- package/es/ProTable/hooks/index.js +2 -0
- package/es/ProTable/hooks/useTableInject.js +5 -0
- package/es/ProTable/hooks/useTableSelection.js +95 -0
- package/es/ProTable/setting.js +1 -1
- package/es/ProTable/style/index.js +109 -1
- package/es/RadioButton/RadioButton.js +10 -4
- package/es/RadioButton/style/index.js +23 -1
- package/es/Scrollbar/Scrollbar.js +10 -3
- package/es/Scrollbar/Thumb.js +36 -25
- package/es/Scrollbar/style/index.js +63 -1
- package/es/Search/Advanced/History.js +23 -16
- package/es/Search/Advanced/SaveHistory.js +1 -2
- package/es/Search/Advanced/index.js +213 -292
- package/es/Search/Item.js +175 -415
- package/es/Search/Search.js +78 -172
- package/es/Search/hooks/index.js +108 -1
- package/es/Search/hooks/useRouteQuery.js +57 -0
- package/es/Search/setting.js +132 -14
- package/es/Search/style/index.js +4 -2
- package/es/Search/style/item.js +28 -0
- package/es/Search/style/search.js +133 -0
- package/es/Search/util.js +116 -124
- package/es/Skeleton/components/DashBoardCard.js +64 -0
- package/es/Skeleton/components/DashBoardChart.js +96 -0
- package/es/Skeleton/components/Detail.js +110 -0
- package/es/Skeleton/components/Drawer.js +91 -0
- package/es/Skeleton/components/Item.js +68 -0
- package/es/Skeleton/components/List.js +45 -0
- package/es/Skeleton/components/ListCard.js +63 -0
- package/es/Skeleton/components/ListCardItem.js +86 -0
- package/es/Skeleton/components/ListTable.js +76 -0
- package/es/Skeleton/components/Page.js +62 -0
- package/es/Skeleton/components/Search.js +54 -0
- package/es/Skeleton/components/Tree.js +72 -0
- package/es/Skeleton/index.js +15 -0
- package/es/Skeleton/skeleton.js +58 -0
- package/es/Skeleton/style/index.js +132 -0
- package/es/Title/style/index.js +29 -1
- package/es/Title/title.js +13 -5
- package/es/ValueItem/ValueItem.js +44 -39
- package/es/components.js +1 -4
- package/es/locale/en-US.js +3 -7
- package/es/locale/zh-CN.js +3 -7
- package/es/style/index.js +0 -3
- package/es/style/styleRegister.js +21 -0
- package/es/style/variable.js +4 -0
- package/es/style.js +0 -12
- package/lib/AutoComplete/AutoComplete.js +13 -9
- package/lib/BadgeStatus/Badge.js +1 -2
- package/lib/BadgeStatus/color.js +3 -3
- package/lib/CardSelect/CardSelect.js +23 -13
- package/lib/CardSelect/style/index.js +30 -1
- package/lib/CheckButton/CheckButton.js +12 -4
- package/lib/CheckButton/style/index.js +46 -1
- package/lib/DragModal/DragModal.js +14 -8
- package/lib/DragModal/style/index.js +69 -1
- package/lib/EditTable/Body.js +10 -3
- package/lib/EditTable/EditTable.js +13 -7
- package/lib/EditTable/FormItem.js +18 -19
- package/lib/EditTable/Header.js +16 -6
- package/lib/EditTable/components/ContextMenu/Menu.js +11 -5
- package/lib/EditTable/components/Search/search.js +1 -2
- package/lib/EditTable/components/Search/sort.js +1 -3
- package/lib/EditTable/group.js +23 -18
- package/lib/EditTable/hooks/useValidate.js +1 -1
- package/lib/EditTable/style/body.js +60 -0
- package/lib/EditTable/style/form.js +31 -0
- package/lib/EditTable/style/group.js +32 -0
- package/lib/EditTable/style/header.js +65 -0
- package/lib/EditTable/style/index.js +47 -1
- package/lib/EditTable/style/menu.js +33 -0
- package/lib/EditTable/style/table.js +52 -0
- package/lib/EditTable/utils.js +31 -3
- package/lib/Ellipsis/Ellipsis.js +10 -2
- package/lib/Ellipsis/style/index.js +29 -1
- package/lib/FullPage/FullPage.js +1 -2
- package/lib/LocaleProvider/index.js +1 -2
- package/lib/PermissionButton/index.js +3 -4
- package/lib/ProLayout/Basic/BasicLayout.js +44 -40
- package/lib/ProLayout/Basic/BasicLayoutStyle.js +46 -0
- package/lib/ProLayout/Basic/Header.js +2 -6
- package/lib/ProLayout/Basic/HeaderStyle.js +17 -0
- package/lib/ProLayout/PageContainer/index.js +19 -15
- package/lib/ProLayout/PageContainer/style.js +53 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +14 -37
- package/lib/ProLayout/SiderMenu/SiderMenu.js +23 -35
- package/lib/ProLayout/SiderMenu/style.js +173 -0
- package/lib/ProLayout/TopHeader/index.js +14 -12
- package/lib/ProLayout/TopHeader/style.js +133 -0
- package/lib/ProLayout/style/index.js +12 -1
- package/lib/ProLayout/util.js +5 -5
- package/lib/ProTable/Alert.js +12 -4
- package/lib/ProTable/Content.js +108 -28
- package/lib/ProTable/Header.js +21 -11
- package/lib/ProTable/Pagination.js +12 -4
- package/lib/ProTable/ProTable.js +42 -26
- package/lib/ProTable/hooks/index.js +27 -0
- package/lib/ProTable/hooks/useTableInject.js +11 -0
- package/lib/ProTable/hooks/useTableSelection.js +102 -0
- package/lib/ProTable/setting.js +1 -1
- package/lib/ProTable/style/index.js +114 -1
- package/lib/RadioButton/RadioButton.js +10 -4
- package/lib/RadioButton/style/index.js +28 -1
- package/lib/Scrollbar/Scrollbar.js +10 -3
- package/lib/Scrollbar/Thumb.js +36 -25
- package/lib/Scrollbar/style/index.js +68 -1
- package/lib/Search/Advanced/History.js +23 -16
- package/lib/Search/Advanced/SaveHistory.js +1 -2
- package/lib/Search/Advanced/index.js +213 -292
- package/lib/Search/Item.js +175 -415
- package/lib/Search/Search.js +78 -172
- package/lib/Search/hooks/index.js +130 -1
- package/lib/Search/hooks/useRouteQuery.js +64 -0
- package/lib/Search/setting.js +133 -15
- package/lib/Search/style/index.js +9 -2
- package/lib/Search/style/item.js +35 -0
- package/lib/Search/style/search.js +140 -0
- package/lib/Search/util.js +116 -124
- package/lib/Skeleton/components/DashBoardCard.js +64 -0
- package/lib/Skeleton/components/DashBoardChart.js +96 -0
- package/lib/Skeleton/components/Detail.js +110 -0
- package/lib/Skeleton/components/Drawer.js +91 -0
- package/lib/Skeleton/components/Item.js +68 -0
- package/lib/Skeleton/components/List.js +45 -0
- package/lib/Skeleton/components/ListCard.js +63 -0
- package/lib/Skeleton/components/ListCardItem.js +86 -0
- package/lib/Skeleton/components/ListTable.js +76 -0
- package/lib/Skeleton/components/Page.js +62 -0
- package/lib/Skeleton/components/Search.js +54 -0
- package/lib/Skeleton/components/Tree.js +72 -0
- package/lib/Skeleton/index.js +75 -0
- package/lib/Skeleton/skeleton.js +58 -0
- package/lib/Skeleton/style/index.js +139 -0
- package/lib/Title/style/index.js +34 -1
- package/lib/Title/title.js +13 -5
- package/lib/ValueItem/ValueItem.js +44 -39
- package/lib/components.js +0 -21
- package/lib/locale/en-US.js +3 -7
- package/lib/locale/zh-CN.js +3 -7
- package/lib/style/components.less +0 -1
- package/lib/style/index.js +1 -4
- package/lib/style/styleRegister.js +28 -0
- package/lib/style/variable.js +10 -0
- package/lib/style.js +1 -14
- package/package.json +10 -13
- package/es/AMap/Map.js +0 -133
- package/es/AMap/index.js +0 -5
- package/es/AMap/util.js +0 -56
- package/es/CardSelect/style/index.css +0 -24
- package/es/CardSelect/style/index.less +0 -26
- package/es/CheckButton/style/index.css +0 -37
- package/es/CheckButton/style/index.less +0 -40
- package/es/DragModal/style/index.css +0 -82
- package/es/DragModal/style/index.less +0 -97
- package/es/Echarts/Echarts.js +0 -48
- package/es/Echarts/index.js +0 -5
- package/es/EditTable/style/body.less +0 -66
- package/es/EditTable/style/form.less +0 -33
- package/es/EditTable/style/group.less +0 -32
- package/es/EditTable/style/header.less +0 -77
- package/es/EditTable/style/index.css +0 -267
- package/es/EditTable/style/index.less +0 -41
- package/es/EditTable/style/menu.less +0 -25
- package/es/EditTable/style/table.less +0 -47
- package/es/Ellipsis/style/index.css +0 -17
- package/es/Ellipsis/style/index.less +0 -20
- package/es/FlameGraph/FlameGraph.js +0 -136
- package/es/FlameGraph/index.js +0 -5
- package/es/FlameGraph/style/index.css +0 -43
- package/es/FlameGraph/style/index.js +0 -1
- package/es/FlameGraph/style/index.less +0 -52
- package/es/ProLayout/Basic/BasicLayout.less +0 -66
- package/es/ProLayout/Basic/Header.less +0 -8
- package/es/ProLayout/PageContainer/index.less +0 -103
- package/es/ProLayout/SiderMenu/index.less +0 -231
- package/es/ProLayout/TopHeader/index.less +0 -174
- package/es/ProLayout/style/default.less +0 -4
- package/es/ProLayout/style/style.less +0 -7
- package/es/ProTable/style/ProTable.less +0 -139
- package/es/RadioButton/style/index.css +0 -20
- package/es/RadioButton/style/index.less +0 -19
- package/es/Scrollbar/style/index.css +0 -65
- package/es/Scrollbar/style/index.less +0 -83
- package/es/Search/style/Item.less +0 -33
- package/es/Search/style/Search.less +0 -179
- package/es/Title/style/index.css +0 -23
- package/es/Title/style/index.less +0 -25
- package/es/style/index.css +0 -5234
- package/es/style/index.less +0 -13
- package/es/style/variable.css +0 -4
- package/es/style/variable.less +0 -4
- package/lib/AMap/Map.js +0 -133
- package/lib/AMap/index.js +0 -12
- package/lib/AMap/util.js +0 -62
- package/lib/CardSelect/style/index.css +0 -24
- package/lib/CardSelect/style/index.less +0 -26
- package/lib/CheckButton/style/index.css +0 -37
- package/lib/CheckButton/style/index.less +0 -40
- package/lib/DragModal/style/index.css +0 -82
- package/lib/DragModal/style/index.less +0 -97
- package/lib/Echarts/Echarts.js +0 -48
- package/lib/Echarts/index.js +0 -12
- package/lib/EditTable/style/body.less +0 -66
- package/lib/EditTable/style/form.less +0 -33
- package/lib/EditTable/style/group.less +0 -32
- package/lib/EditTable/style/header.less +0 -77
- package/lib/EditTable/style/index.css +0 -267
- package/lib/EditTable/style/index.less +0 -41
- package/lib/EditTable/style/menu.less +0 -25
- package/lib/EditTable/style/table.less +0 -47
- package/lib/Ellipsis/style/index.css +0 -17
- package/lib/Ellipsis/style/index.less +0 -20
- package/lib/FlameGraph/FlameGraph.js +0 -136
- package/lib/FlameGraph/index.js +0 -12
- package/lib/FlameGraph/style/index.css +0 -43
- package/lib/FlameGraph/style/index.js +0 -3
- package/lib/FlameGraph/style/index.less +0 -52
- package/lib/ProLayout/Basic/BasicLayout.less +0 -66
- package/lib/ProLayout/Basic/Header.less +0 -8
- package/lib/ProLayout/PageContainer/index.less +0 -103
- package/lib/ProLayout/SiderMenu/index.less +0 -231
- package/lib/ProLayout/TopHeader/index.less +0 -174
- package/lib/ProLayout/style/default.less +0 -4
- package/lib/ProLayout/style/style.less +0 -7
- package/lib/ProTable/style/ProTable.less +0 -139
- package/lib/RadioButton/style/index.css +0 -20
- package/lib/RadioButton/style/index.less +0 -19
- package/lib/Scrollbar/style/index.css +0 -65
- package/lib/Scrollbar/style/index.less +0 -83
- package/lib/Search/style/Item.less +0 -33
- package/lib/Search/style/Search.less +0 -179
- package/lib/Title/style/index.css +0 -23
- package/lib/Title/style/index.less +0 -25
- package/lib/style/index.css +0 -5234
- package/lib/style/index.less +0 -13
- package/lib/style/variable.css +0 -4
- package/lib/style/variable.less +0 -4
package/lib/Search/Search.js
CHANGED
|
@@ -1,112 +1,73 @@
|
|
|
1
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
|
-
"align": "props",
|
|
11
|
-
"JColumnsProps": "setup-maybe-ref",
|
|
12
|
-
"SearchItemData": "setup-maybe-ref",
|
|
13
|
-
"SearchProps": "setup-maybe-ref",
|
|
14
|
-
"Terms": "setup-maybe-ref",
|
|
15
|
-
"Button": "setup-maybe-ref",
|
|
16
|
-
"Row": "setup-maybe-ref",
|
|
17
|
-
"Col": "setup-maybe-ref",
|
|
18
|
-
"Form": "setup-maybe-ref",
|
|
19
|
-
"FormItemRest": "setup-maybe-ref",
|
|
20
|
-
"set": "setup-maybe-ref",
|
|
21
2
|
"reactive": "setup-const",
|
|
22
3
|
"ref": "setup-const",
|
|
23
|
-
"provide": "setup-const",
|
|
24
|
-
"watch": "setup-const",
|
|
25
4
|
"computed": "setup-const",
|
|
26
5
|
"inject": "setup-const",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"optionsMapKey": "setup-maybe-ref",
|
|
30
|
-
"SearchConfig": "setup-maybe-ref",
|
|
6
|
+
"useAttrs": "setup-const",
|
|
7
|
+
"searchProps": "setup-maybe-ref",
|
|
31
8
|
"useLocaleReceiver": "setup-maybe-ref",
|
|
9
|
+
"Button": "setup-maybe-ref",
|
|
10
|
+
"Col": "setup-maybe-ref",
|
|
11
|
+
"Form": "setup-maybe-ref",
|
|
12
|
+
"FormItemRest": "setup-maybe-ref",
|
|
13
|
+
"Row": "setup-maybe-ref",
|
|
14
|
+
"SearchConfig": "setup-maybe-ref",
|
|
15
|
+
"Item": "setup-const",
|
|
16
|
+
"useHandleColumns": "setup-maybe-ref",
|
|
17
|
+
"useOptionMapContent": "setup-maybe-ref",
|
|
18
|
+
"termsParamsFormat": "setup-maybe-ref",
|
|
19
|
+
"useSearchStyle": "setup-maybe-ref",
|
|
32
20
|
"props": "setup-reactive-const",
|
|
33
|
-
"contextLocale": "setup-maybe-ref",
|
|
34
|
-
"columnOptionMap": "setup-ref",
|
|
35
21
|
"emit": "setup-const",
|
|
22
|
+
"contextLocale": "setup-maybe-ref",
|
|
23
|
+
"attrs": "setup-maybe-ref",
|
|
24
|
+
"columnsOptionMap": "setup-ref",
|
|
36
25
|
"terms": "setup-reactive-const",
|
|
37
|
-
"searchItems": "setup-ref",
|
|
38
26
|
"context": "setup-maybe-ref",
|
|
27
|
+
"initValues": "setup-maybe-ref",
|
|
28
|
+
"columnsMap": "setup-maybe-ref",
|
|
29
|
+
"prefixCls": "setup-ref",
|
|
30
|
+
"wrapSSR": "setup-maybe-ref",
|
|
31
|
+
"hashId": "setup-maybe-ref",
|
|
39
32
|
"footerStyles": "setup-ref",
|
|
40
|
-
"itemValueChange": "setup-const",
|
|
41
|
-
"handleItems": "setup-const",
|
|
42
33
|
"searchSubmit": "setup-const",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
34
|
+
"reset": "setup-const",
|
|
35
|
+
"handleDefaultValues": "setup-const"
|
|
45
36
|
} */
|
|
46
37
|
import { defineComponent as _defineComponent } from 'vue';
|
|
47
|
-
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode,
|
|
38
|
+
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue";
|
|
48
39
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
49
40
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
41
|
+
import { reactive, ref, computed, inject, useAttrs } from 'vue';
|
|
42
|
+
import { searchProps } from "./setting";
|
|
43
|
+
import { useLocaleReceiver } from "../LocaleReciver";
|
|
44
|
+
import { Button, Col, Form, FormItemRest, Row } from "ant-design-vue";
|
|
45
|
+
import { SearchConfig } from "../utils/constants";
|
|
46
|
+
import Item from './Item.js';
|
|
47
|
+
import { useHandleColumns, useOptionMapContent } from "./hooks";
|
|
48
|
+
import { termsParamsFormat } from "./util";
|
|
49
|
+
import useSearchStyle from './style';
|
|
58
50
|
const __sfc_main__ = _defineComponent({
|
|
59
51
|
...{
|
|
60
52
|
name: 'JSearch',
|
|
53
|
+
inheritAttrs: false
|
|
61
54
|
},
|
|
62
55
|
props: {
|
|
63
|
-
|
|
64
|
-
type: Array,
|
|
65
|
-
default: () => [],
|
|
66
|
-
required: true,
|
|
67
|
-
},
|
|
68
|
-
type: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: 'terms',
|
|
71
|
-
required: true,
|
|
72
|
-
},
|
|
73
|
-
column: {
|
|
74
|
-
type: Number,
|
|
75
|
-
default: 4,
|
|
76
|
-
},
|
|
77
|
-
style: {
|
|
78
|
-
type: [String, Object],
|
|
79
|
-
default: undefined,
|
|
80
|
-
},
|
|
81
|
-
class: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: '',
|
|
84
|
-
},
|
|
85
|
-
labelWidth: {
|
|
86
|
-
type: Number,
|
|
87
|
-
default: 40,
|
|
88
|
-
},
|
|
89
|
-
resetText: {
|
|
90
|
-
type: String,
|
|
91
|
-
},
|
|
92
|
-
submitText: {
|
|
93
|
-
type: String,
|
|
94
|
-
},
|
|
95
|
-
align: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: 'value'
|
|
98
|
-
}
|
|
56
|
+
...searchProps()
|
|
99
57
|
},
|
|
100
|
-
emits: [
|
|
58
|
+
emits: ['search'],
|
|
101
59
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
102
60
|
const props = __props;
|
|
103
|
-
const [contextLocale] = useLocaleReceiver('Search');
|
|
104
|
-
const columnOptionMap = ref(new Map());
|
|
105
61
|
const emit = __emit;
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
const
|
|
62
|
+
const [contextLocale] = useLocaleReceiver('Search');
|
|
63
|
+
const attrs = useAttrs();
|
|
64
|
+
const columnsOptionMap = ref({}); // 存储每个columnItem的option
|
|
65
|
+
const terms = reactive({ terms: [] }); // 当前查询条件
|
|
109
66
|
const context = inject(SearchConfig, { align: props.align });
|
|
67
|
+
const { initValues, columnsMap } = useHandleColumns(props, terms);
|
|
68
|
+
const prefixCls = computed(() => 'JSearch');
|
|
69
|
+
const [wrapSSR, hashId] = useSearchStyle(prefixCls);
|
|
70
|
+
useOptionMapContent(columnsOptionMap);
|
|
110
71
|
const footerStyles = computed(() => {
|
|
111
72
|
const align = context.align || props.align;
|
|
112
73
|
if (align === 'value') {
|
|
@@ -114,76 +75,25 @@ const __sfc_main__ = _defineComponent({
|
|
|
114
75
|
}
|
|
115
76
|
return {};
|
|
116
77
|
});
|
|
117
|
-
provide(optionsMapKey, columnOptionMap);
|
|
118
|
-
const itemValueChange = (value, index) => {
|
|
119
|
-
set(terms.terms, [index], value);
|
|
120
|
-
};
|
|
121
|
-
const handleItems = (reset = false) => {
|
|
122
|
-
searchItems.value = [];
|
|
123
|
-
terms.terms = [];
|
|
124
|
-
columnOptionMap.value.clear();
|
|
125
|
-
let hasSearch = false;
|
|
126
|
-
props.columns.forEach((item, index) => {
|
|
127
|
-
if (item.search && Object.keys(item.search).length) {
|
|
128
|
-
columnOptionMap.value.set(item.dataIndex, item.search);
|
|
129
|
-
// 默认值
|
|
130
|
-
const { search } = item;
|
|
131
|
-
let defaultTerms = null;
|
|
132
|
-
// 包含defaultValue 或者 defaultOnceValue
|
|
133
|
-
if (search.defaultValue !== undefined ||
|
|
134
|
-
search.defaultTermType ||
|
|
135
|
-
search.defaultOnceValue) {
|
|
136
|
-
const _value = search.defaultValue || reset
|
|
137
|
-
? search.defaultValue
|
|
138
|
-
: search.defaultOnceValue;
|
|
139
|
-
defaultTerms = {
|
|
140
|
-
type: 'and',
|
|
141
|
-
value: _value,
|
|
142
|
-
termType: search.defaultTermType || 'like',
|
|
143
|
-
column: item.dataIndex,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
if (search.defaultValue !== undefined ||
|
|
147
|
-
search.defaultOnceValue !== undefined) {
|
|
148
|
-
hasSearch = true;
|
|
149
|
-
}
|
|
150
|
-
terms.terms.push(defaultTerms);
|
|
151
|
-
searchItems.value.push({
|
|
152
|
-
...item.search,
|
|
153
|
-
sortIndex: item.search.first ? 0 : index + 1,
|
|
154
|
-
title: item.title,
|
|
155
|
-
column: item.dataIndex,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
if (hasSearch) {
|
|
160
|
-
searchSubmit();
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* 提交
|
|
165
|
-
*/
|
|
166
78
|
const searchSubmit = () => {
|
|
167
|
-
emit('search', termsParamsFormat(terms
|
|
79
|
+
emit('search', termsParamsFormat(terms, columnsMap.value, 'low', props.type));
|
|
168
80
|
};
|
|
169
|
-
/**
|
|
170
|
-
* 重置查询
|
|
171
|
-
*/
|
|
172
|
-
const resetNumber = ref(1);
|
|
173
81
|
const reset = () => {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
82
|
+
initValues();
|
|
83
|
+
};
|
|
84
|
+
const handleDefaultValues = (value) => {
|
|
85
|
+
const isObject = Object.prototype.toString.call(value) === '[object Object]';
|
|
86
|
+
let _params = isObject ? Object.keys(value).map((key) => ({ column: key, value: value[key], termType: 'eq' })) : [...value];
|
|
87
|
+
terms.terms.forEach((item) => {
|
|
88
|
+
const paramsItem = _params.find(paramsItem => paramsItem.column === item.column);
|
|
89
|
+
if (paramsItem) {
|
|
90
|
+
item.value = paramsItem.value;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
emit('search', termsParamsFormat(terms, columnsMap.value));
|
|
182
94
|
};
|
|
183
|
-
watch(() => props.columns, () => {
|
|
184
|
-
handleItems();
|
|
185
|
-
}, { immediate: true, deep: true });
|
|
186
95
|
__expose({
|
|
96
|
+
setValues: handleDefaultValues,
|
|
187
97
|
reset
|
|
188
98
|
});
|
|
189
99
|
return (_ctx, _cache) => {
|
|
@@ -193,36 +103,35 @@ const __sfc_main__ = _defineComponent({
|
|
|
193
103
|
}, {
|
|
194
104
|
default: _withCtx(() => [
|
|
195
105
|
_createElementVNode("div", {
|
|
196
|
-
class: _normalizeClass([
|
|
197
|
-
style: _normalizeStyle(
|
|
106
|
+
class: _normalizeClass(["JSearch-warp", [_unref(attrs).class, _unref(hashId)]]),
|
|
107
|
+
style: _normalizeStyle(_unref(attrs).style)
|
|
198
108
|
}, [
|
|
199
109
|
_createElementVNode("div", _hoisted_1, [
|
|
200
110
|
_createElementVNode("div", _hoisted_2, [
|
|
201
111
|
_createVNode(_unref(Row), { gutter: [16, 16] }, {
|
|
202
112
|
default: _withCtx(() => [
|
|
203
|
-
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(
|
|
113
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(terms.terms, (item, index) => {
|
|
204
114
|
return (_openBlock(), _createBlock(_unref(Col), {
|
|
205
|
-
|
|
206
|
-
span: item.span || 24 / __props.column
|
|
115
|
+
span: item._span || 24 / _ctx.column
|
|
207
116
|
}, {
|
|
208
117
|
default: _withCtx(() => [
|
|
209
|
-
_createVNode(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
"
|
|
218
|
-
|
|
219
|
-
}, null, 8 /* PROPS */, ["
|
|
118
|
+
_createVNode(Item, {
|
|
119
|
+
value: item.value,
|
|
120
|
+
"onUpdate:value": ($event) => ((item.value) = $event),
|
|
121
|
+
termType: item.termType,
|
|
122
|
+
"onUpdate:termType": ($event) => ((item.termType) = $event),
|
|
123
|
+
column: item.column,
|
|
124
|
+
"onUpdate:column": ($event) => ((item.column) = $event),
|
|
125
|
+
type: item.type,
|
|
126
|
+
"onUpdate:type": ($event) => ((item.type) = $event),
|
|
127
|
+
labelWidth: _ctx.labelWidth
|
|
128
|
+
}, null, 8 /* PROPS */, ["value", "onUpdate:value", "termType", "onUpdate:termType", "column", "onUpdate:column", "type", "onUpdate:type", "labelWidth"])
|
|
220
129
|
]),
|
|
221
130
|
_: 2 /* DYNAMIC */
|
|
222
131
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["span"]));
|
|
223
|
-
}),
|
|
132
|
+
}), 256 /* UNKEYED_FRAGMENT */)),
|
|
224
133
|
_createVNode(_unref(Col), {
|
|
225
|
-
span: 24 /
|
|
134
|
+
span: 24 / _ctx.column
|
|
226
135
|
}, {
|
|
227
136
|
default: _withCtx(() => [
|
|
228
137
|
_renderSlot(_ctx.$slots, "footerRender", {
|
|
@@ -233,12 +142,9 @@ const __sfc_main__ = _defineComponent({
|
|
|
233
142
|
class: "JSearch-footer--btns",
|
|
234
143
|
style: _normalizeStyle(footerStyles.value)
|
|
235
144
|
}, [
|
|
236
|
-
_createVNode(_unref(Button), {
|
|
237
|
-
type: "stroke",
|
|
238
|
-
onClick: reset
|
|
239
|
-
}, {
|
|
145
|
+
_createVNode(_unref(Button), { onClick: reset }, {
|
|
240
146
|
default: _withCtx(() => [
|
|
241
|
-
_createTextVNode(_toDisplayString(
|
|
147
|
+
_createTextVNode(_toDisplayString(_ctx.resetText || _unref(contextLocale).search.reset), 1 /* TEXT */)
|
|
242
148
|
]),
|
|
243
149
|
_: 1 /* STABLE */
|
|
244
150
|
}),
|
|
@@ -249,7 +155,7 @@ const __sfc_main__ = _defineComponent({
|
|
|
249
155
|
type: "primary"
|
|
250
156
|
}, {
|
|
251
157
|
default: _withCtx(() => [
|
|
252
|
-
_createTextVNode(_toDisplayString(
|
|
158
|
+
_createTextVNode(_toDisplayString(_ctx.submitText || _unref(contextLocale).search.search), 1 /* TEXT */)
|
|
253
159
|
]),
|
|
254
160
|
_: 1 /* STABLE */
|
|
255
161
|
})
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
7
|
+
var _exportNames = {
|
|
8
|
+
useOptionMapContent: true,
|
|
9
|
+
useOptionMap: true,
|
|
10
|
+
useColumnsMapContent: true,
|
|
11
|
+
useColumnsMap: true,
|
|
12
|
+
useDefaultValue: true,
|
|
13
|
+
useHandleColumns: true
|
|
14
|
+
};
|
|
15
|
+
exports.useOptionMapContent = exports.useOptionMap = exports.useHandleColumns = exports.useDefaultValue = exports.useColumnsMapContent = exports.useColumnsMap = void 0;
|
|
16
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
17
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
18
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
|
+
var _vue = require("vue");
|
|
20
|
+
var _util = require("../util");
|
|
6
21
|
var _useSearchItems = require("./useSearchItems");
|
|
7
22
|
Object.keys(_useSearchItems).forEach(function (key) {
|
|
8
23
|
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
9
25
|
if (key in exports && exports[key] === _useSearchItems[key]) return;
|
|
10
26
|
Object.defineProperty(exports, key, {
|
|
11
27
|
enumerable: true,
|
|
@@ -13,4 +29,117 @@ Object.keys(_useSearchItems).forEach(function (key) {
|
|
|
13
29
|
return _useSearchItems[key];
|
|
14
30
|
}
|
|
15
31
|
});
|
|
16
|
-
});
|
|
32
|
+
});
|
|
33
|
+
var _useRouteQuery = require("./useRouteQuery");
|
|
34
|
+
Object.keys(_useRouteQuery).forEach(function (key) {
|
|
35
|
+
if (key === "default" || key === "__esModule") return;
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
37
|
+
if (key in exports && exports[key] === _useRouteQuery[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _useRouteQuery[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
var optionMapKey = Symbol('optionMapKey');
|
|
46
|
+
var columnsMapKey = Symbol('columnMapKey');
|
|
47
|
+
var columnsValues = Symbol('columnsValues');
|
|
48
|
+
var useOptionMapContent = exports.useOptionMapContent = function useOptionMapContent(optionsMap) {
|
|
49
|
+
(0, _vue.provide)(optionMapKey, optionsMap);
|
|
50
|
+
};
|
|
51
|
+
var useOptionMap = exports.useOptionMap = function useOptionMap() {
|
|
52
|
+
return (0, _vue.inject)(optionMapKey);
|
|
53
|
+
};
|
|
54
|
+
var useColumnsMapContent = exports.useColumnsMapContent = function useColumnsMapContent(columnsMap) {
|
|
55
|
+
(0, _vue.provide)(columnsMapKey, columnsMap);
|
|
56
|
+
};
|
|
57
|
+
var useColumnsMap = exports.useColumnsMap = function useColumnsMap() {
|
|
58
|
+
return (0, _vue.inject)(columnsMapKey);
|
|
59
|
+
};
|
|
60
|
+
var useDefaultValue = exports.useDefaultValue = function useDefaultValue() {
|
|
61
|
+
return (0, _vue.inject)(columnsValues);
|
|
62
|
+
};
|
|
63
|
+
var useHandleColumns = exports.useHandleColumns = function useHandleColumns(props, terms) {
|
|
64
|
+
var columnsMap = (0, _vue.ref)({}); // 存储每个column
|
|
65
|
+
var defaultCacheValues = (0, _vue.ref)({});
|
|
66
|
+
useColumnsMapContent(columnsMap);
|
|
67
|
+
/**
|
|
68
|
+
* 处理search.first为true的排序
|
|
69
|
+
* @param arr
|
|
70
|
+
*/
|
|
71
|
+
var moveFirstElementsToFront = function moveFirstElementsToFront(arr) {
|
|
72
|
+
// 提取所有 first: true 的元素
|
|
73
|
+
var firstElements = arr.filter(function (item) {
|
|
74
|
+
return item.search.first === true;
|
|
75
|
+
});
|
|
76
|
+
// 提取剩余的元素
|
|
77
|
+
var otherElements = arr.filter(function (item) {
|
|
78
|
+
return item.search.first !== true;
|
|
79
|
+
});
|
|
80
|
+
// 合并并返回
|
|
81
|
+
return [].concat((0, _toConsumableArray2.default)(firstElements), (0, _toConsumableArray2.default)(otherElements));
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* 处理默认值
|
|
85
|
+
* @param arr
|
|
86
|
+
*/
|
|
87
|
+
var handleDefaultValue = function handleDefaultValue(arr) {
|
|
88
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(arr),
|
|
89
|
+
_step;
|
|
90
|
+
try {
|
|
91
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
92
|
+
var item = _step.value;
|
|
93
|
+
var search = item.search;
|
|
94
|
+
var _data = {
|
|
95
|
+
defaultValue: undefined,
|
|
96
|
+
defaultTermType: undefined
|
|
97
|
+
};
|
|
98
|
+
_data.defaultValue = search.defaultValue;
|
|
99
|
+
_data.defaultTermType = search.defaultTermType;
|
|
100
|
+
defaultCacheValues.value[item.dataIndex] = _data;
|
|
101
|
+
}
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
(0, _vue.provide)(columnsValues, defaultCacheValues);
|
|
108
|
+
};
|
|
109
|
+
var initValues = function initValues() {
|
|
110
|
+
var arr = Object.values(columnsMap.value);
|
|
111
|
+
if (props.mode === 'advanced') {
|
|
112
|
+
// 设置第一位
|
|
113
|
+
terms.terms = [(0, _util.getItemDefaultValue)(arr[0], defaultCacheValues.value)];
|
|
114
|
+
} else {
|
|
115
|
+
terms.terms = arr.map(function (item) {
|
|
116
|
+
return (0, _util.getItemDefaultValue)(item, defaultCacheValues.value);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
var handleColumns = function handleColumns(columns) {
|
|
121
|
+
var columnsSearch = columns.filter(function (item) {
|
|
122
|
+
return item.hasOwnProperty('search') && Object.keys(item.search).length;
|
|
123
|
+
});
|
|
124
|
+
// 排序
|
|
125
|
+
var columnsSort = moveFirstElementsToFront(columnsSearch);
|
|
126
|
+
columnsSort.forEach(function (item, index) {
|
|
127
|
+
columnsMap.value[item.dataIndex] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
128
|
+
_sort_index: index
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
handleDefaultValue(columnsSort);
|
|
132
|
+
if (terms.terms.length === 0) {
|
|
133
|
+
// 高级模式处理数据
|
|
134
|
+
initValues();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
(0, _vue.watchEffect)(function () {
|
|
138
|
+
handleColumns(props.columns);
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
initValues: initValues,
|
|
142
|
+
columnsMap: columnsMap,
|
|
143
|
+
defaultCacheValues: defaultCacheValues
|
|
144
|
+
};
|
|
145
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useRouteQuery = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _vue = require("vue");
|
|
10
|
+
var _vueRouter = require("vue-router");
|
|
11
|
+
var _queue = new WeakMap();
|
|
12
|
+
var useRouteQuery = exports.useRouteQuery = function useRouteQuery(name) {
|
|
13
|
+
var router = (0, _vueRouter.useRouter)();
|
|
14
|
+
var route = (0, _vueRouter.useRoute)();
|
|
15
|
+
var transformGet = function transformGet(value) {
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
var transformSet = function transformSet(value) {
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
if (!_queue.has(router)) _queue.set(router, new Map());
|
|
22
|
+
var _queriesQueue = _queue.get(router);
|
|
23
|
+
var query = route.query[name];
|
|
24
|
+
var _trigger;
|
|
25
|
+
var proxy = (0, _vue.customRef)(function (track, trigger) {
|
|
26
|
+
_trigger = trigger;
|
|
27
|
+
return {
|
|
28
|
+
get: function get() {
|
|
29
|
+
track();
|
|
30
|
+
return transformGet(query !== undefined ? query : undefined);
|
|
31
|
+
},
|
|
32
|
+
set: function set(v) {
|
|
33
|
+
v = transformSet(v);
|
|
34
|
+
if (query === v) return;
|
|
35
|
+
query = v === undefined ? undefined : v;
|
|
36
|
+
_queriesQueue.set(name, v === undefined ? undefined : v);
|
|
37
|
+
trigger();
|
|
38
|
+
(0, _vue.nextTick)(function () {
|
|
39
|
+
if (_queriesQueue.size === 0) return;
|
|
40
|
+
var newQueries = Object.fromEntries(_queriesQueue.entries());
|
|
41
|
+
_queriesQueue.clear();
|
|
42
|
+
var params = route.params,
|
|
43
|
+
query = route.query,
|
|
44
|
+
hash = route.hash;
|
|
45
|
+
router.replace({
|
|
46
|
+
params: params,
|
|
47
|
+
query: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, query), newQueries),
|
|
48
|
+
hash: hash
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
(0, _vue.watch)(function () {
|
|
55
|
+
return route.query[name];
|
|
56
|
+
}, function (v) {
|
|
57
|
+
if (query === transformGet(v)) return;
|
|
58
|
+
query = v;
|
|
59
|
+
_trigger();
|
|
60
|
+
}, {
|
|
61
|
+
flush: 'sync'
|
|
62
|
+
});
|
|
63
|
+
return proxy;
|
|
64
|
+
};
|