@fangzhongya/fang-ui 0.1.19 → 0.1.20
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/forms/src/data.cjs +3 -3
- package/dist/components/forms/src/data.d.ts +1 -1
- package/dist/components/forms/src/data.js +3 -3
- package/dist/components/forms/src/index2.cjs +5 -3
- package/dist/components/forms/src/index2.js +5 -3
- package/dist/components/forms/src/setup.cjs +0 -7
- package/dist/components/forms/src/setup.js +0 -7
- package/dist/components/forms-div/src/data.cjs +1 -1
- package/dist/components/forms-div/src/data.js +1 -1
- package/dist/components/forms-div/src/index2.cjs +7 -1
- package/dist/components/forms-div/src/index2.js +7 -1
- package/dist/components/forms-item/src/data.cjs +1 -1
- package/dist/components/forms-item/src/data.js +1 -1
- package/dist/components/forms-item/src/index2.cjs +4 -2
- package/dist/components/forms-item/src/index2.js +4 -2
- package/dist/components/forms-items/src/data.cjs +1 -1
- package/dist/components/forms-items/src/data.js +1 -1
- package/dist/components/forms-items/src/index2.cjs +4 -2
- package/dist/components/forms-items/src/index2.js +4 -2
- package/dist/components/global-config/src/data.cjs +12 -0
- package/dist/components/global-config/src/data.d.ts +12 -0
- package/dist/components/global-config/src/data.js +12 -0
- package/dist/components/index.cjs +8 -6
- package/dist/{index.css → components/index.css} +39 -22
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.scss +2 -2
- package/dist/components/index2.scss +2 -2
- package/dist/components/list/index.css +12 -0
- package/dist/components/list/index.scss +15 -0
- package/dist/components/list/src/data.cjs +21 -2
- package/dist/components/list/src/data.d.ts +22 -1
- package/dist/components/list/src/data.js +21 -2
- package/dist/components/list/src/index2.cjs +61 -10
- package/dist/components/list/src/index2.js +61 -10
- package/dist/components/list/style/index2.scss +1 -0
- package/dist/components/page/index.css +11 -0
- package/dist/components/tables/common/pagin.cjs +60 -16
- package/dist/components/tables/common/pagin.d.ts +8 -0
- package/dist/components/tables/common/pagin.js +60 -16
- package/dist/components/tables/common/tooltip.cjs +101 -0
- package/dist/components/tables/common/tooltip.d.ts +6 -0
- package/dist/components/tables/common/tooltip.js +101 -0
- package/dist/components/tables/common/util.cjs +3 -3
- package/dist/components/tables/common/util.js +3 -3
- package/dist/components/tables/src/column.cjs +19 -15
- package/dist/components/tables/src/column.d.ts +3 -2
- package/dist/components/tables/src/column.js +17 -13
- package/dist/components/tables/src/columns3.cjs +16 -32
- package/dist/components/tables/src/columns3.js +15 -31
- package/dist/components/tables/src/data.cjs +3 -2
- package/dist/components/tables/src/data.d.ts +1 -0
- package/dist/components/tables/src/data.js +3 -2
- package/dist/components/tablespd/index.cjs +9 -0
- package/dist/components/tablespd/index.css +88 -0
- package/dist/components/tablespd/index.d.ts +4 -0
- package/dist/components/tablespd/index.js +9 -0
- package/dist/components/tablespd/index.scss +40 -0
- package/dist/components/tablespd/src/data.cjs +13 -0
- package/dist/components/tablespd/src/data.d.ts +18 -0
- package/dist/components/tablespd/src/data.js +13 -0
- package/dist/components/tablespd/src/index.cjs +4 -0
- package/dist/components/tablespd/src/index.js +4 -0
- package/dist/components/tablespd/src/index2.cjs +111 -0
- package/dist/components/tablespd/src/index2.js +111 -0
- package/dist/components/tablespd/style/index2.scss +4 -0
- package/dist/components/tablesv/src/column.cjs +4 -4
- package/dist/components/tablesv/src/column.js +3 -3
- package/dist/css/index.css +39 -22
- package/dist/css/list.css +12 -0
- package/dist/css/page.css +11 -0
- package/dist/css/tablespd.css +88 -0
- package/dist/directives/index.cjs +6 -4
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/index.js +4 -2
- package/dist/directives/sortable/index.cjs +45 -0
- package/dist/directives/sortable/index.d.ts +6 -0
- package/dist/directives/sortable/index.js +45 -0
- package/dist/expand/{chunk-XY53LCPN.js → chunk-2BLP2ANQ.js} +3 -0
- package/dist/expand/{chunk-IEODUGVJ.cjs → chunk-OT6GISSR.cjs} +3 -0
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/hooks/cssname/index.d.ts +2 -2
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.js +1 -2
- package/dist/hooks/inherit/index.cjs +0 -8
- package/dist/hooks/inherit/index.d.ts +0 -1
- package/dist/hooks/inherit/index.js +0 -8
- package/dist/icons/index.json +1 -1
- package/dist/index.cjs +30 -26
- package/dist/index.js +6 -2
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.cjs +2758 -0
- package/dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js +2758 -0
- package/dist/utils/vues/getAttrValue.cjs +11 -0
- package/dist/utils/vues/getAttrValue.d.ts +3 -0
- package/dist/utils/vues/getAttrValue.js +11 -0
- package/dist/utils/vues/index.cjs +2 -0
- package/dist/utils/vues/index.d.ts +1 -0
- package/dist/utils/vues/index.js +2 -0
- package/package.json +7 -5
- /package/dist/components/{forms-item → forms-items}/index.css +0 -0
- /package/dist/components/{date-picker → global-config}/index.css +0 -0
- /package/dist/css/{forms-item.css → forms-items.css} +0 -0
- /package/dist/css/{date-picker.css → global-config.css} +0 -0
|
@@ -84,6 +84,9 @@ export declare const dataProps: {
|
|
|
84
84
|
align: {
|
|
85
85
|
type: StringConstructor;
|
|
86
86
|
};
|
|
87
|
+
showOverflow: {
|
|
88
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
89
|
+
};
|
|
87
90
|
/**
|
|
88
91
|
* @props { String } labelAlign ( )
|
|
89
92
|
* 标签展示左右位置
|
|
@@ -91,6 +94,13 @@ export declare const dataProps: {
|
|
|
91
94
|
labelAlign: {
|
|
92
95
|
type: StringConstructor;
|
|
93
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* @props { String } items ( )
|
|
99
|
+
* 展示上下位置
|
|
100
|
+
*/
|
|
101
|
+
items: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
};
|
|
94
104
|
/**
|
|
95
105
|
* @props { String } labelItems=center ( )
|
|
96
106
|
* 标签展示上下位置
|
|
@@ -99,9 +109,20 @@ export declare const dataProps: {
|
|
|
99
109
|
type: StringConstructor;
|
|
100
110
|
default: string;
|
|
101
111
|
};
|
|
102
|
-
|
|
112
|
+
/**
|
|
113
|
+
* @props { String } rowMaxHeight ( )
|
|
114
|
+
* 最大高度
|
|
115
|
+
*/
|
|
116
|
+
rowMaxHeight: {
|
|
103
117
|
type: StringConstructor;
|
|
104
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* @props { Number } lineClamp ( )
|
|
121
|
+
* 超出几行隐藏
|
|
122
|
+
*/
|
|
123
|
+
lineClamp: {
|
|
124
|
+
type: NumberConstructor;
|
|
125
|
+
};
|
|
105
126
|
/**
|
|
106
127
|
* @props { Boolean, String } border=true ( )
|
|
107
128
|
* 是否需要边框,边框颜色
|
|
@@ -74,6 +74,9 @@ const dataProps = {
|
|
|
74
74
|
align: {
|
|
75
75
|
type: String
|
|
76
76
|
},
|
|
77
|
+
showOverflow: {
|
|
78
|
+
type: [Boolean, String]
|
|
79
|
+
},
|
|
77
80
|
/**
|
|
78
81
|
* @props { String } labelAlign ( )
|
|
79
82
|
* 标签展示左右位置
|
|
@@ -81,6 +84,13 @@ const dataProps = {
|
|
|
81
84
|
labelAlign: {
|
|
82
85
|
type: String
|
|
83
86
|
},
|
|
87
|
+
/**
|
|
88
|
+
* @props { String } items ( )
|
|
89
|
+
* 展示上下位置
|
|
90
|
+
*/
|
|
91
|
+
items: {
|
|
92
|
+
type: String
|
|
93
|
+
},
|
|
84
94
|
/**
|
|
85
95
|
* @props { String } labelItems=center ( )
|
|
86
96
|
* 标签展示上下位置
|
|
@@ -89,8 +99,17 @@ const dataProps = {
|
|
|
89
99
|
type: String,
|
|
90
100
|
default: "center"
|
|
91
101
|
},
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
/**
|
|
103
|
+
* @props { String } rowMaxHeight ( )
|
|
104
|
+
* 最大高度
|
|
105
|
+
*/
|
|
106
|
+
rowMaxHeight: { type: String },
|
|
107
|
+
/**
|
|
108
|
+
* @props { Number } lineClamp ( )
|
|
109
|
+
* 超出几行隐藏
|
|
110
|
+
*/
|
|
111
|
+
lineClamp: {
|
|
112
|
+
type: Number
|
|
94
113
|
},
|
|
95
114
|
/**
|
|
96
115
|
* @props { Boolean, String } border=true ( )
|
|
@@ -6,6 +6,7 @@ const css = require("../../common/css.cjs");
|
|
|
6
6
|
const use = require("../../common/use.cjs");
|
|
7
7
|
const compons = require("../../common/compons.cjs");
|
|
8
8
|
const index$1 = require("../../../hooks/cssname/index.cjs");
|
|
9
|
+
const tooltip = require("../../tables/common/tooltip.cjs");
|
|
9
10
|
const index = require("../../../hooks/props-default/index.cjs");
|
|
10
11
|
const data = require("./data.cjs");
|
|
11
12
|
require("../../tables/common/img.cjs");
|
|
@@ -24,6 +25,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
24
25
|
index.viewProps(props, data.name);
|
|
25
26
|
const compons$1 = compons.getCompons(props.compons);
|
|
26
27
|
const cs = index$1.useCssName(data.name);
|
|
28
|
+
const refDom = vue.ref();
|
|
27
29
|
const isfocus = vue.ref(false);
|
|
28
30
|
const rowObj = vue.ref();
|
|
29
31
|
const borderColor = vue.computed(() => {
|
|
@@ -61,9 +63,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
61
63
|
lin = props.column;
|
|
62
64
|
is = true;
|
|
63
65
|
} else {
|
|
64
|
-
let k = (obj.
|
|
66
|
+
let k = (obj.colspan || 1) + lin;
|
|
65
67
|
if (k > props.column) {
|
|
66
|
-
lin = obj.
|
|
68
|
+
lin = obj.colspan || 1;
|
|
67
69
|
is = true;
|
|
68
70
|
} else {
|
|
69
71
|
lin = k;
|
|
@@ -99,9 +101,9 @@ const _sfc_main = vue.defineComponent({
|
|
|
99
101
|
lin = props.column;
|
|
100
102
|
is = true;
|
|
101
103
|
} else {
|
|
102
|
-
let k = (obj.
|
|
104
|
+
let k = (obj.colspan || 1) + lin;
|
|
103
105
|
if (k > props.column) {
|
|
104
|
-
lin = obj.
|
|
106
|
+
lin = obj.colspan || 1;
|
|
105
107
|
is = true;
|
|
106
108
|
} else {
|
|
107
109
|
lin = k;
|
|
@@ -156,6 +158,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
156
158
|
obj.class ?? ""
|
|
157
159
|
].join(" "),
|
|
158
160
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
161
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
159
162
|
onClick: (event) => {
|
|
160
163
|
isfocus.value = true;
|
|
161
164
|
rowObj.value = obj;
|
|
@@ -187,6 +190,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
187
190
|
]
|
|
188
191
|
);
|
|
189
192
|
};
|
|
193
|
+
const handleCellMouseLeave = ($event) => {
|
|
194
|
+
tooltip.hideTooltip($event);
|
|
195
|
+
};
|
|
196
|
+
const handleCellMouseEnter = ($event, obj) => {
|
|
197
|
+
const showOverflow = obj.showOverflow ?? props.showOverflow;
|
|
198
|
+
if (showOverflow) {
|
|
199
|
+
tooltip.showTooltip(
|
|
200
|
+
$event,
|
|
201
|
+
refDom.value,
|
|
202
|
+
showOverflow,
|
|
203
|
+
props.lineClamp
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
190
207
|
const getChildrenValue = (obj, index2) => {
|
|
191
208
|
if (obj.children) {
|
|
192
209
|
return [
|
|
@@ -208,7 +225,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
208
225
|
class: cs.z("table-value"),
|
|
209
226
|
style: {
|
|
210
227
|
textAlign: obj.align || props.align
|
|
211
|
-
}
|
|
228
|
+
},
|
|
229
|
+
title: obj.title,
|
|
230
|
+
onMouseenter: ($event) => handleCellMouseEnter($event, obj),
|
|
231
|
+
onMouseleave: handleCellMouseLeave
|
|
212
232
|
},
|
|
213
233
|
[
|
|
214
234
|
util.setSslot(
|
|
@@ -239,7 +259,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
239
259
|
obj.class ?? ""
|
|
240
260
|
].join(" "),
|
|
241
261
|
colspan: setColspan(obj),
|
|
242
|
-
rowspan: isRow
|
|
262
|
+
rowspan: setRowspan(obj, isRow),
|
|
243
263
|
onClick: (event) => {
|
|
244
264
|
isfocus.value = true;
|
|
245
265
|
rowObj.value = obj;
|
|
@@ -261,6 +281,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
261
281
|
"td",
|
|
262
282
|
{
|
|
263
283
|
colspan: setColspan(obj),
|
|
284
|
+
rowspan: setRowspan(obj),
|
|
264
285
|
class: cs.is("whole", obj.whole)
|
|
265
286
|
},
|
|
266
287
|
[
|
|
@@ -287,8 +308,8 @@ const _sfc_main = vue.defineComponent({
|
|
|
287
308
|
if (["auto", "top"].includes(props.labelPosition)) {
|
|
288
309
|
if (obj.whole) {
|
|
289
310
|
return props.column;
|
|
290
|
-
} else if (obj.
|
|
291
|
-
return obj.
|
|
311
|
+
} else if (obj.colspan) {
|
|
312
|
+
return obj.colspan;
|
|
292
313
|
} else {
|
|
293
314
|
return "";
|
|
294
315
|
}
|
|
@@ -296,21 +317,51 @@ const _sfc_main = vue.defineComponent({
|
|
|
296
317
|
const j = !obj.isdiv ? 0 : 1;
|
|
297
318
|
if (obj.whole) {
|
|
298
319
|
return (props.column - 1) * 2 + 1 + j;
|
|
299
|
-
} else if (obj.
|
|
300
|
-
return (obj.
|
|
320
|
+
} else if (obj.colspan) {
|
|
321
|
+
return (obj.colspan - 1) * 2 + 1 + j;
|
|
301
322
|
} else {
|
|
302
323
|
return 1 + j;
|
|
303
324
|
}
|
|
304
325
|
}
|
|
305
326
|
};
|
|
327
|
+
const setRowspan = (obj, isRow) => {
|
|
328
|
+
if (props.labelPosition == "top") {
|
|
329
|
+
const j = !obj.isdiv ? 0 : 1;
|
|
330
|
+
if (obj.rowspan) {
|
|
331
|
+
return (obj.rowspan - 1) * 2 + 1 + j;
|
|
332
|
+
} else if (isRow) {
|
|
333
|
+
return 2;
|
|
334
|
+
}
|
|
335
|
+
} else if (props.labelPosition == "auto") {
|
|
336
|
+
if (obj.rowspan) {
|
|
337
|
+
return obj.rowspan;
|
|
338
|
+
} else if (isRow) {
|
|
339
|
+
return 2;
|
|
340
|
+
}
|
|
341
|
+
} else {
|
|
342
|
+
if (obj.rowspan) {
|
|
343
|
+
return obj.rowspan;
|
|
344
|
+
} else if (isRow) {
|
|
345
|
+
return 2;
|
|
346
|
+
} else {
|
|
347
|
+
return 1;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
};
|
|
306
352
|
const renderValue = () => {
|
|
307
353
|
if (props.list && props.list.length > 0) {
|
|
308
354
|
return vue.h(
|
|
309
355
|
"div",
|
|
310
356
|
{
|
|
357
|
+
ref: (el) => {
|
|
358
|
+
refDom.value = el;
|
|
359
|
+
},
|
|
311
360
|
class: cs.z("div"),
|
|
312
361
|
style: cs.vdo({
|
|
313
362
|
borderColor: borderColor.value,
|
|
363
|
+
rowMaxHeight: props.rowMaxHeight,
|
|
364
|
+
lineClamp: props.lineClamp,
|
|
314
365
|
interval: props.interval
|
|
315
366
|
})
|
|
316
367
|
// onClick(event: Event) {
|
|
@@ -4,6 +4,7 @@ import { setStyles } from "../../common/css.js";
|
|
|
4
4
|
import { useObjComponSelected, useHide } from "../../common/use.js";
|
|
5
5
|
import { getCompons } from "../../common/compons.js";
|
|
6
6
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
7
|
+
import { hideTooltip, showTooltip } from "../../tables/common/tooltip.js";
|
|
7
8
|
import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
|
|
8
9
|
import { name, dataProps, dataExpose, dataEmits } from "./data.js";
|
|
9
10
|
import "../../tables/common/img.js";
|
|
@@ -22,6 +23,7 @@ const _sfc_main = defineComponent({
|
|
|
22
23
|
viewProps(props, name);
|
|
23
24
|
const compons = getCompons(props.compons);
|
|
24
25
|
const cs = useCssName(name);
|
|
26
|
+
const refDom = ref();
|
|
25
27
|
const isfocus = ref(false);
|
|
26
28
|
const rowObj = ref();
|
|
27
29
|
const borderColor = computed(() => {
|
|
@@ -59,9 +61,9 @@ const _sfc_main = defineComponent({
|
|
|
59
61
|
lin = props.column;
|
|
60
62
|
is = true;
|
|
61
63
|
} else {
|
|
62
|
-
let k = (obj.
|
|
64
|
+
let k = (obj.colspan || 1) + lin;
|
|
63
65
|
if (k > props.column) {
|
|
64
|
-
lin = obj.
|
|
66
|
+
lin = obj.colspan || 1;
|
|
65
67
|
is = true;
|
|
66
68
|
} else {
|
|
67
69
|
lin = k;
|
|
@@ -97,9 +99,9 @@ const _sfc_main = defineComponent({
|
|
|
97
99
|
lin = props.column;
|
|
98
100
|
is = true;
|
|
99
101
|
} else {
|
|
100
|
-
let k = (obj.
|
|
102
|
+
let k = (obj.colspan || 1) + lin;
|
|
101
103
|
if (k > props.column) {
|
|
102
|
-
lin = obj.
|
|
104
|
+
lin = obj.colspan || 1;
|
|
103
105
|
is = true;
|
|
104
106
|
} else {
|
|
105
107
|
lin = k;
|
|
@@ -154,6 +156,7 @@ const _sfc_main = defineComponent({
|
|
|
154
156
|
obj.class ?? ""
|
|
155
157
|
].join(" "),
|
|
156
158
|
colspan: props.labelPosition == "top" ? setColspan(obj) : void 0,
|
|
159
|
+
rowspan: props.labelPosition == "top" ? void 0 : setRowspan(obj),
|
|
157
160
|
onClick: (event) => {
|
|
158
161
|
isfocus.value = true;
|
|
159
162
|
rowObj.value = obj;
|
|
@@ -185,6 +188,20 @@ const _sfc_main = defineComponent({
|
|
|
185
188
|
]
|
|
186
189
|
);
|
|
187
190
|
};
|
|
191
|
+
const handleCellMouseLeave = ($event) => {
|
|
192
|
+
hideTooltip($event);
|
|
193
|
+
};
|
|
194
|
+
const handleCellMouseEnter = ($event, obj) => {
|
|
195
|
+
const showOverflow = obj.showOverflow ?? props.showOverflow;
|
|
196
|
+
if (showOverflow) {
|
|
197
|
+
showTooltip(
|
|
198
|
+
$event,
|
|
199
|
+
refDom.value,
|
|
200
|
+
showOverflow,
|
|
201
|
+
props.lineClamp
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
188
205
|
const getChildrenValue = (obj, index) => {
|
|
189
206
|
if (obj.children) {
|
|
190
207
|
return [
|
|
@@ -206,7 +223,10 @@ const _sfc_main = defineComponent({
|
|
|
206
223
|
class: cs.z("table-value"),
|
|
207
224
|
style: {
|
|
208
225
|
textAlign: obj.align || props.align
|
|
209
|
-
}
|
|
226
|
+
},
|
|
227
|
+
title: obj.title,
|
|
228
|
+
onMouseenter: ($event) => handleCellMouseEnter($event, obj),
|
|
229
|
+
onMouseleave: handleCellMouseLeave
|
|
210
230
|
},
|
|
211
231
|
[
|
|
212
232
|
setSslot(
|
|
@@ -237,7 +257,7 @@ const _sfc_main = defineComponent({
|
|
|
237
257
|
obj.class ?? ""
|
|
238
258
|
].join(" "),
|
|
239
259
|
colspan: setColspan(obj),
|
|
240
|
-
rowspan: isRow
|
|
260
|
+
rowspan: setRowspan(obj, isRow),
|
|
241
261
|
onClick: (event) => {
|
|
242
262
|
isfocus.value = true;
|
|
243
263
|
rowObj.value = obj;
|
|
@@ -259,6 +279,7 @@ const _sfc_main = defineComponent({
|
|
|
259
279
|
"td",
|
|
260
280
|
{
|
|
261
281
|
colspan: setColspan(obj),
|
|
282
|
+
rowspan: setRowspan(obj),
|
|
262
283
|
class: cs.is("whole", obj.whole)
|
|
263
284
|
},
|
|
264
285
|
[
|
|
@@ -285,8 +306,8 @@ const _sfc_main = defineComponent({
|
|
|
285
306
|
if (["auto", "top"].includes(props.labelPosition)) {
|
|
286
307
|
if (obj.whole) {
|
|
287
308
|
return props.column;
|
|
288
|
-
} else if (obj.
|
|
289
|
-
return obj.
|
|
309
|
+
} else if (obj.colspan) {
|
|
310
|
+
return obj.colspan;
|
|
290
311
|
} else {
|
|
291
312
|
return "";
|
|
292
313
|
}
|
|
@@ -294,21 +315,51 @@ const _sfc_main = defineComponent({
|
|
|
294
315
|
const j = !obj.isdiv ? 0 : 1;
|
|
295
316
|
if (obj.whole) {
|
|
296
317
|
return (props.column - 1) * 2 + 1 + j;
|
|
297
|
-
} else if (obj.
|
|
298
|
-
return (obj.
|
|
318
|
+
} else if (obj.colspan) {
|
|
319
|
+
return (obj.colspan - 1) * 2 + 1 + j;
|
|
299
320
|
} else {
|
|
300
321
|
return 1 + j;
|
|
301
322
|
}
|
|
302
323
|
}
|
|
303
324
|
};
|
|
325
|
+
const setRowspan = (obj, isRow) => {
|
|
326
|
+
if (props.labelPosition == "top") {
|
|
327
|
+
const j = !obj.isdiv ? 0 : 1;
|
|
328
|
+
if (obj.rowspan) {
|
|
329
|
+
return (obj.rowspan - 1) * 2 + 1 + j;
|
|
330
|
+
} else if (isRow) {
|
|
331
|
+
return 2;
|
|
332
|
+
}
|
|
333
|
+
} else if (props.labelPosition == "auto") {
|
|
334
|
+
if (obj.rowspan) {
|
|
335
|
+
return obj.rowspan;
|
|
336
|
+
} else if (isRow) {
|
|
337
|
+
return 2;
|
|
338
|
+
}
|
|
339
|
+
} else {
|
|
340
|
+
if (obj.rowspan) {
|
|
341
|
+
return obj.rowspan;
|
|
342
|
+
} else if (isRow) {
|
|
343
|
+
return 2;
|
|
344
|
+
} else {
|
|
345
|
+
return 1;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return;
|
|
349
|
+
};
|
|
304
350
|
const renderValue = () => {
|
|
305
351
|
if (props.list && props.list.length > 0) {
|
|
306
352
|
return h(
|
|
307
353
|
"div",
|
|
308
354
|
{
|
|
355
|
+
ref: (el) => {
|
|
356
|
+
refDom.value = el;
|
|
357
|
+
},
|
|
309
358
|
class: cs.z("div"),
|
|
310
359
|
style: cs.vdo({
|
|
311
360
|
borderColor: borderColor.value,
|
|
361
|
+
rowMaxHeight: props.rowMaxHeight,
|
|
362
|
+
lineClamp: props.lineClamp,
|
|
312
363
|
interval: props.interval
|
|
313
364
|
})
|
|
314
365
|
// onClick(event: Event) {
|
|
@@ -697,6 +697,17 @@
|
|
|
697
697
|
.list-div .list-table .list-table-th {
|
|
698
698
|
text-align: left;
|
|
699
699
|
}
|
|
700
|
+
.list-div .list-table .list-table-value {
|
|
701
|
+
word-break: break-all;
|
|
702
|
+
white-space: normal;
|
|
703
|
+
display: block;
|
|
704
|
+
max-height: var(--list-row-max-height);
|
|
705
|
+
display: -webkit-box;
|
|
706
|
+
-webkit-line-clamp: var(--list-line-clamp); /* 显示的行数 */
|
|
707
|
+
-webkit-box-orient: vertical;
|
|
708
|
+
overflow: hidden;
|
|
709
|
+
text-overflow: ellipsis;
|
|
710
|
+
}
|
|
700
711
|
.list-div .list-table.right .list-table-th {
|
|
701
712
|
text-align: right;
|
|
702
713
|
}
|
|
@@ -52,7 +52,7 @@ const dataProps = {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
const dataEmit = ["list-events", "selection"];
|
|
55
|
+
const dataEmit = ["list-events", "selection", "drag", "update:value"];
|
|
56
56
|
const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
57
57
|
var _a, _b;
|
|
58
58
|
const loading = vue.ref(false);
|
|
@@ -75,8 +75,11 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
75
75
|
const pagconfig = vue.ref(mpagconfig);
|
|
76
76
|
const paginat = vue.reactive({
|
|
77
77
|
is: false,
|
|
78
|
+
// 跨页多选
|
|
78
79
|
cross: false,
|
|
80
|
+
// 前端分页
|
|
79
81
|
front: false,
|
|
82
|
+
// 滚动加载
|
|
80
83
|
scroll: false,
|
|
81
84
|
current: 1,
|
|
82
85
|
pageSize: mpagconfig.pageSize,
|
|
@@ -222,24 +225,26 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
222
225
|
console.log("crossPageData", crossPageData);
|
|
223
226
|
}
|
|
224
227
|
function getCrossPageValue(sarr, index) {
|
|
228
|
+
var _a2;
|
|
225
229
|
const cross = paginat.cross;
|
|
226
230
|
if (cross) {
|
|
227
|
-
|
|
231
|
+
const rowKey = typeof cross === "string" ? cross : (_a2 = tableConfig.value.config) == null ? void 0 : _a2.rowKey;
|
|
232
|
+
if (rowKey) {
|
|
228
233
|
const sv = /* @__PURE__ */ new Set();
|
|
229
234
|
const is = [];
|
|
230
235
|
if (sarr && index) {
|
|
231
236
|
crossPageData.value.forEach((arr, i) => {
|
|
232
237
|
if (i === index) {
|
|
233
238
|
sarr.forEach((v) => {
|
|
234
|
-
if (!is.includes(v[
|
|
235
|
-
is.push(v[
|
|
239
|
+
if (!is.includes(v[rowKey])) {
|
|
240
|
+
is.push(v[rowKey]);
|
|
236
241
|
sv.add(v);
|
|
237
242
|
}
|
|
238
243
|
});
|
|
239
244
|
} else {
|
|
240
245
|
arr.forEach((v) => {
|
|
241
|
-
if (!is.includes(v[
|
|
242
|
-
is.push(v[
|
|
246
|
+
if (!is.includes(v[rowKey])) {
|
|
247
|
+
is.push(v[rowKey]);
|
|
243
248
|
sv.add(v);
|
|
244
249
|
}
|
|
245
250
|
});
|
|
@@ -247,8 +252,8 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
247
252
|
});
|
|
248
253
|
if (!crossPageData.value[index]) {
|
|
249
254
|
sarr.forEach((v) => {
|
|
250
|
-
if (!is.includes(v[
|
|
251
|
-
is.push(v[
|
|
255
|
+
if (!is.includes(v[rowKey])) {
|
|
256
|
+
is.push(v[rowKey]);
|
|
252
257
|
sv.add(v);
|
|
253
258
|
}
|
|
254
259
|
});
|
|
@@ -256,8 +261,8 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
256
261
|
} else {
|
|
257
262
|
crossPageData.value.forEach((arr) => {
|
|
258
263
|
arr.forEach((v) => {
|
|
259
|
-
if (!is.includes(v[
|
|
260
|
-
is.push(v[
|
|
264
|
+
if (!is.includes(v[rowKey])) {
|
|
265
|
+
is.push(v[rowKey]);
|
|
261
266
|
sv.add(v);
|
|
262
267
|
}
|
|
263
268
|
});
|
|
@@ -297,14 +302,16 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
304
|
function toggleCrossPage() {
|
|
305
|
+
var _a2;
|
|
300
306
|
const cross = paginat.cross;
|
|
301
307
|
if (paginat.is && cross && !paginat.scroll) {
|
|
302
308
|
const datas = data.list;
|
|
303
309
|
const vs = getCrossPageValue();
|
|
304
|
-
|
|
305
|
-
|
|
310
|
+
const rowKey = typeof cross === "string" ? cross : (_a2 = tableConfig.value.config) == null ? void 0 : _a2.rowKey;
|
|
311
|
+
if (rowKey) {
|
|
312
|
+
const iss = vs.map((o) => o[rowKey]);
|
|
306
313
|
const ts = datas.filter((v) => {
|
|
307
|
-
return iss.includes(v[
|
|
314
|
+
return iss.includes(v[rowKey]);
|
|
308
315
|
});
|
|
309
316
|
vue.nextTick(() => {
|
|
310
317
|
ts.forEach((v) => {
|
|
@@ -485,7 +492,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
485
492
|
const total = list.length;
|
|
486
493
|
const c = paginat.current;
|
|
487
494
|
const z = paginat.pageSize;
|
|
488
|
-
const
|
|
495
|
+
const v = list.slice((c - 1) * z, c * z);
|
|
489
496
|
const value = {};
|
|
490
497
|
let ajaxData = {};
|
|
491
498
|
if (typeof tableConfig.value.ajax === "object") {
|
|
@@ -493,7 +500,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
493
500
|
}
|
|
494
501
|
const l = (ajaxData == null ? void 0 : ajaxData.list) ?? mpagconfig.data.list;
|
|
495
502
|
const t = (ajaxData == null ? void 0 : ajaxData.total) ?? mpagconfig.data.total;
|
|
496
|
-
objValue.setObjValue(value, l,
|
|
503
|
+
objValue.setObjValue(value, l, v);
|
|
497
504
|
objValue.setObjValue(value, t, total);
|
|
498
505
|
obj.value = value;
|
|
499
506
|
}
|
|
@@ -637,6 +644,41 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
637
644
|
onChange: onScroll
|
|
638
645
|
};
|
|
639
646
|
});
|
|
647
|
+
function onSortable({
|
|
648
|
+
oldIndex,
|
|
649
|
+
newIndex
|
|
650
|
+
}) {
|
|
651
|
+
if (oldIndex === newIndex) return;
|
|
652
|
+
const movedItem = data.list.splice(oldIndex, 1)[0];
|
|
653
|
+
data.list.splice(newIndex, 0, movedItem);
|
|
654
|
+
if (paginat.is && paginat.front) {
|
|
655
|
+
const q = (paginat.current - 1) * paginat.pageSize;
|
|
656
|
+
const movedItem2 = props2.value.splice(q + oldIndex, 1)[0];
|
|
657
|
+
props2.value.splice(q + newIndex, 0, movedItem2);
|
|
658
|
+
if (props2.isValue) {
|
|
659
|
+
emit("update:value", props2.value);
|
|
660
|
+
}
|
|
661
|
+
} else {
|
|
662
|
+
if (props2.isValue) {
|
|
663
|
+
emit("update:value", data.list);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
emit("drag", data.list, newIndex, oldIndex);
|
|
667
|
+
}
|
|
668
|
+
const sortable = vue.computed(() => {
|
|
669
|
+
var _a2;
|
|
670
|
+
let is = false;
|
|
671
|
+
if ((_a2 = tableConfig.value.config) == null ? void 0 : _a2.isdrag) {
|
|
672
|
+
is = true;
|
|
673
|
+
}
|
|
674
|
+
return {
|
|
675
|
+
is,
|
|
676
|
+
onEnd: onSortable
|
|
677
|
+
};
|
|
678
|
+
});
|
|
679
|
+
const datavalue = vue.computed(() => {
|
|
680
|
+
return data.list;
|
|
681
|
+
});
|
|
640
682
|
setValue();
|
|
641
683
|
return {
|
|
642
684
|
height,
|
|
@@ -650,6 +692,7 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
650
692
|
empty,
|
|
651
693
|
loading,
|
|
652
694
|
scroll,
|
|
695
|
+
sortable,
|
|
653
696
|
onSortChange,
|
|
654
697
|
onListEvents,
|
|
655
698
|
onSelect,
|
|
@@ -660,7 +703,8 @@ const useInit = (props2, emit, refTable, getLocale, isEl) => {
|
|
|
660
703
|
onSizeChange,
|
|
661
704
|
onCurrentChange,
|
|
662
705
|
paginat,
|
|
663
|
-
data
|
|
706
|
+
data,
|
|
707
|
+
datavalue
|
|
664
708
|
};
|
|
665
709
|
};
|
|
666
710
|
exports.dataEmit = dataEmit;
|
|
@@ -266,6 +266,13 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
266
266
|
loadText: string;
|
|
267
267
|
onChange: () => void;
|
|
268
268
|
}>;
|
|
269
|
+
sortable: ComputedRef<{
|
|
270
|
+
is: boolean;
|
|
271
|
+
onEnd: ({ oldIndex, newIndex, }: {
|
|
272
|
+
oldIndex: number;
|
|
273
|
+
newIndex: number;
|
|
274
|
+
}) => void;
|
|
275
|
+
}>;
|
|
269
276
|
onSortChange: (obj: ObjAny) => void;
|
|
270
277
|
onListEvents: (...arr: any) => void;
|
|
271
278
|
onSelect: (s: ObjAny, row: ObjStr) => void;
|
|
@@ -335,4 +342,5 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
|
|
|
335
342
|
total: number;
|
|
336
343
|
list: ObjAny[];
|
|
337
344
|
};
|
|
345
|
+
datavalue: ComputedRef<ObjAny[]>;
|
|
338
346
|
};
|