xrk-components 0.3.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.css +7 -2
- package/lib/index.esm.js +107 -46
- package/lib/index.umd.js +107 -46
- package/lib/packages/base/button/index.d.ts +1 -1
- package/lib/packages/base/dialog/dialog.d.ts +11 -0
- package/lib/packages/base/dialog/index.d.ts +4 -3
- package/lib/packages/base/select/index.d.ts +4 -1
- package/lib/packages/xrk/table/table.d.ts +0 -13
- package/lib/packages/xrk/table/types/type.d.ts +2 -2
- package/package.json +1 -1
- package/packages/base/button/button.vue +0 -83
- package/packages/base/button/index.ts +0 -26
- package/packages/base/checkbox/checkbox-button.vue +0 -54
- package/packages/base/checkbox/checkbox-group.vue +0 -85
- package/packages/base/checkbox/checkbox.vue +0 -85
- package/packages/base/checkbox/index.ts +0 -62
- package/packages/base/date-picker/date-picker.vue +0 -144
- package/packages/base/date-picker/index.ts +0 -52
- package/packages/base/dialog/dialog.vue +0 -214
- package/packages/base/dialog/index.ts +0 -57
- package/packages/base/form/form-item.vue +0 -57
- package/packages/base/form/form.vue +0 -70
- package/packages/base/form/index.ts +0 -39
- package/packages/base/input/index.ts +0 -50
- package/packages/base/input/input.vue +0 -175
- package/packages/base/pagination/index.ts +0 -30
- package/packages/base/pagination/pagination.vue +0 -160
- package/packages/base/radio/index.ts +0 -49
- package/packages/base/radio/radio-button.vue +0 -46
- package/packages/base/radio/radio-group.vue +0 -77
- package/packages/base/radio/radio.vue +0 -74
- package/packages/base/select/index.ts +0 -62
- package/packages/base/select/select.vue +0 -258
- package/packages/base/switch/index.ts +0 -26
- package/packages/base/switch/switch.vue +0 -103
- package/packages/base/table/hooks/use-table.ts +0 -15
- package/packages/base/table/index.ts +0 -16
- package/packages/base/table/store/index.ts +0 -35
- package/packages/base/table/table-column.vue +0 -351
- package/packages/base/table/table.vue +0 -168
- package/packages/base/table/types/type.ts +0 -123
- package/packages/base/tag/index.ts +0 -52
- package/packages/base/tag/tag-group.vue +0 -182
- package/packages/base/tag/tag.vue +0 -54
- package/packages/base/tool-tip/index.ts +0 -30
- package/packages/base/tool-tip/tool-tip.vue +0 -108
- package/packages/components.ts +0 -33
- package/packages/functions.ts +0 -16
- package/packages/index.ts +0 -30
- package/packages/types.ts +0 -54
- package/packages/xrk/search/hooks/use-search.ts +0 -96
- package/packages/xrk/search/index.ts +0 -22
- package/packages/xrk/search/search.vue +0 -197
- package/packages/xrk/search/types/type.ts +0 -95
- package/packages/xrk/table/hooks/use-table.tsx +0 -34
- package/packages/xrk/table/index.ts +0 -10
- package/packages/xrk/table/table.vue +0 -218
- package/packages/xrk/table/types/type.ts +0 -31
- package/rollup.config.js +0 -59
- package/styles/element/index.scss +0 -5
- package/styles/element/mixin.scss +0 -40
- package/tools/check.ts +0 -9
package/lib/index.css
CHANGED
|
@@ -18423,6 +18423,9 @@
|
|
|
18423
18423
|
.base-pagination[data-v-1a7c8335] .el-input__suffix {
|
|
18424
18424
|
right: 12px;
|
|
18425
18425
|
}
|
|
18426
|
+
.base-form-item[data-v-17eda5db] .xrk-form-item__label {
|
|
18427
|
+
font-weight: 700;
|
|
18428
|
+
}
|
|
18426
18429
|
.xrk-search[data-v-a1781a06] > .xrk-form {
|
|
18427
18430
|
display: -webkit-box;
|
|
18428
18431
|
display: -webkit-flex;
|
|
@@ -18530,8 +18533,7 @@
|
|
|
18530
18533
|
flex-direction: column;
|
|
18531
18534
|
}
|
|
18532
18535
|
._base-dialog .xrk-dialog__header {
|
|
18533
|
-
font-size:
|
|
18534
|
-
font-weight: 500;
|
|
18536
|
+
font-size: 20px;
|
|
18535
18537
|
color: #303133;
|
|
18536
18538
|
line-height: 1.4;
|
|
18537
18539
|
margin-right: 0;
|
|
@@ -18552,4 +18554,7 @@
|
|
|
18552
18554
|
}
|
|
18553
18555
|
._base-dialog .xrk-dialog__body::-webkit-scrollbar-track {
|
|
18554
18556
|
border-radius: 10px;
|
|
18557
|
+
}
|
|
18558
|
+
._base-dialog.hide-footer .xrk-dialog__footer {
|
|
18559
|
+
display: none !important;
|
|
18555
18560
|
}
|
package/lib/index.esm.js
CHANGED
|
@@ -1069,7 +1069,7 @@ var script$b = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$b
|
|
|
1069
1069
|
var _Reflect = Reflect;
|
|
1070
1070
|
var props = _props;
|
|
1071
1071
|
var setOptionsData = function (val) { return __awaiter(_this, void 0, void 0, function () {
|
|
1072
|
-
var data, error_1;
|
|
1072
|
+
var res, data, error_1;
|
|
1073
1073
|
var _a;
|
|
1074
1074
|
return __generator(this, function (_b) {
|
|
1075
1075
|
switch (_b.label) {
|
|
@@ -1081,11 +1081,18 @@ var script$b = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$b
|
|
|
1081
1081
|
loading.value = true;
|
|
1082
1082
|
return [4 /*yield*/, ((_a = props.remoteMethod) === null || _a === void 0 ? void 0 : _a.call(props, val))];
|
|
1083
1083
|
case 2:
|
|
1084
|
-
|
|
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
|
+
: [];
|
|
1085
1092
|
loading.value = false;
|
|
1086
1093
|
// 避免多次请求接口 接口响应先后顺序不一致导致数据错乱
|
|
1087
1094
|
_options.value = Array.isArray(data)
|
|
1088
|
-
? data.filter(function (i) { return !val || "".concat(i[props.
|
|
1095
|
+
? data.filter(function (i) { return !val || "".concat(i[props.labelKey || 'label']).indexOf(val) > -1; })
|
|
1089
1096
|
: [];
|
|
1090
1097
|
return [3 /*break*/, 4];
|
|
1091
1098
|
case 3:
|
|
@@ -1104,7 +1111,7 @@ var script$b = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$b
|
|
|
1104
1111
|
loading.value = true;
|
|
1105
1112
|
debounceSetOptionsData(val);
|
|
1106
1113
|
}
|
|
1107
|
-
:
|
|
1114
|
+
: props.filterMethod);
|
|
1108
1115
|
var toolTipDisabled = ref(true);
|
|
1109
1116
|
var loading = ref(false);
|
|
1110
1117
|
var _options = ref(props.options);
|
|
@@ -1691,15 +1698,49 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1691
1698
|
size: { type: String, required: false },
|
|
1692
1699
|
disabled: { type: Boolean, required: false }
|
|
1693
1700
|
}, setup: function (__props, _a) {
|
|
1694
|
-
var _b, _c, _d, _e, _f;
|
|
1695
1701
|
var expose = _a.expose;
|
|
1696
1702
|
var BaseForm = ref(null);
|
|
1697
1703
|
expose({
|
|
1698
|
-
validate: (
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
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
|
+
}
|
|
1703
1744
|
});
|
|
1704
1745
|
return function (_ctx, _cache) {
|
|
1705
1746
|
return (openBlock(), createBlock(unref(ElForm), {
|
|
@@ -1752,6 +1793,7 @@ var script$5 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$5
|
|
|
1752
1793
|
});
|
|
1753
1794
|
return function (_ctx, _cache) {
|
|
1754
1795
|
return (openBlock(), createBlock(unref(ElFormItem), {
|
|
1796
|
+
class: "base-form-item",
|
|
1755
1797
|
ref_key: "BaseFormItem",
|
|
1756
1798
|
ref: BaseFormItem,
|
|
1757
1799
|
prop: __props.prop,
|
|
@@ -1772,6 +1814,7 @@ var script$5 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$5
|
|
|
1772
1814
|
};
|
|
1773
1815
|
} }));
|
|
1774
1816
|
|
|
1817
|
+
script$5.__scopeId = "data-v-17eda5db";
|
|
1775
1818
|
script$5.__file = "packages/base/form/form-item.vue";
|
|
1776
1819
|
|
|
1777
1820
|
var BaseFormItem = script$5;
|
|
@@ -2195,11 +2238,11 @@ var script$2 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$2
|
|
|
2195
2238
|
return props.formatter({
|
|
2196
2239
|
row: row,
|
|
2197
2240
|
column: column,
|
|
2198
|
-
cellValue:
|
|
2241
|
+
cellValue: props.prop && row[props.prop],
|
|
2199
2242
|
index: index
|
|
2200
2243
|
});
|
|
2201
2244
|
}
|
|
2202
|
-
return
|
|
2245
|
+
return props.prop && row[props.prop];
|
|
2203
2246
|
};
|
|
2204
2247
|
var selectionRows = props.selectionRows, addSelectionRow = props.addSelectionRow, removeSelectionRow = props.removeSelectionRow, getSelectionRows = props.getSelectionRows;
|
|
2205
2248
|
var checked = computed(function () {
|
|
@@ -2499,12 +2542,7 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2499
2542
|
getListAjax: { type: Function, required: true },
|
|
2500
2543
|
searchConfig: { type: Object, required: true },
|
|
2501
2544
|
tableConfig: { type: Object, required: true },
|
|
2502
|
-
paginationConfig: { type: Object, required: false
|
|
2503
|
-
pageNoKey: 'pageNo',
|
|
2504
|
-
pageSizeKey: 'pageSize',
|
|
2505
|
-
paginationPageSize: 60,
|
|
2506
|
-
paginationCurrentPage: 1
|
|
2507
|
-
}); } }
|
|
2545
|
+
paginationConfig: { type: Object, required: false }
|
|
2508
2546
|
}, setup: function (__props, _a) {
|
|
2509
2547
|
var _b;
|
|
2510
2548
|
var _c, _d;
|
|
@@ -2512,15 +2550,16 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2512
2550
|
var _props = __props;
|
|
2513
2551
|
var props = _props;
|
|
2514
2552
|
var vLoading$1 = vLoading;
|
|
2553
|
+
var paginationConfig = computed(function () { return (__assign({ pageNoKey: 'pageNo', pageSizeKey: 'pageSize', paginationPageSize: 60, paginationCurrentPage: 1 }, (props.paginationConfig || {}))); });
|
|
2515
2554
|
var TableSelectionRows = ref([]);
|
|
2516
2555
|
var XrkSearchRef = ref(null);
|
|
2517
2556
|
var XrkTablebaseTableRef = ref(null);
|
|
2518
2557
|
var BasePaginationRef = ref(null);
|
|
2519
|
-
var pageNoKey =
|
|
2520
|
-
var pageSizeKey =
|
|
2558
|
+
var pageNoKey = paginationConfig.value.pageNoKey;
|
|
2559
|
+
var pageSizeKey = paginationConfig.value.pageSizeKey;
|
|
2521
2560
|
var paginationQuery = ref((_b = {},
|
|
2522
|
-
_b[pageNoKey] = (_c =
|
|
2523
|
-
_b[pageSizeKey] = (_d =
|
|
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,
|
|
2524
2563
|
_b));
|
|
2525
2564
|
var searchQuery = ref({});
|
|
2526
2565
|
var query = computed(function () { return (__assign(__assign({}, paginationQuery.value), searchQuery.value)); });
|
|
@@ -2628,8 +2667,8 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2628
2667
|
ref_key: "BasePaginationRef",
|
|
2629
2668
|
ref: BasePaginationRef,
|
|
2630
2669
|
total: unref(paginationTotal),
|
|
2631
|
-
pageSize:
|
|
2632
|
-
currentPage:
|
|
2670
|
+
pageSize: unref(paginationConfig).paginationPageSize,
|
|
2671
|
+
currentPage: unref(paginationConfig).paginationCurrentPage,
|
|
2633
2672
|
onSizeChange: handlePageChange,
|
|
2634
2673
|
onCurrentChange: handlePageChange
|
|
2635
2674
|
}, null, 8 /* PROPS */, ["total", "pageSize", "currentPage"])
|
|
@@ -2643,6 +2682,7 @@ var XrkTable = script$1;
|
|
|
2643
2682
|
|
|
2644
2683
|
var _hoisted_1 = { key: 1 };
|
|
2645
2684
|
var _hoisted_2 = { key: 1 };
|
|
2685
|
+
var _hoisted_3 = { key: 1 };
|
|
2646
2686
|
var __default__ = {
|
|
2647
2687
|
name: 'base-dialog'
|
|
2648
2688
|
};
|
|
@@ -2661,6 +2701,7 @@ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), {
|
|
|
2661
2701
|
width: { type: [String, Number], required: false, default: '50%' },
|
|
2662
2702
|
title: { type: String, required: false, default: '提示' },
|
|
2663
2703
|
content: { type: String, required: false },
|
|
2704
|
+
showFooter: { type: Boolean, required: false, default: true },
|
|
2664
2705
|
titleRender: { type: Function, required: false },
|
|
2665
2706
|
contentRender: { type: Function, required: false },
|
|
2666
2707
|
footerRender: { type: Function, required: false },
|
|
@@ -2681,7 +2722,13 @@ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), {
|
|
|
2681
2722
|
render: Function
|
|
2682
2723
|
},
|
|
2683
2724
|
render: function (ctx) {
|
|
2684
|
-
return ctx.render
|
|
2725
|
+
return ctx.render
|
|
2726
|
+
? ctx.render(function () {
|
|
2727
|
+
return hanldeBeforeClose(function () {
|
|
2728
|
+
show.value = false;
|
|
2729
|
+
});
|
|
2730
|
+
})
|
|
2731
|
+
: '';
|
|
2685
2732
|
}
|
|
2686
2733
|
});
|
|
2687
2734
|
var hanldeBeforeClose = function (done) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -2747,7 +2794,7 @@ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), {
|
|
|
2747
2794
|
}); };
|
|
2748
2795
|
return function (_ctx, _cache) {
|
|
2749
2796
|
return (openBlock(), createBlock(unref(ElDialog), {
|
|
2750
|
-
"custom-class": __props.customClass,
|
|
2797
|
+
"custom-class": "".concat(__props.customClass, " ").concat(__props.showFooter ? '' : 'hide-footer'),
|
|
2751
2798
|
modelValue: show.value,
|
|
2752
2799
|
closeOnClickModal: __props.closeOnClickModal,
|
|
2753
2800
|
closeOnPressEscape: __props.closeOnPressEscape,
|
|
@@ -2775,24 +2822,32 @@ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), {
|
|
|
2775
2822
|
key: 0,
|
|
2776
2823
|
render: __props.footerRender
|
|
2777
2824
|
}, null, 8 /* PROPS */, ["render"]))
|
|
2778
|
-
: (
|
|
2779
|
-
(
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2825
|
+
: (__props.showFooter)
|
|
2826
|
+
? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2827
|
+
(__props.cancelBtnConfig.show)
|
|
2828
|
+
? (openBlock(), createBlock(unref(BaseButton), mergeProps({
|
|
2829
|
+
key: 0,
|
|
2830
|
+
size: "large"
|
|
2831
|
+
}, __props.cancelBtnConfig, { click: handleCancelClick }), {
|
|
2832
|
+
default: withCtx(function () { return [
|
|
2833
|
+
createTextVNode(toDisplayString(__props.cancelBtnConfig.content), 1 /* TEXT */)
|
|
2834
|
+
]; }),
|
|
2835
|
+
_: 1 /* STABLE */
|
|
2836
|
+
}, 16 /* FULL_PROPS */))
|
|
2837
|
+
: createCommentVNode("v-if", true),
|
|
2838
|
+
(__props.confirmBtnConfig.show)
|
|
2839
|
+
? (openBlock(), createBlock(unref(BaseButton), mergeProps({
|
|
2840
|
+
key: 1,
|
|
2841
|
+
size: "large"
|
|
2842
|
+
}, __props.confirmBtnConfig, { click: handleConfirmClick }), {
|
|
2843
|
+
default: withCtx(function () { return [
|
|
2844
|
+
createTextVNode(toDisplayString(__props.confirmBtnConfig.content), 1 /* TEXT */)
|
|
2845
|
+
]; }),
|
|
2846
|
+
_: 1 /* STABLE */
|
|
2847
|
+
}, 16 /* FULL_PROPS */))
|
|
2848
|
+
: createCommentVNode("v-if", true)
|
|
2849
|
+
]))
|
|
2850
|
+
: createCommentVNode("v-if", true)
|
|
2796
2851
|
]; }),
|
|
2797
2852
|
default: withCtx(function () { return [
|
|
2798
2853
|
(__props.contentRender)
|
|
@@ -2800,7 +2855,9 @@ var script = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__), {
|
|
|
2800
2855
|
key: 0,
|
|
2801
2856
|
render: __props.contentRender
|
|
2802
2857
|
}, null, 8 /* PROPS */, ["render"]))
|
|
2803
|
-
:
|
|
2858
|
+
: (__props.content)
|
|
2859
|
+
? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.content), 1 /* TEXT */))
|
|
2860
|
+
: renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
2804
2861
|
]; }),
|
|
2805
2862
|
_: 3 /* FORWARDED */
|
|
2806
2863
|
}, 8 /* PROPS */, ["custom-class", "modelValue", "closeOnClickModal", "closeOnPressEscape", "appendToBody", "destroyOnClose", "center", "width", "showClose"]));
|
|
@@ -2813,6 +2870,10 @@ var BaseDialog = script;
|
|
|
2813
2870
|
var createDialog = function (config) {
|
|
2814
2871
|
var _a;
|
|
2815
2872
|
var container = document.createElement('div');
|
|
2873
|
+
var customDialogCount = document.querySelectorAll('._xrk_create_dialog').length;
|
|
2874
|
+
container.classList.add('_xrk_create_dialog');
|
|
2875
|
+
container.style.position = 'relative';
|
|
2876
|
+
container.style.zIndex = "".concat(200 + customDialogCount);
|
|
2816
2877
|
render(h(script, __assign(__assign({ modelValue: true }, (config || {})), { appendToBody: false, onClose: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2817
2878
|
var _a, _b;
|
|
2818
2879
|
return __generator(this, function (_c) {
|
|
@@ -2899,7 +2960,7 @@ var install = function (app) {
|
|
|
2899
2960
|
});
|
|
2900
2961
|
};
|
|
2901
2962
|
var index = {
|
|
2902
|
-
version: '0.3.
|
|
2963
|
+
version: '0.3.3',
|
|
2903
2964
|
install: install
|
|
2904
2965
|
};
|
|
2905
2966
|
|
package/lib/index.umd.js
CHANGED
|
@@ -1075,7 +1075,7 @@
|
|
|
1075
1075
|
var _Reflect = Reflect;
|
|
1076
1076
|
var props = _props;
|
|
1077
1077
|
var setOptionsData = function (val) { return __awaiter(_this, void 0, void 0, function () {
|
|
1078
|
-
var data, error_1;
|
|
1078
|
+
var res, data, error_1;
|
|
1079
1079
|
var _a;
|
|
1080
1080
|
return __generator(this, function (_b) {
|
|
1081
1081
|
switch (_b.label) {
|
|
@@ -1087,11 +1087,18 @@
|
|
|
1087
1087
|
loading.value = true;
|
|
1088
1088
|
return [4 /*yield*/, ((_a = props.remoteMethod) === null || _a === void 0 ? void 0 : _a.call(props, val))];
|
|
1089
1089
|
case 2:
|
|
1090
|
-
|
|
1090
|
+
res = _b.sent();
|
|
1091
|
+
data = xrkTools.check.isObject(res.data)
|
|
1092
|
+
? Array.isArray(res.data.list)
|
|
1093
|
+
? res.data.list
|
|
1094
|
+
: []
|
|
1095
|
+
: Array.isArray(res.data)
|
|
1096
|
+
? res.data
|
|
1097
|
+
: [];
|
|
1091
1098
|
loading.value = false;
|
|
1092
1099
|
// 避免多次请求接口 接口响应先后顺序不一致导致数据错乱
|
|
1093
1100
|
_options.value = Array.isArray(data)
|
|
1094
|
-
? data.filter(function (i) { return !val || "".concat(i[props.
|
|
1101
|
+
? data.filter(function (i) { return !val || "".concat(i[props.labelKey || 'label']).indexOf(val) > -1; })
|
|
1095
1102
|
: [];
|
|
1096
1103
|
return [3 /*break*/, 4];
|
|
1097
1104
|
case 3:
|
|
@@ -1110,7 +1117,7 @@
|
|
|
1110
1117
|
loading.value = true;
|
|
1111
1118
|
debounceSetOptionsData(val);
|
|
1112
1119
|
}
|
|
1113
|
-
:
|
|
1120
|
+
: props.filterMethod);
|
|
1114
1121
|
var toolTipDisabled = vue.ref(true);
|
|
1115
1122
|
var loading = vue.ref(false);
|
|
1116
1123
|
var _options = vue.ref(props.options);
|
|
@@ -1697,15 +1704,49 @@
|
|
|
1697
1704
|
size: { type: String, required: false },
|
|
1698
1705
|
disabled: { type: Boolean, required: false }
|
|
1699
1706
|
}, setup: function (__props, _a) {
|
|
1700
|
-
var _b, _c, _d, _e, _f;
|
|
1701
1707
|
var expose = _a.expose;
|
|
1702
1708
|
var BaseForm = vue.ref(null);
|
|
1703
1709
|
expose({
|
|
1704
|
-
validate: (
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1710
|
+
validate: function () {
|
|
1711
|
+
var _a;
|
|
1712
|
+
var args = [];
|
|
1713
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1714
|
+
args[_i] = arguments[_i];
|
|
1715
|
+
}
|
|
1716
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate.apply(_a, args);
|
|
1717
|
+
},
|
|
1718
|
+
validateField: function () {
|
|
1719
|
+
var _a;
|
|
1720
|
+
var args = [];
|
|
1721
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1722
|
+
args[_i] = arguments[_i];
|
|
1723
|
+
}
|
|
1724
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField.apply(_a, args);
|
|
1725
|
+
},
|
|
1726
|
+
resetFields: function () {
|
|
1727
|
+
var _a;
|
|
1728
|
+
var args = [];
|
|
1729
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1730
|
+
args[_i] = arguments[_i];
|
|
1731
|
+
}
|
|
1732
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields.apply(_a, args);
|
|
1733
|
+
},
|
|
1734
|
+
scrollToField: function () {
|
|
1735
|
+
var _a;
|
|
1736
|
+
var args = [];
|
|
1737
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1738
|
+
args[_i] = arguments[_i];
|
|
1739
|
+
}
|
|
1740
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField.apply(_a, args);
|
|
1741
|
+
},
|
|
1742
|
+
clearValidate: function () {
|
|
1743
|
+
var _a;
|
|
1744
|
+
var args = [];
|
|
1745
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1746
|
+
args[_i] = arguments[_i];
|
|
1747
|
+
}
|
|
1748
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate.apply(_a, args);
|
|
1749
|
+
}
|
|
1709
1750
|
});
|
|
1710
1751
|
return function (_ctx, _cache) {
|
|
1711
1752
|
return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElForm), {
|
|
@@ -1758,6 +1799,7 @@
|
|
|
1758
1799
|
});
|
|
1759
1800
|
return function (_ctx, _cache) {
|
|
1760
1801
|
return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElFormItem), {
|
|
1802
|
+
class: "base-form-item",
|
|
1761
1803
|
ref_key: "BaseFormItem",
|
|
1762
1804
|
ref: BaseFormItem,
|
|
1763
1805
|
prop: __props.prop,
|
|
@@ -1778,6 +1820,7 @@
|
|
|
1778
1820
|
};
|
|
1779
1821
|
} }));
|
|
1780
1822
|
|
|
1823
|
+
script$5.__scopeId = "data-v-17eda5db";
|
|
1781
1824
|
script$5.__file = "packages/base/form/form-item.vue";
|
|
1782
1825
|
|
|
1783
1826
|
var BaseFormItem = script$5;
|
|
@@ -2201,11 +2244,11 @@
|
|
|
2201
2244
|
return props.formatter({
|
|
2202
2245
|
row: row,
|
|
2203
2246
|
column: column,
|
|
2204
|
-
cellValue:
|
|
2247
|
+
cellValue: props.prop && row[props.prop],
|
|
2205
2248
|
index: index
|
|
2206
2249
|
});
|
|
2207
2250
|
}
|
|
2208
|
-
return
|
|
2251
|
+
return props.prop && row[props.prop];
|
|
2209
2252
|
};
|
|
2210
2253
|
var selectionRows = props.selectionRows, addSelectionRow = props.addSelectionRow, removeSelectionRow = props.removeSelectionRow, getSelectionRows = props.getSelectionRows;
|
|
2211
2254
|
var checked = vue.computed(function () {
|
|
@@ -2505,12 +2548,7 @@
|
|
|
2505
2548
|
getListAjax: { type: Function, required: true },
|
|
2506
2549
|
searchConfig: { type: Object, required: true },
|
|
2507
2550
|
tableConfig: { type: Object, required: true },
|
|
2508
|
-
paginationConfig: { type: Object, required: false
|
|
2509
|
-
pageNoKey: 'pageNo',
|
|
2510
|
-
pageSizeKey: 'pageSize',
|
|
2511
|
-
paginationPageSize: 60,
|
|
2512
|
-
paginationCurrentPage: 1
|
|
2513
|
-
}); } }
|
|
2551
|
+
paginationConfig: { type: Object, required: false }
|
|
2514
2552
|
}, setup: function (__props, _a) {
|
|
2515
2553
|
var _b;
|
|
2516
2554
|
var _c, _d;
|
|
@@ -2518,15 +2556,16 @@
|
|
|
2518
2556
|
var _props = __props;
|
|
2519
2557
|
var props = _props;
|
|
2520
2558
|
var vLoading = ElementPlus.vLoading;
|
|
2559
|
+
var paginationConfig = vue.computed(function () { return (__assign({ pageNoKey: 'pageNo', pageSizeKey: 'pageSize', paginationPageSize: 60, paginationCurrentPage: 1 }, (props.paginationConfig || {}))); });
|
|
2521
2560
|
var TableSelectionRows = vue.ref([]);
|
|
2522
2561
|
var XrkSearchRef = vue.ref(null);
|
|
2523
2562
|
var XrkTablebaseTableRef = vue.ref(null);
|
|
2524
2563
|
var BasePaginationRef = vue.ref(null);
|
|
2525
|
-
var pageNoKey =
|
|
2526
|
-
var pageSizeKey =
|
|
2564
|
+
var pageNoKey = paginationConfig.value.pageNoKey;
|
|
2565
|
+
var pageSizeKey = paginationConfig.value.pageSizeKey;
|
|
2527
2566
|
var paginationQuery = vue.ref((_b = {},
|
|
2528
|
-
_b[pageNoKey] = (_c =
|
|
2529
|
-
_b[pageSizeKey] = (_d =
|
|
2567
|
+
_b[pageNoKey] = (_c = paginationConfig.value) === null || _c === void 0 ? void 0 : _c.paginationCurrentPage,
|
|
2568
|
+
_b[pageSizeKey] = (_d = paginationConfig.value) === null || _d === void 0 ? void 0 : _d.paginationPageSize,
|
|
2530
2569
|
_b));
|
|
2531
2570
|
var searchQuery = vue.ref({});
|
|
2532
2571
|
var query = vue.computed(function () { return (__assign(__assign({}, paginationQuery.value), searchQuery.value)); });
|
|
@@ -2634,8 +2673,8 @@
|
|
|
2634
2673
|
ref_key: "BasePaginationRef",
|
|
2635
2674
|
ref: BasePaginationRef,
|
|
2636
2675
|
total: vue.unref(paginationTotal),
|
|
2637
|
-
pageSize:
|
|
2638
|
-
currentPage:
|
|
2676
|
+
pageSize: vue.unref(paginationConfig).paginationPageSize,
|
|
2677
|
+
currentPage: vue.unref(paginationConfig).paginationCurrentPage,
|
|
2639
2678
|
onSizeChange: handlePageChange,
|
|
2640
2679
|
onCurrentChange: handlePageChange
|
|
2641
2680
|
}, null, 8 /* PROPS */, ["total", "pageSize", "currentPage"])
|
|
@@ -2649,6 +2688,7 @@
|
|
|
2649
2688
|
|
|
2650
2689
|
var _hoisted_1 = { key: 1 };
|
|
2651
2690
|
var _hoisted_2 = { key: 1 };
|
|
2691
|
+
var _hoisted_3 = { key: 1 };
|
|
2652
2692
|
var __default__ = {
|
|
2653
2693
|
name: 'base-dialog'
|
|
2654
2694
|
};
|
|
@@ -2667,6 +2707,7 @@
|
|
|
2667
2707
|
width: { type: [String, Number], required: false, default: '50%' },
|
|
2668
2708
|
title: { type: String, required: false, default: '提示' },
|
|
2669
2709
|
content: { type: String, required: false },
|
|
2710
|
+
showFooter: { type: Boolean, required: false, default: true },
|
|
2670
2711
|
titleRender: { type: Function, required: false },
|
|
2671
2712
|
contentRender: { type: Function, required: false },
|
|
2672
2713
|
footerRender: { type: Function, required: false },
|
|
@@ -2687,7 +2728,13 @@
|
|
|
2687
2728
|
render: Function
|
|
2688
2729
|
},
|
|
2689
2730
|
render: function (ctx) {
|
|
2690
|
-
return ctx.render
|
|
2731
|
+
return ctx.render
|
|
2732
|
+
? ctx.render(function () {
|
|
2733
|
+
return hanldeBeforeClose(function () {
|
|
2734
|
+
show.value = false;
|
|
2735
|
+
});
|
|
2736
|
+
})
|
|
2737
|
+
: '';
|
|
2691
2738
|
}
|
|
2692
2739
|
});
|
|
2693
2740
|
var hanldeBeforeClose = function (done) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -2753,7 +2800,7 @@
|
|
|
2753
2800
|
}); };
|
|
2754
2801
|
return function (_ctx, _cache) {
|
|
2755
2802
|
return (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDialog), {
|
|
2756
|
-
"custom-class": __props.customClass,
|
|
2803
|
+
"custom-class": "".concat(__props.customClass, " ").concat(__props.showFooter ? '' : 'hide-footer'),
|
|
2757
2804
|
modelValue: show.value,
|
|
2758
2805
|
closeOnClickModal: __props.closeOnClickModal,
|
|
2759
2806
|
closeOnPressEscape: __props.closeOnPressEscape,
|
|
@@ -2781,24 +2828,32 @@
|
|
|
2781
2828
|
key: 0,
|
|
2782
2829
|
render: __props.footerRender
|
|
2783
2830
|
}, null, 8 /* PROPS */, ["render"]))
|
|
2784
|
-
: (
|
|
2785
|
-
(
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2831
|
+
: (__props.showFooter)
|
|
2832
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
2833
|
+
(__props.cancelBtnConfig.show)
|
|
2834
|
+
? (vue.openBlock(), vue.createBlock(vue.unref(BaseButton), vue.mergeProps({
|
|
2835
|
+
key: 0,
|
|
2836
|
+
size: "large"
|
|
2837
|
+
}, __props.cancelBtnConfig, { click: handleCancelClick }), {
|
|
2838
|
+
default: vue.withCtx(function () { return [
|
|
2839
|
+
vue.createTextVNode(vue.toDisplayString(__props.cancelBtnConfig.content), 1 /* TEXT */)
|
|
2840
|
+
]; }),
|
|
2841
|
+
_: 1 /* STABLE */
|
|
2842
|
+
}, 16 /* FULL_PROPS */))
|
|
2843
|
+
: vue.createCommentVNode("v-if", true),
|
|
2844
|
+
(__props.confirmBtnConfig.show)
|
|
2845
|
+
? (vue.openBlock(), vue.createBlock(vue.unref(BaseButton), vue.mergeProps({
|
|
2846
|
+
key: 1,
|
|
2847
|
+
size: "large"
|
|
2848
|
+
}, __props.confirmBtnConfig, { click: handleConfirmClick }), {
|
|
2849
|
+
default: vue.withCtx(function () { return [
|
|
2850
|
+
vue.createTextVNode(vue.toDisplayString(__props.confirmBtnConfig.content), 1 /* TEXT */)
|
|
2851
|
+
]; }),
|
|
2852
|
+
_: 1 /* STABLE */
|
|
2853
|
+
}, 16 /* FULL_PROPS */))
|
|
2854
|
+
: vue.createCommentVNode("v-if", true)
|
|
2855
|
+
]))
|
|
2856
|
+
: vue.createCommentVNode("v-if", true)
|
|
2802
2857
|
]; }),
|
|
2803
2858
|
default: vue.withCtx(function () { return [
|
|
2804
2859
|
(__props.contentRender)
|
|
@@ -2806,7 +2861,9 @@
|
|
|
2806
2861
|
key: 0,
|
|
2807
2862
|
render: __props.contentRender
|
|
2808
2863
|
}, null, 8 /* PROPS */, ["render"]))
|
|
2809
|
-
:
|
|
2864
|
+
: (__props.content)
|
|
2865
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, vue.toDisplayString(__props.content), 1 /* TEXT */))
|
|
2866
|
+
: vue.renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
2810
2867
|
]; }),
|
|
2811
2868
|
_: 3 /* FORWARDED */
|
|
2812
2869
|
}, 8 /* PROPS */, ["custom-class", "modelValue", "closeOnClickModal", "closeOnPressEscape", "appendToBody", "destroyOnClose", "center", "width", "showClose"]));
|
|
@@ -2819,6 +2876,10 @@
|
|
|
2819
2876
|
var createDialog = function (config) {
|
|
2820
2877
|
var _a;
|
|
2821
2878
|
var container = document.createElement('div');
|
|
2879
|
+
var customDialogCount = document.querySelectorAll('._xrk_create_dialog').length;
|
|
2880
|
+
container.classList.add('_xrk_create_dialog');
|
|
2881
|
+
container.style.position = 'relative';
|
|
2882
|
+
container.style.zIndex = "".concat(200 + customDialogCount);
|
|
2822
2883
|
vue.render(vue.h(script, __assign(__assign({ modelValue: true }, (config || {})), { appendToBody: false, onClose: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2823
2884
|
var _a, _b;
|
|
2824
2885
|
return __generator(this, function (_c) {
|
|
@@ -2905,7 +2966,7 @@
|
|
|
2905
2966
|
});
|
|
2906
2967
|
};
|
|
2907
2968
|
var index = {
|
|
2908
|
-
version: '0.3.
|
|
2969
|
+
version: '0.3.3',
|
|
2909
2970
|
install: install
|
|
2910
2971
|
};
|
|
2911
2972
|
|
|
@@ -4,7 +4,7 @@ export declare type BaseButtonProps = {
|
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
loadingIcon?: string | Component;
|
|
6
6
|
size?: 'large' | 'default' | 'small';
|
|
7
|
-
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
|
|
7
|
+
type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' | 'link';
|
|
8
8
|
plain?: boolean;
|
|
9
9
|
round?: boolean;
|
|
10
10
|
circle?: boolean;
|
|
@@ -65,6 +65,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
65
|
type: StringConstructor;
|
|
66
66
|
required: false;
|
|
67
67
|
};
|
|
68
|
+
showFooter: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
required: false;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
68
73
|
titleRender: {
|
|
69
74
|
type: FunctionConstructor;
|
|
70
75
|
required: false;
|
|
@@ -163,6 +168,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
163
168
|
type: StringConstructor;
|
|
164
169
|
required: false;
|
|
165
170
|
};
|
|
171
|
+
showFooter: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
required: false;
|
|
174
|
+
default: boolean;
|
|
175
|
+
};
|
|
166
176
|
titleRender: {
|
|
167
177
|
type: FunctionConstructor;
|
|
168
178
|
required: false;
|
|
@@ -206,6 +216,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
206
216
|
customClass: string;
|
|
207
217
|
width: string | number;
|
|
208
218
|
title: string;
|
|
219
|
+
showFooter: boolean;
|
|
209
220
|
confirmBtnConfig: any;
|
|
210
221
|
cancelBtnConfig: any;
|
|
211
222
|
}>;
|