el-plus 0.0.74 → 0.0.77

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 (60) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +89 -26
  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 +89 -26
  9. package/es/components/attachment/index.d.ts +33 -0
  10. package/es/components/attachment/src/attachment.d.ts +11 -0
  11. package/es/components/attachment/src/attachment.mjs +12 -0
  12. package/es/components/attachment/src/attachment.mjs.map +1 -1
  13. package/es/components/attachment/src/attachment.vue.d.ts +21 -0
  14. package/es/components/attachment/src/attachment.vue2.mjs +8 -5
  15. package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
  16. package/es/components/attachment/src/use-attachment.d.ts +5 -0
  17. package/es/components/attachment/src/use-attachment.mjs +13 -1
  18. package/es/components/attachment/src/use-attachment.mjs.map +1 -1
  19. package/es/components/form/src/hooks/use-form-item.mjs +5 -1
  20. package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
  21. package/es/components/header/index.d.ts +9 -0
  22. package/es/components/header/src/header.vue.d.ts +3 -0
  23. package/es/components/table/src/table.vue2.mjs +2 -1
  24. package/es/components/table/src/table.vue2.mjs.map +1 -1
  25. package/es/components/uni-vue/index.d.ts +23 -3
  26. package/es/components/uni-vue/src/uni-vue.vue.d.ts +10 -2
  27. package/es/components/uni-vue/src/uni-vue.vue2.mjs +4 -2
  28. package/es/components/uni-vue/src/uni-vue.vue2.mjs.map +1 -1
  29. package/es/components/uni-vue/src/use-uni-vue.d.ts +1 -1
  30. package/es/components/uni-vue/src/use-uni-vue.mjs +46 -16
  31. package/es/components/uni-vue/src/use-uni-vue.mjs.map +1 -1
  32. package/es/package.json.mjs +1 -1
  33. package/lib/components/attachment/index.d.ts +33 -0
  34. package/lib/components/attachment/src/attachment.d.ts +11 -0
  35. package/lib/components/attachment/src/attachment.js +12 -0
  36. package/lib/components/attachment/src/attachment.js.map +1 -1
  37. package/lib/components/attachment/src/attachment.vue.d.ts +21 -0
  38. package/lib/components/attachment/src/attachment.vue2.js +9 -6
  39. package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
  40. package/lib/components/attachment/src/use-attachment.d.ts +5 -0
  41. package/lib/components/attachment/src/use-attachment.js +13 -1
  42. package/lib/components/attachment/src/use-attachment.js.map +1 -1
  43. package/lib/components/form/src/hooks/use-form-item.js +5 -1
  44. package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
  45. package/lib/components/header/index.d.ts +9 -0
  46. package/lib/components/header/src/header.vue.d.ts +3 -0
  47. package/lib/components/table/src/table.vue2.js +2 -1
  48. package/lib/components/table/src/table.vue2.js.map +1 -1
  49. package/lib/components/uni-vue/index.d.ts +23 -3
  50. package/lib/components/uni-vue/src/uni-vue.vue.d.ts +10 -2
  51. package/lib/components/uni-vue/src/uni-vue.vue2.js +4 -2
  52. package/lib/components/uni-vue/src/uni-vue.vue2.js.map +1 -1
  53. package/lib/components/uni-vue/src/use-uni-vue.d.ts +1 -1
  54. package/lib/components/uni-vue/src/use-uni-vue.js +45 -15
  55. package/lib/components/uni-vue/src/use-uni-vue.js.map +1 -1
  56. package/lib/package.json.js +1 -1
  57. package/package.json +1 -1
  58. package/theme-chalk/header.css +1 -1
  59. package/theme-chalk/index.css +1 -1
  60. package/theme-chalk/src/header.scss +8 -1
@@ -1,4 +1,4 @@
1
- /*! ElPlus v0.0.74 */
1
+ /*! ElPlus v0.0.77 */
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';
@@ -825,7 +825,11 @@ const useFormItemSlots = (props) => {
825
825
  const events = {};
826
826
  for (const key in attrs) {
827
827
  if (key.startsWith("on")) {
828
- events[key] = attrs[key];
828
+ events[key] = (...args) => {
829
+ const tableScope = attrs["table-scope"];
830
+ const eventFn = attrs[key];
831
+ return eventFn(...args, tableScope);
832
+ };
829
833
  }
830
834
  }
831
835
  const formData = attrs["form-data"];
@@ -2333,6 +2337,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
2333
2337
  });
2334
2338
  const customAttrs = computed(() => {
2335
2339
  return {
2340
+ "row-key": props.rowKey || "id",
2336
2341
  ...prepareProps(props, ["modelValue", ...expandTablePropsKeys]),
2337
2342
  // 'tooltip-effect': 'light',
2338
2343
  size: "small",
@@ -2455,7 +2460,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
2455
2460
  _: 1
2456
2461
  }, 8, ["label", "align", "width"])) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(unref(columnList), (item, index) => {
2457
2462
  return openBlock(), createBlock(_component_el_table_column, mergeProps({
2458
- key: index
2463
+ key: `${item.prop}_${item.type}_${index}`
2459
2464
  }, {
2460
2465
  ref_for: true
2461
2466
  }, item), {
@@ -3366,6 +3371,10 @@ const attachmentProps = {
3366
3371
  formatColumns: {
3367
3372
  ...tableProps.formatColumns
3368
3373
  },
3374
+ rowKey: {
3375
+ type: String,
3376
+ default: "fileId"
3377
+ },
3369
3378
  // 页面模式
3370
3379
  mode: {
3371
3380
  type: String
@@ -3389,6 +3398,14 @@ const attachmentProps = {
3389
3398
  isShowOpenDialogButton: {
3390
3399
  type: Boolean,
3391
3400
  default: false
3401
+ },
3402
+ // 添加前校验
3403
+ beforeAdd: {
3404
+ type: Function
3405
+ },
3406
+ // 权限
3407
+ permission: {
3408
+ type: String
3392
3409
  }
3393
3410
  };
3394
3411
 
@@ -3619,6 +3636,9 @@ const useAttachment = (props, { data }) => {
3619
3636
  if (isDialogOpen) {
3620
3637
  toBeConfirmData.push(fileData);
3621
3638
  }
3639
+ if (props.beforeAdd) {
3640
+ await props.beforeAdd?.(fileData);
3641
+ }
3622
3642
  data.value.push(fileData);
3623
3643
  };
3624
3644
  const onConfirm = async (resolve) => {
@@ -3645,13 +3665,22 @@ const useAttachment = (props, { data }) => {
3645
3665
  }
3646
3666
  resolve();
3647
3667
  };
3668
+ const permission = computed(() => {
3669
+ const arr = props.permission?.split(",") || [];
3670
+ return {
3671
+ arg: arr[0],
3672
+ value: arr[1]
3673
+ };
3674
+ });
3648
3675
  return {
3649
3676
  columns,
3650
3677
  addAttachment,
3651
3678
  isNormalOpen,
3652
3679
  isDialogOpen,
3653
3680
  onConfirm,
3654
- onCancel
3681
+ onCancel,
3682
+ mode,
3683
+ permission
3655
3684
  };
3656
3685
  };
3657
3686
 
@@ -3671,7 +3700,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3671
3700
  const bem = createNameSpace("attachment");
3672
3701
  const props = __props;
3673
3702
  const modelValue = useModel(__props, "modelValue");
3674
- const { columns, addAttachment, isNormalOpen, onConfirm, onCancel } = useAttachment(props, {
3703
+ const { columns, addAttachment, isNormalOpen, permission, onConfirm, onCancel, mode } = useAttachment(props, {
3675
3704
  data: modelValue
3676
3705
  });
3677
3706
  const AttachmentDialog = useDialog({
@@ -3703,7 +3732,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3703
3732
  return (_ctx, _cache) => {
3704
3733
  const _component_EpButtons = resolveComponent("EpButtons");
3705
3734
  return openBlock(), createElementBlock(Fragment, null, [
3706
- props.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
3735
+ props.isShowOpenDialogButton ? withDirectives((openBlock(), createBlock(unref(ElButton), {
3707
3736
  key: 0,
3708
3737
  type: "primary",
3709
3738
  plain: "",
@@ -3715,11 +3744,13 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3715
3744
  createTextVNode(toDisplayString(unref(t)("ep.attachment.manageAttachment")) + "(" + toDisplayString(modelValue.value?.length || 0) + ") ", 1)
3716
3745
  ]),
3717
3746
  _: 1
3718
- }, 8, ["class", "onClick"])) : createCommentVNode("", true),
3747
+ }, 8, ["class", "onClick"])), [
3748
+ [unref(vPermisson), unref(permission)]
3749
+ ]) : createCommentVNode("", true),
3719
3750
  createVNode(unref(AttachmentDialog), null, {
3720
3751
  default: withCtx(() => [
3721
3752
  createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
3722
- props.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
3753
+ props.openType === "dialog" && unref(mode) !== "browse" ? (openBlock(), createBlock(_component_EpButtons, {
3723
3754
  key: 0,
3724
3755
  type: "primary",
3725
3756
  list: [
@@ -3986,7 +4017,7 @@ const uniVueProps = {
3986
4017
  // 组件类型 bpm、 address
3987
4018
  };
3988
4019
 
3989
- const useUniVue = (props) => {
4020
+ const useUniVue = (props, emit) => {
3990
4021
  const uniVue = useTemplateRef("uniVue");
3991
4022
  const { type } = props;
3992
4023
  const loading = ref(true);
@@ -4015,22 +4046,27 @@ const useUniVue = (props) => {
4015
4046
  const prepareVueAttributes = () => {
4016
4047
  const events = {};
4017
4048
  const _props = {};
4018
- console.log(attrs);
4019
4049
  Object.keys(attrs).forEach((key) => {
4020
4050
  if (key.startsWith("on")) {
4021
4051
  let eventName = key.slice(2);
4022
4052
  if (eventName.startsWith("Update:")) {
4023
4053
  eventName = "update:" + eventName.slice(7);
4054
+ if (eventName === "update:modelValue") {
4055
+ eventName = "input";
4056
+ }
4024
4057
  } else {
4025
4058
  eventName = eventName.replace(/([A-Z])/g, "-$1").toLowerCase();
4026
4059
  eventName = eventName.slice(1);
4027
4060
  }
4028
4061
  events[eventName] = attrs[key];
4029
4062
  } else {
4030
- _props[key] = attrs[key];
4063
+ if (key === "modelValue") {
4064
+ _props.value = attrs[key];
4065
+ } else {
4066
+ _props[key] = attrs[key];
4067
+ }
4031
4068
  }
4032
4069
  });
4033
- console.log(events, _props, 9999);
4034
4070
  return {
4035
4071
  on: events,
4036
4072
  props: _props
@@ -4042,7 +4078,7 @@ const useUniVue = (props) => {
4042
4078
  case "bpm":
4043
4079
  return `${cdn}bpm-common/common/index.umd.min.js`;
4044
4080
  case "address":
4045
- return `./hx-address.js`;
4081
+ return `http://localhost:8001/dist/hx-address.js`;
4046
4082
  default:
4047
4083
  return "";
4048
4084
  }
@@ -4134,30 +4170,55 @@ const useUniVue = (props) => {
4134
4170
  }
4135
4171
  }
4136
4172
  shadowRoot.appendChild(container);
4173
+ console.log(prepareVueAttributes());
4174
+ const baseEvents = {
4175
+ ...prepareVueAttributes().on,
4176
+ "input": (newVal) => {
4177
+ console.log(newVal, "input", props.name);
4178
+ emit("update:modelValue", newVal);
4179
+ },
4180
+ "update:dialogFormData": (newVal) => {
4181
+ console.log(newVal, "update:dialogFormData");
4182
+ emit("update:dialogFormData", newVal);
4183
+ },
4184
+ "update:visible": (newVal) => {
4185
+ console.log(newVal, "update:visible");
4186
+ emit("update:visible", newVal);
4187
+ }
4188
+ };
4137
4189
  instance = new Vue2({
4138
4190
  el: container,
4139
4191
  // @ts-expect-error 缺少类型定义
4140
4192
  router: new VueRouter3(),
4141
- render: (h) => h(props.name, prepareVueAttributes())
4193
+ render: (h) => h(props.name, {
4194
+ props: {
4195
+ ...prepareVueAttributes().props
4196
+ },
4197
+ on: baseEvents
4198
+ })
4142
4199
  });
4143
4200
  };
4144
4201
  Object.keys(attrs).forEach((key) => {
4145
- if (key.startsWith("onUpdate:")) {
4146
- const propName = key.slice(9);
4202
+ console.log(key, 8);
4203
+ if (!key.startsWith("on")) {
4147
4204
  watch(
4148
- () => attrs[propName],
4205
+ () => attrs[key],
4149
4206
  (newVal) => {
4150
- console.log(newVal, "newVal", propName);
4151
- if (instance) {
4207
+ nextTick(() => {
4152
4208
  try {
4153
- instance.$children[0][propName] = newVal;
4209
+ console.log(props.name, newVal, "watch", key, instance);
4210
+ let vue2Prop = key;
4211
+ if (key === "modelValue") {
4212
+ vue2Prop = "value";
4213
+ }
4214
+ instance.$children[0][vue2Prop] = newVal;
4154
4215
  } catch (e) {
4155
4216
  }
4156
- }
4217
+ });
4157
4218
  },
4158
4219
  {
4159
- immediate: true,
4160
- deep: true
4220
+ deep: true,
4221
+ immediate: true
4161
4222
  }
4162
4223
  );
4163
4224
  }
@@ -4177,10 +4238,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
4177
4238
  },
4178
4239
  __name: "uni-vue",
4179
4240
  props: uniVueProps,
4180
- setup(__props) {
4241
+ emits: ["update:modelValue", "update:dialogFormData", "update:visible"],
4242
+ setup(__props, { emit: __emit }) {
4181
4243
  const bem = createNameSpace("uni-vue");
4182
4244
  const props = __props;
4183
- const { loading } = useUniVue(props);
4245
+ const emit = __emit;
4246
+ const { loading } = useUniVue(props, emit);
4184
4247
  return (_ctx, _cache) => {
4185
4248
  return openBlock(), createElementBlock(Fragment, null, [
4186
4249
  createVNode(unref(ElSkeleton), {
@@ -4219,7 +4282,7 @@ var components = [
4219
4282
  EpUniVue
4220
4283
  ];
4221
4284
 
4222
- var version = "0.0.74";
4285
+ var version = "0.0.77";
4223
4286
 
4224
4287
  var globalProperties = {
4225
4288
  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
  };
@@ -36,6 +40,12 @@ export declare const EpAttachment: {
36
40
  readonly type: BooleanConstructor;
37
41
  readonly default: false;
38
42
  };
43
+ beforeAdd: {
44
+ readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
45
+ };
46
+ permission: {
47
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
48
+ };
39
49
  modelValue: {
40
50
  type: import("vue").PropType<any[]>;
41
51
  };
@@ -46,6 +56,7 @@ export declare const EpAttachment: {
46
56
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
57
  "update:modelValue": (value: any[] | undefined) => any;
48
58
  }, import("vue").PublicProps, {
59
+ rowKey: string;
49
60
  formatColumns: Partial<import("element-plus").TableColumnCtx & {
50
61
  [key: string]: any;
51
62
  required: boolean | (() => boolean);
@@ -89,6 +100,10 @@ export declare const EpAttachment: {
89
100
  }>[]>;
90
101
  readonly default: () => never[];
91
102
  };
103
+ rowKey: {
104
+ readonly type: StringConstructor;
105
+ readonly default: "fileId";
106
+ };
92
107
  mode: {
93
108
  readonly type: import("vue").PropType<import("el-plus/es/hooks/use-navigation").PageMode>;
94
109
  };
@@ -108,6 +123,12 @@ export declare const EpAttachment: {
108
123
  readonly type: BooleanConstructor;
109
124
  readonly default: false;
110
125
  };
126
+ beforeAdd: {
127
+ readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
128
+ };
129
+ permission: {
130
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
131
+ };
111
132
  modelValue: {
112
133
  type: import("vue").PropType<any[]>;
113
134
  };
@@ -116,6 +137,7 @@ export declare const EpAttachment: {
116
137
  }>, {
117
138
  open: () => Promise<any>;
118
139
  }, {}, {}, {}, {
140
+ rowKey: string;
119
141
  formatColumns: Partial<import("element-plus").TableColumnCtx & {
120
142
  [key: string]: any;
121
143
  required: boolean | (() => boolean);
@@ -143,6 +165,10 @@ export declare const EpAttachment: {
143
165
  readonly type: import("vue").PropType<import("el-plus/es/index").TableColumn[]>;
144
166
  readonly default: () => never[];
145
167
  };
168
+ rowKey: {
169
+ readonly type: StringConstructor;
170
+ readonly default: "fileId";
171
+ };
146
172
  mode: {
147
173
  readonly type: import("vue").PropType<import("el-plus/es/hooks/use-navigation").PageMode>;
148
174
  };
@@ -162,6 +188,12 @@ export declare const EpAttachment: {
162
188
  readonly type: BooleanConstructor;
163
189
  readonly default: false;
164
190
  };
191
+ beforeAdd: {
192
+ readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
193
+ };
194
+ permission: {
195
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission/index").Permission>;
196
+ };
165
197
  modelValue: {
166
198
  type: import("vue").PropType<any[]>;
167
199
  };
@@ -172,6 +204,7 @@ export declare const EpAttachment: {
172
204
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
173
205
  "update:modelValue": (value: any[] | undefined) => any;
174
206
  }, string, {
207
+ rowKey: string;
175
208
  formatColumns: Partial<import("element-plus").TableColumnCtx & {
176
209
  [key: string]: any;
177
210
  required: boolean | (() => 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
  };
@@ -24,5 +29,11 @@ export declare const attachmentProps: {
24
29
  readonly type: BooleanConstructor;
25
30
  readonly default: false;
26
31
  };
32
+ readonly beforeAdd: {
33
+ readonly type: PropType<(fileItem: Record<string, any>) => boolean>;
34
+ };
35
+ readonly permission: {
36
+ readonly type: PropType<Permission>;
37
+ };
27
38
  };
28
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
@@ -28,6 +32,14 @@ const attachmentProps = {
28
32
  isShowOpenDialogButton: {
29
33
  type: Boolean,
30
34
  default: false
35
+ },
36
+ // 添加前校验
37
+ beforeAdd: {
38
+ type: Function
39
+ },
40
+ // 权限
41
+ permission: {
42
+ type: String
31
43
  }
32
44
  };
33
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} 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;AAEb;;;;"}
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
  };
@@ -22,6 +26,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
22
26
  readonly type: BooleanConstructor;
23
27
  readonly default: false;
24
28
  };
29
+ beforeAdd: {
30
+ readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
31
+ };
32
+ permission: {
33
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission").Permission>;
34
+ };
25
35
  modelValue: {
26
36
  type: import("vue").PropType<any[]>;
27
37
  };
@@ -34,6 +44,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
34
44
  readonly type: import("vue").PropType<import("el-plus/es/components/table").TableColumn[]>;
35
45
  readonly default: () => never[];
36
46
  };
47
+ rowKey: {
48
+ readonly type: StringConstructor;
49
+ readonly default: "fileId";
50
+ };
37
51
  mode: {
38
52
  readonly type: import("vue").PropType<import("el-plus/es/hooks").PageMode>;
39
53
  };
@@ -53,12 +67,19 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
53
67
  readonly type: BooleanConstructor;
54
68
  readonly default: false;
55
69
  };
70
+ beforeAdd: {
71
+ readonly type: import("vue").PropType<(fileItem: Record<string, any>) => boolean>;
72
+ };
73
+ permission: {
74
+ readonly type: import("vue").PropType<import("el-plus/es/directives/permission").Permission>;
75
+ };
56
76
  modelValue: {
57
77
  type: import("vue").PropType<any[]>;
58
78
  };
59
79
  }>> & Readonly<{
60
80
  "onUpdate:modelValue"?: ((value: any[] | undefined) => any) | undefined;
61
81
  }>, {
82
+ rowKey: string;
62
83
  formatColumns: Partial<import("element-plus").TableColumnCtx & {
63
84
  [key: string]: any;
64
85
  required: boolean | (() => 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 } = useAttachment(props, {
28
+ const { columns, 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,11 +69,13 @@ 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" } }, [
75
- props.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
78
+ props.openType === "dialog" && unref(mode) !== "browse" ? (openBlock(), createBlock(_component_EpButtons, {
76
79
  key: 0,
77
80
  type: "primary",
78
81
  list: [
@@ -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'\"\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 } =\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,EAAS,GAChE,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,MACA,QAAA,EAAU,CAAC,OAAA,KAAY;AACrB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A,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 :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, 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":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,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,EAAS,aAAA,EAAe,YAAA,EAAa,UAAA,EAAY,WAAW,QAAA,EAAU,IAAA,EAAK,GACjF,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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,CAYM,KAAA,EAAA,EAZD,KAAA,EAAA,EAAA,iBAAA,MAAA,EAAA,YAAA,EAAA,OAAA,EAAA,EAA8C,EAAA;AAAA,cAEzC,KAAA,CAAM,QAAA,KAAQ,QAAA,IAAiBL,KAAA,CAAA,IAAA,MAAI,QAAA,iBAD3CD,WAAA,CAUE,oBAAA,EAAA;AAAA;gBARA,IAAA,EAAK,SAAA;AAAA,gBACJ,IAAA,EAAI;AAAA;0BAAkCC,KAAA,CAAA,CAAA,CAAA,CAAC,6BAAA,CAAA;AAAA;6BAAmFA,MAAA,aAAA;AAAA;;;;YAU/HI,WAAA,CAUUJ,KAAA,WAVVM,UAAA,CAUU;AAAA,cATR,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;;;;;;;;;;"}
@@ -217,4 +217,9 @@ export declare const useAttachment: (props: any, { data }: {
217
217
  isDialogOpen: boolean;
218
218
  onConfirm: (resolve: any) => Promise<void>;
219
219
  onCancel: (resolve: any) => void;
220
+ mode: import("vue").ComputedRef<any>;
221
+ permission: import("vue").ComputedRef<{
222
+ arg: any;
223
+ value: any;
224
+ }>;
220
225
  };
@@ -95,6 +95,9 @@ const useAttachment = (props, { data }) => {
95
95
  if (isDialogOpen) {
96
96
  toBeConfirmData.push(fileData);
97
97
  }
98
+ if (props.beforeAdd) {
99
+ await props.beforeAdd?.(fileData);
100
+ }
98
101
  data.value.push(fileData);
99
102
  };
100
103
  const onConfirm = async (resolve) => {
@@ -121,13 +124,22 @@ const useAttachment = (props, { data }) => {
121
124
  }
122
125
  resolve();
123
126
  };
127
+ const permission = computed(() => {
128
+ const arr = props.permission?.split(",") || [];
129
+ return {
130
+ arg: arr[0],
131
+ value: arr[1]
132
+ };
133
+ });
124
134
  return {
125
135
  columns,
126
136
  addAttachment,
127
137
  isNormalOpen,
128
138
  isDialogOpen,
129
139
  onConfirm,
130
- onCancel
140
+ onCancel,
141
+ mode,
142
+ permission
131
143
  };
132
144
  };
133
145
 
@@ -1 +1 @@
1
- {"version":3,"file":"use-attachment.mjs","sources":["../../../../../../packages/components/attachment/src/use-attachment.ts"],"sourcesContent":["import { ref, computed, useTemplateRef } from 'vue'\nimport { useNavigation } from '@el-plus/hooks/use-navigation'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { downloadFile, previewFile, importFile } from '@el-plus/utils/file'\nimport { Cookies } from '@el-plus/utils/cookie'\nimport type { TableInstance } from '@el-plus/components/table'\n\nexport const useAttachment = (props, { data }) => {\n const { mode: defaultMode } = useNavigation()\n const { t } = useLocale()\n const mode = computed(() => {\n return props.mode || defaultMode.value\n })\n const tableRef = useTemplateRef<TableInstance>('tableRef')\n const isNormalOpen = props.openType === 'normal'\n const isDialogOpen = props.openType === 'dialog'\n\n // 待确认的附件列表\n let toBeConfirmData: Record<string, any>[] = []\n // 待删除的附件列表\n let toBeDeleteData: {\n [key: number]: Record<string, any> // key要存储原来索引以便保留原顺序\n } = {}\n const columns = ref([\n {\n type: 'EpButtons',\n label: t('ep.attachment.operation'),\n width: '120px',\n props: {\n type: 'text',\n list: [\n {\n name: t('ep.attachment.download'),\n onClick({ row }) {\n downloadFile({\n src: row.filePath,\n fileName: row.originalFilename || row.originalFileName,\n })\n },\n },\n {\n name: t('ep.attachment.delete'),\n disabled: () => {\n return mode.value === 'browse'\n },\n onClick: ({ $index, row }) => {\n if (isDialogOpen) {\n // 待删除的附件列表\n toBeDeleteData[$index] = row\n }\n data.value.splice($index, 1)\n },\n },\n ],\n },\n },\n {\n label: t('ep.attachment.attachmentType'),\n prop: 'type',\n type: 'EpSelect',\n required: true,\n show: () => props.isType,\n props: {\n desc: ({ row }) => {\n return row.typeDesc\n },\n },\n },\n {\n label: t('ep.attachment.fileName'),\n prop: 'originalFilename',\n type: 'EpLink',\n onClick({ row }) {\n previewFile(row.filePath)\n },\n },\n {\n label: t('ep.attachment.creator'),\n prop: 'createBy',\n },\n {\n label: t('ep.attachment.createTime'),\n prop: 'createTime',\n },\n {\n label: t('ep.attachment.description'),\n prop: 'note',\n type: 'EpInput',\n show: () => props.isNote,\n },\n ])\n const addAttachment = async () => {\n toBeConfirmData = []\n const fileData = await importFile({\n api: 'api-f/fast/files/save',\n extraData: {\n createBy: Cookies.get('accountName') || '',\n },\n })\n fileData.fileId = fileData.id\n delete fileData.id\n if (isDialogOpen) {\n // 待确认的附件列表\n toBeConfirmData.push(fileData)\n }\n data.value.push(fileData)\n }\n // 确认\n const onConfirm = async (resolve) => {\n await tableRef.value?.validate()\n resolve(data.value)\n toBeConfirmData = []\n toBeDeleteData = {}\n }\n // 取消\n const onCancel = (resolve) => {\n if (toBeConfirmData.length) {\n // 找到待确认的附件\n const index = data.value.findIndex((item) => {\n return item.fileId === toBeConfirmData[0].fileId\n })\n if (index !== -1) {\n // 删除待确认的附件\n data.value.splice(index, 1)\n }\n // 清空待确认的附件列表\n toBeConfirmData = []\n }\n if (Object.keys(toBeDeleteData).length) {\n // 找到待删除的附件在原位置插入\n Object.keys(toBeDeleteData).forEach((oldIndex) => {\n data.value.splice(Number(oldIndex), 0, toBeDeleteData[oldIndex])\n })\n // 清空待删除的附件列表\n toBeDeleteData = {}\n }\n resolve()\n }\n return {\n columns,\n addAttachment,\n isNormalOpen,\n isDialogOpen,\n onConfirm,\n onCancel,\n }\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,aAAA,GAAgB,CAAC,KAAA,EAAO,EAAE,MAAK,KAAM;AAChD,EAAA,MAAM,EA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,MACjE,CAAC,CAAA;AAED,MAAA,cAAA,GAAiB,EAAC;AAAA,IACpB;AACA,IAAA,OAAA,EAAQ;AAAA,EACV,CAAA;AACA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"use-attachment.mjs","sources":["../../../../../../packages/components/attachment/src/use-attachment.ts"],"sourcesContent":["import { ref, computed, useTemplateRef } from 'vue'\nimport { useNavigation } from '@el-plus/hooks/use-navigation'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { downloadFile, previewFile, importFile } from '@el-plus/utils/file'\nimport { Cookies } from '@el-plus/utils/cookie'\nimport type { TableInstance } from '@el-plus/components/table'\n\nexport const useAttachment = (props, { data }) => {\n const { mode: defaultMode } = useNavigation()\n const { t } = useLocale()\n const mode = computed(() => {\n return props.mode || defaultMode.value\n })\n const tableRef = useTemplateRef<TableInstance>('tableRef')\n const isNormalOpen = props.openType === 'normal'\n const isDialogOpen = props.openType === 'dialog'\n\n // 待确认的附件列表\n let toBeConfirmData: Record<string, any>[] = []\n // 待删除的附件列表\n let toBeDeleteData: {\n [key: number]: Record<string, any> // key要存储原来索引以便保留原顺序\n } = {}\n const columns = ref([\n {\n type: 'EpButtons',\n label: t('ep.attachment.operation'),\n width: '120px',\n props: {\n type: 'text',\n list: [\n {\n name: t('ep.attachment.download'),\n onClick({ row }) {\n downloadFile({\n src: row.filePath,\n fileName: row.originalFilename || row.originalFileName,\n })\n },\n },\n {\n name: t('ep.attachment.delete'),\n disabled: () => {\n return mode.value === 'browse'\n },\n onClick: ({ $index, row }) => {\n if (isDialogOpen) {\n // 待删除的附件列表\n toBeDeleteData[$index] = row\n }\n data.value.splice($index, 1)\n },\n },\n ],\n },\n },\n {\n label: t('ep.attachment.attachmentType'),\n prop: 'type',\n type: 'EpSelect',\n required: true,\n show: () => props.isType,\n props: {\n desc: ({ row }) => {\n return row.typeDesc\n },\n },\n },\n {\n label: t('ep.attachment.fileName'),\n prop: 'originalFilename',\n type: 'EpLink',\n onClick({ row }) {\n previewFile(row.filePath)\n },\n },\n {\n label: t('ep.attachment.creator'),\n prop: 'createBy',\n },\n {\n label: t('ep.attachment.createTime'),\n prop: 'createTime',\n },\n {\n label: t('ep.attachment.description'),\n prop: 'note',\n type: 'EpInput',\n show: () => props.isNote,\n },\n ])\n const addAttachment = async () => {\n toBeConfirmData = []\n const fileData = await importFile({\n api: 'api-f/fast/files/save',\n extraData: {\n createBy: Cookies.get('accountName') || '',\n },\n })\n fileData.fileId = fileData.id\n delete fileData.id\n if (isDialogOpen) {\n // 待确认的附件列表\n toBeConfirmData.push(fileData)\n }\n if (props.beforeAdd) {\n await props.beforeAdd?.(fileData)\n }\n data.value.push(fileData)\n }\n // 确认\n const onConfirm = async (resolve) => {\n await tableRef.value?.validate()\n resolve(data.value)\n toBeConfirmData = []\n toBeDeleteData = {}\n }\n // 取消\n const onCancel = (resolve) => {\n if (toBeConfirmData.length) {\n // 找到待确认的附件\n const index = data.value.findIndex((item) => {\n return item.fileId === toBeConfirmData[0].fileId\n })\n if (index !== -1) {\n // 删除待确认的附件\n data.value.splice(index, 1)\n }\n // 清空待确认的附件列表\n toBeConfirmData = []\n }\n if (Object.keys(toBeDeleteData).length) {\n // 找到待删除的附件在原位置插入\n Object.keys(toBeDeleteData).forEach((oldIndex) => {\n data.value.splice(Number(oldIndex), 0, toBeDeleteData[oldIndex])\n })\n // 清空待删除的附件列表\n toBeDeleteData = {}\n }\n resolve()\n }\n const permission = computed(() => {\n const arr = props.permission?.split(',') || []\n return {\n arg: arr[0],\n value: arr[1]\n }\n })\n return {\n columns,\n addAttachment,\n isNormalOpen,\n isDialogOpen,\n onConfirm,\n onCancel,\n mode,\n permission\n }\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,aAAA,GAAgB,CAAC,KAAA,EAAO,EAAE,MAAK,KAAM;AACh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ChD,QAAA,IAAA,CAAK,KAAA,CAAM,OAAO,MAAA,CAAO,QAAQ,GAAG,CAAA,EAAG,cAAA,CAAe,QAAQ,CAAC,CAAA;AAAA,MACjE,CAAC,CAAA;AAED,MAAA,cAAA,GAAiB,EAAC;AAAA,IACpB;AACA,IAAA,OAAA,EAAQ;AAAA,EACV,CAAA;AACA,EAAA,MAAM,UAAA,GAAa,SAAS,MAAM;AAChC,IAAA,MAAM,MAAM,KAAA,CAAM,UAAA,EAAY,KAAA,CAAM,GAAG,KAAK,EAAC;AAC7C,IAAA,OAAO;AAAA,MACL,GAAA,EAAK,IAAI,CAAC,CAAA;AAAA,MACV,KAAA,EAAO,IAAI,CAAC;AAAA,KACd;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -15,7 +15,11 @@ const useFormItemSlots = (props) => {
15
15
  const events = {};
16
16
  for (const key in attrs) {
17
17
  if (key.startsWith("on")) {
18
- events[key] = attrs[key];
18
+ events[key] = (...args) => {
19
+ const tableScope = attrs["table-scope"];
20
+ const eventFn = attrs[key];
21
+ return eventFn(...args, tableScope);
22
+ };
19
23
  }
20
24
  }
21
25
  const formData = attrs["form-data"];