fix: 修复编辑动态请求modal,esc关闭后无法再次打开的问题,并增加取消关闭

This commit is contained in:
tnt group 2022-10-13 16:33:51 +08:00
parent c84f6d9c33
commit 53b9e03e69

View File

@ -1,5 +1,5 @@
<template>
<n-modal class="go-chart-data-request" v-model:show="modelShow" :mask-closable="false">
<n-modal class="go-chart-data-request" v-model:show="modelShow" :mask-closable="false" @esc="closeHandle">
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px">
<template #header></template>
<template #header-extra> </template>
@ -17,9 +17,14 @@
<div>
<n-text> {{ chartConfig.categoryName }} </n-text>
<n-text> </n-text>
<n-tag type="primary" :bordered="false" style="border-radius: 5px"> {{ requestContentTypeObj[requestContentType] }} </n-tag>
<n-tag type="primary" :bordered="false" style="border-radius: 5px">
{{ requestContentTypeObj[requestContentType] }}
</n-tag>
</div>
<n-button type="primary" @click="closeHandle">保存 & 发送请求</n-button>
<n-space>
<n-button size="medium" @click="closeHandle">取消</n-button>
<n-button size="medium" type="primary" @click="saveHandle">保存 & 发送请求</n-button>
</n-space>
</n-space>
</template>
</n-card>
@ -48,8 +53,14 @@ defineProps({
modelShow: Boolean
})
//
const closeHandle = () => {
emit('update:modelShow', false)
}
// |
const saveHandle = () => {
emit('update:modelShow', false)
emit('sendHandle')
}
</script>