xrk-components 0.3.1 → 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.
- package/lib/index.esm.js +30 -23
- package/lib/index.umd.js +30 -23
- package/package.json +1 -1
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,7 +1081,14 @@ 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)
|
|
@@ -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);
|
|
@@ -1700,7 +1707,7 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1700
1707
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1701
1708
|
args[_i] = arguments[_i];
|
|
1702
1709
|
}
|
|
1703
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate(args);
|
|
1710
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate.apply(_a, args);
|
|
1704
1711
|
},
|
|
1705
1712
|
validateField: function () {
|
|
1706
1713
|
var _a;
|
|
@@ -1708,7 +1715,7 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1708
1715
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1709
1716
|
args[_i] = arguments[_i];
|
|
1710
1717
|
}
|
|
1711
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField(args);
|
|
1718
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField.apply(_a, args);
|
|
1712
1719
|
},
|
|
1713
1720
|
resetFields: function () {
|
|
1714
1721
|
var _a;
|
|
@@ -1716,7 +1723,7 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1716
1723
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1717
1724
|
args[_i] = arguments[_i];
|
|
1718
1725
|
}
|
|
1719
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields(args);
|
|
1726
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields.apply(_a, args);
|
|
1720
1727
|
},
|
|
1721
1728
|
scrollToField: function () {
|
|
1722
1729
|
var _a;
|
|
@@ -1724,7 +1731,7 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1724
1731
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1725
1732
|
args[_i] = arguments[_i];
|
|
1726
1733
|
}
|
|
1727
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField(args);
|
|
1734
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField.apply(_a, args);
|
|
1728
1735
|
},
|
|
1729
1736
|
clearValidate: function () {
|
|
1730
1737
|
var _a;
|
|
@@ -1732,7 +1739,7 @@ var script$6 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$6
|
|
|
1732
1739
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1733
1740
|
args[_i] = arguments[_i];
|
|
1734
1741
|
}
|
|
1735
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate(args);
|
|
1742
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate.apply(_a, args);
|
|
1736
1743
|
}
|
|
1737
1744
|
});
|
|
1738
1745
|
return function (_ctx, _cache) {
|
|
@@ -2231,11 +2238,11 @@ var script$2 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$2
|
|
|
2231
2238
|
return props.formatter({
|
|
2232
2239
|
row: row,
|
|
2233
2240
|
column: column,
|
|
2234
|
-
cellValue:
|
|
2241
|
+
cellValue: props.prop && row[props.prop],
|
|
2235
2242
|
index: index
|
|
2236
2243
|
});
|
|
2237
2244
|
}
|
|
2238
|
-
return
|
|
2245
|
+
return props.prop && row[props.prop];
|
|
2239
2246
|
};
|
|
2240
2247
|
var selectionRows = props.selectionRows, addSelectionRow = props.addSelectionRow, removeSelectionRow = props.removeSelectionRow, getSelectionRows = props.getSelectionRows;
|
|
2241
2248
|
var checked = computed(function () {
|
|
@@ -2535,12 +2542,7 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2535
2542
|
getListAjax: { type: Function, required: true },
|
|
2536
2543
|
searchConfig: { type: Object, required: true },
|
|
2537
2544
|
tableConfig: { type: Object, required: true },
|
|
2538
|
-
paginationConfig: { type: Object, required: false
|
|
2539
|
-
pageNoKey: 'pageNo',
|
|
2540
|
-
pageSizeKey: 'pageSize',
|
|
2541
|
-
paginationPageSize: 60,
|
|
2542
|
-
paginationCurrentPage: 1
|
|
2543
|
-
}); } }
|
|
2545
|
+
paginationConfig: { type: Object, required: false }
|
|
2544
2546
|
}, setup: function (__props, _a) {
|
|
2545
2547
|
var _b;
|
|
2546
2548
|
var _c, _d;
|
|
@@ -2548,15 +2550,16 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2548
2550
|
var _props = __props;
|
|
2549
2551
|
var props = _props;
|
|
2550
2552
|
var vLoading$1 = vLoading;
|
|
2553
|
+
var paginationConfig = computed(function () { return (__assign({ pageNoKey: 'pageNo', pageSizeKey: 'pageSize', paginationPageSize: 60, paginationCurrentPage: 1 }, (props.paginationConfig || {}))); });
|
|
2551
2554
|
var TableSelectionRows = ref([]);
|
|
2552
2555
|
var XrkSearchRef = ref(null);
|
|
2553
2556
|
var XrkTablebaseTableRef = ref(null);
|
|
2554
2557
|
var BasePaginationRef = ref(null);
|
|
2555
|
-
var pageNoKey =
|
|
2556
|
-
var pageSizeKey =
|
|
2558
|
+
var pageNoKey = paginationConfig.value.pageNoKey;
|
|
2559
|
+
var pageSizeKey = paginationConfig.value.pageSizeKey;
|
|
2557
2560
|
var paginationQuery = ref((_b = {},
|
|
2558
|
-
_b[pageNoKey] = (_c =
|
|
2559
|
-
_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,
|
|
2560
2563
|
_b));
|
|
2561
2564
|
var searchQuery = ref({});
|
|
2562
2565
|
var query = computed(function () { return (__assign(__assign({}, paginationQuery.value), searchQuery.value)); });
|
|
@@ -2664,8 +2667,8 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
2664
2667
|
ref_key: "BasePaginationRef",
|
|
2665
2668
|
ref: BasePaginationRef,
|
|
2666
2669
|
total: unref(paginationTotal),
|
|
2667
|
-
pageSize:
|
|
2668
|
-
currentPage:
|
|
2670
|
+
pageSize: unref(paginationConfig).paginationPageSize,
|
|
2671
|
+
currentPage: unref(paginationConfig).paginationCurrentPage,
|
|
2669
2672
|
onSizeChange: handlePageChange,
|
|
2670
2673
|
onCurrentChange: handlePageChange
|
|
2671
2674
|
}, null, 8 /* PROPS */, ["total", "pageSize", "currentPage"])
|
|
@@ -2858,6 +2861,10 @@ var BaseDialog = script;
|
|
|
2858
2861
|
var createDialog = function (config) {
|
|
2859
2862
|
var _a;
|
|
2860
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);
|
|
2861
2868
|
render(h(script, __assign(__assign({ modelValue: true }, (config || {})), { appendToBody: false, onClose: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2862
2869
|
var _a, _b;
|
|
2863
2870
|
return __generator(this, function (_c) {
|
|
@@ -2944,7 +2951,7 @@ var install = function (app) {
|
|
|
2944
2951
|
});
|
|
2945
2952
|
};
|
|
2946
2953
|
var index = {
|
|
2947
|
-
version: '0.3.
|
|
2954
|
+
version: '0.3.2',
|
|
2948
2955
|
install: install
|
|
2949
2956
|
};
|
|
2950
2957
|
|
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,7 +1087,14 @@
|
|
|
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)
|
|
@@ -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);
|
|
@@ -1706,7 +1713,7 @@
|
|
|
1706
1713
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1707
1714
|
args[_i] = arguments[_i];
|
|
1708
1715
|
}
|
|
1709
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate(args);
|
|
1716
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validate.apply(_a, args);
|
|
1710
1717
|
},
|
|
1711
1718
|
validateField: function () {
|
|
1712
1719
|
var _a;
|
|
@@ -1714,7 +1721,7 @@
|
|
|
1714
1721
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1715
1722
|
args[_i] = arguments[_i];
|
|
1716
1723
|
}
|
|
1717
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField(args);
|
|
1724
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.validateField.apply(_a, args);
|
|
1718
1725
|
},
|
|
1719
1726
|
resetFields: function () {
|
|
1720
1727
|
var _a;
|
|
@@ -1722,7 +1729,7 @@
|
|
|
1722
1729
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1723
1730
|
args[_i] = arguments[_i];
|
|
1724
1731
|
}
|
|
1725
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields(args);
|
|
1732
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.resetFields.apply(_a, args);
|
|
1726
1733
|
},
|
|
1727
1734
|
scrollToField: function () {
|
|
1728
1735
|
var _a;
|
|
@@ -1730,7 +1737,7 @@
|
|
|
1730
1737
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1731
1738
|
args[_i] = arguments[_i];
|
|
1732
1739
|
}
|
|
1733
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField(args);
|
|
1740
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.scrollToField.apply(_a, args);
|
|
1734
1741
|
},
|
|
1735
1742
|
clearValidate: function () {
|
|
1736
1743
|
var _a;
|
|
@@ -1738,7 +1745,7 @@
|
|
|
1738
1745
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1739
1746
|
args[_i] = arguments[_i];
|
|
1740
1747
|
}
|
|
1741
|
-
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate(args);
|
|
1748
|
+
return (_a = BaseForm.value) === null || _a === void 0 ? void 0 : _a.clearValidate.apply(_a, args);
|
|
1742
1749
|
}
|
|
1743
1750
|
});
|
|
1744
1751
|
return function (_ctx, _cache) {
|
|
@@ -2237,11 +2244,11 @@
|
|
|
2237
2244
|
return props.formatter({
|
|
2238
2245
|
row: row,
|
|
2239
2246
|
column: column,
|
|
2240
|
-
cellValue:
|
|
2247
|
+
cellValue: props.prop && row[props.prop],
|
|
2241
2248
|
index: index
|
|
2242
2249
|
});
|
|
2243
2250
|
}
|
|
2244
|
-
return
|
|
2251
|
+
return props.prop && row[props.prop];
|
|
2245
2252
|
};
|
|
2246
2253
|
var selectionRows = props.selectionRows, addSelectionRow = props.addSelectionRow, removeSelectionRow = props.removeSelectionRow, getSelectionRows = props.getSelectionRows;
|
|
2247
2254
|
var checked = vue.computed(function () {
|
|
@@ -2541,12 +2548,7 @@
|
|
|
2541
2548
|
getListAjax: { type: Function, required: true },
|
|
2542
2549
|
searchConfig: { type: Object, required: true },
|
|
2543
2550
|
tableConfig: { type: Object, required: true },
|
|
2544
|
-
paginationConfig: { type: Object, required: false
|
|
2545
|
-
pageNoKey: 'pageNo',
|
|
2546
|
-
pageSizeKey: 'pageSize',
|
|
2547
|
-
paginationPageSize: 60,
|
|
2548
|
-
paginationCurrentPage: 1
|
|
2549
|
-
}); } }
|
|
2551
|
+
paginationConfig: { type: Object, required: false }
|
|
2550
2552
|
}, setup: function (__props, _a) {
|
|
2551
2553
|
var _b;
|
|
2552
2554
|
var _c, _d;
|
|
@@ -2554,15 +2556,16 @@
|
|
|
2554
2556
|
var _props = __props;
|
|
2555
2557
|
var props = _props;
|
|
2556
2558
|
var vLoading = ElementPlus.vLoading;
|
|
2559
|
+
var paginationConfig = vue.computed(function () { return (__assign({ pageNoKey: 'pageNo', pageSizeKey: 'pageSize', paginationPageSize: 60, paginationCurrentPage: 1 }, (props.paginationConfig || {}))); });
|
|
2557
2560
|
var TableSelectionRows = vue.ref([]);
|
|
2558
2561
|
var XrkSearchRef = vue.ref(null);
|
|
2559
2562
|
var XrkTablebaseTableRef = vue.ref(null);
|
|
2560
2563
|
var BasePaginationRef = vue.ref(null);
|
|
2561
|
-
var pageNoKey =
|
|
2562
|
-
var pageSizeKey =
|
|
2564
|
+
var pageNoKey = paginationConfig.value.pageNoKey;
|
|
2565
|
+
var pageSizeKey = paginationConfig.value.pageSizeKey;
|
|
2563
2566
|
var paginationQuery = vue.ref((_b = {},
|
|
2564
|
-
_b[pageNoKey] = (_c =
|
|
2565
|
-
_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,
|
|
2566
2569
|
_b));
|
|
2567
2570
|
var searchQuery = vue.ref({});
|
|
2568
2571
|
var query = vue.computed(function () { return (__assign(__assign({}, paginationQuery.value), searchQuery.value)); });
|
|
@@ -2670,8 +2673,8 @@
|
|
|
2670
2673
|
ref_key: "BasePaginationRef",
|
|
2671
2674
|
ref: BasePaginationRef,
|
|
2672
2675
|
total: vue.unref(paginationTotal),
|
|
2673
|
-
pageSize:
|
|
2674
|
-
currentPage:
|
|
2676
|
+
pageSize: vue.unref(paginationConfig).paginationPageSize,
|
|
2677
|
+
currentPage: vue.unref(paginationConfig).paginationCurrentPage,
|
|
2675
2678
|
onSizeChange: handlePageChange,
|
|
2676
2679
|
onCurrentChange: handlePageChange
|
|
2677
2680
|
}, null, 8 /* PROPS */, ["total", "pageSize", "currentPage"])
|
|
@@ -2864,6 +2867,10 @@
|
|
|
2864
2867
|
var createDialog = function (config) {
|
|
2865
2868
|
var _a;
|
|
2866
2869
|
var container = document.createElement('div');
|
|
2870
|
+
var customDialogCount = document.querySelectorAll('._xrk_create_dialog').length;
|
|
2871
|
+
container.classList.add('_xrk_create_dialog');
|
|
2872
|
+
container.style.position = 'relative';
|
|
2873
|
+
container.style.zIndex = "".concat(200 + customDialogCount);
|
|
2867
2874
|
vue.render(vue.h(script, __assign(__assign({ modelValue: true }, (config || {})), { appendToBody: false, onClose: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2868
2875
|
var _a, _b;
|
|
2869
2876
|
return __generator(this, function (_c) {
|
|
@@ -2950,7 +2957,7 @@
|
|
|
2950
2957
|
});
|
|
2951
2958
|
};
|
|
2952
2959
|
var index = {
|
|
2953
|
-
version: '0.3.
|
|
2960
|
+
version: '0.3.2',
|
|
2954
2961
|
install: install
|
|
2955
2962
|
};
|
|
2956
2963
|
|