@dazhicheng/ui 1.5.212 → 1.5.215

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.
@@ -41,7 +41,11 @@ export declare const TtRadioGroup: import('../../../../utils/src').SFCWithInstal
41
41
  change: (val: import('./type').TtRadioGroupValueType | undefined) => any;
42
42
  "update:modelValue": (value: import('./type').TtRadioGroupValueType) => any;
43
43
  }, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
44
- $slots: any;
44
+ $slots: Readonly<{
45
+ default?: () => import('vue').VNodeChild;
46
+ }> & {
47
+ default?: () => import('vue').VNodeChild;
48
+ };
45
49
  })> & Record<string, any>;
46
50
  export default TtRadioGroup;
47
51
  export type TtRadioGroupInstance = InstanceType<typeof TtRadioGroup>;
@@ -1,11 +1,18 @@
1
1
  import { TtRadioGroupProp, TtRadioGroupValueType } from './type';
2
+ import { VNodeChild } from 'vue';
2
3
  type __VLS_Props = TtRadioGroupProp;
3
4
  type __VLS_PublicProps = {
4
5
  modelValue?: TtRadioGroupValueType;
5
6
  } & __VLS_Props;
6
7
  declare function __VLS_template(): {
7
8
  attrs: Partial<{}>;
8
- slots: any;
9
+ slots: Readonly<{
10
+ /** 单选项内容 */
11
+ default?: () => VNodeChild;
12
+ }> & {
13
+ /** 单选项内容 */
14
+ default?: () => VNodeChild;
15
+ };
9
16
  refs: {};
10
17
  rootEl: any;
11
18
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as B, mergeModels as m, useModel as k, useAttrs as P, computed as w, ref as d, watch as x, createBlock as L, openBlock as M, unref as c, mergeProps as R, createSlots as S, renderList as $, withCtx as z, renderSlot as A, normalizeProps as D, guardReactiveProps as F } from "vue";
1
+ import { defineComponent as V, mergeModels as d, useModel as y, useAttrs as B, computed as k, ref as p, watch as x, createBlock as w, openBlock as L, unref as m, mergeProps as M, withCtx as P, renderSlot as A } from "vue";
2
2
  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";
3
- import { useDesign as G } from "../../packages/hooks/src/useDesign.js";
3
+ import { useDesign as D } from "../../packages/hooks/src/useDesign.js";
4
4
  import "axios";
5
- import { useFormItem as U, ElRadioGroup as E } from "element-plus";
5
+ import { useFormItem as F, ElRadioGroup as G } from "element-plus";
6
6
  import "dayjs";
7
7
  import "xe-utils";
8
8
  import "dayjs/plugin/utc";
@@ -12,12 +12,12 @@ import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
12
12
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
13
13
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
14
14
  import "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
15
- import { omit as f } from "lodash-es";
16
- const ee = /* @__PURE__ */ B({
15
+ import { omit as c } from "lodash-es";
16
+ const O = /* @__PURE__ */ V({
17
17
  name: "TtRadioGroup",
18
18
  inheritAttrs: !1,
19
19
  __name: "index",
20
- props: /* @__PURE__ */ m({
20
+ props: /* @__PURE__ */ d({
21
21
  id: {},
22
22
  size: {},
23
23
  disabled: { type: Boolean },
@@ -35,46 +35,44 @@ const ee = /* @__PURE__ */ B({
35
35
  modelValue: { type: [String, Number, Boolean] },
36
36
  modelModifiers: {}
37
37
  }),
38
- emits: /* @__PURE__ */ m(["change"], ["update:modelValue"]),
39
- setup(i, { emit: g }) {
40
- const l = i, a = k(i, "modelValue"), s = g, v = P(), { prefixCls: h } = G("radio-group"), C = w(() => ({
41
- ...f(l, ["clearable", "beforeChange", "modelValue"]),
42
- ...f(v, ["onUpdate:modelValue", "onChange", "class"])
43
- })), r = d(a.value), { formItem: n } = U(), u = d(!1);
44
- async function b(e) {
45
- const o = a.value;
38
+ emits: /* @__PURE__ */ d(["change"], ["update:modelValue"]),
39
+ setup(n, { emit: f }) {
40
+ const a = n, l = y(n, "modelValue"), s = f, g = B(), { prefixCls: v } = D("radio-group"), h = k(() => ({
41
+ ...c(a, ["clearable", "beforeChange", "modelValue"]),
42
+ ...c(g, ["onUpdate:modelValue", "onChange", "class"])
43
+ })), r = p(l.value), { formItem: i } = F(), u = p(!1);
44
+ async function C(e) {
45
+ const o = l.value;
46
46
  let t = !0;
47
- l.beforeChange && (t = await l.beforeChange(e, o)), t ? (a.value = e, s("change", e)) : r.value = o;
47
+ a.beforeChange && (t = await a.beforeChange(e, o)), t ? (l.value = e, s("change", e)) : r.value = o;
48
48
  }
49
- function V(e) {
50
- if (!l.clearable) return;
49
+ function b(e) {
50
+ if (!a.clearable || a.disabled) return;
51
51
  const t = e.target.closest(".el-radio, .el-radio-button");
52
- t != null && t.classList.contains("is-checked") && (e.stopPropagation(), e.preventDefault(), a.value = void 0, r.value = void 0, s("change", void 0));
52
+ t != null && t.classList.contains("is-checked") && (t.classList.contains("is-disabled") || (e.stopPropagation(), e.preventDefault(), l.value = void 0, r.value = void 0, s("change", void 0)));
53
53
  }
54
54
  return x(
55
- a,
55
+ l,
56
56
  (e) => {
57
- r.value = e, u.value && (n == null || n.validate("change").catch((o) => {
57
+ r.value = e, u.value && (i == null || i.validate("change").catch((o) => {
58
58
  })), u.value = !0;
59
59
  },
60
60
  { immediate: !0 }
61
- ), (e, o) => (M(), L(c(E), R(C.value, {
61
+ ), (e, o) => (L(), w(m(G), M(h.value, {
62
62
  modelValue: r.value,
63
63
  "onUpdate:modelValue": o[0] || (o[0] = (t) => r.value = t),
64
- class: [c(h), e.$attrs.class],
64
+ class: [m(v), e.$attrs.class],
65
65
  "validate-event": !1,
66
- onClickCapture: V,
67
- onChange: b
68
- }), S({ _: 2 }, [
69
- $(e.$slots, (t, p) => ({
70
- name: p,
71
- fn: z((y) => [
72
- A(e.$slots, p, D(F(y)))
73
- ])
74
- }))
75
- ]), 1040, ["modelValue", "class"]));
66
+ onClickCapture: b,
67
+ onChange: C
68
+ }), {
69
+ default: P(() => [
70
+ A(e.$slots, "default")
71
+ ]),
72
+ _: 3
73
+ }, 16, ["modelValue", "class"]));
76
74
  }
77
75
  });
78
76
  export {
79
- ee as default
77
+ O as default
80
78
  };
@@ -1,9 +1,9 @@
1
- import { queryDataPermissionDetailDataTypeContext as x, pageUser as T } from "../api/dataTypeContext.js";
2
- import { ref as K, watchEffect as L, unref as q, watch as U, computed as b } from "vue";
3
- import { useRoute as M } from "vue-router";
4
- const c = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
5
- let C, m;
6
- const V = "all", _ = { label: "全部", value: V }, j = {
1
+ import { queryDataPermissionDetailDataTypeContext as L, pageUser as R } from "../api/dataTypeContext.js";
2
+ import { ref as U, watchEffect as b, unref as O, watch as M, computed as V } from "vue";
3
+ import { useRoute as _ } from "vue-router";
4
+ const c = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
5
+ let D, h;
6
+ const j = "all", E = { label: "全部", value: j }, z = {
7
7
  platformId: ["platformName", "platformId"],
8
8
  shopId: ["shopName", "shopId"],
9
9
  purchasePlaceId: ["purchasePlaceName", "purchasePlaceCode"],
@@ -11,114 +11,117 @@ const V = "all", _ = { label: "全部", value: V }, j = {
11
11
  lockUserId: ["userName", "userId"],
12
12
  userId: ["fullName", "id"]
13
13
  };
14
- async function E() {
15
- if (C) return C;
16
- if (m) return m;
17
- m = T({ pageNo: 1, pageSize: 9999 }).then((a) => {
18
- const l = a.records || [];
19
- return C = l, l;
14
+ async function k() {
15
+ if (D) return D;
16
+ if (h) return h;
17
+ h = R({ pageNo: 1, pageSize: 9999 }).then((n) => {
18
+ const l = n.records || [];
19
+ return D = l, l;
20
20
  });
21
21
  try {
22
- return await m;
22
+ return await h;
23
23
  } finally {
24
- m = void 0;
24
+ h = void 0;
25
25
  }
26
26
  }
27
- function G(a) {
28
- const l = M(), P = K({});
29
- function p(t = {}) {
30
- P.value = a.codes.reduce(
27
+ function J(n) {
28
+ const l = _(), v = U({});
29
+ function m(t = {}) {
30
+ v.value = n.codes.reduce(
31
31
  (e, r) => {
32
- const [s, d] = j[r], y = (t[r] || []).map((f) => {
33
- const u = r === "purchasePlaceId" ? f.purchaseInfo || {} : f;
32
+ const [s, d] = z[r], g = (t[r] || []).map((f) => {
33
+ const o = r === "purchasePlaceId" ? f.purchaseInfo || {} : f;
34
34
  return {
35
35
  ...f,
36
- label: u == null ? void 0 : u[s],
37
- value: u == null ? void 0 : u[d]
36
+ label: o == null ? void 0 : o[s],
37
+ value: o == null ? void 0 : o[d]
38
38
  };
39
39
  });
40
- return e[r] = y, e;
40
+ return e[r] = g, e;
41
41
  },
42
42
  {}
43
43
  );
44
44
  }
45
- function N(t) {
45
+ function A(t) {
46
46
  var e;
47
- return typeof a.showAll == "boolean" ? a.showAll : ((e = a.showAll) == null ? void 0 : e[t]) ?? !1;
47
+ return typeof n.showAll == "boolean" ? n.showAll : ((e = n.showAll) == null ? void 0 : e[t]) ?? !1;
48
48
  }
49
- function O() {
50
- I.clear(), c.clear(), g.clear(), C = void 0, m = void 0;
49
+ function x() {
50
+ C.clear(), c.clear(), p.clear(), D = void 0, h = void 0;
51
51
  }
52
- function A(t) {
52
+ function T(t) {
53
53
  c.delete(t);
54
54
  }
55
- async function D(t = !1) {
56
- const e = l.path, r = q(a.dataSource);
55
+ async function S(t = !1) {
56
+ const e = l.path, r = O(n.dataSource);
57
57
  if (r) {
58
58
  const i = { ...c.get(e) || {}, ...r };
59
- c.set(e, i), p(i);
59
+ c.set(e, i), m(i);
60
60
  return;
61
61
  }
62
62
  const s = c.get(e) || {};
63
- let d = t ? [...a.codes] : a.codes.filter((n) => !Object.prototype.hasOwnProperty.call(s, n));
63
+ let d = t ? [...n.codes] : n.codes.filter((a) => !Object.prototype.hasOwnProperty.call(s, a));
64
64
  if (!d.length) {
65
- p(s);
65
+ m(s);
66
66
  return;
67
67
  }
68
- const y = t ? void 0 : I.get(e);
69
- if (y) {
70
- const n = await y, o = { ...c.get(e) || {}, ...n };
71
- if (c.set(e, o), d = a.codes.filter((h) => !Object.prototype.hasOwnProperty.call(o, h)), !d.length) {
72
- p(o);
68
+ const g = t ? void 0 : C.get(e);
69
+ if (g) {
70
+ const a = await g, u = { ...c.get(e) || {}, ...a };
71
+ if (c.set(e, u), d = n.codes.filter((y) => !Object.prototype.hasOwnProperty.call(u, y)), !d.length) {
72
+ m(u);
73
73
  return;
74
74
  }
75
75
  }
76
- const f = d.filter((n) => n !== "userId"), u = d.includes("userId"), v = Promise.all([
77
- f.length ? x({ dataTypeName: f }).then(
78
- (n) => n
76
+ const f = d.filter((a) => a !== "userId"), o = d.includes("userId"), q = Promise.allSettled([
77
+ f.length ? L({ dataTypeName: f }).then(
78
+ (a) => a
79
79
  ) : Promise.resolve([]),
80
- u ? E() : Promise.resolve(void 0)
81
- ]).then(([n, i]) => ({
82
- ...i ? { userId: i } : {},
83
- ...n.reduce((o, h) => {
84
- const S = h == null ? void 0 : h.dataTypeCode;
85
- return S && (o[S] = h.originalItems || []), o;
86
- }, {})
87
- })), w = (g.get(e) || 0) + 1;
88
- g.set(e, w), I.set(e, v);
80
+ o ? k() : Promise.resolve(void 0)
81
+ ]).then(([a, i]) => {
82
+ const u = a.status === "fulfilled" ? a.value : [], y = i.status === "fulfilled" ? i.value : void 0;
83
+ return {
84
+ ...y ? { userId: y } : {},
85
+ ...u.reduce((P, I) => {
86
+ const N = I == null ? void 0 : I.dataTypeCode;
87
+ return N && (P[N] = I.originalItems || []), P;
88
+ }, {})
89
+ };
90
+ }), w = (p.get(e) || 0) + 1;
91
+ p.set(e, w), C.set(e, q);
89
92
  try {
90
- const n = await v;
91
- if (g.get(e) !== w) return;
92
- const o = { ...c.get(e) || {}, ...n };
93
- c.set(e, o), p(o);
93
+ const a = await q;
94
+ if (p.get(e) !== w) return;
95
+ const u = { ...c.get(e) || {}, ...a };
96
+ c.set(e, u), m(u);
94
97
  } finally {
95
- g.get(e) === w && I.delete(e);
98
+ p.get(e) === w && C.delete(e);
96
99
  }
97
100
  }
98
- async function R() {
101
+ async function K() {
99
102
  const t = l.path;
100
- O(), A(t), await D(!0);
103
+ x(), T(t), await S(!0);
101
104
  }
102
- return L(() => {
103
- const t = q(a.dataSource);
105
+ return b(() => {
106
+ const t = O(n.dataSource);
104
107
  if (!t) return;
105
108
  const e = l.path, s = { ...c.get(e) || {}, ...t };
106
- c.set(e, s), p(s);
107
- }), U(
109
+ c.set(e, s), m(s);
110
+ }), M(
108
111
  () => l.path,
109
112
  () => {
110
- D();
113
+ S();
111
114
  },
112
115
  { immediate: !0 }
113
116
  ), {
114
117
  /**
115
118
  * 数据源
116
119
  */
117
- dataSource: b(() => {
118
- const t = a.codes.reduce(
120
+ dataSource: V(() => {
121
+ const t = n.codes.reduce(
119
122
  (e, r) => {
120
- const s = P.value[r] || [];
121
- return e[r] = N(r) ? [_, ...s] : s, e;
123
+ const s = v.value[r] || [];
124
+ return e[r] = A(r) ? [E, ...s] : s, e;
122
125
  },
123
126
  {}
124
127
  );
@@ -134,9 +137,9 @@ function G(a) {
134
137
  /**
135
138
  * @description 清空所有缓存,重新请求
136
139
  */
137
- reload: R
140
+ reload: K
138
141
  };
139
142
  }
140
143
  export {
141
- G as useDataPermissionOptions
144
+ J as useDataPermissionOptions
142
145
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.5.212",
3
+ "version": "1.5.215",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -67,8 +67,8 @@
67
67
  "vue-router": "^5.0.2",
68
68
  "vxe-pc-ui": "^4.12.36",
69
69
  "vxe-table": "^4.17.48",
70
- "@dazhicheng/utils": "1.3.41",
71
- "@dazhicheng/hooks": "1.4.44"
70
+ "@dazhicheng/hooks": "1.4.44",
71
+ "@dazhicheng/utils": "1.3.41"
72
72
  },
73
73
  "files": [
74
74
  "dist"