@dazhicheng/ui 1.6.50 → 1.6.52

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 (32) hide show
  1. package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.d.ts +36 -25
  2. package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.js +54 -296
  3. package/dist/components/tt-custom-export-panel/index.d.ts +8 -0
  4. package/dist/components/tt-custom-export-panel/index.js +21 -0
  5. package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue.d.ts +19 -0
  6. package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue.js +289 -0
  7. package/dist/components/tt-custom-export-panel/src/TtCustomExportPanel.vue2.js +4 -0
  8. package/dist/components/tt-custom-export-panel/src/types/index.d.ts +6 -0
  9. package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.d.ts +2 -2
  10. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +1 -0
  11. package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +8 -7
  12. package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +1 -1
  13. package/dist/components/tt-panel-select/src/index.vue.d.ts +3 -0
  14. package/dist/components/tt-panel-select/src/index.vue.js +17 -14
  15. package/dist/components/tt-panel-select/src/types.d.ts +4 -0
  16. package/dist/components/tt-table/index.d.ts +27 -0
  17. package/dist/components/tt-table/index.js +8 -5
  18. package/dist/components/tt-table/src/Table.vue.d.ts +9 -0
  19. package/dist/components/tt-table/src/TableForm.vue.d.ts +74 -90
  20. package/dist/components/tt-table/src/TableForm.vue.js +179 -175
  21. package/dist/components/tt-table/src/components/TableAction.vue.js +3 -2
  22. package/dist/components/tt-table/src/components/TableExportButton.vue.d.ts +12 -0
  23. package/dist/components/tt-table/src/components/TableExportButton.vue.js +44 -0
  24. package/dist/components/tt-table/src/components/TableExportButton.vue2.js +4 -0
  25. package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +36 -42
  26. package/dist/components/tt-table/src/props.d.ts +6 -0
  27. package/dist/components/tt-table/src/props.js +5 -0
  28. package/dist/components/tt-table/src/types/table.d.ts +2 -0
  29. package/dist/index.d.ts +1 -0
  30. package/dist/index.js +111 -107
  31. package/dist/style.css +1 -1
  32. package/package.json +1 -1
@@ -0,0 +1,289 @@
1
+ import { defineComponent as te, shallowRef as w, ref as T, computed as c, toValue as le, watch as ae, onBeforeUnmount as se, createElementBlock as _, openBlock as k, withDirectives as ie, createVNode as F, unref as oe } from "vue";
2
+ import "axios";
3
+ import { vLoading as ne, ElMessage as m, ElMessageBox as de } from "element-plus";
4
+ import { isString as re } from "../../../packages/utils/src/is.js";
5
+ import "dayjs";
6
+ import "numeral";
7
+ import "xe-utils";
8
+ import "dayjs/plugin/utc";
9
+ import "dayjs/plugin/timezone";
10
+ import { subtract as M, add as ue } from "../../../packages/utils/src/calc.js";
11
+ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
12
+ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
13
+ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
+ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
+ import "lodash-es";
16
+ import { setDefaultTemplatesExportApi as ce, deleteTemplatesExportApi as fe, saveTemplatesExportApi as ve, listTemplatesExportApi as pe, fieldsTemplatesExportApi as me } from "../../tt-custom-export-modal/src/api.js";
17
+ import Ce from "../../tt-custom-export-modal/src/components/FieldGridSection.vue.js";
18
+ import Se from "../../tt-custom-export-modal/src/components/FieldToolbarSection.vue.js";
19
+ import he from "../../tt-custom-export-modal/src/components/TemplateManagerSection.vue.js";
20
+ const we = { class: "TtCustomExportPanel flex min-w-0 flex-col gap-3" }, $e = /* @__PURE__ */ te({
21
+ name: "TtCustomExportPanel",
22
+ __name: "TtCustomExportPanel",
23
+ props: {
24
+ defaultSelectedCodes: {},
25
+ businessCode: { default: "BUSINESS_SALES_REPORT" },
26
+ availableFields: {},
27
+ listColumns: { default: () => [] },
28
+ fetchFieldsApi: {},
29
+ fetchTemplatesApi: {},
30
+ saveTemplateApi: {},
31
+ deleteTemplateApi: {},
32
+ setDefaultTemplateApi: {}
33
+ },
34
+ emits: ["templateChange"],
35
+ setup(P, { expose: R, emit: U }) {
36
+ const i = P, b = U;
37
+ let a = Symbol();
38
+ const N = w(a), A = w(Promise.resolve()), v = T(!1), C = T(!1), o = w([]), u = w([]), f = T(void 0), g = T(""), n = w(/* @__PURE__ */ new Set()), $ = c(() => new Map(o.value.map((e) => [e.fieldCode, e]))), p = c(() => [...n.value].map((e) => $.value.get(e)).filter((e) => !!e)), d = c(() => i.businessCode), V = c(() => o.value.length), z = c(() => p.value.length), x = (e = le(i.listColumns)) => (e ?? []).flatMap((t) => {
39
+ var l;
40
+ return re(t) ? [t] : t.visible === !1 ? [] : (l = t.children) != null && l.length ? x(t.children) : t.field ? [t.field] : [];
41
+ }), G = c(() => x()), S = c(() => {
42
+ const e = g.value.trim().toLowerCase();
43
+ return e ? o.value.filter((t) => {
44
+ const l = (t.fieldName ?? "").toLowerCase().includes(e), s = (t.fieldCode ?? "").toLowerCase().includes(e);
45
+ return l || s;
46
+ }) : o.value;
47
+ }), B = c(() => S.value.length === 0 ? !1 : S.value.every((e) => n.value.has(e.fieldCode || ""))), D = () => {
48
+ const e = u.value.find((t) => t.defaultTemplate);
49
+ if (f.value = e == null ? void 0 : e.id, e && e.fields && e.fields.length > 0) {
50
+ const t = /* @__PURE__ */ new Set();
51
+ [...e.fields].sort((l, s) => M(l.sortNo ?? 0, s.sortNo ?? 0)).forEach((l) => {
52
+ l.fieldCode && t.add(l.fieldCode);
53
+ }), o.value.forEach((l) => {
54
+ l.requiredSelected && l.fieldCode && t.add(l.fieldCode);
55
+ }), n.value = t;
56
+ }
57
+ }, I = async (e) => {
58
+ const t = i.availableFields;
59
+ if (t && t.length > 0) {
60
+ o.value = [...t], E();
61
+ return;
62
+ }
63
+ if (i.fetchFieldsApi) {
64
+ try {
65
+ const l = await i.fetchFieldsApi({ businessCode: d.value });
66
+ if (e !== a) return;
67
+ o.value = l ?? [];
68
+ } catch {
69
+ if (e !== a) return;
70
+ o.value = [];
71
+ }
72
+ E();
73
+ return;
74
+ }
75
+ if (d.value) {
76
+ try {
77
+ const l = await me({
78
+ businessCode: d.value
79
+ });
80
+ if (e !== a) return;
81
+ o.value = l ?? [];
82
+ } catch {
83
+ if (e !== a) return;
84
+ o.value = [];
85
+ }
86
+ E();
87
+ }
88
+ }, y = async (e) => {
89
+ if (e === a) {
90
+ if (i.fetchTemplatesApi) {
91
+ try {
92
+ const t = await i.fetchTemplatesApi({ businessCode: d.value });
93
+ if (e !== a) return;
94
+ u.value = t ?? [];
95
+ } catch {
96
+ if (e !== a) return;
97
+ u.value = [];
98
+ }
99
+ D();
100
+ return;
101
+ }
102
+ if (d.value) {
103
+ try {
104
+ const t = await pe({
105
+ businessCode: d.value
106
+ });
107
+ if (e !== a) return;
108
+ u.value = t ?? [];
109
+ } catch {
110
+ if (e !== a) return;
111
+ u.value = [];
112
+ }
113
+ D();
114
+ }
115
+ }
116
+ }, E = () => {
117
+ const e = /* @__PURE__ */ new Set();
118
+ o.value.forEach((t) => {
119
+ (t.requiredSelected || t.defaultSelected) && t.fieldCode && e.add(t.fieldCode);
120
+ }), n.value = e;
121
+ }, L = (e) => {
122
+ if (f.value = e, !e) {
123
+ b("templateChange", void 0);
124
+ return;
125
+ }
126
+ const t = u.value.find((l) => l.id === e);
127
+ if (b("templateChange", t), t && t.fields && t.fields.length > 0) {
128
+ const l = /* @__PURE__ */ new Set();
129
+ [...t.fields].sort((s, h) => M(s.sortNo ?? 0, h.sortNo ?? 0)).forEach((s) => {
130
+ s.fieldCode && l.add(s.fieldCode);
131
+ }), o.value.forEach((s) => {
132
+ s.requiredSelected && s.fieldCode && l.add(s.fieldCode);
133
+ }), n.value = l;
134
+ }
135
+ }, K = async (e) => {
136
+ if (!d.value || !a) return;
137
+ const t = a;
138
+ try {
139
+ if (i.setDefaultTemplateApi ? await i.setDefaultTemplateApi({
140
+ businessCode: d.value,
141
+ templateId: e
142
+ }) : await ce({
143
+ businessCode: d.value,
144
+ templateId: e
145
+ }), t !== a) return;
146
+ m.success("已设为默认模板"), await y(t);
147
+ } catch {
148
+ }
149
+ }, O = async (e, t) => {
150
+ if (!d.value || !a) return;
151
+ const l = a;
152
+ try {
153
+ if (await de.confirm(`确定要删除导出模板「${t}」吗?`, "删除确认", {
154
+ type: "warning",
155
+ confirmButtonText: "确定删除",
156
+ cancelButtonText: "取消"
157
+ }), l !== a || (i.deleteTemplateApi ? await i.deleteTemplateApi({
158
+ businessCode: d.value,
159
+ templateId: e
160
+ }) : await fe({
161
+ businessCode: d.value,
162
+ templateId: e
163
+ }), l !== a)) return;
164
+ m.success("模板删除成功"), f.value = void 0, await y(l);
165
+ } catch {
166
+ }
167
+ }, j = async (e) => {
168
+ if (v.value || C.value || !a) return;
169
+ if (p.value.length === 0) {
170
+ m.warning("请至少勾选一个导出字段后再保存模板");
171
+ return;
172
+ }
173
+ const t = a;
174
+ try {
175
+ C.value = !0;
176
+ const l = p.value.map((r, ee) => ({
177
+ fieldId: r.id,
178
+ customColumnName: r.fieldName,
179
+ sortNo: ue(ee, 1)
180
+ })), s = {
181
+ businessCode: d.value,
182
+ templateName: e,
183
+ fields: l
184
+ };
185
+ if (i.saveTemplateApi ? await i.saveTemplateApi(s) : await ve(s), t !== a || (m.success(`模板「${e}」保存成功`), await y(t), t !== a)) return;
186
+ const h = u.value.find((r) => r.templateName === e);
187
+ h && L(h.id);
188
+ } catch {
189
+ } finally {
190
+ t === a && (C.value = !1);
191
+ }
192
+ }, H = (e) => {
193
+ if (e.requiredSelected || !e.fieldCode) return;
194
+ const t = new Set(n.value);
195
+ t.has(e.fieldCode) ? t.delete(e.fieldCode) : t.add(e.fieldCode), n.value = t;
196
+ }, J = () => {
197
+ const e = new Set(n.value);
198
+ B.value ? S.value.forEach((t) => {
199
+ !t.requiredSelected && t.fieldCode && e.delete(t.fieldCode);
200
+ }) : S.value.forEach((t) => {
201
+ t.fieldCode && e.add(t.fieldCode);
202
+ }), n.value = e;
203
+ }, Q = () => {
204
+ const e = x();
205
+ if (e.length === 0) return;
206
+ const t = new Set(e), l = /* @__PURE__ */ new Set();
207
+ o.value.forEach((s) => {
208
+ s.fieldCode && (s.requiredSelected || t.has(s.fieldCode)) && l.add(s.fieldCode);
209
+ }), n.value = l, m.success("已同步表格当前展示列");
210
+ }, W = () => {
211
+ const e = /* @__PURE__ */ new Set();
212
+ o.value.forEach((t) => {
213
+ t.requiredSelected && t.fieldCode && e.add(t.fieldCode);
214
+ }), n.value = e;
215
+ }, X = () => {
216
+ if (v.value || !a) return;
217
+ if (p.value.length === 0) {
218
+ m.warning("请至少勾选一个导出字段");
219
+ return;
220
+ }
221
+ const e = p.value, t = e.map((r) => r.fieldCode || "").filter(Boolean), l = e.map((r) => r.fieldName || r.fieldCode || "").filter(Boolean), s = u.value.find((r) => r.id === f.value);
222
+ return {
223
+ businessCode: d.value,
224
+ selectedFields: e,
225
+ selectedFieldCodes: t,
226
+ selectedFieldNames: l,
227
+ templateName: s == null ? void 0 : s.templateName,
228
+ templateId: s == null ? void 0 : s.id
229
+ };
230
+ }, Y = async () => {
231
+ const e = Symbol();
232
+ a = e, o.value = [], u.value = [], n.value = /* @__PURE__ */ new Set(), N.value = e, f.value = void 0, g.value = "", C.value = !1, v.value = !0;
233
+ try {
234
+ if (await I(e), e !== a || (await y(e), e !== a)) return;
235
+ if (i.defaultSelectedCodes && i.defaultSelectedCodes.length > 0) {
236
+ const t = new Set(i.defaultSelectedCodes);
237
+ o.value.forEach((l) => {
238
+ l.requiredSelected && l.fieldCode && t.add(l.fieldCode);
239
+ }), n.value = t;
240
+ }
241
+ } finally {
242
+ e === a && (v.value = !1);
243
+ }
244
+ }, q = () => (A.value = Y(), A.value), Z = () => {
245
+ a = void 0;
246
+ };
247
+ return ae(() => i.businessCode, q, { immediate: !0 }), se(Z), R({ reload: q, ready: A, confirm: X, isLoading: v, fieldCount: V, selectedCount: z }), (e, t) => (k(), _("section", we, [
248
+ ie((k(), _("div", {
249
+ key: N.value,
250
+ class: "flex flex-col gap-3 py-1"
251
+ }, [
252
+ F(he, {
253
+ "selected-template-id": f.value,
254
+ "onUpdate:selectedTemplateId": t[0] || (t[0] = (l) => f.value = l),
255
+ "template-list": u.value,
256
+ "is-saving": C.value,
257
+ onSelectTemplate: L,
258
+ onSetDefault: K,
259
+ onDelete: O,
260
+ onSave: j
261
+ }, null, 8, ["selected-template-id", "template-list", "is-saving"]),
262
+ F(Se, {
263
+ keyword: g.value,
264
+ "onUpdate:keyword": t[1] || (t[1] = (l) => g.value = l),
265
+ "is-all-selected": B.value,
266
+ "has-list-columns": G.value.length > 0,
267
+ onToggleSelectAll: J,
268
+ onSelectByListColumns: Q,
269
+ onClearAll: W
270
+ }, null, 8, ["keyword", "is-all-selected", "has-list-columns"]),
271
+ F(Ce, {
272
+ "filtered-fields": S.value,
273
+ "total-field-count": o.value.length,
274
+ "selected-code-set": n.value,
275
+ "selected-fields": p.value,
276
+ onReorder: t[2] || (t[2] = (l) => {
277
+ n.value = new Set(l);
278
+ }),
279
+ onToggleField: H
280
+ }, null, 8, ["filtered-fields", "total-field-count", "selected-code-set", "selected-fields"])
281
+ ])), [
282
+ [oe(ne), v.value]
283
+ ])
284
+ ]));
285
+ }
286
+ });
287
+ export {
288
+ $e as default
289
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TtCustomExportPanel.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,6 @@
1
+ import { TtCustomExportModalProps } from '../../../tt-custom-export-modal/src/types';
2
+ /** 内嵌导出面板配置;字段、模板接口及列来源与弹框共用。 */
3
+ export interface TtCustomExportPanelProps extends Omit<TtCustomExportModalProps, "title"> {
4
+ /** 初始化时最后应用的非空预选编码;按传入顺序排列,并补齐必选字段。 */
5
+ defaultSelectedCodes?: string[];
6
+ }
@@ -6,10 +6,10 @@ export declare const FormArrayRegister: import('vue').DefineComponent<{
6
6
  hide?: boolean | undefined;
7
7
  rules?: import('../../types').FormSchemaRuleType | undefined;
8
8
  defaultValue?: any;
9
- fieldName: string;
10
9
  wrapperClass?: string | undefined;
11
10
  arraySchema?: FormSchema<Record<string, any>>[] | ((entry: FieldEntry<Recordable>, currentIndex: number, ctx: ArraySchemaContext) => FormSchema<Record<string, any>>[]) | undefined;
12
11
  dependencies?: import('./types').ArrayRegisterDependencies<Record<string, any>> | undefined;
12
+ fieldName: string;
13
13
  formItemClass?: (() => string) | string | undefined;
14
14
  virtual?: boolean | undefined;
15
15
  progressive?: boolean | undefined;
@@ -18,10 +18,10 @@ export declare const FormArrayRegister: import('vue').DefineComponent<{
18
18
  hide?: boolean | undefined;
19
19
  rules?: import('../../types').FormSchemaRuleType | undefined;
20
20
  defaultValue?: any;
21
- fieldName: string;
22
21
  wrapperClass?: string | undefined;
23
22
  arraySchema?: FormSchema<Record<string, any>>[] | ((entry: FieldEntry<Recordable>, currentIndex: number, ctx: ArraySchemaContext) => FormSchema<Record<string, any>>[]) | undefined;
24
23
  dependencies?: import('./types').ArrayRegisterDependencies<Record<string, any>> | undefined;
24
+ fieldName: string;
25
25
  formItemClass?: (() => string) | string | undefined;
26
26
  virtual?: boolean | undefined;
27
27
  progressive?: boolean | undefined;
@@ -20,6 +20,7 @@ declare const _default: import('vue').DefineComponent<PanelMiddleProps, {
20
20
  onOptionsCheck?: ((values: PanelSelectValue[], checked: boolean) => any) | undefined;
21
21
  }>, {
22
22
  disabled: boolean;
23
+ showMultiple: boolean;
23
24
  scrollToGroupValue: PanelSelectValue;
24
25
  pasteSearch: boolean;
25
26
  separator: import('../types').PanelSelectSeparator;
@@ -1,4 +1,4 @@
1
- import { defineComponent as se, useTemplateRef as z, ref as m, computed as h, watch as I, nextTick as K, createElementBlock as f, openBlock as s, normalizeClass as n, createElementVNode as k, createCommentVNode as O, createVNode as p, createBlock as M, unref as i, withCtx as d, createTextVNode as b, normalizeStyle as P, Fragment as H, renderList as V, toDisplayString as E } from "vue";
1
+ import { defineComponent as se, useTemplateRef as z, ref as m, computed as h, watch as M, nextTick as K, createElementBlock as f, openBlock as s, normalizeClass as n, createElementVNode as k, createCommentVNode as O, createVNode as p, createBlock as I, unref as i, withCtx as d, createTextVNode as b, normalizeStyle as P, Fragment as H, renderList as V, toDisplayString as E } from "vue";
2
2
  import { TtButton as ne } from "../../../tt-button/index.js";
3
3
  import { TtText as S } from "../../../tt-text/index.js";
4
4
  import { Search as ie } from "@element-plus/icons-vue";
@@ -12,6 +12,7 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
12
12
  disabled: { type: Boolean, default: !1 },
13
13
  prefixCls: {},
14
14
  multiple: { type: Boolean },
15
+ showMultiple: { type: Boolean, default: !0 },
15
16
  keyword: {},
16
17
  rows: {},
17
18
  optionPerRow: {},
@@ -38,7 +39,7 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
38
39
  }), te = h(
39
40
  () => t.rows.filter((e) => e.type === "options").flatMap((e) => e.options).filter((e) => !e.disabled)
40
41
  );
41
- I(
42
+ M(
42
43
  () => t.keyword,
43
44
  (e) => {
44
45
  w.value = e;
@@ -113,13 +114,13 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
113
114
  function re(e) {
114
115
  w.value = e, !R.value && v("update:keyword", e);
115
116
  }
116
- return I(
117
+ return M(
117
118
  () => t.scrollToGroupValue,
118
119
  async (e) => {
119
120
  e !== void 0 && await N(e);
120
121
  },
121
122
  { flush: "post" }
122
- ), I(
123
+ ), M(
123
124
  () => t.rows.length,
124
125
  async () => {
125
126
  await K(), B();
@@ -157,7 +158,7 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
157
158
  ]),
158
159
  _: 1
159
160
  }, 8, ["model-value", "class", "placeholder"]),
160
- l.multiple ? (s(), M(i(ne), {
161
+ l.multiple && l.showMultiple ? (s(), I(i(ne), {
161
162
  key: 0,
162
163
  disabled: l.disabled,
163
164
  plain: "",
@@ -223,7 +224,7 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
223
224
  key: 0,
224
225
  class: n(`${l.prefixCls}__panel-head`)
225
226
  }, [
226
- t.multiple ? (s(), M(i(F), {
227
+ t.multiple ? (s(), I(i(F), {
227
228
  key: 0,
228
229
  "model-value": l.groupCheckedMap[String(o.group.value)],
229
230
  indeterminate: l.groupIndeterminateMap[String(o.group.value)],
@@ -239,7 +240,7 @@ const he = ["data-virtual-index", "data-flash-seed"], Y = 2, be = /* @__PURE__ *
239
240
  }, 1024)
240
241
  ]),
241
242
  _: 2
242
- }, 1032, ["model-value", "indeterminate", "disabled", "onChange"])) : (s(), M(i(S), { key: 1 }, {
243
+ }, 1032, ["model-value", "indeterminate", "disabled", "onChange"])) : (s(), I(i(S), { key: 1 }, {
243
244
  default: d(() => [
244
245
  b(E(o.group.label), 1)
245
246
  ]),
@@ -60,7 +60,7 @@ const r = 34, R = 8, X = /* @__PURE__ */ V({
60
60
  "is-custom-svg": "",
61
61
  icon: s($)
62
62
  }, null, 8, ["icon"]),
63
- l[1] || (l[1] = y(" 取消全选 ", -1))
63
+ l[1] || (l[1] = y(" 取消选择 ", -1))
64
64
  ]),
65
65
  _: 1
66
66
  }, 8, ["disabled"])
@@ -35,6 +35,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
35
35
  beforeFetch: import('../../../../../utils/src').AnyPromiseFunction<any, any>;
36
36
  alwaysLoad: boolean;
37
37
  leftPlaceholder: string;
38
+ showMultiple: boolean;
38
39
  pasteSearch: boolean;
39
40
  separator: import('./types').PanelSelectSeparator;
40
41
  middlePlaceholder: string;
@@ -64,6 +65,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
64
65
  optionsCheck: (values: PanelSelectValue[], checked: boolean) => any;
65
66
  }, import('vue').PublicProps, {
66
67
  disabled: boolean;
68
+ showMultiple: boolean;
67
69
  scrollToGroupValue: PanelSelectValue;
68
70
  pasteSearch: boolean;
69
71
  separator: import('./types').PanelSelectSeparator;
@@ -400,6 +402,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
400
402
  inputFocus: () => void;
401
403
  }, {}, {}, {}, {
402
404
  disabled: boolean;
405
+ showMultiple: boolean;
403
406
  scrollToGroupValue: PanelSelectValue;
404
407
  pasteSearch: boolean;
405
408
  separator: import('./types').PanelSelectSeparator;
@@ -31,6 +31,7 @@ const m = 4, Gl = /* @__PURE__ */ je({
31
31
  disabled: { type: Boolean, default: !1 },
32
32
  showNav: { type: Boolean, default: !0 },
33
33
  multiple: { type: Boolean, default: !0 },
34
+ showMultiple: { type: Boolean, default: !0 },
34
35
  api: {},
35
36
  params: { default: () => ({}) },
36
37
  resultField: { default: "" },
@@ -100,12 +101,12 @@ const m = 4, Gl = /* @__PURE__ */ je({
100
101
  }
101
102
  Array.isArray(l) && (n.value = l.at(-1));
102
103
  });
103
- const b = v(), y = v(""), w = v(""), S = v(), V = E("middleRef"), g = E("selectWrapRef"), N = E("selectRef"), O = v(0);
104
- function B() {
104
+ const b = v(), y = v(""), w = v(""), S = v(), V = E("middleRef"), g = E("selectWrapRef"), B = E("selectRef"), O = v(0);
105
+ function N() {
105
106
  const e = g.value;
106
107
  e && (O.value = e.offsetWidth);
107
108
  }
108
- tl(g, () => B());
109
+ tl(g, () => N());
109
110
  const re = u(() => ({
110
111
  componentProps: {
111
112
  multiple: t.multiple,
@@ -115,7 +116,7 @@ const m = 4, Gl = /* @__PURE__ */ je({
115
116
  },
116
117
  component: "TtPanelSelect",
117
118
  selectWrapRef: g,
118
- selectRef: N
119
+ selectRef: B
119
120
  })), { selectComponentProps: ue } = al(re), T = u(() => {
120
121
  const e = y.value.trim().toLowerCase();
121
122
  if (!e) return R.value;
@@ -241,12 +242,12 @@ const m = 4, Gl = /* @__PURE__ */ je({
241
242
  }
242
243
  async function $e(e) {
243
244
  var l;
244
- C("visible-change", e), e && (w.value = "", y.value = "", await F(), (l = V.value) == null || l.inputFocus(), B(), t.alwaysLoad ? await f() : !t.immediate && !r(ae) && await f());
245
+ C("visible-change", e), e && (w.value = "", y.value = "", await F(), (l = V.value) == null || l.inputFocus(), N(), t.alwaysLoad ? await f() : !t.immediate && !r(ae) && await f());
245
246
  }
246
- function Ne() {
247
+ function Be() {
247
248
  U(L);
248
249
  }
249
- function Be(e) {
250
+ function Ne(e) {
250
251
  C("change", e, [...r(K)], Me(e));
251
252
  }
252
253
  function Te(e, l) {
@@ -255,7 +256,7 @@ const m = 4, Gl = /* @__PURE__ */ je({
255
256
  function U(e) {
256
257
  F(() => {
257
258
  const l = r(n);
258
- Te(l, e) || Be(l);
259
+ Te(l, e) || Ne(l);
259
260
  });
260
261
  }
261
262
  function d(e) {
@@ -329,19 +330,20 @@ const m = 4, Gl = /* @__PURE__ */ je({
329
330
  }, [
330
331
  q(r(Z), Je({
331
332
  ref_key: "selectRef",
332
- ref: N,
333
+ ref: B,
333
334
  modelValue: W.value,
334
335
  "onUpdate:modelValue": l[0] || (l[0] = (a) => W.value = a)
335
336
  }, r(ue), {
336
- multiple: s.multiple,
337
- filterable: !1,
338
337
  placeholder: s.placeholder,
339
338
  persistent: !1,
339
+ multiple: "",
340
340
  "fallback-placements": ["bottom-start", "bottom-end", "bottom", "top-start", "top-end", "top", "right", "left"],
341
341
  disabled: s.disabled,
342
+ "allow-create": "",
343
+ "default-first-option": "",
342
344
  "popper-class": `${r(p)}__popper vxe-table--ignore-clear`,
343
345
  onVisibleChange: $e,
344
- onChange: Ne,
346
+ onChange: Be,
345
347
  onFocus: ze
346
348
  }), {
347
349
  empty: Qe(() => [
@@ -385,13 +387,14 @@ const m = 4, Gl = /* @__PURE__ */ je({
385
387
  "paste-search": s.pasteSearch,
386
388
  separator: s.separator,
387
389
  "middle-placeholder": s.middlePlaceholder,
390
+ "show-multiple": s.showMultiple,
388
391
  "onUpdate:keyword": Le,
389
392
  onAllCheck: Ge,
390
393
  onCheckAll: We,
391
394
  onGroupCheck: De,
392
395
  onOptionCheck: Ke,
393
396
  onOptionsCheck: Ue
394
- }, null, 8, ["prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder"]),
397
+ }, null, 8, ["prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder", "show-multiple"]),
395
398
  t.multiple ? (A(), H(ul, {
396
399
  key: 1,
397
400
  "prefix-cls": r(p),
@@ -406,7 +409,7 @@ const m = 4, Gl = /* @__PURE__ */ je({
406
409
  ])
407
410
  ]),
408
411
  _: 1
409
- }, 16, ["modelValue", "multiple", "placeholder", "disabled", "popper-class"])
412
+ }, 16, ["modelValue", "placeholder", "disabled", "popper-class"])
410
413
  ], 2));
411
414
  }
412
415
  });
@@ -16,6 +16,8 @@ export interface PanelMiddleProps {
16
16
  prefixCls: string;
17
17
  /** 是否多选 */
18
18
  multiple: boolean;
19
+ /** 是否显示全选按钮 */
20
+ showMultiple: boolean;
19
21
  /** 搜索关键词 */
20
22
  keyword: string;
21
23
  /** 数据源 */
@@ -65,6 +67,8 @@ export interface PanelContainerProps {
65
67
  showNav?: boolean;
66
68
  /** 是否多选 */
67
69
  multiple?: boolean;
70
+ /** 是否显示全选按钮 */
71
+ showMultiple?: boolean;
68
72
  /** 远程加载函数 */
69
73
  api?: (arg?: any) => Promise<any[] | any>;
70
74
  /** 传给 api 的参数 */
@@ -105,6 +105,18 @@ export declare const TtTableButton: import('../../../../utils/src').SFCWithInsta
105
105
  }, {}, {}, {
106
106
  disabledTip: import('vue').Directive;
107
107
  }, string, import('vue').ComponentProvideOptions, true, {}, any>> & Record<string, any>;
108
+ /** 表格导出按钮(可脱离表格工具栏单独使用) */
109
+ export declare const TtTableExportButton: import('../../../../utils/src').SFCWithInstall<import('vue').DefineComponent<{
110
+ label?: string;
111
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
112
+ click: () => any;
113
+ }, string, import('vue').PublicProps, Readonly<{
114
+ label?: string;
115
+ }> & Readonly<{
116
+ onClick?: (() => any) | undefined;
117
+ }>, {
118
+ label: string;
119
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>> & Record<string, any>;
108
120
  /** 表格组件 */
109
121
  export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
110
122
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
@@ -309,6 +321,10 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
309
321
  customExportConfig: {
310
322
  type: import('vue').PropType<import('.').TtTableProps["customExportConfig"]>;
311
323
  };
324
+ columnFieldSource: {
325
+ type: import('vue').PropType<import('.').TtTableProps["columnFieldSource"]>;
326
+ default: string;
327
+ };
312
328
  autoHeight: any;
313
329
  leftSlotWidth: {
314
330
  type: NumberConstructor;
@@ -527,6 +543,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
527
543
  rightSlotWidth: number;
528
544
  defaultDisplayFields: string[];
529
545
  useSearchForm: any;
546
+ columnFieldSource: "visible" | "collect" | undefined;
530
547
  toolTipErrorPlacement: "top" | "bottom" | "left" | "right";
531
548
  afterFetch: ((data: any[], res: Recordable | Recordable[]) => Promise<any[]>) | undefined;
532
549
  beforeFetch: ((params: Recordable) => Promise<Recordable>) | undefined;
@@ -1000,6 +1017,10 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1000
1017
  customExportConfig: {
1001
1018
  type: import('vue').PropType<import('.').TtTableProps["customExportConfig"]>;
1002
1019
  };
1020
+ columnFieldSource: {
1021
+ type: import('vue').PropType<import('.').TtTableProps["columnFieldSource"]>;
1022
+ default: string;
1023
+ };
1003
1024
  autoHeight: any;
1004
1025
  leftSlotWidth: {
1005
1026
  type: NumberConstructor;
@@ -1216,6 +1237,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1216
1237
  rightSlotWidth: number;
1217
1238
  defaultDisplayFields: string[];
1218
1239
  useSearchForm: any;
1240
+ columnFieldSource: "visible" | "collect" | undefined;
1219
1241
  toolTipErrorPlacement: "top" | "bottom" | "left" | "right";
1220
1242
  afterFetch: ((data: any[], res: Recordable | Recordable[]) => Promise<any[]>) | undefined;
1221
1243
  beforeFetch: ((params: Recordable) => Promise<Recordable>) | undefined;
@@ -1426,6 +1448,10 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1426
1448
  customExportConfig: {
1427
1449
  type: import('vue').PropType<import('.').TtTableProps["customExportConfig"]>;
1428
1450
  };
1451
+ columnFieldSource: {
1452
+ type: import('vue').PropType<import('.').TtTableProps["columnFieldSource"]>;
1453
+ default: string;
1454
+ };
1429
1455
  autoHeight: any;
1430
1456
  leftSlotWidth: {
1431
1457
  type: NumberConstructor;
@@ -1644,6 +1670,7 @@ export declare const TtTable: import('../../../../utils/src').SFCWithInstall<{
1644
1670
  rightSlotWidth: number;
1645
1671
  defaultDisplayFields: string[];
1646
1672
  useSearchForm: any;
1673
+ columnFieldSource: "visible" | "collect" | undefined;
1647
1674
  toolTipErrorPlacement: "top" | "bottom" | "left" | "right";
1648
1675
  afterFetch: ((data: any[], res: Recordable | Recordable[]) => Promise<any[]>) | undefined;
1649
1676
  beforeFetch: ((params: Recordable) => Promise<Recordable>) | undefined;
@@ -15,7 +15,8 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs
15
15
  import "lodash-es";
16
16
  import o from "./src/components/TableAction.vue.js";
17
17
  import r from "./src/components/TableButtons.js";
18
- import m from "./src/Table.vue.js";
18
+ import m from "./src/components/TableExportButton.vue.js";
19
+ import i from "./src/Table.vue.js";
19
20
  /* empty css */
20
21
  import "@tanstack/vue-store";
21
22
  import "../tt-button/index.js";
@@ -56,6 +57,7 @@ import "../tt-modal/index.js";
56
57
  import "../../directives/disabled-tip/index.js";
57
58
  import "../tt-log/index.js";
58
59
  import "../tt-custom-export-modal/index.js";
60
+ import "../tt-custom-export-panel/index.js";
59
61
  /* empty css */
60
62
  /* empty css */
61
63
  /* empty css */
@@ -70,9 +72,10 @@ import "./src/emits.js";
70
72
  import "./src/props.js";
71
73
  import "./src/table-mutation-events.js";
72
74
  import "./src/utils/context.js";
73
- const Ct = t(o), It = t(r), $t = t(m);
75
+ const It = t(o), dt = t(r), gt = t(m), jt = t(i);
74
76
  export {
75
- $t as TtTable,
76
- Ct as TtTableAction,
77
- It as TtTableButton
77
+ jt as TtTable,
78
+ It as TtTableAction,
79
+ dt as TtTableButton,
80
+ gt as TtTableExportButton
78
81
  };