@jetlinks-web/components 2.0.2 → 2.0.4-1
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 +125 -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 +120 -0
- package/es/CheckButton/index.js +2 -0
- package/es/CheckButton/style/index.css +37 -0
- package/es/CheckButton/style/index.less +40 -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 +184 -0
- package/es/Ellipsis/index.js +2 -0
- package/es/Ellipsis/style/index.css +17 -0
- package/es/Ellipsis/style/index.less +20 -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 +1 -1
- 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/{src → es}/ProTable/style/index.less +92 -92
- 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 +2 -4
- package/es/style.js +5 -0
- package/lib/AMap/Map.js +125 -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 +120 -0
- package/lib/CheckButton/index.js +9 -0
- package/lib/CheckButton/style/index.css +37 -0
- package/lib/CheckButton/style/index.less +40 -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 +184 -0
- package/lib/Ellipsis/index.js +9 -0
- package/lib/Ellipsis/style/index.css +17 -0
- package/lib/Ellipsis/style/index.less +20 -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 +3 -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 +7 -0
- package/package.json +123 -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
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
17
|
+
/* Analyzed bindings: {
|
|
18
|
+
"columns": "props",
|
|
19
|
+
"type": "props",
|
|
20
|
+
"target": "setup-maybe-ref",
|
|
21
|
+
"class": "props",
|
|
22
|
+
"request": "props",
|
|
23
|
+
"historyRequest": "props",
|
|
24
|
+
"deleteRequest": "props",
|
|
25
|
+
"deleteKey": "props",
|
|
26
|
+
"routerMode": "props",
|
|
27
|
+
"style": "props",
|
|
28
|
+
"SearchItem": "setup-const",
|
|
29
|
+
"optionsMapKey": "setup-maybe-ref",
|
|
30
|
+
"typeOptions": "setup-maybe-ref",
|
|
31
|
+
"useElementSize": "setup-maybe-ref",
|
|
32
|
+
"useRouteQuery": "setup-maybe-ref",
|
|
33
|
+
"PropType": "setup-const",
|
|
34
|
+
"ref": "setup-const",
|
|
35
|
+
"reactive": "setup-const",
|
|
36
|
+
"watch": "setup-const",
|
|
37
|
+
"provide": "setup-const",
|
|
38
|
+
"SaveHistory": "setup-const",
|
|
39
|
+
"History": "setup-const",
|
|
40
|
+
"compatibleOldTerms": "setup-maybe-ref",
|
|
41
|
+
"getTermTypeFn": "setup-maybe-ref",
|
|
42
|
+
"handleQData": "setup-maybe-ref",
|
|
43
|
+
"hasExpand": "setup-maybe-ref",
|
|
44
|
+
"termsParamsFormat": "setup-maybe-ref",
|
|
45
|
+
"Select": "setup-maybe-ref",
|
|
46
|
+
"Button": "setup-maybe-ref",
|
|
47
|
+
"Form": "setup-maybe-ref",
|
|
48
|
+
"FormItemRest": "setup-maybe-ref",
|
|
49
|
+
"AIcon": "setup-maybe-ref",
|
|
50
|
+
"cloneDeep": "setup-maybe-ref",
|
|
51
|
+
"props": "setup-reactive-const",
|
|
52
|
+
"searchRef": "setup-ref",
|
|
53
|
+
"searchRefContentRef": "setup-ref",
|
|
54
|
+
"width": "setup-maybe-ref",
|
|
55
|
+
"q": "setup-maybe-ref",
|
|
56
|
+
"hasOnceSearch": "setup-ref",
|
|
57
|
+
"expand": "setup-ref",
|
|
58
|
+
"layout": "setup-ref",
|
|
59
|
+
"compatible": "setup-ref",
|
|
60
|
+
"screenSize": "setup-ref",
|
|
61
|
+
"resetNumber": "setup-ref",
|
|
62
|
+
"searchItems": "setup-ref",
|
|
63
|
+
"termsData": "setup-reactive-const",
|
|
64
|
+
"columnOptionMap": "setup-ref",
|
|
65
|
+
"emit": "setup-const",
|
|
66
|
+
"expandChange": "setup-const",
|
|
67
|
+
"itemValueChange": "setup-const",
|
|
68
|
+
"addUrlParams": "setup-const",
|
|
69
|
+
"submitData": "setup-const",
|
|
70
|
+
"searchSubmit": "setup-const",
|
|
71
|
+
"reset": "setup-const",
|
|
72
|
+
"historyItemClick": "setup-const",
|
|
73
|
+
"handleUrlParams": "setup-const",
|
|
74
|
+
"handleItems": "setup-const"
|
|
75
|
+
} */
|
|
76
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
77
|
+
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";
|
|
78
|
+
const _hoisted_1 = { class: "left" };
|
|
79
|
+
const _hoisted_2 = { class: "left-items" };
|
|
80
|
+
const _hoisted_3 = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "center"
|
|
83
|
+
};
|
|
84
|
+
const _hoisted_4 = {
|
|
85
|
+
key: 1,
|
|
86
|
+
class: "right"
|
|
87
|
+
};
|
|
88
|
+
const _hoisted_5 = { class: "right-items" };
|
|
89
|
+
const _hoisted_6 = { class: "JSearch-footer--btns" };
|
|
90
|
+
const _hoisted_7 = /*#__PURE__*/ _createElementVNode("span", { class: "more-text" }, " 更多筛选 ", -1 /* HOISTED */);
|
|
91
|
+
const _hoisted_8 = { class: "JSearch-content single big pack-up" };
|
|
92
|
+
const _hoisted_9 = { class: "JSearch-items" };
|
|
93
|
+
const _hoisted_10 = { class: "left" };
|
|
94
|
+
const _hoisted_11 = { class: "JSearch-footer" };
|
|
95
|
+
const _hoisted_12 = { class: "JSearch-footer--btns" };
|
|
96
|
+
import SearchItem from '../Item.js';
|
|
97
|
+
import { optionsMapKey, typeOptions } from '../setting';
|
|
98
|
+
import { useElementSize } from '@vueuse/core';
|
|
99
|
+
import { useRouteQuery } from '@vueuse/router';
|
|
100
|
+
import { ref, reactive, watch, provide } from 'vue';
|
|
101
|
+
import SaveHistory from './SaveHistory.js';
|
|
102
|
+
import History from './History.js';
|
|
103
|
+
import { compatibleOldTerms, getTermTypeFn, handleQData, hasExpand, termsParamsFormat, } from '../util';
|
|
104
|
+
import { Select, Button, Form, FormItemRest } from 'ant-design-vue';
|
|
105
|
+
import { AIcon } from '../../../';
|
|
106
|
+
import { cloneDeep } from 'lodash-es';
|
|
107
|
+
const __sfc_main__ = _defineComponent({
|
|
108
|
+
props: {
|
|
109
|
+
columns: {
|
|
110
|
+
type: Array,
|
|
111
|
+
default: () => [],
|
|
112
|
+
required: true,
|
|
113
|
+
},
|
|
114
|
+
type: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: 'advanced',
|
|
117
|
+
},
|
|
118
|
+
target: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: '',
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
class: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: '',
|
|
126
|
+
},
|
|
127
|
+
request: {
|
|
128
|
+
type: Function,
|
|
129
|
+
default: undefined,
|
|
130
|
+
},
|
|
131
|
+
historyRequest: {
|
|
132
|
+
type: Function,
|
|
133
|
+
default: undefined,
|
|
134
|
+
},
|
|
135
|
+
deleteRequest: {
|
|
136
|
+
type: Function,
|
|
137
|
+
default: null,
|
|
138
|
+
},
|
|
139
|
+
deleteKey: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: 'key',
|
|
142
|
+
},
|
|
143
|
+
routerMode: {
|
|
144
|
+
type: String,
|
|
145
|
+
default: 'hash',
|
|
146
|
+
},
|
|
147
|
+
style: {
|
|
148
|
+
type: [String, Object],
|
|
149
|
+
default: undefined,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
emits: ["search"],
|
|
153
|
+
setup(__props, { emit: __emit }) {
|
|
154
|
+
const props = __props;
|
|
155
|
+
const searchRef = ref(null);
|
|
156
|
+
const searchRefContentRef = ref(null);
|
|
157
|
+
const { width } = useElementSize(searchRef);
|
|
158
|
+
const q = useRouteQuery('q');
|
|
159
|
+
const target = useRouteQuery('target');
|
|
160
|
+
const hasOnceSearch = ref(false);
|
|
161
|
+
// 是否展开更多筛选
|
|
162
|
+
const expand = ref(false);
|
|
163
|
+
// 组件方向
|
|
164
|
+
const layout = ref('horizontal');
|
|
165
|
+
const compatible = ref(false);
|
|
166
|
+
// 当前组件宽度 true 大于1000
|
|
167
|
+
const screenSize = ref(true);
|
|
168
|
+
const resetNumber = ref(1);
|
|
169
|
+
const searchItems = ref([]); // 当前查询条件
|
|
170
|
+
const termsData = reactive({
|
|
171
|
+
terms: [
|
|
172
|
+
{ terms: [null, null, null] },
|
|
173
|
+
{ terms: [null, null, null], type: 'and' },
|
|
174
|
+
],
|
|
175
|
+
});
|
|
176
|
+
const columnOptionMap = ref(new Map());
|
|
177
|
+
provide(optionsMapKey, columnOptionMap);
|
|
178
|
+
const emit = __emit;
|
|
179
|
+
const expandChange = () => {
|
|
180
|
+
expand.value = !expand.value;
|
|
181
|
+
if (!expand.value) {
|
|
182
|
+
// 收起
|
|
183
|
+
const firstItem = termsData.terms[0].terms[0];
|
|
184
|
+
termsData.terms = [
|
|
185
|
+
{ terms: [firstItem, null, null] },
|
|
186
|
+
{ type: 'or', terms: [null, null, null] },
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const itemValueChange = (value, index) => {
|
|
191
|
+
if (index < 4) {
|
|
192
|
+
// 第一组数据
|
|
193
|
+
termsData.terms[0].terms[index - 1] = value;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// 第二组数据
|
|
197
|
+
termsData.terms[1].terms[index - 4] = value;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const addUrlParams = () => {
|
|
201
|
+
q.value = encodeURI(JSON.stringify(termsData));
|
|
202
|
+
target.value = props.target;
|
|
203
|
+
};
|
|
204
|
+
const submitData = () => {
|
|
205
|
+
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* 提交
|
|
209
|
+
*/
|
|
210
|
+
const searchSubmit = () => {
|
|
211
|
+
submitData();
|
|
212
|
+
if (props.type === 'advanced') {
|
|
213
|
+
addUrlParams();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* 重置查询
|
|
218
|
+
*/
|
|
219
|
+
const reset = () => {
|
|
220
|
+
termsData.terms = [
|
|
221
|
+
{ terms: [null, null, null] },
|
|
222
|
+
{ terms: [null, null, null], type: 'and' },
|
|
223
|
+
];
|
|
224
|
+
expand.value = false;
|
|
225
|
+
if (props.type === 'advanced') {
|
|
226
|
+
q.value = null;
|
|
227
|
+
target.value = null;
|
|
228
|
+
}
|
|
229
|
+
resetNumber.value += 1;
|
|
230
|
+
emit('search', { terms: [] });
|
|
231
|
+
};
|
|
232
|
+
watch(width, (value) => {
|
|
233
|
+
if (value < 1000) {
|
|
234
|
+
layout.value = 'vertical';
|
|
235
|
+
screenSize.value = false;
|
|
236
|
+
compatible.value = value < 760;
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
layout.value = 'horizontal';
|
|
240
|
+
screenSize.value = true;
|
|
241
|
+
compatible.value = false;
|
|
242
|
+
}
|
|
243
|
+
}, { immediate: true });
|
|
244
|
+
const historyItemClick = (content) => {
|
|
245
|
+
try {
|
|
246
|
+
termsData.terms = _optionalChain([handleQData, 'call', _2 => _2(compatibleOldTerms(content)), 'optionalAccess', _3 => _3.terms]) || [];
|
|
247
|
+
expand.value = hasExpand(termsData.terms);
|
|
248
|
+
searchSubmit();
|
|
249
|
+
}
|
|
250
|
+
catch (e) {
|
|
251
|
+
console.warn(`Search组件中handleUrlParams处理JSON时异常:【${e}】`);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* 处理URL中的查询参数
|
|
256
|
+
* @param _params
|
|
257
|
+
*/
|
|
258
|
+
const handleUrlParams = (_params) => {
|
|
259
|
+
// URL中的target和props的一致,则还原查询参数
|
|
260
|
+
if (props.target && _params.target === props.target && _params.q) {
|
|
261
|
+
const qStr = decodeURI(_params.q);
|
|
262
|
+
termsData.terms = _optionalChain([handleQData, 'call', _4 => _4(compatibleOldTerms(qStr)), 'optionalAccess', _5 => _5.terms]) || [];
|
|
263
|
+
expand.value = hasExpand(termsData.terms);
|
|
264
|
+
emit('search', termsParamsFormat(termsData, columnOptionMap.value));
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* 处理每项的key为Item组件所需要的key
|
|
269
|
+
*/
|
|
270
|
+
const handleItems = () => {
|
|
271
|
+
searchItems.value = [];
|
|
272
|
+
columnOptionMap.value.clear();
|
|
273
|
+
props.columns.forEach((item, index) => {
|
|
274
|
+
const _item = cloneDeep(item);
|
|
275
|
+
if (_item.search && Object.keys(_item.search).length) {
|
|
276
|
+
columnOptionMap.value.set(
|
|
277
|
+
// _item.search?.rename || _item.dataIndex,
|
|
278
|
+
_item.dataIndex, _item.search);
|
|
279
|
+
// 默认值
|
|
280
|
+
const { search } = _item;
|
|
281
|
+
let defaultTerms = null;
|
|
282
|
+
// 包含defaultValue 或者 defaultOnceValue
|
|
283
|
+
if (search.defaultValue !== undefined || search.defaultOnceValue) {
|
|
284
|
+
const _value = search.defaultValue || search.defaultOnceValue;
|
|
285
|
+
defaultTerms = {
|
|
286
|
+
type: 'and',
|
|
287
|
+
value: _value,
|
|
288
|
+
termType: search.defaultTermType || getTermTypeFn(search.type),
|
|
289
|
+
column: _item.dataIndex,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (search.defaultValue !== undefined ||
|
|
293
|
+
search.defaultOnceValue !== undefined) {
|
|
294
|
+
hasOnceSearch.value = true;
|
|
295
|
+
}
|
|
296
|
+
searchItems.value.push({
|
|
297
|
+
..._item.search,
|
|
298
|
+
sortIndex: _item.search.first ? 0 : index + 1,
|
|
299
|
+
title: _item.title,
|
|
300
|
+
// column: _item.search?.rename || _item.dataIndex,
|
|
301
|
+
column: _item.dataIndex,
|
|
302
|
+
});
|
|
303
|
+
if (defaultTerms) {
|
|
304
|
+
itemValueChange(defaultTerms, search.first ? 1 : index + 1);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
submitData();
|
|
309
|
+
handleUrlParams({ q: q.value, target: target.value });
|
|
310
|
+
};
|
|
311
|
+
watch(() => props.columns, () => {
|
|
312
|
+
termsData.terms = [
|
|
313
|
+
{ terms: [null, null, null] },
|
|
314
|
+
{ terms: [null, null, null], type: 'and' },
|
|
315
|
+
];
|
|
316
|
+
expand.value = false;
|
|
317
|
+
if (props.type === 'advanced') {
|
|
318
|
+
q.value = null;
|
|
319
|
+
target.value = null;
|
|
320
|
+
}
|
|
321
|
+
handleItems();
|
|
322
|
+
}, {
|
|
323
|
+
deep: true,
|
|
324
|
+
});
|
|
325
|
+
handleItems();
|
|
326
|
+
return (_ctx, _cache) => {
|
|
327
|
+
return (_openBlock(), _createBlock(_unref(Form), {
|
|
328
|
+
model: termsData,
|
|
329
|
+
onFinish: searchSubmit
|
|
330
|
+
}, {
|
|
331
|
+
default: _withCtx(() => [
|
|
332
|
+
_createElementVNode("div", {
|
|
333
|
+
ref_key: "searchRef",
|
|
334
|
+
ref: searchRef,
|
|
335
|
+
class: _normalizeClass(['JSearch-warp', 'senior', props.class]),
|
|
336
|
+
style: _normalizeStyle(__props.style)
|
|
337
|
+
}, [
|
|
338
|
+
_createCommentVNode(" 高级模式 "),
|
|
339
|
+
(props.type === 'advanced')
|
|
340
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
341
|
+
key: 0,
|
|
342
|
+
ref_key: "searchRefContentRef",
|
|
343
|
+
ref: searchRefContentRef,
|
|
344
|
+
class: _normalizeClass([
|
|
345
|
+
'JSearch-content',
|
|
346
|
+
expand.value || compatible.value ? 'senior-expand' : 'pack-up',
|
|
347
|
+
screenSize.value ? 'big' : 'small',
|
|
348
|
+
])
|
|
349
|
+
}, [
|
|
350
|
+
_createElementVNode("div", {
|
|
351
|
+
class: _normalizeClass([
|
|
352
|
+
'JSearch-items',
|
|
353
|
+
expand.value ? 'items-expand' : '',
|
|
354
|
+
layout.value,
|
|
355
|
+
])
|
|
356
|
+
}, [
|
|
357
|
+
_createElementVNode("div", _hoisted_1, [
|
|
358
|
+
_createElementVNode("div", _hoisted_2, [
|
|
359
|
+
_createVNode(SearchItem, {
|
|
360
|
+
expand: expand.value,
|
|
361
|
+
index: 1,
|
|
362
|
+
columns: searchItems.value,
|
|
363
|
+
"terms-item": termsData.terms[0].terms[0],
|
|
364
|
+
reset: resetNumber.value,
|
|
365
|
+
onChange: _cache[0] || (_cache[0] = (v) => itemValueChange(v, 1))
|
|
366
|
+
}, null, 8 /* PROPS */, ["expand", "columns", "terms-item", "reset"]),
|
|
367
|
+
(expand.value)
|
|
368
|
+
? (_openBlock(), _createBlock(SearchItem, {
|
|
369
|
+
key: 0,
|
|
370
|
+
expand: expand.value,
|
|
371
|
+
index: 2,
|
|
372
|
+
columns: searchItems.value,
|
|
373
|
+
"terms-item": termsData.terms[0].terms[1],
|
|
374
|
+
reset: resetNumber.value,
|
|
375
|
+
onChange: _cache[1] || (_cache[1] = (v) => itemValueChange(v, 2))
|
|
376
|
+
}, null, 8 /* PROPS */, ["expand", "columns", "terms-item", "reset"]))
|
|
377
|
+
: _createCommentVNode("v-if", true),
|
|
378
|
+
(expand.value)
|
|
379
|
+
? (_openBlock(), _createBlock(SearchItem, {
|
|
380
|
+
key: 1,
|
|
381
|
+
expand: expand.value,
|
|
382
|
+
index: 3,
|
|
383
|
+
columns: searchItems.value,
|
|
384
|
+
"terms-item": termsData.terms[0].terms[2],
|
|
385
|
+
reset: resetNumber.value,
|
|
386
|
+
onChange: _cache[2] || (_cache[2] = (v) => itemValueChange(v, 3))
|
|
387
|
+
}, null, 8 /* PROPS */, ["expand", "columns", "terms-item", "reset"]))
|
|
388
|
+
: _createCommentVNode("v-if", true)
|
|
389
|
+
])
|
|
390
|
+
]),
|
|
391
|
+
(expand.value)
|
|
392
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_3, [
|
|
393
|
+
_createVNode(_unref(Select), {
|
|
394
|
+
value: termsData.terms[1].type,
|
|
395
|
+
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => ((termsData.terms[1].type) = $event)),
|
|
396
|
+
class: "center-select",
|
|
397
|
+
style: { "width": "100px" },
|
|
398
|
+
options: _unref(typeOptions)
|
|
399
|
+
}, null, 8 /* PROPS */, ["value", "options"])
|
|
400
|
+
]))
|
|
401
|
+
: _createCommentVNode("v-if", true),
|
|
402
|
+
(expand.value)
|
|
403
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_4, [
|
|
404
|
+
_createElementVNode("div", _hoisted_5, [
|
|
405
|
+
(_openBlock(), _createElementBlock(_Fragment, null, _renderList([4, 5, 6], (item) => {
|
|
406
|
+
return _createVNode(SearchItem, {
|
|
407
|
+
key: `search_item_${item}`,
|
|
408
|
+
expand: expand.value,
|
|
409
|
+
index: item,
|
|
410
|
+
columns: searchItems.value,
|
|
411
|
+
"terms-item": termsData.terms[1].terms[item - 4],
|
|
412
|
+
reset: resetNumber.value,
|
|
413
|
+
onChange: (v) => itemValueChange(v, item)
|
|
414
|
+
}, null, 8 /* PROPS */, ["expand", "index", "columns", "terms-item", "reset", "onChange"]);
|
|
415
|
+
}), 64 /* STABLE_FRAGMENT */))
|
|
416
|
+
])
|
|
417
|
+
]))
|
|
418
|
+
: _createCommentVNode("v-if", true)
|
|
419
|
+
], 2 /* CLASS */),
|
|
420
|
+
_createElementVNode("div", {
|
|
421
|
+
class: _normalizeClass([
|
|
422
|
+
'JSearch-footer',
|
|
423
|
+
expand.value || compatible.value ? 'expand' : '',
|
|
424
|
+
])
|
|
425
|
+
}, [
|
|
426
|
+
_createElementVNode("div", _hoisted_6, [
|
|
427
|
+
_createVNode(_unref(Button), {
|
|
428
|
+
type: "stroke",
|
|
429
|
+
onClick: reset
|
|
430
|
+
}, {
|
|
431
|
+
default: _withCtx(() => [
|
|
432
|
+
_createTextVNode(" 重置")
|
|
433
|
+
]),
|
|
434
|
+
_: 1 /* STABLE */
|
|
435
|
+
}),
|
|
436
|
+
_createVNode(SaveHistory, {
|
|
437
|
+
terms: termsData,
|
|
438
|
+
target: _unref(target),
|
|
439
|
+
request: __props.request
|
|
440
|
+
}, null, 8 /* PROPS */, ["terms", "target", "request"]),
|
|
441
|
+
_createVNode(History, {
|
|
442
|
+
target: _unref(target),
|
|
443
|
+
request: __props.historyRequest,
|
|
444
|
+
"delete-request": __props.deleteRequest,
|
|
445
|
+
"delete-key": __props.deleteKey,
|
|
446
|
+
onClick: searchSubmit,
|
|
447
|
+
onItemClick: historyItemClick
|
|
448
|
+
}, null, 8 /* PROPS */, ["target", "request", "delete-request", "delete-key"])
|
|
449
|
+
]),
|
|
450
|
+
_createVNode(_unref(Button), {
|
|
451
|
+
type: "link",
|
|
452
|
+
class: "more-btn",
|
|
453
|
+
onClick: expandChange
|
|
454
|
+
}, {
|
|
455
|
+
default: _withCtx(() => [
|
|
456
|
+
_hoisted_7,
|
|
457
|
+
_createVNode(_unref(AIcon), {
|
|
458
|
+
type: "DoubleRightOutlined",
|
|
459
|
+
class: _normalizeClass([
|
|
460
|
+
'more-icon',
|
|
461
|
+
expand.value ? 'more-up' : 'more-down',
|
|
462
|
+
])
|
|
463
|
+
}, null, 8 /* PROPS */, ["class"])
|
|
464
|
+
]),
|
|
465
|
+
_: 1 /* STABLE */
|
|
466
|
+
})
|
|
467
|
+
], 2 /* CLASS */)
|
|
468
|
+
], 2 /* CLASS */))
|
|
469
|
+
: (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [
|
|
470
|
+
_createCommentVNode(" 简单模式 "),
|
|
471
|
+
_createElementVNode("div", _hoisted_8, [
|
|
472
|
+
_createElementVNode("div", _hoisted_9, [
|
|
473
|
+
_createElementVNode("div", _hoisted_10, [
|
|
474
|
+
_createVNode(SearchItem, {
|
|
475
|
+
expand: false,
|
|
476
|
+
index: 1,
|
|
477
|
+
columns: searchItems.value,
|
|
478
|
+
"terms-item": termsData.terms[0].terms[0],
|
|
479
|
+
reset: resetNumber.value,
|
|
480
|
+
onChange: _cache[4] || (_cache[4] = (v) => itemValueChange(v, 1))
|
|
481
|
+
}, null, 8 /* PROPS */, ["columns", "terms-item", "reset"])
|
|
482
|
+
])
|
|
483
|
+
]),
|
|
484
|
+
_createElementVNode("div", _hoisted_11, [
|
|
485
|
+
_createElementVNode("div", _hoisted_12, [
|
|
486
|
+
_createVNode(_unref(FormItemRest), null, {
|
|
487
|
+
default: _withCtx(() => [
|
|
488
|
+
_createVNode(_unref(Button), {
|
|
489
|
+
type: "stroke",
|
|
490
|
+
onClick: reset
|
|
491
|
+
}, {
|
|
492
|
+
default: _withCtx(() => [
|
|
493
|
+
_createTextVNode(" 重置 ")
|
|
494
|
+
]),
|
|
495
|
+
_: 1 /* STABLE */
|
|
496
|
+
}),
|
|
497
|
+
_createVNode(_unref(Button), {
|
|
498
|
+
"html-type": "submit",
|
|
499
|
+
type: "primary"
|
|
500
|
+
}, {
|
|
501
|
+
default: _withCtx(() => [
|
|
502
|
+
_createTextVNode(" 搜索 ")
|
|
503
|
+
]),
|
|
504
|
+
_: 1 /* STABLE */
|
|
505
|
+
})
|
|
506
|
+
]),
|
|
507
|
+
_: 1 /* STABLE */
|
|
508
|
+
})
|
|
509
|
+
])
|
|
510
|
+
])
|
|
511
|
+
])
|
|
512
|
+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
|
|
513
|
+
], 6 /* CLASS, STYLE */)
|
|
514
|
+
]),
|
|
515
|
+
_: 1 /* STABLE */
|
|
516
|
+
}, 8 /* PROPS */, ["model"]));
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
export default __sfc_main__;
|