@dt-frames/ui 1.0.12 → 1.0.13

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 (37) hide show
  1. package/es/components/curd/src/components/dialog.d.ts +20 -15
  2. package/es/components/curd/src/components/props.d.ts +4 -4
  3. package/es/components/curd/src/types/curd.type.d.ts +3 -2
  4. package/es/components/forms/src/components/formIcon.d.ts +10 -5
  5. package/es/components/index.d.ts +1 -1
  6. package/es/components/modal/src/components/modal.d.ts +2 -2
  7. package/es/components/modal/src/components/modalFooter.d.ts +9 -4
  8. package/es/components/modal/src/index.d.ts +10 -5
  9. package/es/components/modal/src/props.d.ts +2 -1
  10. package/es/components/table/src/hooks/useTable.d.ts +2 -2
  11. package/es/components/table/src/types/table.type.d.ts +2 -2
  12. package/es/components/upload/index.d.ts +1 -2
  13. package/es/components/upload/src/helper.d.ts +1 -0
  14. package/es/components/upload/src/index.d.ts +13 -9
  15. package/es/components/upload/src/props.d.ts +4 -1
  16. package/es/components/upload/src/upload.d.ts +18 -6
  17. package/es/index.js +220 -204
  18. package/es/style/components/upload/index.less +3 -11
  19. package/package.json +1 -1
  20. package/src/components/curd/src/components/dialog.vue +0 -1
  21. package/src/components/curd/src/components/props.ts +4 -4
  22. package/src/components/curd/src/hooks/useCurd.tsx +1 -1
  23. package/src/components/curd/src/types/curd.type.ts +3 -2
  24. package/src/components/index.ts +1 -2
  25. package/src/components/modal/src/components/modalFooter.vue +10 -2
  26. package/src/components/modal/src/index.vue +18 -7
  27. package/src/components/modal/src/props.ts +3 -2
  28. package/src/components/table/src/hooks/useRowSelection.ts +1 -1
  29. package/src/components/table/src/hooks/useTable.ts +1 -1
  30. package/src/components/table/src/hooks/useTableHeader.ts +2 -2
  31. package/src/components/table/src/types/table.type.ts +2 -2
  32. package/src/components/upload/index.less +3 -11
  33. package/src/components/upload/index.ts +0 -2
  34. package/src/components/upload/src/helper.ts +29 -1
  35. package/src/components/upload/src/props.ts +4 -1
  36. package/src/components/upload/src/upload.vue +88 -63
  37. package/src/components/upload/src/index.vue +0 -38
@@ -1,14 +1,6 @@
1
- .dt-upload-wrap{
2
- height: 350px;
3
- padding: 10px 20px;
4
- display: flex;
5
- flex-direction: column;
6
-
7
- .ant-table-wrapper{
8
- flex: 1;
9
- .ant-table-body{
10
- border-bottom: 1px solid #e7e7e7;
11
- }
1
+ .dt-file {
2
+ td.orange{
3
+ color: orange;
12
4
  }
13
5
  }
14
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"
@@ -29,7 +29,6 @@
29
29
 
30
30
  const [registerDialog, { closeModal }] = useModal({
31
31
  ...omit(toRaw(props), [
32
- 'actions',
33
32
  'curd',
34
33
  'formProps',
35
34
  'formsVal',
@@ -1,5 +1,5 @@
1
1
  import { FormSchema, ButtonProps } from "../../../forms";
2
- import { PropType } from "vue";
2
+ import { PropType, VNodeChild } from "vue";
3
3
 
4
4
  export const basicProps = {
5
5
  title: {
@@ -14,9 +14,9 @@ export const basicProps = {
14
14
  type: Array as PropType<FormSchema[]>,
15
15
  default: []
16
16
  },
17
- actions: {
18
- type: Array as PropType<ButtonProps[]>,
19
- default: []
17
+ footer: {
18
+ type: Array as PropType<VNodeChild | JSX.Element | ButtonProps[]>,
19
+ default: undefined
20
20
  },
21
21
  canFullscreen: {
22
22
  type: Boolean,
@@ -7,7 +7,7 @@ import { CrudOptType } from "../types/curd.type";
7
7
 
8
8
  export function useCurd(curdOpt: CrudOptType) {
9
9
  const formsVal = ref<Recordable>()
10
- const [register, { closeModal, setModalProps, openModal }] = useModalOut()
10
+ const [register, { openModal }] = useModalOut()
11
11
  const { confirm } = useMessage()
12
12
 
13
13
  const DtCurdModal = () => {
@@ -1,5 +1,6 @@
1
1
  import { Recordable } from "@dt-frames/core"
2
- import { FormSchema, ButtonProps, FormProps } from "../../../forms/src/types/form.type"
2
+ import { VNodeChild } from "vue"
3
+ import { FormSchema, FormProps, ButtonProps } from "../../../forms/src/types/form.type"
3
4
 
4
5
  export type CrudOptType = {
5
6
  // 标题
@@ -9,7 +10,7 @@ export type CrudOptType = {
9
10
  // 条目
10
11
  schemas: FormSchema[]
11
12
  // 操作栏
12
- actions?: ButtonProps[]
13
+ footer?: VNodeChild | JSX.Element | ButtonProps[]
13
14
  // 是否显示全屏
14
15
  showFullscreen?: boolean
15
16
  // 是否显示关闭按钮
@@ -8,7 +8,7 @@ import { useSource } from './source'
8
8
  import { useCurd } from './curd'
9
9
  import { export2Excel } from './excel'
10
10
  import { DtIframe } from './iframe'
11
- import { DtUpload, DtUploadModal } from './upload'
11
+ import { DtUpload } from './upload'
12
12
  import { DtTree } from './tree'
13
13
 
14
14
  const dtComponents = [
@@ -18,7 +18,6 @@ const dtComponents = [
18
18
  { name: 'dt-modal', component: DtModal },
19
19
  { name: 'dt-form', component: DtForm },
20
20
  { name: 'dt-upload', component: DtUpload },
21
- { name: 'dt-upload-modal', component: DtUploadModal },
22
21
  { name: 'dt-tree', component: DtTree },
23
22
  ];
24
23
 
@@ -2,13 +2,14 @@
2
2
  <slot name="appendFooter"></slot>
3
3
  <FormButtons
4
4
  :mode="'dialog'"
5
- :buttonList="buttonActions"
5
+ :buttonList="buttonList"
6
6
  @handle-method="handleMethod($event)"
7
7
  ></FormButtons>
8
8
  </template>
9
9
 
10
10
  <script lang="ts" setup>
11
- import { FormButtons, ButtonProps } from '../../../forms';
11
+ import { PropType, computed } from 'vue'
12
+ import { FormButtons, ButtonProps } from '../../../forms'
12
13
 
13
14
  const emits = defineEmits([
14
15
  'handleSave',
@@ -16,6 +17,7 @@
16
17
  ])
17
18
 
18
19
  const props = defineProps({
20
+ buttons: Object as PropType<ButtonProps[]>,
19
21
  showSave: {
20
22
  type: Boolean,
21
23
  default: true
@@ -27,6 +29,12 @@
27
29
  { name: '关闭', preIcon: 'mdi:close', flag: 'CANCEL' },
28
30
  ]
29
31
 
32
+ const buttonList = computed(() => {
33
+ if( props.buttons && props.buttons.length ) return props.buttons
34
+
35
+ return buttonActions
36
+ })
37
+
30
38
  // 处理按钮点击事件
31
39
  function handleMethod(item: ButtonProps) {
32
40
  switch( item.flag ) {
@@ -12,10 +12,10 @@
12
12
  <template #title v-if="!$slots.title">
13
13
  {{ getMergeProps.title }}
14
14
  </template>
15
-
15
+
16
16
  <template #footer v-if="!$slots.footer">
17
17
  <!-- 默认的footer内容 -->
18
- <ModalFooter :showSave="getBindValue.showSave" @handle-save="handleSave" @handle-cancel="handleCancel">
18
+ <ModalFooter :buttons="(propsRef.footer as any)" :showSave="getBindValue.showSave" @handle-save="handleSave" @handle-cancel="handleCancel">
19
19
  <template #[item]="data" v-for="item in Object.keys($slots)">
20
20
  <slot :name="item" v-bind="data || {}"></slot>
21
21
  </template>
@@ -32,7 +32,7 @@
32
32
  :minHeight="getBindValue.minHeight"
33
33
  :height="getWrapperHeight"
34
34
  :visible="visibleRef"
35
- :modalFooterHeight="footer !== undefined && !footer ? 0 : undefined"
35
+ :modalFooterHeight="modalFooterHeight"
36
36
  v-bind="omit(getBindValue.wrapperProps, 'visible', 'height', 'modalFooterHeight')"
37
37
  @ext-height="handleExtHeight"
38
38
  @height-change="handleHeightChange"
@@ -56,7 +56,7 @@
56
56
  import ModalFooter from './components/modalFooter.vue'
57
57
 
58
58
  import CloseIcon from './components/close-icon.vue';
59
- import { isFunction, deepMerge, ModalProps, ModalMethods } from '@dt-frames/core';
59
+ import { isFunction, deepMerge, ModalProps, ModalMethods, isArray } from '@dt-frames/core';
60
60
 
61
61
  const visibleRef = ref(false);
62
62
  const propsRef = ref<Partial<ModalProps>>();
@@ -66,6 +66,12 @@
66
66
  const props = defineProps( basicProps );
67
67
  const emits = defineEmits(['visible-change', 'height-change', 'cancel', 'save', 'register', 'update:visible'])
68
68
 
69
+ const modalFooterHeight = computed(() => {
70
+ if( isArray(props.footer) ) {
71
+ return (unref(propsRef).footer as any).length ? 0 : undefined
72
+ }
73
+ return props.footer !== undefined && !props.footer ? 0 : undefined
74
+ })
69
75
 
70
76
  const modalMethods: ModalMethods = {
71
77
  setModalProps,
@@ -97,10 +103,16 @@
97
103
  ...unref(getMergeProps),
98
104
  ...(unref(propsRef) as any),
99
105
  visible: unref(visibleRef),
100
- wrapClassName: unref(getWrapClassName),
106
+ wrapClassName: unref(getWrapClassName)
107
+ }
108
+
109
+ let omitArr = unref(fullScreenRef) ? ['height', 'title'] : ['title']
110
+
111
+ if( isArray( unref(propsRef).footer ) ) {
112
+ omitArr.push( 'footer' )
101
113
  }
102
114
 
103
- return omit(bindValue, unref(fullScreenRef) ? ['height', 'title'] : 'title');
115
+ return omit(bindValue, omitArr);
104
116
  });
105
117
 
106
118
  const getWrapperHeight = computed(() => {
@@ -132,7 +144,6 @@
132
144
  extHeightRef.value = height;
133
145
  }
134
146
 
135
-
136
147
  function setModalProps(props: Partial<ModalProps>) {
137
148
 
138
149
  propsRef.value = deepMerge(unref(propsRef) || ({} as any), props);
@@ -1,4 +1,5 @@
1
- import { CSSProperties, PropType, VNodeChild } from "vue";
1
+ import { CSSProperties, PropType, VNodeChild } from "vue"
2
+ import { ButtonProps } from "../../forms"
2
3
 
3
4
  // 支持设置的属性
4
5
  const modalProps = {
@@ -33,7 +34,7 @@ export const basicProps = Object.assign({}, modalProps, {
33
34
  keyboard : { type: Boolean, default: true },
34
35
  maskStyle : Object as PropType<CSSProperties>,
35
36
 
36
- footer : Object as PropType<VNodeChild | JSX.Element>,
37
+ footer : Object as PropType<VNodeChild | JSX.Element | ButtonProps[]>,
37
38
 
38
39
  bodyStyle : Object as PropType<CSSProperties>,
39
40
 
@@ -126,7 +126,7 @@ export function useRowSelection(
126
126
  return unref( getRowSelectionRef )
127
127
  }
128
128
 
129
- function getSelectRowKeys() {
129
+ function getSelectRowKeys(): string[] {
130
130
  return unref(selectedRowKeysRef);
131
131
  }
132
132
 
@@ -6,7 +6,7 @@ import { useHeaderCode } from './useHeaderCode'
6
6
 
7
7
  type Props = Partial<DynamicProps<BasicTableProps>>
8
8
 
9
- export function useTable(tableProps?: Props) {
9
+ export function useTable(tableProps?: Props): [registerTable: (...args: any) => void, methods: TableActionType] {
10
10
  const tableRef = ref<Nullable<TableActionType>>(null)
11
11
  const loadedRef = ref<Nullable<boolean>>(false)
12
12
 
@@ -9,10 +9,10 @@ export function useTableHeader(
9
9
  handlers: { onColumnsChange: (data: ColumnChangeParam[]) => void }
10
10
  ) {
11
11
  const getHeaderProps = computed((): Recordable => {
12
- const { tableSetting, toolbar = [] } = unref(propsRef)
12
+ const { tableSetting, toolbar } = unref(propsRef)
13
13
 
14
14
  const { getSlot } = useSlots()
15
- const hideTitle = !toolbar.length && !slots.toolbar && !slots.headerTop && !tableSetting
15
+ const hideTitle = !toolbar && !slots.toolbar && !slots.headerTop && !tableSetting
16
16
 
17
17
  return {
18
18
  title: hideTitle
@@ -154,7 +154,7 @@ export type TableActionType = {
154
154
  getRowSelection: () => TableRowSelection<Recordable>
155
155
  getCacheColumns: () => BasicColumn[]
156
156
  setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void
157
- getSelectRows: ( ) => void
158
- getSelectRowKeys: ( ) => void
157
+ getSelectRows: ( ) => Recordable[]
158
+ getSelectRowKeys: ( ) => string[]
159
159
  emit?: any
160
160
  }
@@ -1,14 +1,6 @@
1
- .dt-upload-wrap{
2
- height: 350px;
3
- padding: 10px 20px;
4
- display: flex;
5
- flex-direction: column;
6
-
7
- .ant-table-wrapper{
8
- flex: 1;
9
- .ant-table-body{
10
- border-bottom: 1px solid #e7e7e7;
11
- }
1
+ .dt-file {
2
+ td.orange{
3
+ color: orange;
12
4
  }
13
5
  }
14
6
 
@@ -1,7 +1,5 @@
1
- import DtUploadModal from './src/index.vue'
2
1
  import DtUpload from './src/upload.vue'
3
2
 
4
3
  export {
5
- DtUploadModal,
6
4
  DtUpload
7
5
  }
@@ -26,7 +26,35 @@ export function useHelpers(
26
26
  .join(',')
27
27
  })
28
28
 
29
+ const getHelpText = computed(() => {
30
+ const helpText = unref(helpTextRef)
31
+ if (helpText) {
32
+ return helpText
33
+ }
34
+
35
+ const helpTexts: string[] = []
36
+
37
+ const accept = unref(acceptRef)
38
+ if (accept.length > 0) {
39
+ helpTexts.push(`支持${ accept.join(',') }格式`)
40
+ }
41
+
42
+ const maxSize = unref(maxSizeRef)
43
+ if (maxSize) {
44
+ helpTexts.push(`不超过${ maxSize }M`)
45
+ }
46
+
47
+ const maxNumber = unref(maxNumberRef)
48
+ if (maxNumber && maxNumber !== Infinity) {
49
+ helpTexts.push(`最多可选择${ maxNumber }个文件`);
50
+ }
51
+
52
+ return helpTexts.join(',') || '请上传pptx、doc、jpg、jpeg、png、bmp、gif、xls、xlsx、txt、rar、zip、7z、tar、gz格式文件'
53
+
54
+ })
55
+
29
56
  return {
30
- getStringAccept
57
+ getStringAccept,
58
+ getHelpText
31
59
  }
32
60
  }
@@ -34,7 +34,6 @@ export const basicUploadProps = {
34
34
  // 文件最大多少MB
35
35
  maxSize: {
36
36
  type: Number as PropType<number>,
37
- default: 2,
38
37
  },
39
38
  // 最大数量的文件,Infinity不限制
40
39
  maxNumber: {
@@ -44,5 +43,9 @@ export const basicUploadProps = {
44
43
  defaultFiles: {
45
44
  type: Array as PropType<FileType[]>,
46
45
  default: []
46
+ },
47
+ showView: {
48
+ type: Boolean,
49
+ default: false
47
50
  }
48
51
  }
@@ -1,46 +1,49 @@
1
1
  <template>
2
- <div class="file-header">
3
- <div>
4
- <Upload
5
- :accept="getStringAccept"
6
- :multiple="multiple"
7
- :before-upload="beforeUpload"
8
- :show-upload-list="false"
9
- >
10
- <Button type="primary">
11
- <span v-icon="'ic:baseline-file-upload'"></span>
12
- 文件上传
2
+ <div class="dt-file">
3
+ <div class="file-header">
4
+ <div>
5
+ <Upload
6
+ :accept="getStringAccept"
7
+ :multiple="multiple"
8
+ :before-upload="beforeUpload"
9
+ :show-upload-list="false"
10
+ >
11
+ <Button type="primary">
12
+ <span v-icon="'ic:baseline-file-upload'"></span>
13
+ 文件上传
14
+ </Button>
15
+ </Upload>
16
+ <Button type="primary" v-if="showTemplateDownload" @click="templateDownload">
17
+ <span v-icon="'ic:baseline-file-download'"></span>
18
+ 模板下载
13
19
  </Button>
14
- </Upload>
15
- <Button type="primary" v-if="showTemplateDownload" @click="templateDownload">
16
- <span v-icon="'ic:baseline-file-download'"></span>
17
- 模板下载
18
- </Button>
20
+ </div>
21
+ <slot></slot>
19
22
  </div>
20
- <slot></slot>
21
- </div>
22
23
 
23
- <div class="file-type-tips ant-alert-info">
24
- <span v-icon="'ant-design:info-circle-outlined'"></span>
25
- <i>请上传pptx、doc、jpg、jpeg、png、bmp、gif、xls、xlsx、txt、rar、zip、7z、tar、gz格式文件</i>
26
- </div>
27
-
28
- <DtTable @register="registerTable"></DtTable>
29
-
30
- <Image
31
- :width="200"
32
- :style="{ display: 'none' }"
33
- :preview="{
34
- visible: imgVisable,
35
- onVisibleChange: setImgVisible,
36
- }"
37
- src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
38
- ></Image>
24
+ <div class="file-type-tips ant-alert-info">
25
+ <span v-icon="'ant-design:info-circle-outlined'"></span>
26
+ <i>{{ getHelpText }}</i>
27
+ </div>
28
+
29
+ <DtTable @register="registerTable"></DtTable>
30
+
31
+ <Image
32
+ :width="200"
33
+ :style="{ display: 'none' }"
34
+ :preview="{
35
+ visible: imgVisable,
36
+ onVisibleChange: setImgVisible,
37
+ }"
38
+ :src="imgSrcRef"
39
+ ></Image>
39
40
 
41
+ </div>
42
+
40
43
  </template>
41
44
 
42
45
  <script lang="ts" setup>
43
- import { h, ref, toRefs, watchEffect } from 'vue'
46
+ import { h, ref, toRefs, watchEffect, watch, computed } from 'vue'
44
47
  import { Button, Upload, Image } from 'ant-design-vue'
45
48
  import { DtTable, useTable } from '../../table'
46
49
  import { basicUploadProps } from './props'
@@ -53,62 +56,77 @@
53
56
 
54
57
  const filesRef = ref([])
55
58
  const historyFilesRef = ref([])
56
- const allFilesRef = ref([])
59
+ const allFilesRef = computed(() => {
60
+ return [...historyFilesRef.value, ...filesRef.value ]
61
+ })
57
62
 
58
63
  // 控制图片预览显示隐藏
59
64
  const imgVisable = ref( false )
65
+ const imgSrcRef = ref()
60
66
  const setImgVisible = (value) => imgVisable.value = value
61
67
 
62
68
  const props = defineProps( basicUploadProps )
63
69
 
64
70
  const { accept, helpText, maxNumber, maxSize } = toRefs(props)
65
- const { getStringAccept } = useHelpers( accept, helpText, maxNumber, maxSize )
71
+ const {
72
+ getStringAccept,
73
+ getHelpText
74
+ } = useHelpers( accept, helpText, maxNumber, maxSize )
66
75
 
76
+ const isImage = (fileType: string) => ['pdf', 'jpg', 'jpeg', 'png', 'bmp', 'gif'].includes( fileType )
67
77
 
68
- const [registerTable, { }] = useTable({
78
+ const [registerTable] = useTable({
69
79
  tableSetting: false,
70
80
  pagination: false,
71
81
  dataSource: allFilesRef,
72
82
  columns: [
73
83
  { title: '文件名称', dataIndex: 'fileName' },
74
- { title: '上传状态', dataIndex: 'fileStatue', render(row) {
75
- return h('span', {
76
- style: `color: ${ row.status === 0 ? 'orange' : 'green' }`,
77
- }, row.fileStatue)
78
- } },
84
+ { title: '上传状态', dataIndex: 'fileStatue', className: 'orange' },
79
85
  ],
80
86
  operations: {
81
87
  expand: true,
82
88
  btns: [
83
89
  { title: '预览', icon: 'ic:baseline-remove-red-eye',
84
90
  ifShow(row) {
85
- const supportFileTypes = ['pdf', 'jpg', 'jpeg', 'png', 'bmp', 'gif']
86
- return supportFileTypes.includes( row.fileName.split('.').pop() )
91
+ if( !props.showView ) return false
92
+ return isImage( row.fileName.split('.').pop() )
87
93
  },
88
- action: () => {
89
- setImgVisible(true)
94
+ action: ({ row }) => {
95
+ if( isImage( row.fileName.split('.').pop() ) ) {
96
+ setImgVisible(true)
97
+ }
90
98
  }
91
99
  },
92
- { title: '编辑', icon: 'mdi:text-box-edit-outline' },
93
- { title: '删除', icon: 'mdi:delete-outline' }
100
+ { title: '删除', icon: 'mdi:delete-outline', action: ({row}) => {
101
+ if( !row.status ) historyFilesRef.value = historyFilesRef.value.filter( it => it.fileId !== row.fileId )
102
+ else {
103
+ filesRef.value = filesRef.value.filter( it => it.fileId !== row.fileId )
104
+ }
105
+ } }
94
106
  ]
95
107
  }
96
108
  })
97
109
 
98
-
99
- watchEffect(() => {
100
- historyFilesRef.value = props.defaultFiles.map(file => {
101
- return {
102
- ...file,
103
- fileName: file.fileName,
104
- status: 0,
105
- fileStatue: '历史上传'
110
+ watch(
111
+ () => props.defaultFiles,
112
+ v => {
113
+ if( v ) {
114
+ historyFilesRef.value = props.defaultFiles.map((file, index) => {
115
+ return {
116
+ ...file,
117
+ fileId: file.id || index,
118
+ fileName: file.fileName,
119
+ status: 0,
120
+ fileStatue: '历史上传'
121
+ }
122
+ })
106
123
  }
107
- })
124
+ },
125
+ {
126
+ immediate: true
127
+ }
128
+ )
108
129
 
109
- allFilesRef.value = [...historyFilesRef.value, ...filesRef.value]
110
- })
111
-
112
130
 
113
131
  function beforeUpload(file: File) {
114
132
  const { maxSize } = props
@@ -139,13 +157,20 @@
139
157
  if (currentChunk < chunks) {
140
158
  loadNext();
141
159
  } else {
142
- filesRef.value.push({
160
+ let fileObj = {
143
161
  fileName: file.name,
144
162
  fileId: spark.end(),
145
163
  file,
146
164
  status: 1,
147
165
  fileStatue: '待上传'
148
- })
166
+ }
167
+
168
+ if( props.multiple ) {
169
+ filesRef.value.push(fileObj)
170
+ } else {
171
+ historyFilesRef.value = []
172
+ filesRef.value = [fileObj]
173
+ }
149
174
  }
150
175
  }
151
176
 
@@ -1,38 +0,0 @@
1
- <template>
2
- <DtModal
3
- @save="handleSave()"
4
- @register="register"
5
- >
6
- <div class="dt-upload-wrap">
7
- <DtUpload ref="uploadRef" :defaultFiles="defaultFiles">
8
- 111
9
- </DtUpload>
10
- </div>
11
- </DtModal>
12
- </template>
13
-
14
- <script lang="ts" setup>
15
- import { ref } from 'vue'
16
- import { DtModal, useModal } from '../../modal'
17
- import DtUpload from './upload.vue'
18
-
19
- const uploadRef = ref(null)
20
- const emites = defineEmits(['register'])
21
-
22
- // 注册弹框
23
- const [register] = useModal({
24
- width: '700px',
25
- title: '文件上传',
26
- maskClosable: false,
27
- })
28
-
29
- const defaultFiles = [
30
- { fileName: '叮咚发票667.09.pdf', fileId: '1' }
31
- ]
32
-
33
- // 保存
34
- function handleSave() {
35
- console.log(uploadRef.value.allFilesRef)
36
- alert("s-s-s-")
37
- }
38
- </script>