fix : 修复标签关闭bug, 表格组件列配置, 完善用户管理页面
This commit is contained in:
62
src/fvcomponents/fvFormDialog/index.vue
Normal file
62
src/fvcomponents/fvFormDialog/index.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<el-dialog v-model="localDialogParams.localVisited" :title="localDialogParams.localTitle" :width="localDialogParams.localWidth+'px'">
|
||||
<fvForm :schema="localDialogParams.localFormSchema" @getInstance="(e)=>baseForm = e" label-position="right" :rules="localDialogParams.localFormRules"></fvForm>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const emits = defineEmits(['getInstance'])
|
||||
const props = defineProps({
|
||||
isVisited: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
title: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '700'
|
||||
},
|
||||
formSchema: {
|
||||
type: Function,
|
||||
default: ()=>{}
|
||||
},
|
||||
formRules: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
const baseForm = ref()
|
||||
const localDialogParams = ref({})
|
||||
watchEffect(()=>{
|
||||
localDialogParams.value.localVisited = props.isVisited
|
||||
localDialogParams.value.localTitle = props.title
|
||||
localDialogParams.value.localWidth = props.width
|
||||
localDialogParams.value.localFormSchema = props.formSchema
|
||||
localDialogParams.value.localFormRules = props.formRules
|
||||
})
|
||||
const getFormInstance=()=>{
|
||||
return baseForm.value
|
||||
}
|
||||
const handleCancel=()=>{
|
||||
emits('dialogCancel')
|
||||
}
|
||||
const handleSubmit=()=>{
|
||||
emits('dialogSubmit',baseForm.value)
|
||||
}
|
||||
defineExpose({
|
||||
getFormInstance
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user