import {getBasicThirdSys} from "@/api/basic/basicThirdSys";
import {getLoading} from "@/utils";
import {deviceRepairInfo} from "@/api/dev/deviceRepairApi";


export default {
  name: "deviceRepairDialog",
  props: {
    repairId:
      { require: true },
    disabledUp:
      {required: false,
        default: false,
        type: Boolean},
  },
  data() {
    return {
      maxFiles: 3, // 允许同时上传的最大文件数
      fileSizeLimit: 5, // 允许上传的文件大小限制（MB）
      uploadedFileNames: '', // 存储已上传文件名，逗号隔开


      info: null
    }
  },
  watch: {
    val(newVal) {
      this.$emit('update:value', newVal);
    },
    value(newVal) {
      this.val = newVal
    },
  },
  created() {
    this.val = this.value
    this.getInfo()
  },
  methods: {
    /**
     * 父组件处理子组件发送的数据更改
     * @param params
     */
    component1DataChange(params) {
      this.uploadedFileNames = params;
    },
    getInfo() {
      let load = getLoading(this)
      deviceRepairInfo(this.repairId).then(res => {
        load.close()
        if (res.code != 20000) {
          this.$message.error(res.message)
          return
        }
        this.info = res.data
      }).catch(() => {
        load.close()
      })
    }
  }
}
