SettingColumns.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. import { ref as _, resolveComponent as m, openBlock as V, createBlock as B, withCtx as a, createElementVNode as o, toDisplayString as i, createVNode as d, unref as N, createTextVNode as c } from "vue";
  2. import { d as O } from "./vuedraggable.js";
  3. import { n as D, d7 as E, B as H } from "./index2.js";
  4. import { _ as T } from "./index7.js";
  5. import { _ as j } from "./index8.js";
  6. const q = { class: "drawer-wrap" }, z = { class: "content-wrap" }, K = { class: "table-wrap" }, R = { class: "title" }, W = { class: "columns-wrap" }, A = { class: "item" }, G = { class: "td-item flex-start" }, J = { class: "drag-icon" }, L = { class: "checkbox" }, M = { class: "checkbox" }, P = { class: "name" }, Q = { class: "td-item" }, X = { style: { "margin-right": "8px" } }, Y = { class: "drawer-footer" }, Z = /* @__PURE__ */ Object.assign({ name: "SettingColumns" }, {
  7. __name: "SettingColumns",
  8. props: {
  9. pageCode: {
  10. type: String,
  11. required: !0
  12. }
  13. },
  14. emits: ["reset"],
  15. setup(ee, { expose: p, emit: f }) {
  16. const v = f, l = _(!1), r = _([]);
  17. function g(t) {
  18. r.value = t.map((e) => (e.item = "item", e.width && !window.$utils.isNumber(e.width) && (e.width = parseInt(e.width)), e.fixed && (e.isFixed = !0), e.show === void 0 && (e.show = !0), e.dataIndex === "action" && (e.isFixed = !0, e.disabledFixed = !0), e)), l.value = !0;
  19. }
  20. function w() {
  21. v("reset", (t) => {
  22. console.log(t);
  23. });
  24. }
  25. function C() {
  26. }
  27. function x(t) {
  28. t.show = !t.show;
  29. }
  30. function b(t) {
  31. t.fixed = !t.fixed;
  32. }
  33. function k({ target: { value: t } }, e) {
  34. e.width = t + "px";
  35. }
  36. function $() {
  37. }
  38. function S() {
  39. }
  40. return p({
  41. show: g,
  42. columns: r,
  43. visible: l
  44. }), (t, e) => {
  45. const y = m("HolderOutlined"), u = E, U = j, F = m("UndoOutlined"), h = H, I = T;
  46. return V(), B(I, {
  47. rootClassName: "filter-columns-wrap",
  48. title: `${t.$l("高级表格")}`,
  49. placement: "right",
  50. width: 700,
  51. visible: l.value,
  52. onClose: e[1] || (e[1] = (s) => l.value = !1)
  53. }, {
  54. default: a(() => [
  55. o("div", q, [
  56. o("div", z, [
  57. o("div", K, [
  58. o("div", R, i(t.$l("勾选要显示的列,拖动排序")), 1),
  59. o("div", W, [
  60. d(N(O), {
  61. list: r.value,
  62. itemKey: "dataIndex",
  63. handle: ".mover",
  64. animation: "300",
  65. "ghost-class": "ghost",
  66. "chosen-class": "chosenClass",
  67. touchStartThreshold: 20,
  68. onStart: $,
  69. onEnd: S
  70. }, {
  71. item: a(({ element: s }) => [
  72. o("div", A, [
  73. o("div", G, [
  74. o("div", J, [
  75. d(y),
  76. e[2] || (e[2] = o("div", { class: "mask mover" }, null, -1))
  77. ]),
  78. o("div", L, [
  79. d(u, {
  80. checked: s.show,
  81. "onUpdate:checked": (n) => s.show = n,
  82. onChange: (n) => x(s)
  83. }, {
  84. default: a(() => [
  85. c(i(t.$l("显示")), 1)
  86. ]),
  87. _: 1
  88. }, 8, ["checked", "onUpdate:checked", "onChange"])
  89. ]),
  90. o("div", M, [
  91. d(u, {
  92. checked: s.isFixed,
  93. "onUpdate:checked": (n) => s.isFixed = n,
  94. disabled: s.disabledFixed,
  95. onChange: (n) => b(s)
  96. }, {
  97. default: a(() => [
  98. c(i(t.$l("冻结")), 1)
  99. ]),
  100. _: 1
  101. }, 8, ["checked", "onUpdate:checked", "disabled", "onChange"])
  102. ]),
  103. o("div", P, i(s.title || s.name), 1)
  104. ]),
  105. o("div", Q, [
  106. o("span", X, i(t.$l("宽度")), 1),
  107. d(U, {
  108. style: { width: "80px" },
  109. size: "small",
  110. modelValue: s.width,
  111. "onUpdate:modelValue": (n) => s.width = n,
  112. onBlur: (n) => k(n, s)
  113. }, null, 8, ["modelValue", "onUpdate:modelValue", "onBlur"]),
  114. e[3] || (e[3] = o("span", { style: { "margin-left": "8px" } }, "px", -1))
  115. ])
  116. ])
  117. ]),
  118. _: 1
  119. }, 8, ["list"])
  120. ])
  121. ])
  122. ]),
  123. o("div", Y, [
  124. d(h, {
  125. class: "reset",
  126. onClick: e[0] || (e[0] = (s) => w())
  127. }, {
  128. default: a(() => [
  129. d(F),
  130. c(i(t.$l("重置")), 1)
  131. ]),
  132. _: 1
  133. }),
  134. d(h, {
  135. class: "submit",
  136. type: "primary",
  137. onClick: C
  138. }, {
  139. default: a(() => [
  140. c(i(t.$l("确定")), 1)
  141. ]),
  142. _: 1
  143. })
  144. ])
  145. ])
  146. ]),
  147. _: 1
  148. }, 8, ["title", "visible"]);
  149. };
  150. }
  151. }), ie = /* @__PURE__ */ D(Z, [["__scopeId", "data-v-11dd8264"]]);
  152. export {
  153. ie as default
  154. };