<script setup lang="ts">
import {useI18n} from "vue-i18n";
import type {IAppEtagController} from "@/model/table/IAppEtagController.ts";
import {computed} from "vue";
import MessageUtils from "@/utils/MessageUtils.ts";
import EtagBaseApi from "@/api/etagBase.ts";
import {AppServeResponseCodeEnum} from "@/constant/enums/AppServeResponseCodeEnum.ts";
import type {AppServeResponse} from "@/interface/api/AppServeResponse.ts";

const modelValue = defineModel('modelValue', {required: true, default: false});
const close = () => {modelValue.value = false;};
const props = defineProps<{
  formData: IAppEtagController;
}>();
const { t } = useI18n();
const formData = computed(() => props.formData);

</script>

<template>
  <div>
    <el-dialog :model-value="modelValue" :title="t('tabPage.etagController.debugEtagController')" @close="close" :close-on-click-modal="false">
      <el-scrollbar style="height:50vh">
        <el-form :model="formData" label-position="right" label-width="120px" require-asterisk-position="right">
          <el-form-item :label="t('tabPage.etagController.controllerId') + '：'" required>
            <el-input-number v-model="formData.controllerId" :min="1" :max="3000" disabled/>
          </el-form-item>
          <el-form-item :label="t('tabPage.etagController.controllerName') + '：'" required>
            <el-input v-model="formData.controllerName" placeholder=""></el-input>
          </el-form-item>
          <el-form-item :label="t('tabPage.etagController.ip') + '：'" required>
            <el-input v-model="formData.ip" placeholder=""></el-input>
          </el-form-item>
        </el-form>
        <el-row>
          <el-button-group>
            <el-button type="primary" @click="close">显示所有标签ID</el-button>
            <el-button type="danger" @click="close">重设全部标签ID</el-button>
          </el-button-group>
        </el-row>
        <el-row style="margin-top: 10px">
          <el-button-group>
            <el-button type="warning" @click="close">切换所有标签为捡货模式</el-button>
            <el-button type="success" @click="close">切换所有标签为盘点模式</el-button>
          </el-button-group>
        </el-row>
      </el-scrollbar>
      <template #footer>
        <el-button-group>
          <el-button type="danger" @click="close">{{t('baseButton.close')}}</el-button>
        </el-button-group>
      </template>
    </el-dialog>
  </div>
</template>

<style scoped>

</style>