|
|
@@ -2,26 +2,91 @@
|
|
|
* @Author: liuJie
|
|
|
* @Date: 2026-01-25 22:13:06
|
|
|
* @LastEditors: liuJie
|
|
|
- * @LastEditTime: 2026-01-25 22:26:30
|
|
|
+ * @LastEditTime: 2026-01-27 10:01:23
|
|
|
* @Describe: file describe
|
|
|
-->
|
|
|
<script lang="ts" setup>
|
|
|
import HttpSetter from './HttpSetter.vue';
|
|
|
+import { Icon } from "@iconify/vue";
|
|
|
+import { useComponentMapInspector } from "@/store"
|
|
|
+
|
|
|
+const store = useComponentMapInspector()
|
|
|
+
|
|
|
+console.log(store.componentMap['http'])
|
|
|
+
|
|
|
interface Props {
|
|
|
data: any, // 暂时定义
|
|
|
visible: boolean
|
|
|
}
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
id: '',
|
|
|
+ data: null,
|
|
|
visible: false
|
|
|
})
|
|
|
const emit = defineEmits<{
|
|
|
'update:visible': [value: boolean]
|
|
|
}>()
|
|
|
+const closeDrawer = () => {
|
|
|
+ emit('update:visible', false)
|
|
|
+}
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class='setter'>
|
|
|
+ <div class="drawer shadow-2xl" :class="{ 'drawer--open': props.visible }">
|
|
|
+ <header>
|
|
|
+ <h4>HTTP请求</h4>
|
|
|
+ <Icon icon="lucide:x" height="24" width="24" @click="closeDrawer" class="cursor-pointer"></Icon>
|
|
|
+ </header>
|
|
|
+ <div class="content">
|
|
|
+ <component :is="'http-node'" :data="props.data"></component>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<HttpSetter :data="data" v-model:visible="props.visible" />
|
|
|
</div>
|
|
|
</template>
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.setter {
|
|
|
+
|
|
|
+ /* Drawer 主体 */
|
|
|
+ .drawer {
|
|
|
+ position: fixed;
|
|
|
+ top: 100px;
|
|
|
+ right: 5px;
|
|
|
+ bottom: 10px;
|
|
|
+ width: 420px;
|
|
|
+ background: #fff;
|
|
|
+ z-index: 1000;
|
|
|
+ border-radius: 8px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ border: 1px solid #e4e4e4;
|
|
|
+
|
|
|
+ /* 初始隐藏状态 */
|
|
|
+ transform: translateX(100%);
|
|
|
+ transition: transform 0.25s ease;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 显示状态 */
|
|
|
+ .drawer--open {
|
|
|
+ transform: translateX(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* Header */
|
|
|
+ .drawer header {
|
|
|
+ height: 56px;
|
|
|
+ padding: 0 16px;
|
|
|
+ border-bottom: 1px solid #eee;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 内容区 */
|
|
|
+ .drawer .content {
|
|
|
+ flex: 1;
|
|
|
+ padding: 16px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|