<template>
    <hc-new-dialog v-model="isShow" widths="666px" title="项目报表" @save="modalSave">
        <el-form ref="formRef" class="p-4" label-position="left" label-width="auto" :model="formModel" :rules="formRules">
            <el-form-item label="报表编号：">
                <el-input v-model="formModel.key1" />
            </el-form-item>
            <el-form-item label="报表名称：">
                <el-input v-model="formModel.key2" />
            </el-form-item>
            <el-form-item label="模板文件路径：">
                <el-input v-model="formModel.key3" />
            </el-form-item>
            <el-form-item label="数据文件路径：">
                <el-input v-model="formModel.key4" />
            </el-form-item>
            <el-form-item label="前处理脚本方法：">
                <el-input v-model="formModel.key5" />
            </el-form-item>
            <el-form-item label="后处理脚本方法：">
                <el-input v-model="formModel.key6" />
            </el-form-item>
            <el-form-item label="持久化参数集合：">
                <el-input v-model="formModel.key7" />
            </el-form-item>
            <el-form-item label="顺序号：">
                <el-input v-model="formModel.key8" />
            </el-form-item>
            <el-form-item label="备注：">
                <el-input v-model="formModel.key9" :autosize="{ minRows: 4, maxRows: 8 }" type="textarea" />
            </el-form-item>
        </el-form>
    </hc-new-dialog>
</template>

<script setup>
import { ref, watch } from 'vue'

const props = defineProps({
    ids: {
        type: [String, Number],
        default: '',
    },
})

//事件
const emit = defineEmits(['finish', 'close'])

//双向绑定
// eslint-disable-next-line no-undef
const isShow = defineModel('modelValue', {
    default: false,
})

//监听
watch(() => [
    props.ids,
], ([ids]) => {
    console.log('ids', ids)
}, { immediate: true })

//监听
watch(isShow, (val) => {
    if (val) {
        console.log('处理数据')
    }
})

//弹窗表单
const formRef = ref(null)
const formModel = ref({ })
const formRules = ref({})

const modalSave = () => {
    emit('finish')
}
</script>
