@das-fed/ui 7.1.0-dev.28 → 7.1.0-dev.29

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/ui",
3
- "version": "7.1.0-dev.28",
3
+ "version": "7.1.0-dev.29",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -26,7 +26,7 @@
26
26
  "@antv/x6-plugin-snapline": "^2.1.7",
27
27
  "@antv/x6-plugin-transform": "^2.1.8",
28
28
  "@antv/x6-vue-shape": "^2.1.2",
29
- "@das-fed/cli": "7.1.0-dev.28",
29
+ "@das-fed/cli": "7.1.0-dev.29",
30
30
  "@element-plus/icons-vue": "^2.3.1",
31
31
  "@types/lodash": "^4.14.194",
32
32
  "@types/lodash-es": "^4.17.9",
@@ -56,9 +56,9 @@
56
56
  "vue-tsc": "^2.0.29"
57
57
  },
58
58
  "dependencies": {
59
- "@das-fed/ui": "7.1.0-dev.28",
60
- "@das-fed/utils": "7.1.0-dev.28",
61
- "@das-fed/web": "7.1.0-dev.28",
59
+ "@das-fed/ui": "7.1.0-dev.29",
60
+ "@das-fed/utils": "7.1.0-dev.29",
61
+ "@das-fed/web": "7.1.0-dev.29",
62
62
  "@types/markdown-it": "^14.1.2",
63
63
  "@wangeditor-next/editor": "5.6.31",
64
64
  "@wangeditor-next/editor-for-vue": "5.1.14",
@@ -1,31 +1,31 @@
1
1
  import '@das-fed/ui/packages/business-components/change-pwd/style.css';
2
- import { ref as y, reactive as F, defineComponent as T, createBlock as v, openBlock as z, unref as t, isRef as B, withCtx as h, createElementVNode as V, createVNode as C, createCommentVNode as I, createTextVNode as A, toDisplayString as S } from "vue";
3
- import { withInstall as O } from "@das-fed/utils/with-install/index";
4
- import { t as d, i18n as x, setI18nRule as $ } from "@das-fed/web/packages/i18n/index";
5
- import { DasDialog as Z } from "@das-fed/ui/packages/components/dialog/index";
6
- import { DasFormRef as W, DasForm as j } from "@das-fed/ui/packages/components/form/index";
7
- import { DasFormItem as N } from "@das-fed/ui/packages/components/form-item/index";
8
- import { DasButton as E } from "@das-fed/ui/packages/components/button/index";
9
- import { DasMessage as G } from "@das-fed/ui/packages/components/message/index";
10
- import { enterpriseright as q, superadminPortal as H, systemConfiguration as X, justauth as Y } from "@das-fed/utils/api-services/modules";
11
- import { encryption as k } from "@das-fed/utils/atob";
12
- const D = q.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), U = q.put("/user/change-pwd", (r) => (r.csrf = !0, r)), J = H.put("/change-pwd"), Q = X.get("/visitor/login/with-default"), ee = "RSA_V1:", re = async (r) => {
2
+ import { ref as b, reactive as I, defineComponent as O, createBlock as V, openBlock as A, unref as t, isRef as $, withCtx as C, createElementVNode as S, createVNode as y, createCommentVNode as Z, createTextVNode as x, toDisplayString as E } from "vue";
3
+ import { withInstall as W } from "@das-fed/utils/with-install/index";
4
+ import { t as d, i18n as D, setI18nRule as j } from "@das-fed/web/packages/i18n/index";
5
+ import { DasDialog as G } from "@das-fed/ui/packages/components/dialog/index";
6
+ import { DasFormRef as H, DasForm as X } from "@das-fed/ui/packages/components/form/index";
7
+ import { DasFormItem as q } from "@das-fed/ui/packages/components/form-item/index";
8
+ import { DasButton as U } from "@das-fed/ui/packages/components/button/index";
9
+ import { DasMessage as Y } from "@das-fed/ui/packages/components/message/index";
10
+ import { enterpriseright as z, superadminPortal as J, systemConfiguration as Q, justauth as ee } from "@das-fed/utils/api-services/modules";
11
+ import { encryption as v } from "@das-fed/utils/atob";
12
+ const M = z.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), K = z.put("/user/change-pwd", (r) => (r.csrf = !0, r)), re = J.put("/change-pwd"), te = Q.get("/visitor/login/with-default"), ne = "RSA_V1:", ae = async (r) => {
13
13
  const n = window.atob(r), p = new Uint8Array(n.length);
14
14
  for (let a = 0; a < n.length; a++)
15
15
  p[a] = n.charCodeAt(a);
16
16
  return window.crypto.subtle.importKey("spki", p.buffer, { name: "RSA-OAEP", hash: "SHA-256" }, !1, ["encrypt"]);
17
- }, te = (r) => {
17
+ }, oe = (r) => {
18
18
  let n = "";
19
19
  const p = new Uint8Array(r);
20
20
  for (let a = 0; a < p.byteLength; a++)
21
21
  n += String.fromCharCode(p[a]);
22
22
  return window.btoa(n);
23
- }, ne = async (r) => {
23
+ }, se = async (r) => {
24
24
  try {
25
25
  const n = await r();
26
26
  if (!n.trim())
27
- return async (a) => k(a);
28
- const p = await re(n);
27
+ return async (a) => v(a);
28
+ const p = await ae(n);
29
29
  return async (a) => {
30
30
  try {
31
31
  const l = await window.crypto.subtle.encrypt(
@@ -33,25 +33,25 @@ const D = q.get("/user/change-pwd", (r) => (r.ignoreErrorMessage = !0, r)), U =
33
33
  p,
34
34
  new TextEncoder().encode(a)
35
35
  );
36
- return ee + te(l);
36
+ return ne + oe(l);
37
37
  } catch {
38
- return k(a);
38
+ return v(a);
39
39
  }
40
40
  };
41
41
  } catch {
42
- return async (n) => k(n);
42
+ return async (n) => v(n);
43
43
  }
44
- }, ae = q.get("/visitor/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
45
- Y.get("/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
46
- const oe = async () => {
47
- const [r, n] = await ae().run();
44
+ }, ie = z.get("/visitor/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
45
+ ee.get("/rsa/public-key", (r) => (r.ignoreErrorMessage = !0, r));
46
+ const pe = async () => {
47
+ const [r, n] = await ie().run();
48
48
  return r || !n ? "" : typeof n.publicKey == "string" ? n.publicKey : "";
49
- }, se = (r, n) => {
50
- const p = y(!1), a = W(), l = y({
49
+ }, de = (r, n) => {
50
+ const p = b(!1), a = H(), l = b({
51
51
  prePwd: "",
52
52
  pwd: "",
53
53
  confirmPwd: ""
54
- }), o = F({
54
+ }), o = I({
55
55
  pwdStrongLimit: !1,
56
56
  // 是否开启密码强度校验
57
57
  pwdRequireLength: !1,
@@ -66,29 +66,29 @@ const oe = async () => {
66
66
  // 密码要求包含大写字母
67
67
  pwdRequireSpecialCharacter: !1
68
68
  // 密码要求特殊字符
69
- }), R = async () => {
70
- const [s, e] = await Q().run();
69
+ }), _ = async () => {
70
+ const [s, e] = await te().run();
71
71
  s || (o.pwdStrongLimit = e.pwdStrongLimit, o.pwdRequireLength = e.pwdRequireLength, o.pwdMinLength = e.pwdMinLength, o.pwdRequireNum = e.pwdRequireNum, o.pwdRequireLowercaseLetters = e.pwdRequireLowercaseLetters, o.pwdRequireUppercaseLetters = e.pwdRequireUppercaseLetters, o.pwdRequireSpecialCharacter = e.pwdRequireSpecialCharacter);
72
- }, m = (s) => {
72
+ }, w = (s) => {
73
73
  let e = "";
74
- return o.pwdStrongLimit ? e = M(s) : e = f(s), e;
75
- }, P = (s, e, i) => {
76
- var u;
74
+ return o.pwdStrongLimit ? e = F(s) : e = c(s), e;
75
+ }, L = (s, e, i) => {
76
+ var m;
77
77
  if (!e) return i(new Error(d("新密码不能为空")));
78
78
  if (r.mainApp === "enterpriseadmin") {
79
- const c = m(e);
80
- if ((u = a.value) == null || u.validateField("confirmPwd", () => null), c) return i(new Error(c));
79
+ const h = w(e);
80
+ if ((m = a.value) == null || m.validateField("confirmPwd", () => null), h) return i(new Error(h));
81
81
  }
82
82
  i();
83
- }, _ = (s, e, i) => {
83
+ }, N = (s, e, i) => {
84
84
  if (!e) return i(new Error(d("确认密码不能为空")));
85
85
  if (l.value.pwd !== e) return i(new Error(d("与新密码不一致")));
86
86
  if (r.mainApp === "enterpriseadmin") {
87
- const u = m(e);
88
- if (u) return i(new Error(u));
87
+ const m = w(e);
88
+ if (m) return i(new Error(m));
89
89
  }
90
90
  i();
91
- }, b = y({
91
+ }, R = b({
92
92
  prePwd: [
93
93
  {
94
94
  required: !r.forceUpdate,
@@ -96,88 +96,92 @@ const oe = async () => {
96
96
  trigger: "blur"
97
97
  }
98
98
  ],
99
- pwd: [{ validator: P, trigger: "blur" }],
100
- confirmPwd: [{ validator: _, trigger: "blur" }]
101
- }), g = y(""), L = (s) => {
102
- r.mainApp === "enterpriseadmin" && R(), p.value = !0, g.value = s || "";
103
- }, w = (s = !1) => {
99
+ pwd: [{ validator: L, trigger: "blur" }],
100
+ confirmPwd: [{ validator: N, trigger: "blur" }]
101
+ }), g = b(""), k = (s) => {
102
+ r.mainApp === "enterpriseadmin" && _(), p.value = !0, g.value = s || "";
103
+ }, u = (s = !1) => {
104
104
  var e;
105
105
  l.value.prePwd = "", l.value.pwd = "", l.value.confirmPwd = "", (e = a.value) == null || e.resetField(), p.value = !1, s || n("onCancel");
106
- }, f = (s) => {
106
+ }, c = (s) => {
107
107
  const e = d("das-ui-business-components-change-pwd-passwordFormatRule");
108
108
  return /^(?=.*[a-zA-Z])(?=.*[\d])(?=.*[\w])[a-zA-Z\d\W_]{8,20}$/.test(s) ? "" : e;
109
- }, M = (s) => {
109
+ }, F = (s) => {
110
110
  let e = "", i = !1;
111
111
  e += d("das-ui-business-components-change-pwd-limit-number", o.pwdMinLength);
112
- const u = `\\S{${o.pwdMinLength},}`;
113
- return new RegExp(u).test(s) || (i = !0), (o.pwdRequireNum || o.pwdRequireLowercaseLetters || o.pwdRequireUppercaseLetters || o.pwdRequireSpecialCharacter) && (e += d("必须包含")), o.pwdRequireNum && (e += d("数字,"), /\d+/.test(s) || (i = !0)), o.pwdRequireLowercaseLetters && (e += d("小写字母,"), /[a-z]+/.test(s) || (i = !0)), o.pwdRequireUppercaseLetters && (e += d("大写字母,"), /[A-Z]+/.test(s) || (i = !0)), o.pwdRequireSpecialCharacter && (e += d("符号,"), /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~]+/.test(s) || (i = !0)), i ? e.slice(0, -1) : "";
112
+ const m = `\\S{${o.pwdMinLength},}`;
113
+ return new RegExp(m).test(s) || (i = !0), (o.pwdRequireNum || o.pwdRequireLowercaseLetters || o.pwdRequireUppercaseLetters || o.pwdRequireSpecialCharacter) && (e += d("必须包含")), o.pwdRequireNum && (e += d("数字,"), /\d+/.test(s) || (i = !0)), o.pwdRequireLowercaseLetters && (e += d("小写字母,"), /[a-z]+/.test(s) || (i = !0)), o.pwdRequireUppercaseLetters && (e += d("大写字母,"), /[A-Z]+/.test(s) || (i = !0)), o.pwdRequireSpecialCharacter && (e += d("符号,"), /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~]+/.test(s) || (i = !0)), i ? e.slice(0, -1) : "";
114
114
  };
115
115
  return {
116
116
  visible: p,
117
117
  formData: l,
118
118
  form: a,
119
- rules: b,
120
- openDialog: L,
121
- onCancel: w,
119
+ rules: R,
120
+ openDialog: k,
121
+ onCancel: u,
122
122
  onConfirm: async () => {
123
123
  var s;
124
124
  (s = a.value) == null || s.validate(async (e) => {
125
- const i = await ne(oe);
125
+ const i = await se(pe), [m, h, T] = await Promise.all([
126
+ i(l.value.pwd),
127
+ i(l.value.confirmPwd),
128
+ i(l.value.prePwd)
129
+ ]);
126
130
  if (e) {
127
- const u = {
128
- pwd: i(l.value.pwd),
129
- confirmPwd: i(l.value.confirmPwd)
131
+ const P = {
132
+ pwd: m,
133
+ confirmPwd: h
130
134
  };
131
135
  if (r.mainApp === "enterpriseadmin" && r.forceUpdate) {
132
- let c = {};
133
- g.value && (c = { headers: { Authorization: g.value } }), await D({}, c).run();
134
- const [K] = await U({}, c).run(u);
135
- if (K) return;
136
- } else if (u.prePwd = i(l.value.prePwd), r.mainApp === "enterpriseadmin") {
137
- await D().run();
138
- const [c] = await U().run(u);
139
- if (c) return;
136
+ let f = {};
137
+ g.value && (f = { headers: { Authorization: g.value } }), await M({}, f).run();
138
+ const [B] = await K({}, f).run(P);
139
+ if (B) return;
140
+ } else if (P.prePwd = T, r.mainApp === "enterpriseadmin") {
141
+ await M().run();
142
+ const [f] = await K().run(P);
143
+ if (f) return;
140
144
  } else {
141
- const [c] = await J().run(u);
142
- if (c) return;
145
+ const [f] = await re().run(P);
146
+ if (f) return;
143
147
  }
144
- w(!0), G.success(d("修改密码成功!")), n("onConfirm");
148
+ u(!0), Y.success(d("修改密码成功!")), n("onConfirm");
145
149
  }
146
150
  });
147
151
  }
148
152
  };
149
- }, ie = { class: "dialog-content" }, pe = {
153
+ }, le = { class: "dialog-content" }, ue = {
150
154
  name: "ChangePwd"
151
- }, de = /* @__PURE__ */ T({
152
- ...pe,
155
+ }, we = /* @__PURE__ */ O({
156
+ ...ue,
153
157
  props: {
154
158
  mainApp: { default: "enterpriseadmin" },
155
159
  forceUpdate: { type: Boolean }
156
160
  },
157
161
  emits: ["onCancel", "onConfirm"],
158
162
  setup(r, { expose: n, emit: p }) {
159
- const a = r, l = p, { visible: o, form: R, formData: m, rules: P, openDialog: _, onCancel: b, onConfirm: g } = se(a, l);
163
+ const a = r, l = p, { visible: o, form: _, formData: w, rules: L, openDialog: N, onCancel: R, onConfirm: g } = de(a, l);
160
164
  return n({
161
- openDialog: _
162
- }), (L, w) => (z(), v(t(Z), {
165
+ openDialog: N
166
+ }), (k, u) => (A(), V(t(G), {
163
167
  title: t(d)("修改密码"),
164
168
  width: "460px",
165
169
  height: "360px",
166
170
  bodyStyle: { padding: 0 },
167
171
  modelValue: t(o),
168
- "onUpdate:modelValue": w[3] || (w[3] = (f) => B(o) ? o.value = f : null),
169
- "before-close": t(b)
172
+ "onUpdate:modelValue": u[3] || (u[3] = (c) => $(o) ? o.value = c : null),
173
+ "before-close": t(R)
170
174
  }, {
171
- footer: h(() => [
172
- V("div", null, [
173
- C(t(E), {
175
+ footer: C(() => [
176
+ S("div", null, [
177
+ y(t(U), {
174
178
  size: "middle",
175
179
  style: { "margin-right": "12px" },
176
- onClick: t(b)
180
+ onClick: t(R)
177
181
  }, {
178
- default: h(() => [
179
- A(
180
- S(t(x)("取消").value),
182
+ default: C(() => [
183
+ x(
184
+ E(t(D)("取消").value),
181
185
  1
182
186
  /* TEXT */
183
187
  )
@@ -185,14 +189,14 @@ const oe = async () => {
185
189
  _: 1
186
190
  /* STABLE */
187
191
  }, 8, ["onClick"]),
188
- C(t(E), {
192
+ y(t(U), {
189
193
  btnType: "primary",
190
194
  size: "middle",
191
195
  onClick: t(g)
192
196
  }, {
193
- default: h(() => [
194
- A(
195
- S(t(x)("确定").value),
197
+ default: C(() => [
198
+ x(
199
+ E(t(D)("确定").value),
196
200
  1
197
201
  /* TEXT */
198
202
  )
@@ -202,16 +206,16 @@ const oe = async () => {
202
206
  }, 8, ["onClick"])
203
207
  ])
204
208
  ]),
205
- default: h(() => [
206
- V("div", ie, [
207
- C(t(j), {
209
+ default: C(() => [
210
+ S("div", le, [
211
+ y(t(X), {
208
212
  ref_key: "form",
209
- ref: R,
210
- rules: t(P),
213
+ ref: _,
214
+ rules: t(L),
211
215
  style: { "overflow-x": "hidden !important" }
212
216
  }, {
213
- default: h(() => [
214
- L.forceUpdate ? I("v-if", !0) : (z(), v(t(N), {
217
+ default: C(() => [
218
+ k.forceUpdate ? Z("v-if", !0) : (A(), V(t(q), {
215
219
  key: 0,
216
220
  type: "password",
217
221
  isTitle: !1,
@@ -219,34 +223,34 @@ const oe = async () => {
219
223
  "show-password": "",
220
224
  prop: "prePwd",
221
225
  label: t(d)("旧密码"),
222
- modelValue: t(m).prePwd,
223
- "onUpdate:modelValue": w[0] || (w[0] = (f) => t(m).prePwd = f),
226
+ modelValue: t(w).prePwd,
227
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => t(w).prePwd = c),
224
228
  modelModifiers: { trim: !0 },
225
229
  maxlength: 20,
226
230
  required: ""
227
231
  }, null, 8, ["label", "modelValue"])),
228
- C(t(N), {
232
+ y(t(q), {
229
233
  type: "password",
230
234
  isTitle: !1,
231
235
  autocomplete: "new-password",
232
236
  "show-password": "",
233
237
  prop: "pwd",
234
238
  label: t(d)("新密码"),
235
- modelValue: t(m).pwd,
236
- "onUpdate:modelValue": w[1] || (w[1] = (f) => t(m).pwd = f),
239
+ modelValue: t(w).pwd,
240
+ "onUpdate:modelValue": u[1] || (u[1] = (c) => t(w).pwd = c),
237
241
  modelModifiers: { trim: !0 },
238
242
  maxlength: 20,
239
243
  required: ""
240
244
  }, null, 8, ["label", "modelValue"]),
241
- C(t(N), {
245
+ y(t(q), {
242
246
  type: "password",
243
247
  isTitle: !1,
244
248
  autocomplete: "new-password",
245
249
  "show-password": "",
246
250
  prop: "confirmPwd",
247
251
  label: t(d)("确认新密码"),
248
- modelValue: t(m).confirmPwd,
249
- "onUpdate:modelValue": w[2] || (w[2] = (f) => t(m).confirmPwd = f),
252
+ modelValue: t(w).confirmPwd,
253
+ "onUpdate:modelValue": u[2] || (u[2] = (c) => t(w).confirmPwd = c),
250
254
  modelModifiers: { trim: !0 },
251
255
  maxlength: 20,
252
256
  required: ""
@@ -261,12 +265,12 @@ const oe = async () => {
261
265
  /* STABLE */
262
266
  }, 8, ["title", "modelValue", "before-close"]));
263
267
  }
264
- }), le = (r, n) => {
268
+ }), ce = (r, n) => {
265
269
  const p = r.__vccOpts || r;
266
270
  for (const [a, l] of n)
267
271
  p[a] = l;
268
272
  return p;
269
- }, ue = /* @__PURE__ */ le(de, [["__scopeId", "data-v-901c1af6"]]), we = {
273
+ }, me = /* @__PURE__ */ ce(we, [["__scopeId", "data-v-901c1af6"]]), fe = {
270
274
  新密码不能为空: { "zh-CN": "新密码不能为空", en: "New password cannot be empty", _appCode: "framework" },
271
275
  确认密码不能为空: { "zh-CN": "确认密码不能为空", en: "Confirm password cannot be empty", _appCode: "framework" },
272
276
  与新密码不一致: { "zh-CN": "与新密码不一致", en: "Doesn't match the new password", _appCode: "framework" },
@@ -298,9 +302,9 @@ const oe = async () => {
298
302
  _appCode: "framework"
299
303
  }
300
304
  };
301
- $(we);
302
- const Le = O(ue), Ne = () => y(null);
305
+ j(fe);
306
+ const qe = W(me), ve = () => b(null);
303
307
  export {
304
- Le as DasChangePwd,
305
- Ne as DasChangePwdRef
308
+ qe as DasChangePwd,
309
+ ve as DasChangePwdRef
306
310
  };