diff --git a/app/public/iconfont.css b/app/public/iconfont.css index 33474da..a143ee9 100644 --- a/app/public/iconfont.css +++ b/app/public/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 4870215 */ - src: url('iconfont.woff2?t=1742992580860') format('woff2'), - url('iconfont.woff?t=1742992580860') format('woff'), - url('iconfont.ttf?t=1742992580860') format('truetype'); + src: url('iconfont.woff2?t=1743002215431') format('woff2'), + url('iconfont.woff?t=1743002215431') format('woff'), + url('iconfont.ttf?t=1743002215431') format('truetype'); } .iconfont { @@ -13,6 +13,10 @@ -moz-osx-font-smoothing: grayscale; } +.icon-close:before { + content: "\e615"; +} + .icon-blank:before { content: "\e602"; } diff --git a/app/public/iconfont.woff2 b/app/public/iconfont.woff2 index 58c9b1e..b4fdf3f 100644 Binary files a/app/public/iconfont.woff2 and b/app/public/iconfont.woff2 differ diff --git a/app/src/components/main-panel/chat/index.vue b/app/src/components/main-panel/chat/index.vue new file mode 100644 index 0000000..0c7e7dc --- /dev/null +++ b/app/src/components/main-panel/chat/index.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/app/src/components/main-panel/index.vue b/app/src/components/main-panel/index.vue index 58e5516..dc203de 100644 --- a/app/src/components/main-panel/index.vue +++ b/app/src/components/main-panel/index.vue @@ -5,9 +5,15 @@ class="tab" v-for="(tab, index) of tabs.content" :key="index" + :class="{ 'active-tab': tabs.activeIndex === index }" + @click="setActiveTab(index)" > {{ tab.name }} + import { defineComponent } from 'vue'; -import { addNewTab, tabs } from './panel'; +import { addNewTab, tabs, setActiveTab, closeTab } from './panel'; defineComponent({ name: 'main-panel' }); \ No newline at end of file diff --git a/app/src/components/main-panel/panel.ts b/app/src/components/main-panel/panel.ts index 052e80b..ddd6081 100644 --- a/app/src/components/main-panel/panel.ts +++ b/app/src/components/main-panel/panel.ts @@ -1,5 +1,11 @@ import { reactive } from 'vue'; +interface Tab { + name: string; + icon: string; + type: string; +} + export const tabs = reactive({ content: [ { @@ -7,9 +13,35 @@ export const tabs = reactive({ icon: 'icon-blank', type: 'blank' } - ], + ] as Tab[], + activeIndex: 0 }); +let tabCounter = 1; + export function addNewTab() { - console.log(); + const newTab = { + name: `新标签页 ${tabCounter++}`, + icon: 'icon-blank', + type: 'blank' + }; + tabs.content.push(newTab); + tabs.activeIndex = tabs.content.length - 1; +} + +export function setActiveTab(index: number) { + if (index >= 0 && index < tabs.content.length) { + tabs.activeIndex = index; + } +} + +export function closeTab(index: number) { + if (tabs.content.length <= 1) return; // 至少保留一个标签页 + + tabs.content.splice(index, 1); + + // 调整活动标签索引 + if (tabs.activeIndex >= index) { + tabs.activeIndex = Math.max(0, tabs.activeIndex - 1); + } } \ No newline at end of file diff --git a/app/src/components/main-panel/prompt/index.vue b/app/src/components/main-panel/prompt/index.vue new file mode 100644 index 0000000..3ceef72 --- /dev/null +++ b/app/src/components/main-panel/prompt/index.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/app/src/components/main-panel/resource/index.vue b/app/src/components/main-panel/resource/index.vue new file mode 100644 index 0000000..e830743 --- /dev/null +++ b/app/src/components/main-panel/resource/index.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/app/src/components/main-panel/tool/index.vue b/app/src/components/main-panel/tool/index.vue new file mode 100644 index 0000000..a4acfda --- /dev/null +++ b/app/src/components/main-panel/tool/index.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file