@web-utils/component 4.0.0 → 4.0.1

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.
Files changed (171) hide show
  1. package/awesome-button/index.mjs +25 -55
  2. package/base.css +1 -1
  3. package/card/style.css +1 -1
  4. package/carousel/style.css +1 -1
  5. package/chat/style.css +1 -1
  6. package/chunks/{ElementForm.8w6UkiuU.mjs → ElementForm.CQ3PN5qj.mjs} +17 -35
  7. package/chunks/{ElementListeners.DOy8wyD2.mjs → ElementListeners.De_PRuIm.mjs} +56 -95
  8. package/chunks/{ElementMultiInstance.3Z28ewuh.mjs → ElementMultiInstance.DQo2wuAQ.mjs} +16 -26
  9. package/chunks/{ElementProperties.B2I48muA.mjs → ElementProperties.CosfDrlW.mjs} +16 -16
  10. package/chunks/{ElementTaskConfig.MBbkLrth.mjs → ElementTaskConfig.Bko0kgTp.mjs} +104 -113
  11. package/chunks/{FlowCondition.BfU9kw6h.mjs → FlowCondition.Y6qEYi1T.mjs} +36 -66
  12. package/chunks/{SignalAndMessage.CH6L7cYu.mjs → SignalAndMessage.Bb5PFX0N.mjs} +11 -22
  13. package/chunks/{UserTaskListeners.XXe5dC5I.mjs → UserTaskListeners.Bv3BDfEI.mjs} +45 -86
  14. package/chunks/configComponents.BDhlZU8F.mjs +23 -0
  15. package/chunks/confirmable-mixin.D9aKzKZ9.mjs +85 -0
  16. package/chunks/core.DJEgjQW6.mjs +54 -0
  17. package/chunks/dictionary.DqiP9x2m.mjs +25 -0
  18. package/chunks/form-input.B8z37eqj.mjs +31 -0
  19. package/chunks/form-item.D-H-wCPE.mjs +233 -0
  20. package/chunks/form-validate.CVarNHKX.mjs +12 -0
  21. package/chunks/helper.BiMLcEEk.mjs +41 -0
  22. package/chunks/index.9OxHjTIE.mjs +16 -0
  23. package/chunks/{index.MAFc4eFi.mjs → index.d3MV3Wq2.mjs} +43 -47
  24. package/chunks/sub-table-plus-props.BVsD71hT.mjs +30 -0
  25. package/chunks/{tab-mixin.CVr9bZtn.mjs → tab-mixin.BNK6dxLN.mjs} +1 -1
  26. package/chunks/utilSelf.Csq1766E.mjs +48 -0
  27. package/color-picker/index.mjs +19 -37
  28. package/comment/style.css +1 -1
  29. package/confirm-button/index.mjs +1 -1
  30. package/confirmable/index.mjs +1 -1
  31. package/context-menu/style.css +1 -1
  32. package/count-up/index.mjs +13 -24
  33. package/custom-scrollbar/index.mjs +1 -2
  34. package/data-operatext/style.css +1 -1
  35. package/data-panel/style.css +1 -1
  36. package/data-pay/style.css +1 -1
  37. package/data-price/style.css +1 -1
  38. package/data-rotate/style.css +1 -1
  39. package/data-table-picker/index.mjs +1 -1
  40. package/data-tabs/style.css +1 -1
  41. package/dialog-form/index.mjs +16 -28
  42. package/dynamic-table/style.css +1 -1
  43. package/easy-popup/index.mjs +22 -40
  44. package/easy-popup/style.css +1 -1
  45. package/editable-tree/index.mjs +203 -250
  46. package/editable-tree/style.css +1 -1
  47. package/element-dialog/index.mjs +30 -52
  48. package/element-dialog/style.css +1 -1
  49. package/flex-column/index.mjs +13 -25
  50. package/flex-item/index.mjs +15 -27
  51. package/flex-row/index.mjs +13 -25
  52. package/flow-designer/index.mjs +343 -374
  53. package/flow-designer/style.css +1 -1
  54. package/flow-viewer/index.mjs +64 -91
  55. package/form-block/index.mjs +33 -26
  56. package/form-card/index.mjs +25 -0
  57. package/form-cascader/index.mjs +70 -67
  58. package/form-checkbox/index.mjs +71 -0
  59. package/form-checkbox-group/index.mjs +33 -53
  60. package/form-date-picker/index.mjs +44 -73
  61. package/form-holder/index.mjs +54 -40
  62. package/form-holder/style.css +1 -0
  63. package/form-input/index.mjs +62 -40
  64. package/form-input-cron-expression/index.mjs +77 -0
  65. package/form-input-cron-expression/style.css +1 -0
  66. package/form-input-email/index.mjs +21 -33
  67. package/form-input-id-card/index.mjs +25 -38
  68. package/form-input-number/index.mjs +39 -42
  69. package/form-input-number/style.css +1 -1
  70. package/form-input-phone-number/index.mjs +26 -37
  71. package/form-input-tag/index.mjs +32 -34
  72. package/form-input-time/index.mjs +22 -37
  73. package/form-item/index.mjs +109 -101
  74. package/form-item/style.css +1 -1
  75. package/form-item-config-provider/index.mjs +18 -10
  76. package/form-item-group/index.mjs +73 -69
  77. package/form-item-group/style.css +1 -1
  78. package/form-radio-group/index.mjs +41 -36
  79. package/form-radio-group/style.css +1 -1
  80. package/form-select/index.mjs +142 -75
  81. package/form-select/style.css +1 -0
  82. package/form-switch/index.mjs +29 -34
  83. package/form-table/index.mjs +85 -0
  84. package/form-table-plus/index.mjs +109 -0
  85. package/form-textarea/index.mjs +23 -35
  86. package/form-tree-select/index.mjs +72 -0
  87. package/form-tree-select/style.css +1 -0
  88. package/form-tree-select-multiple/index.mjs +78 -0
  89. package/form-view/index.mjs +37 -69
  90. package/form-view/style.css +1 -1
  91. package/fy-curd/index.mjs +131 -140
  92. package/fy-curd/style.css +1 -1
  93. package/fy-draggable/index.mjs +16 -26
  94. package/fy-draggable/style.css +1 -1
  95. package/fy-dynamic/index.mjs +48 -57
  96. package/fy-empty/style.css +1 -1
  97. package/fy-form/style.css +1 -1
  98. package/fy-form-design/index.mjs +314 -339
  99. package/fy-form-design/style.css +1 -1
  100. package/fy-input-map/index.mjs +40 -50
  101. package/fy-input-map/style.css +1 -1
  102. package/fy-input-table/index.mjs +31 -41
  103. package/fy-u-editor/index.mjs +77 -103
  104. package/fy-upload/style.css +1 -1
  105. package/highlight-j-s/style.css +1 -1
  106. package/image-cropper/index.mjs +14 -65
  107. package/image-preview/index.mjs +17 -45
  108. package/image-preview/style.css +1 -1
  109. package/image-viewer/style.css +1 -1
  110. package/index.mjs +666 -496
  111. package/input-number/index.mjs +64 -9
  112. package/keyboard/style.css +1 -1
  113. package/monaco-editor/index.mjs +43 -71
  114. package/name-avatar/style.css +1 -1
  115. package/package.json +5 -4
  116. package/page-index/index.mjs +30 -54
  117. package/page-index-top/index.mjs +25 -47
  118. package/pageable-table/index.mjs +353 -221
  119. package/pageable-table/style.css +1 -1
  120. package/pageable-view/index.mjs +56 -95
  121. package/photo-swipe/index.mjs +51 -74
  122. package/picker-table-view/index.mjs +117 -0
  123. package/present-view/index.mjs +43 -77
  124. package/present-view/style.css +1 -1
  125. package/resize-observer/index.mjs +1 -1
  126. package/resize-observer/style.css +1 -1
  127. package/search/style.css +1 -1
  128. package/search-popover/index.mjs +28 -48
  129. package/search-popover/style.css +1 -1
  130. package/sign/index.mjs +1 -1
  131. package/sign-panel/style.css +1 -1
  132. package/skeleton-panel/index.mjs +38 -0
  133. package/skeleton-panel/style.css +1 -0
  134. package/split-pane/index.mjs +31 -49
  135. package/split-pane/style.css +1 -1
  136. package/sub-table/index.mjs +206 -0
  137. package/sub-table/style.css +1 -0
  138. package/sub-table-plus/index.mjs +231 -0
  139. package/sub-table-plus/style.css +1 -0
  140. package/swiper/index.mjs +18 -38
  141. package/swiper/style.css +1 -1
  142. package/tab/index.mjs +1 -1
  143. package/tab/style.css +1 -1
  144. package/tab-item/index.mjs +2 -2
  145. package/table-column/index.mjs +112 -37
  146. package/table-column/style.css +1 -0
  147. package/table-view/index.mjs +177 -132
  148. package/table-view/style.css +1 -1
  149. package/tabs-view/index.mjs +104 -0
  150. package/tabs-view/style.css +1 -0
  151. package/tag-render/index.mjs +13 -24
  152. package/toolbar/index.mjs +115 -58
  153. package/toolbar/style.css +1 -1
  154. package/toolbar-button/index.mjs +92 -48
  155. package/vue-cron/index.mjs +47 -65
  156. package/vue-qr-code/index.mjs +14 -32
  157. package/vue-quill-editor/index.mjs +13 -24
  158. package/vue-tags-input/index.mjs +10 -21
  159. package/vue-tree-select/index.mjs +352 -393
  160. package/vue-tree-select/style.css +1 -1
  161. package/vue-video-player/index.mjs +34 -63
  162. package/watermark/index.mjs +21 -31
  163. package/web-types.json +9240 -3840
  164. package/x-input-tag/index.mjs +29 -61
  165. package/chunks/confirmable-mixin.D4LAArE5.mjs +0 -114
  166. package/chunks/form-input-mixin.BkKiqJhi.mjs +0 -24
  167. package/chunks/form-item-mixin.CG4ZwzMC.mjs +0 -140
  168. package/chunks/input-number-mixin.CzjtGf2n.mjs +0 -60
  169. package/chunks/utilSelf.CRqpl0Cz.mjs +0 -56
  170. package/toolbar-button/style.css +0 -1
  171. /package/chunks/{form-pick-mixin.BFTIVn_i.mjs → form-pick.BFTIVn_i.mjs} +0 -0
@@ -1,17 +1,9 @@
1
- var s = Object.defineProperty, u = Object.defineProperties;
2
- var d = Object.getOwnPropertyDescriptors;
3
- var o = Object.getOwnPropertySymbols;
4
- var c = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
5
- var i = (t, e, n) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, l = (t, e) => {
6
- for (var n in e || (e = {}))
7
- c.call(e, n) && i(t, n, e[n]);
8
- if (o)
9
- for (var n of o(e))
10
- f.call(e, n) && i(t, n, e[n]);
11
- return t;
12
- }, r = (t, e) => u(t, d(e));
13
- import { n as p } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
14
- const g = {
1
+ import { _ } from "../chunks/helper.BiMLcEEk.mjs";
2
+ import { h as g } from "vue";
3
+ import w from "../dict-render/index.mjs";
4
+ import { f as v } from "../chunks/core.DJEgjQW6.mjs";
5
+ import { n as F } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
6
+ const x = {
15
7
  props: {
16
8
  type: {
17
9
  type: String,
@@ -27,7 +19,7 @@ const g = {
27
19
  renderHeader: Function,
28
20
  sortable: {
29
21
  type: [Boolean, String],
30
- default: !1
22
+ default: !0
31
23
  },
32
24
  sortMethod: Function,
33
25
  sortBy: [String, Function, Array],
@@ -39,6 +31,8 @@ const g = {
39
31
  align: String,
40
32
  headerAlign: String,
41
33
  showTooltipWhenOverflow: Boolean,
34
+ clickable: Boolean,
35
+ cellClick: Function,
42
36
  showOverflowTooltip: {
43
37
  type: Boolean,
44
38
  default: !0
@@ -61,36 +55,117 @@ const g = {
61
55
  default() {
62
56
  return ["ascending", "descending", null];
63
57
  },
64
- validator(t) {
65
- return t.every((e) => ["ascending", "descending", null].indexOf(e) > -1);
58
+ validator(n) {
59
+ return n.every((t) => ["ascending", "descending", null].indexOf(t) > -1);
66
60
  }
67
- }
61
+ },
62
+ dictType: String,
63
+ options: Array,
64
+ autoUpdate: Boolean,
65
+ treeDict: Boolean,
66
+ idAsValue: {
67
+ type: Boolean,
68
+ default: !0
69
+ },
70
+ labelAsValue: Boolean
71
+ }
72
+ }, N = {
73
+ selection: !0,
74
+ "single-selection": !0,
75
+ index: !0,
76
+ expand: !0
77
+ }, O = (n, t, e, y, d) => {
78
+ var i;
79
+ const l = n.rowDbClick || ((i = n.$children.find((f) => f.$options.name === "TableView")) == null ? void 0 : i.rowDbClick);
80
+ l == null || l(t, e, y, d);
81
+ }, V = (n) => {
82
+ let t = n.target;
83
+ for (; t && t.tagName.toUpperCase() !== "HTML"; ) {
84
+ if (t.tagName.toUpperCase() === "TD")
85
+ return t;
86
+ t = t.parentNode;
68
87
  }
69
- }, m = {
88
+ return null;
89
+ }, D = () => {
90
+ }, M = (n) => !v(n).length, k = {
70
91
  name: "TableColumn",
71
92
  functional: !0,
72
- mixins: [g],
73
- render(t, { data: e, props: n, children: a }) {
74
- return t(
75
- "ElTableColumn",
76
- r(l({}, e), {
77
- props: r(l({}, n), {
78
- showOverflowTooltip: ["selection", "single-selection", "index", "expand"].includes(n.type) ? !1 : n.showOverflowTooltip
79
- })
80
- }),
81
- a
82
- );
93
+ mixins: [x],
94
+ render(n, {
95
+ data: t,
96
+ props: e,
97
+ children: y,
98
+ parent: d,
99
+ listeners: {
100
+ click: l
101
+ }
102
+ }) {
103
+ const {
104
+ scopedSlots: i,
105
+ ...f
106
+ } = t, {
107
+ clickable: C,
108
+ cellClick: a,
109
+ ...b
110
+ } = e, S = {
111
+ ...i || {}
112
+ }, h = N[e.type];
113
+ if (!h) {
114
+ const p = i == null ? void 0 : i.default, c = C || l || a;
115
+ (c || e.dictType || e.options) && (S.default = (T) => {
116
+ const {
117
+ row: o,
118
+ column: r
119
+ } = T, B = c ? (u) => {
120
+ const m = V(u);
121
+ l || a ? (l == null || l(o, r, o, r, m, u), a == null || a(o, r, o, r, m, u)) : O(d, o, r, m, u);
122
+ } : D;
123
+ let s = p == null ? void 0 : p(T);
124
+ return M(s) && (s = null), (e.dictType || e.options) && !s ? g(w, {
125
+ class: {
126
+ "is-clickable": c
127
+ },
128
+ on: {
129
+ click: B
130
+ },
131
+ attrs: {
132
+ row: o,
133
+ column: r,
134
+ dictType: e.dictType,
135
+ treeDict: e.treeDict,
136
+ idAsValue: e.idAsValue,
137
+ labelAsValue: e.labelAsValue,
138
+ options: e.options
139
+ }
140
+ }) : c ? g("span", {
141
+ class: "is-clickable",
142
+ on: {
143
+ click: B
144
+ }
145
+ }, [s || (o == null ? void 0 : o[r == null ? void 0 : r.property])]) : s;
146
+ });
147
+ }
148
+ const A = {
149
+ ...f,
150
+ props: {
151
+ ...b,
152
+ showOverflowTooltip: h ? !1 : b.showOverflowTooltip
153
+ }
154
+ };
155
+ return g("ElTableColumn", _([{}, A, {
156
+ scopedSlots: S
157
+ }]));
83
158
  }
84
- }, y = null, S = null;
85
- var b = /* @__PURE__ */ p(
86
- m,
87
- y,
88
- S,
159
+ }, H = null, P = null;
160
+ var U = /* @__PURE__ */ F(
161
+ k,
162
+ H,
163
+ P,
89
164
  !1,
90
165
  null,
91
166
  null
92
167
  );
93
- const w = b.exports;
168
+ const K = U.exports;
94
169
  export {
95
- w as default
170
+ K as default
96
171
  };
@@ -0,0 +1 @@
1
+ .is-clickable{cursor:pointer;text-decoration:underline}.is-clickable:hover{color:var(--color-primary)}.el-table__column-filter-trigger{line-height:unset}
@@ -1,24 +1,12 @@
1
- var a = (r, e, t) => new Promise((s, l) => {
2
- var o = (i) => {
3
- try {
4
- c(t.next(i));
5
- } catch (h) {
6
- l(h);
7
- }
8
- }, b = (i) => {
9
- try {
10
- c(t.throw(i));
11
- } catch (h) {
12
- l(h);
13
- }
14
- }, c = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(o, b);
15
- c((t = t.apply(r, e)).next());
16
- });
17
- import { merge as n } from "@web-utils/integrations/lodash";
18
- import { isFunction as u, toStringArray as m, isString as d, isArray as g, trace as f, warning as w, hasOwn as p } from "@web-utils/core";
19
- import { k as _ } from "../chunks/index.MAFc4eFi.mjs";
20
- import { n as v } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
21
- const P = [
1
+ import { isFunction as w, toStringArray as g, isString as i, isArray as d, trace as u, warning as b, hasOwn as p } from "@web-utils/core";
2
+ import { merge as a } from "@web-utils/integrations/lodash";
3
+ import { e as v } from "../chunks/index.d3MV3Wq2.mjs";
4
+ import _ from "../form-item-config-provider/index.mjs";
5
+ import { g as f } from "../chunks/configComponents.BDhlZU8F.mjs";
6
+ import { b as n } from "../chunks/core.DJEgjQW6.mjs";
7
+ import y from "element-ui/lib/transitions/collapse-transition";
8
+ import { n as S } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
9
+ const T = [
22
10
  "back",
23
11
  "create",
24
12
  "save",
@@ -38,22 +26,29 @@ const P = [
38
26
  "disabled",
39
27
  "reload",
40
28
  "slot"
41
- ], y = {
29
+ ], P = {
42
30
  name: "TableView",
43
31
  bus: {
44
- reloadTableView(r, e) {
32
+ reloadTableView(t) {
33
+ if (this._viewIds)
34
+ if (i(t) || d(t)) {
35
+ let e = t;
36
+ i(e) && (e = e.split(",")), this._viewIds.some((r) => e.includes(r)) && (u.call(this.$parent || {}, "reloadTableView"), this.reloadTable());
37
+ } else
38
+ b.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
39
+ },
40
+ reloadTreeView(t) {
45
41
  if (this._viewIds)
46
- if (d(r) || g(r)) {
47
- let t = r;
48
- d(t) && (t = t.split(",")), this._viewIds.some((s) => t.includes(s)) && (e ? this.$refs.tree && (f.call(this.$parent || {}, "reloadTree"), this.refreshTree()) : (f.call(this.$parent || {}, "reloadTable"), this.reloadTable()));
42
+ if (i(t) || d(t)) {
43
+ let e = t;
44
+ i(e) && (e = e.split(",")), this._viewIds.some((r) => e.includes(r)) && this.$refs.tree && (u.call(this.$parent || {}, "reloadTreeView"), this.reloadTree());
49
45
  } else
50
- w.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
46
+ b.call(this.$parent || {}, "`viewId`的类型必须是字符串或数组");
51
47
  }
52
48
  },
49
+ components: { FormItemConfigProvider: _, ElCollapseTransition: y },
53
50
  props: {
54
- viewId: {
55
- type: String
56
- },
51
+ viewId: [String, Array],
57
52
  searchPanelAttrs: {
58
53
  type: Object,
59
54
  default: () => {
@@ -64,31 +59,21 @@ const P = [
64
59
  default: () => {
65
60
  }
66
61
  },
67
- toolbarListeners: {
68
- type: Object
69
- },
62
+ toolbarListeners: Object,
70
63
  treeAttrs: {
71
64
  type: Object,
72
65
  default: () => {
73
66
  }
74
67
  },
75
- treeListeners: {
76
- type: Object
77
- },
78
- tableAttrs: {
79
- type: Object
80
- },
81
- searchModel: {
82
- type: Object
83
- },
68
+ treeListeners: Object,
69
+ tableAttrs: Object,
70
+ searchModel: Object,
84
71
  tableListeners: {
85
72
  type: Object,
86
73
  default: () => {
87
74
  }
88
75
  },
89
- deleteApi: {
90
- type: Function
91
- },
76
+ deleteApi: Function,
92
77
  borderTop: Boolean,
93
78
  borderBottom: Boolean,
94
79
  borderLeft: Boolean,
@@ -99,32 +84,45 @@ const P = [
99
84
  },
100
85
  labelWidth: {
101
86
  type: String,
102
- default: "80px"
87
+ default: "120px"
103
88
  },
104
- formPath: {
105
- type: [String, Function]
89
+ formPath: [String, Function],
90
+ searchFormPosition: {
91
+ type: String,
92
+ default: "top"
93
+ },
94
+ embed: Boolean,
95
+ deleteTips: String,
96
+ selectTips: String,
97
+ rowKey: {
98
+ type: String,
99
+ default: "id"
100
+ },
101
+ expandSearch: Boolean,
102
+ showToolbar: {
103
+ type: Boolean,
104
+ default: !0
106
105
  }
107
106
  },
108
107
  data() {
109
- var r;
110
108
  return {
111
109
  importDialogVisible: !1,
112
- right: -(((r = this.searchPanelAttrs) == null ? void 0 : r.width) || 350),
113
- selectedRows: []
110
+ selectedRows: [],
111
+ isSearchVisible: !1
114
112
  };
115
113
  },
116
114
  computed: {
117
115
  buttonSlots() {
118
- return P.filter((r) => this.$scopedSlots[r]);
116
+ return T.filter((t) => this.$scopedSlots[t]);
119
117
  },
120
118
  toolbarProps() {
121
119
  var s, l;
122
- const r = {}, e = n(this.toolbarAttrs, r);
123
- let t = (e == null ? void 0 : e.buttons) || this.$parent.buttons;
124
- return t = t || [], t.includes("reload") || (t = [...t, "reload"]), e.buttons = t, e.buttons = m(e.buttons), e.searchable = !!((l = (s = this.$scopedSlots)["search-form"]) != null && l.call(s)), e;
120
+ const t = {}, e = a({}, this.toolbarAttrs, t);
121
+ let r = (e == null ? void 0 : e.buttons) || this.$parent.buttons;
122
+ return r = r || [], e.buttons = r, e.buttons = f.privilege.processButtons(e.buttons), e.buttons = g(e.buttons), e.searchable = !!((l = (s = this.$scopedSlots)["search-form"]) != null && l.call(s)), e;
125
123
  },
126
124
  treeProps() {
127
- const r = {
125
+ const t = {
128
126
  treeProps: {
129
127
  children: "children",
130
128
  label: "label",
@@ -134,26 +132,45 @@ const P = [
134
132
  lazy: !0,
135
133
  readonly: !0,
136
134
  data: [],
137
- "expand-first-node": !1,
138
- "default-expand-all": !1
135
+ expandFirstNode: !0,
136
+ defaultExpandAll: !1
139
137
  };
140
- return n(this.treeAttrs, r);
138
+ return n(a({}, this.treeAttrs, t));
141
139
  },
142
140
  tableProps() {
143
- const r = this.tableAttrs.api || this.$parent.getPage, e = {
141
+ const t = this.tableAttrs.api || this.$parent.getPage, e = {
144
142
  model: this.searchModel || {},
145
143
  height: "auto",
146
- "highlight-current-row": !0,
147
- api: r
144
+ highlightCurrentRow: !0,
145
+ api: t
148
146
  };
149
- return n(this.tableAttrs, e);
147
+ return n(a({}, this.tableAttrs, e));
150
148
  },
151
149
  searchPanelProps() {
152
- const r = {
150
+ const t = {
153
151
  width: 350,
154
152
  model: this.searchModel || {}
155
153
  };
156
- return n(this.searchPanelAttrs, r);
154
+ return n(a({}, this.searchPanelAttrs, t));
155
+ },
156
+ toolbarEventHandlers() {
157
+ if (this.toolbarListeners) {
158
+ const { exp: t, ...e } = this.toolbarListeners;
159
+ return e;
160
+ }
161
+ return null;
162
+ },
163
+ tableScopeSlotNames() {
164
+ var t, e;
165
+ return ((e = (t = this.tableAttrs) == null ? void 0 : t.columns) == null ? void 0 : e.map((r) => r.prop).filter((r) => this.$scopedSlots[r])) ?? [];
166
+ }
167
+ },
168
+ watch: {
169
+ expandSearch: {
170
+ immediate: !0,
171
+ handler(t) {
172
+ this.isSearchVisible = t;
173
+ }
157
174
  }
158
175
  },
159
176
  created() {
@@ -163,120 +180,148 @@ const P = [
163
180
  this.$refs.treeScroller && (this.treeScrollTop && (this.$refs.treeScroller.scrollTop = this.treeScrollTop), this.treeScrollLeft && (this.$refs.treeScroller.scrollLeft = this.treeScrollLeft));
164
181
  },
165
182
  methods: {
183
+ toHyphenateKey: n,
166
184
  onTreeScroll() {
167
185
  this.treeScrollTop = this.$refs.treeScroller.scrollTop, this.treeScrollLeft = this.$refs.treeScroller.scrollLeft;
168
186
  },
169
187
  toggleSearch() {
170
- this.right = this.right === 0 ? -this.searchPanelProps.width : 0;
188
+ this.isSearchVisible = !this.isSearchVisible;
171
189
  },
172
- onSearchClick() {
173
- return a(this, null, function* () {
174
- this.$refs.table.setModel(this.searchModel || this.searchPanelProps.model), yield this.refreshTable();
175
- });
190
+ async onSearchClick() {
191
+ await this.reloadTable();
176
192
  },
177
- onClearClick() {
178
- return a(this, null, function* () {
179
- this.$emit("reset"), this.$refs.form.resetFields(), this.$refs.table.setModel(this.searchModel || this.searchPanelProps.model), yield this.refreshTable();
180
- });
193
+ async onClearClick() {
194
+ this.$emit("reset"), this.$refs.form.resetFields(), await this.reloadTable();
181
195
  },
182
- openFrom(r) {
183
- this.$router.push(_(this.formPath, r));
196
+ openFrom(t) {
197
+ this.$router.push(v(this.formPath, t));
184
198
  },
185
- rowDbClick(r) {
199
+ rowDbClick(t) {
186
200
  var e;
187
- !((e = this.tableListeners) != null && e["row-dblclick"]) && this.formPath && this.openFrom(r);
201
+ !((e = this.tableListeners) != null && e["row-dblclick"]) && this.formPath && this.openFrom(t);
188
202
  },
189
- onSelectionChange(r) {
190
- this.selectedRows = r;
203
+ onSelectionChange(t) {
204
+ this.selectedRows = t;
191
205
  },
192
206
  create() {
193
- var r;
194
- !((r = this.toolbarListeners) != null && r.create) && this.formPath && this.openFrom();
207
+ var t;
208
+ !((t = this.toolbarListeners) != null && t.create) && this.formPath && this.openFrom();
195
209
  },
196
- del() {
197
- return a(this, null, function* () {
198
- var e;
199
- const r = this.deleteApi || this.$parent.del;
200
- if (!((e = this.toolbarListeners) != null && e.del) && u(r)) {
201
- if (!this.selectedRows.length) {
202
- this.$message.warning("请选择要删除的记录!");
203
- return;
204
- }
205
- yield this.$confirm(`您确定要删除选中的[<span class="break-word" style="color: orange">${this.selectedRows.length}</span>]行记录吗?`, "系统提示", {
210
+ async del() {
211
+ var e;
212
+ const t = this.deleteApi || this.$parent.del;
213
+ if (!((e = this.toolbarListeners) != null && e.del) && w(t)) {
214
+ if (!this.selectedRows.length) {
215
+ this.$message.warning(this.selectTips || "请选择要删除的记录!");
216
+ return;
217
+ }
218
+ await this.$confirm(
219
+ this.deleteTips || `您确定要删除选中的[<span class="break-word" style="color: orange">${this.selectedRows.length}</span>]行记录吗?`,
220
+ "系统提示",
221
+ {
206
222
  type: "warning",
207
223
  modal: !0,
208
224
  dangerouslyUseHTMLString: !0,
209
225
  closeOnClickModal: !1,
210
- beforeClose: (t, s, l) => a(this, null, function* () {
211
- if (t === "confirm")
226
+ beforeClose: async (r, s, l) => {
227
+ var o, c;
228
+ if (r === "confirm")
212
229
  try {
213
- s.confirmButtonLoading = !0, s.confirmButtonText = "删除...", yield r.call(this, this.selectedRows.map((o) => o.id).join(",")), this.$message.success("删除成功"), yield this.reloadTable(), yield this.refreshTree();
214
- } catch (o) {
230
+ s.confirmButtonLoading = !0, s.confirmButtonText = "删除...";
231
+ const h = await t.call(
232
+ this,
233
+ this.selectedRows.map((m) => m[this.rowKey])
234
+ );
235
+ this.$message.success(h.data.msg || "删除成功"), this.reloadTableAndTree(), (c = (o = f.tableView) == null ? void 0 : o.reload) == null || c.call(o);
236
+ } catch {
215
237
  }
216
238
  l();
217
- })
218
- }).catch((t) => t);
219
- }
220
- });
239
+ }
240
+ }
241
+ ).catch((r) => r);
242
+ }
221
243
  },
222
244
  reloadTable() {
223
- var r;
224
- (r = this.$refs.table) == null || r.reload();
245
+ var t;
246
+ (t = this.$refs.table) == null || t.reload();
247
+ },
248
+ async refreshTable(t) {
249
+ var e;
250
+ await ((e = this.$refs.table) == null ? void 0 : e.getPage(t));
225
251
  },
226
- refreshTable() {
227
- return a(this, null, function* () {
228
- var r;
229
- yield (r = this.$refs.table) == null ? void 0 : r.getPage();
230
- });
252
+ reloadTree() {
253
+ var t;
254
+ (t = this.$refs.tree) == null || t.reloadTree();
231
255
  },
232
- refreshTree() {
233
- this.$refs.tree.reloadTree();
256
+ reloadTableAndTree() {
257
+ this.reloadTable(), this.reloadTree();
234
258
  },
235
- getSearchModel() {
236
- return this.searchPanelProps.model;
259
+ currentRow() {
260
+ return this.$refs.table.currentRow;
261
+ },
262
+ getPageQuery() {
263
+ return this.$refs.table.getPageQuery();
264
+ },
265
+ exp() {
266
+ var t, e;
267
+ (e = (t = this.toolbarListeners).exp) == null || e.call(t, this.selectedRows);
268
+ },
269
+ getTableColumns() {
270
+ return this.$refs.table.tableColumns;
237
271
  }
238
272
  }
239
273
  };
240
- var S = function() {
241
- var e = this, t = e._self._c;
242
- return t("div", { staticClass: "table-view" }, [t("Toolbar", e._g(e._b({ on: { search: e.toggleSearch, del: e.del, create: e.create, reload: e.reloadTable, imp: function(s) {
274
+ var C = function() {
275
+ var e = this, r = e._self._c;
276
+ return r("div", { class: ["table-view", { embed: e.embed, "has-tree": e.treeProps.show }] }, [r("div", { staticClass: "table-view-wrapper" }, [e.searchFormPosition === "top" ? [r("ElCollapseTransition", [e.toolbarProps.searchable ? r("div", { directives: [{ name: "show", rawName: "v-show", value: e.isSearchVisible, expression: "isSearchVisible" }], staticClass: "search-form-top" }, [r("ElForm", { ref: "form", attrs: { "label-position": "right", model: e.searchModel || e.searchPanelProps.model, size: "mini", "label-width": e.labelWidth }, nativeOn: { "!submit": function(s) {
277
+ return s.preventDefault(), e.onSearchClick.apply(null, arguments);
278
+ } } }, [r("FormItemConfigProvider", { attrs: { reactive: "" } }, [r("ElRow", { attrs: { gutter: 0 } }, [e._t("search-form", function() {
279
+ return [r("p", [e._v("请添加搜索条件!")])];
280
+ }), r("FormItem", { staticClass: "search-actions", attrs: { "hide-label": "" } }, [r("ElButton", { attrs: { type: "primary", "native-type": "submit", size: "mini" } }, [e._v("开始搜索")]), r("ElButton", { staticStyle: { "margin-left": "10px" }, attrs: { size: "mini" }, on: { click: e.onClearClick } }, [e._v("清除条件")])], 1)], 2)], 1)], 1)], 1) : e._e()])] : e._e(), e.showToolbar ? r("Toolbar", e._g(e._b({ attrs: { refreshable: "" }, on: { search: e.toggleSearch, settings: () => e.$refs.table.toggleSettings(), del: e.del, create: e.create, reload: e.reloadTableAndTree, exp: e.exp, imp: function(s) {
243
281
  e.importDialogVisible = !0;
244
282
  } }, scopedSlots: e._u([{ key: "default", fn: function() {
245
- return [e._t("toolbar-button")];
283
+ return [e._t("toolbar-button", null, { selectedRows: e.selectedRows })];
284
+ }, proxy: !0 }, { key: "toolbar-left", fn: function() {
285
+ return [e._t("toolbar-left", null, { selectedRows: e.selectedRows })];
286
+ }, proxy: !0 }, { key: "toolbar-right", fn: function() {
287
+ return [e._t("toolbar-right", null, { del: e.del, create: e.create, reload: e.reloadTableAndTree, selectedRows: e.selectedRows })];
288
+ }, proxy: !0 }, { key: "toolbar-right-button", fn: function() {
289
+ return [e._t("toolbar-right-button")];
246
290
  }, proxy: !0 }, e._l(e.buttonSlots, function(s) {
247
291
  return { key: s, fn: function() {
248
- return [e._t(s)];
292
+ return [e._t(s, null, { selectedRows: e.selectedRows })];
249
293
  }, proxy: !0 };
250
- })], null, !0) }, "Toolbar", e.toolbarProps, !1), e.toolbarListeners)), t("div", { staticClass: "table-view-content-wrapper" }, [t("div", { staticClass: "table-view-content" }, [e.treeProps.show ? t("div", { ref: "treeScroller", staticClass: "table-view-sidebar", on: { scroll: e.onTreeScroll } }, [t("div", { staticStyle: { "font-size": "16px" } }, [e._v("视图导航")]), t("EditableTree", e._g(e._b({ ref: "tree", attrs: { readonly: "" }, scopedSlots: e._u([{ key: "default", fn: function({ node: s, data: l }) {
294
+ })], null, !0) }, "Toolbar", e.toolbarProps, !1), e.toolbarEventHandlers)) : e._e(), r("div", { staticClass: "table-view-content-wrapper" }, [r("div", { staticClass: "table-view-content" }, [e.treeProps.show ? r("div", { ref: "treeScroller", staticClass: "table-view-sidebar", on: { scroll: e.onTreeScroll } }, [r("EditableTree", e._g(e._b({ ref: "tree", attrs: { readonly: "" }, scopedSlots: e._u([{ key: "default", fn: function({ node: s, data: l }) {
251
295
  return [e._t("tree-node", function() {
252
- return [t("span", [t("i", { staticClass: "node-icon", class: s.childNodes.length > 0 ? s.expanded ? "el-icon-folder-opened" : "el-icon-folder" : "el-icon-tickets" }), e._t("tree-label", function() {
296
+ return [r("span", [r("i", { staticClass: "node-icon", class: s.childNodes.length > 0 ? s.expanded ? "el-icon-folder-opened" : "el-icon-folder" : "el-icon-tickets" }), e._t("tree-label", function() {
253
297
  return [e._v(e._s(s.label))];
254
298
  }, { node: s, data: l })], 2)];
255
299
  }, { node: s, data: l })];
256
- } }], null, !0) }, "EditableTree", e.treeProps, !1), e.treeListeners))], 1) : e._e(), t("div", { staticClass: "table-view-table" }, [t("PageableTable", e._g(e._b({ ref: "table", class: [
300
+ } }], null, !0) }, "EditableTree", e.treeProps, !1), e.toHyphenateKey(e.treeListeners)))], 1) : e._e(), r("div", { staticClass: "table-view-table" }, [r("PageableTable", e._g(e._b({ ref: "table", class: [
257
301
  {
258
302
  "border-top": e.borderTop,
259
303
  "border-bottom": e.borderBottom,
260
304
  "border-left": e.borderLeft || e.treeAttrs && e.treeAttrs.show,
261
305
  "border-right": e.borderRight
262
306
  }
263
- ], attrs: { border: e.border }, on: { "row-dblclick": e.rowDbClick, "selection-change": e.onSelectionChange } }, "PageableTable", e.tableProps, !1), e.tableListeners), [e._t("columns")], 2)], 1)]), e.toolbarProps.searchable ? t("div", { staticClass: "slide-panel", style: { right: `${e.right}px`, width: `${e.searchPanelProps.width}px` } }, [e._m(0), t("div", { staticClass: "slide-panel-content" }, [t("ElForm", { ref: "form", attrs: { "label-position": "right", model: e.searchModel || e.searchPanelProps.model, size: "mini", "label-width": e.labelWidth }, nativeOn: { "!submit": function(s) {
307
+ ], attrs: { border: e.border }, on: { "row-dblclick": e.rowDbClick, "selection-change": e.onSelectionChange }, scopedSlots: e._u([e._l(e.tableScopeSlotNames, function(s) {
308
+ return { key: s, fn: function({ row: l }) {
309
+ return [e._t(s, null, { row: l })];
310
+ } };
311
+ })], null, !0) }, "PageableTable", e.tableProps, !1), e.toHyphenateKey(e.tableListeners)), [e._t("columns")], 2)], 1)]), e.searchFormPosition === "right" ? [r("Transition", { attrs: { name: "slide" } }, [e.toolbarProps.searchable ? r("div", { directives: [{ name: "show", rawName: "v-show", value: e.isSearchVisible, expression: "isSearchVisible" }], staticClass: "slide-panel", style: { width: `${e.searchPanelProps.width}px` } }, [r("div", { staticClass: "slide-panel-content" }, [r("ElForm", { ref: "form", attrs: { "label-position": "right", model: e.searchModel || e.searchPanelProps.model, size: "mini", "label-width": e.labelWidth }, nativeOn: { "!submit": function(s) {
264
312
  return s.preventDefault(), e.onSearchClick.apply(null, arguments);
265
- } } }, [t("FormItemConfigProvider", { attrs: { block: "", "wrap-col": !1 } }, [t("ElRow", { attrs: { gutter: 0 } }, [e._t("search-form", function() {
266
- return [t("p", [e._v("请添加搜索条件!")])];
267
- })], 2)], 1), t("ElFormItem", { attrs: { "label-width": "0" } }, [t("div", { staticClass: "slide-panel-actions" }, [t("ElButton", { attrs: { type: "primary", "native-type": "submit", size: "mini" } }, [e._v(" 开始搜索 ")]), t("ElButton", { attrs: { size: "mini" }, on: { click: e.onClearClick } }, [e._v(" 清除条件 ")])], 1)])], 1)], 1)]) : e._e()]), e._t("default")], 2);
268
- }, T = [function() {
269
- var r = this, e = r._self._c;
270
- return e("div", { staticClass: "slide-panel-line" }, [e("div", { staticClass: "slide-panel-line-indicator" })]);
271
- }], $ = /* @__PURE__ */ v(
272
- y,
273
- S,
274
- T,
313
+ } } }, [r("FormItemConfigProvider", { attrs: { block: "", "wrap-col": !1 } }, [r("ElRow", { attrs: { gutter: 0 } }, [e._t("search-form", function() {
314
+ return [r("p", [e._v("请添加搜索条件!")])];
315
+ })], 2)], 1), r("ElFormItem", { attrs: { "label-width": "0" } }, [r("div", { staticClass: "slide-panel-actions" }, [r("ElButton", { attrs: { type: "primary", "native-type": "submit", size: "mini" } }, [e._v("开始搜索")]), r("ElButton", { attrs: { size: "mini" }, on: { click: e.onClearClick } }, [e._v("清除条件")])], 1)])], 1)], 1)]) : e._e()])] : e._e()], 2), e._t("default")], 2)]);
316
+ }, $ = [], k = /* @__PURE__ */ S(
317
+ P,
318
+ C,
319
+ $,
275
320
  !1,
276
321
  null,
277
322
  null
278
323
  );
279
- const B = $.exports;
324
+ const E = k.exports;
280
325
  export {
281
- B as default
326
+ E as default
282
327
  };
@@ -1 +1 @@
1
- .table-view{flex-direction:column;height:100%;display:flex}.table-view .el-table--border{border:none}.table-view .border-top .el-table--border{border-top:1px solid #ebeef5}.table-view .border-bottom .el-table--border{border-bottom:1px solid #ebeef5}.table-view .border-left .el-table--border,.table-view .border-left .el-pagination{border-left:1px solid #ebeef5}.table-view .border-right .el-table--border{border-right:1px solid #ebeef5}.table-view .table-view-content-wrapper{flex:1;position:relative;overflow:hidden}.table-view .table-view-content{background-color:#fff;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.table-view .table-view-sidebar{flex-shrink:0;width:240px;height:100%;padding:10px;overflow:auto}.table-view .table-view-sidebar .et-tree-wrapper{display:table;overflow:visible}.table-view .table-view-table{flex:auto;height:100%}.table-view .slide-panel{z-index:5;background-color:#fff;transition:right .2s;display:flex;position:absolute;top:0;bottom:0;right:0}.table-view .slide-panel .slide-panel-line{background-color:#ddd;flex-shrink:0;width:3px;height:100%;position:relative}.table-view .slide-panel .slide-panel-line-indicator{background-color:#aaa;width:100%;height:50px;position:absolute;top:50%;left:0;transform:translateY(-50%)}.table-view .slide-panel .slide-panel-actions{justify-content:center;align-items:center;margin-top:10px;display:flex}.table-view .slide-panel .slide-panel-content{flex:1;padding:10px;overflow:auto}.table-view .slide-panel .slide-panel-content .el-date-editor{width:100%}
1
+ .table-view{flex-direction:column;height:100%;padding:10px;display:flex}.table-view.has-tree .table-view-wrapper .pageable-table-wrapper,.table-view.embed{padding:0}.table-view.embed .toolbar{border:1px solid #ebeef5;border-bottom:none}.table-view.embed .table-view-wrapper{box-shadow:none;border-radius:0}.table-view.embed .table-view-wrapper .pageable-table-wrapper{padding:0}.table-view .toolbar{border-bottom:none;height:46px;line-height:46px}.table-view .table-view-wrapper{border-radius:4px;flex-direction:column;height:100%;display:flex;overflow:hidden;box-shadow:0 2px 12px #0000001a}.table-view .table-view-wrapper .pageable-table-wrapper{padding-left:10px;padding-right:10px}.table-view .table-view-wrapper .el-pagination{color:#303133;white-space:nowrap;text-align:left;padding:6px 10px;font-weight:700}.table-view .border-top .el-table--border{border-top:1px solid #ebeef5}.table-view .border-bottom .el-table--border{border-bottom:1px solid #ebeef5}.table-view .border-left .el-table--border,.table-view .border-left .el-pagination{border-left:1px solid #ebeef5}.table-view .border-right .el-table--border{border-right:1px solid #ebeef5}.table-view .node-icon{margin-right:4px}.table-view .table-view-content-wrapper{flex:1;position:relative;overflow:hidden}.table-view .table-view-content{background-color:#fff;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.table-view .table-view-sidebar{background-color:#fafafa;border-top:1px solid #ebeef5;flex-shrink:0;width:240px;height:100%;padding:4px 10px 10px 4px;overflow:auto}.table-view .table-view-sidebar .et-tree-wrapper{display:table;overflow:visible}.table-view .table-view-sidebar .et-tree-wrapper .el-tree{background-color:#0000}.table-view .table-view-table{flex:auto;height:100%}.table-view .search-form-top{background-color:#fff;padding:10px 10px 0}.table-view .search-form-top .el-form-item__content{align-items:center;display:flex}.table-view .search-actions{float:right}.table-view .search-actions .el-form-item__content{text-align:right;justify-content:right}.table-view .slide-panel{z-index:5;background-color:#fff;display:flex;position:absolute;top:0;bottom:0;right:0;box-shadow:0 0 10px 5px #0000001a}.table-view .slide-panel .slide-panel-line{background-color:#ddd;flex-shrink:0;width:3px;height:100%;position:relative}.table-view .slide-panel .slide-panel-line-indicator{background-color:#aaa;width:100%;height:50px;position:absolute;top:50%;left:0;transform:translateY(-50%)}.table-view .slide-panel .slide-panel-actions{justify-content:center;align-items:center;margin-top:10px;display:flex}.table-view .slide-panel .slide-panel-content{flex:1;padding:10px;overflow:auto}.table-view .slide-panel .slide-panel-content .el-date-editor{width:100%}