@fangzhongya/fang-ui 0.0.27 → 0.0.29
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/dist/components/array/src/index.cjs +6 -9
- package/dist/components/array/src/index.js +6 -9
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/src/index.d.ts +2 -2
- package/dist/components/cascader/index.d.ts +1 -1
- package/dist/components/cascader/src/index.d.ts +2 -2
- package/dist/components/checks/src/index.cjs +4 -4
- package/dist/components/checks/src/index.js +4 -4
- package/dist/components/common/list.cjs +2 -3
- package/dist/components/common/list.js +2 -3
- package/dist/components/common/use.cjs +11 -11
- package/dist/components/common/use.js +11 -11
- package/dist/components/cs-slot/src/index.cjs +6 -6
- package/dist/components/cs-slot/src/index.js +6 -6
- package/dist/components/dates/index.css +1 -1
- package/dist/components/dates/index.scss +4 -6
- package/dist/components/dialog/src/index.cjs +7 -11
- package/dist/components/dialog/src/index.js +8 -12
- package/dist/components/dialog/style/index2.scss +3 -0
- package/dist/components/edit-float/src/index2.cjs +2 -2
- package/dist/components/edit-float/src/index2.js +2 -2
- package/dist/components/el-tables/src/columns3.cjs +1 -1
- package/dist/components/el-tables/src/columns3.js +1 -1
- package/dist/components/el-tables/src/index.cjs +2 -3
- package/dist/components/el-tables/src/index.js +2 -3
- package/dist/components/forms/src/data.cjs +1 -1
- package/dist/components/forms/src/data.js +1 -1
- package/dist/components/forms/src/index.cjs +2 -2
- package/dist/components/forms/src/index.js +2 -2
- package/dist/components/forms/src/setup.cjs +5 -8
- package/dist/components/forms/src/setup.js +5 -8
- package/dist/components/forms/src/util.cjs +1 -2
- package/dist/components/forms/src/util.js +1 -2
- package/dist/components/forms-drag/src/index.cjs +2 -2
- package/dist/components/forms-drag/src/index.js +2 -2
- package/dist/components/forms-item/src/index.cjs +1 -1
- package/dist/components/forms-item/src/index.js +1 -1
- package/dist/components/forms-items/src/index.cjs +2 -2
- package/dist/components/forms-items/src/index.js +2 -2
- package/dist/components/global-config/src/index.cjs +1 -1
- package/dist/components/global-config/src/index.js +1 -1
- package/dist/components/icon-picker/src/index.cjs +4 -6
- package/dist/components/icon-picker/src/index.js +4 -6
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/src/index.d.ts +4 -4
- package/dist/components/input-history/src/util.d.ts +17 -0
- package/dist/components/input-number/index.d.ts +1 -1
- package/dist/components/input-number/src/index.d.ts +2 -2
- package/dist/components/input-select/index.d.ts +2 -2
- package/dist/components/input-select/src/index.d.ts +4 -4
- package/dist/components/input-select/src/index2.cjs +1 -1
- package/dist/components/input-select/src/index2.js +1 -1
- package/dist/components/labels/src/index2.cjs +1 -2
- package/dist/components/labels/src/index2.js +1 -2
- package/dist/components/menus/src/menu-ll.cjs +1 -1
- package/dist/components/menus/src/menu-ll.js +1 -1
- package/dist/components/page/src/index.cjs +65 -85
- package/dist/components/page/src/index.js +65 -85
- package/dist/components/page/src/set-column2.cjs +2 -2
- package/dist/components/page/src/set-column2.js +2 -2
- package/dist/components/right-key/index.d.ts +15 -0
- package/dist/components/right-key/src/data.cjs +5 -1
- package/dist/components/right-key/src/data.d.ts +4 -0
- package/dist/components/right-key/src/data.js +5 -1
- package/dist/components/right-key/src/index.cjs +6 -1
- package/dist/components/right-key/src/index.d.ts +9 -0
- package/dist/components/right-key/src/index.js +6 -1
- package/dist/components/role-select/src/index.cjs +1 -1
- package/dist/components/role-select/src/index.js +1 -1
- package/dist/components/selector/src/index2.cjs +2 -2
- package/dist/components/selector/src/index2.js +2 -2
- package/dist/components/selects/src/index.cjs +1 -1
- package/dist/components/selects/src/index.js +1 -1
- package/dist/components/stick-window/src/index.cjs +1 -1
- package/dist/components/stick-window/src/index.js +1 -1
- package/dist/components/switchs/src/index.cjs +4 -4
- package/dist/components/switchs/src/index.js +4 -4
- package/dist/components/table-list/src/table-list.cjs +10 -15
- package/dist/components/table-list/src/table-list.js +10 -15
- package/dist/components/tables/common/pagin.cjs +40 -57
- package/dist/components/tables/common/pagin.js +40 -57
- package/dist/components/tables/common/table-but.cjs +1 -2
- package/dist/components/tables/common/table-but.js +1 -2
- package/dist/components/tables/common/table-color.cjs +4 -5
- package/dist/components/tables/common/table-color.js +4 -5
- package/dist/components/tables/common/table-list.cjs +1 -2
- package/dist/components/tables/common/table-list.js +1 -2
- package/dist/components/tables/common/util.cjs +2 -3
- package/dist/components/tables/common/util.js +2 -3
- package/dist/components/tables/src/index.cjs +4 -5
- package/dist/components/tables/src/index.js +4 -5
- package/dist/components/tables-form/src/columns3.cjs +1 -1
- package/dist/components/tables-form/src/columns3.js +1 -1
- package/dist/components/tables-form/src/index.cjs +4 -7
- package/dist/components/tables-form/src/index.js +4 -7
- package/dist/components/tables-pagin/src/index.cjs +3 -4
- package/dist/components/tables-pagin/src/index.js +3 -4
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/src/index.d.ts +2 -2
- package/dist/components/vxe-tables/src/columns3.cjs +1 -1
- package/dist/components/vxe-tables/src/columns3.js +1 -1
- package/dist/components/vxe-tables/src/index.cjs +2 -3
- package/dist/components/vxe-tables/src/index.js +2 -3
- package/dist/directives/adjust/index.cjs +1 -2
- package/dist/directives/adjust/index.js +1 -2
- package/dist/hooks/global-config/index.cjs +2 -5
- package/dist/hooks/global-config/index.js +2 -5
- package/dist/index.css +1 -1
- package/package.json +13 -13
- /package/dist/components/{forms-items → forms-item}/index.css +0 -0
|
@@ -52,7 +52,6 @@ const dataProps = {
|
|
|
52
52
|
};
|
|
53
53
|
const dataEmit = ["list-events", "selection"];
|
|
54
54
|
const useInit = (props2, emit, refTable, isEl) => {
|
|
55
|
-
var _a, _b;
|
|
56
55
|
const loading = ref(false);
|
|
57
56
|
const mpagconfig = {
|
|
58
57
|
pageSize: 10,
|
|
@@ -87,34 +86,33 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
87
86
|
desc: "desc",
|
|
88
87
|
descending: "desc"
|
|
89
88
|
};
|
|
90
|
-
const tableList = ref(
|
|
91
|
-
const tableConfig = ref(
|
|
89
|
+
const tableList = ref(props2.configs?.list ?? props2.list);
|
|
90
|
+
const tableConfig = ref(props2.configs?.config ?? props2.config);
|
|
92
91
|
const width = {
|
|
93
92
|
index: 66,
|
|
94
93
|
selection: 46
|
|
95
94
|
};
|
|
96
95
|
const setList = () => {
|
|
97
|
-
var _a2, _b2, _c, _d, _e, _f;
|
|
98
96
|
const configs = props2.configs;
|
|
99
|
-
const list =
|
|
100
|
-
const config =
|
|
101
|
-
if (
|
|
102
|
-
let isx =
|
|
103
|
-
let iss =
|
|
97
|
+
const list = configs?.list ?? props2.list;
|
|
98
|
+
const config = configs?.config ?? props2.config;
|
|
99
|
+
if (config.config?.ischecked || config.config?.isserial) {
|
|
100
|
+
let isx = config.config?.ischecked;
|
|
101
|
+
let iss = config.config?.isserial;
|
|
104
102
|
let i = -1;
|
|
105
103
|
for (let t = 0; t < list.length; t++) {
|
|
106
104
|
const obj = list[t];
|
|
107
|
-
if (
|
|
105
|
+
if (obj?.type == "selection") {
|
|
108
106
|
if (!obj.width) {
|
|
109
107
|
obj.width = width.selection;
|
|
110
108
|
}
|
|
111
109
|
if (!obj.selectable) {
|
|
112
|
-
obj.selectable =
|
|
110
|
+
obj.selectable = config.config?.selectable;
|
|
113
111
|
}
|
|
114
112
|
i = t;
|
|
115
113
|
isx = false;
|
|
116
114
|
}
|
|
117
|
-
if (
|
|
115
|
+
if (obj?.type == "index") {
|
|
118
116
|
if (!obj.width) {
|
|
119
117
|
obj.width = width.index;
|
|
120
118
|
}
|
|
@@ -145,7 +143,7 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
145
143
|
list.unshift({
|
|
146
144
|
type: "selection",
|
|
147
145
|
width: width.selection,
|
|
148
|
-
selectable:
|
|
146
|
+
selectable: config.config?.selectable,
|
|
149
147
|
fixed: true
|
|
150
148
|
});
|
|
151
149
|
}
|
|
@@ -153,10 +151,9 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
153
151
|
tableList.value = list;
|
|
154
152
|
};
|
|
155
153
|
const setConfig = () => {
|
|
156
|
-
var _a2;
|
|
157
154
|
const configs = props2.configs;
|
|
158
|
-
const config =
|
|
159
|
-
if (
|
|
155
|
+
const config = configs?.config ?? props2.config;
|
|
156
|
+
if (config.config?.defaultSort) {
|
|
160
157
|
const v = config.config.defaultSort;
|
|
161
158
|
paginat.order = orderMap[v.order] ?? "";
|
|
162
159
|
paginat.prop = v.prop;
|
|
@@ -197,21 +194,19 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
197
194
|
}
|
|
198
195
|
});
|
|
199
196
|
function onChange(arr) {
|
|
200
|
-
|
|
201
|
-
if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio)) {
|
|
197
|
+
if (!tableConfig.value.config?.isradio) {
|
|
202
198
|
console.log("onChange");
|
|
203
199
|
emit("selection", arr);
|
|
204
200
|
}
|
|
205
201
|
}
|
|
206
202
|
function onRowClick(row, obj) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const selectable = (_b2 = tableConfig.value.config) == null ? void 0 : _b2.selectable;
|
|
203
|
+
if (!tableConfig.value.config?.noRowSelect) {
|
|
204
|
+
const selectable = tableConfig.value.config?.selectable;
|
|
210
205
|
if (selectable) {
|
|
211
206
|
const index = data.list.findIndex((obj2) => {
|
|
212
207
|
});
|
|
213
208
|
if (selectable(row, index)) {
|
|
214
|
-
if (
|
|
209
|
+
if (tableConfig.value.config?.isradio) {
|
|
215
210
|
refTable.value.clearSelection();
|
|
216
211
|
refTable.value.toggleRowSelection(row, true);
|
|
217
212
|
console.log("onRowClick");
|
|
@@ -221,7 +216,7 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
221
216
|
}
|
|
222
217
|
}
|
|
223
218
|
} else {
|
|
224
|
-
if (
|
|
219
|
+
if (tableConfig.value.config?.isradio) {
|
|
225
220
|
refTable.value.clearSelection();
|
|
226
221
|
refTable.value.toggleRowSelection(row, true);
|
|
227
222
|
console.log("onRowClick");
|
|
@@ -233,17 +228,15 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
233
228
|
}
|
|
234
229
|
}
|
|
235
230
|
function empty() {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
(_b2 = refTable.value) == null ? void 0 : _b2.clearRadioRow();
|
|
231
|
+
if (istype.value && tableConfig.value.config?.isradio) {
|
|
232
|
+
refTable.value?.clearRadioRow();
|
|
239
233
|
}
|
|
240
|
-
|
|
234
|
+
refTable.value?.clearSelection();
|
|
241
235
|
console.log("empty");
|
|
242
236
|
emit("selection", []);
|
|
243
237
|
}
|
|
244
238
|
function onSelect(s, row) {
|
|
245
|
-
|
|
246
|
-
if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
|
|
239
|
+
if (tableConfig.value.config?.isradio) {
|
|
247
240
|
refTable.value.clearSelection();
|
|
248
241
|
refTable.value.toggleRowSelection(row, true);
|
|
249
242
|
console.log("onSelect");
|
|
@@ -251,19 +244,17 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
251
244
|
}
|
|
252
245
|
}
|
|
253
246
|
function onRadioChange(obj) {
|
|
254
|
-
|
|
255
|
-
if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isradio) {
|
|
247
|
+
if (tableConfig.value.config?.isradio) {
|
|
256
248
|
console.log("onRadioChange");
|
|
257
249
|
emit("selection", [obj.row]);
|
|
258
250
|
}
|
|
259
251
|
}
|
|
260
252
|
function defaultSort(arr) {
|
|
261
|
-
|
|
262
|
-
if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.sort)) {
|
|
253
|
+
if (!tableConfig.value.config?.sort) {
|
|
263
254
|
return arr;
|
|
264
255
|
} else {
|
|
265
|
-
const prop =
|
|
266
|
-
const order = orderMap[
|
|
256
|
+
const prop = tableConfig.value.config?.defaultSort?.prop;
|
|
257
|
+
const order = orderMap[tableConfig.value.config?.defaultSort?.order] || "";
|
|
267
258
|
if (prop && order) {
|
|
268
259
|
const vs = arr.sort((ao, bo) => {
|
|
269
260
|
const a = ao[prop];
|
|
@@ -286,8 +277,7 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
286
277
|
}
|
|
287
278
|
}
|
|
288
279
|
function onSortChange(obj) {
|
|
289
|
-
|
|
290
|
-
if (!((_a2 = tableConfig.value.config) == null ? void 0 : _a2.sort)) {
|
|
280
|
+
if (!tableConfig.value.config?.sort) {
|
|
291
281
|
paginat.order = orderMap[obj.order] || "";
|
|
292
282
|
paginat.prop = obj.field || obj.prop;
|
|
293
283
|
paginat.current = 1;
|
|
@@ -310,13 +300,11 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
310
300
|
getData({}, callback);
|
|
311
301
|
}
|
|
312
302
|
function clean() {
|
|
313
|
-
|
|
314
|
-
(_a2 = refTable.value) == null ? void 0 : _a2.clearSelection();
|
|
303
|
+
refTable.value?.clearSelection();
|
|
315
304
|
console.log("clean");
|
|
316
305
|
emit("selection", []);
|
|
317
306
|
}
|
|
318
307
|
function getParam(param) {
|
|
319
|
-
var _a2;
|
|
320
308
|
const arr = [
|
|
321
309
|
"current",
|
|
322
310
|
"pageSize",
|
|
@@ -325,7 +313,7 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
325
313
|
];
|
|
326
314
|
let data2 = {};
|
|
327
315
|
if (typeof tableConfig.value.ajax === "object") {
|
|
328
|
-
data2 =
|
|
316
|
+
data2 = tableConfig.value.ajax?.data ?? {};
|
|
329
317
|
}
|
|
330
318
|
for (const key of arr) {
|
|
331
319
|
const current = data2[key] ?? mpagconfig.data[key];
|
|
@@ -334,14 +322,13 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
334
322
|
return param;
|
|
335
323
|
}
|
|
336
324
|
function getData(p = {}, callback) {
|
|
337
|
-
var _a2, _b2;
|
|
338
325
|
clean();
|
|
339
326
|
loading.value = true;
|
|
340
327
|
let ajaxConfig = props2.ajaxConfig;
|
|
341
328
|
let ajax = props2.ajax;
|
|
342
329
|
if (typeof tableConfig.value.ajax === "object") {
|
|
343
|
-
ajaxConfig = ajaxConfig ??
|
|
344
|
-
ajax = ajax ??
|
|
330
|
+
ajaxConfig = ajaxConfig ?? tableConfig.value.ajax?.config;
|
|
331
|
+
ajax = ajax ?? tableConfig.value.ajax?.url;
|
|
345
332
|
} else {
|
|
346
333
|
ajax = ajax ?? tableConfig.value.ajax;
|
|
347
334
|
}
|
|
@@ -359,16 +346,15 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
359
346
|
...p
|
|
360
347
|
})
|
|
361
348
|
).then((list) => {
|
|
362
|
-
|
|
363
|
-
let dlist = (list == null ? void 0 : list.list) || [];
|
|
349
|
+
let dlist = list?.list || [];
|
|
364
350
|
if (dlist instanceof Array === false) {
|
|
365
351
|
dlist = [dlist];
|
|
366
352
|
}
|
|
367
|
-
if (
|
|
353
|
+
if (tableConfig.value.paginat?.is && dlist.length > paginat.pageSize) {
|
|
368
354
|
dlist = dlist.slice(0, paginat.pageSize);
|
|
369
355
|
}
|
|
370
356
|
data.list = defaultSort(dlist);
|
|
371
|
-
data.total =
|
|
357
|
+
data.total = list?.total || dlist.length;
|
|
372
358
|
loading.value = false;
|
|
373
359
|
if (callback) {
|
|
374
360
|
callback(data);
|
|
@@ -381,10 +367,9 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
381
367
|
});
|
|
382
368
|
}
|
|
383
369
|
function inParamFilter(obj) {
|
|
384
|
-
var _a2;
|
|
385
370
|
let before = props2.onRequestBefore;
|
|
386
371
|
if (typeof tableConfig.value.ajax === "object") {
|
|
387
|
-
before = before ??
|
|
372
|
+
before = before ?? tableConfig.value.ajax?.onRequestBefore;
|
|
388
373
|
}
|
|
389
374
|
if (before) {
|
|
390
375
|
return executionMethod(before, obj);
|
|
@@ -393,18 +378,17 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
393
378
|
}
|
|
394
379
|
}
|
|
395
380
|
function inDataFilter(data2, obj) {
|
|
396
|
-
var _a2, _b2;
|
|
397
381
|
let after = props2.onRequestAfter;
|
|
398
382
|
let ajaxData = {};
|
|
399
383
|
if (typeof tableConfig.value.ajax === "object") {
|
|
400
|
-
ajaxData =
|
|
401
|
-
after = after ??
|
|
384
|
+
ajaxData = tableConfig.value.ajax?.data ?? {};
|
|
385
|
+
after = after ?? tableConfig.value.ajax?.onRequestAfter;
|
|
402
386
|
}
|
|
403
387
|
if (after) {
|
|
404
388
|
return executionMethod(after, data2, obj);
|
|
405
389
|
} else {
|
|
406
|
-
const l =
|
|
407
|
-
const t =
|
|
390
|
+
const l = ajaxData?.list ?? mpagconfig.data.list;
|
|
391
|
+
const t = ajaxData?.total ?? mpagconfig.data.total;
|
|
408
392
|
const list = getObjValue(l, data2) ?? data2;
|
|
409
393
|
const total = t == "" ? list.length : getObjValue(t, data2);
|
|
410
394
|
return {
|
|
@@ -417,8 +401,7 @@ const useInit = (props2, emit, refTable, isEl) => {
|
|
|
417
401
|
initData();
|
|
418
402
|
}
|
|
419
403
|
const height = computed(() => {
|
|
420
|
-
|
|
421
|
-
return ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.height) ?? "auto";
|
|
404
|
+
return tableConfig.value.config?.height ?? "auto";
|
|
422
405
|
});
|
|
423
406
|
return {
|
|
424
407
|
height,
|
|
@@ -73,14 +73,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
73
73
|
emit("scope-click", obj, props.tableScope, props.tableListObj, "but");
|
|
74
74
|
}
|
|
75
75
|
const valueArr = vue.computed(() => {
|
|
76
|
-
var _a;
|
|
77
76
|
const prop = props.tableListObj.prop || "";
|
|
78
77
|
const row = props.tableScope.row || {};
|
|
79
78
|
const column = props.tableScope.column || {};
|
|
80
79
|
const cellValue = row[prop];
|
|
81
80
|
const index = props.tableScope.$index;
|
|
82
81
|
const formatter = props.tableListObj.formatter;
|
|
83
|
-
const configFormatter =
|
|
82
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
84
83
|
if (configFormatter) {
|
|
85
84
|
const arr = configFormatter(row, column, cellValue, index);
|
|
86
85
|
return setValue(arr);
|
|
@@ -71,14 +71,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
71
|
emit("scope-click", obj, props.tableScope, props.tableListObj, "but");
|
|
72
72
|
}
|
|
73
73
|
const valueArr = computed(() => {
|
|
74
|
-
var _a;
|
|
75
74
|
const prop = props.tableListObj.prop || "";
|
|
76
75
|
const row = props.tableScope.row || {};
|
|
77
76
|
const column = props.tableScope.column || {};
|
|
78
77
|
const cellValue = row[prop];
|
|
79
78
|
const index = props.tableScope.$index;
|
|
80
79
|
const formatter = props.tableListObj.formatter;
|
|
81
|
-
const configFormatter =
|
|
80
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
82
81
|
if (configFormatter) {
|
|
83
82
|
const arr = configFormatter(row, column, cellValue, index);
|
|
84
83
|
return setValue(arr);
|
|
@@ -56,14 +56,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const valueObj = vue.computed(() => {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
60
59
|
const prop = props.tableListObj.prop || "";
|
|
61
|
-
const row =
|
|
62
|
-
const column =
|
|
60
|
+
const row = props.tableScope?.row || {};
|
|
61
|
+
const column = props.tableScope?.column || {};
|
|
63
62
|
const cellValue = row[prop];
|
|
64
|
-
const index =
|
|
63
|
+
const index = props.tableScope?.$index;
|
|
65
64
|
const formatter = props.tableListObj.formatter;
|
|
66
|
-
const configFormatter =
|
|
65
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
67
66
|
if (configFormatter) {
|
|
68
67
|
const obj = configFormatter(row, column, cellValue, index);
|
|
69
68
|
let css;
|
|
@@ -54,14 +54,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
const valueObj = computed(() => {
|
|
57
|
-
var _a, _b, _c, _d;
|
|
58
57
|
const prop = props.tableListObj.prop || "";
|
|
59
|
-
const row =
|
|
60
|
-
const column =
|
|
58
|
+
const row = props.tableScope?.row || {};
|
|
59
|
+
const column = props.tableScope?.column || {};
|
|
61
60
|
const cellValue = row[prop];
|
|
62
|
-
const index =
|
|
61
|
+
const index = props.tableScope?.$index;
|
|
63
62
|
const formatter = props.tableListObj.formatter;
|
|
64
|
-
const configFormatter =
|
|
63
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
65
64
|
if (configFormatter) {
|
|
66
65
|
const obj = configFormatter(row, column, cellValue, index);
|
|
67
66
|
let css;
|
|
@@ -61,14 +61,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
const valueArr = vue.computed(() => {
|
|
64
|
-
var _a;
|
|
65
64
|
const prop = props.tableListObj.prop || "";
|
|
66
65
|
const row = props.tableScope.row || {};
|
|
67
66
|
const column = props.tableScope.column || {};
|
|
68
67
|
const cellValue = row[prop];
|
|
69
68
|
const index = props.tableScope.$index;
|
|
70
69
|
const formatter = props.tableListObj.formatter;
|
|
71
|
-
const configFormatter =
|
|
70
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
72
71
|
if (configFormatter) {
|
|
73
72
|
const arr = configFormatter(row, column, cellValue, index);
|
|
74
73
|
return setValue(arr);
|
|
@@ -59,14 +59,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
const valueArr = computed(() => {
|
|
62
|
-
var _a;
|
|
63
62
|
const prop = props.tableListObj.prop || "";
|
|
64
63
|
const row = props.tableScope.row || {};
|
|
65
64
|
const column = props.tableScope.column || {};
|
|
66
65
|
const cellValue = row[prop];
|
|
67
66
|
const index = props.tableScope.$index;
|
|
68
67
|
const formatter = props.tableListObj.formatter;
|
|
69
|
-
const configFormatter =
|
|
68
|
+
const configFormatter = props.tableListObj.config?.formatter;
|
|
70
69
|
if (configFormatter) {
|
|
71
70
|
const arr = configFormatter(row, column, cellValue, index);
|
|
72
71
|
return setValue(arr);
|
|
@@ -19,7 +19,7 @@ require("@fangzhongya/utils/css/setObjStyle");
|
|
|
19
19
|
require("@fangzhongya/utils/css/getCss");
|
|
20
20
|
const index = require("../../../hooks/inherit/index.cjs");
|
|
21
21
|
function setMinWidth(obj, props) {
|
|
22
|
-
const config =
|
|
22
|
+
const config = props?.table ?? {};
|
|
23
23
|
if (obj.width) {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -58,8 +58,7 @@ const eventAliasObj = {
|
|
|
58
58
|
},
|
|
59
59
|
// .once - 最多触发一次处理函数。
|
|
60
60
|
once(event) {
|
|
61
|
-
|
|
62
|
-
if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
|
|
61
|
+
if (event.currentTarget?.__once__) {
|
|
63
62
|
return false;
|
|
64
63
|
} else {
|
|
65
64
|
if (event.currentTarget) {
|
|
@@ -17,7 +17,7 @@ import "@fangzhongya/utils/css/setObjStyle";
|
|
|
17
17
|
import "@fangzhongya/utils/css/getCss";
|
|
18
18
|
import { useAttrValue } from "../../../hooks/inherit/index.js";
|
|
19
19
|
function setMinWidth(obj, props) {
|
|
20
|
-
const config =
|
|
20
|
+
const config = props?.table ?? {};
|
|
21
21
|
if (obj.width) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
@@ -56,8 +56,7 @@ const eventAliasObj = {
|
|
|
56
56
|
},
|
|
57
57
|
// .once - 最多触发一次处理函数。
|
|
58
58
|
once(event) {
|
|
59
|
-
|
|
60
|
-
if ((_a = event.currentTarget) == null ? void 0 : _a.__once__) {
|
|
59
|
+
if (event.currentTarget?.__once__) {
|
|
61
60
|
return false;
|
|
62
61
|
} else {
|
|
63
62
|
if (event.currentTarget) {
|
|
@@ -44,7 +44,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
44
|
empty
|
|
45
45
|
});
|
|
46
46
|
return (_ctx, _cache) => {
|
|
47
|
-
var _a, _b, _c, _d;
|
|
48
47
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
49
48
|
class: vue.normalizeClass(vue.unref(cs).z())
|
|
50
49
|
}, [
|
|
@@ -52,7 +51,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
51
|
ref_key: "refTable",
|
|
53
52
|
ref: refTable,
|
|
54
53
|
class: [vue.unref(cs).z("main")],
|
|
55
|
-
size:
|
|
54
|
+
size: vue.unref(tableConfig).config?.size,
|
|
56
55
|
value: vue.unref(data).list,
|
|
57
56
|
list: vue.unref(tableList),
|
|
58
57
|
paginat: vue.unref(paginat),
|
|
@@ -77,11 +76,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
77
76
|
ref: refTable,
|
|
78
77
|
class: [
|
|
79
78
|
vue.unref(cs).z("main"),
|
|
80
|
-
vue.unref(cs).is("radio",
|
|
79
|
+
vue.unref(cs).is("radio", vue.unref(tableConfig).config?.isradio)
|
|
81
80
|
],
|
|
82
81
|
value: vue.unref(data).list,
|
|
83
82
|
list: vue.unref(tableList),
|
|
84
|
-
size:
|
|
83
|
+
size: vue.unref(tableConfig).config?.size,
|
|
85
84
|
paginat: vue.unref(paginat),
|
|
86
85
|
loading: vue.unref(loading),
|
|
87
86
|
options: props.options,
|
|
@@ -101,7 +100,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
101
100
|
};
|
|
102
101
|
})
|
|
103
102
|
]), 1040, ["class", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"])),
|
|
104
|
-
|
|
103
|
+
vue.unref(tableConfig).paginat?.is ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.Pagin), vue.mergeProps({ key: 2 }, vue.unref(pagconfig), {
|
|
105
104
|
class: vue.unref(cs).z("paginat"),
|
|
106
105
|
paginat: vue.unref(paginat),
|
|
107
106
|
total: vue.unref(data).total,
|
|
@@ -42,7 +42,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
empty
|
|
43
43
|
});
|
|
44
44
|
return (_ctx, _cache) => {
|
|
45
|
-
var _a, _b, _c, _d;
|
|
46
45
|
return openBlock(), createElementBlock("div", {
|
|
47
46
|
class: normalizeClass(unref(cs).z())
|
|
48
47
|
}, [
|
|
@@ -50,7 +49,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
49
|
ref_key: "refTable",
|
|
51
50
|
ref: refTable,
|
|
52
51
|
class: [unref(cs).z("main")],
|
|
53
|
-
size:
|
|
52
|
+
size: unref(tableConfig).config?.size,
|
|
54
53
|
value: unref(data).list,
|
|
55
54
|
list: unref(tableList),
|
|
56
55
|
paginat: unref(paginat),
|
|
@@ -75,11 +74,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
74
|
ref: refTable,
|
|
76
75
|
class: [
|
|
77
76
|
unref(cs).z("main"),
|
|
78
|
-
unref(cs).is("radio",
|
|
77
|
+
unref(cs).is("radio", unref(tableConfig).config?.isradio)
|
|
79
78
|
],
|
|
80
79
|
value: unref(data).list,
|
|
81
80
|
list: unref(tableList),
|
|
82
|
-
size:
|
|
81
|
+
size: unref(tableConfig).config?.size,
|
|
83
82
|
paginat: unref(paginat),
|
|
84
83
|
loading: unref(loading),
|
|
85
84
|
options: props.options,
|
|
@@ -99,7 +98,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
98
|
};
|
|
100
99
|
})
|
|
101
100
|
]), 1040, ["class", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"])),
|
|
102
|
-
|
|
101
|
+
unref(tableConfig).paginat?.is ? (openBlock(), createBlock(unref(Pagin), mergeProps({ key: 2 }, unref(pagconfig), {
|
|
103
102
|
class: unref(cs).z("paginat"),
|
|
104
103
|
paginat: unref(paginat),
|
|
105
104
|
total: unref(data).total,
|
|
@@ -7,7 +7,7 @@ const elementPlus = require("element-plus");
|
|
|
7
7
|
const column = require("./column.cjs");
|
|
8
8
|
function getLists(arrs, emit, table, form, formValue) {
|
|
9
9
|
const arr = [];
|
|
10
|
-
arrs
|
|
10
|
+
arrs?.forEach((obj, index) => {
|
|
11
11
|
if (obj.children && obj.children.length > 0) {
|
|
12
12
|
if (use.useHide(obj)) {
|
|
13
13
|
arr.push(
|
|
@@ -5,7 +5,7 @@ import { ElTableColumn } from "element-plus";
|
|
|
5
5
|
import { setProps, setHeader, columnRender } from "./column.js";
|
|
6
6
|
function getLists(arrs, emit, table, form, formValue) {
|
|
7
7
|
const arr = [];
|
|
8
|
-
arrs
|
|
8
|
+
arrs?.forEach((obj, index) => {
|
|
9
9
|
if (obj.children && obj.children.length > 0) {
|
|
10
10
|
if (useHide(obj)) {
|
|
11
11
|
arr.push(
|
|
@@ -48,10 +48,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
48
48
|
isSort = false;
|
|
49
49
|
}, 400);
|
|
50
50
|
const tableDefaultSort = vue.computed(() => {
|
|
51
|
-
var _a, _b;
|
|
52
51
|
return {
|
|
53
|
-
prop:
|
|
54
|
-
order:
|
|
52
|
+
prop: props.defaultSort?.prop,
|
|
53
|
+
order: props.defaultSort?.order
|
|
55
54
|
};
|
|
56
55
|
});
|
|
57
56
|
const rowStyle = vue.computed(() => {
|
|
@@ -114,8 +113,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
114
113
|
return rowStyle2;
|
|
115
114
|
} else {
|
|
116
115
|
return (scope) => {
|
|
117
|
-
|
|
118
|
-
const prop = (_a = props.form) == null ? void 0 : _a.prop;
|
|
116
|
+
const prop = props.form?.prop;
|
|
119
117
|
const obj = lists.value[scope.columnIndex];
|
|
120
118
|
const defaultFormfilter = () => {
|
|
121
119
|
return obj.isform && obj.compon && prop && scope.row[prop];
|
|
@@ -142,8 +140,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
142
140
|
}
|
|
143
141
|
});
|
|
144
142
|
function validate() {
|
|
145
|
-
|
|
146
|
-
(_a = formRef.value) == null ? void 0 : _a.validate((valid) => {
|
|
143
|
+
formRef.value?.validate((valid) => {
|
|
147
144
|
if (valid) {
|
|
148
145
|
emit("submit", dataFormValue.value);
|
|
149
146
|
}
|
|
@@ -46,10 +46,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
46
|
isSort = false;
|
|
47
47
|
}, 400);
|
|
48
48
|
const tableDefaultSort = computed(() => {
|
|
49
|
-
var _a, _b;
|
|
50
49
|
return {
|
|
51
|
-
prop:
|
|
52
|
-
order:
|
|
50
|
+
prop: props.defaultSort?.prop,
|
|
51
|
+
order: props.defaultSort?.order
|
|
53
52
|
};
|
|
54
53
|
});
|
|
55
54
|
const rowStyle = computed(() => {
|
|
@@ -112,8 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
112
111
|
return rowStyle2;
|
|
113
112
|
} else {
|
|
114
113
|
return (scope) => {
|
|
115
|
-
|
|
116
|
-
const prop = (_a = props.form) == null ? void 0 : _a.prop;
|
|
114
|
+
const prop = props.form?.prop;
|
|
117
115
|
const obj = lists.value[scope.columnIndex];
|
|
118
116
|
const defaultFormfilter = () => {
|
|
119
117
|
return obj.isform && obj.compon && prop && scope.row[prop];
|
|
@@ -140,8 +138,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
140
138
|
}
|
|
141
139
|
});
|
|
142
140
|
function validate() {
|
|
143
|
-
|
|
144
|
-
(_a = formRef.value) == null ? void 0 : _a.validate((valid) => {
|
|
141
|
+
formRef.value?.validate((valid) => {
|
|
145
142
|
if (valid) {
|
|
146
143
|
emit("submit", dataFormValue.value);
|
|
147
144
|
}
|
|
@@ -43,7 +43,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43
43
|
empty
|
|
44
44
|
});
|
|
45
45
|
return (_ctx, _cache) => {
|
|
46
|
-
var _a, _b, _c;
|
|
47
46
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48
47
|
class: vue.normalizeClass(vue.unref(cs).z()),
|
|
49
48
|
style: vue.normalizeStyle(vue.unref(cs).vdo({ height: vue.unref(height) }))
|
|
@@ -52,10 +51,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
51
|
height: vue.unref(height),
|
|
53
52
|
ref_key: "refTable",
|
|
54
53
|
ref: refTable,
|
|
55
|
-
class: [vue.unref(cs).z("main"), vue.unref(cs).is("radio",
|
|
54
|
+
class: [vue.unref(cs).z("main"), vue.unref(cs).is("radio", vue.unref(tableConfig).config?.isradio)],
|
|
56
55
|
value: vue.unref(data).list,
|
|
57
56
|
list: vue.unref(tableList),
|
|
58
|
-
size:
|
|
57
|
+
size: vue.unref(tableConfig).config?.size,
|
|
59
58
|
paginat: vue.unref(paginat),
|
|
60
59
|
loading: vue.unref(loading),
|
|
61
60
|
options: props.options,
|
|
@@ -75,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
75
74
|
};
|
|
76
75
|
})
|
|
77
76
|
]), 1040, ["height", "class", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"]),
|
|
78
|
-
|
|
77
|
+
vue.unref(tableConfig).paginat?.is ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.Pagin), vue.mergeProps({ key: 0 }, vue.unref(pagconfig), {
|
|
79
78
|
class: vue.unref(cs).z("paginat"),
|
|
80
79
|
paginat: vue.unref(paginat),
|
|
81
80
|
total: vue.unref(data).total,
|
|
@@ -41,7 +41,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
empty
|
|
42
42
|
});
|
|
43
43
|
return (_ctx, _cache) => {
|
|
44
|
-
var _a, _b, _c;
|
|
45
44
|
return openBlock(), createElementBlock("div", {
|
|
46
45
|
class: normalizeClass(unref(cs).z()),
|
|
47
46
|
style: normalizeStyle(unref(cs).vdo({ height: unref(height) }))
|
|
@@ -50,10 +49,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
49
|
height: unref(height),
|
|
51
50
|
ref_key: "refTable",
|
|
52
51
|
ref: refTable,
|
|
53
|
-
class: [unref(cs).z("main"), unref(cs).is("radio",
|
|
52
|
+
class: [unref(cs).z("main"), unref(cs).is("radio", unref(tableConfig).config?.isradio)],
|
|
54
53
|
value: unref(data).list,
|
|
55
54
|
list: unref(tableList),
|
|
56
|
-
size:
|
|
55
|
+
size: unref(tableConfig).config?.size,
|
|
57
56
|
paginat: unref(paginat),
|
|
58
57
|
loading: unref(loading),
|
|
59
58
|
options: props.options,
|
|
@@ -73,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
72
|
};
|
|
74
73
|
})
|
|
75
74
|
]), 1040, ["height", "class", "value", "list", "size", "paginat", "loading", "options", "compons", "onSortChange", "onListEvents", "onSelect", "onRowClick", "onSelectionChange"]),
|
|
76
|
-
|
|
75
|
+
unref(tableConfig).paginat?.is ? (openBlock(), createBlock(unref(Pagin), mergeProps({ key: 0 }, unref(pagconfig), {
|
|
77
76
|
class: unref(cs).z("paginat"),
|
|
78
77
|
paginat: unref(paginat),
|
|
79
78
|
total: unref(data).total,
|