/**
 * 疾病检测与上报：ddT（data.ddNs）、ddCommon（通用按钮/校验）
 */
export default {
  methods: {
    ddT(key) {
      const ns = this.ddNs
      if (!ns) {
        return key
      }
      return this.$t(`diseaseDetection.${ns}.${key}`)
    },
    ddCommon(key) {
      return this.$t(`diseaseDetection.common.${key}`)
    },
    relieveStatusText(v) {
      if (v === 1 || v === "1") {
        return this.$t("diseaseDetection.status.relieved")
      }
      return this.$t("diseaseDetection.status.active")
    },
    isReleased(row) {
      if (!row) {
        return false
      }
      if (row.relieveStatus === 1 || row.relieveStatus === "1") {
        return true
      }
      return !!(row.releaseDate && String(row.releaseDate).trim())
    }
  }
}
