@dazhicheng/ui 1.5.247 → 1.5.249

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.
@@ -1,14 +1,14 @@
1
- import { defineComponent as Y, ref as S, reactive as Z, computed as C, watch as T, createBlock as E, openBlock as m, unref as s, normalizeClass as b, createSlots as ee, withCtx as d, createElementVNode as c, createVNode as a, toDisplayString as h, createElementBlock as v, Fragment as M, renderList as $, createTextVNode as F, createCommentVNode as le, withModifiers as te, renderSlot as V } from "vue";
2
- import oe from "../../../../assets/svg/close.svg.js";
3
- import se from "../../../../assets/svg/drag.svg.js";
4
- import { TtIcon as B } from "../../../tt-icon/index.js";
5
- import { TtText as ne } from "../../../tt-text/index.js";
1
+ import { defineComponent as Q, ref as x, computed as b, createBlock as F, openBlock as f, unref as e, normalizeClass as a, createSlots as W, withCtx as s, createElementVNode as c, createVNode as r, createTextVNode as h, toDisplayString as $, createElementBlock as C, Fragment as w, renderList as T, createCommentVNode as X, withModifiers as Y, renderSlot as V } from "vue";
2
+ import Z from "../../../../assets/svg/close.svg.js";
3
+ import ee from "../../../../assets/svg/drag.svg.js";
4
+ import { TtIcon as P } from "../../../tt-icon/index.js";
5
+ import { TtText as le } from "../../../tt-text/index.js";
6
6
  import "../../../tt-modal/index.js";
7
- import { TtButton as ie } from "../../../tt-button/index.js";
7
+ import { TtButton as te } from "../../../tt-button/index.js";
8
8
  import "../../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
9
- import { useDesign as de } from "../../../../packages/hooks/src/useDesign.js";
9
+ import { useDesign as oe } from "../../../../packages/hooks/src/useDesign.js";
10
10
  import "axios";
11
- import { ElScrollbar as I, ElCheckbox as R, ElCheckboxGroup as ce, ElTooltip as ae } from "element-plus";
11
+ import { ElScrollbar as B, ElCheckbox as N, ElCheckboxGroup as ne, ElTooltip as ie } from "element-plus";
12
12
  import "dayjs";
13
13
  import "xe-utils";
14
14
  import "dayjs/plugin/utc";
@@ -18,231 +18,204 @@ import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ae
18
18
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
19
19
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
20
20
  import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
21
- import { cloneDeep as re } from "lodash-es";
22
- import ue from "sortablejs";
23
- import { useModalRender as me } from "../../../tt-modal/src/hooks/useModalRender.js";
24
- const fe = { class: "flex-1" }, pe = { class: "cb flex items-center" }, he = { class: "text-[var(--el-text-color-primary)] font-bold" }, xe = { class: "flex flex-col w-[200px] shrink-0" }, Ce = { class: "flex items-center justify-between px-15px pt-12px pb-6px text-xs text-[var(--el-text-color-regular)]" }, be = { class: "flex items-center text-xs" }, ve = ["onClick"], ke = { class: "text-left" }, Le = /* @__PURE__ */ Y({
21
+ import "lodash-es";
22
+ import ae from "sortablejs";
23
+ import { useModalRender as se } from "../../../tt-modal/src/hooks/useModalRender.js";
24
+ const re = ["aria-label", "onClick"], Pe = /* @__PURE__ */ Q({
25
25
  __name: "TableColumnModal",
26
26
  props: {
27
27
  openColumn: { type: Function },
28
28
  openExport: { type: Function }
29
29
  },
30
30
  emits: ["on-submit"],
31
- setup(A, { expose: N, emit: j }) {
32
- const r = A, z = j, { prefixCls: u } = de("table-column-modal"), _ = S(), [D, x] = me(), k = S(!1), l = Z({
33
- allColumns: [],
34
- checkedFields: [],
35
- selectedColumns: [],
36
- disabledColumnField: []
37
- });
38
- let f = null, g = null;
39
- const p = C(() => l.allColumns.filter((e) => e.field)), O = C(() => p.value.filter((e) => !e.disabled)), P = C(() => {
40
- const e = O.value.length;
41
- return e === 0 ? !0 : l.checkedFields.filter((t) => !l.disabledColumnField.includes(t)).length === e;
42
- }), q = C(() => {
43
- const e = [.../* @__PURE__ */ new Set([...l.checkedFields, ...l.disabledColumnField])];
44
- return e.length > 0 && e.length < p.value.length;
45
- });
46
- function G(e) {
47
- const o = p.value;
48
- l.checkedFields = e ? o.map((t) => t.field) : o.filter((t) => l.disabledColumnField.includes(t.field)).map((t) => t.field);
31
+ setup(z, { expose: A, emit: I }) {
32
+ const m = z, D = I, { prefixCls: i } = oe("table-column-modal"), [L, g] = se(), u = x([]), n = x([]), y = x(!1);
33
+ let p = null;
34
+ const E = b(
35
+ () => n.value.map((t) => u.value.find((l) => l.field === t)).filter(Boolean)
36
+ ), R = b(() => u.value.filter((t) => !t.locked)), G = b(() => n.value.filter((t) => !M(t))), S = b(() => G.value.length === R.value.length), O = b(() => n.value.length > 0 && !S.value);
37
+ function M(t) {
38
+ return u.value.some((l) => l.field === t && l.locked);
49
39
  }
50
- function L(e) {
51
- l.checkedFields = l.checkedFields.filter((o) => o !== e);
40
+ function U(t) {
41
+ n.value = u.value.filter((l) => l.locked ? n.value.includes(l.field) : !!t).map((l) => l.field);
52
42
  }
53
- function U() {
54
- l.checkedFields = l.checkedFields.filter((e) => l.disabledColumnField.includes(e));
43
+ function j(t) {
44
+ n.value = n.value.filter((l) => l !== t);
55
45
  }
56
- const y = () => {
57
- z("on-submit", {
58
- checkedModel: [...l.selectedColumns.map((e) => e.field)],
59
- modalApi: x,
60
- isExport: k.value
46
+ function q() {
47
+ n.value = n.value.filter(M);
48
+ }
49
+ function _() {
50
+ D("on-submit", {
51
+ checkedModel: [...n.value],
52
+ modalApi: g,
53
+ isExport: y.value
61
54
  });
62
- };
63
- function H({ columns: e, displayFields: o = [], disabledColumnField: t, isExport: n }) {
64
- k.value = n ?? !1, x.openModal();
65
- const Q = re(e).filter((i) => i.field);
66
- l.disabledColumnField = t, l.allColumns = Q.map((i) => ({ ...i, disabled: t.includes(i.field) }));
67
- const W = new Set(l.allColumns.map((i) => i.field)), w = o.filter((i) => i && W.has(i));
68
- l.checkedFields = [...w], l.selectedColumns = w.map((i) => l.allColumns.find((X) => X.field === i)).filter(Boolean), g = setTimeout(J, 100);
69
55
  }
70
- function J() {
71
- var o;
72
- const e = (o = s(_)) == null ? void 0 : o.querySelector(`.${u}-move-box`);
73
- e && (f = ue.create(e, {
56
+ function H({ columns: t, displayFields: l = [], disabledColumnField: o, isExport: v }) {
57
+ y.value = v ?? !1, u.value = t.filter((d) => d.field).map((d) => ({ ...d, locked: o.includes(d.field) }));
58
+ const k = new Set(u.value.map((d) => d.field));
59
+ n.value = [...new Set(l.filter((d) => k.has(d)))], g.openModal();
60
+ }
61
+ function J(t) {
62
+ p == null || p.destroy(), p = null, t && (p = ae.create(t, {
74
63
  animation: 300,
75
- handle: `.${u}-item-move:not(.is-disabled)`,
76
- onStart: (t) => t.item.style.opacity = "0",
77
- onEnd(t) {
78
- if (t.oldIndex == null || t.newIndex == null) return;
79
- const [n] = l.selectedColumns.splice(t.oldIndex, 1);
80
- l.selectedColumns.splice(t.newIndex, 0, n), t.item.style.opacity = "1";
64
+ onStart: (l) => l.item.style.opacity = "0",
65
+ onEnd(l) {
66
+ l.item.style.opacity = "1";
67
+ const { oldIndex: o, newIndex: v } = l;
68
+ if (o == null || v == null) return;
69
+ const k = [...n.value];
70
+ k.splice(v, 0, ...k.splice(o, 1)), n.value = k;
81
71
  }
82
72
  }));
83
73
  }
84
- T(
85
- () => l.checkedFields,
86
- (e) => {
87
- const o = new Set(e);
88
- l.selectedColumns = l.selectedColumns.filter((n) => o.has(n.field || ""));
89
- const t = new Set(l.selectedColumns.map((n) => n.field || ""));
90
- l.selectedColumns.push(
91
- ...l.allColumns.filter((n) => o.has(n.field || "") && !t.has(n.field || ""))
92
- );
93
- },
94
- { deep: !0 }
95
- ), T(
96
- () => {
97
- var e;
98
- return (e = x.getVisible) == null ? void 0 : e.value;
99
- },
100
- (e) => {
101
- e || (g && clearTimeout(g), f == null || f.destroy(), f = null, Object.assign(l, { allColumns: [], checkedFields: [], selectedColumns: [] }));
102
- }
103
- );
104
74
  function K() {
105
- var e, o;
106
- k.value ? (e = r.openExport) == null || e.call(r, !0) : (o = r.openColumn) == null || o.call(r, !0);
75
+ var t, l;
76
+ y.value ? (t = m.openExport) == null || t.call(m, !0) : (l = m.openColumn) == null || l.call(m, !0);
107
77
  }
108
- return N({
109
- handleSubmit: y,
78
+ return A({
79
+ handleSubmit: _,
110
80
  openModal: H,
111
- setModalProps(e) {
112
- x.setModalProps(e);
81
+ setModalProps(t) {
82
+ g.setModalProps(t);
113
83
  }
114
- }), (e, o) => (m(), E(s(D), {
84
+ }), (t, l) => (f(), F(e(L), {
115
85
  width: "720",
116
- class: b(s(u)),
117
- onOk: y
118
- }, ee({
119
- beforeFooter: d(() => [
120
- c("div", ke, [
121
- a(s(ie), { onClick: K }, {
122
- default: d(() => [...o[1] || (o[1] = [
123
- F("重置", -1)
86
+ class: a(e(i)),
87
+ onOk: _
88
+ }, W({
89
+ beforeFooter: s(() => [
90
+ c("div", {
91
+ class: a(`${e(i)}-footer-left`)
92
+ }, [
93
+ r(e(te), { onClick: K }, {
94
+ default: s(() => [...l[1] || (l[1] = [
95
+ h("重置", -1)
124
96
  ])]),
125
97
  _: 1
126
98
  }),
127
- V(e.$slots, "beforeFooter")
128
- ])
99
+ V(t.$slots, "beforeFooter")
100
+ ], 2)
129
101
  ]),
130
- default: d(() => [
102
+ default: s(() => [
131
103
  c("div", {
132
- ref_key: "contentRef",
133
- ref: _,
134
- class: "flex h-[400px]"
104
+ class: a(`${e(i)}-body`)
135
105
  }, [
136
- c("div", fe, [
137
- a(s(I), { class: "h-full px-24px py-12px" }, {
138
- default: d(() => [
139
- c("div", pe, [
140
- a(s(R), {
141
- "model-value": P.value,
142
- class: "checkbox-all",
143
- indeterminate: q.value,
144
- onChange: G
106
+ r(e(B), {
107
+ class: a(`${e(i)}-source`)
108
+ }, {
109
+ default: s(() => [
110
+ r(e(N), {
111
+ class: a(`${e(i)}-all`),
112
+ "model-value": S.value,
113
+ indeterminate: O.value,
114
+ onChange: U
115
+ }, {
116
+ default: s(() => [
117
+ h(" 全部(" + $(n.value.length) + "/" + $(u.value.length) + ") ", 1)
118
+ ]),
119
+ _: 1
120
+ }, 8, ["class", "model-value", "indeterminate"]),
121
+ r(e(ne), {
122
+ modelValue: n.value,
123
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
124
+ class: a(`${e(i)}-group`)
125
+ }, {
126
+ default: s(() => [
127
+ (f(!0), C(w, null, T(u.value, (o) => (f(), F(e(N), {
128
+ key: o.field,
129
+ value: o.field,
130
+ disabled: o.locked
145
131
  }, {
146
- default: d(() => [
147
- c("span", he, " 全部(" + h(l.checkedFields.length) + "/" + h(p.value.length) + ") ", 1)
132
+ default: s(() => [
133
+ r(e(ie), {
134
+ content: o.title || "",
135
+ "show-after": 400,
136
+ placement: "top"
137
+ }, {
138
+ default: s(() => [
139
+ h($(o.title || ""), 1)
140
+ ]),
141
+ _: 2
142
+ }, 1032, ["content"])
148
143
  ]),
149
- _: 1
150
- }, 8, ["model-value", "indeterminate"])
144
+ _: 2
145
+ }, 1032, ["value", "disabled"]))), 128))
151
146
  ]),
152
- a(s(ce), {
153
- modelValue: l.checkedFields,
154
- "onUpdate:modelValue": o[0] || (o[0] = (t) => l.checkedFields = t),
155
- class: "mb-10px w-full"
156
- }, {
157
- default: d(() => [
158
- (m(!0), v(M, null, $(p.value, (t) => (m(), E(s(R), {
159
- key: t.field,
160
- value: t.field,
161
- disabled: t.disabled
162
- }, {
163
- default: d(() => [
164
- a(s(ae), {
165
- "show-after": 400,
166
- content: t.title || "",
167
- placement: "top"
168
- }, {
169
- default: d(() => [
170
- F(h(t.title || ""), 1)
171
- ]),
172
- _: 2
173
- }, 1032, ["content"])
174
- ]),
175
- _: 2
176
- }, 1032, ["value", "disabled"]))), 128))
177
- ]),
178
- _: 1
179
- }, 8, ["modelValue"])
180
- ]),
181
- _: 1
182
- })
183
- ]),
184
- c("div", xe, [
185
- c("div", Ce, [
186
- c("span", null, "已选 " + h(l.selectedColumns.length) + " 列", 1),
187
- c("span", {
188
- class: "cursor-pointer text-(--el-color-primary)",
189
- onClick: U
190
- }, "清空")
147
+ _: 1
148
+ }, 8, ["modelValue", "class"])
191
149
  ]),
192
- a(s(I), { class: "flex-1" }, {
193
- default: d(() => [
194
- c("div", {
195
- class: b([`${s(u)}-move-box`, "px-7px"])
150
+ _: 1
151
+ }, 8, ["class"]),
152
+ c("div", {
153
+ class: a(`${e(i)}-picked`)
154
+ }, [
155
+ c("header", {
156
+ class: a(`${e(i)}-picked-head`)
157
+ }, [
158
+ c("span", null, "已选 " + $(E.value.length) + " 列", 1),
159
+ c("span", {
160
+ class: a(`${e(i)}-clear`),
161
+ onClick: q
162
+ }, "清空", 2)
163
+ ], 2),
164
+ r(e(B), null, {
165
+ default: s(() => [
166
+ c("ul", {
167
+ ref: J,
168
+ class: a(`${e(i)}-list`)
196
169
  }, [
197
- (m(!0), v(M, null, $(l.selectedColumns, (t) => (m(), v("div", {
198
- key: t.field,
199
- class: b([
200
- `${s(u)}-item-move`,
201
- "flex h-36px items-center justify-between pr-12px py-2 cursor-pointer"
202
- ])
170
+ (f(!0), C(w, null, T(E.value, (o) => (f(), C("li", {
171
+ key: o.field,
172
+ class: a(`${e(i)}-item`)
203
173
  }, [
204
- c("div", be, [
205
- a(s(B), {
206
- class: "shrink-0 text-[var(--el-text-color-secondary)]",
174
+ c("span", {
175
+ class: a(`${e(i)}-item-main`)
176
+ }, [
177
+ r(e(P), {
178
+ class: a(`${e(i)}-item-drag`),
207
179
  size: 14,
208
- icon: s(se),
180
+ icon: e(ee),
209
181
  "is-custom-svg": ""
210
- }, null, 8, ["icon"]),
211
- a(s(ne), {
182
+ }, null, 8, ["class", "icon"]),
183
+ r(e(le), {
212
184
  "tool-tip": !1,
213
- class: "ml-1"
185
+ class: a(`${e(i)}-item-title`)
214
186
  }, {
215
- default: d(() => [
216
- F(h(t.title || ""), 1)
187
+ default: s(() => [
188
+ h($(o.title || ""), 1)
217
189
  ]),
218
190
  _: 2
219
- }, 1024)
220
- ]),
221
- l.disabledColumnField.includes(t.field) ? le("", !0) : (m(), v("span", {
191
+ }, 1032, ["class"])
192
+ ], 2),
193
+ o.locked ? X("", !0) : (f(), C("button", {
222
194
  key: 0,
223
- class: b(`${s(u)}-action-btn`),
224
- onClick: te((n) => L(t.field), ["stop"])
195
+ type: "button",
196
+ class: a(`${e(i)}-item-remove`),
197
+ "aria-label": `移除${o.title || ""}`,
198
+ onClick: Y((v) => j(o.field), ["stop"])
225
199
  }, [
226
- a(s(B), {
227
- class: "text-[var(--el-text-color-secondary)]",
200
+ r(e(P), {
228
201
  size: 12,
229
- "icon-font": s(oe)
202
+ "icon-font": e(Z)
230
203
  }, null, 8, ["icon-font"])
231
- ], 10, ve))
204
+ ], 10, re))
232
205
  ], 2))), 128))
233
206
  ], 2)
234
207
  ]),
235
208
  _: 1
236
209
  })
237
- ])
238
- ], 512)
210
+ ], 2)
211
+ ], 2)
239
212
  ]),
240
213
  _: 2
241
214
  }, [
242
- e.$slots.title ? {
215
+ t.$slots.title ? {
243
216
  name: "header",
244
- fn: d(() => [
245
- V(e.$slots, "title")
217
+ fn: s(() => [
218
+ V(t.$slots, "title")
246
219
  ]),
247
220
  key: "0"
248
221
  } : void 0
@@ -250,5 +223,5 @@ const fe = { class: "flex-1" }, pe = { class: "cb flex items-center" }, he = { c
250
223
  }
251
224
  });
252
225
  export {
253
- Le as default
226
+ Pe as default
254
227
  };
@@ -14,6 +14,16 @@ export declare const CODES: {
14
14
  readonly SALES_ORDER_TYPE: "SALES_ORDER_TYPE";
15
15
  /** 产品类型(字典 SALES_ORDER_PRODUCT_TYPE) */
16
16
  readonly SALES_ORDER_PRODUCT_TYPE: "SALES_ORDER_PRODUCT_TYPE";
17
+ /** 用户(/iam/user/page) */
18
+ readonly USER: "user";
19
+ /** 亏损原因一级(/rule/lossReason/primaryDropdownList) */
20
+ readonly LOSS_REASON: "lossReason";
21
+ /** 亏损原因细类(/rule/lossReason/secondaryDropdownList) */
22
+ readonly LOSS_REASON_SECONDARY: "lossReasonSecondary";
23
+ /** 配置号(/supplier/supplierConfigManage/config/getAllConfigList) */
24
+ readonly SUPPLIER_CONFIG: "supplierConfig";
25
+ /** 供应商(/supplier/supplierManage/listAllValid) */
26
+ readonly SUPPLIER: "supplier";
17
27
  };
18
28
  export type BasicDataCode = (typeof CODES)[keyof typeof CODES];
19
29
  export type BasicDataOption = {
@@ -25,21 +35,28 @@ export type BasicDataOption = {
25
35
  /**
26
36
  * PanelSelect 分组方式。
27
37
  * - continent / region / country:按洲 / 区域 / 国家树形分组
38
+ * - businessType / primaryReason / supplierManageName:按业务字段树形分组
28
39
  * - pinyin:按拼音首字母分组(TtPanelSelect showPinyinMode)
29
40
  */
30
41
  export declare const GROUP_BY: {
31
42
  readonly CONTINENT: "continent";
32
43
  readonly REGION: "region";
33
44
  readonly COUNTRY: "country";
45
+ /** 按业务类型(亏损原因) */
46
+ readonly BUSINESS_TYPE: "businessType";
47
+ /** 按所属一级原因(亏损原因细类) */
48
+ readonly PRIMARY_REASON: "primaryReason";
49
+ /** 按供应商名称(配置号) */
50
+ readonly SUPPLIER_MANAGE_NAME: "supplierManageName";
34
51
  readonly PINYIN: "pinyin";
35
52
  };
36
53
  export type PanelSelectGroupBy = (typeof GROUP_BY)[keyof typeof GROUP_BY];
37
54
  /**
38
- * 将扁平 options 按洲/区域/国家转为树形(父节点 + children)。
55
+ * 将扁平 options 按分组字段转为树形(父节点 + children)。
39
56
  * `pinyin` 或不支持的分组原样返回,交由组件拼音模式处理。
40
57
  */
41
58
  export declare function groupBasicDataOptions(options: BasicDataOption[], groupBy: PanelSelectGroupBy): BasicDataOption[];
42
- /** 机场默认按国家分组;其余默认拼音 */
59
+ /** code 默认分组;未特殊指定时为拼音 */
43
60
  export declare function resolveDefaultGroupBy(code: BasicDataCode, groupBy?: PanelSelectGroupBy): PanelSelectGroupBy;
44
61
  export type BasicDataFetchContext = {
45
62
  /** 当前路由 permissionOnlyCode,字典接口按权限过滤时使用 */