<template>
  <div>
    <el-row>
      <el-col :span="4"></el-col>
      <el-col :span="8">
        <el-form v-model="generalForm" label-width="155px" append-to-body>
          <el-form-item>
            <h2 style="margin-bottom: 10px">联系方式</h2>
          </el-form-item>
          <el-form-item label="启用">
            <el-switch v-model="generalForm.Discord.Enabled"></el-switch>
          </el-form-item>
          <el-form-item label="发件人">
            <el-input v-model="generalForm.Discord.SenderName"></el-input>
          </el-form-item>
          <el-form-item label="地址">
            <el-input v-model="generalForm.Discord.URL"></el-input>
          </el-form-item>

          <el-divider/>

          <el-form-item >
            <h2>其他配置</h2>
          </el-form-item><el-form-item label="使用UI的原始交易命令">
            <el-switch v-model="generalForm.UseOriginalTradeCommandWithUI"></el-switch>
          </el-form-item>
          <el-form-item label="每页项目数">
            <el-input v-model="generalForm.ItemsPerPage"></el-input>
          </el-form-item>
          <el-form-item label="店铺展示时间">
            <el-input v-model="generalForm.ShopDisplayTime"></el-input>
          </el-form-item>
          <el-form-item label="店铺文字大小">
            <el-input v-model="generalForm.ShopTextSize"></el-input>
          </el-form-item>
          <el-form-item label="DB文件位置">
            <el-input v-model="generalForm.DbPathOverride"></el-input>
          </el-form-item>
          <el-form-item label="默认礼包">
            <el-input v-model="generalForm.DefaultKit"></el-input>
          </el-form-item>
          <el-form-item label="使用低温仓给予恐龙">
            <el-switch v-model="generalForm.GiveDinosInCryopods"></el-switch>
          </el-form-item>
          <el-form-item label="使用灵魂陷阱 ?">
            <el-switch v-model="generalForm.UseSoulTraps"></el-switch>
          </el-form-item>
          <el-form-item label="低温仓时间上限 ?">
            <el-switch v-model="generalForm.CryoLimitedTime"></el-switch>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="8">
        <VIPView/>
      </el-col>
    </el-row>
  </div>
</template>
<script setup lang="ts">
import {General, GetGeneral} from "../../api/ConfigFile";
import {ref} from "vue";
import VIPView from "./VIPView.vue";

let generalForm = ref<General>(General.Create())
replay()
function replay() {
  generalForm.value = General.Create()
  GetGeneral().then(res => {
    generalForm.value = res.data
  })
}


</script>
<style scoped>

</style>