@witlink/usercenter 1.2.88 → 1.2.89

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.
@@ -41922,6 +41922,20 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
41922
41922
  trigger: "blur",
41923
41923
  validator: validateEmail
41924
41924
  }
41925
+ ],
41926
+ mobile: [
41927
+ {
41928
+ validator: (_rule, value) => {
41929
+ if (value === void 0 || value === null)
41930
+ return Promise.resolve();
41931
+ const str = String(value);
41932
+ if (!/^\d{1,15}$/.test(str)) {
41933
+ return Promise.reject(t2("uc_common.mobile_format_tip"));
41934
+ }
41935
+ return Promise.resolve();
41936
+ },
41937
+ trigger: "blur"
41938
+ }
41925
41939
  ]
41926
41940
  };
41927
41941
  });
@@ -41989,28 +42003,32 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
41989
42003
  };
41990
42004
  const dropdownRender = (list) => {
41991
42005
  const { menuNode } = list;
41992
- return h("div", [
41993
- h(
41994
- "div",
41995
- {
41996
- class: "select-all-option",
41997
- style: { padding: "8px 12px", cursor: "pointer" }
41998
- },
41999
- [
42000
- h(Checkbox$1, {
42001
- checked: isAllSelected.value,
42002
- indeterminate: isIndeterminate.value,
42003
- onClick: (e) => {
42004
- e.stopPropagation();
42005
- toggleSelectAll();
42006
- }
42007
- }),
42008
- h("span", { style: "margin-left: 8px" }, t2("uc_user.selectAll"))
42009
- ]
42010
- ),
42011
- h(Divider$1, { style: "margin: 4px 0" }),
42012
- menuNode
42013
- ]);
42006
+ const children = [];
42007
+ if (rolesList.value.length > 0) {
42008
+ children.push(
42009
+ h(
42010
+ "div",
42011
+ {
42012
+ class: "select-all-option",
42013
+ style: { padding: "8px 12px", cursor: "pointer" }
42014
+ },
42015
+ [
42016
+ h(Checkbox$1, {
42017
+ checked: isAllSelected.value,
42018
+ indeterminate: isIndeterminate.value,
42019
+ onClick: (e) => {
42020
+ e.stopPropagation();
42021
+ toggleSelectAll();
42022
+ }
42023
+ }),
42024
+ h("span", { style: "margin-left: 8px" }, t2("uc_user.selectAll"))
42025
+ ]
42026
+ ),
42027
+ h(Divider$1, { style: "margin: 4px 0" })
42028
+ );
42029
+ }
42030
+ children.push(menuNode);
42031
+ return h("div", children);
42014
42032
  };
42015
42033
  const getSystemRolesList = async () => {
42016
42034
  var _a;
@@ -43272,7 +43290,6 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
43272
43290
  const { t: t2 } = useI18n();
43273
43291
  const emit = __emit;
43274
43292
  const visible = ref(false);
43275
- const loading = ref(false);
43276
43293
  const formRef = ref();
43277
43294
  const isBind = ref(false);
43278
43295
  const formState = reactive({
@@ -43284,14 +43301,26 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
43284
43301
  {
43285
43302
  required: true,
43286
43303
  message: t2("uc_personal_center.user_pwd4_msg1"),
43287
- trigger: "blur"
43304
+ trigger: ["blur", "change"]
43288
43305
  }
43289
43306
  ],
43290
43307
  mobile: [
43291
43308
  {
43292
43309
  required: true,
43293
43310
  message: t2("uc_personal_center.mobile_placeholder"),
43294
- trigger: "blur"
43311
+ trigger: ["blur", "change"]
43312
+ },
43313
+ {
43314
+ validator: (_rule, value) => {
43315
+ if (value === void 0 || value === null)
43316
+ return Promise.resolve();
43317
+ const str = String(value);
43318
+ if (!/^\d{1,15}$/.test(str)) {
43319
+ return Promise.reject(t2("uc_common.mobile_format_tip"));
43320
+ }
43321
+ return Promise.resolve();
43322
+ },
43323
+ trigger: "change"
43295
43324
  }
43296
43325
  ]
43297
43326
  }));
@@ -43308,15 +43337,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
43308
43337
  };
43309
43338
  const handleSubmit = async () => {
43310
43339
  var _a;
43311
- try {
43312
- await ((_a = formRef.value) == null ? void 0 : _a.validate());
43313
- } catch {
43314
- return;
43315
- }
43316
- loading.value = true;
43317
- try {
43340
+ (_a = formRef.value) == null ? void 0 : _a.validate().then(async () => {
43318
43341
  const res = await updateMobile({
43319
- mobile: formState.mobile.trim(),
43342
+ mobile: formState.mobile,
43320
43343
  pwd: hash.sha256().update(formState.pwd).digest("hex")
43321
43344
  });
43322
43345
  if (res.code === 0) {
@@ -43326,9 +43349,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
43326
43349
  emit("ok");
43327
43350
  handleClose();
43328
43351
  }
43329
- } finally {
43330
- loading.value = false;
43331
- }
43352
+ });
43332
43353
  };
43333
43354
  __expose({
43334
43355
  open
@@ -43356,14 +43377,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
43356
43377
  }),
43357
43378
  createVNode(_component_a_button, {
43358
43379
  type: "primary",
43359
- loading: loading.value,
43360
43380
  onClick: handleSubmit
43361
43381
  }, {
43362
43382
  default: withCtx(() => [
43363
43383
  createTextVNode(toDisplayString(_ctx.$t("uc_common.btnSubmit")), 1)
43364
43384
  ]),
43365
43385
  _: 1
43366
- }, 8, ["loading"])
43386
+ })
43367
43387
  ]),
43368
43388
  default: withCtx(() => [
43369
43389
  createVNode(_component_a_form, {
@@ -45992,6 +46012,20 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
45992
46012
  trigger: "blur",
45993
46013
  validator: validateEmail
45994
46014
  }
46015
+ ],
46016
+ userMobile: [
46017
+ {
46018
+ validator: (_rule, value) => {
46019
+ if (value === void 0 || value === null)
46020
+ return Promise.resolve();
46021
+ const str = String(value);
46022
+ if (!/^\d{1,15}$/.test(str)) {
46023
+ return Promise.reject(t2("uc_common.mobile_format_tip"));
46024
+ }
46025
+ return Promise.resolve();
46026
+ },
46027
+ trigger: "blur"
46028
+ }
45995
46029
  ]
45996
46030
  };
45997
46031
  });