|
@@ -49,15 +49,17 @@
|
|
|
<template v-slot:tip>
|
|
|
<div class="el-upload__tip">注:可上传{{ size }}以内的文件</div>
|
|
|
</template>
|
|
|
- <!-- <template v-slot:file="{ file }: { file: UploadFile }">
|
|
|
+ <template v-slot:file="{ file }: { file: UploadFile }">
|
|
|
<div class="file" @click.stop="previewFile()">
|
|
|
<div>
|
|
|
<el-icon><Document /></el-icon>
|
|
|
<span class="name">{{ file.name }}</span>
|
|
|
</div>
|
|
|
- <el-icon @click.stop="removeFile()"><Close /></el-icon>
|
|
|
+ <el-icon @click.stop="removeFile() && (data.file = undefined)"
|
|
|
+ ><Close
|
|
|
+ /></el-icon>
|
|
|
</div>
|
|
|
- </template> -->
|
|
|
+ </template>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -69,7 +71,7 @@ import { QuiskExpose } from "@/helper/mount";
|
|
|
import { CameraVersionAppEntity } from "@/store/cameraVersionApp";
|
|
|
import { useUpload } from "@/hook/upload";
|
|
|
import { maxFileSize } from "@/constant/caseFile";
|
|
|
-
|
|
|
+import { UploadFile } from "element-plus";
|
|
|
import {
|
|
|
addCameraVersionApp,
|
|
|
editCameraVersionApp,
|
|
@@ -77,6 +79,7 @@ import {
|
|
|
} from "@/store/cameraVersionApp";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
|
|
|
+
|
|
|
const props = defineProps<{
|
|
|
// type: string | number;
|
|
|
entity?: CameraVersionAppEntity;
|
|
@@ -86,10 +89,15 @@ const data = ref<CameraVersionAppEntity>({
|
|
|
description: "",
|
|
|
minVersion: "",
|
|
|
file: undefined,
|
|
|
+ status: "",
|
|
|
+ fileUrl: "",
|
|
|
+ name: "",
|
|
|
});
|
|
|
|
|
|
const form = ref();
|
|
|
|
|
|
+
|
|
|
+
|
|
|
const isAdd = computed(() => !props.entity?.id);
|
|
|
|
|
|
const httpsApi = async ({ file }) => {
|
|
@@ -129,11 +137,10 @@ defineExpose<QuiskExpose>({
|
|
|
ElMessage.error("文件不能为空!");
|
|
|
throw "文件不能为空!";
|
|
|
}
|
|
|
- await addCameraVersionApp(data.value as any as CameraVersionAppType);
|
|
|
+ await addCameraVersionApp(data.value as any as CameraVersionAppEntity);
|
|
|
ElMessage.success("添加成功!");
|
|
|
-
|
|
|
} else {
|
|
|
- await editCameraVersionApp(data.value as any as CameraVersionAppType);
|
|
|
+ await editCameraVersionApp(data.value as any as CameraVersionAppEntity);
|
|
|
ElMessage.success("保存成功!");
|
|
|
}
|
|
|
},
|
|
@@ -145,4 +152,21 @@ defineExpose<QuiskExpose>({
|
|
|
font-size: 20px;
|
|
|
line-height: 50px;
|
|
|
}
|
|
|
+.upload-demo {
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.file {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ > div {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .name {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|