mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 00:02:51 +08:00
!225 feat: 数据接口管理弹窗增加取消按钮,并增加ESC关闭弹窗
Merge pull request !225 from QuietlyChan/fix
This commit is contained in:
commit
fe8ca5a447
@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<n-modal class="go-chart-data-pond-control" v-model:show="modelShowRef" :mask-closable="false" :close-on-esc="false">
|
||||
<n-modal
|
||||
class="go-chart-data-pond-control"
|
||||
v-model:show="modelShowRef"
|
||||
:mask-closable="false"
|
||||
:close-on-esc="true"
|
||||
:onEsc="onEsc"
|
||||
>
|
||||
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 900px; height: 650px">
|
||||
<template #header></template>
|
||||
<template #header-extra> </template>
|
||||
@ -29,7 +35,10 @@
|
||||
</n-icon>
|
||||
</template>
|
||||
</n-button>
|
||||
<n-button type="primary" @click="closeHandle">保存 & 发送请求</n-button>
|
||||
<div>
|
||||
<n-button class="go-mr-3" @click="closeHandle">取消</n-button>
|
||||
<n-button type="primary" @click="closeAndSendHandle">保存 & 发送请求</n-button>
|
||||
</div>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-card>
|
||||
@ -82,9 +91,12 @@ const pondData = computed(() => {
|
||||
return data[0]
|
||||
})
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
})
|
||||
watch(
|
||||
() => props.modelShow,
|
||||
newValue => {
|
||||
modelShowRef.value = newValue
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => pondData.value,
|
||||
@ -189,7 +201,7 @@ const deletePond = (targetData: RequestDataPondItemType) => {
|
||||
}
|
||||
|
||||
// 关闭
|
||||
const closeHandle = () => {
|
||||
const closeAndSendHandle = () => {
|
||||
// 将所选内容赋值给对象
|
||||
if (pondData.value) {
|
||||
targetData.value.request = {
|
||||
@ -200,6 +212,14 @@ const closeHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
emit('sendHandle')
|
||||
}
|
||||
|
||||
const closeHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
}
|
||||
|
||||
const onEsc = () => {
|
||||
closeHandle()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -10,7 +10,11 @@
|
||||
>
|
||||
<!-- 源地址 -->
|
||||
<setting-item name="前置 URL">
|
||||
<n-input v-model:value.trim="requestOriginUrl" :disabled="editDisabled" placeholder="例:http://127.0.0.1/"></n-input>
|
||||
<n-input
|
||||
v-model:value.trim="requestOriginUrl"
|
||||
:disabled="editDisabled"
|
||||
placeholder="例:http://127.0.0.1/"
|
||||
></n-input>
|
||||
</setting-item>
|
||||
<setting-item name="更新间隔,为 0 只会初始化">
|
||||
<n-input-group>
|
||||
|
@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<n-modal class="go-chart-data-request" v-model:show="modelShowRef" :mask-closable="false" :closeOnEsc="false">
|
||||
<n-modal
|
||||
class="go-chart-data-request"
|
||||
v-model:show="modelShowRef"
|
||||
:mask-closable="false"
|
||||
:closeOnEsc="true"
|
||||
:onEsc="onEsc"
|
||||
>
|
||||
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px">
|
||||
<template #header></template>
|
||||
<template #header-extra> </template>
|
||||
@ -21,7 +27,10 @@
|
||||
{{ requestContentTypeObj[requestContentType] }}
|
||||
</n-tag>
|
||||
</div>
|
||||
<n-button type="primary" @click="closeAndSendHandle"> {{ saveBtnText || '保存 & 发送请求' }}</n-button>
|
||||
<div>
|
||||
<n-button class="go-mr-3" @click="closeHandle">取消</n-button>
|
||||
<n-button type="primary" @click="closeAndSendHandle"> {{ saveBtnText || '保存 & 发送请求' }}</n-button>
|
||||
</div>
|
||||
</n-space>
|
||||
</template>
|
||||
</n-card>
|
||||
@ -70,6 +79,10 @@ const closeAndSendHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
emit('sendHandle')
|
||||
}
|
||||
|
||||
const onEsc = () => {
|
||||
closeHandle()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<n-modal class="go-chart-data-request" v-model:show="modelShowRef" :mask-closable="false" :closeOnEsc="false">
|
||||
<n-modal
|
||||
class="go-chart-data-request"
|
||||
v-model:show="modelShowRef"
|
||||
:mask-closable="false"
|
||||
:closeOnEsc="true"
|
||||
:onEsc="onEsc"
|
||||
>
|
||||
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px">
|
||||
<template #header></template>
|
||||
<template #header-extra> </template>
|
||||
@ -17,7 +23,7 @@
|
||||
<template #action>
|
||||
<n-space justify="space-between">
|
||||
<n-space v-if="targetDataRequest">
|
||||
<n-tag :bordered="false" type="primary">名称:</n-tag>
|
||||
<n-tag :bordered="false" type="primary">名称:</n-tag>
|
||||
<n-input
|
||||
v-model:value="targetDataRequest.dataPondName"
|
||||
ref="inputInstRef"
|
||||
@ -60,10 +66,12 @@ const pondName = ref()
|
||||
const inputInstRef = ref()
|
||||
const modelShowRef = ref(false)
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.modelShow,
|
||||
newValue => {
|
||||
modelShowRef.value = newValue
|
||||
}
|
||||
)
|
||||
|
||||
const closeHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
@ -85,6 +93,10 @@ const closeAndSendHandle = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const onEsc = () => {
|
||||
closeHandle()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -56,6 +56,7 @@
|
||||
type="text"
|
||||
maxlength="16"
|
||||
:placeholder="$t('global.form_account')"
|
||||
@keydown.enter="handleSubmit"
|
||||
>
|
||||
<template #prefix>
|
||||
<n-icon size="18">
|
||||
@ -71,6 +72,7 @@
|
||||
maxlength="16"
|
||||
show-password-on="click"
|
||||
:placeholder="$t('global.form_password')"
|
||||
@keydown.enter="handleSubmit"
|
||||
>
|
||||
<template #prefix>
|
||||
<n-icon size="18">
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<!-- mask-closable 暂时是失效的,不知道为啥 -->
|
||||
<n-modal
|
||||
class="go-modal-box"
|
||||
v-model:show="showRef"
|
||||
:mask-closable="true"
|
||||
@afterLeave="closeHandle"
|
||||
>
|
||||
<n-card hoverable size="small">
|
||||
|
Loading…
Reference in New Issue
Block a user