@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.
Files changed (237) hide show
  1. package/es/AMap/Map.js +124 -0
  2. package/es/AMap/index.js +2 -0
  3. package/es/AMap/util.js +56 -0
  4. package/es/BadgeStatus/Badge.js +54 -0
  5. package/es/BadgeStatus/color.js +21 -0
  6. package/es/BadgeStatus/index.js +3 -0
  7. package/es/CardSelect/CardSelect.js +123 -0
  8. package/es/CardSelect/index.js +2 -0
  9. package/es/CheckButton/CheckButton.js +121 -0
  10. package/es/CheckButton/index.js +2 -0
  11. package/es/ConfigProvider/context.js +12 -0
  12. package/es/ConfigProvider/index.js +31 -0
  13. package/es/Echarts/Echarts.js +47 -0
  14. package/es/Echarts/index.js +2 -0
  15. package/es/Ellipsis/Ellipsis.js +189 -0
  16. package/es/Ellipsis/index.js +2 -0
  17. package/es/Empty/Empty.js +56 -0
  18. package/es/Empty/image.js +2 -0
  19. package/es/Empty/index.js +2 -0
  20. package/es/FullPage/FullPage.js +31 -0
  21. package/es/FullPage/index.js +2 -0
  22. package/es/Icon/icon.js +42 -0
  23. package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
  24. package/es/MonacoEditor/Monaco.js +238 -0
  25. package/es/MonacoEditor/index.js +2 -0
  26. package/es/PermissionButton/index.js +117 -0
  27. package/es/ProLayout/Basic/BasicLayout.js +259 -0
  28. package/es/ProLayout/Basic/Header.js +97 -0
  29. package/es/ProLayout/PageContainer/index.js +324 -0
  30. package/es/ProLayout/PageContainer/typings.js +1 -0
  31. package/es/ProLayout/RouteContext.js +22 -0
  32. package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
  33. package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
  34. package/es/ProLayout/SiderMenu/index.js +2 -0
  35. package/es/ProLayout/SiderMenu/typings.js +1 -0
  36. package/es/ProLayout/TopHeader/index.js +163 -0
  37. package/es/ProLayout/defaultSettings.js +66 -0
  38. package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
  39. package/{src → es}/ProLayout/style/default.less +4 -4
  40. package/es/ProLayout/style/index.js +1 -0
  41. package/es/ProLayout/typings.js +1 -0
  42. package/es/ProLayout/util.js +61 -0
  43. package/es/ProTable/index.js +411 -0
  44. package/es/ProTable/proTableTypes.js +11 -0
  45. package/es/ProTable/style/index.css +65 -0
  46. package/es/ProTable/style/index.js +1 -0
  47. package/es/Scrollbar/Bar.js +114 -0
  48. package/es/Scrollbar/Scrollbar.js +212 -0
  49. package/es/Scrollbar/Thumb.js +189 -0
  50. package/es/Scrollbar/constants.js +1 -0
  51. package/es/Scrollbar/index.js +2 -0
  52. package/es/Scrollbar/scrollbarProps.js +100 -0
  53. package/es/Scrollbar/thumbProps.js +10 -0
  54. package/es/Scrollbar/util.js +30 -0
  55. package/es/Search/Advanced/History.js +183 -0
  56. package/es/Search/Advanced/SaveHistory.js +153 -0
  57. package/es/Search/Advanced/index.js +520 -0
  58. package/es/Search/Item.js +497 -0
  59. package/es/Search/Search.js +249 -0
  60. package/es/Search/hooks/index.js +1 -0
  61. package/es/Search/hooks/useSearchItems.js +40 -0
  62. package/es/Search/index.js +4 -0
  63. package/es/Search/setting.js +91 -0
  64. package/es/Search/style/Item.less +33 -0
  65. package/es/Search/style/Search.less +179 -0
  66. package/es/Search/style/index.js +2 -0
  67. package/es/Search/typing.js +1 -0
  68. package/es/Search/util.js +234 -0
  69. package/es/ValueItem/ValueItem.js +233 -0
  70. package/es/ValueItem/index.js +2 -0
  71. package/es/ValueItem/util.js +16 -0
  72. package/es/index.js +24 -0
  73. package/es/style/index.js +3 -0
  74. package/es/style/variable.css +0 -0
  75. package/{src → es}/style/variable.less +0 -2
  76. package/es/style.js +3 -0
  77. package/lib/AMap/Map.js +124 -0
  78. package/lib/AMap/index.js +9 -0
  79. package/lib/AMap/util.js +62 -0
  80. package/lib/BadgeStatus/Badge.js +54 -0
  81. package/lib/BadgeStatus/color.js +27 -0
  82. package/lib/BadgeStatus/index.js +22 -0
  83. package/lib/CardSelect/CardSelect.js +123 -0
  84. package/lib/CardSelect/index.js +9 -0
  85. package/lib/CheckButton/CheckButton.js +121 -0
  86. package/lib/CheckButton/index.js +9 -0
  87. package/lib/ConfigProvider/context.js +19 -0
  88. package/lib/ConfigProvider/index.js +37 -0
  89. package/lib/Echarts/Echarts.js +47 -0
  90. package/lib/Echarts/index.js +9 -0
  91. package/lib/Ellipsis/Ellipsis.js +189 -0
  92. package/lib/Ellipsis/index.js +9 -0
  93. package/lib/Empty/Empty.js +56 -0
  94. package/lib/Empty/image.js +8 -0
  95. package/lib/Empty/index.js +9 -0
  96. package/lib/FullPage/FullPage.js +31 -0
  97. package/lib/FullPage/index.js +9 -0
  98. package/lib/Icon/icon.js +52 -0
  99. package/lib/Icon/index.js +9 -0
  100. package/lib/MonacoEditor/Monaco.js +238 -0
  101. package/lib/MonacoEditor/index.js +9 -0
  102. package/lib/PermissionButton/index.js +124 -0
  103. package/lib/ProLayout/Basic/BasicLayout.js +268 -0
  104. package/lib/ProLayout/Basic/BasicLayout.less +66 -0
  105. package/lib/ProLayout/Basic/Header.js +103 -0
  106. package/lib/ProLayout/Basic/Header.less +8 -0
  107. package/lib/ProLayout/PageContainer/index.js +327 -0
  108. package/lib/ProLayout/PageContainer/index.less +103 -0
  109. package/lib/ProLayout/PageContainer/typings.js +5 -0
  110. package/lib/ProLayout/RouteContext.js +28 -0
  111. package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
  112. package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
  113. package/lib/ProLayout/SiderMenu/index.js +20 -0
  114. package/lib/ProLayout/SiderMenu/index.less +212 -0
  115. package/lib/ProLayout/SiderMenu/typings.js +5 -0
  116. package/lib/ProLayout/TopHeader/index.js +168 -0
  117. package/lib/ProLayout/TopHeader/index.less +174 -0
  118. package/lib/ProLayout/defaultSettings.js +72 -0
  119. package/lib/ProLayout/index.js +16 -0
  120. package/lib/ProLayout/style/default.less +4 -0
  121. package/lib/ProLayout/style/index.js +3 -0
  122. package/lib/ProLayout/style/style.less +7 -0
  123. package/lib/ProLayout/typings.js +5 -0
  124. package/lib/ProLayout/util.js +72 -0
  125. package/lib/ProTable/index.js +417 -0
  126. package/lib/ProTable/proTableTypes.js +17 -0
  127. package/lib/ProTable/style/index.css +65 -0
  128. package/lib/ProTable/style/index.js +3 -0
  129. package/lib/ProTable/style/index.less +92 -0
  130. package/lib/Scrollbar/Bar.js +114 -0
  131. package/lib/Scrollbar/Scrollbar.js +212 -0
  132. package/lib/Scrollbar/Thumb.js +189 -0
  133. package/lib/Scrollbar/constants.js +7 -0
  134. package/lib/Scrollbar/index.js +9 -0
  135. package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
  136. package/lib/Scrollbar/thumbProps.js +16 -0
  137. package/lib/Scrollbar/util.js +37 -0
  138. package/lib/Search/Advanced/History.js +183 -0
  139. package/lib/Search/Advanced/SaveHistory.js +153 -0
  140. package/lib/Search/Advanced/index.js +520 -0
  141. package/lib/Search/Item.js +497 -0
  142. package/lib/Search/Search.js +249 -0
  143. package/lib/Search/hooks/index.js +16 -0
  144. package/lib/Search/hooks/useSearchItems.js +47 -0
  145. package/lib/Search/index.js +16 -0
  146. package/lib/Search/setting.js +97 -0
  147. package/lib/Search/style/Item.less +33 -0
  148. package/lib/Search/style/Search.less +179 -0
  149. package/lib/Search/style/index.js +4 -0
  150. package/lib/Search/typing.js +5 -0
  151. package/lib/Search/util.js +241 -0
  152. package/lib/ValueItem/ValueItem.js +233 -0
  153. package/lib/ValueItem/index.js +9 -0
  154. package/lib/ValueItem/util.js +22 -0
  155. package/lib/index.js +158 -0
  156. package/lib/style/components.less +1 -0
  157. package/lib/style/index.js +4 -0
  158. package/lib/style/variable.css +0 -0
  159. package/lib/style/variable.less +2 -0
  160. package/lib/style.js +5 -0
  161. package/package.json +122 -13
  162. package/index.ts +0 -64
  163. package/src/AMap/Map.vue +0 -110
  164. package/src/AMap/index.ts +0 -1
  165. package/src/AMap/util.ts +0 -56
  166. package/src/BadgeStatus/Badge.vue +0 -41
  167. package/src/BadgeStatus/color.ts +0 -25
  168. package/src/BadgeStatus/index.ts +0 -4
  169. package/src/CardSelect/CardSelect.vue +0 -136
  170. package/src/CardSelect/index.ts +0 -3
  171. package/src/CheckButton/CheckButton.vue +0 -146
  172. package/src/CheckButton/index.md +0 -27
  173. package/src/CheckButton/index.ts +0 -3
  174. package/src/ConfigProvider/context.ts +0 -17
  175. package/src/ConfigProvider/index.tsx +0 -42
  176. package/src/Echarts/Echarts.vue +0 -43
  177. package/src/Echarts/index.ts +0 -3
  178. package/src/Ellipsis/Ellipsis.vue +0 -182
  179. package/src/Ellipsis/index.ts +0 -3
  180. package/src/Empty/Empty.vue +0 -43
  181. package/src/Empty/image.ts +0 -3
  182. package/src/Empty/index.ts +0 -2
  183. package/src/FullPage/FullPage.vue +0 -30
  184. package/src/FullPage/index.ts +0 -3
  185. package/src/Icon/icon.tsx +0 -40
  186. package/src/MonacoEditor/Monaco.vue +0 -242
  187. package/src/MonacoEditor/index.md +0 -26
  188. package/src/MonacoEditor/index.ts +0 -2
  189. package/src/PermissionButton/index.tsx +0 -110
  190. package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
  191. package/src/ProLayout/Basic/Header.tsx +0 -115
  192. package/src/ProLayout/PageContainer/index.tsx +0 -441
  193. package/src/ProLayout/PageContainer/typings.ts +0 -56
  194. package/src/ProLayout/RouteContext.ts +0 -87
  195. package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
  196. package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
  197. package/src/ProLayout/SiderMenu/index.ts +0 -2
  198. package/src/ProLayout/SiderMenu/typings.ts +0 -49
  199. package/src/ProLayout/TopHeader/index.tsx +0 -210
  200. package/src/ProLayout/defaultSettings.ts +0 -106
  201. package/src/ProLayout/style/index.ts +0 -1
  202. package/src/ProLayout/typings.ts +0 -87
  203. package/src/ProLayout/util.ts +0 -64
  204. package/src/ProTable/index.md +0 -53
  205. package/src/ProTable/index.tsx +0 -551
  206. package/src/ProTable/proTableTypes.ts +0 -70
  207. package/src/ProTable/style/index.ts +0 -1
  208. package/src/Scrollbar/Bar.vue +0 -75
  209. package/src/Scrollbar/Scrollbar.vue +0 -260
  210. package/src/Scrollbar/Thumb.vue +0 -163
  211. package/src/Scrollbar/constants.ts +0 -10
  212. package/src/Scrollbar/index.ts +0 -4
  213. package/src/Scrollbar/thumb.ts +0 -16
  214. package/src/Scrollbar/util.ts +0 -38
  215. package/src/Search/Advanced/History.vue +0 -140
  216. package/src/Search/Advanced/SaveHistory.vue +0 -108
  217. package/src/Search/Advanced/index.vue +0 -435
  218. package/src/Search/Item.vue +0 -525
  219. package/src/Search/Search.vue +0 -398
  220. package/src/Search/hooks/index.ts +0 -1
  221. package/src/Search/hooks/useSearchItems.ts +0 -68
  222. package/src/Search/index.md +0 -57
  223. package/src/Search/index.ts +0 -5
  224. package/src/Search/setting.ts +0 -55
  225. package/src/Search/typing.ts +0 -76
  226. package/src/Search/util.ts +0 -263
  227. package/src/ValueItem/ValueItem.vue +0 -192
  228. package/src/ValueItem/index.ts +0 -3
  229. package/src/ValueItem/util.ts +0 -16
  230. package/src/style/index.ts +0 -3
  231. /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
  232. /package/{src → es}/ProLayout/Basic/Header.less +0 -0
  233. /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
  234. /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
  235. /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
  236. /package/{src → es}/ProLayout/style/style.less +0 -0
  237. /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-1712546547908"), 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,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _useSearchItems = require("./useSearchItems");
7
+ Object.keys(_useSearchItems).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _useSearchItems[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _useSearchItems[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useSearchItems = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _vue = require("vue");
10
+ var _lodashEs = require("lodash");
11
+ var hasDefaultValue = function hasDefaultValue(item) {
12
+ return item.defaultValue !== undefined || item.defaultTermType || item.defaultOnceValue;
13
+ };
14
+ var useSearchItems = exports.useSearchItems = function useSearchItems(columns, options) {
15
+ var items = (0, _vue.ref)([]);
16
+ var optionsMap = (0, _vue.ref)(new Map());
17
+ var handleColumns = function handleColumns() {
18
+ var _items = [];
19
+ var values = [];
20
+ columns.forEach(function (item, index) {
21
+ var search = item.search;
22
+ if (search && Object.keys(search).length) {
23
+ optionsMap.value.set(item.dataIndex, search);
24
+ if (hasDefaultValue(search)) {
25
+ var _value = search.defaultValue || search.defaultOnceValue;
26
+ values.push({
27
+ type: 'and',
28
+ value: _value,
29
+ termType: search.defaultTermType || 'like',
30
+ column: item.dataIndex
31
+ });
32
+ }
33
+ _items.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, item.search), {}, {
34
+ sortIndex: item.search.first ? 0 : index + 1,
35
+ column: item.dataIndex
36
+ }));
37
+ }
38
+ });
39
+ items.value = (0, _lodashEs.sortBy)(_items, 'sortIndex');
40
+ options === null || options === void 0 ? void 0 : options.getDefaultValue(values);
41
+ };
42
+ handleColumns();
43
+ return {
44
+ searchItems: items,
45
+ searchOptionsMap: optionsMap
46
+ };
47
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "AdvancedSearch", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _index.default;
11
+ }
12
+ });
13
+ exports.default = void 0;
14
+ var _index = _interopRequireDefault(require("./Advanced/index.js"));
15
+ var _Search = _interopRequireDefault(require("./Search.js"));
16
+ var _default = exports.default = _Search.default;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.typeOptions = exports.termType = exports.optionsMapKey = exports.componentType = exports.basicSearch = exports.TermTypeMap = void 0;
7
+ require("vue");
8
+ require("./typing");
9
+ var optionsMapKey = exports.optionsMapKey = Symbol('searchOptionsMap');
10
+ var basicSearch = exports.basicSearch = {
11
+ columns: {
12
+ type: Array,
13
+ default: function _default() {
14
+ return [];
15
+ },
16
+ required: true
17
+ },
18
+ type: {
19
+ type: String,
20
+ default: 'advanced'
21
+ }
22
+ };
23
+ var typeOptions = exports.typeOptions = [{
24
+ label: '或者',
25
+ value: 'or'
26
+ }, {
27
+ label: '并且',
28
+ value: 'and'
29
+ }];
30
+ var TermTypeMap = exports.TermTypeMap = {
31
+ EQ: {
32
+ label: '=',
33
+ value: 'eq'
34
+ },
35
+ NOT: {
36
+ label: '!=',
37
+ value: 'not'
38
+ },
39
+ LIKE: {
40
+ label: '包含',
41
+ value: 'like'
42
+ },
43
+ NLIKE: {
44
+ label: '不包含',
45
+ value: 'nlike'
46
+ },
47
+ GT: {
48
+ label: '>',
49
+ value: 'gt'
50
+ },
51
+ GTE: {
52
+ label: '>=',
53
+ value: 'gte'
54
+ },
55
+ LT: {
56
+ label: '<',
57
+ value: 'lt'
58
+ },
59
+ LTE: {
60
+ label: '<=',
61
+ value: 'lte'
62
+ },
63
+ IN: {
64
+ label: '在...之中',
65
+ value: 'in'
66
+ },
67
+ NIN: {
68
+ label: '不在...之中',
69
+ value: 'nin'
70
+ },
71
+ BTW: {
72
+ label: '在...之间',
73
+ value: 'btw'
74
+ },
75
+ NBTW: {
76
+ label: '不在...之间',
77
+ value: 'nbtw'
78
+ }
79
+ };
80
+ var termType = exports.termType = Object.values(TermTypeMap);
81
+ var componentType = exports.componentType = {
82
+ input: 'input',
83
+ inputNumber: 'inputNumber',
84
+ password: 'password',
85
+ switch: 'switch',
86
+ radio: 'radio',
87
+ checkbox: 'checkbox',
88
+ time: 'time',
89
+ date: 'date',
90
+ timeRange: 'timeRange',
91
+ rangePicker: 'rangePicker',
92
+ treeSelect: 'treeSelect',
93
+ upload: 'upload',
94
+ tree: 'tree',
95
+ select: 'select',
96
+ component: 'component'
97
+ };
@@ -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,4 @@
1
+ "use strict";
2
+
3
+ require("./Search.less");
4
+ require("./Item.less");
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });