xrk-components 0.1.0 → 0.3.2

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 (38) hide show
  1. package/.babelrc +2 -11
  2. package/lib/index.css +18560 -0
  3. package/lib/index.esm.js +2958 -0
  4. package/lib/index.umd.js +2997 -0
  5. package/package.json +47 -69
  6. package/rollup.config.js +59 -0
  7. package/tsconfig.json +24 -0
  8. package/typings/shims-vue.d.ts +6 -0
  9. package/.editorconfig +0 -9
  10. package/.eslintrc.js +0 -40
  11. package/.prettierrc.js +0 -16
  12. package/debug.log +0 -1
  13. package/dist/bundler.js +0 -7
  14. package/dist/bundler.js.map +0 -1
  15. package/index.html +0 -19
  16. package/src/App.vue +0 -134
  17. package/src/lib/index.js +0 -27
  18. package/src/main.js +0 -25
  19. package/src/packages/dialog/index.js +0 -32
  20. package/src/packages/dialog/src/main.vue +0 -197
  21. package/src/packages/slide-verify/index.js +0 -12
  22. package/src/packages/slide-verify/src/main.vue +0 -479
  23. package/src/packages/slide-verify/src/static/close.png +0 -0
  24. package/src/packages/slide-verify/src/static/placeholder.png +0 -0
  25. package/src/packages/slide-verify/src/static/range_btn.png +0 -0
  26. package/src/packages/slide-verify/src/static/refresh.png +0 -0
  27. package/src/packages/task-detail/index.js +0 -12
  28. package/src/packages/task-detail/src/components/formDetail.vue +0 -79
  29. package/src/packages/task-detail/src/components/mixin.js +0 -105
  30. package/src/packages/task-detail/src/components/styles/index.scss +0 -162
  31. package/src/packages/task-detail/src/components/surveyDetail.vue +0 -337
  32. package/src/packages/task-detail/src/config/fields.js +0 -655
  33. package/src/packages/task-detail/src/config/index.js +0 -34
  34. package/src/packages/task-detail/src/main.vue +0 -108
  35. package/src/packages/task-detail/src/static/fieldsMap.js +0 -274
  36. package/src/packages/task-detail/src/test/testData.js +0 -743
  37. package/src/packages/task-detail/src/tools/index.js +0 -290
  38. package/webpack.config.js +0 -93
@@ -0,0 +1,2958 @@
1
+ import ElementPlus, { ElButton, ElRadioButton, ElRadioGroup, vLoading, ElRadio, ElCheckboxButton, ElCheckboxGroup, ElCheckbox, ElDatePicker, ElInput, ElTooltip, ElSelect, ElOptionGroup, ElOption, ElSwitch, ElTag, ElPagination, ElForm, ElFormItem, ElTable, ElTableColumn, ElDialog } from 'element-plus';
2
+ import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, renderSlot, withDirectives, createElementBlock, watch, withKeys, normalizeStyle, createElementVNode, isRef, Fragment, renderList, createVNode, toDisplayString, createTextVNode, createCommentVNode, nextTick, shallowRef, reactive, resolveDynamicComponent, mergeProps, createSlots, withModifiers, onMounted, render, h } from 'vue';
3
+ import { check, base } from 'xrk-tools';
4
+
5
+ function getDefaultExportFromCjs (x) {
6
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
+ }
8
+
9
+ var zhCn = {};
10
+
11
+ (function (exports) {
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var zhCn = {
16
+ name: "zh-cn",
17
+ el: {
18
+ colorpicker: {
19
+ confirm: "\u786E\u5B9A",
20
+ clear: "\u6E05\u7A7A"
21
+ },
22
+ datepicker: {
23
+ now: "\u6B64\u523B",
24
+ today: "\u4ECA\u5929",
25
+ cancel: "\u53D6\u6D88",
26
+ clear: "\u6E05\u7A7A",
27
+ confirm: "\u786E\u5B9A",
28
+ selectDate: "\u9009\u62E9\u65E5\u671F",
29
+ selectTime: "\u9009\u62E9\u65F6\u95F4",
30
+ startDate: "\u5F00\u59CB\u65E5\u671F",
31
+ startTime: "\u5F00\u59CB\u65F6\u95F4",
32
+ endDate: "\u7ED3\u675F\u65E5\u671F",
33
+ endTime: "\u7ED3\u675F\u65F6\u95F4",
34
+ prevYear: "\u524D\u4E00\u5E74",
35
+ nextYear: "\u540E\u4E00\u5E74",
36
+ prevMonth: "\u4E0A\u4E2A\u6708",
37
+ nextMonth: "\u4E0B\u4E2A\u6708",
38
+ year: "\u5E74",
39
+ month1: "1 \u6708",
40
+ month2: "2 \u6708",
41
+ month3: "3 \u6708",
42
+ month4: "4 \u6708",
43
+ month5: "5 \u6708",
44
+ month6: "6 \u6708",
45
+ month7: "7 \u6708",
46
+ month8: "8 \u6708",
47
+ month9: "9 \u6708",
48
+ month10: "10 \u6708",
49
+ month11: "11 \u6708",
50
+ month12: "12 \u6708",
51
+ weeks: {
52
+ sun: "\u65E5",
53
+ mon: "\u4E00",
54
+ tue: "\u4E8C",
55
+ wed: "\u4E09",
56
+ thu: "\u56DB",
57
+ fri: "\u4E94",
58
+ sat: "\u516D"
59
+ },
60
+ months: {
61
+ jan: "\u4E00\u6708",
62
+ feb: "\u4E8C\u6708",
63
+ mar: "\u4E09\u6708",
64
+ apr: "\u56DB\u6708",
65
+ may: "\u4E94\u6708",
66
+ jun: "\u516D\u6708",
67
+ jul: "\u4E03\u6708",
68
+ aug: "\u516B\u6708",
69
+ sep: "\u4E5D\u6708",
70
+ oct: "\u5341\u6708",
71
+ nov: "\u5341\u4E00\u6708",
72
+ dec: "\u5341\u4E8C\u6708"
73
+ }
74
+ },
75
+ select: {
76
+ loading: "\u52A0\u8F7D\u4E2D",
77
+ noMatch: "\u65E0\u5339\u914D\u6570\u636E",
78
+ noData: "\u65E0\u6570\u636E",
79
+ placeholder: "\u8BF7\u9009\u62E9"
80
+ },
81
+ cascader: {
82
+ noMatch: "\u65E0\u5339\u914D\u6570\u636E",
83
+ loading: "\u52A0\u8F7D\u4E2D",
84
+ placeholder: "\u8BF7\u9009\u62E9",
85
+ noData: "\u6682\u65E0\u6570\u636E"
86
+ },
87
+ pagination: {
88
+ goto: "\u524D\u5F80",
89
+ pagesize: "\u6761/\u9875",
90
+ total: "\u5171 {total} \u6761",
91
+ pageClassifier: "\u9875",
92
+ deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
93
+ },
94
+ messagebox: {
95
+ title: "\u63D0\u793A",
96
+ confirm: "\u786E\u5B9A",
97
+ cancel: "\u53D6\u6D88",
98
+ error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
99
+ },
100
+ upload: {
101
+ deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
102
+ delete: "\u5220\u9664",
103
+ preview: "\u67E5\u770B\u56FE\u7247",
104
+ continue: "\u7EE7\u7EED\u4E0A\u4F20"
105
+ },
106
+ table: {
107
+ emptyText: "\u6682\u65E0\u6570\u636E",
108
+ confirmFilter: "\u7B5B\u9009",
109
+ resetFilter: "\u91CD\u7F6E",
110
+ clearFilter: "\u5168\u90E8",
111
+ sumText: "\u5408\u8BA1"
112
+ },
113
+ tree: {
114
+ emptyText: "\u6682\u65E0\u6570\u636E"
115
+ },
116
+ transfer: {
117
+ noMatch: "\u65E0\u5339\u914D\u6570\u636E",
118
+ noData: "\u65E0\u6570\u636E",
119
+ titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
120
+ filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
121
+ noCheckedFormat: "\u5171 {total} \u9879",
122
+ hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
123
+ },
124
+ image: {
125
+ error: "\u52A0\u8F7D\u5931\u8D25"
126
+ },
127
+ pageHeader: {
128
+ title: "\u8FD4\u56DE"
129
+ },
130
+ popconfirm: {
131
+ confirmButtonText: "\u786E\u5B9A",
132
+ cancelButtonText: "\u53D6\u6D88"
133
+ }
134
+ }
135
+ };
136
+
137
+ exports["default"] = zhCn;
138
+
139
+ } (zhCn));
140
+
141
+ var locale = /*@__PURE__*/getDefaultExportFromCjs(zhCn);
142
+
143
+ /******************************************************************************
144
+ Copyright (c) Microsoft Corporation.
145
+
146
+ Permission to use, copy, modify, and/or distribute this software for any
147
+ purpose with or without fee is hereby granted.
148
+
149
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
150
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
151
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
152
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
153
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
154
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
155
+ PERFORMANCE OF THIS SOFTWARE.
156
+ ***************************************************************************** */
157
+
158
+ var __assign = function() {
159
+ __assign = Object.assign || function __assign(t) {
160
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
161
+ s = arguments[i];
162
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
163
+ }
164
+ return t;
165
+ };
166
+ return __assign.apply(this, arguments);
167
+ };
168
+
169
+ function __awaiter(thisArg, _arguments, P, generator) {
170
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
171
+ return new (P || (P = Promise))(function (resolve, reject) {
172
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
173
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
174
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
175
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
176
+ });
177
+ }
178
+
179
+ function __generator(thisArg, body) {
180
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
181
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
182
+ function verb(n) { return function (v) { return step([n, v]); }; }
183
+ function step(op) {
184
+ if (f) throw new TypeError("Generator is already executing.");
185
+ while (_) try {
186
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
187
+ if (y = 0, t) op = [op[0] & 2, t.value];
188
+ switch (op[0]) {
189
+ case 0: case 1: t = op; break;
190
+ case 4: _.label++; return { value: op[1], done: false };
191
+ case 5: _.label++; y = op[1]; op = [0]; continue;
192
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
193
+ default:
194
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
195
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
196
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
197
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
198
+ if (t[2]) _.ops.pop();
199
+ _.trys.pop(); continue;
200
+ }
201
+ op = body.call(thisArg, _);
202
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
203
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
204
+ }
205
+ }
206
+
207
+ function __spreadArray(to, from, pack) {
208
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
209
+ if (ar || !(i in from)) {
210
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
211
+ ar[i] = from[i];
212
+ }
213
+ }
214
+ return to.concat(ar || Array.prototype.slice.call(from));
215
+ }
216
+
217
+ var __default__$l = {
218
+ name: 'base-button'
219
+ };
220
+ var script$l = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$l), { props: {
221
+ click: { type: null, required: false },
222
+ loading: { type: Boolean, required: false },
223
+ loadingIcon: { type: null, required: false },
224
+ size: { type: String, required: false, default: 'default' },
225
+ type: { type: String, required: false, default: 'primary' },
226
+ plain: { type: Boolean, required: false },
227
+ round: { type: Boolean, required: false },
228
+ circle: { type: Boolean, required: false },
229
+ disabled: { type: Boolean, required: false },
230
+ autofocus: { type: Boolean, required: false },
231
+ autoInsertSpace: { type: Boolean, required: false },
232
+ nativeType: { type: String, required: false },
233
+ icon: { type: null, required: false }
234
+ }, setup: function (__props) {
235
+ var _this = this;
236
+ var _props = __props;
237
+ var props = _props;
238
+ var _a = (function () {
239
+ var _loading = ref(false);
240
+ var isLoading = computed(function () {
241
+ return props.loading || _loading.value;
242
+ });
243
+ return {
244
+ isLoading: isLoading,
245
+ handleClick: (props.click
246
+ ? function () { return __awaiter(_this, void 0, void 0, function () {
247
+ var error_1;
248
+ var _a;
249
+ return __generator(this, function (_b) {
250
+ switch (_b.label) {
251
+ case 0:
252
+ _loading.value = true;
253
+ _b.label = 1;
254
+ case 1:
255
+ _b.trys.push([1, 3, , 4]);
256
+ return [4 /*yield*/, ((_a = props.click) === null || _a === void 0 ? void 0 : _a.call(props))];
257
+ case 2:
258
+ _b.sent();
259
+ _loading.value = false;
260
+ return [3 /*break*/, 4];
261
+ case 3:
262
+ error_1 = _b.sent();
263
+ console.warn(error_1);
264
+ _loading.value = false;
265
+ return [3 /*break*/, 4];
266
+ case 4: return [2 /*return*/];
267
+ }
268
+ });
269
+ }); }
270
+ : undefined)
271
+ };
272
+ })(), handleClick = _a.handleClick, isLoading = _a.isLoading;
273
+ return function (_ctx, _cache) {
274
+ return (openBlock(), createBlock(unref(ElButton), {
275
+ onClick: unref(handleClick),
276
+ loading: unref(isLoading),
277
+ size: __props.size,
278
+ type: __props.type,
279
+ plain: __props.plain,
280
+ round: __props.round,
281
+ circle: __props.circle,
282
+ disabled: __props.disabled,
283
+ autofocus: __props.autofocus,
284
+ autoInsertSpace: __props.autoInsertSpace,
285
+ nativeType: __props.nativeType,
286
+ loadingIcon: __props.loadingIcon,
287
+ icon: __props.icon
288
+ }, {
289
+ default: withCtx(function () { return [
290
+ renderSlot(_ctx.$slots, "default")
291
+ ]; }),
292
+ _: 3 /* FORWARDED */
293
+ }, 8 /* PROPS */, ["onClick", "loading", "size", "type", "plain", "round", "circle", "disabled", "autofocus", "autoInsertSpace", "nativeType", "loadingIcon", "icon"]));
294
+ };
295
+ } }));
296
+
297
+ script$l.__file = "packages/base/button/button.vue";
298
+
299
+ var BaseButton = script$l;
300
+
301
+ var __default__$k = {
302
+ name: 'base-radio-button'
303
+ };
304
+ var script$k = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$k), { props: {
305
+ modelValue: { type: null, required: false },
306
+ size: { type: String, required: false },
307
+ name: { type: String, required: false },
308
+ label: { type: [String, Number, Boolean], required: false },
309
+ disabled: { type: Boolean, required: false }
310
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
311
+ var emits = _a.emit;
312
+ var handleChange = function (activeValue) {
313
+ emits('update:modelValue', activeValue);
314
+ emits('change', activeValue);
315
+ };
316
+ return function (_ctx, _cache) {
317
+ return (openBlock(), createBlock(unref(ElRadioButton), {
318
+ "model-value": __props.modelValue,
319
+ disabled: __props.disabled,
320
+ name: __props.name,
321
+ label: __props.label,
322
+ size: __props.size,
323
+ onChange: handleChange
324
+ }, {
325
+ default: withCtx(function () { return [
326
+ renderSlot(_ctx.$slots, "default")
327
+ ]; }),
328
+ _: 3 /* FORWARDED */
329
+ }, 8 /* PROPS */, ["model-value", "disabled", "name", "label", "size"]));
330
+ };
331
+ } }));
332
+
333
+ script$k.__file = "packages/base/radio/radio-button.vue";
334
+
335
+ /*
336
+ * @Description:
337
+ * @Date: 2022-07-01 11:46:30
338
+ */
339
+ function isFunction(val) {
340
+ return check.isFunction(val) || check.isAsyncFunction(val);
341
+ }
342
+
343
+ var _hoisted_1$6 = { style: { "display": "inline-block" } };
344
+ var __default__$j = {
345
+ name: 'base-radio-group'
346
+ };
347
+ var script$j = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$j), { props: {
348
+ modelValue: { type: null, required: false },
349
+ size: { type: String, required: false },
350
+ textColor: { type: String, required: false },
351
+ fill: { type: String, required: false },
352
+ disabled: { type: Boolean, required: false },
353
+ checkBefore: { type: Function, required: false }
354
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
355
+ var _this = this;
356
+ var emits = _a.emit;
357
+ var props = __props;
358
+ var vLoading$1 = vLoading;
359
+ var _loading = ref(false);
360
+ var handleChange = function (activeValue) { return __awaiter(_this, void 0, void 0, function () {
361
+ var _a;
362
+ return __generator(this, function (_b) {
363
+ switch (_b.label) {
364
+ case 0:
365
+ if (_loading.value)
366
+ return [2 /*return*/];
367
+ _loading.value = true;
368
+ _b.label = 1;
369
+ case 1:
370
+ _b.trys.push([1, 5, , 6]);
371
+ if (!((((_a = props.modelValue) === null || _a === void 0 ? void 0 : _a.length) || 0) < (activeValue === null || activeValue === void 0 ? void 0 : activeValue.length) &&
372
+ isFunction(props.checkBefore))) return [3 /*break*/, 3];
373
+ return [4 /*yield*/, props.checkBefore(activeValue, function () {
374
+ emits('update:modelValue', activeValue);
375
+ emits('change', activeValue);
376
+ })];
377
+ case 2:
378
+ _b.sent();
379
+ return [3 /*break*/, 4];
380
+ case 3:
381
+ emits('update:modelValue', activeValue);
382
+ emits('change', activeValue);
383
+ _b.label = 4;
384
+ case 4: return [3 /*break*/, 6];
385
+ case 5:
386
+ _b.sent();
387
+ return [3 /*break*/, 6];
388
+ case 6:
389
+ _loading.value = false;
390
+ return [2 /*return*/];
391
+ }
392
+ });
393
+ }); };
394
+ return function (_ctx, _cache) {
395
+ return (openBlock(), createBlock(unref(ElRadioGroup), {
396
+ class: "base-radio-group",
397
+ "model-value": __props.modelValue,
398
+ size: __props.size,
399
+ disabled: __props.disabled,
400
+ "text-color": __props.textColor,
401
+ fill: __props.fill,
402
+ onChange: handleChange
403
+ }, {
404
+ default: withCtx(function () { return [
405
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_1$6, [
406
+ renderSlot(_ctx.$slots, "default")
407
+ ])), [
408
+ [unref(vLoading$1), _loading.value]
409
+ ])
410
+ ]; }),
411
+ _: 3 /* FORWARDED */
412
+ }, 8 /* PROPS */, ["model-value", "size", "disabled", "text-color", "fill"]));
413
+ };
414
+ } }));
415
+
416
+ script$j.__scopeId = "data-v-9d4003c2";
417
+ script$j.__file = "packages/base/radio/radio-group.vue";
418
+
419
+ var __default__$i = {
420
+ name: 'base-radio'
421
+ };
422
+ var script$i = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$i), { props: {
423
+ modelValue: { type: null, required: false },
424
+ size: { type: String, required: false },
425
+ name: { type: String, required: false },
426
+ label: { type: [String, Number, Boolean], required: false },
427
+ disabled: { type: Boolean, required: false },
428
+ border: { type: Boolean, required: false },
429
+ checkBefore: { type: Function, required: false }
430
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
431
+ var _this = this;
432
+ var emits = _a.emit;
433
+ var props = __props;
434
+ var _loading = ref(false);
435
+ var handleChange = function (activeValue) { return __awaiter(_this, void 0, void 0, function () {
436
+ return __generator(this, function (_a) {
437
+ switch (_a.label) {
438
+ case 0:
439
+ if (_loading.value)
440
+ return [2 /*return*/];
441
+ _loading.value = true;
442
+ _a.label = 1;
443
+ case 1:
444
+ _a.trys.push([1, 5, , 6]);
445
+ if (!(activeValue && isFunction(props.checkBefore))) return [3 /*break*/, 3];
446
+ return [4 /*yield*/, props.checkBefore(activeValue, function () {
447
+ emits('update:modelValue', activeValue);
448
+ emits('change', activeValue);
449
+ })];
450
+ case 2:
451
+ _a.sent();
452
+ return [3 /*break*/, 4];
453
+ case 3:
454
+ emits('update:modelValue', activeValue);
455
+ emits('change', activeValue);
456
+ _a.label = 4;
457
+ case 4: return [3 /*break*/, 6];
458
+ case 5:
459
+ _a.sent();
460
+ return [3 /*break*/, 6];
461
+ case 6:
462
+ _loading.value = false;
463
+ return [2 /*return*/];
464
+ }
465
+ });
466
+ }); };
467
+ return function (_ctx, _cache) {
468
+ return (openBlock(), createBlock(unref(ElRadio), {
469
+ class: "base-radio",
470
+ "model-value": __props.modelValue,
471
+ size: __props.size,
472
+ name: __props.name,
473
+ label: __props.label,
474
+ disabled: __props.disabled,
475
+ border: __props.border,
476
+ onChange: handleChange
477
+ }, {
478
+ default: withCtx(function () { return [
479
+ renderSlot(_ctx.$slots, "default")
480
+ ]; }),
481
+ _: 3 /* FORWARDED */
482
+ }, 8 /* PROPS */, ["model-value", "size", "name", "label", "disabled", "border"]));
483
+ };
484
+ } }));
485
+
486
+ script$i.__scopeId = "data-v-56d41f26";
487
+ script$i.__file = "packages/base/radio/radio.vue";
488
+
489
+ var BaseRadioButton = script$k;
490
+ var BaseRadioGroup = script$j;
491
+ var BaseRadio = script$i;
492
+
493
+ var __default__$h = {
494
+ name: 'base-checkbox-button'
495
+ };
496
+ var script$h = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$h), { props: {
497
+ modelValue: { type: [String, Number, Boolean], required: false },
498
+ size: { type: String, required: false },
499
+ name: { type: String, required: false },
500
+ label: { type: [String, Number, Boolean], required: false },
501
+ disabled: { type: Boolean, required: false },
502
+ border: { type: Boolean, required: false },
503
+ trueLabel: { type: [String, Number], required: false },
504
+ falseLabel: { type: [String, Number], required: false },
505
+ checked: { type: Boolean, required: false }
506
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
507
+ var emits = _a.emit;
508
+ var handleChange = function (activeValue) {
509
+ emits('update:modelValue', activeValue);
510
+ emits('change', activeValue);
511
+ };
512
+ return function (_ctx, _cache) {
513
+ return (openBlock(), createBlock(unref(ElCheckboxButton), {
514
+ "model-value": __props.modelValue,
515
+ size: __props.size,
516
+ name: __props.name,
517
+ label: __props.label,
518
+ disabled: __props.disabled,
519
+ border: __props.border,
520
+ "true-label": __props.trueLabel,
521
+ "false-label": __props.falseLabel,
522
+ checked: __props.checked,
523
+ onChange: handleChange
524
+ }, {
525
+ default: withCtx(function () { return [
526
+ renderSlot(_ctx.$slots, "default")
527
+ ]; }),
528
+ _: 3 /* FORWARDED */
529
+ }, 8 /* PROPS */, ["model-value", "size", "name", "label", "disabled", "border", "true-label", "false-label", "checked"]));
530
+ };
531
+ } }));
532
+
533
+ script$h.__file = "packages/base/checkbox/checkbox-button.vue";
534
+
535
+ var _hoisted_1$5 = { style: { "display": "inline-block" } };
536
+ var __default__$g = {
537
+ name: 'base-checkbox-group'
538
+ };
539
+ var script$g = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$g), { props: {
540
+ modelValue: { type: Array, required: false },
541
+ size: { type: String, required: false },
542
+ disabled: { type: Boolean, required: false },
543
+ textColor: { type: String, required: false },
544
+ fill: { type: String, required: false },
545
+ label: { type: String, required: false },
546
+ min: { type: Number, required: false },
547
+ max: { type: Number, required: false },
548
+ checkBefore: { type: Function, required: false }
549
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
550
+ var _this = this;
551
+ var emits = _a.emit;
552
+ var props = __props;
553
+ var vLoading$1 = vLoading;
554
+ var _loading = ref(false);
555
+ var handleChange = function (activeValue) { return __awaiter(_this, void 0, void 0, function () {
556
+ var _a;
557
+ return __generator(this, function (_b) {
558
+ switch (_b.label) {
559
+ case 0:
560
+ if (_loading.value)
561
+ return [2 /*return*/];
562
+ _loading.value = true;
563
+ _b.label = 1;
564
+ case 1:
565
+ _b.trys.push([1, 5, , 6]);
566
+ if (!((((_a = props.modelValue) === null || _a === void 0 ? void 0 : _a.length) || 0) < (activeValue === null || activeValue === void 0 ? void 0 : activeValue.length) &&
567
+ isFunction(props.checkBefore))) return [3 /*break*/, 3];
568
+ return [4 /*yield*/, props.checkBefore(activeValue, function () {
569
+ emits('update:modelValue', activeValue);
570
+ emits('change', activeValue);
571
+ })];
572
+ case 2:
573
+ _b.sent();
574
+ return [3 /*break*/, 4];
575
+ case 3:
576
+ emits('update:modelValue', activeValue);
577
+ emits('change', activeValue);
578
+ _b.label = 4;
579
+ case 4: return [3 /*break*/, 6];
580
+ case 5:
581
+ _b.sent();
582
+ return [3 /*break*/, 6];
583
+ case 6:
584
+ _loading.value = false;
585
+ return [2 /*return*/];
586
+ }
587
+ });
588
+ }); };
589
+ return function (_ctx, _cache) {
590
+ return (openBlock(), createBlock(unref(ElCheckboxGroup), {
591
+ class: "base-checkbox-group",
592
+ "model-value": __props.modelValue,
593
+ size: __props.size,
594
+ disabled: __props.disabled,
595
+ "text-color": __props.textColor,
596
+ fill: __props.fill,
597
+ label: __props.label,
598
+ min: __props.min,
599
+ max: __props.max,
600
+ onChange: handleChange
601
+ }, {
602
+ default: withCtx(function () { return [
603
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_1$5, [
604
+ renderSlot(_ctx.$slots, "default")
605
+ ])), [
606
+ [unref(vLoading$1), _loading.value]
607
+ ])
608
+ ]; }),
609
+ _: 3 /* FORWARDED */
610
+ }, 8 /* PROPS */, ["model-value", "size", "disabled", "text-color", "fill", "label", "min", "max"]));
611
+ };
612
+ } }));
613
+
614
+ script$g.__scopeId = "data-v-1e1f0947";
615
+ script$g.__file = "packages/base/checkbox/checkbox-group.vue";
616
+
617
+ var __default__$f = {
618
+ name: 'base-checkbox'
619
+ };
620
+ var script$f = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$f), { props: {
621
+ modelValue: { type: [String, Number, Boolean], required: false },
622
+ size: { type: String, required: false },
623
+ name: { type: String, required: false },
624
+ label: { type: [String, Number, Boolean], required: false },
625
+ disabled: { type: Boolean, required: false },
626
+ border: { type: Boolean, required: false },
627
+ trueLabel: { type: [String, Number], required: false },
628
+ falseLabel: { type: [String, Number], required: false },
629
+ checked: { type: Boolean, required: false },
630
+ indeterminate: { type: Boolean, required: false },
631
+ checkBefore: { type: Function, required: false }
632
+ }, emits: ["change", "update:modelValue"], setup: function (__props, _a) {
633
+ var _this = this;
634
+ var emits = _a.emit;
635
+ var props = __props;
636
+ var vLoading$1 = vLoading;
637
+ var _loading = ref(false);
638
+ var handleChange = function (activeValue) { return __awaiter(_this, void 0, void 0, function () {
639
+ return __generator(this, function (_a) {
640
+ switch (_a.label) {
641
+ case 0:
642
+ if (_loading.value)
643
+ return [2 /*return*/];
644
+ _loading.value = true;
645
+ _a.label = 1;
646
+ case 1:
647
+ _a.trys.push([1, 5, , 6]);
648
+ if (!(activeValue && isFunction(props.checkBefore))) return [3 /*break*/, 3];
649
+ return [4 /*yield*/, props.checkBefore(activeValue, function () {
650
+ emits('update:modelValue', activeValue);
651
+ emits('change', activeValue);
652
+ })];
653
+ case 2:
654
+ _a.sent();
655
+ return [3 /*break*/, 4];
656
+ case 3:
657
+ emits('update:modelValue', activeValue);
658
+ emits('change', activeValue);
659
+ _a.label = 4;
660
+ case 4: return [3 /*break*/, 6];
661
+ case 5:
662
+ _a.sent();
663
+ return [3 /*break*/, 6];
664
+ case 6:
665
+ _loading.value = false;
666
+ return [2 /*return*/];
667
+ }
668
+ });
669
+ }); };
670
+ return function (_ctx, _cache) {
671
+ return withDirectives((openBlock(), createBlock(unref(ElCheckbox), {
672
+ class: "base-checkbox",
673
+ "model-value": __props.modelValue,
674
+ size: __props.size,
675
+ name: __props.name,
676
+ label: __props.label,
677
+ disabled: __props.disabled,
678
+ border: __props.border,
679
+ "true-label": __props.trueLabel,
680
+ "false-label": __props.falseLabel,
681
+ checked: __props.checked,
682
+ indeterminate: __props.indeterminate,
683
+ onChange: handleChange
684
+ }, {
685
+ default: withCtx(function () { return [
686
+ renderSlot(_ctx.$slots, "default")
687
+ ]; }),
688
+ _: 3 /* FORWARDED */
689
+ }, 8 /* PROPS */, ["model-value", "size", "name", "label", "disabled", "border", "true-label", "false-label", "checked", "indeterminate"])), [
690
+ [unref(vLoading$1), _loading.value]
691
+ ]);
692
+ };
693
+ } }));
694
+
695
+ script$f.__scopeId = "data-v-53a67995";
696
+ script$f.__file = "packages/base/checkbox/checkbox.vue";
697
+
698
+ var BaseCheckboxButton = script$h;
699
+ var BaseCheckboxGroup = script$g;
700
+ var BaseCheckbox = script$f;
701
+
702
+ var __default__$e = {
703
+ name: 'base-date-picker'
704
+ };
705
+ var script$e = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$e), { props: {
706
+ modelValue: { type: null, required: false },
707
+ readonly: { type: Boolean, required: false },
708
+ disabled: { type: Boolean, required: false },
709
+ size: { type: String, required: false },
710
+ editable: { type: Boolean, required: false },
711
+ clearable: { type: Boolean, required: false, default: true },
712
+ placeholder: { type: String, required: false, default: '请选择日期' },
713
+ startPlaceholder: { type: String, required: false, default: '请选择开始日期' },
714
+ endPlaceholder: { type: String, required: false, default: '请选择结束日期' },
715
+ type: { type: String, required: false, default: 'date' },
716
+ format: { type: String, required: false },
717
+ popperClass: { type: String, required: false },
718
+ rangeSeparator: { type: String, required: false },
719
+ defaultValue: { type: null, required: false },
720
+ defaultTime: { type: null, required: false },
721
+ valueFormat: { type: String, required: false },
722
+ unlinkPanels: { type: Boolean, required: false },
723
+ prefixIcon: { type: null, required: false },
724
+ clearIcon: { type: null, required: false },
725
+ validateEvent: { type: Boolean, required: false },
726
+ disabledDate: { type: Function, required: false },
727
+ shortcuts: { type: null, required: false },
728
+ cellClassName: { type: Function, required: false },
729
+ teleported: { type: Boolean, required: false, default: true }
730
+ }, emits: ["change", "visibleChange", "calendarChange", "update:modelValue"], setup: function (__props, _a) {
731
+ var emits = _a.emit;
732
+ var _props = __props;
733
+ var props = _props;
734
+ // 越过类型不匹配导致的ts报错
735
+ var defaultTime = computed(function () { return props.defaultTime; });
736
+ var valueFormat = computed(function () {
737
+ return props.valueFormat ||
738
+ (props.type &&
739
+ (['datetime', 'datetimerange'].includes(props.type)
740
+ ? 'YYYY-MM-DD HH:mm:ss'
741
+ : 'YYYY-MM-DD'));
742
+ });
743
+ var startDt = ref(null);
744
+ var dateValue = ref(props.modelValue);
745
+ // 父组件值发生改变时,同步dateValue
746
+ watch(function () { return props.modelValue; }, function (newV) {
747
+ dateValue.value = newV;
748
+ });
749
+ var _disabledDate = function (date) {
750
+ var _a;
751
+ if (isFunction(props === null || props === void 0 ? void 0 : props.disabledDate)) {
752
+ return (_a = props === null || props === void 0 ? void 0 : props.disabledDate) === null || _a === void 0 ? void 0 : _a.call(props, date, startDt.value);
753
+ }
754
+ };
755
+ var handleChange = function (val) {
756
+ emits('update:modelValue', val);
757
+ emits('change', val);
758
+ };
759
+ var handleVisibleChange = function (visibility) {
760
+ emits('visibleChange', visibility);
761
+ };
762
+ var handleCalendarChange = function (val) {
763
+ startDt.value = val[0];
764
+ emits('calendarChange', val);
765
+ };
766
+ return function (_ctx, _cache) {
767
+ return (openBlock(), createBlock(unref(ElDatePicker), {
768
+ modelValue: dateValue.value,
769
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((dateValue).value = $event); }),
770
+ readonly: __props.readonly,
771
+ disabled: __props.disabled,
772
+ size: __props.size,
773
+ editable: __props.editable,
774
+ clearable: __props.clearable,
775
+ placeholder: __props.placeholder,
776
+ "start-placeholder": __props.startPlaceholder,
777
+ "end-placeholder": __props.endPlaceholder,
778
+ type: __props.type,
779
+ format: __props.format,
780
+ "popper-class": __props.popperClass,
781
+ "range-separator": __props.rangeSeparator,
782
+ "default-value": __props.defaultValue,
783
+ "default-time": unref(defaultTime),
784
+ "value-format": unref(valueFormat),
785
+ "unlink-panels": __props.unlinkPanels,
786
+ "prefix-icon": __props.prefixIcon,
787
+ "clear-icon": __props.clearIcon,
788
+ "validate-event": __props.validateEvent,
789
+ "disabled-date": _disabledDate,
790
+ shortcuts: __props.shortcuts,
791
+ "cell-class-name": __props.cellClassName,
792
+ teleported: __props.teleported,
793
+ onChange: handleChange,
794
+ onVisibleChange: handleVisibleChange,
795
+ onCalendarChange: handleCalendarChange
796
+ }, null, 8 /* PROPS */, ["modelValue", "readonly", "disabled", "size", "editable", "clearable", "placeholder", "start-placeholder", "end-placeholder", "type", "format", "popper-class", "range-separator", "default-value", "default-time", "value-format", "unlink-panels", "prefix-icon", "clear-icon", "validate-event", "shortcuts", "cell-class-name", "teleported"]));
797
+ };
798
+ } }));
799
+
800
+ script$e.__file = "packages/base/date-picker/date-picker.vue";
801
+
802
+ var BaseDatePicker = script$e;
803
+
804
+ var __default__$d = {
805
+ name: 'base-input'
806
+ };
807
+ var script$d = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$d), { props: {
808
+ modelValue: { type: [String, Number], required: false },
809
+ type: { type: String, required: false, default: 'text' },
810
+ maxlength: { type: [String, Number], required: false },
811
+ minlength: { type: [String, Number], required: false },
812
+ showWordLimit: { type: Boolean, required: false },
813
+ placeholder: { type: String, required: false, default: '请输入' },
814
+ clearable: { type: Boolean, required: false },
815
+ formatter: { type: Function, required: false },
816
+ parser: { type: Function, required: false },
817
+ showPassword: { type: Boolean, required: false },
818
+ disabled: { type: Boolean, required: false },
819
+ size: { type: String, required: false },
820
+ prefixIcon: { type: null, required: false },
821
+ suffixIcon: { type: null, required: false },
822
+ rows: { type: Number, required: false, default: 2 },
823
+ autosize: { type: null, required: false },
824
+ autocomplete: { type: String, required: false, default: 'off' },
825
+ name: { type: String, required: false },
826
+ readonly: { type: Boolean, required: false },
827
+ max: { type: Number, required: false },
828
+ min: { type: Number, required: false },
829
+ step: { type: Number, required: false },
830
+ resize: { type: String, required: false },
831
+ autofocus: { type: Boolean, required: false },
832
+ form: { type: String, required: false },
833
+ label: { type: String, required: false },
834
+ tabindex: { type: [String, Number], required: false },
835
+ validateEvent: { type: Boolean, required: false, default: true },
836
+ inputStyle: { type: null, required: false },
837
+ inputRewrite: { type: null, required: false },
838
+ changeRewrite: { type: null, required: false }
839
+ }, emits: ["update:modelValue", "blur", "focus", "keyup", "change", "input", "clear"], setup: function (__props, _a) {
840
+ var _this = this;
841
+ var expose = _a.expose, emits = _a.emit;
842
+ var _props = __props;
843
+ var props = _props;
844
+ var updateValue = function (value) {
845
+ emits('update:modelValue', value); // 更新父级v-model绑定变量的值;
846
+ };
847
+ var handleBlur = function (event) {
848
+ emits('blur', event);
849
+ };
850
+ var handleFocus = function (event) {
851
+ emits('focus', event);
852
+ };
853
+ var handleChange = function (value) { return __awaiter(_this, void 0, void 0, function () {
854
+ var _value, _a;
855
+ var _b;
856
+ return __generator(this, function (_c) {
857
+ switch (_c.label) {
858
+ case 0:
859
+ if (!isFunction(props.changeRewrite)) return [3 /*break*/, 2];
860
+ return [4 /*yield*/, ((_b = props.changeRewrite) === null || _b === void 0 ? void 0 : _b.call(props, value))];
861
+ case 1:
862
+ _a = _c.sent();
863
+ return [3 /*break*/, 3];
864
+ case 2:
865
+ _a = value;
866
+ _c.label = 3;
867
+ case 3:
868
+ _value = (_a);
869
+ updateValue(_value);
870
+ emits('change', _value);
871
+ return [2 /*return*/];
872
+ }
873
+ });
874
+ }); };
875
+ var handleInput = function (value) { return __awaiter(_this, void 0, void 0, function () {
876
+ var _value, _a;
877
+ var _b;
878
+ return __generator(this, function (_c) {
879
+ switch (_c.label) {
880
+ case 0:
881
+ if (!isFunction(props.inputRewrite)) return [3 /*break*/, 2];
882
+ return [4 /*yield*/, ((_b = props.inputRewrite) === null || _b === void 0 ? void 0 : _b.call(props, value))];
883
+ case 1:
884
+ _a = _c.sent();
885
+ return [3 /*break*/, 3];
886
+ case 2:
887
+ _a = value;
888
+ _c.label = 3;
889
+ case 3:
890
+ _value = (_a);
891
+ updateValue(_value);
892
+ emits('input', _value);
893
+ return [2 /*return*/];
894
+ }
895
+ });
896
+ }); };
897
+ var handleClear = function () {
898
+ emits('clear');
899
+ };
900
+ var handleKeyupEnter = function (event) {
901
+ emits('keyup', event);
902
+ };
903
+ var BaseInputRef = ref(null);
904
+ expose({
905
+ focus: function () {
906
+ var _a, _b;
907
+ (_b = (_a = BaseInputRef.value) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
908
+ },
909
+ blur: function () {
910
+ var _a, _b;
911
+ (_b = (_a = BaseInputRef.value) === null || _a === void 0 ? void 0 : _a.blur) === null || _b === void 0 ? void 0 : _b.call(_a);
912
+ },
913
+ select: function () {
914
+ var _a, _b;
915
+ (_b = (_a = BaseInputRef.value) === null || _a === void 0 ? void 0 : _a.select) === null || _b === void 0 ? void 0 : _b.call(_a);
916
+ }
917
+ });
918
+ return function (_ctx, _cache) {
919
+ return (openBlock(), createBlock(unref(ElInput), {
920
+ class: "base-input",
921
+ type: __props.type,
922
+ "model-value": __props.modelValue,
923
+ minlength: __props.minlength,
924
+ maxlength: __props.maxlength,
925
+ "show-word-limit": __props.showWordLimit,
926
+ placeholder: __props.placeholder,
927
+ clearable: __props.clearable,
928
+ formatter: __props.formatter,
929
+ parser: __props.parser,
930
+ "show-password": __props.showPassword,
931
+ disabled: __props.disabled,
932
+ size: __props.size,
933
+ "prefix-icon": __props.prefixIcon,
934
+ "suffix-icon": __props.suffixIcon,
935
+ rows: __props.rows,
936
+ autosize: __props.autosize,
937
+ autocomplete: __props.autocomplete,
938
+ name: __props.name,
939
+ readonly: __props.readonly,
940
+ max: __props.max,
941
+ min: __props.min,
942
+ step: __props.step,
943
+ resize: __props.resize,
944
+ autofocus: __props.autofocus,
945
+ form: __props.form,
946
+ label: __props.label,
947
+ tabindex: __props.tabindex,
948
+ "validate-event": __props.validateEvent,
949
+ "input-style": __props.inputStyle,
950
+ ref_key: "BaseInputRef",
951
+ ref: BaseInputRef,
952
+ onBlur: handleBlur,
953
+ onFocus: handleFocus,
954
+ onInput: handleInput,
955
+ onChange: handleChange,
956
+ onClear: handleClear,
957
+ onKeyup: withKeys(handleKeyupEnter, ["enter"])
958
+ }, null, 8 /* PROPS */, ["type", "model-value", "minlength", "maxlength", "show-word-limit", "placeholder", "clearable", "formatter", "parser", "show-password", "disabled", "size", "prefix-icon", "suffix-icon", "rows", "autosize", "autocomplete", "name", "readonly", "max", "min", "step", "resize", "autofocus", "form", "label", "tabindex", "validate-event", "input-style", "onKeyup"]));
959
+ };
960
+ } }));
961
+
962
+ script$d.__scopeId = "data-v-36a4c1cb";
963
+ script$d.__file = "packages/base/input/input.vue";
964
+
965
+ var BaseInput = script$d;
966
+
967
+ var __default__$c = {
968
+ name: 'base-tool-tip'
969
+ };
970
+ var script$c = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$c), { props: {
971
+ popperClass: { type: String, required: false, default: 'base-tool-tip' },
972
+ trigger: { type: String, required: false },
973
+ transition: { type: String, required: false, default: 'el-fade-in-linear' },
974
+ disabled: { type: Boolean, required: false },
975
+ enterable: { type: Boolean, required: false, default: true },
976
+ hideAfter: { type: Number, required: false, default: 100 },
977
+ placement: { type: String, required: false, default: 'top' },
978
+ content: { type: [String, Number], required: false },
979
+ style: { type: null, required: false },
980
+ overShow: { type: Boolean, required: false, default: false }
981
+ }, setup: function (__props) {
982
+ var props = __props;
983
+ var _overShow = ref(props.overShow);
984
+ var toolTipDefault = ref(null);
985
+ var toolTipDefaultContent = ref(null);
986
+ var _content = computed(function () { return props.content; });
987
+ var handleMouseMove = function () {
988
+ var _a, _b;
989
+ if (((_a = toolTipDefault.value) === null || _a === void 0 ? void 0 : _a.tagName) && ((_b = toolTipDefaultContent.value) === null || _b === void 0 ? void 0 : _b.tagName)) {
990
+ var _c = toolTipDefault.value, offsetWidth = _c.offsetWidth, offsetHeight = _c.offsetHeight;
991
+ var _d = toolTipDefaultContent.value, childOffsetWidth = _d.offsetWidth, childOffsetHeight = _d.offsetHeight;
992
+ _overShow.value = !(offsetWidth < childOffsetWidth || offsetHeight < childOffsetHeight);
993
+ }
994
+ };
995
+ return function (_ctx, _cache) {
996
+ return (openBlock(), createBlock(unref(ElTooltip), {
997
+ key: _overShow.value ? '1' : '0',
998
+ "popper-class": __props.popperClass,
999
+ trigger: __props.trigger,
1000
+ transition: __props.transition,
1001
+ disabled: _overShow.value || __props.disabled,
1002
+ placement: __props.placement,
1003
+ hideAfter: __props.hideAfter,
1004
+ enterable: __props.enterable,
1005
+ content: unref(_content)
1006
+ }, {
1007
+ content: withCtx(function () { return [
1008
+ renderSlot(_ctx.$slots, "content")
1009
+ ]; }),
1010
+ default: withCtx(function () { return [
1011
+ (__props.overShow)
1012
+ ? (openBlock(), createElementBlock("div", {
1013
+ key: 0,
1014
+ style: normalizeStyle([{ "width": "100%" }, __props.style]),
1015
+ onMousemove: handleMouseMove,
1016
+ ref_key: "toolTipDefault",
1017
+ ref: toolTipDefault
1018
+ }, [
1019
+ createElementVNode("span", {
1020
+ ref_key: "toolTipDefaultContent",
1021
+ ref: toolTipDefaultContent
1022
+ }, [
1023
+ renderSlot(_ctx.$slots, "default")
1024
+ ], 512 /* NEED_PATCH */)
1025
+ ], 36 /* STYLE, HYDRATE_EVENTS */))
1026
+ : renderSlot(_ctx.$slots, "default", { key: 1 })
1027
+ ]; }),
1028
+ _: 3 /* FORWARDED */
1029
+ }, 8 /* PROPS */, ["popper-class", "trigger", "transition", "disabled", "placement", "hideAfter", "enterable", "content"]));
1030
+ };
1031
+ } }));
1032
+
1033
+ script$c.__file = "packages/base/tool-tip/tool-tip.vue";
1034
+
1035
+ var BaseToolTip = script$c;
1036
+
1037
+ var __default__$b = {
1038
+ name: 'base-select'
1039
+ };
1040
+ var script$b = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$b), { props: {
1041
+ init: { type: Boolean, required: false, default: false },
1042
+ filterUseRemote: { type: Boolean, required: false, default: false },
1043
+ options: { type: null, required: false },
1044
+ group: { type: Boolean, required: false },
1045
+ labelKey: { type: String, required: false, default: 'label' },
1046
+ valueKey: { type: String, required: false, default: 'value' },
1047
+ optionsKey: { type: String, required: false, default: 'options' },
1048
+ modelValue: { type: null, required: false },
1049
+ multiple: { type: Boolean, required: false },
1050
+ disabled: { type: Boolean, required: false },
1051
+ size: { type: String, required: false },
1052
+ clearable: { type: Boolean, required: false },
1053
+ collapseTags: { type: Boolean, required: false },
1054
+ collapseTagsTooltip: { type: Boolean, required: false },
1055
+ multipleLimit: { type: Number, required: false },
1056
+ placeholder: { type: String, required: false },
1057
+ filterable: { type: Boolean, required: false },
1058
+ allowCreate: { type: Boolean, required: false },
1059
+ fitInputWidth: { type: Boolean, required: false, default: true },
1060
+ filterMethod: { type: Function, required: false },
1061
+ remoteMethod: { type: Function, required: false },
1062
+ loadingText: { type: String, required: false, default: '加载中' },
1063
+ noMatchText: { type: String, required: false, default: '暂无数据' },
1064
+ noDataText: { type: String, required: false, default: '暂无数据' }
1065
+ }, emits: ["update:modelValue", "change", "remove-tag", "visible-change", "clear"], setup: function (__props, _a) {
1066
+ var _this = this;
1067
+ var emits = _a.emit;
1068
+ var _props = __props;
1069
+ var _Reflect = Reflect;
1070
+ var props = _props;
1071
+ var setOptionsData = function (val) { return __awaiter(_this, void 0, void 0, function () {
1072
+ var res, data, error_1;
1073
+ var _a;
1074
+ return __generator(this, function (_b) {
1075
+ switch (_b.label) {
1076
+ case 0:
1077
+ if (!isFunction(props.remoteMethod)) return [3 /*break*/, 4];
1078
+ _b.label = 1;
1079
+ case 1:
1080
+ _b.trys.push([1, 3, , 4]);
1081
+ loading.value = true;
1082
+ return [4 /*yield*/, ((_a = props.remoteMethod) === null || _a === void 0 ? void 0 : _a.call(props, val))];
1083
+ case 2:
1084
+ res = _b.sent();
1085
+ data = check.isObject(res.data)
1086
+ ? Array.isArray(res.data.list)
1087
+ ? res.data.list
1088
+ : []
1089
+ : Array.isArray(res.data)
1090
+ ? res.data
1091
+ : [];
1092
+ loading.value = false;
1093
+ // 避免多次请求接口 接口响应先后顺序不一致导致数据错乱
1094
+ _options.value = Array.isArray(data)
1095
+ ? data.filter(function (i) { return !val || "".concat(i[props.valueKey]).indexOf(val) > -1; })
1096
+ : [];
1097
+ return [3 /*break*/, 4];
1098
+ case 3:
1099
+ error_1 = _b.sent();
1100
+ loading.value = false;
1101
+ console.error(error_1);
1102
+ return [3 /*break*/, 4];
1103
+ case 4: return [2 /*return*/];
1104
+ }
1105
+ });
1106
+ }); };
1107
+ var _filterable = computed(function () { return props.filterable || isFunction(props.remoteMethod); });
1108
+ var debounceSetOptionsData = base.debounce(setOptionsData, 600);
1109
+ var _filterMethod = (props.filterUseRemote
1110
+ ? function (val) {
1111
+ loading.value = true;
1112
+ debounceSetOptionsData(val);
1113
+ }
1114
+ : props.filterMethod);
1115
+ var toolTipDisabled = ref(true);
1116
+ var loading = ref(false);
1117
+ var _options = ref(props.options);
1118
+ var selectValue = ref(props.multiple && props.modelValue && !Array.isArray(props.modelValue)
1119
+ ? [props.modelValue]
1120
+ : props.modelValue);
1121
+ // 父组件值发生改变时,同步selectValue
1122
+ watch(function () { return props.modelValue; }, function (newV) {
1123
+ selectValue.value = newV;
1124
+ });
1125
+ var getSelectOptions = function (options, selectValue) {
1126
+ return options.reduce(function (pre, option) {
1127
+ if (Array.isArray(selectValue)
1128
+ ? selectValue.includes(Reflect.get(option, props.valueKey))
1129
+ : Reflect.get(option, props.valueKey) == selectValue) {
1130
+ pre.push(option);
1131
+ }
1132
+ if (Array.isArray(option.options)) {
1133
+ pre.push.apply(pre, getSelectOptions(option.options, selectValue));
1134
+ }
1135
+ return pre;
1136
+ }, []);
1137
+ };
1138
+ var handleChange = function (value) {
1139
+ emits('update:modelValue', value);
1140
+ emits('change', value, Array.isArray(_options.value) ? getSelectOptions(_options.value, value) : []);
1141
+ };
1142
+ var handleVisibleChange = function (visibleStatus) {
1143
+ toolTipDisabled.value = !visibleStatus;
1144
+ if (visibleStatus) {
1145
+ setOptionsData();
1146
+ }
1147
+ emits('visible-change', visibleStatus);
1148
+ };
1149
+ var handleClear = function () {
1150
+ emits('clear');
1151
+ };
1152
+ var handleRemoveTag = function (value) {
1153
+ emits('remove-tag', value);
1154
+ };
1155
+ if (props.init) {
1156
+ setOptionsData();
1157
+ }
1158
+ return function (_ctx, _cache) {
1159
+ return (openBlock(), createBlock(unref(ElSelect), {
1160
+ modelValue: unref(selectValue),
1161
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return (isRef(selectValue) ? (selectValue).value = $event : null); }),
1162
+ placeholder: __props.placeholder,
1163
+ multiple: __props.multiple,
1164
+ disabled: __props.disabled,
1165
+ size: __props.size,
1166
+ clearable: __props.clearable,
1167
+ collapseTags: __props.collapseTags,
1168
+ collapseTagsTooltip: __props.collapseTagsTooltip,
1169
+ multipleLimit: __props.multipleLimit,
1170
+ filterable: unref(_filterable),
1171
+ allowCreate: __props.allowCreate,
1172
+ filterMethod: unref(_filterMethod),
1173
+ loading: loading.value,
1174
+ remoteMethod: __props.remoteMethod,
1175
+ loadingText: __props.loadingText,
1176
+ noMatchText: __props.noMatchText,
1177
+ noDataText: __props.noDataText,
1178
+ fitInputWidth: __props.fitInputWidth,
1179
+ onChange: handleChange,
1180
+ onVisibleChange: handleVisibleChange,
1181
+ onRemoveTag: handleRemoveTag,
1182
+ onClear: handleClear
1183
+ }, {
1184
+ default: withCtx(function () { return [
1185
+ (__props.group)
1186
+ ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_options.value, function (group) {
1187
+ return (openBlock(), createBlock(unref(ElOptionGroup), {
1188
+ key: unref(_Reflect).get(group, __props.labelKey),
1189
+ label: unref(_Reflect).get(group, __props.labelKey)
1190
+ }, {
1191
+ default: withCtx(function () { return [
1192
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(_Reflect).get(group, __props.optionsKey) || [], function (item) {
1193
+ return (openBlock(), createBlock(unref(ElOption), {
1194
+ class: "option",
1195
+ key: item[__props.valueKey],
1196
+ label: item[__props.labelKey],
1197
+ value: item[__props.valueKey]
1198
+ }, {
1199
+ default: withCtx(function () { return [
1200
+ createVNode(unref(BaseToolTip), {
1201
+ content: item[__props.labelKey],
1202
+ hideAfter: 0,
1203
+ enterable: false,
1204
+ transition: "none",
1205
+ disabled: toolTipDisabled.value,
1206
+ overShow: true
1207
+ }, {
1208
+ default: withCtx(function () { return [
1209
+ createElementVNode("span", null, toDisplayString(item[__props.labelKey]), 1 /* TEXT */)
1210
+ ]; }),
1211
+ _: 2 /* DYNAMIC */
1212
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content", "disabled"])
1213
+ ]; }),
1214
+ _: 2 /* DYNAMIC */
1215
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["label", "value"]));
1216
+ }), 128 /* KEYED_FRAGMENT */))
1217
+ ]; }),
1218
+ _: 2 /* DYNAMIC */
1219
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["label"]));
1220
+ }), 128 /* KEYED_FRAGMENT */))
1221
+ : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_options.value, function (item) {
1222
+ return (openBlock(), createBlock(unref(ElOption), {
1223
+ class: "option",
1224
+ key: unref(_Reflect).get(item, __props.labelKey),
1225
+ label: unref(_Reflect).get(item, __props.labelKey),
1226
+ value: unref(_Reflect).get(item, __props.valueKey)
1227
+ }, {
1228
+ default: withCtx(function () { return [
1229
+ createVNode(unref(BaseToolTip), {
1230
+ content: unref(_Reflect).get(item, __props.labelKey),
1231
+ hideAfter: 0,
1232
+ enterable: false,
1233
+ transition: "none",
1234
+ disabled: toolTipDisabled.value,
1235
+ overShow: true
1236
+ }, {
1237
+ default: withCtx(function () { return [
1238
+ createTextVNode(toDisplayString(unref(_Reflect).get(item, __props.labelKey)), 1 /* TEXT */)
1239
+ ]; }),
1240
+ _: 2 /* DYNAMIC */
1241
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content", "disabled"])
1242
+ ]; }),
1243
+ _: 2 /* DYNAMIC */
1244
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["label", "value"]));
1245
+ }), 128 /* KEYED_FRAGMENT */))
1246
+ ]; }),
1247
+ _: 1 /* STABLE */
1248
+ }, 8 /* PROPS */, ["modelValue", "placeholder", "multiple", "disabled", "size", "clearable", "collapseTags", "collapseTagsTooltip", "multipleLimit", "filterable", "allowCreate", "filterMethod", "loading", "remoteMethod", "loadingText", "noMatchText", "noDataText", "fitInputWidth"]));
1249
+ };
1250
+ } }));
1251
+
1252
+ script$b.__scopeId = "data-v-545bd175";
1253
+ script$b.__file = "packages/base/select/select.vue";
1254
+
1255
+ /*
1256
+ * @Description:
1257
+ * @Date: 2022-06-29 18:18:19
1258
+ */
1259
+ var BaseSelect = script$b;
1260
+
1261
+ var __default__$a = {
1262
+ name: 'base-switch'
1263
+ };
1264
+ var script$a = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$a), { props: {
1265
+ modelValue: { type: [Boolean, String, Number], required: false },
1266
+ disabled: { type: Boolean, required: false },
1267
+ loading: { type: Boolean, required: false },
1268
+ size: { type: String, required: false },
1269
+ width: { type: Number, required: false },
1270
+ activeIcon: { type: null, required: false },
1271
+ activeText: { type: String, required: false },
1272
+ activeValue: { type: [Boolean, String, Number], required: false, default: true },
1273
+ inactiveIcon: { type: null, required: false },
1274
+ inactiveText: { type: String, required: false },
1275
+ inactiveValue: { type: [Boolean, String, Number], required: false, default: false },
1276
+ beforeChange: { type: Function, required: false }
1277
+ }, emits: ["update:modelValue", "change"], setup: function (__props, _a) {
1278
+ var _this = this;
1279
+ var emits = _a.emit;
1280
+ var _props = __props;
1281
+ var props = _props;
1282
+ var _loading = ref(props.loading);
1283
+ var _switchValue = ref(props.modelValue);
1284
+ // 父组件值发生改变时,同步_switchValue
1285
+ watch(function () { return props.modelValue; }, function (newV) {
1286
+ _switchValue.value = newV;
1287
+ });
1288
+ var _beforeChange = (function () { return __awaiter(_this, void 0, void 0, function () {
1289
+ var error_1;
1290
+ var _a;
1291
+ return __generator(this, function (_b) {
1292
+ switch (_b.label) {
1293
+ case 0:
1294
+ _b.trys.push([0, 3, , 4]);
1295
+ _loading.value = true;
1296
+ if (!isFunction(props.beforeChange)) return [3 /*break*/, 2];
1297
+ return [4 /*yield*/, ((_a = props.beforeChange) === null || _a === void 0 ? void 0 : _a.call(props))];
1298
+ case 1:
1299
+ _b.sent();
1300
+ _b.label = 2;
1301
+ case 2:
1302
+ _loading.value = false;
1303
+ return [2 /*return*/, true];
1304
+ case 3:
1305
+ error_1 = _b.sent();
1306
+ console.error('switch change fail', error_1);
1307
+ _loading.value = false;
1308
+ return [2 /*return*/, false];
1309
+ case 4: return [2 /*return*/];
1310
+ }
1311
+ });
1312
+ }); });
1313
+ var handleChange = function (val) {
1314
+ _switchValue.value = val;
1315
+ emits('update:modelValue', val);
1316
+ emits('change', val);
1317
+ };
1318
+ return function (_ctx, _cache) {
1319
+ return (openBlock(), createBlock(unref(ElSwitch), {
1320
+ class: "base-switch",
1321
+ modelValue: _switchValue.value,
1322
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((_switchValue).value = $event); }),
1323
+ disabled: __props.disabled,
1324
+ loading: _loading.value,
1325
+ size: __props.size,
1326
+ width: __props.width,
1327
+ activeIcon: __props.activeIcon,
1328
+ activeText: __props.activeText,
1329
+ activeValue: __props.activeValue,
1330
+ inactiveIcon: __props.inactiveIcon,
1331
+ inactiveText: __props.inactiveText,
1332
+ inactiveValue: __props.inactiveValue,
1333
+ beforeChange: unref(_beforeChange),
1334
+ onChange: handleChange
1335
+ }, null, 8 /* PROPS */, ["modelValue", "disabled", "loading", "size", "width", "activeIcon", "activeText", "activeValue", "inactiveIcon", "inactiveText", "inactiveValue", "beforeChange"]));
1336
+ };
1337
+ } }));
1338
+
1339
+ script$a.__scopeId = "data-v-50b6e275";
1340
+ script$a.__file = "packages/base/switch/switch.vue";
1341
+
1342
+ var BaseSwitch = script$a;
1343
+
1344
+ var __default__$9 = {
1345
+ name: 'base-tag'
1346
+ };
1347
+ var script$9 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$9), { props: {
1348
+ type: { type: String, required: false },
1349
+ closable: { type: Boolean, required: false },
1350
+ disableTransitions: { type: Boolean, required: false },
1351
+ hit: { type: Boolean, required: false },
1352
+ color: { type: String, required: false },
1353
+ size: { type: String, required: false, default: 'large' },
1354
+ effect: { type: String, required: false },
1355
+ round: { type: Boolean, required: false }
1356
+ }, emits: ["click", "close"], setup: function (__props, _a) {
1357
+ var emits = _a.emit;
1358
+ return function (_ctx, _cache) {
1359
+ return (openBlock(), createBlock(unref(ElTag), {
1360
+ type: __props.type,
1361
+ closable: __props.closable,
1362
+ disableTransitions: __props.disableTransitions,
1363
+ hit: __props.hit,
1364
+ color: __props.color,
1365
+ size: __props.size,
1366
+ effect: __props.effect,
1367
+ round: __props.round,
1368
+ onClick: _cache[0] || (_cache[0] = function ($event) { return (emits('click')); }),
1369
+ onClose: _cache[1] || (_cache[1] = function ($event) { return (emits('close')); })
1370
+ }, {
1371
+ default: withCtx(function () { return [
1372
+ renderSlot(_ctx.$slots, "default")
1373
+ ]; }),
1374
+ _: 3 /* FORWARDED */
1375
+ }, 8 /* PROPS */, ["type", "closable", "disableTransitions", "hit", "color", "size", "effect", "round"]));
1376
+ };
1377
+ } }));
1378
+
1379
+ script$9.__file = "packages/base/tag/tag.vue";
1380
+
1381
+ var _hoisted_1$4 = { class: "base-tag-group" };
1382
+ var __default__$8 = {
1383
+ name: 'base-tag-group'
1384
+ };
1385
+ var script$8 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$8), { props: {
1386
+ modelValue: { type: Array, required: false },
1387
+ labelKey: { type: String, required: false, default: 'label' },
1388
+ type: { type: String, required: false },
1389
+ disableTransitions: { type: Boolean, required: false },
1390
+ hit: { type: Boolean, required: false },
1391
+ color: { type: String, required: false },
1392
+ size: { type: String, required: false },
1393
+ effect: { type: String, required: false },
1394
+ round: { type: Boolean, required: false },
1395
+ beforeClose: { type: null, required: false },
1396
+ beforeAdd: { type: Function, required: false },
1397
+ showAdd: { type: Boolean, required: false, default: false },
1398
+ addBtnText: { type: String, required: false, default: '新增' },
1399
+ maxlength: { type: Number, required: false, default: 20 }
1400
+ }, emits: ["update:modelValue", "change", "click"], setup: function (__props, _a) {
1401
+ var _this = this;
1402
+ var emits = _a.emit;
1403
+ var _props = __props;
1404
+ var vLoading$1 = vLoading;
1405
+ var _Reflect = Reflect;
1406
+ var props = _props;
1407
+ var tagsValue = ref(props.modelValue);
1408
+ var closeIndex = ref(-1);
1409
+ var adding = ref(false);
1410
+ var handleTagClose = function (index) { return __awaiter(_this, void 0, void 0, function () {
1411
+ var error_1;
1412
+ var _a, _b, _c;
1413
+ return __generator(this, function (_d) {
1414
+ switch (_d.label) {
1415
+ case 0:
1416
+ if (closeIndex.value > -1)
1417
+ return [2 /*return*/];
1418
+ _d.label = 1;
1419
+ case 1:
1420
+ _d.trys.push([1, 4, , 5]);
1421
+ closeIndex.value = index;
1422
+ if (!isFunction(props.beforeClose)) return [3 /*break*/, 3];
1423
+ return [4 /*yield*/, ((_a = props.beforeClose) === null || _a === void 0 ? void 0 : _a.call(props, (_b = tagsValue.value) === null || _b === void 0 ? void 0 : _b[index]))];
1424
+ case 2:
1425
+ _d.sent();
1426
+ _d.label = 3;
1427
+ case 3:
1428
+ (_c = tagsValue.value) === null || _c === void 0 ? void 0 : _c.splice(index, 1);
1429
+ emits('update:modelValue', tagsValue.value);
1430
+ emits('change', tagsValue.value);
1431
+ closeIndex.value = -1;
1432
+ return [3 /*break*/, 5];
1433
+ case 4:
1434
+ error_1 = _d.sent();
1435
+ console.error(error_1);
1436
+ closeIndex.value = -1;
1437
+ return [3 /*break*/, 5];
1438
+ case 5: return [2 /*return*/];
1439
+ }
1440
+ });
1441
+ }); };
1442
+ var handleTagClick = function (index) {
1443
+ var _a;
1444
+ emits('click', (_a = tagsValue.value) === null || _a === void 0 ? void 0 : _a[index]);
1445
+ };
1446
+ /**
1447
+ * 增加标签逻辑
1448
+ */
1449
+ var InputRef = ref(null);
1450
+ var inputVisible = ref(false);
1451
+ var inputValue = ref('');
1452
+ var showInput = function () {
1453
+ inputVisible.value = true;
1454
+ nextTick(function () {
1455
+ InputRef.value.focus();
1456
+ });
1457
+ };
1458
+ var handleInputConfirm = function () { return __awaiter(_this, void 0, void 0, function () {
1459
+ var _value, _a;
1460
+ var _b, _c;
1461
+ return __generator(this, function (_d) {
1462
+ switch (_d.label) {
1463
+ case 0:
1464
+ if (adding.value) {
1465
+ return [2 /*return*/];
1466
+ }
1467
+ if (check.isFalseValue(inputValue.value)) {
1468
+ inputVisible.value = false;
1469
+ return [2 /*return*/];
1470
+ }
1471
+ _d.label = 1;
1472
+ case 1:
1473
+ _d.trys.push([1, 5, , 6]);
1474
+ adding.value = true;
1475
+ if (!isFunction(props.beforeAdd)) return [3 /*break*/, 3];
1476
+ return [4 /*yield*/, ((_b = props.beforeAdd) === null || _b === void 0 ? void 0 : _b.call(props, inputValue.value))];
1477
+ case 2:
1478
+ _a = _d.sent();
1479
+ return [3 /*break*/, 4];
1480
+ case 3:
1481
+ _a = { label: inputValue.value, value: inputValue.value, closable: true };
1482
+ _d.label = 4;
1483
+ case 4:
1484
+ _value = (_a);
1485
+ (_c = tagsValue.value) === null || _c === void 0 ? void 0 : _c.push(_value);
1486
+ emits('update:modelValue', tagsValue.value);
1487
+ emits('change', tagsValue.value);
1488
+ inputVisible.value = false;
1489
+ adding.value = false;
1490
+ inputValue.value = '';
1491
+ return [3 /*break*/, 6];
1492
+ case 5:
1493
+ _d.sent();
1494
+ adding.value = false;
1495
+ inputVisible.value = false;
1496
+ inputValue.value = '';
1497
+ return [3 /*break*/, 6];
1498
+ case 6: return [2 /*return*/];
1499
+ }
1500
+ });
1501
+ }); };
1502
+ return function (_ctx, _cache) {
1503
+ return (openBlock(), createElementBlock("div", _hoisted_1$4, [
1504
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.modelValue, function (item, index) {
1505
+ return withDirectives((openBlock(), createBlock(script$9, {
1506
+ class: "base-tag",
1507
+ key: index,
1508
+ type: __props.type,
1509
+ closable: item['closable'],
1510
+ disableTransitions: __props.disableTransitions,
1511
+ hit: __props.hit,
1512
+ color: __props.color,
1513
+ size: __props.size,
1514
+ effect: __props.effect,
1515
+ round: __props.round,
1516
+ onClose: function ($event) { return (handleTagClose(index)); },
1517
+ onClick: function ($event) { return (handleTagClick(index)); }
1518
+ }, {
1519
+ default: withCtx(function () { return [
1520
+ createTextVNode(toDisplayString(unref(_Reflect).get(item, __props.labelKey)), 1 /* TEXT */)
1521
+ ]; }),
1522
+ _: 2 /* DYNAMIC */
1523
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["type", "closable", "disableTransitions", "hit", "color", "size", "effect", "round", "onClose", "onClick"])), [
1524
+ [unref(vLoading$1), closeIndex.value == index]
1525
+ ]);
1526
+ }), 128 /* KEYED_FRAGMENT */)),
1527
+ (__props.showAdd)
1528
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1529
+ (inputVisible.value)
1530
+ ? withDirectives((openBlock(), createBlock(unref(BaseInput), {
1531
+ key: 0,
1532
+ class: "base-input",
1533
+ clearable: "",
1534
+ disabled: adding.value,
1535
+ ref_key: "InputRef",
1536
+ ref: InputRef,
1537
+ modelValue: inputValue.value,
1538
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((inputValue).value = $event); }),
1539
+ size: __props.size,
1540
+ maxlength: __props.maxlength,
1541
+ onKeyup: withKeys(handleInputConfirm, ["enter"]),
1542
+ onBlur: handleInputConfirm
1543
+ }, null, 8 /* PROPS */, ["disabled", "modelValue", "size", "maxlength", "onKeyup"])), [
1544
+ [unref(vLoading$1), adding.value]
1545
+ ])
1546
+ : (openBlock(), createBlock(unref(BaseButton), {
1547
+ key: 1,
1548
+ size: __props.size,
1549
+ onClick: showInput,
1550
+ disabled: adding.value
1551
+ }, {
1552
+ default: withCtx(function () { return [
1553
+ createTextVNode(toDisplayString(__props.addBtnText), 1 /* TEXT */)
1554
+ ]; }),
1555
+ _: 1 /* STABLE */
1556
+ }, 8 /* PROPS */, ["size", "disabled"]))
1557
+ ], 64 /* STABLE_FRAGMENT */))
1558
+ : createCommentVNode("v-if", true)
1559
+ ]));
1560
+ };
1561
+ } }));
1562
+
1563
+ script$8.__scopeId = "data-v-eb1feb46";
1564
+ script$8.__file = "packages/base/tag/tag-group.vue";
1565
+
1566
+ var BaseTag = script$9;
1567
+ var BaseTagGroup = script$8;
1568
+
1569
+ var __default__$7 = {
1570
+ name: 'base-pagination'
1571
+ };
1572
+ var script$7 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$7), { props: {
1573
+ small: { type: Boolean, required: false, default: true },
1574
+ currentPage: { type: Number, required: false, default: 1 },
1575
+ pageSize: { type: Number, required: false, default: 15 },
1576
+ total: { type: Number, required: false },
1577
+ pagerCount: { type: Number, required: false, default: 7 },
1578
+ pageSizes: { type: Array, required: false, default: function () { return [15, 60, 100]; } },
1579
+ hideOnSinglePage: { type: Boolean, required: false, default: false },
1580
+ layout: { type: Array, required: false, default: function () { return ['total', 'sizes', 'prev', 'pager', 'next', 'jumper']; } }
1581
+ }, emits: ["size-change", "current-change"], setup: function (__props, _a) {
1582
+ var expose = _a.expose, emits = _a.emit;
1583
+ var props = __props;
1584
+ var _pageSize = ref(props.pageSize);
1585
+ var _currentPage = ref(props.currentPage);
1586
+ var _layout = ref(Array.isArray(props.layout) ? props.layout.join(',') : props.layout);
1587
+ var maxPage = computed(function () { return Math.ceil((props.total || 0) / _pageSize.value); });
1588
+ var setCurrentPage = function (newCurrentPage) {
1589
+ if (!newCurrentPage || newCurrentPage == _currentPage.value)
1590
+ return;
1591
+ if (newCurrentPage > maxPage.value) {
1592
+ // 设置的页码超过最大页码
1593
+ console.warn("currentPage ".concat(newCurrentPage, " \u5927\u4E8E\u6700\u5927\u9875\u7801 ").concat(maxPage.value));
1594
+ }
1595
+ else {
1596
+ _currentPage.value = newCurrentPage;
1597
+ }
1598
+ };
1599
+ var setPageSize = function (newPageSize) {
1600
+ if (!newPageSize || newPageSize == _pageSize.value)
1601
+ return;
1602
+ if (props.pageSizes.includes(newPageSize)) {
1603
+ _pageSize.value = newPageSize;
1604
+ }
1605
+ else {
1606
+ console.warn("pageSize ".concat(newPageSize, " \u4E0D\u5728 pageSizes ").concat(props.pageSizes, " \u4E2D"));
1607
+ }
1608
+ };
1609
+ // watch(
1610
+ // () => [props.currentPage, props.pageSize],
1611
+ // ([newCurrentPage, newPageSize]) => {
1612
+ // if (newCurrentPage > maxPage.value) {
1613
+ // // 设置的页码超过最大页码
1614
+ // emits('update:currentPage', _currentPage.value);
1615
+ // console.warn(
1616
+ // `currentPage ${newCurrentPage} 大于最大页码 ${maxPage.value}`
1617
+ // );
1618
+ // } else {
1619
+ // _currentPage.value = newCurrentPage;
1620
+ // }
1621
+ // if (props.pageSizes.includes(newPageSize)) {
1622
+ // _pageSize.value = newPageSize;
1623
+ // } else {
1624
+ // emits('update:pageSize', _pageSize.value);
1625
+ // console.warn(
1626
+ // `pageSize ${newPageSize} 不在 pageSizes ${props.pageSizes} 中`
1627
+ // );
1628
+ // }
1629
+ // }
1630
+ // );
1631
+ var handleSizeChange = function (pageSize) {
1632
+ _pageSize.value = pageSize;
1633
+ // emits('update:pageSize', pageSize);
1634
+ if (maxPage.value >= _currentPage.value) {
1635
+ // 组件不会再次触发size-change事件,没有这个判断,会导致同事触发size-change 和 size-change
1636
+ emits('size-change', {
1637
+ pageSize: pageSize,
1638
+ currentPage: _currentPage.value
1639
+ });
1640
+ }
1641
+ };
1642
+ var handleCurrenChange = function (currentPage) {
1643
+ _currentPage.value = currentPage;
1644
+ // emits('update:currentPage', currentPage);
1645
+ emits('current-change', {
1646
+ pageSize: _pageSize.value,
1647
+ currentPage: currentPage
1648
+ });
1649
+ };
1650
+ expose({
1651
+ // 父组件调用,修改组件内页面显示,不会触发emits事件。
1652
+ setPageInfo: function (info) {
1653
+ setPageSize(info.pageSize);
1654
+ setCurrentPage(info.currentPage);
1655
+ },
1656
+ getPageInfo: function () { return ({
1657
+ pageSize: _pageSize.value,
1658
+ currentPage: _currentPage.value
1659
+ }); }
1660
+ });
1661
+ return function (_ctx, _cache) {
1662
+ return (openBlock(), createBlock(unref(ElPagination), {
1663
+ class: "base-pagination",
1664
+ small: __props.small,
1665
+ "page-size": _pageSize.value,
1666
+ "current-page": _currentPage.value,
1667
+ layout: _layout.value,
1668
+ total: __props.total,
1669
+ pagerCount: __props.pagerCount,
1670
+ pageSizes: __props.pageSizes,
1671
+ hideOnSinglePage: __props.hideOnSinglePage,
1672
+ onSizeChange: handleSizeChange,
1673
+ onCurrentChange: handleCurrenChange
1674
+ }, null, 8 /* PROPS */, ["small", "page-size", "current-page", "layout", "total", "pagerCount", "pageSizes", "hideOnSinglePage"]));
1675
+ };
1676
+ } }));
1677
+
1678
+ script$7.__scopeId = "data-v-1a7c8335";
1679
+ script$7.__file = "packages/base/pagination/pagination.vue";
1680
+
1681
+ var BasePagination = script$7;
1682
+
1683
+ var __default__$6 = {
1684
+ name: 'base-form'
1685
+ };
1686
+ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6), { props: {
1687
+ model: { type: null, required: true },
1688
+ rules: { type: null, required: false },
1689
+ inline: { type: Boolean, required: false },
1690
+ labelPosition: { type: String, required: false, default: 'left' },
1691
+ labelWidth: { type: [String, Number], required: false, default: 'auto' },
1692
+ labelSuffix: { type: String, required: false },
1693
+ hideRequiredAsterisk: { type: Boolean, required: false },
1694
+ showMessage: { type: Boolean, required: false, default: true },
1695
+ inlineMessage: { type: Boolean, required: false },
1696
+ statusIcon: { type: Boolean, required: false },
1697
+ validateOnRuleChange: { type: Boolean, required: false, default: true },
1698
+ size: { type: String, required: false },
1699
+ disabled: { type: Boolean, required: false }
1700
+ }, setup: function (__props, _a) {
1701
+ var expose = _a.expose;
1702
+ var BaseForm = ref(null);
1703
+ expose({
1704
+ validate: function () {
1705
+ var _a;
1706
+ var args = [];
1707
+ for (var _i = 0; _i < arguments.length; _i++) {
1708
+ args[_i] = arguments[_i];
1709
+ }
1710
+ return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate.apply(_a, args);
1711
+ },
1712
+ validateField: function () {
1713
+ var _a;
1714
+ var args = [];
1715
+ for (var _i = 0; _i < arguments.length; _i++) {
1716
+ args[_i] = arguments[_i];
1717
+ }
1718
+ return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField.apply(_a, args);
1719
+ },
1720
+ resetFields: function () {
1721
+ var _a;
1722
+ var args = [];
1723
+ for (var _i = 0; _i < arguments.length; _i++) {
1724
+ args[_i] = arguments[_i];
1725
+ }
1726
+ return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields.apply(_a, args);
1727
+ },
1728
+ scrollToField: function () {
1729
+ var _a;
1730
+ var args = [];
1731
+ for (var _i = 0; _i < arguments.length; _i++) {
1732
+ args[_i] = arguments[_i];
1733
+ }
1734
+ return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField.apply(_a, args);
1735
+ },
1736
+ clearValidate: function () {
1737
+ var _a;
1738
+ var args = [];
1739
+ for (var _i = 0; _i < arguments.length; _i++) {
1740
+ args[_i] = arguments[_i];
1741
+ }
1742
+ return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate.apply(_a, args);
1743
+ }
1744
+ });
1745
+ return function (_ctx, _cache) {
1746
+ return (openBlock(), createBlock(unref(ElForm), {
1747
+ ref_key: "BaseForm",
1748
+ ref: BaseForm,
1749
+ model: __props.model,
1750
+ rules: __props.rules,
1751
+ inline: __props.inline,
1752
+ labelPosition: __props.labelPosition,
1753
+ labelWidth: __props.labelWidth,
1754
+ labelSuffix: __props.labelSuffix,
1755
+ hideRequiredAsterisk: __props.hideRequiredAsterisk,
1756
+ showMessage: __props.showMessage,
1757
+ inlineMessage: __props.inlineMessage,
1758
+ statusIcon: __props.statusIcon,
1759
+ validateOnRuleChange: __props.validateOnRuleChange,
1760
+ size: __props.size,
1761
+ disabled: __props.disabled
1762
+ }, {
1763
+ default: withCtx(function () { return [
1764
+ renderSlot(_ctx.$slots, "default")
1765
+ ]; }),
1766
+ _: 3 /* FORWARDED */
1767
+ }, 8 /* PROPS */, ["model", "rules", "inline", "labelPosition", "labelWidth", "labelSuffix", "hideRequiredAsterisk", "showMessage", "inlineMessage", "statusIcon", "validateOnRuleChange", "size", "disabled"]));
1768
+ };
1769
+ } }));
1770
+
1771
+ script$6.__file = "packages/base/form/form.vue";
1772
+
1773
+ var __default__$5 = {
1774
+ name: 'base-form-item'
1775
+ };
1776
+ var script$5 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$5), { props: {
1777
+ prop: { type: null, required: true },
1778
+ label: { type: String, required: false },
1779
+ labelWidth: { type: [String, Number], required: false, default: 'auto' },
1780
+ required: { type: Boolean, required: false },
1781
+ rules: { type: null, required: false },
1782
+ error: { type: String, required: false },
1783
+ showMessage: { type: Boolean, required: false, default: true },
1784
+ inlineMessage: { type: Boolean, required: false },
1785
+ size: { type: String, required: false }
1786
+ }, setup: function (__props, _a) {
1787
+ var _b, _c;
1788
+ var expose = _a.expose;
1789
+ var BaseFormItem = ref(null);
1790
+ expose({
1791
+ resetField: (_b = BaseFormItem.value) === null || _b === void 0 ? void 0 : _b.resetField,
1792
+ clearValidate: (_c = BaseFormItem.value) === null || _c === void 0 ? void 0 : _c.clearValidate
1793
+ });
1794
+ return function (_ctx, _cache) {
1795
+ return (openBlock(), createBlock(unref(ElFormItem), {
1796
+ class: "base-form-item",
1797
+ ref_key: "BaseFormItem",
1798
+ ref: BaseFormItem,
1799
+ prop: __props.prop,
1800
+ label: __props.label,
1801
+ labelWidth: __props.labelWidth,
1802
+ required: __props.required,
1803
+ rules: __props.rules,
1804
+ error: __props.error,
1805
+ showMessage: __props.showMessage,
1806
+ inlineMessage: __props.inlineMessage,
1807
+ size: __props.size
1808
+ }, {
1809
+ default: withCtx(function () { return [
1810
+ renderSlot(_ctx.$slots, "default")
1811
+ ]; }),
1812
+ _: 3 /* FORWARDED */
1813
+ }, 8 /* PROPS */, ["prop", "label", "labelWidth", "required", "rules", "error", "showMessage", "inlineMessage", "size"]));
1814
+ };
1815
+ } }));
1816
+
1817
+ script$5.__scopeId = "data-v-17eda5db";
1818
+ script$5.__file = "packages/base/form/form-item.vue";
1819
+
1820
+ var BaseFormItem = script$5;
1821
+ var BaseForm = script$6;
1822
+
1823
+ var _hoisted_1$3 = { class: "xrk-search" };
1824
+ var __default__$4 = {
1825
+ name: 'xrk-search'
1826
+ };
1827
+ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4), { props: {
1828
+ columns: { type: null, required: true },
1829
+ searchBtn: { type: null, required: false, default: function () { return ({
1830
+ text: '搜索',
1831
+ show: true
1832
+ }); } },
1833
+ resetBtn: { type: null, required: false, default: function () { return ({
1834
+ text: '重置',
1835
+ show: true
1836
+ }); } },
1837
+ otherComponents: { type: null, required: false }
1838
+ }, emits: ["search"], setup: function (__props, _a) {
1839
+ var _this = this;
1840
+ var expose = _a.expose, emits = _a.emit;
1841
+ var _props = __props;
1842
+ var components = ref({
1843
+ input: shallowRef(script$d),
1844
+ select: shallowRef(script$b),
1845
+ datePicker: shallowRef(script$e)
1846
+ });
1847
+ var props = _props;
1848
+ var columnsToSearchValue = function (columns) {
1849
+ return columns.reduce(function (pre, _a) {
1850
+ var prop = _a.prop, defaultValue = _a.defaultValue;
1851
+ pre[prop] = defaultValue || '';
1852
+ return pre;
1853
+ }, {});
1854
+ };
1855
+ // 将 searchValue 传入 每个搜索项的监听事件
1856
+ var proxyColumnListener = function (listener) {
1857
+ return Object.keys(listener).reduce(function (pre, cur) {
1858
+ pre[cur] = function () {
1859
+ var args = [];
1860
+ for (var _i = 0; _i < arguments.length; _i++) {
1861
+ args[_i] = arguments[_i];
1862
+ }
1863
+ listener[cur].apply(listener, __spreadArray(__spreadArray([], args, false), [searchValue], false));
1864
+ };
1865
+ return pre;
1866
+ }, {});
1867
+ };
1868
+ var searchValue = reactive(columnsToSearchValue(props.columns));
1869
+ var BaseSearchRender = defineComponent({
1870
+ name: 'search-render',
1871
+ props: {
1872
+ render: Function
1873
+ },
1874
+ render: function (ctx) {
1875
+ return ctx.render
1876
+ ? ctx.render({ columns: props.columns, searchValue: searchValue })
1877
+ : '';
1878
+ }
1879
+ });
1880
+ var handleSearchClick = function () { return __awaiter(_this, void 0, void 0, function () {
1881
+ var _searchValue;
1882
+ var _a, _b, _c, _d, _e, _f;
1883
+ return __generator(this, function (_g) {
1884
+ switch (_g.label) {
1885
+ case 0:
1886
+ _searchValue = base.deepClone(searchValue);
1887
+ if (!isFunction((_a = props.searchBtn) === null || _a === void 0 ? void 0 : _a.beforeSearch)) return [3 /*break*/, 2];
1888
+ return [4 /*yield*/, ((_c = (_b = props.searchBtn) === null || _b === void 0 ? void 0 : _b.beforeSearch) === null || _c === void 0 ? void 0 : _c.call(_b, _searchValue))];
1889
+ case 1:
1890
+ _searchValue = _g.sent();
1891
+ _g.label = 2;
1892
+ case 2:
1893
+ emits('search', _searchValue);
1894
+ if (!isFunction((_d = props.searchBtn) === null || _d === void 0 ? void 0 : _d.afterSearch)) return [3 /*break*/, 4];
1895
+ return [4 /*yield*/, ((_f = (_e = props.searchBtn) === null || _e === void 0 ? void 0 : _e.afterSearch) === null || _f === void 0 ? void 0 : _f.call(_e, _searchValue))];
1896
+ case 3:
1897
+ _g.sent();
1898
+ _g.label = 4;
1899
+ case 4: return [2 /*return*/];
1900
+ }
1901
+ });
1902
+ }); };
1903
+ var handleResetClick = function () { return __awaiter(_this, void 0, void 0, function () {
1904
+ var _searchValue;
1905
+ var _a, _b, _c, _d, _e, _f;
1906
+ return __generator(this, function (_g) {
1907
+ switch (_g.label) {
1908
+ case 0:
1909
+ Object.keys(searchValue).forEach(function (searchKey) { return (searchValue[searchKey] = null); });
1910
+ _searchValue = base.deepClone(searchValue);
1911
+ if (!isFunction((_a = props.resetBtn) === null || _a === void 0 ? void 0 : _a.beforeReset)) return [3 /*break*/, 2];
1912
+ return [4 /*yield*/, ((_c = (_b = props.resetBtn) === null || _b === void 0 ? void 0 : _b.beforeReset) === null || _c === void 0 ? void 0 : _c.call(_b, _searchValue))];
1913
+ case 1:
1914
+ _searchValue = _g.sent();
1915
+ _g.label = 2;
1916
+ case 2:
1917
+ emits('search', _searchValue);
1918
+ if (!isFunction((_d = props.resetBtn) === null || _d === void 0 ? void 0 : _d.afterReset)) return [3 /*break*/, 4];
1919
+ return [4 /*yield*/, ((_f = (_e = props.resetBtn) === null || _e === void 0 ? void 0 : _e.afterReset) === null || _f === void 0 ? void 0 : _f.call(_e, _searchValue))];
1920
+ case 3:
1921
+ _g.sent();
1922
+ _g.label = 4;
1923
+ case 4: return [2 /*return*/];
1924
+ }
1925
+ });
1926
+ }); };
1927
+ expose({
1928
+ getSearchValue: function () {
1929
+ return base.deepClone(searchValue);
1930
+ },
1931
+ setSearchValue: function (key, value) {
1932
+ if (props.columns.findIndex(function (_a) {
1933
+ var prop = _a.prop;
1934
+ return prop == key;
1935
+ }) == -1) {
1936
+ console.warn("\u539F\u59CBsearch\u914D\u7F6E\u9879\u4E0D\u5B58\u5728".concat(key, "\u5C5E\u6027\uFF0C\u5EFA\u8BAE\u4FEE\u6539"));
1937
+ }
1938
+ searchValue[key] = value;
1939
+ },
1940
+ handleSearchClick: handleSearchClick,
1941
+ handleResetClick: handleResetClick
1942
+ });
1943
+ return function (_ctx, _cache) {
1944
+ return (openBlock(), createElementBlock("div", _hoisted_1$3, [
1945
+ createVNode(script$6, { model: searchValue }, {
1946
+ default: withCtx(function () { return [
1947
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, function (_a) {
1948
+ var style = _a.style, label = _a.label, prop = _a.prop, type = _a.type, disabled = _a.disabled, config = _a.config, listener = _a.listener;
1949
+ return (openBlock(), createBlock(script$5, {
1950
+ prop: prop,
1951
+ label: label,
1952
+ key: prop
1953
+ }, {
1954
+ default: withCtx(function () { return [
1955
+ type
1956
+ ? (openBlock(), createBlock(resolveDynamicComponent(components.value[type]), mergeProps({
1957
+ key: 0,
1958
+ style: style
1959
+ }, __assign(__assign({}, config), proxyColumnListener(listener || {})), {
1960
+ disabled: unref(isFunction)(disabled) ? disabled(searchValue) : disabled,
1961
+ modelValue: searchValue[prop],
1962
+ "onUpdate:modelValue": function ($event) { return ((searchValue[prop]) = $event); }
1963
+ }), null, 16 /* FULL_PROPS */, ["style", "disabled", "modelValue", "onUpdate:modelValue"]))
1964
+ : createCommentVNode("v-if", true)
1965
+ ]; }),
1966
+ _: 2 /* DYNAMIC */
1967
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["prop", "label"]));
1968
+ }), 128 /* KEYED_FRAGMENT */)),
1969
+ (__props.searchBtn.show)
1970
+ ? (openBlock(), createBlock(script$l, {
1971
+ key: 0,
1972
+ click: handleSearchClick
1973
+ }, {
1974
+ default: withCtx(function () { return [
1975
+ createTextVNode(toDisplayString(__props.searchBtn.text), 1 /* TEXT */)
1976
+ ]; }),
1977
+ _: 1 /* STABLE */
1978
+ }))
1979
+ : createCommentVNode("v-if", true),
1980
+ (__props.resetBtn.show)
1981
+ ? (openBlock(), createBlock(script$l, {
1982
+ key: 1,
1983
+ plain: true,
1984
+ click: handleResetClick
1985
+ }, {
1986
+ default: withCtx(function () { return [
1987
+ createTextVNode(toDisplayString(__props.resetBtn.text), 1 /* TEXT */)
1988
+ ]; }),
1989
+ _: 1 /* STABLE */
1990
+ }))
1991
+ : createCommentVNode("v-if", true),
1992
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.otherComponents, function (_a, index) {
1993
+ var render = _a.render;
1994
+ return (openBlock(), createBlock(unref(BaseSearchRender), {
1995
+ render: render,
1996
+ key: index
1997
+ }, null, 8 /* PROPS */, ["render"]));
1998
+ }), 128 /* KEYED_FRAGMENT */))
1999
+ ]; }),
2000
+ _: 1 /* STABLE */
2001
+ }, 8 /* PROPS */, ["model"])
2002
+ ]));
2003
+ };
2004
+ } }));
2005
+
2006
+ script$4.__scopeId = "data-v-a1781a06";
2007
+ script$4.__file = "packages/xrk/search/search.vue";
2008
+
2009
+ var XrkSearch = script$4;
2010
+
2011
+ /*
2012
+ * @Description:
2013
+ * @Date: 2022-03-14 19:18:12
2014
+ */
2015
+ var useTableSetup = function () {
2016
+ var info = reactive({
2017
+ selectionRows: new Map()
2018
+ });
2019
+ return {
2020
+ selectionRows: info.selectionRows,
2021
+ hasSelectionRow: function (rowId) {
2022
+ return info.selectionRows.has(rowId);
2023
+ },
2024
+ addSelectionRow: function (rowId, row) {
2025
+ info.selectionRows.set(rowId, row);
2026
+ },
2027
+ removeSelectionRow: function (rowId) {
2028
+ info.selectionRows.delete(rowId);
2029
+ },
2030
+ getSelectionRows: function () {
2031
+ var arr = [];
2032
+ info.selectionRows.forEach(function (value) {
2033
+ arr.push(value);
2034
+ });
2035
+ return arr;
2036
+ },
2037
+ clearSelectionRows: function () {
2038
+ info.selectionRows.clear();
2039
+ }
2040
+ };
2041
+ };
2042
+
2043
+ var __default__$3 = {
2044
+ name: 'base-table'
2045
+ };
2046
+ var script$3 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$3), { props: {
2047
+ data: { type: Array, required: true },
2048
+ columns: { type: null, required: true },
2049
+ height: { type: [String, Number], required: false },
2050
+ maxHeight: { type: [String, Number], required: false },
2051
+ stripe: { type: Boolean, required: false },
2052
+ border: { type: Boolean, required: false, default: true },
2053
+ size: { type: String, required: false },
2054
+ fit: { type: Boolean, required: false, default: true },
2055
+ rowClassName: { type: null, required: false },
2056
+ rowStyle: { type: null, required: false },
2057
+ cellClassName: { type: null, required: false },
2058
+ cellStyle: { type: null, required: false },
2059
+ headerRowClassName: { type: null, required: false },
2060
+ headerRowStyle: { type: null, required: false },
2061
+ headerCellClassName: { type: null, required: false },
2062
+ headerCellStyle: { type: null, required: false },
2063
+ rowKey: { type: [Function, String], required: false },
2064
+ defaultExpandAll: { type: Boolean, required: false },
2065
+ expandRowKeys: { type: Array, required: false },
2066
+ emptyText: { type: String, required: false, default: '暂无数据' },
2067
+ defaultSort: { type: Object, required: false }
2068
+ }, emits: ["sort-change", "select", "select-all"], setup: function (__props, _a) {
2069
+ var expose = _a.expose, emits = _a.emit;
2070
+ var _b = useTableSetup(), selectionRows = _b.selectionRows, getSelectionRows = _b.getSelectionRows, addSelectionRow = _b.addSelectionRow, removeSelectionRow = _b.removeSelectionRow, clearSelectionRows = _b.clearSelectionRows;
2071
+ var handleSortChange = function (info) {
2072
+ emits('sort-change', info);
2073
+ };
2074
+ var handleColumnSelect = function (selection, row) {
2075
+ emits('select', selection, row);
2076
+ };
2077
+ var handleColumnSelectAll = function (selection) {
2078
+ emits('select-all', selection);
2079
+ };
2080
+ expose({
2081
+ getSelectionRows: getSelectionRows,
2082
+ addSelectionRow: addSelectionRow,
2083
+ removeSelectionRow: removeSelectionRow,
2084
+ clearSelectionRows: clearSelectionRows
2085
+ });
2086
+ return function (_ctx, _cache) {
2087
+ return (openBlock(), createBlock(unref(ElTable), {
2088
+ class: "base-table",
2089
+ data: __props.data,
2090
+ height: __props.height,
2091
+ maxHeight: __props.maxHeight,
2092
+ stripe: __props.stripe,
2093
+ border: __props.border,
2094
+ size: __props.size,
2095
+ fit: __props.fit,
2096
+ rowClassName: __props.rowClassName,
2097
+ rowStyle: __props.rowStyle,
2098
+ cellClassName: __props.cellClassName,
2099
+ cellStyle: __props.cellStyle,
2100
+ headerRowClassName: __props.headerRowClassName,
2101
+ headerRowStyle: __props.headerRowStyle,
2102
+ rowKey: __props.rowKey,
2103
+ defaultExpandAll: __props.defaultExpandAll,
2104
+ expandRowKeys: __props.expandRowKeys,
2105
+ defaultSort: __props.defaultSort,
2106
+ emptyText: __props.emptyText,
2107
+ onSortChange: handleSortChange
2108
+ }, {
2109
+ empty: withCtx(function () { return [
2110
+ renderSlot(_ctx.$slots, "empty")
2111
+ ]; }),
2112
+ default: withCtx(function () { return [
2113
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, function (column) {
2114
+ return (openBlock(), createBlock(unref(BaseTableColumn), mergeProps({
2115
+ key: column.prop,
2116
+ pageAllData: __props.data,
2117
+ selectionRows: unref(selectionRows),
2118
+ getSelectionRows: unref(getSelectionRows),
2119
+ addSelectionRow: unref(addSelectionRow),
2120
+ removeSelectionRow: unref(removeSelectionRow),
2121
+ clearSelectionRows: unref(clearSelectionRows)
2122
+ }, column, {
2123
+ onSelect: handleColumnSelect,
2124
+ onSelectAll: handleColumnSelectAll
2125
+ }), null, 16 /* FULL_PROPS */, ["pageAllData", "selectionRows", "getSelectionRows", "addSelectionRow", "removeSelectionRow", "clearSelectionRows"]));
2126
+ }), 128 /* KEYED_FRAGMENT */))
2127
+ ]; }),
2128
+ _: 3 /* FORWARDED */
2129
+ }, 8 /* PROPS */, ["data", "height", "maxHeight", "stripe", "border", "size", "fit", "rowClassName", "rowStyle", "cellClassName", "cellStyle", "headerRowClassName", "headerRowStyle", "rowKey", "defaultExpandAll", "expandRowKeys", "defaultSort", "emptyText"]));
2130
+ };
2131
+ } }));
2132
+
2133
+ script$3.__scopeId = "data-v-968a9a5a";
2134
+ script$3.__file = "packages/base/table/table.vue";
2135
+
2136
+ var _hoisted_1$2 = ["onClick"];
2137
+ var _hoisted_2$2 = {
2138
+ key: 2,
2139
+ class: "base-table-column"
2140
+ };
2141
+ var __default__$2 = {
2142
+ name: 'base-table-column'
2143
+ };
2144
+ var script$2 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$2), { props: {
2145
+ pageAllData: { type: Array, required: false },
2146
+ prop: { type: String, required: false },
2147
+ type: { type: String, required: false },
2148
+ index: { type: [Number, Function], required: false },
2149
+ label: { type: String, required: false },
2150
+ columnKey: { type: String, required: false },
2151
+ width: { type: [String, Number], required: false },
2152
+ minWidth: { type: [String, Number], required: false },
2153
+ fixed: { type: [Boolean, String], required: false },
2154
+ sortable: { type: [Boolean, String], required: false },
2155
+ sortMethod: { type: Function, required: false },
2156
+ sortBy: { type: [Array, String, Function], required: false },
2157
+ sortOrders: { type: Array, required: false },
2158
+ showOverflowTooltip: { type: Boolean, required: false, default: true },
2159
+ align: { type: String, required: false, default: 'center' },
2160
+ headerAlign: { type: String, required: false },
2161
+ className: { type: String, required: false },
2162
+ labelClassName: { type: String, required: false },
2163
+ textLineClamp: { type: Number, required: false, default: 1 },
2164
+ renderHeader: { type: Function, required: false },
2165
+ formatter: { type: Function, required: false },
2166
+ render: { type: Function, required: false },
2167
+ selectionDisabled: { type: [Function, Boolean], required: false },
2168
+ selectionRows: { type: null, required: false },
2169
+ hasSelectionRow: { type: Function, required: false },
2170
+ addSelectionRow: { type: Function, required: false },
2171
+ removeSelectionRow: { type: Function, required: false },
2172
+ getSelectionRows: { type: Function, required: false },
2173
+ clearSelectionRows: { type: Function, required: false },
2174
+ selectionAllBefore: { type: Function, required: false },
2175
+ selectionAddBefore: { type: Function, required: false },
2176
+ selectionAddAfter: { type: Function, required: false },
2177
+ selectionRemoveBefore: { type: Function, required: false },
2178
+ selectionRemoveAfter: { type: Function, required: false }
2179
+ }, emits: ["select", "select-all"], setup: function (__props, _a) {
2180
+ var _this = this;
2181
+ var emits = _a.emit;
2182
+ var _props = __props;
2183
+ var vLoading$1 = vLoading;
2184
+ var props = _props;
2185
+ var _selectionAllLoading = ref(false);
2186
+ var BaseTableColumnHeaderRender = defineComponent({
2187
+ name: 'table-column-header-render',
2188
+ props: ['column', 'index'],
2189
+ render: function (params) {
2190
+ return props.renderHeader
2191
+ ? props.renderHeader(props.type == '_selection'
2192
+ ? {
2193
+ column: params.column,
2194
+ index: params.index,
2195
+ selectionInfo: {
2196
+ toggleCheckAll: handleCheckboxAllClick,
2197
+ checkboxAllChecked: checkboxAllChecked,
2198
+ checkboxAllIndeterminate: checkboxAllIndeterminate,
2199
+ selectionAllLoading: _selectionAllLoading
2200
+ }
2201
+ }
2202
+ : { column: params.column, index: params.index })
2203
+ : '';
2204
+ }
2205
+ });
2206
+ var BaseTableColumnContentRender = defineComponent({
2207
+ name: 'table-column-content-render',
2208
+ props: ['column', 'cellValue', 'row', 'index'],
2209
+ render: function (params) {
2210
+ return props.render
2211
+ ? props.render({
2212
+ column: params.column,
2213
+ index: params.index,
2214
+ cellValue: params.cellValue,
2215
+ row: params.row
2216
+ })
2217
+ : '';
2218
+ }
2219
+ });
2220
+ var _selectionDisabled = function (row) {
2221
+ var _a;
2222
+ if (isFunction(props.selectionDisabled)) {
2223
+ var status_1 = (_a = props === null || props === void 0 ? void 0 : props.selectionDisabled) === null || _a === void 0 ? void 0 : _a.call(props, row);
2224
+ // if (status && props.prop && selectionRows?.has(row[props.prop])) {
2225
+ // console.log(row[props.prop], row, '已被禁用,无法设置选中');
2226
+ // removeSelectionRow?.(row[props.prop]);
2227
+ // }
2228
+ return status_1;
2229
+ }
2230
+ else {
2231
+ return props.selectionDisabled;
2232
+ }
2233
+ };
2234
+ var getColumnValue = function (row, index, column) {
2235
+ if (props.type == 'index')
2236
+ return "".concat(index + 1);
2237
+ if (props.formatter) {
2238
+ return props.formatter({
2239
+ row: row,
2240
+ column: column,
2241
+ cellValue: props.prop && row[props.prop],
2242
+ index: index
2243
+ });
2244
+ }
2245
+ return props.prop && row[props.prop];
2246
+ };
2247
+ var selectionRows = props.selectionRows, addSelectionRow = props.addSelectionRow, removeSelectionRow = props.removeSelectionRow, getSelectionRows = props.getSelectionRows;
2248
+ var checked = computed(function () {
2249
+ return function (row) {
2250
+ return props.prop && (selectionRows === null || selectionRows === void 0 ? void 0 : selectionRows.has(row[props.prop]));
2251
+ };
2252
+ });
2253
+ var filterPageAllData = computed(function () {
2254
+ return Array.isArray(props.pageAllData)
2255
+ ? props.pageAllData.filter(function (row) { return !_selectionDisabled(row); })
2256
+ : [];
2257
+ });
2258
+ var checkboxAllChecked = computed(function () {
2259
+ return (filterPageAllData.value.length > 0 &&
2260
+ filterPageAllData.value.every(function (row) {
2261
+ return props.prop && row[props.prop] && (selectionRows === null || selectionRows === void 0 ? void 0 : selectionRows.has(row[props.prop]));
2262
+ }));
2263
+ });
2264
+ var checkboxAllIndeterminate = computed(function () {
2265
+ return (filterPageAllData.value.length > 0 &&
2266
+ !checkboxAllChecked.value &&
2267
+ filterPageAllData.value.some(function (row) {
2268
+ return props.prop && row[props.prop] && (selectionRows === null || selectionRows === void 0 ? void 0 : selectionRows.has(row[props.prop]));
2269
+ }));
2270
+ });
2271
+ var handleCheckboxAllClick = function () { return __awaiter(_this, void 0, void 0, function () {
2272
+ var fn;
2273
+ return __generator(this, function (_a) {
2274
+ switch (_a.label) {
2275
+ case 0:
2276
+ if (!Array.isArray(props.pageAllData)) return [3 /*break*/, 7];
2277
+ if (_selectionAllLoading.value)
2278
+ return [2 /*return*/];
2279
+ fn = function () {
2280
+ if (checkboxAllChecked.value) {
2281
+ // 已经选择全部
2282
+ filterPageAllData.value.forEach(function (row) {
2283
+ props.prop && (removeSelectionRow === null || removeSelectionRow === void 0 ? void 0 : removeSelectionRow(row[props.prop]));
2284
+ });
2285
+ }
2286
+ else {
2287
+ filterPageAllData.value.forEach(function (row) {
2288
+ props.prop && (addSelectionRow === null || addSelectionRow === void 0 ? void 0 : addSelectionRow(row[props.prop], row));
2289
+ });
2290
+ }
2291
+ };
2292
+ _a.label = 1;
2293
+ case 1:
2294
+ _a.trys.push([1, 5, , 6]);
2295
+ _selectionAllLoading.value = true;
2296
+ if (!isFunction(props.selectionAllBefore)) return [3 /*break*/, 3];
2297
+ return [4 /*yield*/, props.selectionAllBefore(fn)];
2298
+ case 2:
2299
+ _a.sent();
2300
+ return [3 /*break*/, 4];
2301
+ case 3:
2302
+ fn();
2303
+ _a.label = 4;
2304
+ case 4: return [3 /*break*/, 6];
2305
+ case 5:
2306
+ _a.sent();
2307
+ return [3 /*break*/, 6];
2308
+ case 6:
2309
+ _selectionAllLoading.value = false;
2310
+ _a.label = 7;
2311
+ case 7:
2312
+ emits('select-all', getSelectionRows === null || getSelectionRows === void 0 ? void 0 : getSelectionRows());
2313
+ return [2 /*return*/];
2314
+ }
2315
+ });
2316
+ }); };
2317
+ var handleCheckboxClick = function (row) { return __awaiter(_this, void 0, void 0, function () {
2318
+ var _a, _b;
2319
+ return __generator(this, function (_c) {
2320
+ switch (_c.label) {
2321
+ case 0:
2322
+ if (_selectionDisabled(row) || row._selectionLoading)
2323
+ return [2 /*return*/];
2324
+ if (!props.prop) return [3 /*break*/, 15];
2325
+ row._selectionLoading = true;
2326
+ _c.label = 1;
2327
+ case 1:
2328
+ _c.trys.push([1, 14, , 15]);
2329
+ if (!(selectionRows === null || selectionRows === void 0 ? void 0 : selectionRows.has(row[props.prop]))) return [3 /*break*/, 7];
2330
+ if (!isFunction(props.selectionRemoveBefore)) return [3 /*break*/, 3];
2331
+ return [4 /*yield*/, props.selectionRemoveBefore(row, removeSelectionRow
2332
+ ? removeSelectionRow.bind(null, row[props.prop])
2333
+ : function () { })];
2334
+ case 2:
2335
+ _c.sent();
2336
+ return [3 /*break*/, 4];
2337
+ case 3:
2338
+ removeSelectionRow === null || removeSelectionRow === void 0 ? void 0 : removeSelectionRow(row[props.prop]);
2339
+ _c.label = 4;
2340
+ case 4:
2341
+ row._selectionLoading = false;
2342
+ _a = isFunction(props.selectionRemoveAfter);
2343
+ if (!_a) return [3 /*break*/, 6];
2344
+ return [4 /*yield*/, props.selectionRemoveAfter(row)];
2345
+ case 5:
2346
+ _a = (_c.sent());
2347
+ _c.label = 6;
2348
+ case 6:
2349
+ return [3 /*break*/, 13];
2350
+ case 7:
2351
+ if (!isFunction(props.selectionAddBefore)) return [3 /*break*/, 9];
2352
+ return [4 /*yield*/, props.selectionAddBefore(row, addSelectionRow
2353
+ ? addSelectionRow.bind(null, row[props.prop], row)
2354
+ : function () { })];
2355
+ case 8:
2356
+ _c.sent();
2357
+ return [3 /*break*/, 10];
2358
+ case 9:
2359
+ addSelectionRow === null || addSelectionRow === void 0 ? void 0 : addSelectionRow(row[props.prop], row);
2360
+ _c.label = 10;
2361
+ case 10:
2362
+ row._selectionLoading = false;
2363
+ _b = isFunction(props.selectionAddAfter);
2364
+ if (!_b) return [3 /*break*/, 12];
2365
+ return [4 /*yield*/, props.selectionAddAfter(row)];
2366
+ case 11:
2367
+ _b = (_c.sent());
2368
+ _c.label = 12;
2369
+ case 12:
2370
+ _c.label = 13;
2371
+ case 13:
2372
+ emits('select', getSelectionRows === null || getSelectionRows === void 0 ? void 0 : getSelectionRows(), row);
2373
+ return [3 /*break*/, 15];
2374
+ case 14:
2375
+ _c.sent();
2376
+ row._selectionLoading = false;
2377
+ return [3 /*break*/, 15];
2378
+ case 15: return [2 /*return*/];
2379
+ }
2380
+ });
2381
+ }); };
2382
+ return function (_ctx, _cache) {
2383
+ return (openBlock(), createBlock(unref(ElTableColumn), {
2384
+ prop: __props.prop,
2385
+ type: __props.type,
2386
+ index: __props.index,
2387
+ label: __props.label,
2388
+ columnKey: __props.columnKey,
2389
+ width: __props.width,
2390
+ minWidth: __props.minWidth,
2391
+ fixed: __props.fixed,
2392
+ sortable: __props.sortable,
2393
+ sortMethod: __props.sortMethod,
2394
+ sortBy: __props.sortBy,
2395
+ sortOrders: __props.sortOrders,
2396
+ align: __props.align,
2397
+ headerAlign: __props.headerAlign,
2398
+ className: __props.className,
2399
+ labelClassName: __props.labelClassName,
2400
+ textLineClamp: __props.textLineClamp
2401
+ }, createSlots({
2402
+ default: withCtx(function (_a) {
2403
+ var row = _a.row, column = _a.column, $index = _a.$index;
2404
+ return [
2405
+ (__props.render)
2406
+ ? (openBlock(), createBlock(unref(BaseTableColumnContentRender), {
2407
+ key: 0,
2408
+ row: row,
2409
+ column: column,
2410
+ cellValue: __props.prop ? row[__props.prop] : '',
2411
+ index: $index
2412
+ }, null, 8 /* PROPS */, ["row", "column", "cellValue", "index"]))
2413
+ : (__props.type == '_selection')
2414
+ ? (openBlock(), createElementBlock("div", {
2415
+ key: 1,
2416
+ style: { "display": "inline-block" },
2417
+ onClick: withModifiers(function ($event) { return (handleCheckboxClick(row)); }, ["prevent"])
2418
+ }, [
2419
+ withDirectives(createVNode(unref(BaseCheckbox), {
2420
+ class: "table-base-checkbox",
2421
+ "model-value": unref(checked)(row),
2422
+ disabled: _selectionDisabled(row)
2423
+ }, null, 8 /* PROPS */, ["model-value", "disabled"]), [
2424
+ [unref(vLoading$1), row._selectionLoading]
2425
+ ])
2426
+ ], 8 /* PROPS */, _hoisted_1$2))
2427
+ : (openBlock(), createElementBlock("div", _hoisted_2$2, [
2428
+ createVNode(unref(BaseToolTip), {
2429
+ content: getColumnValue(row, $index, column),
2430
+ hideAfter: 0,
2431
+ enterable: false,
2432
+ transition: "none",
2433
+ overShow: __props.showOverflowTooltip,
2434
+ style: normalizeStyle({ '-webkit-line-clamp': __props.textLineClamp || 1 })
2435
+ }, {
2436
+ default: withCtx(function () { return [
2437
+ createTextVNode(toDisplayString(getColumnValue(row, $index, column)), 1 /* TEXT */)
2438
+ ]; }),
2439
+ _: 2 /* DYNAMIC */
2440
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content", "overShow", "style"])
2441
+ ]))
2442
+ ];
2443
+ }),
2444
+ _: 2 /* DYNAMIC */
2445
+ }, [
2446
+ (__props.renderHeader)
2447
+ ? {
2448
+ name: "header",
2449
+ fn: withCtx(function (_a) {
2450
+ var column = _a.column, $index = _a.$index;
2451
+ return [
2452
+ createVNode(unref(BaseTableColumnHeaderRender), {
2453
+ index: $index,
2454
+ column: column
2455
+ }, null, 8 /* PROPS */, ["index", "column"])
2456
+ ];
2457
+ })
2458
+ }
2459
+ : (__props.type == '_selection')
2460
+ ? {
2461
+ name: "header",
2462
+ fn: withCtx(function () { return [
2463
+ withDirectives((openBlock(), createBlock(unref(BaseCheckbox), {
2464
+ class: "table-base-checkbox",
2465
+ onClick: withModifiers(handleCheckboxAllClick, ["prevent"]),
2466
+ "model-value": unref(checkboxAllChecked),
2467
+ indeterminate: unref(checkboxAllIndeterminate)
2468
+ }, {
2469
+ default: withCtx(function () { return [
2470
+ createTextVNode(toDisplayString(unref(selectionRows).size > 0 ? "\u5DF2\u9009".concat(unref(selectionRows).size, "\u9879") : ''), 1 /* TEXT */)
2471
+ ]; }),
2472
+ _: 1 /* STABLE */
2473
+ }, 8 /* PROPS */, ["onClick", "model-value", "indeterminate"])), [
2474
+ [unref(vLoading$1), _selectionAllLoading.value]
2475
+ ])
2476
+ ]; })
2477
+ }
2478
+ : undefined
2479
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["prop", "type", "index", "label", "columnKey", "width", "minWidth", "fixed", "sortable", "sortMethod", "sortBy", "sortOrders", "align", "headerAlign", "className", "labelClassName", "textLineClamp"]));
2480
+ };
2481
+ } }));
2482
+
2483
+ script$2.__scopeId = "data-v-2a64ae40";
2484
+ script$2.__file = "packages/base/table/table-column.vue";
2485
+
2486
+ var useTableColumn$1 = function (props) {
2487
+ return __assign({ minWidth: '120px', width: props.type === 'index' ? '90px' : '' }, props);
2488
+ };
2489
+
2490
+ var BaseTable = script$3;
2491
+ var BaseTableColumn = script$2;
2492
+ var useTableColumn = useTableColumn$1;
2493
+
2494
+ var useTable = function (config) {
2495
+ var pageIsLoading = ref(false);
2496
+ var pageAllData = ref([]);
2497
+ var paginationTotal = ref(0);
2498
+ var getList = function (query) { return __awaiter(void 0, void 0, void 0, function () {
2499
+ var res, error_1;
2500
+ return __generator(this, function (_a) {
2501
+ switch (_a.label) {
2502
+ case 0:
2503
+ if (pageIsLoading.value)
2504
+ return [2 /*return*/];
2505
+ pageIsLoading.value = true;
2506
+ _a.label = 1;
2507
+ case 1:
2508
+ _a.trys.push([1, 4, , 5]);
2509
+ if (!isFunction(config.getListAjax)) return [3 /*break*/, 3];
2510
+ return [4 /*yield*/, config.getListAjax(query)];
2511
+ case 2:
2512
+ res = _a.sent();
2513
+ pageAllData.value = res.data.list;
2514
+ paginationTotal.value = res.data.total;
2515
+ _a.label = 3;
2516
+ case 3: return [3 /*break*/, 5];
2517
+ case 4:
2518
+ error_1 = _a.sent();
2519
+ console.warn(error_1);
2520
+ return [3 /*break*/, 5];
2521
+ case 5:
2522
+ pageIsLoading.value = false;
2523
+ return [2 /*return*/];
2524
+ }
2525
+ });
2526
+ }); };
2527
+ return {
2528
+ pageIsLoading: pageIsLoading,
2529
+ pageAllData: pageAllData,
2530
+ paginationTotal: paginationTotal,
2531
+ getList: getList
2532
+ };
2533
+ };
2534
+
2535
+ var _hoisted_1$1 = { class: "slot-before slot" };
2536
+ var _hoisted_2$1 = { class: "slot-after slot" };
2537
+ var __default__$1 = {
2538
+ name: 'xrk-table'
2539
+ };
2540
+ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1), { props: {
2541
+ requestNow: { type: Boolean, required: false, default: true },
2542
+ getListAjax: { type: Function, required: true },
2543
+ searchConfig: { type: Object, required: true },
2544
+ tableConfig: { type: Object, required: true },
2545
+ paginationConfig: { type: Object, required: false }
2546
+ }, setup: function (__props, _a) {
2547
+ var _b;
2548
+ var _c, _d;
2549
+ var expose = _a.expose;
2550
+ var _props = __props;
2551
+ var props = _props;
2552
+ var vLoading$1 = vLoading;
2553
+ var paginationConfig = computed(function () { return (__assign({ pageNoKey: 'pageNo', pageSizeKey: 'pageSize', paginationPageSize: 60, paginationCurrentPage: 1 }, (props.paginationConfig || {}))); });
2554
+ var TableSelectionRows = ref([]);
2555
+ var XrkSearchRef = ref(null);
2556
+ var XrkTablebaseTableRef = ref(null);
2557
+ var BasePaginationRef = ref(null);
2558
+ var pageNoKey = paginationConfig.value.pageNoKey;
2559
+ var pageSizeKey = paginationConfig.value.pageSizeKey;
2560
+ var paginationQuery = ref((_b = {},
2561
+ _b[pageNoKey] = (_c = paginationConfig.value) === null || _c === void 0 ? void 0 : _c.paginationCurrentPage,
2562
+ _b[pageSizeKey] = (_d = paginationConfig.value) === null || _d === void 0 ? void 0 : _d.paginationPageSize,
2563
+ _b));
2564
+ var searchQuery = ref({});
2565
+ var query = computed(function () { return (__assign(__assign({}, paginationQuery.value), searchQuery.value)); });
2566
+ var initSearchQuery = function () {
2567
+ var _a, _b;
2568
+ var searchQueryDefault = ((_b = (_a = XrkSearchRef.value) === null || _a === void 0 ? void 0 : _a.getSearchValue) === null || _b === void 0 ? void 0 : _b.call(_a)) || {};
2569
+ searchQuery.value = searchQueryDefault;
2570
+ };
2571
+ var initPageInfo = function (pageNo) {
2572
+ var _a;
2573
+ if (pageNo === void 0) { pageNo = 1; }
2574
+ (_a = BasePaginationRef.value) === null || _a === void 0 ? void 0 : _a.setPageInfo({
2575
+ pageSize: paginationQuery.value[pageSizeKey],
2576
+ currentPage: pageNo
2577
+ });
2578
+ paginationQuery.value[pageNoKey] = pageNo;
2579
+ };
2580
+ var clearSelectionRows = function () {
2581
+ var _a, _b;
2582
+ (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.clearSelectionRows) === null || _b === void 0 ? void 0 : _b.call(_a);
2583
+ TableSelectionRows.value = [];
2584
+ };
2585
+ var handleSearch = function (searchValue) {
2586
+ searchQuery.value = base.deepClone(searchValue);
2587
+ initPageInfo(1);
2588
+ clearSelectionRows();
2589
+ getList === null || getList === void 0 ? void 0 : getList(query.value);
2590
+ };
2591
+ var handlePageChange = function () {
2592
+ var _a;
2593
+ var _b, _c;
2594
+ var pageInfo = (_c = (_b = BasePaginationRef.value) === null || _b === void 0 ? void 0 : _b.getPageInfo) === null || _c === void 0 ? void 0 : _c.call(_b);
2595
+ paginationQuery.value = (_a = {},
2596
+ _a[pageNoKey] = pageInfo.currentPage,
2597
+ _a[pageSizeKey] = pageInfo.pageSize,
2598
+ _a);
2599
+ getList === null || getList === void 0 ? void 0 : getList(query.value);
2600
+ };
2601
+ var handleTableSelect = function () {
2602
+ var _a, _b;
2603
+ var res = (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.getSelectionRows) === null || _b === void 0 ? void 0 : _b.call(_a);
2604
+ TableSelectionRows.value = Array.isArray(res) ? res : [];
2605
+ };
2606
+ var _e = useTable({
2607
+ getListAjax: props.getListAjax
2608
+ }), pageAllData = _e.pageAllData, getList = _e.getList, paginationTotal = _e.paginationTotal, pageIsLoading = _e.pageIsLoading;
2609
+ onMounted(function () {
2610
+ initSearchQuery();
2611
+ clearSelectionRows();
2612
+ props.requestNow && (getList === null || getList === void 0 ? void 0 : getList(query.value));
2613
+ });
2614
+ expose({
2615
+ getSelectionRows: function () { var _a, _b; return (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.getSelectionRows) === null || _b === void 0 ? void 0 : _b.call(_a); },
2616
+ addSelectionRow: function (rowId, row) { var _a, _b; return (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.addSelectionRow) === null || _b === void 0 ? void 0 : _b.call(_a, rowId, row); },
2617
+ removeSelectionRow: function (rowId) { var _a, _b; return (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.removeSelectionRow) === null || _b === void 0 ? void 0 : _b.call(_a, rowId); },
2618
+ clearSelectionRows: function () { var _a, _b; return (_b = (_a = XrkTablebaseTableRef.value) === null || _a === void 0 ? void 0 : _a.clearSelectionRows) === null || _b === void 0 ? void 0 : _b.call(_a); },
2619
+ setSearchValue: function (key, value) { var _a, _b; return (_b = (_a = XrkSearchRef.value) === null || _a === void 0 ? void 0 : _a.setSearchValue) === null || _b === void 0 ? void 0 : _b.call(_a, key, value); },
2620
+ initCurrentList: function (customQuery) {
2621
+ initSearchQuery();
2622
+ getList === null || getList === void 0 ? void 0 : getList(__assign(__assign({}, (customQuery || {})), query.value));
2623
+ },
2624
+ initList: function (customQuery) {
2625
+ initSearchQuery();
2626
+ initPageInfo(1);
2627
+ getList === null || getList === void 0 ? void 0 : getList(__assign(__assign({}, (customQuery || {})), query.value));
2628
+ }
2629
+ });
2630
+ return function (_ctx, _cache) {
2631
+ return (openBlock(), createElementBlock(Fragment, null, [
2632
+ createVNode(script$4, {
2633
+ ref_key: "XrkSearchRef",
2634
+ ref: XrkSearchRef,
2635
+ columns: __props.searchConfig.searchColumns,
2636
+ "search-btn": __props.searchConfig.searchBtn,
2637
+ "reset-btn": __props.searchConfig.resetBtn,
2638
+ "other-components": __props.searchConfig.othertComponents,
2639
+ onSearch: handleSearch
2640
+ }, null, 8 /* PROPS */, ["columns", "search-btn", "reset-btn", "other-components"]),
2641
+ createElementVNode("div", _hoisted_1$1, [
2642
+ renderSlot(_ctx.$slots, "tableBefore", {
2643
+ selectionRows: TableSelectionRows.value,
2644
+ tableData: unref(pageAllData),
2645
+ searchQuery: unref(query)
2646
+ })
2647
+ ]),
2648
+ withDirectives(createVNode(unref(BaseTable), {
2649
+ class: "xrk-table-content",
2650
+ ref_key: "XrkTablebaseTableRef",
2651
+ ref: XrkTablebaseTableRef,
2652
+ data: unref(pageAllData),
2653
+ columns: __props.tableConfig.tableColumns,
2654
+ onSelectAll: handleTableSelect,
2655
+ onSelect: handleTableSelect
2656
+ }, null, 8 /* PROPS */, ["data", "columns"]), [
2657
+ [unref(vLoading$1), unref(pageIsLoading)]
2658
+ ]),
2659
+ createElementVNode("div", _hoisted_2$1, [
2660
+ renderSlot(_ctx.$slots, "tableAfter", {
2661
+ selectionRows: TableSelectionRows.value,
2662
+ tableData: unref(pageAllData),
2663
+ searchQuery: unref(query)
2664
+ })
2665
+ ]),
2666
+ createVNode(unref(BasePagination), {
2667
+ ref_key: "BasePaginationRef",
2668
+ ref: BasePaginationRef,
2669
+ total: unref(paginationTotal),
2670
+ pageSize: unref(paginationConfig).paginationPageSize,
2671
+ currentPage: unref(paginationConfig).paginationCurrentPage,
2672
+ onSizeChange: handlePageChange,
2673
+ onCurrentChange: handlePageChange
2674
+ }, null, 8 /* PROPS */, ["total", "pageSize", "currentPage"])
2675
+ ], 64 /* STABLE_FRAGMENT */));
2676
+ };
2677
+ } }));
2678
+
2679
+ script$1.__file = "packages/xrk/table/table.vue";
2680
+
2681
+ var XrkTable = script$1;
2682
+
2683
+ var _hoisted_1 = { key: 1 };
2684
+ var _hoisted_2 = { key: 1 };
2685
+ var __default__ = {
2686
+ name: 'base-dialog'
2687
+ };
2688
+ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), { props: {
2689
+ modelValue: { type: Boolean, required: false, default: true },
2690
+ closeOnClickModal: { type: Boolean, required: false, default: false },
2691
+ closeOnPressEscape: { type: Boolean, required: false, default: false },
2692
+ appendToBody: { type: Boolean, required: false, default: true },
2693
+ destroyOnClose: { type: Boolean, required: false, default: true },
2694
+ center: { type: Boolean, required: false, default: true },
2695
+ showClose: { type: Boolean, required: false, default: false },
2696
+ beforeClose: { type: Function, required: false },
2697
+ beforeCancel: { type: Function, required: false },
2698
+ beforeConfirm: { type: Function, required: false },
2699
+ customClass: { type: String, required: false, default: '_base-dialog' },
2700
+ width: { type: [String, Number], required: false, default: '50%' },
2701
+ title: { type: String, required: false, default: '提示' },
2702
+ content: { type: String, required: false },
2703
+ showFooter: { type: Boolean, required: false, default: true },
2704
+ titleRender: { type: Function, required: false },
2705
+ contentRender: { type: Function, required: false },
2706
+ footerRender: { type: Function, required: false },
2707
+ confirmBtnConfig: { type: null, required: false, default: function () { return ({ show: true, content: '确定' }); } },
2708
+ cancelBtnConfig: { type: null, required: false, default: function () { return ({ show: true, content: '取消', plain: true }); } }
2709
+ }, emits: ["update:modelValue", "close"], setup: function (__props, _a) {
2710
+ var _this = this;
2711
+ var emits = _a.emit;
2712
+ var _props = __props;
2713
+ var props = _props;
2714
+ var show = ref(props.modelValue || false);
2715
+ watch(function () { return props.modelValue; }, function (newV) {
2716
+ show.value = newV || false;
2717
+ });
2718
+ var BaseDialogRender = defineComponent({
2719
+ name: 'dialog-render',
2720
+ props: {
2721
+ render: Function
2722
+ },
2723
+ render: function (ctx) {
2724
+ return ctx.render
2725
+ ? ctx.render(function () {
2726
+ return hanldeBeforeClose(function () {
2727
+ show.value = false;
2728
+ });
2729
+ })
2730
+ : '';
2731
+ }
2732
+ });
2733
+ var hanldeBeforeClose = function (done) { return __awaiter(_this, void 0, void 0, function () {
2734
+ return __generator(this, function (_a) {
2735
+ switch (_a.label) {
2736
+ case 0:
2737
+ if (!isFunction(props.beforeClose)) return [3 /*break*/, 2];
2738
+ return [4 /*yield*/, props.beforeClose(done)];
2739
+ case 1:
2740
+ _a.sent();
2741
+ return [3 /*break*/, 3];
2742
+ case 2:
2743
+ done();
2744
+ _a.label = 3;
2745
+ case 3:
2746
+ emits('close');
2747
+ return [2 /*return*/];
2748
+ }
2749
+ });
2750
+ }); };
2751
+ var handleClosed = function () {
2752
+ emits('update:modelValue', !props.modelValue);
2753
+ };
2754
+ var handleCancelClick = function () { return __awaiter(_this, void 0, void 0, function () {
2755
+ return __generator(this, function (_a) {
2756
+ switch (_a.label) {
2757
+ case 0:
2758
+ if (!isFunction(props.beforeCancel)) return [3 /*break*/, 2];
2759
+ return [4 /*yield*/, props.beforeCancel(function () {
2760
+ show.value = false;
2761
+ })];
2762
+ case 1:
2763
+ _a.sent();
2764
+ return [3 /*break*/, 3];
2765
+ case 2:
2766
+ show.value = false;
2767
+ _a.label = 3;
2768
+ case 3:
2769
+ emits('close');
2770
+ return [2 /*return*/];
2771
+ }
2772
+ });
2773
+ }); };
2774
+ var handleConfirmClick = function () { return __awaiter(_this, void 0, void 0, function () {
2775
+ return __generator(this, function (_a) {
2776
+ switch (_a.label) {
2777
+ case 0:
2778
+ if (!isFunction(props.beforeConfirm)) return [3 /*break*/, 2];
2779
+ return [4 /*yield*/, props.beforeConfirm(function () {
2780
+ show.value = false;
2781
+ })];
2782
+ case 1:
2783
+ _a.sent();
2784
+ return [3 /*break*/, 3];
2785
+ case 2:
2786
+ show.value = false;
2787
+ _a.label = 3;
2788
+ case 3:
2789
+ emits('close');
2790
+ return [2 /*return*/];
2791
+ }
2792
+ });
2793
+ }); };
2794
+ return function (_ctx, _cache) {
2795
+ return (openBlock(), createBlock(unref(ElDialog), {
2796
+ "custom-class": "".concat(__props.customClass, " ").concat(__props.showFooter ? '' : 'hide-footer'),
2797
+ modelValue: show.value,
2798
+ closeOnClickModal: __props.closeOnClickModal,
2799
+ closeOnPressEscape: __props.closeOnPressEscape,
2800
+ appendToBody: __props.appendToBody,
2801
+ destroyOnClose: __props.destroyOnClose,
2802
+ center: __props.center,
2803
+ width: __props.width,
2804
+ showClose: __props.showClose,
2805
+ "before-close": hanldeBeforeClose,
2806
+ onClosed: handleClosed
2807
+ }, {
2808
+ header: withCtx(function () { return [
2809
+ (__props.titleRender)
2810
+ ? (openBlock(), createBlock(unref(BaseDialogRender), {
2811
+ key: 0,
2812
+ render: __props.titleRender
2813
+ }, null, 8 /* PROPS */, ["render"]))
2814
+ : (__props.title)
2815
+ ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.title), 1 /* TEXT */))
2816
+ : renderSlot(_ctx.$slots, "header", { key: 2 })
2817
+ ]; }),
2818
+ footer: withCtx(function () { return [
2819
+ (__props.footerRender)
2820
+ ? (openBlock(), createBlock(unref(BaseDialogRender), {
2821
+ key: 0,
2822
+ render: __props.footerRender
2823
+ }, null, 8 /* PROPS */, ["render"]))
2824
+ : (__props.showFooter)
2825
+ ? (openBlock(), createElementBlock("div", _hoisted_2, [
2826
+ (__props.cancelBtnConfig.show)
2827
+ ? (openBlock(), createBlock(unref(BaseButton), mergeProps({ key: 0 }, __props.cancelBtnConfig, { click: handleCancelClick }), {
2828
+ default: withCtx(function () { return [
2829
+ createTextVNode(toDisplayString(__props.cancelBtnConfig.content), 1 /* TEXT */)
2830
+ ]; }),
2831
+ _: 1 /* STABLE */
2832
+ }, 16 /* FULL_PROPS */))
2833
+ : createCommentVNode("v-if", true),
2834
+ (__props.confirmBtnConfig.show)
2835
+ ? (openBlock(), createBlock(unref(BaseButton), mergeProps({ key: 1 }, __props.confirmBtnConfig, { click: handleConfirmClick }), {
2836
+ default: withCtx(function () { return [
2837
+ createTextVNode(toDisplayString(__props.confirmBtnConfig.content), 1 /* TEXT */)
2838
+ ]; }),
2839
+ _: 1 /* STABLE */
2840
+ }, 16 /* FULL_PROPS */))
2841
+ : createCommentVNode("v-if", true)
2842
+ ]))
2843
+ : createCommentVNode("v-if", true)
2844
+ ]; }),
2845
+ default: withCtx(function () { return [
2846
+ (__props.contentRender)
2847
+ ? (openBlock(), createBlock(unref(BaseDialogRender), {
2848
+ key: 0,
2849
+ render: __props.contentRender
2850
+ }, null, 8 /* PROPS */, ["render"]))
2851
+ : renderSlot(_ctx.$slots, "default", { key: 1 })
2852
+ ]; }),
2853
+ _: 3 /* FORWARDED */
2854
+ }, 8 /* PROPS */, ["custom-class", "modelValue", "closeOnClickModal", "closeOnPressEscape", "appendToBody", "destroyOnClose", "center", "width", "showClose"]));
2855
+ };
2856
+ } }));
2857
+
2858
+ script.__file = "packages/base/dialog/dialog.vue";
2859
+
2860
+ var BaseDialog = script;
2861
+ var createDialog = function (config) {
2862
+ var _a;
2863
+ var container = document.createElement('div');
2864
+ var customDialogCount = document.querySelectorAll('._xrk_create_dialog').length;
2865
+ container.classList.add('_xrk_create_dialog');
2866
+ container.style.position = 'relative';
2867
+ container.style.zIndex = "".concat(200 + customDialogCount);
2868
+ render(h(script, __assign(__assign({ modelValue: true }, (config || {})), { appendToBody: false, onClose: function () { return __awaiter(void 0, void 0, void 0, function () {
2869
+ var _a, _b;
2870
+ return __generator(this, function (_c) {
2871
+ switch (_c.label) {
2872
+ case 0: return [4 /*yield*/, ((_a = config === null || config === void 0 ? void 0 : config.onClose) === null || _a === void 0 ? void 0 : _a.call(config))];
2873
+ case 1:
2874
+ _c.sent();
2875
+ (_b = document.querySelector('body')) === null || _b === void 0 ? void 0 : _b.removeChild(container);
2876
+ return [2 /*return*/];
2877
+ }
2878
+ });
2879
+ }); } })), container);
2880
+ (_a = document.querySelector('body')) === null || _a === void 0 ? void 0 : _a.appendChild(container);
2881
+ };
2882
+
2883
+ /*
2884
+ * @Description:
2885
+ * @Date: 2022-07-05 16:34:24
2886
+ */
2887
+
2888
+ var AllComponents = /*#__PURE__*/Object.freeze({
2889
+ __proto__: null,
2890
+ BaseButton: BaseButton,
2891
+ BaseRadio: BaseRadio,
2892
+ BaseRadioGroup: BaseRadioGroup,
2893
+ BaseRadioButton: BaseRadioButton,
2894
+ BaseCheckbox: BaseCheckbox,
2895
+ BaseCheckboxGroup: BaseCheckboxGroup,
2896
+ BaseCheckboxButton: BaseCheckboxButton,
2897
+ BaseDatePicker: BaseDatePicker,
2898
+ BaseInput: BaseInput,
2899
+ BaseSelect: BaseSelect,
2900
+ BaseSwitch: BaseSwitch,
2901
+ BaseTag: BaseTag,
2902
+ BaseTagGroup: BaseTagGroup,
2903
+ BasePagination: BasePagination,
2904
+ BaseForm: BaseForm,
2905
+ BaseFormItem: BaseFormItem,
2906
+ XrkSearch: XrkSearch,
2907
+ BaseTable: BaseTable,
2908
+ XrkTable: XrkTable,
2909
+ BaseDialog: BaseDialog
2910
+ });
2911
+
2912
+ /*
2913
+ * @Description:
2914
+ * @Date: 2022-06-29 15:58:37
2915
+ */
2916
+ var useInputColumn = function (column) {
2917
+ return __assign(__assign({ type: 'input' }, column), { style: __assign({ width: '220px' }, (column.style || {})) });
2918
+ };
2919
+ var useSelectColumn = function (column) {
2920
+ return __assign(__assign({ type: 'select' }, column), { style: __assign({ width: '220px' }, (column.style || {})) });
2921
+ };
2922
+ var useDatePickerColumn = function (column) {
2923
+ var _a;
2924
+ return __assign(__assign({ type: 'datePicker' }, column), { style: __assign({ width: ['datetimerange', 'daterange', 'monthrange'].includes(((_a = column.config) === null || _a === void 0 ? void 0 : _a.type) || '')
2925
+ ? '280px'
2926
+ : '220px' }, (column.style || {})) });
2927
+ };
2928
+ var useSearchColumns = function (columns) {
2929
+ return columns.map(function (column) { return (__assign(__assign({}, column), { listener: column.listener || {}, config: __assign({ clearable: true }, (column.config || {})) })); });
2930
+ };
2931
+ var useSearchBtn = function (searchBtnConfig) {
2932
+ return __assign({ text: '搜索', show: true }, searchBtnConfig);
2933
+ };
2934
+ var useResetBtn = function (resetBtnConfig) {
2935
+ return __assign({ text: '重置', show: true }, resetBtnConfig);
2936
+ };
2937
+ var useOtherComponents = function (otherComponents) {
2938
+ return otherComponents;
2939
+ };
2940
+
2941
+ /*
2942
+ * @Description:
2943
+ * @Date: 2022-06-30 22:57:28
2944
+ */
2945
+ // 所有组件列表
2946
+ var components = Object.values(AllComponents).map(function (i) { return i; });
2947
+ var install = function (app) {
2948
+ app.use(ElementPlus, { namespace: 'xrk', locale: locale });
2949
+ components.map(function (component) {
2950
+ app.component(component.name, component);
2951
+ });
2952
+ };
2953
+ var index = {
2954
+ version: '0.3.2',
2955
+ install: install
2956
+ };
2957
+
2958
+ export { BaseButton, BaseCheckbox, BaseCheckboxButton, BaseCheckboxGroup, BaseDatePicker, BaseDialog, BaseForm, BaseFormItem, BaseInput, BasePagination, BaseRadio, BaseRadioButton, BaseRadioGroup, BaseSelect, BaseSwitch, BaseTable, BaseTag, BaseTagGroup, XrkSearch, XrkTable, createDialog, index as default, useDatePickerColumn, useInputColumn, useOtherComponents, useResetBtn, useSearchBtn, useSearchColumns, useSelectColumn, useTableColumn };