Browse Source

basicForm组件添加底部按钮参数

master_hella_20240701
陈薪名 9 months ago
parent
commit
3e0bf8da07
  1. 37
      src/components/BasicForm/src/BasicForm.vue

37
src/components/BasicForm/src/BasicForm.vue

@ -240,13 +240,18 @@ const props = defineProps({
required: false, required: false,
default: null default: null
}, },
//
isShowFooterButtton: {
type: Boolean,
required: false,
default: true
}
}) })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogWidth = ref() const dialogWidth = ref()
if (props.basicFormWidth) { if (props.basicFormWidth) {
console.log('111111111111111')
dialogWidth.value = props.basicFormWidth dialogWidth.value = props.basicFormWidth
} else { } else {
dialogWidth.value = props.isBusiness ? '60%' : '40%' dialogWidth.value = props.isBusiness ? '60%' : '40%'
@ -263,19 +268,19 @@ const tableAllSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules) const tableFormRules = ref(props.tableFormRules)
// - // -
const buttondata = [ // const buttondata = [
defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null) // defaultButtons.mainListDeleteBtn(null)
] // ]
// - // // -
const buttonTableClick = async (val, row) => { // const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') {
} else if (val == 'delete') { // } else if (val == 'delete') {
} else { // } else {
} // }
} // }
/** 弹层操作 */ /** 弹层操作 */
// formField form // formField form
@ -392,10 +397,13 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading }) // open defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading }) // open
/** 弹窗按钮 */ /** 弹窗按钮 */
const Butttondata = [ let Butttondata:any = []
if (props.isShowFooterButtton) {
Butttondata = [
defaultButtons.formSaveBtn(null), // defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
}
/** 按钮事件 */ /** 按钮事件 */
const buttonBaseClick = (val) => { const buttonBaseClick = (val) => {
@ -436,7 +444,6 @@ const submitForm = async () => {
// //
try { try {
const data = unref(formRef)?.formModel const data = unref(formRef)?.formModel
console.log('data',data)
emit('submitForm', formType.value, data) emit('submitForm', formType.value, data)
} finally { } finally {
} }

Loading…
Cancel
Save