feat: 编写请求配置页

This commit is contained in:
奔跑的面条
2022-07-11 09:01:19 +08:00
parent 801f6e8d18
commit e9c2ca0989
20 changed files with 497 additions and 31 deletions
@@ -0,0 +1,62 @@
<template>
<n-modal class="go-chart-data-request" v-model:show="modelShow" :mask-closable="false" @afterLeave="closeHandle">
<n-card :bordered="false" role="dialog" size="small" aria-modal="true" style="width: 1000px; height: 800px">
<template #header></template>
<template #header-extra> </template>
<n-space vertical>
<request-global-config></request-global-config>
<request-target-config></request-target-config>
</n-space>
<!-- 底部 -->
<template #action>
<n-space justify="space-between">
<div>
<n-text> 柱状图 </n-text>
<n-text> </n-text>
<n-tag type="primary" :bordered="false"> {{requestContentTypeObj[requestContentType]}} </n-tag>
</div>
<n-button type="primary" ghost @click="closeHandle">关闭</n-button>
</n-space>
</template>
</n-card>
</n-modal>
</template>
<script script lang="ts" setup>
import { toRefs } from 'vue'
import { RequestContentTypeEnum } from '@/enums/httpEnum'
import { useTargetData } from '../../../hooks/useTargetData.hook'
import { RequestGlobalConfig } from './components/RequestGlobalConfig'
import { RequestTargetConfig } from './components/RequestTargetConfig'
const emit = defineEmits(['update:modelShow'])
const { targetData, chartEditStore } = useTargetData()
// 解构基础配置
const { requestContentType } = toRefs(targetData.value.request)
const requestContentTypeObj = {
[RequestContentTypeEnum.DEFAULT]: '普通请求',
[RequestContentTypeEnum.SQL]: 'SQL 请求',
}
defineProps({
modelShow: Boolean
})
const closeHandle = () => {
emit('update:modelShow', false)
}
</script>
<style lang="scss" scoped>
@include go('chart-data-request') {
&.n-card.n-modal,
.n-card {
@extend .go-background-filter;
}
.n-card-shallow {
background-color: rgba(0, 0, 0, 0) !important;
}
}
</style>