feat : 通讯录管理
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<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>
|
||||
<el-dialog v-model="isVisited" :title="localDialogParams.localTitle" :width="localDialogParams.localWidth+'px'" @close="isVisited==false">
|
||||
<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>
|
||||
<el-button type="primary" @click="handleSubmit(baseForm)">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -12,15 +12,16 @@
|
||||
|
||||
<script setup>
|
||||
const emits = defineEmits(['getInstance'])
|
||||
const isVisited=ref(false)
|
||||
const props = defineProps({
|
||||
isVisited: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
title: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
dialogType: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '700'
|
||||
@@ -36,8 +37,8 @@ const props = defineProps({
|
||||
})
|
||||
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
|
||||
@@ -47,13 +48,21 @@ const getFormInstance=()=>{
|
||||
return baseForm.value
|
||||
}
|
||||
const handleCancel=()=>{
|
||||
emits('dialogCancel')
|
||||
// emits('dialogCancel')
|
||||
isVisited.value=false
|
||||
nextTick(() => {
|
||||
baseForm.value.resetFields()
|
||||
})
|
||||
}
|
||||
const handleSubmit=()=>{
|
||||
emits('dialogSubmit',baseForm.value)
|
||||
const handleSubmit=(baseForm)=>{
|
||||
emits('dialogSubmit',baseForm)
|
||||
}
|
||||
const openOrCloseDialog=(flag=true)=>{
|
||||
isVisited.value=flag
|
||||
}
|
||||
defineExpose({
|
||||
getFormInstance
|
||||
getFormInstance,
|
||||
openOrCloseDialog
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user