From f19e5267cc23b1c714dc746239864f33ed715dd9 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 05 十二月 2025 17:55:02 +0800
Subject: [PATCH] 完成地图制作任务功能初版
---
src/views/fysp/check/components/ComChangeEdit.vue | 66 +++++++++++++++++++-------------
1 files changed, 39 insertions(+), 27 deletions(-)
diff --git a/src/views/fysp/check/components/ComChangeEdit.vue b/src/views/fysp/check/components/ComChangeEdit.vue
index 64703dd..b8be328 100644
--- a/src/views/fysp/check/components/ComChangeEdit.vue
+++ b/src/views/fysp/check/components/ComChangeEdit.vue
@@ -46,17 +46,19 @@
</el-col>
</el-row>
<div class="flex-div">
- <el-button type="primary" @click="onSubmit">淇濆瓨</el-button>
+ <el-button type="primary" @click="onSubmit" :loading="loading"
+ >淇濆瓨</el-button
+ >
<el-button @click="onCancel">鍙栨秷</el-button>
</div>
<el-image-viewer
- v-if="previewDialogVisible"
- :url-list="fileList.map((item) => item.url)"
- :initial-index="initialIndex"
- @close="previewDialogVisible = false"
- alt="棰勮"
- class="preview-pic"
- />
+ v-if="previewDialogVisible"
+ :url-list="fileList.map((item) => item.url)"
+ :initial-index="initialIndex"
+ @close="previewDialogVisible = false"
+ alt="棰勮"
+ class="preview-pic"
+ />
</template>
</CompGenericWrapper>
</template>
@@ -68,8 +70,7 @@
import { ElMessage } from 'element-plus';
export default {
emits: ['submit', 'cancel'],
- components: {
- },
+ components: {},
watch: {
oldChangeFileList: {
handler(nv, ov) {
@@ -117,13 +118,15 @@
deleteImg: [],
ledgerPicDialog: false,
- anyPhotoDialog: false
+ anyPhotoDialog: false,
+
+ loading: false
};
},
mounted() {},
methods: {
pictureValidate() {
- if (this.changeType == 1 && this.fileList.length < 1) {
+ if (this.fileList.length < 1) {
ElMessage({
message: '鑷冲皯涓婁紶涓�寮犲浘鐗�',
type: 'error'
@@ -161,12 +164,14 @@
this.oldFileList = useCloned(beforeEditImgList).cloned.value;
},
onCancel() {
- this.$emit("cancel")
+ this.$emit('cancel');
+ this.$emit('update:visible', false);
},
onSubmit() {
if (!this.pictureValidate()) {
return;
}
+ this.loading = true;
// 鏁版嵁鍑嗗
let data = new FormData();
var picUrls = [];
@@ -189,28 +194,35 @@
}
});
- const that = this;
let deleteImgCopy = this.deleteImg;
if (this.changeType == 1) {
- fileUtil.getImageFiles(picUrls, function (files) {
+ fileUtil.getImageFiles(picUrls, (files) => {
data.append('deleteImg', deleteImgCopy);
- data.append('problemId', that.problemId);
+ data.append('problemId', this.problemId);
files.forEach((image) => {
data.append('images', image);
});
- problemApi.updateChange(data).then((res) => {});
+ problemApi
+ .updateChange(data)
+ .then((res) => {
+ this.$emit('submit', true);
+ })
+ .finally(() => (this.loading = false));
});
- that.$emit('submit', true);
} else {
- fileUtil.getImageFiles(picUrls, function (files) {
- data.append('problemId', that.problemId);
+ fileUtil.getImageFiles(picUrls, (files) => {
+ data.append('problemId', this.problemId);
files.forEach((image) => {
data.append('images', image);
});
- problemApi.changeProblem(data).then((res) => {});
- that.$emit('submit', true);
+ problemApi
+ .changeProblem(data)
+ .then((res) => {
+ this.$emit('submit', true);
+ })
+ .finally(() => (this.loading = false));
});
}
},
@@ -221,7 +233,7 @@
}
},
handlePictureCardPreview(uploadFile) {
- this.initialIndex = this.fileList.indexOf(uploadFile)
+ this.initialIndex = this.fileList.indexOf(uploadFile);
this.previewDialogVisible = true;
this.previewDialogImageUrl = uploadFile.url;
},
@@ -251,10 +263,10 @@
margin-bottom: 30px;
margin-left: 63px;
}
-::v-deep .el-dialog__body {
+:deep(.el-dialog__body) {
width: 95%;
}
-::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail {
+:deep(.el-upload-list--picture-card .el-upload-list__item-thumbnail) {
object-fit: cover !important;
}
.preview-pic {
@@ -262,11 +274,11 @@
width: 100%;
height: 100%;
}
-::v-deep .el-upload--picture-card {
+:deep(.el-upload--picture-card) {
display: none;
}
/* 闅愯棌el-upload涓婁紶鎴愬姛缁勪欢 */
-::v-deep .el-upload-list__item-status-label {
+:deep(.el-upload-list__item-status-label) {
display: none !important;
}
</style>
--
Gitblit v1.9.3