riku
2024-11-21 af5a8d80bca9b8c08543238a370ea3c70c8c59b1
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -214,7 +214,6 @@
  </CompGenericWrapper>
</template>
<script>
import CompGenericWrapper from './CompGenericWrapper.vue';
import ArbitraryPhoto from './ArbitraryPhoto.vue';
import CompLedgerPhoto from './CompLedgerPhoto.vue';
import CompDevicePhoto from './CompDevicePhoto.vue';
@@ -232,7 +231,6 @@
    ArbitraryPhoto,
    CompDevicePhoto,
    CompLedgerPhoto,
    CompGenericWrapper
  },
  props: {
    readonly: {
@@ -263,6 +261,8 @@
  },
  data() {
    return {
      // fixme 2024.11.20 子组件初始化时机问题
      initPropsCount: 0,
      // 初始预览图片index
      initialIndex: -1,
      // 图片选择最大数量
@@ -327,10 +327,37 @@
      },
      deep: true
    },
    problem: {
    initPropsCount: {
      handler(nv, ov) {
        if (nv >= 3) {
        this.initOptions();
      }
      },
      immediate: true
    },
    problem: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    },
    topTask: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    },
    subtask: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    }
  },
  computed: {
@@ -362,15 +389,13 @@
      return array;
    }
  },
  mounted() {
    this.initOptions();
  },
  mounted() {},
  methods: {
    onProAdviseChange(value) {
      this.deepCopyProblem._adviseEdit = this.deepCopyProblem.advice;
    },
    handlePictureCardPreview(uploadFile) {
      this.initialIndex = this.fileList.indexOf(uploadFile)
      this.initialIndex = this.fileList.indexOf(uploadFile);
      this.previewDialogVisible = true;
      this.previewDialogImageUrl = uploadFile.url;
    },