Browse Source

basicForm组件添加底部按钮参数

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

35
src/components/BasicForm/src/BasicForm.vue

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

Loading…
Cancel
Save