Browse Source

tableform组件修改

master
陈薪名 1 year ago
parent
commit
587ab3a272
  1. 15
      src/components/TableForm/src/TableForm.vue

15
src/components/TableForm/src/TableForm.vue

@ -48,7 +48,8 @@
:sortable="headerItem?.tableForm?.sortable || ''" :sortable="headerItem?.tableForm?.sortable || ''"
:width="headerItem?.tableForm?.width || '200'" :width="headerItem?.tableForm?.width || '200'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'"> :min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form ref="TableBaseForm_Ref" <el-form
ref="TableBaseForm_Ref"
:model="row" :model="row"
style="width: 100%;" style="width: 100%;"
:rules="tableFormRules" :rules="tableFormRules"
@ -357,20 +358,23 @@ const itemIsDisabled = (colum, row) => {
return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field]) return Boolean(colum.tableForm?.disabled) || Boolean(row.disabled) || Boolean(row['disabled_' + colum.field])
} }
// const { t } = useI18n() //
// const message = useMessage() //
const TableBaseComponents_Ref = ref() const TableBaseComponents_Ref = ref()
const TableBaseForm_Ref = ref() const TableBaseForm_Ref = ref()
/** /**
* 验证表单是否符合rules * 验证表单是否符合rules
* @param {*} success 如果验证成功走的方法 * @param {*} success 如果验证成功走的方法
* @param {*} error 如果验证不成功走的方法 * @param {*} error 如果验证不成功走的方法
*/ */
const validateForm = async () => { const validateForm = () => {
let _lists = TableBaseForm_Ref.value.map(v => v.validate()) let _lists = TableBaseForm_Ref.value?.map(v => v.validate())
return Promise.all(_lists).then(res => { return Promise.all(_lists).then(() => {
return true return true
}).catch(err => { }).catch(() => {
return false return false
}) })
} }
@ -389,6 +393,7 @@ const inpuFocus = (headerItem)=>{
emit('inpuFocus') emit('inpuFocus')
} }
} }
// setup // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, TableBaseComponents_Ref,

Loading…
Cancel
Save