| | |
| | | <template> |
| | | <div class="comp-container"> |
| | | <el-form :model="teForm" label-width="150px" :rules="teRules" ref="ruleFormRef"> |
| | | <el-form :model="teForm" label-width="150px" :rules="teRules" ref="teRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | |
| | | } |
| | | export default defineComponent({ |
| | | name: 'tempElectForm', |
| | | setup() { |
| | | props: { |
| | | teForm: Object |
| | | }, |
| | | setup(props) { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({}); |
| | | const teForm = reactive({ |
| | | teDepartment: '', |
| | | teApplyName: '', |
| | | teLevel: '', |
| | | teHeight: '' |
| | | }) |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const teForm1 = reactive(props.teForm) |
| | | const teRef = ref<FormInstance>() |
| | | const teRules = reactive<FormRules>({ |
| | | teDepartment:[{required: true,message: '此处不可为空',trigger: 'blur'}], |
| | | teApplyName:[{required: true,message: '此处不可为空',trigger: 'blur'}], |
| | | teLevel: [{required: true,message: '此处不可为空',trigger: 'blur'}], |
| | | teHeight: [{required: true,message: '此处不可为空',trigger: 'blur'}] |
| | | }) |
| | | const validateForm = async () => { |
| | | let flag = null |
| | | await teRef.value.validate(valid=>{ |
| | | if(valid){ |
| | | flag = true |
| | | }else{ |
| | | flag = false |
| | | } |
| | | }) |
| | | return flag |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | teForm, |
| | | ruleFormRef, |
| | | teForm1, |
| | | teRef, |
| | | teRules, |
| | | validateForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |