|
@@ -40,25 +40,44 @@ const props = defineProps<{
|
|
|
caseId: number;
|
|
|
filesTypeId: number;
|
|
|
filesId: number;
|
|
|
+ fileOptions: Array<any>;
|
|
|
}>();
|
|
|
const fileOptions = ref([])
|
|
|
-
|
|
|
-onMounted(async () => {
|
|
|
- fileOptions.value = await updateSelectByTreeFileLists();
|
|
|
- console.log(fileOptions.value);
|
|
|
-});
|
|
|
const caseFile = ref({
|
|
|
caseId: props.caseId,
|
|
|
filesTypeId: props.filesTypeId,
|
|
|
filesTitle: "",
|
|
|
filesId: props.filesId,
|
|
|
});
|
|
|
+onMounted(async () => {
|
|
|
+ if(props.fileOptions?.length){
|
|
|
+ fileOptions.value = getTreeList(props.fileOptions);
|
|
|
+ }else{
|
|
|
+ fileOptions.value = await updateSelectByTreeFileLists();
|
|
|
+ }
|
|
|
+ console.log('caseFile', caseFile)
|
|
|
+ console.log(fileOptions.value);
|
|
|
+});
|
|
|
console.log(caseFile.value, '===caseFile');
|
|
|
const { size, fileList, upload, removeFile, previewFile, file, accept } = useUpload({
|
|
|
maxSize: 10 * 1024 * 1024,
|
|
|
formats: [".jpg", ".jpeg", ".png", '.mp4'],
|
|
|
});
|
|
|
-
|
|
|
+const getTreeList = (list) => {
|
|
|
+ return list.map(item => {
|
|
|
+ if (item.childrenList) {
|
|
|
+ return {
|
|
|
+ value: item.filesTypeId,
|
|
|
+ label: item.filesTypeName,
|
|
|
+ children: getTreeList(item.childrenList)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ value: item.filesTypeId,
|
|
|
+ label: item.filesTypeName,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
const formatDesc = computed(() =>
|
|
|
'jpg、png、jpeg、mp4上传'
|
|
|
);
|