chore: 🔨 合并冲突解决
This commit is contained in:
@@ -35,11 +35,7 @@
|
||||
<a class="el-upload-list__item-name" @click="downloadFile(file)">
|
||||
<el-icon><Document /></el-icon>
|
||||
<span class="el-upload-list__item-file-name">{{ file.name }}</span>
|
||||
<span
|
||||
v-if="props.showDelBtn"
|
||||
class="el-icon--close"
|
||||
@click.stop="handleRemove(file)"
|
||||
>
|
||||
<span v-if="props.showDelBtn" class="el-icon--close" @click.stop="handleRemove(file)">
|
||||
<el-icon><Close /></el-icon>
|
||||
</span>
|
||||
</a>
|
||||
@@ -278,9 +274,7 @@ function handleRemove(removeFile: UploadUserFile) {
|
||||
if (filePath) {
|
||||
FileAPI.deleteByPath(filePath).then(() => {
|
||||
// 删除成功回调
|
||||
valFileList.value = valFileList.value.filter(
|
||||
(file) => file.url !== filePath
|
||||
);
|
||||
valFileList.value = valFileList.value.filter((file) => file.url !== filePath);
|
||||
emit("update:modelValue", valFileList.value);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<el-upload
|
||||
v-model:file-list="fileList"
|
||||
list-type="picture-card"
|
||||
:class="
|
||||
fileList.length >= props.limit || !props.showUploadBtn ? 'hide' : 'show'
|
||||
"
|
||||
:class="fileList.length >= props.limit || !props.showUploadBtn ? 'hide' : 'show'"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:action="props.action"
|
||||
:headers="props.headers"
|
||||
@@ -45,12 +43,7 @@
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
UploadRawFile,
|
||||
UploadUserFile,
|
||||
UploadFile,
|
||||
UploadProps,
|
||||
} from "element-plus";
|
||||
import { UploadRawFile, UploadUserFile, UploadFile, UploadProps } from "element-plus";
|
||||
import FileAPI from "@/api/file";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { ResultEnum } from "@/enums/ResultEnum";
|
||||
@@ -224,9 +217,7 @@ function handleBeforeUpload(file: UploadRawFile) {
|
||||
*/
|
||||
const previewImg: UploadProps["onPreview"] = (uploadFile: UploadFile) => {
|
||||
viewFileList.value = fileList.value.map((file) => file.url!);
|
||||
initialIndex.value = fileList.value.findIndex(
|
||||
(file) => file.url === uploadFile.url
|
||||
);
|
||||
initialIndex.value = fileList.value.findIndex((file) => file.url === uploadFile.url);
|
||||
viewVisible.value = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ElImageViewer,
|
||||
UploadRawFile,
|
||||
UploadRequestOptions,
|
||||
} from "element-plus";
|
||||
import { ElImageViewer, UploadRawFile, UploadRequestOptions } from "element-plus";
|
||||
import FileAPI from "@/api/file";
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
Reference in New Issue
Block a user