el-plus 0.0.76 → 0.0.78

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +112 -71
  4. package/dist/index.full.min.js +4 -4
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +4 -4
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +113 -72
  9. package/es/components/attachment/index.d.ts +24 -0
  10. package/es/components/attachment/src/attachment.d.ts +8 -0
  11. package/es/components/attachment/src/attachment.mjs +8 -0
  12. package/es/components/attachment/src/attachment.mjs.map +1 -1
  13. package/es/components/attachment/src/attachment.vue.d.ts +15 -0
  14. package/es/components/attachment/src/attachment.vue2.mjs +10 -5
  15. package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
  16. package/es/components/attachment/src/use-attachment.d.ts +14 -105
  17. package/es/components/attachment/src/use-attachment.mjs +31 -30
  18. package/es/components/attachment/src/use-attachment.mjs.map +1 -1
  19. package/es/components/header/index.d.ts +6 -0
  20. package/es/components/header/src/header.vue.d.ts +2 -0
  21. package/es/components/search-list-page/index.d.ts +42 -15
  22. package/es/components/search-list-page/src/search-list-page.vue.d.ts +14 -5
  23. package/es/components/search-list-page/src/use-search-list-page.d.ts +14 -5
  24. package/es/components/table/index.d.ts +15 -3
  25. package/es/components/table/src/table.d.ts +4 -1
  26. package/es/components/table/src/table.mjs +4 -0
  27. package/es/components/table/src/table.mjs.map +1 -1
  28. package/es/components/table/src/table.vue.d.ts +9 -2
  29. package/es/components/table/src/table.vue2.mjs +17 -6
  30. package/es/components/table/src/table.vue2.mjs.map +1 -1
  31. package/es/components/table/src/use-table.mjs +1 -1
  32. package/es/components/table/src/use-table.mjs.map +1 -1
  33. package/es/components/uni-vue/index.d.ts +23 -3
  34. package/es/components/uni-vue/src/uni-vue.vue.d.ts +10 -2
  35. package/es/components/uni-vue/src/uni-vue.vue2.mjs +4 -2
  36. package/es/components/uni-vue/src/uni-vue.vue2.mjs.map +1 -1
  37. package/es/components/uni-vue/src/use-uni-vue.d.ts +1 -1
  38. package/es/components/uni-vue/src/use-uni-vue.mjs +39 -27
  39. package/es/components/uni-vue/src/use-uni-vue.mjs.map +1 -1
  40. package/es/package.json.mjs +1 -1
  41. package/lib/components/attachment/index.d.ts +24 -0
  42. package/lib/components/attachment/src/attachment.d.ts +8 -0
  43. package/lib/components/attachment/src/attachment.js +8 -0
  44. package/lib/components/attachment/src/attachment.js.map +1 -1
  45. package/lib/components/attachment/src/attachment.vue.d.ts +15 -0
  46. package/lib/components/attachment/src/attachment.vue2.js +11 -6
  47. package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
  48. package/lib/components/attachment/src/use-attachment.d.ts +14 -105
  49. package/lib/components/attachment/src/use-attachment.js +31 -30
  50. package/lib/components/attachment/src/use-attachment.js.map +1 -1
  51. package/lib/components/header/index.d.ts +6 -0
  52. package/lib/components/header/src/header.vue.d.ts +2 -0
  53. package/lib/components/search-list-page/index.d.ts +42 -15
  54. package/lib/components/search-list-page/src/search-list-page.vue.d.ts +14 -5
  55. package/lib/components/search-list-page/src/use-search-list-page.d.ts +14 -5
  56. package/lib/components/table/index.d.ts +15 -3
  57. package/lib/components/table/src/table.d.ts +4 -1
  58. package/lib/components/table/src/table.js +4 -0
  59. package/lib/components/table/src/table.js.map +1 -1
  60. package/lib/components/table/src/table.vue.d.ts +9 -2
  61. package/lib/components/table/src/table.vue2.js +17 -6
  62. package/lib/components/table/src/table.vue2.js.map +1 -1
  63. package/lib/components/table/src/use-table.js +1 -1
  64. package/lib/components/table/src/use-table.js.map +1 -1
  65. package/lib/components/uni-vue/index.d.ts +23 -3
  66. package/lib/components/uni-vue/src/uni-vue.vue.d.ts +10 -2
  67. package/lib/components/uni-vue/src/uni-vue.vue2.js +4 -2
  68. package/lib/components/uni-vue/src/uni-vue.vue2.js.map +1 -1
  69. package/lib/components/uni-vue/src/use-uni-vue.d.ts +1 -1
  70. package/lib/components/uni-vue/src/use-uni-vue.js +38 -26
  71. package/lib/components/uni-vue/src/use-uni-vue.js.map +1 -1
  72. package/lib/package.json.js +1 -1
  73. package/package.json +1 -1
  74. package/theme-chalk/header.css +1 -1
  75. package/theme-chalk/index.css +1 -1
  76. package/theme-chalk/src/header.scss +8 -1
@@ -1,4 +1,4 @@
1
- /*! ElPlus v0.0.76 */
1
+ /*! ElPlus v0.0.78 */
2
2
 
3
3
  import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw } from 'vue';
4
4
  import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, configProviderContextKey, ElConfigProvider, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1, ElSkeleton } from 'element-plus';
@@ -10,7 +10,7 @@ import * as qs from 'qs';
10
10
  import elTableProps from 'element-plus/es/components/table/src/table/defaults';
11
11
  import { ArrowUp, ArrowDown, EditPen } from '@element-plus/icons-vue';
12
12
  import mitt from 'mitt';
13
- import { merge, cloneDeep } from 'lodash-unified';
13
+ import { merge, cloneDeep, uniqueId } from 'lodash-unified';
14
14
  import { useToggle } from '@vueuse/core';
15
15
  import { useRouter, useRoute } from 'vue-router';
16
16
  import { encode } from 'js-base64';
@@ -1839,6 +1839,10 @@ const inheritTableProps = {
1839
1839
  fontSize: "14px",
1840
1840
  color: "#505050"
1841
1841
  })
1842
+ },
1843
+ rowKey: {
1844
+ type: String,
1845
+ default: "_rowKey"
1842
1846
  }
1843
1847
  };
1844
1848
  const expandTableProps = {
@@ -2300,7 +2304,7 @@ const useTableFormItem = (props) => {
2300
2304
  isShowLabel: false,
2301
2305
  required,
2302
2306
  hideRequiredAsterisk: "cellRequired" in item ? false : required,
2303
- prop: `table.${scope.$index}.${item.prop}`,
2307
+ prop: `table.${scope.row[props.rowKey]}.${item.prop}`,
2304
2308
  tableProp: item.prop,
2305
2309
  // table里的表单需要绑定的prop
2306
2310
  props: {
@@ -2344,6 +2348,18 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
2344
2348
  ...prepareEvents(emit, tableEmitsKeys)
2345
2349
  };
2346
2350
  });
2351
+ const tableData = computed(() => {
2352
+ const result = {};
2353
+ data.value?.forEach((item, index) => {
2354
+ if (props.rowKey === "_rowKey") {
2355
+ item[props.rowKey] = uniqueId();
2356
+ }
2357
+ result[item[props.rowKey]] = item;
2358
+ });
2359
+ return {
2360
+ table: result
2361
+ };
2362
+ });
2347
2363
  const {
2348
2364
  pagination,
2349
2365
  paginationProps,
@@ -2394,9 +2410,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
2394
2410
  }, [createVNode(_component_el_form, {
2395
2411
  ref_key: "elFormRef",
2396
2412
  ref: elFormRef,
2397
- model: {
2398
- table: unref(data)
2399
- },
2413
+ model: tableData.value,
2400
2414
  size: "small",
2401
2415
  "hide-required-asterisk": "",
2402
2416
  "scroll-to-error": "",
@@ -2459,14 +2473,14 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
2459
2473
  _: 1
2460
2474
  }, 8, ["label", "align", "width"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(columnList), (item, index) => {
2461
2475
  return openBlock(), createBlock(_component_el_table_column, mergeProps({
2462
- key: index
2476
+ key: `${item.prop}_${item.type}_${index}`
2463
2477
  }, {
2464
2478
  ref_for: true
2465
2479
  }, item), {
2466
2480
  default: withCtx((scope) => [item.type || item.render ? (openBlock(), createBlock(unref(EpFormItem), mergeProps({
2467
- key: 0,
2468
2481
  "form-data": scope.row,
2469
- "table-scope": scope
2482
+ "table-scope": scope,
2483
+ key: `${scope.row[props.rowKey]}_${item.prop}`
2470
2484
  }, {
2471
2485
  ref_for: true
2472
2486
  }, unref(formItemProps)(scope, item)), null, 16, ["form-data", "table-scope"])) : (openBlock(), createElementBlock(Fragment, {
@@ -3370,6 +3384,10 @@ const attachmentProps = {
3370
3384
  formatColumns: {
3371
3385
  ...tableProps.formatColumns
3372
3386
  },
3387
+ rowKey: {
3388
+ type: String,
3389
+ default: "fileId"
3390
+ },
3373
3391
  // 页面模式
3374
3392
  mode: {
3375
3393
  type: String
@@ -3397,6 +3415,10 @@ const attachmentProps = {
3397
3415
  // 添加前校验
3398
3416
  beforeAdd: {
3399
3417
  type: Function
3418
+ },
3419
+ // 权限
3420
+ permission: {
3421
+ type: String
3400
3422
  }
3401
3423
  };
3402
3424
 
@@ -3547,38 +3569,30 @@ const useAttachment = (props, { data }) => {
3547
3569
  const isDialogOpen = props.openType === "dialog";
3548
3570
  let toBeConfirmData = [];
3549
3571
  let toBeDeleteData = {};
3550
- const columns = ref([
3572
+ const actionButtons = ref([
3551
3573
  {
3552
- type: "EpButtons",
3553
- label: t("ep.attachment.operation"),
3554
- width: "120px",
3555
- props: {
3556
- type: "text",
3557
- list: [
3558
- {
3559
- name: t("ep.attachment.download"),
3560
- onClick({ row }) {
3561
- downloadFile({
3562
- src: row.filePath,
3563
- fileName: row.originalFilename || row.originalFileName
3564
- });
3565
- }
3566
- },
3567
- {
3568
- name: t("ep.attachment.delete"),
3569
- disabled: () => {
3570
- return mode.value === "browse";
3571
- },
3572
- onClick: ({ $index, row }) => {
3573
- if (isDialogOpen) {
3574
- toBeDeleteData[$index] = row;
3575
- }
3576
- data.value.splice($index, 1);
3577
- }
3578
- }
3579
- ]
3574
+ name: t("ep.attachment.download"),
3575
+ onClick({ row }) {
3576
+ downloadFile({
3577
+ src: row.filePath,
3578
+ fileName: row.originalFilename || row.originalFileName
3579
+ });
3580
3580
  }
3581
3581
  },
3582
+ {
3583
+ name: t("ep.attachment.delete"),
3584
+ disabled: () => {
3585
+ return mode.value === "browse";
3586
+ },
3587
+ onClick: ({ $index, row }) => {
3588
+ if (isDialogOpen) {
3589
+ toBeDeleteData[$index] = row;
3590
+ }
3591
+ data.value.splice($index, 1);
3592
+ }
3593
+ }
3594
+ ]);
3595
+ const columns = ref([
3582
3596
  {
3583
3597
  label: t("ep.attachment.attachmentType"),
3584
3598
  prop: "type",
@@ -3656,14 +3670,23 @@ const useAttachment = (props, { data }) => {
3656
3670
  }
3657
3671
  resolve();
3658
3672
  };
3673
+ const permission = computed(() => {
3674
+ const arr = props.permission?.split(":") || [];
3675
+ return {
3676
+ arg: arr[0],
3677
+ value: arr[1]
3678
+ };
3679
+ });
3659
3680
  return {
3660
3681
  columns,
3682
+ actionButtons,
3661
3683
  addAttachment,
3662
3684
  isNormalOpen,
3663
3685
  isDialogOpen,
3664
3686
  onConfirm,
3665
3687
  onCancel,
3666
- mode
3688
+ mode,
3689
+ permission
3667
3690
  };
3668
3691
  };
3669
3692
 
@@ -3683,7 +3706,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3683
3706
  const bem = createNameSpace("attachment");
3684
3707
  const props = __props;
3685
3708
  const modelValue = useModel(__props, "modelValue");
3686
- const { columns, addAttachment, isNormalOpen, onConfirm, onCancel, mode } = useAttachment(props, {
3709
+ const { columns, actionButtons, addAttachment, isNormalOpen, permission, onConfirm, onCancel, mode } = useAttachment(props, {
3687
3710
  data: modelValue
3688
3711
  });
3689
3712
  const AttachmentDialog = useDialog({
@@ -3715,7 +3738,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3715
3738
  return (_ctx, _cache) => {
3716
3739
  const _component_EpButtons = resolveComponent("EpButtons");
3717
3740
  return openBlock(), createElementBlock(Fragment, null, [
3718
- props.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
3741
+ props.isShowOpenDialogButton ? withDirectives((openBlock(), createBlock(unref(ElButton), {
3719
3742
  key: 0,
3720
3743
  type: "primary",
3721
3744
  plain: "",
@@ -3727,7 +3750,9 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3727
3750
  createTextVNode(toDisplayString(unref(t)("ep.attachment.manageAttachment")) + "(" + toDisplayString(modelValue.value?.length || 0) + ") ", 1)
3728
3751
  ]),
3729
3752
  _: 1
3730
- }, 8, ["class", "onClick"])) : createCommentVNode("", true),
3753
+ }, 8, ["class", "onClick"])), [
3754
+ [unref(vPermisson), unref(permission)]
3755
+ ]) : createCommentVNode("", true),
3731
3756
  createVNode(unref(AttachmentDialog), null, {
3732
3757
  default: withCtx(() => [
3733
3758
  createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
@@ -3750,8 +3775,10 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3750
3775
  ...unref(prepareStyles)()
3751
3776
  },
3752
3777
  columns: unref(columns),
3778
+ "action-buttons": unref(actionButtons),
3779
+ actionColWidth: "110",
3753
3780
  data: modelValue.value
3754
- }, props), null, 16, ["class", "style", "columns", "data"])
3781
+ }, props), null, 16, ["class", "style", "columns", "action-buttons", "data"])
3755
3782
  ]),
3756
3783
  _: 1
3757
3784
  })
@@ -3998,7 +4025,7 @@ const uniVueProps = {
3998
4025
  // 组件类型 bpm、 address
3999
4026
  };
4000
4027
 
4001
- const useUniVue = (props) => {
4028
+ const useUniVue = (props, emit) => {
4002
4029
  const uniVue = useTemplateRef("uniVue");
4003
4030
  const { type } = props;
4004
4031
  const loading = ref(true);
@@ -4032,7 +4059,7 @@ const useUniVue = (props) => {
4032
4059
  let eventName = key.slice(2);
4033
4060
  if (eventName.startsWith("Update:")) {
4034
4061
  eventName = "update:" + eventName.slice(7);
4035
- if (eventName === "update:value") {
4062
+ if (eventName === "update:modelValue") {
4036
4063
  eventName = "input";
4037
4064
  }
4038
4065
  } else {
@@ -4041,10 +4068,13 @@ const useUniVue = (props) => {
4041
4068
  }
4042
4069
  events[eventName] = attrs[key];
4043
4070
  } else {
4044
- _props[key] = attrs[key];
4071
+ if (key === "modelValue") {
4072
+ _props.value = attrs[key];
4073
+ } else {
4074
+ _props[key] = attrs[key];
4075
+ }
4045
4076
  }
4046
4077
  });
4047
- console.log(events, _props, 9999);
4048
4078
  return {
4049
4079
  on: events,
4050
4080
  props: _props
@@ -4056,7 +4086,7 @@ const useUniVue = (props) => {
4056
4086
  case "bpm":
4057
4087
  return `${cdn}bpm-common/common/index.umd.min.js`;
4058
4088
  case "address":
4059
- return `./hx-address.js`;
4089
+ return `http://localhost:8001/dist/hx-address.js`;
4060
4090
  default:
4061
4091
  return "";
4062
4092
  }
@@ -4148,6 +4178,22 @@ const useUniVue = (props) => {
4148
4178
  }
4149
4179
  }
4150
4180
  shadowRoot.appendChild(container);
4181
+ console.log(prepareVueAttributes());
4182
+ const baseEvents = {
4183
+ ...prepareVueAttributes().on,
4184
+ "input": (newVal) => {
4185
+ console.log(newVal, "input", props.name);
4186
+ emit("update:modelValue", newVal);
4187
+ },
4188
+ "update:dialogFormData": (newVal) => {
4189
+ console.log(newVal, "update:dialogFormData");
4190
+ emit("update:dialogFormData", newVal);
4191
+ },
4192
+ "update:visible": (newVal) => {
4193
+ console.log(newVal, "update:visible");
4194
+ emit("update:visible", newVal);
4195
+ }
4196
+ };
4151
4197
  instance = new Vue2({
4152
4198
  el: container,
4153
4199
  // @ts-expect-error 缺少类型定义
@@ -4156,38 +4202,31 @@ const useUniVue = (props) => {
4156
4202
  props: {
4157
4203
  ...prepareVueAttributes().props
4158
4204
  },
4159
- on: {
4160
- ...prepareVueAttributes().on,
4161
- // 'update:dialogFormData': (newVal) => {
4162
- // console.log(newVal, 'update:dialogFormData');
4163
- // },
4164
- // 'update:visible': (newVal) => {
4165
- // console.log(newVal, 'update:visible');
4166
- // },
4167
- "input": (newVal) => {
4168
- console.log(newVal, "input");
4169
- }
4170
- }
4205
+ on: baseEvents
4171
4206
  })
4172
4207
  });
4173
4208
  };
4174
4209
  Object.keys(attrs).forEach((key) => {
4175
- if (key.startsWith("onUpdate:")) {
4176
- const propName = key.slice(9);
4210
+ console.log(key, 8);
4211
+ if (!key.startsWith("on")) {
4177
4212
  watch(
4178
- () => attrs[propName],
4213
+ () => attrs[key],
4179
4214
  (newVal) => {
4180
- if (instance) {
4215
+ nextTick(() => {
4181
4216
  try {
4182
- console.log(newVal, "newVal", propName, instance);
4183
- instance.$children[0][propName] = newVal;
4217
+ console.log(props.name, newVal, "watch", key, instance);
4218
+ let vue2Prop = key;
4219
+ if (key === "modelValue") {
4220
+ vue2Prop = "value";
4221
+ }
4222
+ instance.$children[0][vue2Prop] = newVal;
4184
4223
  } catch (e) {
4185
4224
  }
4186
- }
4225
+ });
4187
4226
  },
4188
4227
  {
4189
- immediate: true,
4190
- deep: true
4228
+ deep: true,
4229
+ immediate: true
4191
4230
  }
4192
4231
  );
4193
4232
  }
@@ -4207,10 +4246,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
4207
4246
  },
4208
4247
  __name: "uni-vue",
4209
4248
  props: uniVueProps,
4210
- setup(__props) {
4249
+ emits: ["update:modelValue", "update:dialogFormData", "update:visible"],
4250
+ setup(__props, { emit: __emit }) {
4211
4251
  const bem = createNameSpace("uni-vue");
4212
4252
  const props = __props;
4213
- const { loading } = useUniVue(props);
4253
+ const emit = __emit;
4254
+ const { loading } = useUniVue(props, emit);
4214
4255
  return (_ctx, _cache) => {
4215
4256
  return openBlock(), createElementBlock(Fragment, null, [
4216
4257
  createVNode(unref(ElSkeleton), {
@@ -4249,7 +4290,7 @@ var components = [
4249
4290
  EpUniVue
4250
4291
  ];
4251
4292
 
4252
- var version = "0.0.76";
4293
+ var version = "0.0.78";
4253
4294
 
4254
4295
  var globalProperties = {
4255
4296
  install(app) {
@@ -17,6 +17,10 @@ export declare const EpAttachment: {
17
17
  }>[]>;
18
18
  readonly default: () => never[];
19
19
  };
20
+ rowKey: {
21
+ readonly type: StringConstructor;
22
+ readonly default: "fileId";
23
+ };
20
24
  mode: {
21
25
  readonly type: import("vue").PropType<import("el-plus/es/hooks/use-navigation").PageMode>;
22
26
  };
@@ -39,6 +43,9 @@ export declare const EpAttachment: {
39
43
  beforeAdd: {
40
44
  readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
41
45
  };
46
+ permission: {
47
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
48
+ };
42
49
  modelValue: {
43
50
  type: import("vue").PropType<any[]>;
44
51
  };
@@ -63,6 +70,7 @@ export declare const EpAttachment: {
63
70
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
64
71
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
65
72
  }>[];
73
+ rowKey: string;
66
74
  openType: "dialog" | "normal";
67
75
  isType: boolean;
68
76
  isNote: boolean;
@@ -92,6 +100,10 @@ export declare const EpAttachment: {
92
100
  }>[]>;
93
101
  readonly default: () => never[];
94
102
  };
103
+ rowKey: {
104
+ readonly type: StringConstructor;
105
+ readonly default: "fileId";
106
+ };
95
107
  mode: {
96
108
  readonly type: import("vue").PropType<import("el-plus/es/hooks/use-navigation").PageMode>;
97
109
  };
@@ -114,6 +126,9 @@ export declare const EpAttachment: {
114
126
  beforeAdd: {
115
127
  readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
116
128
  };
129
+ permission: {
130
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
131
+ };
117
132
  modelValue: {
118
133
  type: import("vue").PropType<any[]>;
119
134
  };
@@ -136,6 +151,7 @@ export declare const EpAttachment: {
136
151
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
137
152
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
138
153
  }>[];
154
+ rowKey: string;
139
155
  openType: "dialog" | "normal";
140
156
  isType: boolean;
141
157
  isNote: boolean;
@@ -149,6 +165,10 @@ export declare const EpAttachment: {
149
165
  readonly type: import("vue").PropType<import("el-plus/es/index").TableColumn[]>;
150
166
  readonly default: () => never[];
151
167
  };
168
+ rowKey: {
169
+ readonly type: StringConstructor;
170
+ readonly default: "fileId";
171
+ };
152
172
  mode: {
153
173
  readonly type: import("vue").PropType<import("el-plus/es/hooks/use-navigation").PageMode>;
154
174
  };
@@ -171,6 +191,9 @@ export declare const EpAttachment: {
171
191
  beforeAdd: {
172
192
  readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
173
193
  };
194
+ permission: {
195
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
196
+ };
174
197
  modelValue: {
175
198
  type: import("vue").PropType<any[]>;
176
199
  };
@@ -195,6 +218,7 @@ export declare const EpAttachment: {
195
218
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
196
219
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
197
220
  }>[];
221
+ rowKey: string;
198
222
  openType: "dialog" | "normal";
199
223
  isType: boolean;
200
224
  isNote: boolean;
@@ -1,10 +1,15 @@
1
1
  import type { ExtractPublicPropTypes, PropType } from 'vue';
2
2
  import type { PageMode } from 'el-plus/es/hooks/use-navigation';
3
+ import type { Permission } from 'el-plus/es/directives/permission';
3
4
  export declare const attachmentProps: {
4
5
  readonly formatColumns: {
5
6
  readonly type: PropType<import("el-plus/es/components/table").TableColumn[]>;
6
7
  readonly default: () => never[];
7
8
  };
9
+ readonly rowKey: {
10
+ readonly type: StringConstructor;
11
+ readonly default: "fileId";
12
+ };
8
13
  readonly mode: {
9
14
  readonly type: PropType<PageMode>;
10
15
  };
@@ -27,5 +32,8 @@ export declare const attachmentProps: {
27
32
  readonly beforeAdd: {
28
33
  readonly type: PropType<(fileItem: Record<string, any>) => boolean>;
29
34
  };
35
+ readonly permission: {
36
+ readonly type: PropType<Permission>;
37
+ };
30
38
  };
31
39
  export type AttachmentProps = ExtractPublicPropTypes<typeof attachmentProps>;
@@ -5,6 +5,10 @@ const attachmentProps = {
5
5
  formatColumns: {
6
6
  ...tableProps.formatColumns
7
7
  },
8
+ rowKey: {
9
+ type: String,
10
+ default: "fileId"
11
+ },
8
12
  // 页面模式
9
13
  mode: {
10
14
  type: String
@@ -32,6 +36,10 @@ const attachmentProps = {
32
36
  // 添加前校验
33
37
  beforeAdd: {
34
38
  type: Function
39
+ },
40
+ // 权限
41
+ permission: {
42
+ type: String
35
43
  }
36
44
  };
37
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.ts"],"sourcesContent":["import type { ExtractPublicPropTypes, PropType } from 'vue'\nimport { tableProps } from '@el-plus/components/table'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\n\nexport const attachmentProps = {\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n // 展示模式\n openType: {\n type: String as PropType<'dialog' | 'normal'>,\n default: 'dialog',\n },\n // 是否需要类型\n isType: {\n type: Boolean,\n default: true,\n },\n // 是否需要备注\n isNote: {\n type: Boolean,\n default: false,\n },\n // 是否需要打开弹窗按钮\n isShowOpenDialogButton: {\n type: Boolean,\n default: false,\n },\n // 添加前校验\n beforeAdd: {\n type: Function as PropType<(fileItem: Record<string, any>) => boolean>,\n },\n \n} as const\nexport type AttachmentProps = ExtractPublicPropTypes<typeof attachmentProps>\n"],"names":[],"mappings":";;AAIO,MAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,aAAA,EAAe;AAAA,IACb,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,sBAAA,EAAwB;AAAA,IACtB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA;AAGV;;;;"}
1
+ {"version":3,"file":"attachment.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.ts"],"sourcesContent":["import type { ExtractPublicPropTypes, PropType } from 'vue'\nimport { tableProps } from '@el-plus/components/table'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nimport type {Permission} from '@el-plus/directives/permission'\nexport const attachmentProps = {\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n rowKey: {\n type: String,\n default: 'fileId',\n },\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n // 展示模式\n openType: {\n type: String as PropType<'dialog' | 'normal'>,\n default: 'dialog',\n },\n // 是否需要类型\n isType: {\n type: Boolean,\n default: true,\n },\n // 是否需要备注\n isNote: {\n type: Boolean,\n default: false,\n },\n // 是否需要打开弹窗按钮\n isShowOpenDialogButton: {\n type: Boolean,\n default: false,\n },\n // 添加前校验\n beforeAdd: {\n type: Function as PropType<(fileItem: Record<string, any>) => boolean>,\n },\n // 权限\n permission: {\n type: String as PropType<Permission>,\n },\n\n} as const\nexport type AttachmentProps = ExtractPublicPropTypes<typeof attachmentProps>\n"],"names":[],"mappings":";;AAIO,MAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,aAAA,EAAe;AAAA,IACb,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,sBAAA,EAAwB;AAAA,IACtB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM;AAAA;AAGV;;;;"}
@@ -3,6 +3,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
3
3
  readonly type: import("vue").PropType<import("el-plus/es/components/table").TableColumn[]>;
4
4
  readonly default: () => never[];
5
5
  };
6
+ rowKey: {
7
+ readonly type: StringConstructor;
8
+ readonly default: "fileId";
9
+ };
6
10
  mode: {
7
11
  readonly type: import("vue").PropType<import("el-plus/es/hooks").PageMode>;
8
12
  };
@@ -25,6 +29,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
29
  beforeAdd: {
26
30
  readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
27
31
  };
32
+ permission: {
33
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission").Permission>;
34
+ };
28
35
  modelValue: {
29
36
  type: import("vue").PropType<any[]>;
30
37
  };
@@ -37,6 +44,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
37
44
  readonly type: import("vue").PropType<import("el-plus/es/components/table").TableColumn[]>;
38
45
  readonly default: () => never[];
39
46
  };
47
+ rowKey: {
48
+ readonly type: StringConstructor;
49
+ readonly default: "fileId";
50
+ };
40
51
  mode: {
41
52
  readonly type: import("vue").PropType<import("el-plus/es/hooks").PageMode>;
42
53
  };
@@ -59,6 +70,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
59
70
  beforeAdd: {
60
71
  readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
61
72
  };
73
+ permission: {
74
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission").Permission>;
75
+ };
62
76
  modelValue: {
63
77
  type: import("vue").PropType<any[]>;
64
78
  };
@@ -79,6 +93,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
79
93
  show?: (boolean | ((T: unknown) => boolean)) | undefined;
80
94
  hide?: (boolean | ((T: unknown) => boolean)) | undefined;
81
95
  }>[];
96
+ rowKey: string;
82
97
  openType: "dialog" | "normal";
83
98
  isType: boolean;
84
99
  isNote: boolean;
@@ -1,4 +1,4 @@
1
- import { defineComponent, mergeModels, useModel, resolveComponent, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createVNode, unref, normalizeClass, withCtx, createTextVNode, toDisplayString, createElementVNode, mergeProps } from 'vue';
1
+ import { defineComponent, mergeModels, useModel, resolveComponent, createElementBlock, openBlock, Fragment, withDirectives, createCommentVNode, createVNode, createBlock, unref, normalizeClass, withCtx, createTextVNode, toDisplayString, createElementVNode, mergeProps } from 'vue';
2
2
  import { createNameSpace } from '../../../utils/bem.mjs';
3
3
  import { prepareStyles, prepareClassNames } from '../../../utils/props.mjs';
4
4
  import { attachmentProps } from './attachment.mjs';
@@ -7,6 +7,7 @@ import { useAttachment } from './use-attachment.mjs';
7
7
  import { useDialog } from '../../../hooks/dialog/use-dialog.mjs';
8
8
  import { useLocale } from '../../../hooks/use-locale.mjs';
9
9
  import { ElButton } from 'element-plus';
10
+ import vPermisson from '../../../directives/permission/index.mjs';
10
11
 
11
12
  var _sfc_main = /* @__PURE__ */ defineComponent({
12
13
  ...{
@@ -24,7 +25,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
24
25
  const bem = createNameSpace("attachment");
25
26
  const props = __props;
26
27
  const modelValue = useModel(__props, "modelValue");
27
- const { columns, addAttachment, isNormalOpen, onConfirm, onCancel, mode } = useAttachment(props, {
28
+ const { columns, actionButtons, addAttachment, isNormalOpen, permission, onConfirm, onCancel, mode } = useAttachment(props, {
28
29
  data: modelValue
29
30
  });
30
31
  const AttachmentDialog = useDialog({
@@ -56,7 +57,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
56
57
  return (_ctx, _cache) => {
57
58
  const _component_EpButtons = resolveComponent("EpButtons");
58
59
  return openBlock(), createElementBlock(Fragment, null, [
59
- props.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
60
+ props.isShowOpenDialogButton ? withDirectives((openBlock(), createBlock(unref(ElButton), {
60
61
  key: 0,
61
62
  type: "primary",
62
63
  plain: "",
@@ -68,7 +69,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
68
69
  createTextVNode(toDisplayString(unref(t)("ep.attachment.manageAttachment")) + "(" + toDisplayString(modelValue.value?.length || 0) + ") ", 1)
69
70
  ]),
70
71
  _: 1
71
- }, 8, ["class", "onClick"])) : createCommentVNode("", true),
72
+ }, 8, ["class", "onClick"])), [
73
+ [unref(vPermisson), unref(permission)]
74
+ ]) : createCommentVNode("", true),
72
75
  createVNode(unref(AttachmentDialog), null, {
73
76
  default: withCtx(() => [
74
77
  createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
@@ -91,8 +94,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
91
94
  ...unref(prepareStyles)()
92
95
  },
93
96
  columns: unref(columns),
97
+ "action-buttons": unref(actionButtons),
98
+ actionColWidth: "110",
94
99
  data: modelValue.value
95
- }, props), null, 16, ["class", "style", "columns", "data"])
100
+ }, props), null, 16, ["class", "style", "columns", "action-buttons", "data"])
96
101
  ]),
97
102
  _: 1
98
103
  })
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.vue2.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"props.isShowOpenDialogButton\"\n type=\"primary\"\n plain\n size=\"small\"\n :class=\"bem.e('handler')\"\n @click=\"open\"\n >\n {{ t('ep.attachment.manageAttachment') }}({{ modelValue?.length || 0 }})\n </ElButton>\n <AttachmentDialog>\n <div style=\"margin-bottom: 10px; text-align: right\">\n <EpButtons\n v-if=\"props.openType === 'dialog' && mode !== 'browse'\"\n type=\"primary\"\n :list=\"[\n {\n name: t('ep.attachment.addAttachment'),\n type: 'primary',\n onClick: addAttachment,\n },\n ]\"\n />\n </div>\n\n <EpTable\n ref=\"tableRef\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n :columns=\"columns\"\n :data=\"modelValue\"\n v-bind=\"props\"\n >\n </EpTable>\n </AttachmentDialog>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { attachmentProps } from './attachment'\nimport EpTable from '@el-plus/components/table'\nimport { useAttachment } from './use-attachment'\nimport type { TableProps } from '@el-plus/components/table'\nimport { useDialog } from '@el-plus/hooks/dialog/use-dialog'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { ElButton } from 'element-plus'\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpAttachment',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('attachment')\nconst props = defineProps(attachmentProps)\nconst modelValue = defineModel<TableProps['data']>()\nconst { columns, addAttachment, isNormalOpen, onConfirm, onCancel, mode } =\n useAttachment(props, {\n data: modelValue,\n })\nconst AttachmentDialog = useDialog({\n width: 850,\n center: true,\n title: isNormalOpen ? '' : t('ep.attachment.manageAttachment'),\n modal: !isNormalOpen,\n showClose: !isNormalOpen,\n showFooter: !isNormalOpen,\n transition: isNormalOpen ? '' : 'dialog-fade',\n modalClass: bem.em(\n 'dialog',\n props.openType === 'normal' ? props.openType : '',\n ),\n onConfirm: async (resolve) => {\n onConfirm(resolve)\n },\n onCancel: (resolve) => {\n onCancel(resolve)\n },\n})\nconst open = AttachmentDialog.open\nif (isNormalOpen) {\n open()\n}\ndefineExpose({\n open,\n})\n</script>\n"],"names":["_useModel","_createBlock","_unref","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createElementVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AAKxB,IAAA,MAAM,GAAA,GAAM,gBAAgB,YAAY,CAAA;AACxC,IAAA,MAAM,KAAA,GAAQ,OAAA;AACd,IAAA,MAAM,UAAA,GAAaA,QAAA,CAA+B,OAAA,EAAA,YAAC,CAAA;AACnD,IAAA,MAAM,EAAE,SAAS,aAAA,EAAe,YAAA,EAAc,WAAW,QAAA,EAAU,IAAA,EAAK,GACtE,aAAA,CAAc,KAAA,EAAO;AAAA,MACnB,IAAA,EAAM;AAAA,KACP,CAAA;AACH,IAAA,MAAM,mBAAmB,SAAA,CAAU;AAAA,MACjC,KAAA,EAAO,GAAA;AAAA,MACP,MAAA,EAAQ,IAAA;AAAA,MACR,KAAA,EAAO,YAAA,GAAe,EAAA,GAAK,CAAA,CAAE,gCAAgC,CAAA;AAAA,MAC7D,OAAO,CAAC,YAAA;AAAA,MACR,WAAW,CAAC,YAAA;AAAA,MACZ,YAAY,CAAC,YAAA;AAAA,MACb,UAAA,EAAY,eAAe,EAAA,GAAK,aAAA;AAAA,MAChC,YAAY,GAAA,CAAI,EAAA;AAAA,QACd,QAAA;AAAA,QACA,KAAA,CAAM,QAAA,KAAa,QAAA,GAAW,KAAA,CAAM,QAAA,GAAW;AAAA,OACjD;AAAA,MACA,SAAA,EAAW,OAAO,OAAA,KAAY;AAC5B,QAAA,SAAA,CAAU,OAAO,CAAA;AAAA,MACnB,CAAA;AAAA,M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R,GAAA,EAAI,UAAA;AAAA,cACH,KAAA,EAAK,CAAA,EAAKN,KAAA,CAAA,GAAA,CAAA,CAAI,CAAA,MAAOA,KAAA,CAAA,iBAAA,CAAA,EAAiB,CAAA,CAAA;AAAA,cACtC,KAAA,EAAK;AAAA,mBAAeA,KAAA,CAAA,aAAA,CAAA;AAAa;cAGjC,OAAA,EAASA,MAAA,OAAA,CAAA;AAAA,cACT,MAAM,UAAA,CAAA;AAAA,eACC,KAAK,CAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"attachment.vue2.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"props.isShowOpenDialogButton\"\n type=\"primary\"\n plain\n size=\"small\"\n :class=\"bem.e('handler')\"\n @click=\"open\"\n v-permission=\"permission\"\n >\n {{ t('ep.attachment.manageAttachment') }}({{ modelValue?.length || 0 }})\n </ElButton>\n <AttachmentDialog>\n <div style=\"margin-bottom: 10px; text-align: right\">\n <EpButtons\n v-if=\"props.openType === 'dialog' && mode !== 'browse'\"\n type=\"primary\"\n :list=\"[\n {\n name: t('ep.attachment.addAttachment'),\n type: 'primary',\n onClick: addAttachment,\n },\n ]\"\n />\n </div>\n\n <EpTable\n ref=\"tableRef\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n :columns=\"columns\"\n :action-buttons=\"actionButtons\"\n actionColWidth=\"110\"\n :data=\"modelValue\"\n v-bind=\"props\"\n >\n </EpTable>\n </AttachmentDialog>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { attachmentProps } from './attachment'\nimport EpTable from '@el-plus/components/table'\nimport { useAttachment } from './use-attachment'\nimport type { TableProps } from '@el-plus/components/table'\nimport { useDialog } from '@el-plus/hooks/dialog/use-dialog'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { ElButton } from 'element-plus'\nimport { vPermission } from '@el-plus/directives'\n\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpAttachment',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('attachment')\nconst props = defineProps(attachmentProps)\nconst modelValue = defineModel<TableProps['data']>()\nconst { columns,actionButtons, addAttachment, isNormalOpen,permission, onConfirm, onCancel, mode } =\n useAttachment(props, {\n data: modelValue,\n })\nconst AttachmentDialog = useDialog({\n width: 850,\n center: true,\n title: isNormalOpen ? '' : t('ep.attachment.manageAttachment'),\n modal: !isNormalOpen,\n showClose: !isNormalOpen,\n showFooter: !isNormalOpen,\n transition: isNormalOpen ? '' : 'dialog-fade',\n modalClass: bem.em(\n 'dialog',\n props.openType === 'normal' ? props.openType : '',\n ),\n onConfirm: async (resolve) => {\n onConfirm(resolve)\n },\n onCancel: (resolve) => {\n onCancel(resolve)\n },\n})\nconst open = AttachmentDialog.open\nif (isNormalOpen) {\n open()\n}\ndefineExpose({\n open,\n})\n</script>\n"],"names":["_useModel","_createBlock","_unref","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createElementVNode","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsDA,IAAA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AAKxB,IAAA,MAAM,GAAA,GAAM,gBAAgB,YAAY,CAAA;AACxC,IAAA,MAAM,KAAA,GAAQ,OAAA;AACd,IAAA,MAAM,UAAA,GAAaA,QAAA,CAA+B,OAAA,EAAA,YAAC,CAAA;AACnD,IAAA,MAAM,EAAE,OAAA,EAAQ,aAAA,EAAe,aAAA,EAAe,YAAA,EAAa,UAAA,EAAY,SAAA,EAAW,QAAA,EAAU,IAAA,EAAK,GAC/F,aAAA,CAAc,KAAA,EAAO;AAAA,MACnB,IAAA,EAAM;AAAA,KACP,CAAA;AACH,IA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