此类问题需要嵌套
表格部分
<el-table v-loading="tableLoading" height="100%" :data="tableData">
<el-table-column v-for="(item, idx) in tableColumns" :key="idx" align="center" v-bind="item" />
</el-table>
填写部分
const tableColumns: TableColumnProps[] = [
{
label: '考核评分',
minWidth: 6,
formatter(row, column, cellValue, index) {
return (
<>
<el-form label-position="left" model={row} rules={reportDialogConf.value.rules}>
<el-form-item prop="score">
<el-input type="number" min="0" max="2" disabled={router.currentRoute.value.query.type == '1'} v-model={row.score} />
</el-form-item>
</el-form>
</>
);
},
},
];
对于子父、循环的表单可利用Promise.all
/** 内容提交 */
const sumbitBtnClick = (flag: 'continue' | 'submit') => {
Promise.all([taskFormRef.value?.validate()].concat(taskFormRefs.value?.map((ele: any) => ele.validate())))
.then((el: any) => {
})
.catch(el => {
})
};