qidian-vue-ui 1.0.96 → 1.1.0

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.
@@ -12760,8 +12760,8 @@ const QdConfigProvider = defineComponent({
12760
12760
  watchEffect(async () => {
12761
12761
  const localeMap = {
12762
12762
  "zh-CN": () => Promise.resolve().then(() => zhCN$1),
12763
- "zh-TW": () => import("./zh-TW-LiWc27ue.mjs"),
12764
- "en-US": () => import("./en-US-DPyo6heP.mjs")
12763
+ "zh-TW": () => import("./zh-TW-CFh--7Lf.mjs"),
12764
+ "en-US": () => import("./en-US-BR6k1E6q.mjs")
12765
12765
  };
12766
12766
  const loadLocale = localeMap[props.locale] || localeMap["zh-CN"];
12767
12767
  const [err, res] = await to(
@@ -13967,7 +13967,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
13967
13967
  config: {},
13968
13968
  context: {}
13969
13969
  },
13970
- setup(__props) {
13970
+ setup(__props, { expose: __expose }) {
13971
13971
  const props = __props;
13972
13972
  const currentContext = computed(() => props.config.context || props.context || {});
13973
13973
  const vIfValue = computed(() => {
@@ -14051,12 +14051,18 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
14051
14051
  currentContext
14052
14052
  );
14053
14053
  componentProps2[key] = result.value;
14054
+ } else if (typeof value === "function" && key.startsWith("on")) {
14055
+ componentProps2[key] = (...args) => {
14056
+ return value(currentContext.value, ...args);
14057
+ };
14054
14058
  } else {
14055
14059
  componentProps2[key] = value;
14056
14060
  }
14057
14061
  });
14058
14062
  return componentProps2;
14059
14063
  });
14064
+ const expose = { vIf: shouldRender };
14065
+ __expose(expose);
14060
14066
  return (_ctx, _cache) => {
14061
14067
  return shouldRender.value ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(resolvedComponent.value), normalizeProps(mergeProps({ key: 0 }, componentProps.value)), createSlots({ _: 2 }, [
14062
14068
  renderList(__props.config.slots, (slotConfig, slotName) => {
@@ -14329,8 +14335,11 @@ function authRole(role) {
14329
14335
  function hasPermi$1(permission) {
14330
14336
  return authPermission(permission);
14331
14337
  }
14332
- function hasPermiOr(permissions) {
14333
- return permissions.some((item) => {
14338
+ function hasPermiOr(permissions, strict = true) {
14339
+ if (!strict && (!permissions || !permissions.length)) {
14340
+ return true;
14341
+ }
14342
+ return permissions?.some((item) => {
14334
14343
  return authPermission(item);
14335
14344
  });
14336
14345
  }
@@ -14342,8 +14351,11 @@ function hasPermiAnd(permissions) {
14342
14351
  function hasRole$1(role) {
14343
14352
  return authRole(role);
14344
14353
  }
14345
- function hasRoleOr(roles) {
14346
- return roles.some((item) => {
14354
+ function hasRoleOr(roles, strict = true) {
14355
+ if (!strict && (!roles || !roles.length)) {
14356
+ return true;
14357
+ }
14358
+ return roles?.some((item) => {
14347
14359
  return authRole(item);
14348
14360
  });
14349
14361
  }
@@ -14373,8 +14385,7 @@ function checkPermission(el, binding) {
14373
14385
  const { value } = binding;
14374
14386
  if (!value) return;
14375
14387
  if (value instanceof Array) {
14376
- if (!value.length) return;
14377
- const hasPermissions = hasPermiOr(value);
14388
+ const hasPermissions = hasPermiOr(value, false);
14378
14389
  if (hasPermissions) return;
14379
14390
  el.parentNode?.removeChild(el);
14380
14391
  return;
@@ -14397,8 +14408,7 @@ function checkRole(el, binding) {
14397
14408
  const { value } = binding;
14398
14409
  if (!value) return;
14399
14410
  if (value instanceof Array) {
14400
- if (!value.length) return;
14401
- const hasRole2 = hasRoleOr(value);
14411
+ const hasRole2 = hasRoleOr(value, false);
14402
14412
  if (hasRole2) return;
14403
14413
  el.parentNode?.removeChild(el);
14404
14414
  return;
@@ -15733,6 +15743,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15733
15743
  firstLoad,
15734
15744
  manualTriggerLoad,
15735
15745
  loading,
15746
+ current,
15747
+ pageSize,
15748
+ total,
15736
15749
  changeCurrent,
15737
15750
  changePageSize,
15738
15751
  changePagination,
@@ -15798,7 +15811,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15798
15811
  };
15799
15812
  }
15800
15813
  });
15801
- const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-dcd10848"]]);
15814
+ const QdServiceTable = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-5a4b2682"]]);
15802
15815
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
15803
15816
  ...{
15804
15817
  name: "QdServiceList"
@@ -17124,6 +17137,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17124
17137
  passive: true
17125
17138
  });
17126
17139
  const { t } = useConfig("crud");
17140
+ const formRef = useTemplateRef("form");
17127
17141
  const formSubmitLoad = ref(false);
17128
17142
  const reProps = computed(() => {
17129
17143
  const {
@@ -17153,6 +17167,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17153
17167
  },
17154
17168
  qdDialogOptions: {
17155
17169
  ...wrapper,
17170
+ onOpened: () => {
17171
+ wrapper.onOpened?.();
17172
+ Object.assign(expose, formRef.value);
17173
+ },
17156
17174
  confirmLoading: reConfirmLoading,
17157
17175
  closeOnEscKeydown: loading || reConfirmLoading ? false : wrapper.closeOnEscKeydown,
17158
17176
  closeOnOverlayClick: loading || reConfirmLoading ? false : wrapper.closeOnOverlayClick,
@@ -17171,7 +17189,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17171
17189
  models: { data: data2, visible: inVisible }
17172
17190
  };
17173
17191
  });
17174
- const formRef = useTemplateRef("form");
17175
17192
  function show(newData) {
17176
17193
  if (newData != void 0) data.value = newData;
17177
17194
  visible.value = true;
@@ -17183,9 +17200,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
17183
17200
  show,
17184
17201
  hide
17185
17202
  };
17186
- onMounted(() => {
17187
- Object.assign(expose, formRef.value);
17188
- });
17189
17203
  __expose(expose);
17190
17204
  return (_ctx, _cache) => {
17191
17205
  return openBlock(), createBlock(_sfc_main$e, mergeProps({
@@ -18459,7 +18473,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18459
18473
  expose: __expose,
18460
18474
  emit: __emit
18461
18475
  }) {
18462
- const vHasPermi = hasPermiDirective;
18463
18476
  const props = __props;
18464
18477
  const emit = __emit;
18465
18478
  const {
@@ -18906,6 +18919,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18906
18919
  }
18907
18920
  return res;
18908
18921
  }
18922
+ function setActionVIf(el, action) {
18923
+ if (!el) return;
18924
+ const crVIf = el.vIf;
18925
+ action._vIf = crVIf && hasPermiOr(action.permi);
18926
+ }
18909
18927
  const expose = {};
18910
18928
  onMounted(() => {
18911
18929
  Object.assign(expose, tableRef.value);
@@ -18954,8 +18972,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18954
18972
  size: "small"
18955
18973
  }, {
18956
18974
  default: withCtx(() => [renderSlot(_ctx.$slots, "actions", {}, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(reProps.value.actions, (item, index2) => {
18957
- return withDirectives((openBlock(), createBlock(unref(_sfc_main$i), {
18975
+ return openBlock(), createElementBlock(Fragment, null, [item._vIf !== false ? (openBlock(), createBlock(unref(_sfc_main$i), {
18958
18976
  key: item.uid || index2,
18977
+ ref_for: true,
18978
+ ref: (el) => setActionVIf(el, item),
18959
18979
  context: getConfigRendererCtx(item),
18960
18980
  config: {
18961
18981
  is: unref(Button),
@@ -18964,8 +18984,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
18964
18984
  onClick: buildActionOnClick(item),
18965
18985
  disabled: buildActionDisabled(item)
18966
18986
  }
18967
- }, null, 8, ["context", "config"])), [[unref(vHasPermi), item.permi]]);
18968
- }), 128))], true)]),
18987
+ }, null, 8, ["context", "config"])) : createCommentVNode("", true)], 64);
18988
+ }), 256))], true)]),
18969
18989
  _: 3
18970
18990
  }), createVNode(unref(Space), {
18971
18991
  align: "center",
@@ -19060,16 +19080,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19060
19080
  layout: "vertical"
19061
19081
  })]),
19062
19082
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(reProps.value.rowActions, (item, index2) => {
19063
- return withDirectives((openBlock(), createBlock(unref(_sfc_main$i), {
19083
+ return openBlock(), createElementBlock(Fragment, null, [item._vIf !== false ? (openBlock(), createBlock(unref(_sfc_main$i), {
19064
19084
  key: item.uid || index2,
19085
+ ref_for: true,
19086
+ ref: (el) => setActionVIf(el, item),
19065
19087
  context: getConfigRendererCtx(item, slotProps),
19066
19088
  config: {
19067
19089
  is: unref(Link),
19068
19090
  ...item,
19069
19091
  onClick: buildActionOnClick(item, slotProps)
19070
19092
  }
19071
- }, null, 8, ["context", "config"])), [[unref(vHasPermi), item.permi]]);
19072
- }), 128))]),
19093
+ }, null, 8, ["context", "config"])) : createCommentVNode("", true)], 64);
19094
+ }), 256))]),
19073
19095
  _: 2
19074
19096
  }, 1024)) : createCommentVNode("", true)], true)]),
19075
19097
  _: 2
@@ -19096,7 +19118,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
19096
19118
  };
19097
19119
  }
19098
19120
  });
19099
- const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-94011095"]]);
19121
+ const table = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-c40b7121"]]);
19100
19122
  const _hoisted_1$2 = {
19101
19123
  key: 0,
19102
19124
  class: "qd-crud-list__header"
@@ -55381,4 +55403,4 @@ export {
55381
55403
  _sfc_main$a as y,
55382
55404
  QdFormItem as z
55383
55405
  };
55384
- //# sourceMappingURL=index-aiqgTd8M.mjs.map
55406
+ //# sourceMappingURL=index-OP442pVF.mjs.map