zhengyiming
8 天以前 7ea19f75b3b1fc8c9af3840a470cb662b8f65d0d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
  <ProDialog :title="title" v-model="visible" destroy-on-close draggable width="800px">
    <FourStreamsMaterialFileTable v-model:list="form.list" v-bind="props" />
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="handleConfirm">确 定</el-button>
      </span>
    </template>
  </ProDialog>
</template>
 
<script setup lang="ts" generic="T">
import { ProDialog } from '@bole-core/components';
import FourStreamsMaterialFileTable from './FourStreamsMaterialFileTable.vue';
import { FourStreamsMaterialFileTableProps, BaseMaterialFileTableItem } from './types';
 
defineOptions({
  name: 'FourStreamsMaterialFileDialog',
});
 
type Props = FourStreamsMaterialFileTableProps & {
  title?: string;
};
 
const props = withDefaults(defineProps<Props>(), {
  showUploadBtn: true,
  showCheckBtn: true,
  showDownloadBtn: true,
  showDeleteBtn: true,
  title: '材料详情',
});
 
const visible = defineModel({ type: Boolean });
 
type Form = {
  list: BaseMaterialFileTableItem<T>[];
};
 
const form = defineModel<Form>('form');
 
const emit = defineEmits<{
  (e: 'onConfirm'): void;
  (e: 'onCancel'): void;
}>();
 
function handleConfirm() {
  emit('onConfirm');
}
</script>