UNPKG

@wetspace/pro-components

Version:
188 lines (187 loc) 10.2 kB
import { defineComponent as E, shallowRef as H, computed as M, openBlock as m, createElementBlock as h, normalizeClass as c, unref as l, createVNode as s, withCtx as t, createTextVNode as d, createElementVNode as i, Fragment as V, renderList as _, createBlock as B, toDisplayString as D } from "vue"; import { useNamespace as j, ElIcon as f, ElDropdown as L, ElDropdownMenu as N, ElDropdownItem as g, ElPopover as R, ElCheckbox as w, ElButton as S, ElCheckboxGroup as $ } from "element-plus"; import { RefreshRight as F } from "../../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.4.2_/node_modules/@element-plus/icons-vue/dist/index.mjs"; const G = { class: "check-all__inner" }, P = { class: "cols__inner" }, J = /* @__PURE__ */ E({ __name: "tool-icon", props: { size: String, columns: { type: Array, default() { return []; } }, initColumns: { type: Array, default() { return []; } } }, emits: ["refresh", "update:size", "tools", "update:columns"], setup(y, { emit: A }) { const r = j("tabel-tools"), p = H(!0), z = M(() => !(n.columns.length !== 0 && n.columns.length === n.initColumns.length || n.columns.length === 0)), x = () => { const o = n.initColumns.map((e) => Array.isArray(e.dataIndex) ? e.dataIndex.join("") : e.dataIndex); u("update:columns", o); }, k = (o) => { o ? x() : u("update:columns", []), p.value = o; }, u = A, n = y, v = (o) => { u("update:size", o); }, I = () => u("refresh"), b = (o) => { u("update:columns", o); }; return (o, e) => (m(), h("div", { class: c([l(r).b()]) }, [ s(l(f), { class: "table-tool-icon", onClick: I }, { default: t(() => [ s(l(F)) ]), _: 1 }), s(l(L), { trigger: "click", class: "table-tool-icon" }, { dropdown: t(() => [ s(l(N), null, { default: t(() => [ s(l(g), { class: c([l(r).e("toolsizeitem"), l(r).is("actived", n.size === "default")]), onClick: e[0] || (e[0] = (a) => v("default")) }, { default: t(() => e[5] || (e[5] = [ d(" 默认 ") ])), _: 1 }, 8, ["class"]), s(l(g), { class: c([l(r).e("toolsizeitem"), l(r).is("actived", n.size === "large")]), onClick: e[1] || (e[1] = (a) => v("large")) }, { default: t(() => e[6] || (e[6] = [ d(" 宽松 ") ])), _: 1 }, 8, ["class"]), s(l(g), { class: c([l(r).e("toolsizeitem"), l(r).is("actived", n.size === "small")]), onClick: e[2] || (e[2] = (a) => v("small")) }, { default: t(() => e[7] || (e[7] = [ d(" 紧凑 ") ])), _: 1 }, 8, ["class"]) ]), _: 1 }) ]), default: t(() => [ s(l(f), { size: 14 }, { default: t(() => e[4] || (e[4] = [ i("svg", { t: "1716079659980", class: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "p-id": "1502", width: "200", height: "200" }, [ i("path", { d: "M815 72.7H214.9c-22.3 0-40.3 18.1-40.3 40.3v4.9c0 22.3 18.1 40.3 40.3 40.3H815c22.3 0 40.3-18.1 40.3-40.3V113c0-22.2-18-40.3-40.3-40.3zM815 893.4H214.9c-22.3 0-40.3 18.1-40.3 40.3v4.9c0 22.3 18.1 40.3 40.3 40.3H815c22.3 0 40.3-18.1 40.3-40.3v-4.9c0-22.2-18-40.3-40.3-40.3zM408.8 708.8l53.1 76.2 53 76.1L568 785l53-76.2h-63.2v-370H621l-53-70.9-53.1-71-53 71-53.1 70.9h63.4v370z", "p-id": "1503" }) ], -1) ])), _: 1 }) ]), _: 1 }), s(l(R), { trigger: "click" }, { reference: t(() => [ s(l(f), { class: "table-tool-icon" }, { default: t(() => e[8] || (e[8] = [ i("svg", { t: "1716079862322", class: "icon", viewBox: "0 0 1024 1024", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "p-id": "6939", width: "200", height: "200" }, [ i("path", { d: "M577.173333 138.666667v38.986666A92.8 92.8 0 0 0 629.333333 260.693333a276.106667 276.106667 0 0 1 37.92 22.293334 91.733333 91.733333 0 0 0 99.04 4.266666l32.693334-19.04 65.706666 114.773334-33.493333 19.52a92.693333 92.693333 0 0 0-45.386667 87.413333c0.693333 7.84 1.013333 15.093333 1.013334 22.08s-0.32 14.24-1.013334 22.08a92.693333 92.693333 0 0 0 45.386667 87.413333l33.493333 19.52-65.706666 114.773334-32.693334-19.04a91.733333 91.733333 0 0 0-99.04 4.266666 276.106667 276.106667 0 0 1-37.92 22.293334 92.8 92.8 0 0 0-52.266666 83.04V885.333333H446.826667v-38.986666A92.8 92.8 0 0 0 394.666667 763.306667a276.106667 276.106667 0 0 1-37.92-22.293334 91.733333 91.733333 0 0 0-99.04-4.266666l-32.693334 19.04-65.813333-114.773334 33.493333-19.52a92.693333 92.693333 0 0 0 45.386667-87.413333c-0.693333-7.84-1.013333-15.093333-1.013333-22.08s0.32-14.24 1.013333-22.08a92.693333 92.693333 0 0 0-45.386667-87.413333l-33.493333-19.52 65.706667-114.773334 32.693333 19.04a91.733333 91.733333 0 0 0 99.04-4.266666A276.106667 276.106667 0 0 1 394.666667 260.693333a92.8 92.8 0 0 0 52.266666-83.04V138.666667h130.346667M512 692.48a182.08 182.08 0 0 0 40.426667-4.533333 178.826667 178.826667 0 0 0 134.666666-135.573334 181.333333 181.333333 0 0 0-35.36-153.653333A178.453333 178.453333 0 0 0 512 331.52a182.08 182.08 0 0 0-40.426667 4.533333 178.826667 178.826667 0 0 0-134.666666 135.573334 181.333333 181.333333 0 0 0 35.36 153.653333 178.453333 178.453333 0 0 0 139.733333 67.2M634.666667 64H389.6a17.546667 17.546667 0 0 0-17.44 17.6v96a17.546667 17.546667 0 0 1-10.026667 16 352.746667 352.746667 0 0 0-48.32 28.373333 17.6 17.6 0 0 1-9.813333 3.093334 17.013333 17.013333 0 0 1-8.533333-2.346667l-82.666667-48a17.12 17.12 0 0 0-8.693333-2.4A17.386667 17.386667 0 0 0 188.746667 181.333333l-122.666667 213.866667a17.706667 17.706667 0 0 0 6.4 24.053333l82.346667 48a17.493333 17.493333 0 0 1 8.533333 16.746667c-0.746667 9.333333-1.226667 18.72-1.226667 28.266667s0.48 18.933333 1.226667 28.266666a17.6 17.6 0 0 1-8.533333 16.746667l-82.346667 48a17.706667 17.706667 0 0 0-6.4 24.053333l122.666667 213.866667a17.333333 17.333333 0 0 0 15.093333 8.8 17.066667 17.066667 0 0 0 8.693333-2.346667l82.666667-48a16.48 16.48 0 0 1 8.533333-2.346666 17.6 17.6 0 0 1 10.08 3.253333 352.746667 352.746667 0 0 0 48.32 28.373333 17.546667 17.546667 0 0 1 10.026667 16v96a17.546667 17.546667 0 0 0 17.44 17.6H634.666667a17.546667 17.546667 0 0 0 17.44-17.6v-96a17.546667 17.546667 0 0 1 10.026666-16 352.746667 352.746667 0 0 0 48.32-28.373333 17.6 17.6 0 0 1 10.08-3.253333 16.48 16.48 0 0 1 8.533334 2.346666l82.666666 48a17.066667 17.066667 0 0 0 8.693334 2.346667 17.333333 17.333333 0 0 0 15.093333-8.8l122.133333-213.866667a17.706667 17.706667 0 0 0-6.4-24.053333l-82.346666-48a17.6 17.6 0 0 1-8.533334-16.746667c0.746667-9.333333 1.226667-18.72 1.226667-28.266666s-0.48-18.933333-1.226667-28.266667a17.493333 17.493333 0 0 1 8.533334-16.746667l82.346666-48a17.706667 17.706667 0 0 0 6.4-24.053333L835.253333 181.333333a17.386667 17.386667 0 0 0-15.093333-8.853333 17.12 17.12 0 0 0-8.693333 2.4l-82.666667 48a17.013333 17.013333 0 0 1-8.533333 2.346667 17.6 17.6 0 0 1-10.08-3.253334 352.746667 352.746667 0 0 0-48.32-28.373333 17.546667 17.546667 0 0 1-10.026667-16v-96A17.546667 17.546667 0 0 0 634.666667 64zM512 617.813333a105.973333 105.973333 0 0 1-24-208.96 109.973333 109.973333 0 0 1 24-2.666666 105.973333 105.973333 0 0 1 24 208.96 109.973333 109.973333 0 0 1-24 2.666666z", "p-id": "6940" }) ], -1) ])), _: 1 }) ]), default: t(() => [ i("div", { class: c([l(r).e("cols-display")]) }, [ i("div", G, [ s(l(w), { modelValue: p.value, "onUpdate:modelValue": e[3] || (e[3] = (a) => p.value = a), indeterminate: z.value, onChange: k }, { default: t(() => e[9] || (e[9] = [ d(" 列展示 ") ])), _: 1 }, 8, ["modelValue", "indeterminate"]), s(l(S), { link: "", type: "primary", onClick: x }, { default: t(() => e[10] || (e[10] = [ d(" 重置 ") ])), _: 1 }) ]), i("div", P, [ s(l($), { "model-value": n.columns, onChange: b }, { default: t(() => [ (m(!0), h(V, null, _(n.initColumns, (a, C) => (m(), B(l(w), { key: Array.isArray(a.dataIndex) ? a.dataIndex.join("") : a.dataIndex, disabled: C === 0 || C === n.initColumns.length - 1, label: Array.isArray(a.dataIndex) ? a.dataIndex.join("") : a.dataIndex, value: Array.isArray(a.dataIndex) ? a.dataIndex.join("") : a.dataIndex }, { default: t(() => [ d(D(a.label || a.title), 1) ]), _: 2 }, 1032, ["disabled", "label", "value"]))), 128)) ]), _: 1 }, 8, ["model-value"]) ]) ], 2) ]), _: 1 }) ], 2)); } }); export { J as default };