<script name="projectCollectionEnterProgressInfo" setup>
import { ref, watch } from 'vue'
import store from '@/store'

const props = defineProps({
    detail: {
      type: Object
    }
  }),
  { baseProjSetProgOptions } = store.dictStore.globalDicts || {},
  formRef = ref(),
  formData = ref({}),
  rules = {
    status: [{ required: true, message: '请选择项目状态', trigger: 'change' }]
  }
defineExpose({ formRef, formData })
watch(() => props.detail, val => {
  console.log(val)
  if (val) {
    formData.value = {
      status: val.status,
      applicationName: val.applicationName,
      applicationIrsCode: val.applicationIrsCode
    }
  }
})
</script>

<template>
  <el-form
    ref="formRef"
    :model="formData"
    :rules="rules"
    label-position="top"
    label-suffix=":"
    scroll-to-error
  >
    <el-row :gutter="40">
      <el-col :span="8">
        <el-form-item label="项目状态" prop="status">
          <el-select
            v-model="formData.status"
            class="w-full"
            placeholder="请选择"
            clearable
          >
            <el-option
              v-for="(v,k) in baseProjSetProgOptions"
              :key="k"
              :label="v"
              :value="k*1"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="关联应用" prop="applicationName">
          <el-input v-model="formData.applicationName" maxlength="50" placeholder="请填写" />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="关联应用IRS编码" prop="applicationIrsCode">
          <el-input v-model="formData.applicationIrsCode" maxlength="50" placeholder="请填写" />
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>

</template>
