@qy_better_lib/pc 0.2.20 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/contextMenu/src/index.vue.js +104 -0
- package/lib/contextMenu/src/index.vue2.js +4 -0
- package/lib/describeView/src/index.vue.js +81 -0
- package/lib/describeView/src/index.vue2.js +4 -0
- package/lib/simpleVirtualList/src/index.vue.js +84 -0
- package/lib/simpleVirtualList/src/index.vue2.js +4 -0
- package/lib/tableExtend/src/colVisible.vue.js +103 -0
- package/lib/tableExtend/src/colVisible.vue2.js +4 -0
- package/lib/tableExtend/src/index.vue.js +220 -0
- package/lib/tableExtend/src/index.vue2.js +4 -0
- package/lib/tableExtend/src/valueCol.vue.js +26 -0
- package/lib/tableExtend/src/valueCol.vue2.js +4 -0
- package/lib/textButton/src/index.vue.js +56 -0
- package/lib/textButton/src/index.vue2.js +4 -0
- package/lib/{src/utils → utils}/index.js +22 -24
- package/package.json +1 -1
- package/lib/node_modules/@ctrl/tinycolor/dist/module/conversion.js +0 -115
- package/lib/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +0 -153
- package/lib/node_modules/@ctrl/tinycolor/dist/module/format-input.js +0 -68
- package/lib/node_modules/@ctrl/tinycolor/dist/module/index.js +0 -183
- package/lib/node_modules/@ctrl/tinycolor/dist/module/util.js +0 -32
- package/lib/node_modules/@element-plus/icons-vue/dist/index.js +0 -167
- package/lib/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -22
- package/lib/node_modules/@vueuse/core/index.js +0 -112
- package/lib/node_modules/@vueuse/shared/index.js +0 -68
- package/lib/node_modules/element-plus/es/_virtual/plugin-vue_export-helper.js +0 -9
- package/lib/node_modules/element-plus/es/components/badge/index.js +0 -7
- package/lib/node_modules/element-plus/es/components/button/index.js +0 -11
- package/lib/node_modules/element-plus/es/components/icon/index.js +0 -7
- package/lib/node_modules/element-plus/es/components/input/index.js +0 -7
- package/lib/node_modules/element-plus/es/components/message/index.js +0 -7
- package/lib/node_modules/element-plus/es/components/message-box/index.js +0 -10
- package/lib/node_modules/element-plus/es/components/notification/index.js +0 -7
- package/lib/node_modules/element-plus/es/components/overlay/index.js +0 -9
- package/lib/node_modules/element-plus/es/constants/aria.js +0 -9
- package/lib/node_modules/element-plus/es/constants/event.js +0 -6
- package/lib/node_modules/element-plus/es/constants/size.js +0 -4
- package/lib/node_modules/element-plus/es/directives/trap-focus/index.js +0 -32
- package/lib/node_modules/element-plus/es/hooks/use-aria/index.js +0 -14
- package/lib/node_modules/element-plus/es/hooks/use-attrs/index.js +0 -12
- package/lib/node_modules/element-plus/es/hooks/use-composition/index.js +0 -29
- package/lib/node_modules/element-plus/es/hooks/use-cursor/index.js +0 -39
- package/lib/node_modules/element-plus/es/hooks/use-deprecated/index.js +0 -10
- package/lib/node_modules/element-plus/es/hooks/use-draggable/index.js +0 -45
- package/lib/node_modules/element-plus/es/hooks/use-empty-values/index.js +0 -20
- package/lib/node_modules/element-plus/es/hooks/use-escape-keydown/index.js +0 -16
- package/lib/node_modules/element-plus/es/hooks/use-focus-controller/index.js +0 -34
- package/lib/node_modules/element-plus/es/hooks/use-id/index.js +0 -15
- package/lib/node_modules/element-plus/es/hooks/use-locale/index.js +0 -24
- package/lib/node_modules/element-plus/es/hooks/use-lockscreen/index.js +0 -30
- package/lib/node_modules/element-plus/es/hooks/use-namespace/index.js +0 -44
- package/lib/node_modules/element-plus/es/hooks/use-prop/index.js +0 -11
- package/lib/node_modules/element-plus/es/hooks/use-same-target/index.js +0 -16
- package/lib/node_modules/element-plus/es/hooks/use-size/index.js +0 -16
- package/lib/node_modules/element-plus/es/hooks/use-z-index/index.js +0 -22
- package/lib/node_modules/element-plus/es/locale/lang/en.js +0 -182
- package/lib/node_modules/element-plus/es/utils/browser.js +0 -6
- package/lib/node_modules/element-plus/es/utils/dom/aria.js +0 -29
- package/lib/node_modules/element-plus/es/utils/dom/scroll.js +0 -20
- package/lib/node_modules/element-plus/es/utils/dom/style.js +0 -45
- package/lib/node_modules/element-plus/es/utils/error.js +0 -14
- package/lib/node_modules/element-plus/es/utils/i18n.js +0 -4
- package/lib/node_modules/element-plus/es/utils/objects.js +0 -4
- package/lib/node_modules/element-plus/es/utils/types.js +0 -13
- package/lib/node_modules/element-plus/es/utils/typescript.js +0 -4
- package/lib/node_modules/element-plus/es/utils/vue/icon.js +0 -29
- package/lib/node_modules/element-plus/es/utils/vue/install.js +0 -17
- package/lib/node_modules/element-plus/es/utils/vue/props/runtime.js +0 -31
- package/lib/node_modules/element-plus/es/utils/vue/validator.js +0 -5
- package/lib/node_modules/element-plus/es/utils/vue/vnode.js +0 -5
- package/lib/node_modules/lodash-es/_Hash.js +0 -20
- package/lib/node_modules/lodash-es/_ListCache.js +0 -20
- package/lib/node_modules/lodash-es/_Map.js +0 -6
- package/lib/node_modules/lodash-es/_MapCache.js +0 -20
- package/lib/node_modules/lodash-es/_Symbol.js +0 -5
- package/lib/node_modules/lodash-es/_apply.js +0 -16
- package/lib/node_modules/lodash-es/_arrayMap.js +0 -8
- package/lib/node_modules/lodash-es/_arrayPush.js +0 -8
- package/lib/node_modules/lodash-es/_assignValue.js +0 -10
- package/lib/node_modules/lodash-es/_assocIndexOf.js +0 -10
- package/lib/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/lib/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/lib/node_modules/lodash-es/_baseGet.js +0 -11
- package/lib/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/lib/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/lib/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/lib/node_modules/lodash-es/_baseIsNative.js +0 -16
- package/lib/node_modules/lodash-es/_basePick.js +0 -10
- package/lib/node_modules/lodash-es/_basePickBy.js +0 -13
- package/lib/node_modules/lodash-es/_baseSet.js +0 -24
- package/lib/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/lib/node_modules/lodash-es/_baseToString.js +0 -18
- package/lib/node_modules/lodash-es/_castPath.js +0 -10
- package/lib/node_modules/lodash-es/_coreJsData.js +0 -5
- package/lib/node_modules/lodash-es/_defineProperty.js +0 -11
- package/lib/node_modules/lodash-es/_flatRest.js +0 -9
- package/lib/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/lib/node_modules/lodash-es/_getMapData.js +0 -8
- package/lib/node_modules/lodash-es/_getNative.js +0 -9
- package/lib/node_modules/lodash-es/_getRawTag.js +0 -15
- package/lib/node_modules/lodash-es/_getValue.js +0 -6
- package/lib/node_modules/lodash-es/_hasPath.js +0 -19
- package/lib/node_modules/lodash-es/_hashClear.js +0 -7
- package/lib/node_modules/lodash-es/_hashDelete.js +0 -7
- package/lib/node_modules/lodash-es/_hashGet.js +0 -13
- package/lib/node_modules/lodash-es/_hashHas.js +0 -9
- package/lib/node_modules/lodash-es/_hashSet.js +0 -9
- package/lib/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/lib/node_modules/lodash-es/_isIndex.js +0 -8
- package/lib/node_modules/lodash-es/_isKey.js +0 -12
- package/lib/node_modules/lodash-es/_isKeyable.js +0 -7
- package/lib/node_modules/lodash-es/_isMasked.js +0 -11
- package/lib/node_modules/lodash-es/_listCacheClear.js +0 -6
- package/lib/node_modules/lodash-es/_listCacheDelete.js +0 -12
- package/lib/node_modules/lodash-es/_listCacheGet.js +0 -8
- package/lib/node_modules/lodash-es/_listCacheHas.js +0 -7
- package/lib/node_modules/lodash-es/_listCacheSet.js +0 -8
- package/lib/node_modules/lodash-es/_mapCacheClear.js +0 -13
- package/lib/node_modules/lodash-es/_mapCacheDelete.js +0 -8
- package/lib/node_modules/lodash-es/_mapCacheGet.js +0 -7
- package/lib/node_modules/lodash-es/_mapCacheHas.js +0 -7
- package/lib/node_modules/lodash-es/_mapCacheSet.js +0 -8
- package/lib/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/lib/node_modules/lodash-es/_nativeCreate.js +0 -5
- package/lib/node_modules/lodash-es/_objectToString.js +0 -7
- package/lib/node_modules/lodash-es/_overRest.js +0 -15
- package/lib/node_modules/lodash-es/_root.js +0 -5
- package/lib/node_modules/lodash-es/_setToString.js +0 -6
- package/lib/node_modules/lodash-es/_shortOut.js +0 -16
- package/lib/node_modules/lodash-es/_stringToPath.js +0 -10
- package/lib/node_modules/lodash-es/_toKey.js +0 -10
- package/lib/node_modules/lodash-es/_toSource.js +0 -17
- package/lib/node_modules/lodash-es/constant.js +0 -8
- package/lib/node_modules/lodash-es/eq.js +0 -6
- package/lib/node_modules/lodash-es/flatten.js +0 -8
- package/lib/node_modules/lodash-es/fromPairs.js +0 -10
- package/lib/node_modules/lodash-es/get.js +0 -8
- package/lib/node_modules/lodash-es/hasIn.js +0 -8
- package/lib/node_modules/lodash-es/identity.js +0 -6
- package/lib/node_modules/lodash-es/isArguments.js +0 -10
- package/lib/node_modules/lodash-es/isArray.js +0 -4
- package/lib/node_modules/lodash-es/isFunction.js +0 -12
- package/lib/node_modules/lodash-es/isLength.js +0 -7
- package/lib/node_modules/lodash-es/isNil.js +0 -6
- package/lib/node_modules/lodash-es/isObject.js +0 -7
- package/lib/node_modules/lodash-es/isObjectLike.js +0 -6
- package/lib/node_modules/lodash-es/isSymbol.js +0 -9
- package/lib/node_modules/lodash-es/memoize.js +0 -18
- package/lib/node_modules/lodash-es/pick.js +0 -8
- package/lib/node_modules/lodash-es/toString.js +0 -7
- /package/lib/{src/contextMenu → contextMenu}/index.js +0 -0
- /package/lib/{src/describeView → describeView}/index.js +0 -0
- /package/lib/{src/index.js → index.js} +0 -0
- /package/lib/{src/simpleVirtualList → simpleVirtualList}/index.js +0 -0
- /package/lib/{src/tableExtend → tableExtend}/index.js +0 -0
- /package/lib/{src/tableExtend → tableExtend}/props.js +0 -0
- /package/lib/{src/tableExtend → tableExtend}/type.js +0 -0
- /package/lib/{src/tableExtend → tableExtend}/useTable.js +0 -0
- /package/lib/{src/textButton → textButton}/index.js +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineComponent as M, ref as _, reactive as X, watch as $, nextTick as p, onMounted as D, onBeforeUnmount as L, resolveComponent as N, createBlock as h, openBlock as i, Teleport as P, withDirectives as S, createCommentVNode as T, createElementBlock as a, normalizeStyle as V, createElementVNode as b, Fragment as C, renderList as Y, normalizeClass as z, renderSlot as H, createTextVNode as O, toDisplayString as R, unref as W } from "vue";
|
|
2
|
+
import { ClickOutside as j } from "@qy_better_lib/core";
|
|
3
|
+
const q = { class: "contextmenu-wrap" }, A = { class: "contextmenu-items" }, F = ["onClick"], I = /* @__PURE__ */ M({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
visible: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: () => !1
|
|
9
|
+
},
|
|
10
|
+
position: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => {
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
options: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: [],
|
|
18
|
+
required: !0
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: ["menuClick", "update:visible"],
|
|
22
|
+
setup(m, { expose: g, emit: B }) {
|
|
23
|
+
const v = m, y = B;
|
|
24
|
+
g({
|
|
25
|
+
hide: d,
|
|
26
|
+
show: u
|
|
27
|
+
});
|
|
28
|
+
const l = _(!1), s = _(null), r = X({
|
|
29
|
+
left: 0,
|
|
30
|
+
top: 0
|
|
31
|
+
});
|
|
32
|
+
$(() => v.visible, (e) => {
|
|
33
|
+
e && (l.value = !0, p(() => {
|
|
34
|
+
k(v.position);
|
|
35
|
+
}));
|
|
36
|
+
}, {
|
|
37
|
+
immediate: !0
|
|
38
|
+
}), D(() => {
|
|
39
|
+
s.value?.addEventListener("contextmenu", u);
|
|
40
|
+
}), L(() => {
|
|
41
|
+
x();
|
|
42
|
+
});
|
|
43
|
+
function x() {
|
|
44
|
+
s.value?.removeEventListener("contextmenu", u);
|
|
45
|
+
}
|
|
46
|
+
function E(e) {
|
|
47
|
+
e.disabled || (y("menuClick", e), d());
|
|
48
|
+
}
|
|
49
|
+
async function u(e) {
|
|
50
|
+
e.preventDefault(), l.value = !0, await p();
|
|
51
|
+
const { pageX: o, pageY: t } = e;
|
|
52
|
+
k({ x: o, y: t });
|
|
53
|
+
}
|
|
54
|
+
function k(e) {
|
|
55
|
+
const { clientWidth: o, clientHeight: t } = s.value;
|
|
56
|
+
!o || !t || (r.top = `${w("Y", e.y || 0, t)}px`, r.left = `${w("X", e.x || 0, o)}px`);
|
|
57
|
+
}
|
|
58
|
+
function d() {
|
|
59
|
+
x(), l.value = !1, p(() => {
|
|
60
|
+
y("update:visible", !1);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function w(e, o, t) {
|
|
64
|
+
const n = e === "X" ? window.innerWidth : window.innerHeight, f = e === "X" ? window.scrollX : window.scrollY;
|
|
65
|
+
let c = o - f;
|
|
66
|
+
return c + t > n && (c = Math.max(0, c - t)), c + f;
|
|
67
|
+
}
|
|
68
|
+
return (e, o) => {
|
|
69
|
+
const t = N("el-divider");
|
|
70
|
+
return i(), h(P, { to: "body" }, [
|
|
71
|
+
l.value ? S((i(), a("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "contextmenu",
|
|
74
|
+
style: V({ top: r.top, left: r.left }),
|
|
75
|
+
ref_key: "contextMenuRef",
|
|
76
|
+
ref: s
|
|
77
|
+
}, [
|
|
78
|
+
b("div", q, [
|
|
79
|
+
b("ul", A, [
|
|
80
|
+
(i(!0), a(C, null, Y(m.options, (n) => (i(), a(C, {
|
|
81
|
+
key: n.key
|
|
82
|
+
}, [
|
|
83
|
+
n?.type == "divider" ? (i(), h(t, { key: 0 })) : (i(), a("li", {
|
|
84
|
+
key: 1,
|
|
85
|
+
class: z(["contextmenu-item", { disabled: n.disabled }]),
|
|
86
|
+
onClick: (f) => E(n)
|
|
87
|
+
}, [
|
|
88
|
+
H(e.$slots, "item", { data: n }, () => [
|
|
89
|
+
O(R(n.label), 1)
|
|
90
|
+
])
|
|
91
|
+
], 10, F))
|
|
92
|
+
], 64))), 128))
|
|
93
|
+
])
|
|
94
|
+
])
|
|
95
|
+
], 4)), [
|
|
96
|
+
[W(j), d]
|
|
97
|
+
]) : T("", !0)
|
|
98
|
+
]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
I as default
|
|
104
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineComponent as y, computed as h, createElementBlock as s, openBlock as i, renderSlot as r, createElementVNode as d, normalizeStyle as c, Fragment as v, renderList as $, createTextVNode as u, toDisplayString as p } from "vue";
|
|
2
|
+
import { isNumber as g } from "@qy_better_lib/core";
|
|
3
|
+
const w = { class: "describe-view-container" }, _ = { class: "value" }, N = /* @__PURE__ */ y({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
/**配置 */
|
|
7
|
+
config: {
|
|
8
|
+
type: Object
|
|
9
|
+
},
|
|
10
|
+
/**数据 */
|
|
11
|
+
data: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: {}
|
|
14
|
+
},
|
|
15
|
+
// 展示列数
|
|
16
|
+
column: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 3
|
|
19
|
+
},
|
|
20
|
+
/**label宽度:数字或字符串;如果定义多列宽度,使用字符串格式'20,30,50' */
|
|
21
|
+
labelWidth: {
|
|
22
|
+
type: [Number, String],
|
|
23
|
+
default: 85
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(n) {
|
|
27
|
+
const a = n, f = h(() => ({
|
|
28
|
+
"grid-template-columns": `repeat(${a.column}, minmax(1px, 1fr))`
|
|
29
|
+
}));
|
|
30
|
+
function m(t) {
|
|
31
|
+
const l = {};
|
|
32
|
+
return t.col_span && (l.gridColumnStart = `span ${t.col_span}`), t.row_span && (l.gridRowStart = `span ${t.row_span}`), l;
|
|
33
|
+
}
|
|
34
|
+
function b(t) {
|
|
35
|
+
let l = (t + 1) % a.column;
|
|
36
|
+
l = l === 0 ? a.column : l;
|
|
37
|
+
let e = 0;
|
|
38
|
+
if (g(a.labelWidth))
|
|
39
|
+
e = a.labelWidth;
|
|
40
|
+
else {
|
|
41
|
+
if (a.labelWidth === "auto") return {};
|
|
42
|
+
const o = a.labelWidth.split(",");
|
|
43
|
+
o.length === 1 ? e = a.labelWidth : e = o[l - 1];
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
width: `${e}px`
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return (t, l) => (i(), s("div", w, [
|
|
50
|
+
r(t.$slots, "header"),
|
|
51
|
+
d("div", {
|
|
52
|
+
class: "view-content",
|
|
53
|
+
style: c(f.value)
|
|
54
|
+
}, [
|
|
55
|
+
(i(!0), s(v, null, $(n.config, (e, o) => (i(), s("div", {
|
|
56
|
+
class: "view-item",
|
|
57
|
+
key: e.prop,
|
|
58
|
+
style: c(m(e))
|
|
59
|
+
}, [
|
|
60
|
+
d("div", {
|
|
61
|
+
class: "label",
|
|
62
|
+
style: c(b(o))
|
|
63
|
+
}, [
|
|
64
|
+
r(t.$slots, `label_${e.prop}`, {}, () => [
|
|
65
|
+
u(p(`${e.label}:`), 1)
|
|
66
|
+
])
|
|
67
|
+
], 4),
|
|
68
|
+
d("div", _, [
|
|
69
|
+
r(t.$slots, `value_${e.prop}`, { data: n.data }, () => [
|
|
70
|
+
u(p(n.data[e.prop] != null ? n.data[e.prop] : "--"), 1)
|
|
71
|
+
])
|
|
72
|
+
])
|
|
73
|
+
], 4))), 128))
|
|
74
|
+
], 4),
|
|
75
|
+
r(t.$slots, "footer")
|
|
76
|
+
]));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
N as default
|
|
81
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { defineComponent as $, ref as s, computed as c, watch as S, onMounted as w, createElementBlock as u, openBlock as d, unref as v, normalizeStyle as a, createElementVNode as p, Fragment as B, renderList as E, renderSlot as N, createTextVNode as T, toDisplayString as V } from "vue";
|
|
2
|
+
import { throttle as z } from "@qy_better_lib/core";
|
|
3
|
+
const F = /* @__PURE__ */ $({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
item_height: {},
|
|
8
|
+
container_height: {},
|
|
9
|
+
buffer: { default: 5 },
|
|
10
|
+
data_key: { default: "id" }
|
|
11
|
+
},
|
|
12
|
+
setup(g) {
|
|
13
|
+
const e = g, o = s(), l = s({
|
|
14
|
+
/**起始索引 */
|
|
15
|
+
start_index: 0,
|
|
16
|
+
/**结束索引 */
|
|
17
|
+
end_index: 0,
|
|
18
|
+
/**可见数量 */
|
|
19
|
+
visible_count: 0,
|
|
20
|
+
/**滚动位置 */
|
|
21
|
+
scroll_top: 0
|
|
22
|
+
}), r = s(0), x = c(() => e.data.length * e.item_height), y = c(() => l.value.start_index * e.item_height), b = c(() => {
|
|
23
|
+
const { start_index: t, end_index: i } = l.value;
|
|
24
|
+
return e.data.slice(t, i + 1);
|
|
25
|
+
});
|
|
26
|
+
S(() => e.data?.length || 0, () => {
|
|
27
|
+
h();
|
|
28
|
+
}), w(() => {
|
|
29
|
+
const t = o.value;
|
|
30
|
+
r.value = e.container_height || t.clientHeight, h();
|
|
31
|
+
});
|
|
32
|
+
const _ = z((t) => k(t), 80);
|
|
33
|
+
function h() {
|
|
34
|
+
if (!o.value) return;
|
|
35
|
+
const t = Math.ceil(r.value / e.item_height), i = Math.min(t + e.buffer * 2, e.data.length - 1);
|
|
36
|
+
l.value = {
|
|
37
|
+
start_index: 0,
|
|
38
|
+
end_index: i,
|
|
39
|
+
visible_count: t,
|
|
40
|
+
scroll_top: 0
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function k(t) {
|
|
44
|
+
const n = t.target.scrollTop, { visible_count: f } = l.value, m = Math.floor(n / e.item_height), M = Math.min(m + f + e.buffer * 2, e.data.length - 1);
|
|
45
|
+
l.value = {
|
|
46
|
+
start_index: Math.max(0, m - e.buffer),
|
|
47
|
+
// 起始索引减去缓冲区,确保上方有预备项
|
|
48
|
+
end_index: M,
|
|
49
|
+
visible_count: f,
|
|
50
|
+
scroll_top: n
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return (t, i) => (d(), u("div", {
|
|
54
|
+
ref_key: "container_ref",
|
|
55
|
+
ref: o,
|
|
56
|
+
class: "simple-virtual-list",
|
|
57
|
+
style: a({ height: `${r.value}px` }),
|
|
58
|
+
onScroll: i[0] || (i[0] = //@ts-ignore
|
|
59
|
+
(...n) => v(_) && v(_)(...n))
|
|
60
|
+
}, [
|
|
61
|
+
p("div", {
|
|
62
|
+
class: "simple-virtual-list-wrap",
|
|
63
|
+
style: a({ height: `${x.value}px` })
|
|
64
|
+
}, null, 4),
|
|
65
|
+
p("div", {
|
|
66
|
+
class: "simple-virtual-list-content",
|
|
67
|
+
style: a({ transform: `translateY(${y.value}px)` })
|
|
68
|
+
}, [
|
|
69
|
+
(d(!0), u(B, null, E(b.value, (n) => (d(), u("div", {
|
|
70
|
+
class: "simple-virtual-list-item",
|
|
71
|
+
key: n[t.data_key],
|
|
72
|
+
style: a({ height: `${t.item_height}px` })
|
|
73
|
+
}, [
|
|
74
|
+
N(t.$slots, "item", { item: n }, () => [
|
|
75
|
+
T(V(n), 1)
|
|
76
|
+
])
|
|
77
|
+
], 4))), 128))
|
|
78
|
+
], 4)
|
|
79
|
+
], 36));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
F as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent as A, inject as E, ref as v, computed as h, resolveComponent as i, createBlock as F, openBlock as r, withCtx as c, createElementVNode as g, createVNode as l, createTextVNode as k, createElementBlock as x, Fragment as $, renderList as j, toDisplayString as y, normalizeClass as b } from "vue";
|
|
2
|
+
const z = { class: "set-column-list-wrap" }, D = { class: "fixed-wrap" }, P = /* @__PURE__ */ A({
|
|
3
|
+
__name: "colVisible",
|
|
4
|
+
setup(I) {
|
|
5
|
+
const t = E("table-extend"), s = v(!0), m = v(!1), p = h(() => t && t.columnConfig.showColumn.map((o) => o.prop) || []), a = h(() => t?.tableColums.value || []);
|
|
6
|
+
function V(o) {
|
|
7
|
+
o ? t && (t.columnConfig.showColumn = a.value) : t && (t.columnConfig.showColumn = []);
|
|
8
|
+
}
|
|
9
|
+
function w(o) {
|
|
10
|
+
if (t) {
|
|
11
|
+
t.columnConfig.showColumn = a.value.filter((u) => o.includes(u.prop));
|
|
12
|
+
const e = o.length;
|
|
13
|
+
s.value = e === a.value.length, m.value = e > 0 && e < a.value.length;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function f(o, e) {
|
|
17
|
+
e.fixed === o ? e.fixed = void 0 : e.fixed = o;
|
|
18
|
+
}
|
|
19
|
+
return (o, e) => {
|
|
20
|
+
const u = i("Setting"), d = i("el-icon"), _ = i("el-checkbox"), C = i("Upload"), U = i("el-divider"), B = i("el-checkbox-group"), N = i("el-popover");
|
|
21
|
+
return r(), F(N, {
|
|
22
|
+
placement: "bottom",
|
|
23
|
+
title: "列显示设置",
|
|
24
|
+
width: 220
|
|
25
|
+
}, {
|
|
26
|
+
reference: c(() => [
|
|
27
|
+
l(d, null, {
|
|
28
|
+
default: c(() => [
|
|
29
|
+
l(u)
|
|
30
|
+
]),
|
|
31
|
+
_: 1
|
|
32
|
+
})
|
|
33
|
+
]),
|
|
34
|
+
default: c(() => [
|
|
35
|
+
g("div", z, [
|
|
36
|
+
l(_, {
|
|
37
|
+
indeterminate: m.value,
|
|
38
|
+
modelValue: s.value,
|
|
39
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => s.value = n),
|
|
40
|
+
onChange: V
|
|
41
|
+
}, {
|
|
42
|
+
default: c(() => [...e[2] || (e[2] = [
|
|
43
|
+
k("全选 ", -1)
|
|
44
|
+
])]),
|
|
45
|
+
_: 1
|
|
46
|
+
}, 8, ["indeterminate", "modelValue"]),
|
|
47
|
+
l(B, {
|
|
48
|
+
class: "set-column-check-group",
|
|
49
|
+
modelValue: p.value,
|
|
50
|
+
"onUpdate:modelValue": e[1] || (e[1] = (n) => p.value = n),
|
|
51
|
+
onChange: w
|
|
52
|
+
}, {
|
|
53
|
+
default: c(() => [
|
|
54
|
+
(r(!0), x($, null, j(a.value, (n) => (r(), x("div", {
|
|
55
|
+
class: "group-item",
|
|
56
|
+
key: n.prop
|
|
57
|
+
}, [
|
|
58
|
+
l(_, {
|
|
59
|
+
class: "set-column-check",
|
|
60
|
+
label: n.prop
|
|
61
|
+
}, {
|
|
62
|
+
default: c(() => [
|
|
63
|
+
k(y(n.label), 1)
|
|
64
|
+
]),
|
|
65
|
+
_: 2
|
|
66
|
+
}, 1032, ["label"]),
|
|
67
|
+
g("div", D, [
|
|
68
|
+
l(d, {
|
|
69
|
+
class: b(["fixed-icon", n.fixed === "left" && "active"]),
|
|
70
|
+
title: "固定到左边",
|
|
71
|
+
onClick: (S) => f("left", n)
|
|
72
|
+
}, {
|
|
73
|
+
default: c(() => [
|
|
74
|
+
l(C)
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["class", "onClick"]),
|
|
78
|
+
l(U, { direction: "vertical" }),
|
|
79
|
+
l(d, {
|
|
80
|
+
class: b(["fixed-icon", n.fixed === "right" && "active"]),
|
|
81
|
+
title: "固定到右边",
|
|
82
|
+
onClick: (S) => f("right", n)
|
|
83
|
+
}, {
|
|
84
|
+
default: c(() => [
|
|
85
|
+
l(C)
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 8, ["class", "onClick"])
|
|
89
|
+
])
|
|
90
|
+
]))), 128))
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["modelValue"])
|
|
94
|
+
])
|
|
95
|
+
]),
|
|
96
|
+
_: 1
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
P as default
|
|
103
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { defineComponent as J, provide as K, toRef as Q, ref as _, watch as w, onMounted as W, nextTick as X, resolveComponent as h, resolveDirective as Y, createElementBlock as c, openBlock as o, createCommentVNode as a, renderSlot as n, unref as l, createElementVNode as m, createBlock as r, withDirectives as Z, mergeProps as C, withCtx as f, Fragment as $, renderList as ee, createTextVNode as te, toDisplayString as oe, createVNode as R } from "vue";
|
|
2
|
+
import { useI18n as le } from "vue-i18n";
|
|
3
|
+
import ne from "../useTable.js";
|
|
4
|
+
import ae from "../props.js";
|
|
5
|
+
import re from "./valueCol.vue.js";
|
|
6
|
+
import se from "./colVisible.vue.js";
|
|
7
|
+
const ie = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "tool-panel"
|
|
10
|
+
}, de = { class: "left-panel" }, ue = { class: "right-panel" }, pe = { class: "default-tool" }, ce = ["innerHTML"], fe = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "required-ident"
|
|
13
|
+
}, ge = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "table-bottom"
|
|
16
|
+
}, me = { class: "left" }, we = /* @__PURE__ */ J({
|
|
17
|
+
__name: "index",
|
|
18
|
+
props: { ...ae() },
|
|
19
|
+
emits: [
|
|
20
|
+
"tableSort",
|
|
21
|
+
"handleSelectionChange",
|
|
22
|
+
"currentChange",
|
|
23
|
+
"pageSizeChange",
|
|
24
|
+
"rowClick",
|
|
25
|
+
"rowDblClick"
|
|
26
|
+
],
|
|
27
|
+
setup(T, { expose: D, emit: P }) {
|
|
28
|
+
const s = T, u = P, { t: I } = le(), {
|
|
29
|
+
selectionOptions: y,
|
|
30
|
+
tableAttribute: L,
|
|
31
|
+
pagination: i,
|
|
32
|
+
hasPagination: v,
|
|
33
|
+
columnConfig: S,
|
|
34
|
+
colSettingList: x,
|
|
35
|
+
showToolPanel: N,
|
|
36
|
+
showBottomPanel: B,
|
|
37
|
+
auto_size: z
|
|
38
|
+
} = ne(I);
|
|
39
|
+
K("table-extend", {
|
|
40
|
+
tableProps: s,
|
|
41
|
+
tableColums: Q(s, "tableColums"),
|
|
42
|
+
columnConfig: S
|
|
43
|
+
});
|
|
44
|
+
const E = _(), p = _(null), k = _(!1);
|
|
45
|
+
w(
|
|
46
|
+
() => s.tableColums,
|
|
47
|
+
() => {
|
|
48
|
+
S.showColumn = s.tableColums;
|
|
49
|
+
}
|
|
50
|
+
), w(
|
|
51
|
+
() => i.pageIndex,
|
|
52
|
+
(e) => {
|
|
53
|
+
if (e && e > 0) {
|
|
54
|
+
if (k.value) {
|
|
55
|
+
k.value = !1;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
u("currentChange", e), p.value?.setScrollTop(0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
), w(
|
|
62
|
+
() => i.pageSize,
|
|
63
|
+
(e) => {
|
|
64
|
+
e && e > 0 && (k.value = !0, i.pageIndex = 1, u("pageSizeChange", e), p.value?.setScrollTop(0));
|
|
65
|
+
}
|
|
66
|
+
), W(() => {
|
|
67
|
+
X(() => {
|
|
68
|
+
s.tableColums && s.tableColums.length > 0 && (S.showColumn = s.tableColums);
|
|
69
|
+
}).then(() => {
|
|
70
|
+
});
|
|
71
|
+
}), D({
|
|
72
|
+
clearSelection: U,
|
|
73
|
+
toggleRowSelection: j,
|
|
74
|
+
table: p
|
|
75
|
+
});
|
|
76
|
+
function V(e) {
|
|
77
|
+
u("tableSort", {
|
|
78
|
+
sortName: e.prop,
|
|
79
|
+
sortType: e.order === "descending" ? "desc" : e.order === "ascending" ? "asc" : ""
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function H(e) {
|
|
83
|
+
y.rows = e, y.count = e && e.length, u("handleSelectionChange", e);
|
|
84
|
+
}
|
|
85
|
+
function M(e) {
|
|
86
|
+
u("rowClick", e);
|
|
87
|
+
}
|
|
88
|
+
function q(e) {
|
|
89
|
+
u("rowDblClick", e);
|
|
90
|
+
}
|
|
91
|
+
function U() {
|
|
92
|
+
p.value?.clearSelection();
|
|
93
|
+
}
|
|
94
|
+
function j(e) {
|
|
95
|
+
p.value?.toggleRowSelection(e);
|
|
96
|
+
}
|
|
97
|
+
return (e, b) => {
|
|
98
|
+
const g = h("el-table-column"), A = h("el-empty"), F = h("el-table"), O = h("el-pagination"), G = Y("loading");
|
|
99
|
+
return o(), c("div", {
|
|
100
|
+
class: "table-extend",
|
|
101
|
+
ref_key: "tableExtendRef",
|
|
102
|
+
ref: E
|
|
103
|
+
}, [
|
|
104
|
+
l(N) ? (o(), c("div", ie, [
|
|
105
|
+
m("div", de, [
|
|
106
|
+
n(e.$slots, "tool-left")
|
|
107
|
+
]),
|
|
108
|
+
m("div", ue, [
|
|
109
|
+
n(e.$slots, "tool-right"),
|
|
110
|
+
m("div", pe, [
|
|
111
|
+
e.isSetColumn ? (o(), r(se, { key: 0 })) : a("", !0)
|
|
112
|
+
])
|
|
113
|
+
])
|
|
114
|
+
])) : a("", !0),
|
|
115
|
+
n(e.$slots, "default", {}, () => [
|
|
116
|
+
Z((o(), r(F, C({
|
|
117
|
+
ref_key: "tableRef",
|
|
118
|
+
ref: p
|
|
119
|
+
}, l(L), {
|
|
120
|
+
data: e.tableData,
|
|
121
|
+
onSortChange: V,
|
|
122
|
+
onSelectionChange: H,
|
|
123
|
+
onRowClick: M,
|
|
124
|
+
onRowDblclick: q
|
|
125
|
+
}), {
|
|
126
|
+
empty: f(() => [
|
|
127
|
+
n(e.$slots, "empty", {}, () => [
|
|
128
|
+
R(A, { "image-size": 60 })
|
|
129
|
+
])
|
|
130
|
+
]),
|
|
131
|
+
default: f(() => [
|
|
132
|
+
e.selectionCol ? (o(), r(g, {
|
|
133
|
+
key: 0,
|
|
134
|
+
type: "selection",
|
|
135
|
+
width: e.autoSize ? l(z)(50) : 50,
|
|
136
|
+
fixed: "left"
|
|
137
|
+
}, null, 8, ["width"])) : a("", !0),
|
|
138
|
+
e.indexCol ? (o(), r(g, {
|
|
139
|
+
key: 1,
|
|
140
|
+
type: "index",
|
|
141
|
+
label: "序号",
|
|
142
|
+
width: e.autoSize ? l(z)(60) : 60,
|
|
143
|
+
fixed: "left"
|
|
144
|
+
}, null, 8, ["width"])) : a("", !0),
|
|
145
|
+
e.expand ? (o(), r(g, {
|
|
146
|
+
key: 2,
|
|
147
|
+
type: "expand"
|
|
148
|
+
}, {
|
|
149
|
+
default: f(({ row: t, $index: d }) => [
|
|
150
|
+
n(e.$slots, "expand", {
|
|
151
|
+
index: d,
|
|
152
|
+
data: t
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
_: 3
|
|
156
|
+
})) : a("", !0),
|
|
157
|
+
(o(!0), c($, null, ee(l(x), (t) => (o(), c($, {
|
|
158
|
+
key: t.prop
|
|
159
|
+
}, [
|
|
160
|
+
t.isHtml ? (o(), r(g, C({
|
|
161
|
+
key: 0,
|
|
162
|
+
ref_for: !0
|
|
163
|
+
}, t), {
|
|
164
|
+
default: f((d) => [
|
|
165
|
+
m("div", {
|
|
166
|
+
innerHTML: t.prop && d.row[t.prop]
|
|
167
|
+
}, null, 8, ce)
|
|
168
|
+
]),
|
|
169
|
+
_: 2
|
|
170
|
+
}, 1040)) : (o(), r(g, C({
|
|
171
|
+
key: 1,
|
|
172
|
+
ref_for: !0
|
|
173
|
+
}, t), {
|
|
174
|
+
default: f((d) => [
|
|
175
|
+
n(e.$slots, `col_${t.prop}`, {
|
|
176
|
+
index: d.$index,
|
|
177
|
+
data: d.row
|
|
178
|
+
}, () => [
|
|
179
|
+
R(re, C({ ref_for: !0 }, { row: d.row, colCfg: t }), null, 16)
|
|
180
|
+
])
|
|
181
|
+
]),
|
|
182
|
+
header: f(() => [
|
|
183
|
+
n(e.$slots, `header_${t.prop}`, { data: t }, () => [
|
|
184
|
+
t.required ? (o(), c("span", fe, "*")) : a("", !0),
|
|
185
|
+
te(" " + oe(t.label), 1)
|
|
186
|
+
])
|
|
187
|
+
]),
|
|
188
|
+
_: 2
|
|
189
|
+
}, 1040))
|
|
190
|
+
], 64))), 128)),
|
|
191
|
+
n(e.$slots, "operatColumn")
|
|
192
|
+
]),
|
|
193
|
+
_: 3
|
|
194
|
+
}, 16, ["data"])), [
|
|
195
|
+
[G, e.tableLoading]
|
|
196
|
+
])
|
|
197
|
+
]),
|
|
198
|
+
l(B) || l(v) ? (o(), c("div", ge, [
|
|
199
|
+
m("div", me, [
|
|
200
|
+
n(e.$slots, "bottom-left")
|
|
201
|
+
]),
|
|
202
|
+
l(v) ? (o(), r(O, {
|
|
203
|
+
key: 0,
|
|
204
|
+
"current-page": l(i).pageIndex,
|
|
205
|
+
"onUpdate:currentPage": b[0] || (b[0] = (t) => l(i).pageIndex = t),
|
|
206
|
+
"page-size": l(i).pageSize,
|
|
207
|
+
"onUpdate:pageSize": b[1] || (b[1] = (t) => l(i).pageSize = t),
|
|
208
|
+
"page-sizes": e.sizeList,
|
|
209
|
+
layout: "total,prev,pager,next,sizes,jumper",
|
|
210
|
+
total: e.total,
|
|
211
|
+
background: ""
|
|
212
|
+
}, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : a("", !0)
|
|
213
|
+
])) : a("", !0)
|
|
214
|
+
], 512);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
export {
|
|
219
|
+
we as default
|
|
220
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as l, computed as p, createElementBlock as r, openBlock as a, toDisplayString as u } from "vue";
|
|
2
|
+
const f = /* @__PURE__ */ l({
|
|
3
|
+
__name: "valueCol",
|
|
4
|
+
props: {
|
|
5
|
+
row: {
|
|
6
|
+
type: Object,
|
|
7
|
+
default: () => {
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
colCfg: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => {
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(n) {
|
|
17
|
+
const c = n, e = p(() => {
|
|
18
|
+
const { row: o, colCfg: t } = c;
|
|
19
|
+
return o[t.prop];
|
|
20
|
+
});
|
|
21
|
+
return (o, t) => (a(), r("span", null, u(e.value != null ? e.value : "--"), 1));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
f as default
|
|
26
|
+
};
|