xrk-components 2.0.0-beta.79 → 2.0.0-beta.80
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 +40 -18
- package/lib/index.umd.js +40 -18
- package/lib/packages/base/select/index.d.ts +7 -0
- package/lib/packages/base/select/select.d.ts +8 -0
- package/lib/packages/hooks/use-create-modal.d.ts +5 -2
- package/lib/packages/xrk/search/index.d.ts +24 -0
- package/lib/packages/xrk/search/search.d.ts +18 -0
- package/lib/packages/xrk/table/table.d.ts +9 -0
- package/lib/packages/xrk/table/types/type.d.ts +9 -17
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -73167,6 +73167,7 @@ var script$o = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$m
|
|
|
73167
73167
|
filterMethod: { type: Function, required: false },
|
|
73168
73168
|
maxlength: { type: Number, required: false, default: 50 },
|
|
73169
73169
|
remoteMethod: { type: Function, required: false },
|
|
73170
|
+
remoteSelected: { type: Array, required: false },
|
|
73170
73171
|
notRemoteAutoFilter: { type: Boolean, required: false },
|
|
73171
73172
|
loadingText: { type: String, required: false, default: '加载中' },
|
|
73172
73173
|
noMatchText: { type: String, required: false, default: '暂无数据' },
|
|
@@ -73215,20 +73216,20 @@ var script$o = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$m
|
|
|
73215
73216
|
}
|
|
73216
73217
|
});
|
|
73217
73218
|
var setOptionsData = function (val) { return __awaiter(_this, void 0, void 0, function () {
|
|
73218
|
-
var res,
|
|
73219
|
-
var _a;
|
|
73220
|
-
return __generator(this, function (
|
|
73221
|
-
switch (
|
|
73219
|
+
var res, data_1, error_1;
|
|
73220
|
+
var _a, _b;
|
|
73221
|
+
return __generator(this, function (_c) {
|
|
73222
|
+
switch (_c.label) {
|
|
73222
73223
|
case 0:
|
|
73223
73224
|
if (!isFunction(props.remoteMethod)) return [3 /*break*/, 4];
|
|
73224
|
-
|
|
73225
|
+
_c.label = 1;
|
|
73225
73226
|
case 1:
|
|
73226
|
-
|
|
73227
|
+
_c.trys.push([1, 3, , 4]);
|
|
73227
73228
|
loading.value = true;
|
|
73228
73229
|
return [4 /*yield*/, ((_a = props.remoteMethod) === null || _a === void 0 ? void 0 : _a.call(props, val))];
|
|
73229
73230
|
case 2:
|
|
73230
|
-
res =
|
|
73231
|
-
|
|
73231
|
+
res = _c.sent();
|
|
73232
|
+
data_1 = check.isObject(res.data)
|
|
73232
73233
|
? Array.isArray(res.data.list)
|
|
73233
73234
|
? res.data.list
|
|
73234
73235
|
: []
|
|
@@ -73236,17 +73237,29 @@ var script$o = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$m
|
|
|
73236
73237
|
? res.data
|
|
73237
73238
|
: [];
|
|
73238
73239
|
loading.value = false;
|
|
73240
|
+
if (!val && ((_b = props.remoteSelected) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
73241
|
+
props.remoteSelected.forEach(function (select) {
|
|
73242
|
+
var _a;
|
|
73243
|
+
if (select[props.labelKey] !== undefined &&
|
|
73244
|
+
select[props.valueKey] !== undefined) {
|
|
73245
|
+
// 不存在则添加
|
|
73246
|
+
if (!data_1.some(function (item) { return item[props.valueKey] === select[props.valueKey]; })) {
|
|
73247
|
+
data_1.push(__assign(__assign({}, select), (_a = {}, _a[props.labelKey] = select[props.labelKey], _a[props.valueKey] = select[props.valueKey], _a)));
|
|
73248
|
+
}
|
|
73249
|
+
}
|
|
73250
|
+
});
|
|
73251
|
+
}
|
|
73239
73252
|
if (props.notRemoteAutoFilter) {
|
|
73240
|
-
_options.value = Array.isArray(
|
|
73253
|
+
_options.value = Array.isArray(data_1) ? data_1 : [];
|
|
73241
73254
|
return [2 /*return*/];
|
|
73242
73255
|
}
|
|
73243
73256
|
// 避免多次请求接口 接口响应先后顺序不一致导致数据错乱
|
|
73244
|
-
_options.value = Array.isArray(
|
|
73245
|
-
?
|
|
73257
|
+
_options.value = Array.isArray(data_1)
|
|
73258
|
+
? data_1.filter(function (i) { return !val || "".concat(i[props.labelKey || 'label']).indexOf(val) > -1; })
|
|
73246
73259
|
: [];
|
|
73247
73260
|
return [3 /*break*/, 4];
|
|
73248
73261
|
case 3:
|
|
73249
|
-
error_1 =
|
|
73262
|
+
error_1 = _c.sent();
|
|
73250
73263
|
loading.value = false;
|
|
73251
73264
|
console.error(error_1);
|
|
73252
73265
|
return [3 /*break*/, 4];
|
|
@@ -73946,7 +73959,9 @@ var script$i = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$g
|
|
|
73946
73959
|
text: '重置',
|
|
73947
73960
|
show: true
|
|
73948
73961
|
}); } },
|
|
73949
|
-
otherComponents: { type: null, required: false }
|
|
73962
|
+
otherComponents: { type: null, required: false },
|
|
73963
|
+
syncQueryToSearch: { type: Boolean, required: false },
|
|
73964
|
+
syncSearchToQuery: { type: Boolean, required: false }
|
|
73950
73965
|
}, emits: ["search"], setup: function (__props, _a) {
|
|
73951
73966
|
var _this = this;
|
|
73952
73967
|
var expose = _a.expose, emits = _a.emit;
|
|
@@ -75010,8 +75025,10 @@ var useCreateModal = function (component, options, app) {
|
|
|
75010
75025
|
appendToBody: false }, options));
|
|
75011
75026
|
// inject 函数调用组件导致内部inject无法接收到,需要使用app.provide(全局): https://github.com/vuejs/core/issues/6220
|
|
75012
75027
|
// context createApp需要use插件,内部才能使用插件\库相关API。可以直接修改上下文: https://github.com/vuejs/core/issues/2097
|
|
75028
|
+
// main APP为_context, 组件上下文为appContext
|
|
75029
|
+
// 如果不关联该项,会导致使用useCreateModal的函数组件内无法使用provide\route等需关联上下文的函数
|
|
75013
75030
|
if (app) {
|
|
75014
|
-
_instance.appContext = app
|
|
75031
|
+
_instance.appContext = app['_context'] || app['appContext']; // 承接上下文,用于inject,调用层需要使用app.provide
|
|
75015
75032
|
}
|
|
75016
75033
|
render$2(_instance, container);
|
|
75017
75034
|
(_a = document.querySelector('body')) === null || _a === void 0 ? void 0 : _a.appendChild(container);
|
|
@@ -77135,6 +77152,7 @@ var __default__$1 = {
|
|
|
77135
77152
|
};
|
|
77136
77153
|
var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1), { props: {
|
|
77137
77154
|
requestNow: { type: Boolean, required: false, default: true },
|
|
77155
|
+
reserveSelection: { type: Boolean, required: false },
|
|
77138
77156
|
fix: { type: Boolean, required: false, default: true },
|
|
77139
77157
|
getListAjax: { type: Function, required: true },
|
|
77140
77158
|
searchConfig: { type: Object, required: true },
|
|
@@ -77217,7 +77235,9 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
77217
77235
|
case 0:
|
|
77218
77236
|
searchQuery.value = base.deepClone(searchValue);
|
|
77219
77237
|
initPageInfo(1);
|
|
77220
|
-
|
|
77238
|
+
if (!props.reserveSelection) {
|
|
77239
|
+
clearSelectionRows();
|
|
77240
|
+
}
|
|
77221
77241
|
return [4 /*yield*/, (getList === null || getList === void 0 ? void 0 : getList(query.value))];
|
|
77222
77242
|
case 1:
|
|
77223
77243
|
_a.sent();
|
|
@@ -77340,15 +77360,17 @@ var script$1 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$1
|
|
|
77340
77360
|
(!__props.searchConfig.hide)
|
|
77341
77361
|
? (openBlock(), createBlock(script$i, {
|
|
77342
77362
|
key: 1,
|
|
77363
|
+
style: { "margin-bottom": "16px" },
|
|
77343
77364
|
ref_key: "XrkSearchRef",
|
|
77344
77365
|
ref: XrkSearchRef,
|
|
77345
77366
|
columns: __props.searchConfig.searchColumns,
|
|
77346
77367
|
"search-btn": __props.searchConfig.searchBtn,
|
|
77347
77368
|
"reset-btn": __props.searchConfig.resetBtn,
|
|
77348
77369
|
"other-components": __props.searchConfig.otherComponents,
|
|
77349
|
-
|
|
77350
|
-
|
|
77351
|
-
|
|
77370
|
+
"sync-query-to-search": __props.searchConfig.syncQueryToSearch,
|
|
77371
|
+
"sync-search-to-query": __props.searchConfig.syncSearchToQuery,
|
|
77372
|
+
onSearch: handleSearch
|
|
77373
|
+
}, null, 8 /* PROPS */, ["columns", "search-btn", "reset-btn", "other-components", "sync-query-to-search", "sync-search-to-query"]))
|
|
77352
77374
|
: createCommentVNode("v-if", true),
|
|
77353
77375
|
(unref(slots).tableBefore)
|
|
77354
77376
|
? renderSlot(_ctx.$slots, "tableBefore", {
|
package/lib/index.umd.js
CHANGED
|
@@ -73170,6 +73170,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
73170
73170
|
filterMethod: { type: Function, required: false },
|
|
73171
73171
|
maxlength: { type: Number, required: false, default: 50 },
|
|
73172
73172
|
remoteMethod: { type: Function, required: false },
|
|
73173
|
+
remoteSelected: { type: Array, required: false },
|
|
73173
73174
|
notRemoteAutoFilter: { type: Boolean, required: false },
|
|
73174
73175
|
loadingText: { type: String, required: false, default: '加载中' },
|
|
73175
73176
|
noMatchText: { type: String, required: false, default: '暂无数据' },
|
|
@@ -73218,20 +73219,20 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
73218
73219
|
}
|
|
73219
73220
|
});
|
|
73220
73221
|
var setOptionsData = function (val) { return __awaiter(_this, void 0, void 0, function () {
|
|
73221
|
-
var res,
|
|
73222
|
-
var _a;
|
|
73223
|
-
return __generator(this, function (
|
|
73224
|
-
switch (
|
|
73222
|
+
var res, data_1, error_1;
|
|
73223
|
+
var _a, _b;
|
|
73224
|
+
return __generator(this, function (_c) {
|
|
73225
|
+
switch (_c.label) {
|
|
73225
73226
|
case 0:
|
|
73226
73227
|
if (!isFunction(props.remoteMethod)) return [3 /*break*/, 4];
|
|
73227
|
-
|
|
73228
|
+
_c.label = 1;
|
|
73228
73229
|
case 1:
|
|
73229
|
-
|
|
73230
|
+
_c.trys.push([1, 3, , 4]);
|
|
73230
73231
|
loading.value = true;
|
|
73231
73232
|
return [4 /*yield*/, ((_a = props.remoteMethod) === null || _a === void 0 ? void 0 : _a.call(props, val))];
|
|
73232
73233
|
case 2:
|
|
73233
|
-
res =
|
|
73234
|
-
|
|
73234
|
+
res = _c.sent();
|
|
73235
|
+
data_1 = xrkTools.check.isObject(res.data)
|
|
73235
73236
|
? Array.isArray(res.data.list)
|
|
73236
73237
|
? res.data.list
|
|
73237
73238
|
: []
|
|
@@ -73239,17 +73240,29 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
73239
73240
|
? res.data
|
|
73240
73241
|
: [];
|
|
73241
73242
|
loading.value = false;
|
|
73243
|
+
if (!val && ((_b = props.remoteSelected) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
73244
|
+
props.remoteSelected.forEach(function (select) {
|
|
73245
|
+
var _a;
|
|
73246
|
+
if (select[props.labelKey] !== undefined &&
|
|
73247
|
+
select[props.valueKey] !== undefined) {
|
|
73248
|
+
// 不存在则添加
|
|
73249
|
+
if (!data_1.some(function (item) { return item[props.valueKey] === select[props.valueKey]; })) {
|
|
73250
|
+
data_1.push(__assign(__assign({}, select), (_a = {}, _a[props.labelKey] = select[props.labelKey], _a[props.valueKey] = select[props.valueKey], _a)));
|
|
73251
|
+
}
|
|
73252
|
+
}
|
|
73253
|
+
});
|
|
73254
|
+
}
|
|
73242
73255
|
if (props.notRemoteAutoFilter) {
|
|
73243
|
-
_options.value = Array.isArray(
|
|
73256
|
+
_options.value = Array.isArray(data_1) ? data_1 : [];
|
|
73244
73257
|
return [2 /*return*/];
|
|
73245
73258
|
}
|
|
73246
73259
|
// 避免多次请求接口 接口响应先后顺序不一致导致数据错乱
|
|
73247
|
-
_options.value = Array.isArray(
|
|
73248
|
-
?
|
|
73260
|
+
_options.value = Array.isArray(data_1)
|
|
73261
|
+
? data_1.filter(function (i) { return !val || "".concat(i[props.labelKey || 'label']).indexOf(val) > -1; })
|
|
73249
73262
|
: [];
|
|
73250
73263
|
return [3 /*break*/, 4];
|
|
73251
73264
|
case 3:
|
|
73252
|
-
error_1 =
|
|
73265
|
+
error_1 = _c.sent();
|
|
73253
73266
|
loading.value = false;
|
|
73254
73267
|
console.error(error_1);
|
|
73255
73268
|
return [3 /*break*/, 4];
|
|
@@ -73949,7 +73962,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
73949
73962
|
text: '重置',
|
|
73950
73963
|
show: true
|
|
73951
73964
|
}); } },
|
|
73952
|
-
otherComponents: { type: null, required: false }
|
|
73965
|
+
otherComponents: { type: null, required: false },
|
|
73966
|
+
syncQueryToSearch: { type: Boolean, required: false },
|
|
73967
|
+
syncSearchToQuery: { type: Boolean, required: false }
|
|
73953
73968
|
}, emits: ["search"], setup: function (__props, _a) {
|
|
73954
73969
|
var _this = this;
|
|
73955
73970
|
var expose = _a.expose, emits = _a.emit;
|
|
@@ -75013,8 +75028,10 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
75013
75028
|
appendToBody: false }, options));
|
|
75014
75029
|
// inject 函数调用组件导致内部inject无法接收到,需要使用app.provide(全局): https://github.com/vuejs/core/issues/6220
|
|
75015
75030
|
// context createApp需要use插件,内部才能使用插件\库相关API。可以直接修改上下文: https://github.com/vuejs/core/issues/2097
|
|
75031
|
+
// main APP为_context, 组件上下文为appContext
|
|
75032
|
+
// 如果不关联该项,会导致使用useCreateModal的函数组件内无法使用provide\route等需关联上下文的函数
|
|
75016
75033
|
if (app) {
|
|
75017
|
-
_instance.appContext = app
|
|
75034
|
+
_instance.appContext = app['_context'] || app['appContext']; // 承接上下文,用于inject,调用层需要使用app.provide
|
|
75018
75035
|
}
|
|
75019
75036
|
vue.render(_instance, container);
|
|
75020
75037
|
(_a = document.querySelector('body')) === null || _a === void 0 ? void 0 : _a.appendChild(container);
|
|
@@ -77138,6 +77155,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
77138
77155
|
};
|
|
77139
77156
|
var script$1 = /*#__PURE__*/ vue.defineComponent(__assign(__assign({}, __default__$1), { props: {
|
|
77140
77157
|
requestNow: { type: Boolean, required: false, default: true },
|
|
77158
|
+
reserveSelection: { type: Boolean, required: false },
|
|
77141
77159
|
fix: { type: Boolean, required: false, default: true },
|
|
77142
77160
|
getListAjax: { type: Function, required: true },
|
|
77143
77161
|
searchConfig: { type: Object, required: true },
|
|
@@ -77220,7 +77238,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
77220
77238
|
case 0:
|
|
77221
77239
|
searchQuery.value = xrkTools.base.deepClone(searchValue);
|
|
77222
77240
|
initPageInfo(1);
|
|
77223
|
-
|
|
77241
|
+
if (!props.reserveSelection) {
|
|
77242
|
+
clearSelectionRows();
|
|
77243
|
+
}
|
|
77224
77244
|
return [4 /*yield*/, (getList === null || getList === void 0 ? void 0 : getList(query.value))];
|
|
77225
77245
|
case 1:
|
|
77226
77246
|
_a.sent();
|
|
@@ -77343,15 +77363,17 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
|
|
|
77343
77363
|
(!__props.searchConfig.hide)
|
|
77344
77364
|
? (vue.openBlock(), vue.createBlock(script$i, {
|
|
77345
77365
|
key: 1,
|
|
77366
|
+
style: { "margin-bottom": "16px" },
|
|
77346
77367
|
ref_key: "XrkSearchRef",
|
|
77347
77368
|
ref: XrkSearchRef,
|
|
77348
77369
|
columns: __props.searchConfig.searchColumns,
|
|
77349
77370
|
"search-btn": __props.searchConfig.searchBtn,
|
|
77350
77371
|
"reset-btn": __props.searchConfig.resetBtn,
|
|
77351
77372
|
"other-components": __props.searchConfig.otherComponents,
|
|
77352
|
-
|
|
77353
|
-
|
|
77354
|
-
|
|
77373
|
+
"sync-query-to-search": __props.searchConfig.syncQueryToSearch,
|
|
77374
|
+
"sync-search-to-query": __props.searchConfig.syncSearchToQuery,
|
|
77375
|
+
onSearch: handleSearch
|
|
77376
|
+
}, null, 8 /* PROPS */, ["columns", "search-btn", "reset-btn", "other-components", "sync-query-to-search", "sync-search-to-query"]))
|
|
77355
77377
|
: vue.createCommentVNode("v-if", true),
|
|
77356
77378
|
(vue.unref(slots).tableBefore)
|
|
77357
77379
|
? vue.renderSlot(_ctx.$slots, "tableBefore", {
|
|
@@ -84,6 +84,13 @@ export interface BaseSelectProps extends BaseSelectListener {
|
|
|
84
84
|
* 远程方法
|
|
85
85
|
*/
|
|
86
86
|
remoteMethod?: (searchVal?: string) => any;
|
|
87
|
+
/**
|
|
88
|
+
* 远程-已选中数据,解决初始数据时远程搜索数据不包含已选数据,包括多项选择。
|
|
89
|
+
* key必须对应labelKey与valueKey。
|
|
90
|
+
* 对象可添加多个属性不限于label value。
|
|
91
|
+
* 有搜索条件不添加,其他情况都添加。data无数据也要push。
|
|
92
|
+
*/
|
|
93
|
+
remoteSelected?: Array<Record<string, any>>;
|
|
87
94
|
/**
|
|
88
95
|
* 远程方法-是否自动过滤数据
|
|
89
96
|
*/
|
|
@@ -94,6 +94,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
94
|
type: FunctionConstructor;
|
|
95
95
|
required: false;
|
|
96
96
|
};
|
|
97
|
+
remoteSelected: {
|
|
98
|
+
type: ArrayConstructor;
|
|
99
|
+
required: false;
|
|
100
|
+
};
|
|
97
101
|
notRemoteAutoFilter: {
|
|
98
102
|
type: BooleanConstructor;
|
|
99
103
|
required: false;
|
|
@@ -219,6 +223,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
219
223
|
type: FunctionConstructor;
|
|
220
224
|
required: false;
|
|
221
225
|
};
|
|
226
|
+
remoteSelected: {
|
|
227
|
+
type: ArrayConstructor;
|
|
228
|
+
required: false;
|
|
229
|
+
};
|
|
222
230
|
notRemoteAutoFilter: {
|
|
223
231
|
type: BooleanConstructor;
|
|
224
232
|
required: false;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { App, Component } from 'vue';
|
|
1
|
+
import { App, Component, ComponentInternalInstance } from 'vue';
|
|
2
2
|
declare type anyObj = Record<string, any>;
|
|
3
3
|
interface ModalInstance {
|
|
4
4
|
remove(): void;
|
|
5
5
|
close(): void;
|
|
6
6
|
$updateProps(props: anyObj): void;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
interface InstanceComponent extends ComponentInternalInstance {
|
|
9
|
+
ctx: ModalInstance;
|
|
10
|
+
}
|
|
11
|
+
export declare const useCreateModal: (component: Component, options?: anyObj, app?: App | InstanceComponent) => ModalInstance;
|
|
9
12
|
declare const install: (app: App, component: Component, options: anyObj) => void;
|
|
10
13
|
export default install;
|
|
@@ -13,10 +13,34 @@ export declare const formItemComponents: import("vue").Ref<{
|
|
|
13
13
|
upload: any;
|
|
14
14
|
}>;
|
|
15
15
|
export declare type XrkSearchProps<T extends Record<string, any> = any> = {
|
|
16
|
+
/**
|
|
17
|
+
* 搜索项
|
|
18
|
+
*/
|
|
16
19
|
columns: Array<SearchColumnType<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* 搜索按钮配置
|
|
22
|
+
* 点击时,执行顺序 beforeSearch -> emit.search -> afterSearch
|
|
23
|
+
*/
|
|
17
24
|
searchBtn?: SearchBtnType<T>;
|
|
25
|
+
/**
|
|
26
|
+
* 重置按钮配置
|
|
27
|
+
* 点击时,执行顺序 清空组件内的值 -> beforeReset -> emit.search -> afterReset
|
|
28
|
+
*/
|
|
18
29
|
resetBtn?: ResetBtnType<T>;
|
|
30
|
+
/**
|
|
31
|
+
* 其他组件
|
|
32
|
+
*/
|
|
19
33
|
otherComponents?: Array<ComponentRender<T>>;
|
|
34
|
+
/**
|
|
35
|
+
* 通过query 同步到搜索项value中
|
|
36
|
+
* 未实现
|
|
37
|
+
*/
|
|
38
|
+
syncQueryToSearch?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 通过搜索项 同步到route.query中
|
|
41
|
+
* 未实现
|
|
42
|
+
*/
|
|
43
|
+
syncSearchToQuery?: boolean;
|
|
20
44
|
};
|
|
21
45
|
export declare type XrkSearchRef<T extends Record<string, any> = any> = {
|
|
22
46
|
/**
|
|
@@ -27,6 +27,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
27
|
type: null;
|
|
28
28
|
required: false;
|
|
29
29
|
};
|
|
30
|
+
syncQueryToSearch: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
required: false;
|
|
33
|
+
};
|
|
34
|
+
syncSearchToQuery: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
required: false;
|
|
37
|
+
};
|
|
30
38
|
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
39
|
[key: string]: any;
|
|
32
40
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "search"[], "search", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -58,11 +66,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
66
|
type: null;
|
|
59
67
|
required: false;
|
|
60
68
|
};
|
|
69
|
+
syncQueryToSearch: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
required: false;
|
|
72
|
+
};
|
|
73
|
+
syncSearchToQuery: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
required: false;
|
|
76
|
+
};
|
|
61
77
|
}>> & {
|
|
62
78
|
onSearch?: ((...args: any[]) => any) | undefined;
|
|
63
79
|
}, {
|
|
64
80
|
loading: boolean;
|
|
65
81
|
searchBtn: any;
|
|
66
82
|
resetBtn: any;
|
|
83
|
+
syncQueryToSearch: boolean;
|
|
84
|
+
syncSearchToQuery: boolean;
|
|
67
85
|
}>;
|
|
68
86
|
export default _default;
|
|
@@ -4,6 +4,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4
4
|
required: false;
|
|
5
5
|
default: boolean;
|
|
6
6
|
};
|
|
7
|
+
reserveSelection: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
required: false;
|
|
10
|
+
};
|
|
7
11
|
fix: {
|
|
8
12
|
type: BooleanConstructor;
|
|
9
13
|
required: false;
|
|
@@ -33,6 +37,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
37
|
required: false;
|
|
34
38
|
default: boolean;
|
|
35
39
|
};
|
|
40
|
+
reserveSelection: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
required: false;
|
|
43
|
+
};
|
|
36
44
|
fix: {
|
|
37
45
|
type: BooleanConstructor;
|
|
38
46
|
required: false;
|
|
@@ -56,6 +64,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
64
|
};
|
|
57
65
|
}>>, {
|
|
58
66
|
requestNow: boolean;
|
|
67
|
+
reserveSelection: boolean;
|
|
59
68
|
fix: boolean;
|
|
60
69
|
}>;
|
|
61
70
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseTableColumnProps, BaseTableProps } from '../../../base/table/types/type';
|
|
2
|
-
import {
|
|
2
|
+
import { SearchColumnType } from '../../search/types/type';
|
|
3
|
+
import { XrkSearchProps } from '../../search/index';
|
|
3
4
|
declare type Result<T = any> = {
|
|
4
5
|
code?: number;
|
|
5
6
|
message?: string;
|
|
@@ -21,6 +22,11 @@ export declare type XrkTableProps<S extends Record<string, any> = any, T extends
|
|
|
21
22
|
* 是否固定高度 滚动表格
|
|
22
23
|
*/
|
|
23
24
|
fix?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 点击搜索是否重置选中项,默认false清空
|
|
27
|
+
* 由xrk-table维护
|
|
28
|
+
*/
|
|
29
|
+
reserveSelection?: boolean;
|
|
24
30
|
/**
|
|
25
31
|
* 获取表格数据
|
|
26
32
|
*/
|
|
@@ -34,24 +40,10 @@ export declare type XrkTableProps<S extends Record<string, any> = any, T extends
|
|
|
34
40
|
*/
|
|
35
41
|
hide?: boolean;
|
|
36
42
|
/**
|
|
37
|
-
*
|
|
43
|
+
* 搜索项,与search中的columns一致
|
|
38
44
|
*/
|
|
39
45
|
searchColumns: Array<SearchColumnType<S>>;
|
|
40
|
-
|
|
41
|
-
* 搜索按钮配置
|
|
42
|
-
* 点击时,执行顺序 beforeSearch -> emit.search -> afterSearch
|
|
43
|
-
*/
|
|
44
|
-
searchBtn?: SearchBtnType<S>;
|
|
45
|
-
/**
|
|
46
|
-
* 重置按钮配置
|
|
47
|
-
* 点击时,执行顺序 清空组件内的值 -> beforeReset -> emit.search -> afterReset
|
|
48
|
-
*/
|
|
49
|
-
resetBtn?: ResetBtnType<S>;
|
|
50
|
-
/**
|
|
51
|
-
* 其他组件
|
|
52
|
-
*/
|
|
53
|
-
otherComponents?: Array<ComponentRender<S>>;
|
|
54
|
-
};
|
|
46
|
+
} & Omit<XrkSearchProps<S>, 'columns'>;
|
|
55
47
|
/**
|
|
56
48
|
* 表格配置
|
|
57
49
|
*/
|