@liuyunxi/table
Version:
超级表格
1,297 lines (1,288 loc) • 84.2 kB
JavaScript
import { h as zt, nextTick as Xt, createVNode as b, defineComponent as za, ref as O, reactive as Ke, watch as jt, toRefs as ja, computed as Pa, onMounted as Na, onBeforeUnmount as Va, resolveComponent as E, openBlock as s, createElementBlock as h, createElementVNode as p, renderSlot as Ma, withCtx as d, toDisplayString as I, unref as q, createTextVNode as F, createCommentVNode as j, normalizeStyle as W, normalizeClass as te, Fragment as L, renderList as G, withModifiers as $e, createSlots as La, createBlock as k, pushScopeId as Ua, popScopeId as Wa } from "vue";
import Ye from "vuedraggable";
import { cloneDeep as ot } from "lodash-es";
function K(e, a) {
Ha(e) && (e = "100%");
var t = Ka(e);
return e = a === 360 ? e : Math.min(a, Math.max(0, parseFloat(e))), t && (e = parseInt(String(e * a), 10) / 100), Math.abs(e - a) < 1e-6 ? 1 : (a === 360 ? e = (e < 0 ? e % a + a : e % a) / parseFloat(String(a)) : e = e % a / parseFloat(String(a)), e);
}
function Ha(e) {
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
}
function Ka(e) {
return typeof e == "string" && e.indexOf("%") !== -1;
}
function $a(e) {
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
}
function Je(e) {
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
}
function lt(e) {
return e.length === 1 ? "0" + e : String(e);
}
function Ya(e, a, t) {
return {
r: K(e, 255) * 255,
g: K(a, 255) * 255,
b: K(t, 255) * 255
};
}
function it(e, a, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (a - e) * (6 * t) : t < 1 / 2 ? a : t < 2 / 3 ? e + (a - e) * (2 / 3 - t) * 6 : e;
}
function Ja(e, a, t) {
var n, o, c;
if (e = K(e, 360), a = K(a, 100), t = K(t, 100), a === 0)
o = t, c = t, n = t;
else {
var v = t < 0.5 ? t * (1 + a) : t + a - t * a, m = 2 * t - v;
n = it(m, v, e + 1 / 3), o = it(m, v, e), c = it(m, v, e - 1 / 3);
}
return { r: n * 255, g: o * 255, b: c * 255 };
}
function Qa(e, a, t) {
e = K(e, 255), a = K(a, 255), t = K(t, 255);
var n = Math.max(e, a, t), o = Math.min(e, a, t), c = 0, v = n, m = n - o, S = n === 0 ? 0 : m / n;
if (n === o)
c = 0;
else {
switch (n) {
case e:
c = (a - t) / m + (a < t ? 6 : 0);
break;
case a:
c = (t - e) / m + 2;
break;
case t:
c = (e - a) / m + 4;
break;
}
c /= 6;
}
return { h: c, s: S, v };
}
function Ga(e, a, t) {
e = K(e, 360) * 6, a = K(a, 100), t = K(t, 100);
var n = Math.floor(e), o = e - n, c = t * (1 - a), v = t * (1 - o * a), m = t * (1 - (1 - o) * a), S = n % 6, _ = [t, v, c, c, m, t][S], J = [m, t, t, v, c, c][S], P = [c, c, m, t, t, v][S];
return { r: _ * 255, g: J * 255, b: P * 255 };
}
function qa(e, a, t, n) {
var o = [
lt(Math.round(e).toString(16)),
lt(Math.round(a).toString(16)),
lt(Math.round(t).toString(16))
];
return n && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) : o.join("");
}
function Pt(e) {
return H(e) / 255;
}
function H(e) {
return parseInt(e, 16);
}
var Nt = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function Fe(e) {
var a = { r: 0, g: 0, b: 0 }, t = 1, n = null, o = null, c = null, v = !1, m = !1;
return typeof e == "string" && (e = en(e)), typeof e == "object" && (Z(e.r) && Z(e.g) && Z(e.b) ? (a = Ya(e.r, e.g, e.b), v = !0, m = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : Z(e.h) && Z(e.s) && Z(e.v) ? (n = Je(e.s), o = Je(e.v), a = Ga(e.h, n, o), v = !0, m = "hsv") : Z(e.h) && Z(e.s) && Z(e.l) && (n = Je(e.s), c = Je(e.l), a = Ja(e.h, n, c), v = !0, m = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (t = e.a)), t = $a(t), {
ok: v,
format: e.format || m,
r: Math.min(255, Math.max(a.r, 0)),
g: Math.min(255, Math.max(a.g, 0)),
b: Math.min(255, Math.max(a.b, 0)),
a: t
};
}
var Za = "[-\\+]?\\d+%?", Xa = "[-\\+]?\\d*\\.\\d+%?", ae = "(?:".concat(Xa, ")|(?:").concat(Za, ")"), st = "[\\s|\\(]+(".concat(ae, ")[,|\\s]+(").concat(ae, ")[,|\\s]+(").concat(ae, ")\\s*\\)?"), ut = "[\\s|\\(]+(".concat(ae, ")[,|\\s]+(").concat(ae, ")[,|\\s]+(").concat(ae, ")[,|\\s]+(").concat(ae, ")\\s*\\)?"), Y = {
CSS_UNIT: new RegExp(ae),
rgb: new RegExp("rgb" + st),
rgba: new RegExp("rgba" + ut),
hsl: new RegExp("hsl" + st),
hsla: new RegExp("hsla" + ut),
hsv: new RegExp("hsv" + st),
hsva: new RegExp("hsva" + ut),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function en(e) {
if (e = e.trim().toLowerCase(), e.length === 0)
return !1;
var a = !1;
if (Nt[e])
e = Nt[e], a = !0;
else if (e === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var t = Y.rgb.exec(e);
return t ? { r: t[1], g: t[2], b: t[3] } : (t = Y.rgba.exec(e), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = Y.hsl.exec(e), t ? { h: t[1], s: t[2], l: t[3] } : (t = Y.hsla.exec(e), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = Y.hsv.exec(e), t ? { h: t[1], s: t[2], v: t[3] } : (t = Y.hsva.exec(e), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = Y.hex8.exec(e), t ? {
r: H(t[1]),
g: H(t[2]),
b: H(t[3]),
a: Pt(t[4]),
format: a ? "name" : "hex8"
} : (t = Y.hex6.exec(e), t ? {
r: H(t[1]),
g: H(t[2]),
b: H(t[3]),
format: a ? "name" : "hex"
} : (t = Y.hex4.exec(e), t ? {
r: H(t[1] + t[1]),
g: H(t[2] + t[2]),
b: H(t[3] + t[3]),
a: Pt(t[4] + t[4]),
format: a ? "name" : "hex8"
} : (t = Y.hex3.exec(e), t ? {
r: H(t[1] + t[1]),
g: H(t[2] + t[2]),
b: H(t[3] + t[3]),
format: a ? "name" : "hex"
} : !1)))))))));
}
function Z(e) {
return !!Y.CSS_UNIT.exec(String(e));
}
var Qe = 2, Vt = 0.16, tn = 0.05, an = 0.05, nn = 0.15, ea = 5, ta = 4, rn = [{
index: 7,
opacity: 0.15
}, {
index: 6,
opacity: 0.25
}, {
index: 5,
opacity: 0.3
}, {
index: 5,
opacity: 0.45
}, {
index: 5,
opacity: 0.65
}, {
index: 5,
opacity: 0.85
}, {
index: 4,
opacity: 0.9
}, {
index: 3,
opacity: 0.95
}, {
index: 2,
opacity: 0.97
}, {
index: 1,
opacity: 0.98
}];
function Mt(e) {
var a = e.r, t = e.g, n = e.b, o = Qa(a, t, n);
return {
h: o.h * 360,
s: o.s,
v: o.v
};
}
function Ge(e) {
var a = e.r, t = e.g, n = e.b;
return "#".concat(qa(a, t, n, !1));
}
function on(e, a, t) {
var n = t / 100, o = {
r: (a.r - e.r) * n + e.r,
g: (a.g - e.g) * n + e.g,
b: (a.b - e.b) * n + e.b
};
return o;
}
function Lt(e, a, t) {
var n;
return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? n = t ? Math.round(e.h) - Qe * a : Math.round(e.h) + Qe * a : n = t ? Math.round(e.h) + Qe * a : Math.round(e.h) - Qe * a, n < 0 ? n += 360 : n >= 360 && (n -= 360), n;
}
function Ut(e, a, t) {
if (e.h === 0 && e.s === 0)
return e.s;
var n;
return t ? n = e.s - Vt * a : a === ta ? n = e.s + Vt : n = e.s + tn * a, n > 1 && (n = 1), t && a === ea && n > 0.1 && (n = 0.1), n < 0.06 && (n = 0.06), Number(n.toFixed(2));
}
function Wt(e, a, t) {
var n;
return t ? n = e.v + an * a : n = e.v - nn * a, n > 1 && (n = 1), Number(n.toFixed(2));
}
function pt(e) {
for (var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = [], n = Fe(e), o = ea; o > 0; o -= 1) {
var c = Mt(n), v = Ge(Fe({
h: Lt(c, o, !0),
s: Ut(c, o, !0),
v: Wt(c, o, !0)
}));
t.push(v);
}
t.push(Ge(n));
for (var m = 1; m <= ta; m += 1) {
var S = Mt(n), _ = Ge(Fe({
h: Lt(S, m),
s: Ut(S, m),
v: Wt(S, m)
}));
t.push(_);
}
return a.theme === "dark" ? rn.map(function(J) {
var P = J.index, X = J.opacity, B = Ge(on(Fe(a.backgroundColor || "#141414"), Fe(t[P]), X * 100));
return B;
}) : t;
}
var ct = {
red: "#F5222D",
volcano: "#FA541C",
orange: "#FA8C16",
gold: "#FAAD14",
yellow: "#FADB14",
lime: "#A0D911",
green: "#52C41A",
cyan: "#13C2C2",
blue: "#1890FF",
geekblue: "#2F54EB",
purple: "#722ED1",
magenta: "#EB2F96",
grey: "#666666"
}, ft = {}, dt = {};
Object.keys(ct).forEach(function(e) {
ft[e] = pt(ct[e]), ft[e].primary = ft[e][5], dt[e] = pt(ct[e], {
theme: "dark",
backgroundColor: "#141414"
}), dt[e].primary = dt[e][5];
});
var Ht = [], Be = [], ln = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
function sn() {
var e = document.createElement("style");
return e.setAttribute("type", "text/css"), e;
}
function un(e, a) {
if (a = a || {}, e === void 0)
throw new Error(ln);
var t = a.prepend === !0 ? "prepend" : "append", n = a.container !== void 0 ? a.container : document.querySelector("head"), o = Ht.indexOf(n);
o === -1 && (o = Ht.push(n) - 1, Be[o] = {});
var c;
return Be[o] !== void 0 && Be[o][t] !== void 0 ? c = Be[o][t] : (c = Be[o][t] = sn(), t === "prepend" ? n.insertBefore(c, n.childNodes[0]) : n.appendChild(c)), e.charCodeAt(0) === 65279 && (e = e.substr(1, e.length)), c.styleSheet ? c.styleSheet.cssText += e : c.textContent += e, c;
}
function Kt(e) {
for (var a = 1; a < arguments.length; a++) {
var t = arguments[a] != null ? Object(arguments[a]) : {}, n = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(t).filter(function(o) {
return Object.getOwnPropertyDescriptor(t, o).enumerable;
}))), n.forEach(function(o) {
cn(e, o, t[o]);
});
}
return e;
}
function cn(e, a, t) {
return a in e ? Object.defineProperty(e, a, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = t, e;
}
function fn(e, a) {
process.env.NODE_ENV !== "production" && !e && console !== void 0 && console.error("Warning: ".concat(a));
}
function dn(e, a) {
fn(e, "[@ant-design/icons-vue] ".concat(a));
}
function $t(e) {
return typeof e == "object" && typeof e.name == "string" && typeof e.theme == "string" && (typeof e.icon == "object" || typeof e.icon == "function");
}
function ht(e, a, t) {
return t ? zt(e.tag, Kt({
key: a
}, t, e.attrs), (e.children || []).map(function(n, o) {
return ht(n, "".concat(a, "-").concat(e.tag, "-").concat(o));
})) : zt(e.tag, Kt({
key: a
}, e.attrs), (e.children || []).map(function(n, o) {
return ht(n, "".concat(a, "-").concat(e.tag, "-").concat(o));
}));
}
function aa(e) {
return pt(e)[0];
}
function na(e) {
return e ? Array.isArray(e) ? e : [e] : [];
}
var pn = `
.anticon {
display: inline-block;
color: inherit;
font-style: normal;
line-height: 0;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.anticon > * {
line-height: 1;
}
.anticon svg {
display: inline-block;
}
.anticon::before {
display: none;
}
.anticon .anticon-icon {
display: block;
}
.anticon[tabindex] {
cursor: pointer;
}
.anticon-spin::before,
.anticon-spin {
display: inline-block;
-webkit-animation: loadingCircle 1s infinite linear;
animation: loadingCircle 1s infinite linear;
}
@-webkit-keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`, Yt = !1, hn = function() {
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : pn;
Xt(function() {
Yt || (typeof window < "u" && window.document && window.document.documentElement && un(a, {
prepend: !0
}), Yt = !0);
});
}, vn = ["icon", "primaryColor", "secondaryColor"];
function gn(e, a) {
if (e == null)
return {};
var t = yn(e, a), n, o;
if (Object.getOwnPropertySymbols) {
var c = Object.getOwnPropertySymbols(e);
for (o = 0; o < c.length; o++)
n = c[o], !(a.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (t[n] = e[n]);
}
return t;
}
function yn(e, a) {
if (e == null)
return {};
var t = {}, n = Object.keys(e), o, c;
for (c = 0; c < n.length; c++)
o = n[c], !(a.indexOf(o) >= 0) && (t[o] = e[o]);
return t;
}
function qe(e) {
for (var a = 1; a < arguments.length; a++) {
var t = arguments[a] != null ? Object(arguments[a]) : {}, n = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(t).filter(function(o) {
return Object.getOwnPropertyDescriptor(t, o).enumerable;
}))), n.forEach(function(o) {
mn(e, o, t[o]);
});
}
return e;
}
function mn(e, a, t) {
return a in e ? Object.defineProperty(e, a, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = t, e;
}
var ze = {
primaryColor: "#333",
secondaryColor: "#E6E6E6",
calculated: !1
};
function bn(e) {
var a = e.primaryColor, t = e.secondaryColor;
ze.primaryColor = a, ze.secondaryColor = t || aa(a), ze.calculated = !!t;
}
function xn() {
return qe({}, ze);
}
var de = function(a, t) {
var n = qe({}, a, t.attrs), o = n.icon, c = n.primaryColor, v = n.secondaryColor, m = gn(n, vn), S = ze;
if (c && (S = {
primaryColor: c,
secondaryColor: v || aa(c)
}), hn(), dn($t(o), "icon should be icon definiton, but got ".concat(o)), !$t(o))
return null;
var _ = o;
return _ && typeof _.icon == "function" && (_ = qe({}, _, {
icon: _.icon(S.primaryColor, S.secondaryColor)
})), ht(_.icon, "svg-".concat(_.name), qe({}, m, {
"data-icon": _.name,
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true"
}));
};
de.props = {
icon: Object,
primaryColor: String,
secondaryColor: String,
focusable: String
};
de.inheritAttrs = !1;
de.displayName = "IconBase";
de.getTwoToneColors = xn;
de.setTwoToneColors = bn;
const gt = de;
function _n(e, a) {
return An(e) || wn(e, a) || Cn(e, a) || kn();
}
function kn() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Cn(e, a) {
if (e) {
if (typeof e == "string")
return Jt(e, a);
var t = Object.prototype.toString.call(e).slice(8, -1);
if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
return Array.from(e);
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
return Jt(e, a);
}
}
function Jt(e, a) {
(a == null || a > e.length) && (a = e.length);
for (var t = 0, n = new Array(a); t < a; t++)
n[t] = e[t];
return n;
}
function wn(e, a) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var n = [], o = !0, c = !1, v, m;
try {
for (t = t.call(e); !(o = (v = t.next()).done) && (n.push(v.value), !(a && n.length === a)); o = !0)
;
} catch (S) {
c = !0, m = S;
} finally {
try {
!o && t.return != null && t.return();
} finally {
if (c)
throw m;
}
}
return n;
}
}
function An(e) {
if (Array.isArray(e))
return e;
}
function ra(e) {
var a = na(e), t = _n(a, 2), n = t[0], o = t[1];
return gt.setTwoToneColors({
primaryColor: n,
secondaryColor: o
});
}
function Sn() {
var e = gt.getTwoToneColors();
return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor;
}
var On = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
function En(e, a) {
return Dn(e) || Rn(e, a) || Tn(e, a) || In();
}
function In() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Tn(e, a) {
if (e) {
if (typeof e == "string")
return Qt(e, a);
var t = Object.prototype.toString.call(e).slice(8, -1);
if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
return Array.from(e);
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
return Qt(e, a);
}
}
function Qt(e, a) {
(a == null || a > e.length) && (a = e.length);
for (var t = 0, n = new Array(a); t < a; t++)
n[t] = e[t];
return n;
}
function Rn(e, a) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var n = [], o = !0, c = !1, v, m;
try {
for (t = t.call(e); !(o = (v = t.next()).done) && (n.push(v.value), !(a && n.length === a)); o = !0)
;
} catch (S) {
c = !0, m = S;
} finally {
try {
!o && t.return != null && t.return();
} finally {
if (c)
throw m;
}
}
return n;
}
}
function Dn(e) {
if (Array.isArray(e))
return e;
}
function Gt(e) {
for (var a = 1; a < arguments.length; a++) {
var t = arguments[a] != null ? Object(arguments[a]) : {}, n = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(t).filter(function(o) {
return Object.getOwnPropertyDescriptor(t, o).enumerable;
}))), n.forEach(function(o) {
vt(e, o, t[o]);
});
}
return e;
}
function vt(e, a, t) {
return a in e ? Object.defineProperty(e, a, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = t, e;
}
function Fn(e, a) {
if (e == null)
return {};
var t = Bn(e, a), n, o;
if (Object.getOwnPropertySymbols) {
var c = Object.getOwnPropertySymbols(e);
for (o = 0; o < c.length; o++)
n = c[o], !(a.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (t[n] = e[n]);
}
return t;
}
function Bn(e, a) {
if (e == null)
return {};
var t = {}, n = Object.keys(e), o, c;
for (c = 0; c < n.length; c++)
o = n[c], !(a.indexOf(o) >= 0) && (t[o] = e[o]);
return t;
}
ra("#1890ff");
var pe = function(a, t) {
var n, o = Gt({}, a, t.attrs), c = o.class, v = o.icon, m = o.spin, S = o.rotate, _ = o.tabindex, J = o.twoToneColor, P = o.onClick, X = Fn(o, On), B = (n = {
anticon: !0
}, vt(n, "anticon-".concat(v.name), !!v.name), vt(n, c, c), n), Ze = m === "" || m || v.name === "loading" ? "anticon-spin" : "", g = _;
g === void 0 && P && (g = -1, X.tabindex = g);
var ee = S ? {
msTransform: "rotate(".concat(S, "deg)"),
transform: "rotate(".concat(S, "deg)")
} : void 0, Xe = na(J), ne = En(Xe, 2), le = ne[0], Q = ne[1];
return b("span", Gt({
role: "img",
"aria-label": v.name
}, X, {
onClick: P,
class: B
}), [b(gt, {
class: Ze,
icon: v,
primaryColor: le,
secondaryColor: Q,
style: ee
}, null)]);
};
pe.props = {
spin: Boolean,
rotate: Number,
icon: Object,
twoToneColor: String
};
pe.displayName = "AntdIcon";
pe.inheritAttrs = !1;
pe.getTwoToneColor = Sn;
pe.setTwoToneColor = ra;
const zn = pe;
var jn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" };
const Pn = jn;
function qt(e) {
for (var a = 1; a < arguments.length; a++) {
var t = arguments[a] != null ? Object(arguments[a]) : {}, n = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(t).filter(function(o) {
return Object.getOwnPropertyDescriptor(t, o).enumerable;
}))), n.forEach(function(o) {
Nn(e, o, t[o]);
});
}
return e;
}
function Nn(e, a, t) {
return a in e ? Object.defineProperty(e, a, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[a] = t, e;
}
var yt = function(a, t) {
var n = qt({}, a, t.attrs);
return b(zn, qt({}, n, {
icon: Pn
}), null);
};
yt.displayName = "DownOutlined";
yt.inheritAttrs = !1;
const Vn = yt;
const Mn = (e, a) => {
const t = e.__vccOpts || e;
for (const [n, o] of a)
t[n] = o;
return t;
}, V = (e) => (Ua("data-v-3aecc70a"), e = e(), Wa(), e), Ln = { class: "yx-table__container" }, Un = {
key: 0,
class: "yx-table__tools"
}, Wn = { class: "yx-table__tools__left" }, Hn = { class: "yx-table__tools__right" }, Kn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", { class: "ellipsis_tip" }, "0 表示关闭“内容超出省略”配置", -1)), $n = { class: "yx-table__tools__ellipsis_config" }, Yn = { class: "__tools__ellipsis_config__text" }, Jn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "内容超出省略", -1)), Qn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("div", {
style: { "font-size": "22px", cursor: "pointer" },
class: "exfont expencil_ellipsis_rectangle"
}, null, -1)), Gn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "紧凑布局", -1)), qn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "刷新列表", -1)), Zn = { key: 0 }, Xn = /* @__PURE__ */ V(() => /* @__PURE__ */ p("div", { class: "show__column__content__title" }, "固定在左侧", -1)), er = { class: "table__show__column" }, tr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", {
style: { cursor: "move", "margin-right": "10px", "font-size": "18px" },
class: "exfont exmove1 handle"
}, null, -1)), ar = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "取消固定", -1)), nr = ["onClick"], rr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "固定在列尾", -1)), or = ["onClick"], lr = { key: 1 }, ir = /* @__PURE__ */ V(() => /* @__PURE__ */ p("div", { class: "show__column__content__title" }, "不固定", -1)), sr = { class: "table__show__column" }, ur = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", {
style: { cursor: "move", "margin-right": "10px", "font-size": "18px" },
class: "exfont exmove1 handle"
}, null, -1)), cr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "固定在列首", -1)), fr = ["onClick"], dr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "固定在列尾", -1)), pr = ["onClick"], hr = { key: 2 }, vr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("div", { class: "show__column__content__title" }, "固定在右侧", -1)), gr = { class: "table__show__column" }, yr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", {
style: { cursor: "move", "margin-right": "10px", "font-size": "18px" },
class: "exfont exmove1 handle"
}, null, -1)), mr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "取消固定", -1)), br = ["onClick"], xr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "固定在列首", -1)), _r = ["onClick"], kr = { style: { display: "flex", "justify-content": "space-between", "align-items": "center" } }, Cr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("span", null, "列配置", -1)), wr = /* @__PURE__ */ V(() => /* @__PURE__ */ p("div", null, [
/* @__PURE__ */ p("span", {
style: { cursor: "pointer", "font-size": "18px" },
class: "exfont exshujupeizhi"
})
], -1)), Ar = { class: "yx-table__header yx-table__header--fixed" }, Sr = ["onClick", "onMouseover"], Or = { key: 1 }, Er = {
key: 0,
style: { "font-size": "14px" },
class: "exfont exasc active"
}, Ir = {
key: 1,
style: { "font-size": "14px" },
class: "exfont exdesc active"
}, Tr = {
key: 2,
style: { "font-size": "14px" },
class: "exfont exsort"
}, Rr = ["onClick"], Dr = {
key: 0,
class: "handle"
}, Fr = ["title"], Br = { key: 1 }, zr = ["title"], jr = {
key: 0,
class: "table__empty"
}, Pr = {
key: 0,
style: { "text-align": "right", "margin-top": "20px" }
}, Nr = { key: 1 }, Vr = za({
__name: "index",
props: {
columns: { default: () => [] },
dataSource: { default: () => {
} },
pagination: { type: Boolean, default: !0 },
height: { default: "500px" },
ellipsis: { default: 0 },
tableSm: { type: Boolean, default: !1 },
showIndex: { type: Boolean, default: !1 },
selection: { default: void 0 },
drag: { type: Boolean, default: !1 },
action: {},
showTools: { type: Boolean, default: !0 }
},
emits: ["dragend", "reload"],
setup(e, { expose: a, emit: t }) {
function n(r, i) {
const f = {
primary: "#28A6FF",
warn: "#faad14",
danger: "#f5222d",
success: "#52c41a",
info: "#333"
};
if ((r === void 0 || r === "") && i !== void 0)
return i;
switch (r) {
case "primary":
return f.primary;
case "warn":
return f.warn;
case "danger":
return f.danger;
case "success":
return f.success;
case "info":
return f.info;
default:
return r;
}
}
const o = O(
"data:image/png;base64,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"
), c = () => {
const r = navigator.userAgent.toLowerCase(), i = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(r), f = !r.match("iphone") && navigator.maxTouchPoints > 1;
return i || f;
}, v = O(), m = O(), S = O(!1), _ = O([]), J = O(!1), P = O([]), X = O(!1), B = O(), Ze = (r) => {
B.value = r, X.value = !0;
}, g = e, ee = O([]), Xe = () => {
var i;
const r = (i = g.action) == null ? void 0 : i.buttons;
r == null || r.forEach((f) => {
f instanceof Array ? ee.value.push(...f) : ee.value.push(f);
});
}, ne = (r, i, f) => {
const y = r.filter((N) => N.hide === void 0 ? !0 : !N.hide(f));
return i ? y.length > 3 ? y.slice(2) : [] : y.length > 3 ? y.slice(0, 2) : y;
}, le = O(g.tableSm), Q = O(g.ellipsis), mt = () => {
le.value = !le.value;
}, bt = (r, i) => {
const f = {
textAlign: r.align
};
return r.fixed && (Object.assign(f, {
position: "sticky",
"z-index": 10
}), r.fixed === "left" ? Object.assign(f, {
left: r.fixedPx + "px"
}) : Object.assign(f, {
right: r.fixedPx + "px"
})), i === "body" && r.click && Object.assign(f, {
color: "#1890ff",
cursor: "pointer"
}), f;
}, oa = (r, i, f) => {
r.click && r.click(i, f);
}, re = O("left"), la = (r) => {
r.target.scrollLeft === 0 ? re.value = "left" : r.target.scrollWidth === r.target.scrollLeft + r.target.clientWidth ? re.value = "right" : re.value = "";
}, xt = t, ia = (r) => {
xt("dragend", {
item: r.item.__draggable_context.element,
oldIndex: r.oldIndex,
newIndex: r.newIndex,
rows: P.value
});
}, sa = () => {
v.value.scrollLeft = 0;
}, C = Ke({
indeterminate: !1,
checkAll: !1,
selected: {
selectedRowKeys: [],
selectedRows: []
}
}), ua = (r) => {
r.target.checked ? P.value.forEach((i) => {
C.selected.selectedRowKeys.includes(i.id) || (C.selected.selectedRowKeys.push(i.id), C.selected.selectedRows.push(i));
}) : P.value.forEach((i) => {
const f = C.selected.selectedRowKeys.indexOf(i.id);
f > -1 && (C.selected.selectedRowKeys.splice(f, 1), C.selected.selectedRows.splice(f, 1));
});
}, ca = (r, i) => {
r.target.checked ? (C.selected.selectedRowKeys.push(i.id), C.selected.selectedRows.push(i)) : (C.selected.selectedRowKeys = C.selected.selectedRowKeys.filter((f) => f !== i.id), C.selected.selectedRows = C.selected.selectedRows.filter((f) => f.id !== i.id));
}, _t = (r) => !!C.selected.selectedRowKeys.includes(r.id);
jt(
() => C.selected.selectedRowKeys,
() => {
fa();
},
{ deep: !0 }
);
const fa = () => {
const r = P.value.filter(
(i) => C.selected.selectedRowKeys.includes(i.id)
);
C.indeterminate = !!r.length && r.length < P.value.length, C.checkAll = r.length === P.value.length;
}, da = (r, i) => {
r.target.checked ? (C.selected.selectedRowKeys = [i.id], C.selected.selectedRows = [i]) : (C.selected.selectedRowKeys = [], C.selected.selectedRows = []);
}, pa = () => ({
selectedRowKeys: C.selected.selectedRowKeys,
selectedRows: C.selected.selectedRows
}), ha = () => {
C.selected.selectedRowKeys = [], C.selected.selectedRows = [];
}, kt = O(), va = (r) => {
r.sorter && (kt.value = r);
}, ga = Ke({
sorter: {
sortName: "",
sortOrder: ""
}
}), { sorter: M } = ja(ga), ya = Pa(() => {
var r;
return ((r = kt.value) == null ? void 0 : r.dataIndex) === M.value.sortName ? M.value.sortOrder === "ASC" ? "取消排序" : M.value.sortOrder === "DESC" ? "点击升序" : "点击降序" : "点击降序";
}), ma = (r) => {
r.sorter && (M.value.sortName !== r.dataIndex ? M.value = {
sortName: r.dataIndex,
sortOrder: "DESC"
} : M.value.sortOrder === "DESC" ? M.value.sortOrder = "ASC" : M.value.sortOrder === "ASC" ? M.value.sortOrder = "" : M.value.sortOrder = "DESC", ve());
}, U = Ke({
pageCurrent: 1,
pageSize: 10,
pageSizeOptions: ["10", "20", "30", "50", "100"],
totalSize: 0
}), ba = (r, i) => `第 ${i[0]} - ${i[1]} 条/总共 ${r || 0} 条`, he = O(null), xa = (r, i) => {
U.pageCurrent = 1, U.pageSize = i, delete he.value.pageNumber, ve();
}, _a = (r) => {
U.pageCurrent = r, delete he.value.pageNumber, ve();
}, ve = (r) => {
S.value = !0, r === void 0 ? he.value !== null ? r = ot(he.value) : r = {} : he.value = ot(r), (M.value.sortOrder === "ASC" || M.value.sortOrder === "DESC") && Object.assign(r, {
sortName: M.value.sortName,
sortOrder: M.value.sortOrder
}), g.pagination && (r.pageNumber == null && (r.pageNumber = U.pageCurrent), r.pageSize == null && (r.pageSize = U.pageSize)), xt("reload", r);
};
jt(
() => g.dataSource,
() => {
Ct(), S.value = !1;
},
{ deep: !0 }
);
const Ct = () => {
var r, i, f, y;
g.pagination ? (P.value = ((r = g.dataSource) == null ? void 0 : r.rows) || [], U.pageCurrent = ((i = g.dataSource) == null ? void 0 : i.pageNumber) || 1, U.pageSize = ((f = g.dataSource) == null ? void 0 : f.pageSize) || 10, U.totalSize = ((y = g.dataSource) == null ? void 0 : y.total) || 0) : P.value = g.dataSource || [], P.value && P.value.length > 0 ? J.value = !1 : J.value = !0;
}, oe = Ke({
indeterminate: !0,
checkAll: !1
}), wt = () => {
const r = _.value.filter((i) => i.hidden);
oe.indeterminate = !!r.length && r.length < _.value.length, oe.checkAll = r.length !== _.value.length;
}, ka = (r) => {
oe.checkAll = r.target.checked, oe.indeterminate = !1, w.value.forEach((i) => {
i.hidden = !r.target.checked;
}), A.value.forEach((i) => {
i.hidden = !r.target.checked;
}), T.value.forEach((i) => {
i.hidden = !r.target.checked;
}), ie(), se(), _.value = w.value.concat(T.value).concat(A.value);
}, Ca = () => {
At();
}, et = (r, i, f) => {
f === "d" ? T.value[i].hidden = !r.target.checked : f === "l" ? (w.value[i].hidden = !r.target.checked, ie()) : f === "r" && (A.value[i].hidden = !r.target.checked, se()), _.value = w.value.concat(T.value).concat(A.value), ye(), wt();
}, ie = () => {
if (w.value.length < 1)
return;
let r = 0;
w.value.forEach((y) => {
y.hidden || (y.fixed = "left", y.fixedLast = !1, y.fixedPx = r, r += y.width || 0);
});
let i = w.value.length - 1, f = !0;
for (; f; )
w.value[i].hidden || (w.value[i].fixedLast = !0, f = !1), i--, i < 0 && (f = !1);
}, wa = () => {
ie();
const r = w.value.concat(T.value).concat(A.value);
_.value = r;
}, Aa = () => {
const r = w.value.concat(T.value).concat(A.value);
_.value = r;
}, se = () => {
if (A.value.length < 1)
return;
let r = 0;
const i = A.value.length;
for (let N = i - 1; N >= 0; N--)
A.value[N].hidden || (A.value[N].fixed = "right", A.value[N].fixedPx = r, A.value[N].fixedLast = !1, r += A.value[N].width || 0);
let f = 0, y = !0;
for (; y; )
A.value[f].hidden || (A.value[f].fixedLast = !0, y = !1), f++, f > A.value.length - 1 && (y = !1);
}, Sa = () => {
se();
const r = w.value.concat(T.value).concat(A.value);
_.value = r;
}, ue = (r, i, f) => {
var je, me, Pe, Ne, Ve, Me;
let y = O();
i === "l" ? (y.value = w.value[r], (je = y.value) == null || delete je.fixedLast, (me = y.value) == null || delete me.fixedPx, (Pe = y.value) == null || delete Pe.fixed, w.value.splice(r, 1), ie()) : i === "d" ? (y.value = T.value[r], T.value.splice(r, 1)) : i === "r" && (y.value = A.value[r], (Ne = y.value) == null || delete Ne.fixedLast, (Ve = y.value) == null || delete Ve.fixedPx, (Me = y.value) == null || delete Me.fixed, A.value.splice(r, 1), se()), f === "d" ? y.value !== void 0 && T.value.push(y.value) : f === "r" ? y.value !== void 0 && (A.value.unshift(y.value), se()) : f === "l" && y.value !== void 0 && (w.value.push(y.value), ie());
const N = w.value.concat(T.value).concat(A.value);
_.value = N;
}, tt = O({
title: "序号",
dataIndex: "yxIndex",
width: 60,
align: "center"
}), at = O({
title: "#",
dataIndex: "yxCheckbox",
width: 60,
align: "center"
}), nt = O({
title: "选择",
dataIndex: "yxRadio",
width: 60,
align: "center"
}), rt = O({
title: "排序",
dataIndex: "yxDrag",
width: 60,
align: "center"
}), ce = O({
title: "操作",
dataIndex: "yxAction",
width: 120,
align: "left"
}), w = O([]), T = O([]), A = O([]), At = () => {
w.value = [], T.value = [], A.value = [];
const r = g.columns;
g.action && (ce.value.width = g.action.width || 150, (g.action.fixed === "left" || g.action.fixed === "right") && (ce.value.fixed = g.action.fixed)), r.forEach((i) => {
i.width || (i.width = 150), i.align || (i.align = "left"), c() ? T.value.push({ ...i }) : i.fixed && i.fixed === "left" ? w.value.push({ ...i }) : i.fixed && i.fixed === "right" ? A.value.push({ ...i }) : T.value.push({ ...i });
}), c() ? g.action && T.value.push({ ...ce.value }) : (g.action && g.action.fixed !== "left" && g.action.fixed !== "right" && T.value.push({ ...ce.value }), g.action && g.action.fixed === "left" && w.value.push({ ...ce.value }), g.action && g.action.fixed === "right" && A.value.push({ ...ce.value })), w.value.length > 0 ? (g.showIndex && (tt.value.fixed = "left", w.value.unshift({ ...tt.value })), g.selection === "radio" && (nt.value.fixed = "left", w.value.unshift({ ...nt.value })), g.selection === "checkbox" && (at.value.fixed = "left", w.value.unshift({ ...at.value })), g.drag && (rt.value.fixed = "left", w.value.unshift({ ...rt.value }))) : (g.showIndex && T.value.unshift({ ...tt.value }), g.selection === "checkbox" && T.value.unshift({ ...at.value }), g.selection === "radio" && T.value.unshift({ ...nt.value }), g.drag && T.value.unshift({ ...rt.value })), ie(), se(), _.value = w.value.concat(T.value).concat(A.value);
}, ge = O(!1), ye = () => {
if (v.value) {
const r = v.value.scrollWidth, i = v.value.clientWidth, f = v.value.offsetHeight;
ge.value = r > i || f > i;
}
};
return Na(() => {
At(), Ct(), Xe(), window.removeEventListener("resize", ye), window.addEventListener("resize", ye), Xt(() => {
ye(), wt();
});
}), Va(() => {
window.removeEventListener("resize", ye);
}), a({
getSelection: pa,
clearSelection: ha,
reload: ve,
showDetail: Ze,
getColumnConfig: () => {
let r = ot(_.value);
return r = r.filter(
(i) => ["yxAction", "yxDrag", "yxRadio", "yxCheckbox", "yxIndex"].indexOf(
i.dataIndex
) == -1
), r;
}
}), (r, i) => {
const f = E("ATooltip"), y = E("APopover"), N = E("ACheckbox"), je = E("AButton"), me = E("ASpace"), Pe = E("ARadio"), Ne = E("a-typography-link"), Ve = E("a-menu-item"), Me = E("a-menu"), Oa = E("a-dropdown"), St = E("ASelect"), Ea = E("AInput"), Le = E("YxImage"), Ot = E("a-image"), Ue = E("YxVideoViewer"), We = E("a-space"), Et = E("YxPdfViewer"), It = E("YxOfficeViewer"), Tt = E("ATag"), Ia = E("AEmpty"), Ta = E("APagination"), Ra = E("ASpin"), Da = E("ADescriptionsItem"), Fa = E("ADescriptions"), Ba = E("ADrawer");
return s(), h("div", Ln, [
r.showTools ? (s(), h("div", Un, [
p("div", Wn, [
Ma(r.$slots, "tools", {}, void 0, !0)
]),
p("div", Hn, [
b(me, null, {
default: d(() => [
b(y, {
placement: "bottomRight",
title: "设置显示行数",
trigger: "click",
"overlay-class-name": "show__column__overlay"
}, {
content: d(() => [
p("div", null, [
Kn,
p("div", $n, [
p("span", {
onClick: i[0] || (i[0] = (l) => Q.value > 0 && Q.value--),
style: { "font-size": "22px", cursor: "pointer" },
class: "exfont exjian"
}),
p("span", Yn, I(Q.value), 1),
p("span", {
onClick: i[1] || (i[1] = (l) => Q.value < 5 && Q.value++),
style: { "font-size": "22px", cursor: "pointer" },
class: "exfont exjia"
})
])
])
]),
default: d(() => [
b(f, { placement: "topRight" }, {
title: d(() => [
Jn
]),
default: d(() => [
Qn
]),
_: 1
})
]),
_: 1
}),
b(f, { placement: "topRight" }, {
title: d(() => [
Gn
]),
default: d(() => [
p("div", null, [
le.value ? (s(), h("span", {
key: 0,
onClick: mt,
style: { "font-size": "18px", cursor: "pointer" },
class: "exfont excolumn-height active"
})) : (s(), h("span", {
key: 1,
onClick: mt,
style: { "font-size": "18px", cursor: "pointer" },
class: "exfont excolumn-height"
}))
])
]),
_: 1
}),
b(f, { placement: "topRight" }, {
title: d(() => [
qn
]),
default: d(() => [
p("div", null, [
p("span", {
onClick: i[2] || (i[2] = (l) => ve()),
style: { "font-size": "18px", cursor: "pointer" },
class: "exfont exshuaxin1"
})
])
]),
_: 1
}),
b(y, {
trigger: "click",
placement: "bottomRight",
"overlay-class-name": "show__column__overlay"
}, {
content: d(() => [
p("div", null, [
w.value.length > 0 ? (s(), h("div", Zn, [
Xn,
b(q(Ye), {
"item-key": "id",
modelValue: w.value,
"onUpdate:modelValue": i[3] || (i[3] = (l) => w.value = l),
group: "fixColumnLeft",
"ghost-class": "ghost",
"chosen-class": "chosen",
"drag-class": "drag__class",
"force-fallback": !0,
onEnd: wa,
handle: ".handle"
}, {
item: d(({ element: l, index: R }) => [
p("div", er, [
tr,
b(N, {
checked: l.hidden !== !0,
onChange: (u) => et(u, R, "l")
}, {
default: d(() => [
F(I(l.title), 1)
]),
_: 2
}, 1032, ["checked", "onChange"]),
b(f, { placement: "topRight" }, {
title: d(() => [
ar
]),
default: d(() => [
p("div", null, [
p("span", {
onClick: (u) => ue(R, "l", "d"),
style: { cursor: "pointer", "margin-left": "10px", "font-size": "18px" },
class: "exfont exput-center"
}, null, 8, nr)
])
]),
_: 2
}, 1024),
b(f, { placement: "topRight" }, {
title: d(() => [
rr
]),
default: d(() => [
p("div", null, [
p("span", {
onClick: (u) => ue(R, "l", "r"),
style: { cursor: "pointer", "margin-left": "10px", "font-size": "18px" },
class: "exfont exput-bottom"
}, null, 8, or)
])
]),
_: 2
}, 1024)
])
]),
_: 1
}, 8, ["modelValue"])
])) : j("", !0),
T.value.length > 0 ? (s(), h("div", lr, [
ir,
b(q(Ye), {
"item-key": "id",
modelValue: T.value,
"onUpdate:modelValue": i[4] || (i[4] = (l) => T.value = l),
group: "defaultColumn",
"ghost-class": "ghost",
"chosen-class": "chosen",
"drag-class": "drag__class",
"force-fallback": !0,
onEnd: Aa,
handle: ".handle"
}, {
item: d(({ element: l, index: R }) => [
p("div", sr, [
ur,
b(N, {
checked: l.hidden !== !0,
onChange: (u) => et(u, R, "d")
}, {
default: d(() => [
F(I(l.title), 1)
]),
_: 2
}, 1032, ["checked", "onChange"]),
b(f, { placement: "topRight" }, {
title: d(() => [
cr
]),
default: d(() => [