<template>
  <div style="background-color: #ffffff; width: 100%; height: 100%;">
    <CusTab :tabs="[
          {name: '默认', value: '1'},
          {name: '整体禁用', value: '2'},
          {name: '整体禁用（单独测试不禁用）', value: '3'},
          {name: '单独禁用', value: '4'},
      ]" type="type2" v-model:param="tab"/>
    <template v-if="tab === '1'">
      <CusForm>
        <CusFormColumn
            :span="24"
            required
            link="cascader"
            label="cascader"
            v-model:param="form.caseType"
            :options="$store.state.dictionary.caseTypeTree"/>
        <CusFormColumn
            :span="24"
            required
            link="checkbox"
            label="checkbox"
            v-model:param="form.portType"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :span="24"
            required
            link="date"
            label="date"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            link="datetime"
            label="datetime"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            link="dept"
            label="dept"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            label="input"
            v-model:param="form.name"/>
        <CusFormColumn
            :span="24"
            link="portOfRegistry"
            label="portOfRegistry"
            v-model:paramOne="form.portOfRegistry1"
            v-model:paramTwo="form.portOfRegistry2"/>
        <CusFormColumn
            :span="24"
            required
            link="radio"
            label="radio"
            v-model:param="form.portType1"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :span="24"
            link="residentMooringPoint"
            label="residentMooringPoint"
            v-model:paramOne="form.residentMooringPoint1"
            v-model:paramTwo="form.residentMooringPoint2"/>
        <CusFormColumn
            :span="24"
            required
            link="select"
            label="select"
            v-model:param="form.type"
            :options="$store.state.dictionary.pboatTypeList"/>
        <CusFormColumn
            :span="24"
            link="switch"
            label="switch"
            v-model:param="form.input1"/>
        <CusFormColumn
            :span="24"
            link="time"
            label="time"
            v-model:param="form.input1"/>
        <CusFormColumn
            :span="24"
            link="upload"
            label="upload"
            v-model:param="form.fileList1"
        />
      </CusForm>
    </template>
    <template v-else-if="tab === '2'">
      <CusForm :formView="true">
        <CusFormColumn
            :span="24"
            required
            link="cascader"
            label="cascader"
            v-model:param="form.caseType"
            :options="$store.state.dictionary.caseTypeTree"/>
        <CusFormColumn
            :span="24"
            required
            link="checkbox"
            label="checkbox"
            v-model:param="form.portType"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :span="24"
            required
            link="date"
            label="date"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            link="datetime"
            label="datetime"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            link="dept"
            label="dept"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :span="24"
            required
            label="input"
            v-model:param="form.name"/>
        <CusFormColumn
            :span="24"
            link="portOfRegistry"
            label="portOfRegistry"
            v-model:paramOne="form.portOfRegistry1"
            v-model:paramTwo="form.portOfRegistry2"/>
        <CusFormColumn
            :span="24"
            required
            link="radio"
            label="radio"
            v-model:param="form.portType1"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :span="24"
            link="residentMooringPoint"
            label="residentMooringPoint"
            v-model:paramOne="form.residentMooringPoint1"
            v-model:paramTwo="form.residentMooringPoint2"/>
        <CusFormColumn
            :span="24"
            required
            link="select"
            label="select"
            v-model:param="form.type"
            :options="$store.state.dictionary.pboatTypeList"/>
        <CusFormColumn
            :span="24"
            link="switch"
            label="switch"
            v-model:param="form.input1"/>
        <CusFormColumn
            :span="24"
            link="time"
            label="time"
            v-model:param="form.input1"/>
        <CusFormColumn
            :span="24"
            link="upload"
            label="upload"
            v-model:param="form.fileList1"
        />
      </CusForm>
    </template>
    <template v-else-if="tab === '3'">
      <CusForm :formView="true">
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="cascader"
            label="cascader"
            v-model:param="form.caseType"
            :options="$store.state.dictionary.caseTypeTree"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="checkbox"
            label="checkbox"
            v-model:param="form.portType"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="date"
            label="date"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="datetime"
            label="datetime"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="dept"
            label="dept"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            label="input"
            v-model:param="form.name"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            link="portOfRegistry"
            label="portOfRegistry"
            v-model:paramOne="form.portOfRegistry1"
            v-model:paramTwo="form.portOfRegistry2"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="radio"
            label="radio"
            v-model:param="form.portType1"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            link="residentMooringPoint"
            label="residentMooringPoint"
            v-model:paramOne="form.residentMooringPoint1"
            v-model:paramTwo="form.residentMooringPoint2"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            required
            link="select"
            label="select"
            v-model:param="form.type"
            :options="$store.state.dictionary.pboatTypeList"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            link="switch"
            label="switch"
            v-model:param="form.input1"/>
        <CusFormColumn
            :disabled="false"
            :span="24"
            link="time"
            label="time"
            v-model:param="form.input1"/>
        <CusFormColumn
            :view="false"
            :span="24"
            link="upload"
            label="upload"
            v-model:param="form.fileList1"
        />
      </CusForm>
    </template>
    <template v-else-if="tab === '4'">
      <CusForm :formView="false">
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="cascader"
            label="cascader"
            v-model:param="form.caseType"
            :options="$store.state.dictionary.caseTypeTree"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="checkbox"
            label="checkbox"
            v-model:param="form.portType"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="date"
            label="date"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="datetime"
            label="datetime"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="dept"
            label="dept"
            v-model:param="form.createDate"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            label="input"
            v-model:param="form.name"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            link="portOfRegistry"
            label="portOfRegistry"
            v-model:paramOne="form.portOfRegistry1"
            v-model:paramTwo="form.portOfRegistry2"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="radio"
            label="radio"
            v-model:param="form.portType1"
            :options="$store.state.dictionary.tempPortTypeList"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            link="residentMooringPoint"
            label="residentMooringPoint"
            v-model:paramOne="form.residentMooringPoint1"
            v-model:paramTwo="form.residentMooringPoint2"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            required
            link="select"
            label="select"
            v-model:param="form.type"
            :options="$store.state.dictionary.pboatTypeList"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            link="switch"
            label="switch"
            v-model:param="form.input1"/>
        <CusFormColumn
            :disabled="true"
            :span="24"
            link="time"
            label="time"
            v-model:param="form.input1"/>
        <CusFormColumn
            :view="true"
            :span="24"
            link="upload"
            label="upload"
            v-model:param="form.fileList1"
        />
      </CusForm>
    </template>
  </div>
</template>

<script lang="ts">
import {
  defineComponent,
  computed,
  onMounted,
  ref,
  reactive,
  watch,
  getCurrentInstance,
  ComponentInternalInstance,
  toRefs,
  nextTick
} from 'vue'
import {useStore} from 'vuex'
import {useRouter, useRoute} from 'vue-router'

export default defineComponent({
  name: '',
  components: {},
  setup(props, {emit}) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
    const state = reactive({
      tab: '1',
      form: {
        fileList1: [
          { "url": "http://8.140.240.182:18085/profile/upload/2023/10/23/6b7bf3b4-592a-4e2f-ba92-11923671ce3b.doc", "name": "迁移案例.doc"},
        ]
      }
    })
    onMounted(() => {
      store.dispatch("dictionary/LOAD_DICT_LIST", "pboat_type");
      store.dispatch("dictionary/LOAD_DICT_LIST", "temp_port_type");
      store.dispatch("dictionary/LOAD_CASE_TYPE");
    })
    return {
      ...toRefs(state)
    }
  },
})
</script>

<style scoped lang="scss">
</style>
