Просмотр исходного кода

feature_20260330_拜访连拍速度优化

zhujindu 1 неделя назад
Родитель
Сommit
6ed34d2852
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      src/views/deviceWithin/taskPhotoTaking.vue

+ 7 - 3
src/views/deviceWithin/taskPhotoTaking.vue

@@ -166,6 +166,13 @@ export default {
       this.getDetaile();
     }
   },
+  beforeRouteLeave(to, from, next) {
+    if (this.$refs.taskPhoto && this.$refs.taskPhoto[0]) {
+      this.$refs.taskPhoto[0].imgArr = [];
+    }
+    next();
+  },
+  watch: {},
   methods: {
     taskObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
       const cellValue = row[column.property];
@@ -288,9 +295,6 @@ export default {
       return addCollectionAnswerBatch(formData).then((res) => {
         if (res.code == 200) {
           localStorage.setItem('getRequestFlage', 'true');
-          if (this.$refs.taskPhoto && this.$refs.taskPhoto[0]) {
-            this.$refs.taskPhoto[0].imgArr = [];
-          }
           this.$router.go(-1);
         } else {
           this.$toast('提交失败,请重试');