el-plus 0.0.51 → 0.0.53

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 (70) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +107 -54
  4. package/dist/index.full.min.js +1 -1
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +1 -1
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +107 -55
  9. package/es/components/attachment/src/attachment.d.ts +4 -3
  10. package/es/components/attachment/src/attachment.mjs +1 -2
  11. package/es/components/attachment/src/attachment.mjs.map +1 -1
  12. package/es/components/attachment/src/attachment.vue2.mjs +2 -2
  13. package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
  14. package/es/components/attachment/src/use-attachment.mjs +2 -0
  15. package/es/components/attachment/src/use-attachment.mjs.map +1 -1
  16. package/es/components/header/index.d.ts +90 -0
  17. package/es/components/header/src/header.d.ts +9 -0
  18. package/es/components/header/src/header.mjs +10 -0
  19. package/es/components/header/src/header.mjs.map +1 -1
  20. package/es/components/header/src/header.vue.d.ts +38 -0
  21. package/es/components/header/src/header.vue2.mjs +4 -3
  22. package/es/components/header/src/header.vue2.mjs.map +1 -1
  23. package/es/hooks/dialog/use-confirm-dialog.d.ts +12 -0
  24. package/es/hooks/dialog/use-confirm-dialog.mjs +47 -0
  25. package/es/hooks/dialog/use-confirm-dialog.mjs.map +1 -0
  26. package/es/hooks/dialog/use-dialog.d.ts +2 -0
  27. package/es/hooks/dialog/use-dialog.mjs +28 -32
  28. package/es/hooks/dialog/use-dialog.mjs.map +1 -1
  29. package/es/hooks/dialog/use-form-dialog.d.ts +1 -0
  30. package/es/hooks/dialog/use-form-dialog.mjs +4 -3
  31. package/es/hooks/dialog/use-form-dialog.mjs.map +1 -1
  32. package/es/hooks/index.d.ts +1 -0
  33. package/es/hooks/index.mjs +1 -0
  34. package/es/hooks/index.mjs.map +1 -1
  35. package/es/index.mjs +1 -0
  36. package/es/index.mjs.map +1 -1
  37. package/es/package.json.mjs +1 -1
  38. package/lib/components/attachment/src/attachment.d.ts +4 -3
  39. package/lib/components/attachment/src/attachment.js +1 -2
  40. package/lib/components/attachment/src/attachment.js.map +1 -1
  41. package/lib/components/attachment/src/attachment.vue2.js +2 -2
  42. package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
  43. package/lib/components/attachment/src/use-attachment.js +2 -0
  44. package/lib/components/attachment/src/use-attachment.js.map +1 -1
  45. package/lib/components/header/index.d.ts +90 -0
  46. package/lib/components/header/src/header.d.ts +9 -0
  47. package/lib/components/header/src/header.js +10 -0
  48. package/lib/components/header/src/header.js.map +1 -1
  49. package/lib/components/header/src/header.vue.d.ts +38 -0
  50. package/lib/components/header/src/header.vue2.js +3 -2
  51. package/lib/components/header/src/header.vue2.js.map +1 -1
  52. package/lib/hooks/dialog/use-confirm-dialog.d.ts +12 -0
  53. package/lib/hooks/dialog/use-confirm-dialog.js +49 -0
  54. package/lib/hooks/dialog/use-confirm-dialog.js.map +1 -0
  55. package/lib/hooks/dialog/use-dialog.d.ts +2 -0
  56. package/lib/hooks/dialog/use-dialog.js +27 -31
  57. package/lib/hooks/dialog/use-dialog.js.map +1 -1
  58. package/lib/hooks/dialog/use-form-dialog.d.ts +1 -0
  59. package/lib/hooks/dialog/use-form-dialog.js +4 -3
  60. package/lib/hooks/dialog/use-form-dialog.js.map +1 -1
  61. package/lib/hooks/index.d.ts +1 -0
  62. package/lib/hooks/index.js +2 -0
  63. package/lib/hooks/index.js.map +1 -1
  64. package/lib/index.js +2 -0
  65. package/lib/index.js.map +1 -1
  66. package/lib/package.json.js +1 -1
  67. package/package.json +1 -1
  68. package/theme-chalk/dialog.css +1 -1
  69. package/theme-chalk/index.css +1 -1
  70. package/theme-chalk/src/dialog.scss +7 -0
@@ -1,4 +1,4 @@
1
- /*! ElPlus v0.0.51 */
1
+ /*! ElPlus v0.0.53 */
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';
@@ -711,7 +711,7 @@ async function queryRoles() {
711
711
  }
712
712
  }
713
713
 
714
- const bem$4 = createNameSpace("button");
714
+ const bem$5 = createNameSpace("button");
715
715
  var Buttons = /* @__PURE__ */ defineComponent({
716
716
  name: "EpButtons",
717
717
  directives: {
@@ -763,7 +763,7 @@ var Buttons = /* @__PURE__ */ defineComponent({
763
763
  return () => createVNode(Fragment, null, [customList.value.map((item) => {
764
764
  const permissionArr = item.permission?.split(":") || [];
765
765
  return withDirectives(createVNode(resolveComponent("el-button"), mergeProps({
766
- "class": [bem$4.b(), prepareClassNames()],
766
+ "class": [bem$5.b(), prepareClassNames()],
767
767
  "style": prepareStyles(),
768
768
  "key": item.prop || item.name
769
769
  }, {
@@ -1024,7 +1024,7 @@ const formItemProps = {
1024
1024
  };
1025
1025
  const expandFormItemPropsKeys = Object.keys(expandFormItemProps);
1026
1026
 
1027
- const bem$3 = createNameSpace("form-item");
1027
+ const bem$4 = createNameSpace("form-item");
1028
1028
  var EpFormItem = /* @__PURE__ */ defineComponent({
1029
1029
  name: "EpFormItem",
1030
1030
  inheritAttrs: false,
@@ -1046,7 +1046,7 @@ var EpFormItem = /* @__PURE__ */ defineComponent({
1046
1046
  } = props;
1047
1047
  return () => {
1048
1048
  return createVNode(ElFormItem, mergeProps({
1049
- "class": [bem$3.b(), prepareClassNames()],
1049
+ "class": [bem$4.b(), prepareClassNames()],
1050
1050
  "style": prepareStyles()
1051
1051
  }, {
1052
1052
  ...prepareProps(formItemProps2, [...expandFormItemPropsKeys]),
@@ -1320,7 +1320,7 @@ var _sfc_main$a = /* @__PURE__ */ defineComponent({
1320
1320
 
1321
1321
  const EpInput = withInstall(_sfc_main$a);
1322
1322
 
1323
- function _isSlot$1(s) {
1323
+ function _isSlot(s) {
1324
1324
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
1325
1325
  }
1326
1326
  const useTemplatePromise = (options = {}) => {
@@ -1394,7 +1394,7 @@ const useTemplatePromise = (options = {}) => {
1394
1394
  });
1395
1395
  if (transition) return () => {
1396
1396
  let _slot;
1397
- return createVNode(Transition, transition, _isSlot$1(_slot = renderList()) ? _slot : {
1397
+ return createVNode(Transition, transition, _isSlot(_slot = renderList()) ? _slot : {
1398
1398
  default: () => [_slot]
1399
1399
  });
1400
1400
  };
@@ -1404,10 +1404,7 @@ const useTemplatePromise = (options = {}) => {
1404
1404
  return markRaw(component);
1405
1405
  };
1406
1406
 
1407
- function _isSlot(s) {
1408
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
1409
- }
1410
- const bem$2 = createNameSpace("dialog");
1407
+ const bem$3 = createNameSpace("dialog");
1411
1408
  const useDialog = (options = {}) => {
1412
1409
  const {
1413
1410
  t
@@ -1418,7 +1415,9 @@ const useDialog = (options = {}) => {
1418
1415
  render: render$1,
1419
1416
  destroyOnClose,
1420
1417
  onConfirm,
1418
+ confirmText,
1421
1419
  onCancel,
1420
+ cancelText,
1422
1421
  showFooter = true,
1423
1422
  ...dialogProps
1424
1423
  } = options;
@@ -1438,38 +1437,35 @@ const useDialog = (options = {}) => {
1438
1437
  };
1439
1438
  const slots = {};
1440
1439
  if (showFooter) {
1441
- slots.footer = () => {
1442
- let _slot, _slot2;
1443
- return createVNode("div", {
1444
- "class": bem$2.e("footer")
1445
- }, [scopedSlots.footerPrepend?.(promiseOptions), createVNode(ElButton, {
1446
- "size": "default",
1447
- "onClick": () => {
1448
- if (onCancel) {
1449
- onCancel(reject);
1450
- } else {
1451
- reject("cancel");
1452
- }
1440
+ slots.footer = () => createVNode("div", {
1441
+ "class": bem$3.e("footer")
1442
+ }, [scopedSlots.footerPrepend?.(promiseOptions), createVNode(ElButton, {
1443
+ "size": "default",
1444
+ "onClick": () => {
1445
+ if (onCancel) {
1446
+ onCancel(reject);
1447
+ } else {
1448
+ reject("cancel");
1453
1449
  }
1454
- }, _isSlot(_slot = t("ep.dialog.cancel")) ? _slot : {
1455
- default: () => [_slot]
1456
- }), scopedSlots.footerInner?.(promiseOptions), createVNode(ElButton, {
1457
- "type": "primary",
1458
- "onClick": async () => {
1459
- if (onConfirm) {
1460
- onConfirm(resolve);
1461
- } else {
1462
- resolve("confirm");
1463
- }
1464
- },
1465
- "loading": isResolving
1466
- }, _isSlot(_slot2 = t("ep.dialog.confirm")) ? _slot2 : {
1467
- default: () => [_slot2]
1468
- }), scopedSlots.footerAppend?.(promiseOptions)]);
1469
- };
1450
+ }
1451
+ }, {
1452
+ default: () => [cancelText || t("ep.dialog.cancel")]
1453
+ }), scopedSlots.footerInner?.(promiseOptions), createVNode(ElButton, {
1454
+ "type": "primary",
1455
+ "onClick": async () => {
1456
+ if (onConfirm) {
1457
+ onConfirm(resolve);
1458
+ } else {
1459
+ resolve("confirm");
1460
+ }
1461
+ },
1462
+ "loading": isResolving
1463
+ }, {
1464
+ default: () => [confirmText || t("ep.dialog.confirm")]
1465
+ }), scopedSlots.footerAppend?.(promiseOptions)]);
1470
1466
  }
1471
1467
  return createVNode(ElDialog, mergeProps({
1472
- "class": bem$2.b(),
1468
+ "class": bem$3.b(),
1473
1469
  "modelValue": true
1474
1470
  }, {
1475
1471
  closeOnClickModal: false,
@@ -1962,11 +1958,12 @@ const expandTablePropsKeys = Object.keys(expandTableProps);
1962
1958
  const tableEmits = [...ElTable.emits, "single-selection-change"];
1963
1959
  const tableEmitsKeys = tableEmits;
1964
1960
 
1965
- const bem$1 = createNameSpace("form-dialog");
1961
+ const bem$2 = createNameSpace("form-dialog");
1966
1962
  const useFormDialog = (options = {}) => {
1967
1963
  const {
1968
1964
  dialogProps,
1969
1965
  title,
1966
+ width = "80%",
1970
1967
  ...formProps
1971
1968
  } = options;
1972
1969
  const formRef = ref();
@@ -1979,10 +1976,10 @@ const useFormDialog = (options = {}) => {
1979
1976
  }
1980
1977
  };
1981
1978
  return useDialog({
1982
- class: bem$1.b(),
1983
- width: "80%",
1979
+ class: bem$2.b(),
1980
+ width,
1984
1981
  title,
1985
- render: (props) => {
1982
+ render: () => {
1986
1983
  return createVNode(EpForm, mergeProps({
1987
1984
  "ref": formRef,
1988
1985
  "modelValue": formData,
@@ -1995,7 +1992,7 @@ const useFormDialog = (options = {}) => {
1995
1992
  },
1996
1993
  onConfirm: async (resolve) => {
1997
1994
  await formRef.value.validate();
1998
- resolve(JSON.parse(JSON.stringify(formData)));
1995
+ resolve(isUseComFormData ? JSON.parse(JSON.stringify(formData)) : formData);
1999
1996
  resetForm();
2000
1997
  },
2001
1998
  onCancel: async (resolve) => {
@@ -3199,6 +3196,16 @@ const headerProps = {
3199
3196
  isShowAttachmentButton: {
3200
3197
  type: Boolean,
3201
3198
  default: false
3199
+ },
3200
+ // 附件列表
3201
+ fileList: {
3202
+ type: Array,
3203
+ default: () => []
3204
+ },
3205
+ attachmentProps: {
3206
+ type: Object,
3207
+ default: () => {
3208
+ }
3202
3209
  }
3203
3210
  };
3204
3211
  const headerEmits = {};
@@ -3363,7 +3370,7 @@ const attachmentProps = {
3363
3370
  },
3364
3371
  // 页面模式
3365
3372
  mode: {
3366
- ...headerProps.mode
3373
+ type: String
3367
3374
  },
3368
3375
  // 展示模式
3369
3376
  openType: {
@@ -3619,6 +3626,8 @@ const useAttachment = (props, { data }) => {
3619
3626
  const onConfirm = async (resolve) => {
3620
3627
  await tableRef.value?.validate();
3621
3628
  resolve(data.value);
3629
+ toBeConfirmData = [];
3630
+ toBeDeleteData = {};
3622
3631
  };
3623
3632
  const onCancel = (resolve) => {
3624
3633
  if (toBeConfirmData.length) {
@@ -3696,7 +3705,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3696
3705
  return (_ctx, _cache) => {
3697
3706
  const _component_EpButtons = resolveComponent("EpButtons");
3698
3707
  return openBlock(), createElementBlock(Fragment, null, [
3699
- _ctx.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
3708
+ props.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
3700
3709
  key: 0,
3701
3710
  type: "primary",
3702
3711
  plain: "",
@@ -3712,7 +3721,7 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
3712
3721
  createVNode(unref(AttachmentDialog), null, {
3713
3722
  default: withCtx(() => [
3714
3723
  createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
3715
- _ctx.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
3724
+ props.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
3716
3725
  key: 0,
3717
3726
  type: "primary",
3718
3727
  list: [
@@ -3771,10 +3780,11 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
3771
3780
  _: 1
3772
3781
  }, 8, ["onBack"])) : createCommentVNode("", true),
3773
3782
  createVNode(unref(EpButtons), { list: unref(buttons) }, null, 8, ["list"]),
3774
- props.isShowAttachmentButton ? (openBlock(), createBlock(unref(EpAttachment), {
3783
+ props.isShowAttachmentButton ? (openBlock(), createBlock(unref(EpAttachment), mergeProps({
3775
3784
  key: 1,
3785
+ "model-value": props.fileList,
3776
3786
  "is-show-open-dialog-button": ""
3777
- })) : createCommentVNode("", true)
3787
+ }, props.attachmentProps), null, 16, ["model-value"])) : createCommentVNode("", true)
3778
3788
  ], 6);
3779
3789
  };
3780
3790
  }
@@ -4159,7 +4169,7 @@ var components = [
4159
4169
  EpUniVue
4160
4170
  ];
4161
4171
 
4162
- var version = "0.0.51";
4172
+ var version = "0.0.53";
4163
4173
 
4164
4174
  var globalProperties = {
4165
4175
  install(app) {
@@ -4172,7 +4182,7 @@ var plugins = /*#__PURE__*/Object.freeze({
4172
4182
  globalProperties: globalProperties
4173
4183
  });
4174
4184
 
4175
- const bem = createNameSpace("choose-dialog");
4185
+ const bem$1 = createNameSpace("choose-dialog");
4176
4186
  const useChooseDialog = (options = {}) => {
4177
4187
  const {
4178
4188
  t
@@ -4189,7 +4199,7 @@ const useChooseDialog = (options = {}) => {
4189
4199
  if (!showSingleSelectionCol) {
4190
4200
  scopedSlots.footerPrepend = () => {
4191
4201
  return createVNode("span", {
4192
- "class": bem.e("selected-count")
4202
+ "class": bem$1.e("selected-count")
4193
4203
  }, [t("ep.chooseDialog.selected"), selections.value.length, t("ep.chooseDialog.unit")]);
4194
4204
  };
4195
4205
  }
@@ -4199,7 +4209,7 @@ const useChooseDialog = (options = {}) => {
4199
4209
  };
4200
4210
  let searchListPageRef;
4201
4211
  return useDialog({
4202
- class: bem.b(),
4212
+ class: bem$1.b(),
4203
4213
  width: "80%",
4204
4214
  showFooter: !showSingleSelectionCol,
4205
4215
  scopedSlots,
@@ -4246,6 +4256,48 @@ const useChooseDialog = (options = {}) => {
4246
4256
  });
4247
4257
  };
4248
4258
 
4259
+ const bem = createNameSpace("confirm-dialog");
4260
+ const useConfirmDialog = (options = {}) => {
4261
+ const {
4262
+ dialogProps = {},
4263
+ width = "50%",
4264
+ title,
4265
+ /** TextareaProps */
4266
+ rows = 5,
4267
+ maxlength = 500,
4268
+ minlength,
4269
+ showWordLimit = true,
4270
+ /** TextareaFormItemProps */
4271
+ rules,
4272
+ required = true,
4273
+ placeholder
4274
+ } = options;
4275
+ const formItemList = [{
4276
+ rules,
4277
+ prop: "value",
4278
+ label: " ",
4279
+ required,
4280
+ props: {
4281
+ placeholder,
4282
+ type: "textarea",
4283
+ rows,
4284
+ maxlength,
4285
+ minlength,
4286
+ showWordLimit
4287
+ }
4288
+ }];
4289
+ return useFormDialog({
4290
+ title,
4291
+ width,
4292
+ formItemList,
4293
+ dialogProps: {
4294
+ ...dialogProps,
4295
+ class: bem.b(),
4296
+ destroyOnClose: true
4297
+ }
4298
+ });
4299
+ };
4300
+
4249
4301
  const INSTALLED_KEY = /* @__PURE__ */ Symbol("INSTALLED_KEY");
4250
4302
  const install = (app, options) => {
4251
4303
  if (app[INSTALLED_KEY]) return;
@@ -4258,4 +4310,4 @@ const plugin = {
4258
4310
  version
4259
4311
  };
4260
4312
 
4261
- export { EpAttachment, EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, EpUniVue, attachmentProps, buttonsProps, componentType, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, uniVueProps, useChooseDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };
4313
+ export { EpAttachment, EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, EpUniVue, attachmentProps, buttonsProps, componentType, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, uniVueProps, useChooseDialog, useConfirmDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };
@@ -1,11 +1,12 @@
1
- import type { ExtractPropTypes, PropType } from 'vue';
1
+ import type { ExtractPublicPropTypes, PropType } from 'vue';
2
+ import type { PageMode } from 'el-plus/es/hooks/use-navigation';
2
3
  export declare const attachmentProps: {
3
4
  readonly formatColumns: {
4
5
  readonly type: PropType<import("el-plus/es/components/table").TableColumn[]>;
5
6
  readonly default: () => never[];
6
7
  };
7
8
  readonly mode: {
8
- readonly type: PropType<import("el-plus/es/hooks").PageMode>;
9
+ readonly type: PropType<PageMode>;
9
10
  };
10
11
  readonly openType: {
11
12
  readonly type: PropType<"dialog" | "normal">;
@@ -24,4 +25,4 @@ export declare const attachmentProps: {
24
25
  readonly default: false;
25
26
  };
26
27
  };
27
- export type AttachmentProps = ExtractPropTypes<typeof attachmentProps>;
28
+ export type AttachmentProps = ExtractPublicPropTypes<typeof attachmentProps>;
@@ -1,4 +1,3 @@
1
- import { headerProps } from '../../header/src/header.mjs';
2
1
  import { tableProps } from '../../table/src/table.mjs';
3
2
 
4
3
  const attachmentProps = {
@@ -8,7 +7,7 @@ const attachmentProps = {
8
7
  },
9
8
  // 页面模式
10
9
  mode: {
11
- ...headerProps.mode
10
+ type: String
12
11
  },
13
12
  // 展示模式
14
13
  openType: {
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { tableProps } from '@el-plus/components/table'\nimport { headerProps } from '@el-plus/components/header'\nexport const attachmentProps = {\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n // 页面模式\n mode: {\n ...headerProps.mode,\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 = ExtractPropTypes<typeof attachmentProps>\n"],"names":[],"mappings":";;;AAGO,MAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,aAAA,EAAe;AAAA,IACb,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,GAAG,WAAA,CAAY;AAAA,GACjB;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'\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;;;;"}
@@ -56,7 +56,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
56
56
  return (_ctx, _cache) => {
57
57
  const _component_EpButtons = resolveComponent("EpButtons");
58
58
  return openBlock(), createElementBlock(Fragment, null, [
59
- _ctx.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
59
+ props.isShowOpenDialogButton ? (openBlock(), createBlock(unref(ElButton), {
60
60
  key: 0,
61
61
  type: "primary",
62
62
  plain: "",
@@ -72,7 +72,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
72
72
  createVNode(unref(AttachmentDialog), null, {
73
73
  default: withCtx(() => [
74
74
  createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
75
- _ctx.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
75
+ props.openType === "dialog" ? (openBlock(), createBlock(_component_EpButtons, {
76
76
  key: 0,
77
77
  type: "primary",
78
78
  list: [
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.vue2.mjs","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"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=\"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","isShowOpenDialogButton","_createBlock","_unref","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createElementVNode","openType","_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,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CAUUJ,KAAA,WAVVO,UAAA,CAUU;AAAA,cATR,GAAA,EAAI,UAAA;AAAA,cACH,KAAA,EAAK,CAAA,EAAKP,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 >\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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AA,EAAA,EAZD,KAAA,EAAA,EAAA,iBAAA,MAAA,EAAA,YAAA,EAAA,OAAA,EAAA,EAA8C,EAAA;AAAA,cAEzC,MAAM,QAAA,KAAQ,QAAA,iBADtBN,YAUE,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;;;;;;;;;;"}
@@ -100,6 +100,8 @@ const useAttachment = (props, { data }) => {
100
100
  const onConfirm = async (resolve) => {
101
101
  await tableRef.value?.validate();
102
102
  resolve(data.value);
103
+ toBeConfirmData = [];
104
+ toBeDeleteData = {};
103
105
  };
104
106
  const onCancel = (resolve) => {
105
107
  if (toBeConfirmData.length) {
@@ -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 }\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,EAAE,IAAA,EAAM,WAAA,EAAY,GAAI,aAAA,EAAc;AAC5C,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AACxB,EAAA,MAAM,IAAA,GAAO,SAAS,MAAM;AAC1B,IAAA,OAAO,KAAA,CAAM,QAAQ,WAAA,CAAY,KAAA;AAAA,EACnC,CAAC,CAAA;AACD,EAAA,MAAM,QAAA,GAAW,eAA8B,UAAU,CAAA;AACzD,EAAA,MAAM,YAAA,GAAe,MAAM,QAAA,KAAa,QAAA;AACxC,EAAA,MAAM,YAAA,GAAe,MAAM,QAAA,KAAa,QAAA;AAGxC,EAAA,IAAI,kBAAyC,EAAC;AAE9C,EAAA,IAAI,iBAEA,EAAC;AACL,EAAA,MAAM,UAAU,GAAA,CAAI;AAAA,IAClB;AAAA,MACE,IAAA,EAAM,WAAA;AAAA,MACN,KAAA,EAAO,EAAE,yBAAyB,CAAA;AAAA,MAClC,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO;AAAA,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AAC3C,QAAA,OAAO,IAAA,CAAK,MAAA,KAAW,eAAA,CAAgB,CAAC,CAAA,CAAE,MAAA;AAAA,MAC5C,CAAC,CAAA;AACD,MAAA,IAAI,UAAU,EAAA,EAAI;AAEhB,QAAA,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,KAAA,EAAO,CAAC,CAAA;AAAA,MAC5B;AAEA,MAAA,eAAA,GAAkB,EAAC;AAAA,IACrB;AACA,IAAA,IAAI,MAAA,CAAO,IAAA,CAAK,cAAc,CAAA,CAAE,MAAA,EAAQ;AAEtC,MAAA,MAAA,CAAO,IAAA,CAAK,cAAc,CAAA,CAAE,OAAA,CAAQ,CAAC,QAAA,KAAa;AAChD,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,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 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,EAAE,IAAA,EAAM,WAAA,EAAY,GAAI,aAAA,EAAc;AAC5C,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AACxB,EAAA,MAAM,IAAA,GAAO,SAAS,MAAM;AAC1B,IAAA,OAAO,KAAA,CAAM,QAAQ,WAAA,CAAY,KAAA;AAAA,EACnC,CAAC,CAAA;AACD,EAAA,MAAM,QAAA,GAAW,eAA8B,UAAU,CAAA;AACzD,EAAA,MAAM,YAAA,GAAe,MAAM,QAAA,KAAa,QAAA;AACxC,EAAA,MAAM,YAAA,GAAe,MAAM,QAAA,KAAa,QAAA;AAGxC,EAAA,IAAI,kBAAyC,EAAC;AAE9C,EAAA,IAAI,iBAEA,EAAC;AACL,EAAA,MAAM,UAAU,GAAA,CAAI;AAAA,IAClB;AAAA,MACE,IAAA,EAAM,WAAA;AAAA,MACN,KAAA,EAAO,EAAE,yBAAyB,CAAA;AAAA,MAClC,KAAA,EAAO,OAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,IAAA,EAAM,MAAA;AAAA,QACN,IAAA,EAAM;AAAA,UACJ;AAAA,YACE,IAAA,EAAM,EAAE,wBAAwB,CAAA;AAAA,YAChC,OAAA,CAAQ,EAAE,GAAA,EAAI,EAAG;AACf,cAAA,YAAA,CA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ACD,MAAA,IAAI,UAAU,EAAA,EAAI;AAEhB,QAAA,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,KAAA,EAAO,CAAC,CAAA;AAAA,MAC5B;AAEA,MAAA,eAAA,GAAkB,EAAC;AAAA,IACrB;AACA,IAAA,IAAI,MAAA,CAAO,IAAA,CAAK,cAAc,CAAA,CAAE,MAAA,EAAQ;AAEtC,MAAA,MAAA,CAAO,IAAA,CAAK,cAAc,CAAA,CAAE,OAAA,CAAQ,CAAC,QAAA,KAAa;AAChD,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,OAAO;AAAA,IACL,OAAA;AAAA,IACA,aAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -33,6 +33,14 @@ export declare const EpHeader: {
33
33
  readonly type: BooleanConstructor;
34
34
  readonly default: false;
35
35
  };
36
+ readonly fileList: {
37
+ readonly type: import("vue").PropType<Record<string, any>[]>;
38
+ readonly default: () => never[];
39
+ };
40
+ readonly attachmentProps: {
41
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
42
+ readonly default: () => void;
43
+ };
36
44
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
37
45
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
38
46
  name: string;
@@ -50,6 +58,28 @@ export declare const EpHeader: {
50
58
  readonly allowBack: boolean;
51
59
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
52
60
  readonly isShowAttachmentButton: boolean;
61
+ readonly fileList: Record<string, any>[];
62
+ readonly attachmentProps: {
63
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
64
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
65
+ [key: string]: any;
66
+ required: boolean | (() => boolean);
67
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
68
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
69
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
70
+ type: string;
71
+ props: Record<string, any>;
72
+ filter: boolean;
73
+ editable: boolean | ((formData: Record<string, any>) => void);
74
+ } & {} & {
75
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
76
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
77
+ }>[] | undefined;
78
+ readonly openType?: "dialog" | "normal" | undefined;
79
+ readonly isType?: boolean | undefined;
80
+ readonly isNote?: boolean | undefined;
81
+ readonly isShowOpenDialogButton?: boolean | undefined;
82
+ };
53
83
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
54
84
  P: {};
55
85
  B: {};
@@ -91,6 +121,14 @@ export declare const EpHeader: {
91
121
  readonly type: BooleanConstructor;
92
122
  readonly default: false;
93
123
  };
124
+ readonly fileList: {
125
+ readonly type: import("vue").PropType<Record<string, any>[]>;
126
+ readonly default: () => never[];
127
+ };
128
+ readonly attachmentProps: {
129
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
130
+ readonly default: () => void;
131
+ };
94
132
  }>> & Readonly<{}>, {}, {}, {}, {}, {
95
133
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
96
134
  name: string;
@@ -108,6 +146,28 @@ export declare const EpHeader: {
108
146
  readonly allowBack: boolean;
109
147
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
110
148
  readonly isShowAttachmentButton: boolean;
149
+ readonly fileList: Record<string, any>[];
150
+ readonly attachmentProps: {
151
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
152
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
153
+ [key: string]: any;
154
+ required: boolean | (() => boolean);
155
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
156
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
157
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
158
+ type: string;
159
+ props: Record<string, any>;
160
+ filter: boolean;
161
+ editable: boolean | ((formData: Record<string, any>) => void);
162
+ } & {} & {
163
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
164
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
165
+ }>[] | undefined;
166
+ readonly openType?: "dialog" | "normal" | undefined;
167
+ readonly isType?: boolean | undefined;
168
+ readonly isNote?: boolean | undefined;
169
+ readonly isShowOpenDialogButton?: boolean | undefined;
170
+ };
111
171
  }>;
112
172
  __isFragment?: never;
113
173
  __isTeleport?: never;
@@ -134,6 +194,14 @@ export declare const EpHeader: {
134
194
  readonly type: BooleanConstructor;
135
195
  readonly default: false;
136
196
  };
197
+ readonly fileList: {
198
+ readonly type: import("vue").PropType<Record<string, any>[]>;
199
+ readonly default: () => never[];
200
+ };
201
+ readonly attachmentProps: {
202
+ readonly type: import("vue").PropType<import("el-plus/es/index").AttachmentProps>;
203
+ readonly default: () => void;
204
+ };
137
205
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
138
206
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
139
207
  name: string;
@@ -151,6 +219,28 @@ export declare const EpHeader: {
151
219
  readonly allowBack: boolean;
152
220
  readonly defaultButtons: import("./src/header").defaultButtonsProps[];
153
221
  readonly isShowAttachmentButton: boolean;
222
+ readonly fileList: Record<string, any>[];
223
+ readonly attachmentProps: {
224
+ readonly mode?: import("el-plus/es/hooks/use-navigation").PageMode | undefined;
225
+ readonly formatColumns?: Partial<import("element-plus").TableColumnCtx & {
226
+ [key: string]: any;
227
+ required: boolean | (() => boolean);
228
+ cellRequired: (scope: import("el-plus/es/index").TableScope) => boolean;
229
+ headerRender: import("element-plus").TableColumnCtx["renderHeader"];
230
+ disabled: boolean | ((scope: import("el-plus/es/index").TableScope) => boolean);
231
+ type: string;
232
+ props: Record<string, any>;
233
+ filter: boolean;
234
+ editable: boolean | ((formData: Record<string, any>) => void);
235
+ } & {} & {
236
+ show?: (boolean | ((T: unknown) => boolean)) | undefined;
237
+ hide?: (boolean | ((T: unknown) => boolean)) | undefined;
238
+ }>[] | undefined;
239
+ readonly openType?: "dialog" | "normal" | undefined;
240
+ readonly isType?: boolean | undefined;
241
+ readonly isNote?: boolean | undefined;
242
+ readonly isShowOpenDialogButton?: boolean | undefined;
243
+ };
154
244
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
155
245
  export default EpHeader;
156
246
  export * from './src/header';
@@ -1,4 +1,5 @@
1
1
  import type { ExtractPropTypes, PropType } from 'vue';
2
+ import type { AttachmentProps } from 'el-plus/es/components/attachment';
2
3
  import type { PageMode } from 'el-plus/es/hooks/use-navigation';
3
4
  export type defaultButtonsProps = 'modify' | 'save' | 'cancel' | 'refresh' | 'auditLog';
4
5
  export declare const headerProps: {
@@ -23,6 +24,14 @@ export declare const headerProps: {
23
24
  readonly type: BooleanConstructor;
24
25
  readonly default: false;
25
26
  };
27
+ readonly fileList: {
28
+ readonly type: PropType<Record<string, any>[]>;
29
+ readonly default: () => never[];
30
+ };
31
+ readonly attachmentProps: {
32
+ readonly type: PropType<AttachmentProps>;
33
+ readonly default: () => void;
34
+ };
26
35
  };
27
36
  export type HeaderProps = ExtractPropTypes<typeof headerProps>;
28
37
  export declare const headerEmits: {};
@@ -25,6 +25,16 @@ const headerProps = {
25
25
  isShowAttachmentButton: {
26
26
  type: Boolean,
27
27
  default: false
28
+ },
29
+ // 附件列表
30
+ fileList: {
31
+ type: Array,
32
+ default: () => []
33
+ },
34
+ attachmentProps: {
35
+ type: Object,
36
+ default: () => {
37
+ }
28
38
  }
29
39
  };
30
40
  const headerEmits = {};