| | |
| | | <img style="width: 60px;height: 60px" src="@/assets/img/logo.png"/> |
| | | </div> |
| | | <div class="menu"> |
| | | <div :class="{tab: true, activeTab: activeTab === 0}" @click="changeTab(0)"> |
| | | <svg t="1742895429099" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1205" width="18" height="18"> |
| | | <path :fill="activeTab === 0 ? 'blue' : 'grey'" d="M174.72 855.68l130.048-43.392 23.424 11.392C382.4 849.984 444.352 864 512 864c223.744 0 384-159.872 384-352 0-192.832-159.104-352-384-352S128 319.168 128 512a341.12 341.12 0 0 0 69.248 204.288l21.632 28.8-44.16 110.528z m-45.248 82.56A32 32 0 0 1 89.6 896l56.512-141.248A405.12 405.12 0 0 1 64 512C64 299.904 235.648 96 512 96s448 203.904 448 416-173.44 416-448 416c-79.68 0-150.848-17.152-211.712-46.72l-170.88 56.96z" p-id="1206"> |
| | | </path></svg> |
| | | <span style="margin-left: 10px">对话</span> |
| | | </div> |
| | | <div :class="{tab: true, activeTab: activeTab === 1}" style="margin-top: 2px" @click="changeTab(1)"> |
| | | <svg t="1743057348452" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2837" width="17" height="17"> |
| | | <path :fill="activeTab === 1 ? 'blue' : 'grey'" d="M927.8 193.7c0.1-1.6 0.2-3.2 0.2-4.8 0-15.7-6.3-30-18.7-42.9-6.9-7.2-15.8-13.9-26.5-20.1-21.9-12.7-52.3-23.9-90.5-33.3C717.1 74.2 617.5 64 512 64S306.9 74.2 231.7 92.6c-38.2 9.4-68.6 20.6-90.5 33.3-2.4 1.4-4.8 2.9-7 4.3-18.5 12.1-30.4 25.9-35.4 41.2-1.6 4.8-2.5 9.8-2.7 15H96v649.2c0 24.3 15.2 45.4 45.2 62.8 21.9 12.6 52.3 23.8 90.5 33.1C306.9 949.9 406.5 960 512 960s205.1-10.1 280.3-28.5c38.2-9.3 68.6-20.5 90.5-33.1 30-17.4 45.2-38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.4-252.6-23.7C182.8 213.4 161 195 155.7 189c1.6-1.8 4.4-4.5 9.6-7.9z m-11 211.3c0.1 0.4 0.2 0.9 0.2 1.6h-0.2v-1.6zM869.5 834c-2.4 3.5-20 23.9-104.8 42.6-69.1 15.2-158.8 23.6-252.6 23.6s-183.5-8.4-252.6-23.6C174.6 858 157 837.5 154.5 834V684.5c2 1 4.1 1.9 6.2 2.9 0.6 0.3 1.1 0.5 1.7 0.7l2.1 0.9c0.8 0.3 1.5 0.6 2.3 1 0.7 0.3 1.3 0.6 2 0.8 0.7 0.3 1.4 0.6 2.1 0.8 3.6 1.4 7.3 2.9 11.2 4.3 0.7 0.3 1.5 0.5 2.2 0.8 3.5 1.2 7.1 2.5 10.9 3.7 1 0.3 2.1 0.7 3.1 1 1 0.3 2.1 0.7 3.1 1 4.4 1.3 8.9 2.6 13.5 3.9 1.8 0.5 3.7 1 5.5 1.5 0.9 0.3 1.9 0.5 2.8 0.7 0.9 0.2 1.9 0.5 2.8 0.7 1.9 0.5 3.8 1 5.7 1.4 75.2 18.4 174.8 28.5 280.3 28.5s205.1-10.1 280.3-28.5c1.9-0.5 3.9-1 5.7-1.4 0.9-0.2 1.9-0.5 2.8-0.7 0.9-0.2 1.9-0.5 2.8-0.7 1.9-0.5 3.7-1 5.5-1.5 4.6-1.3 9.1-2.6 13.5-3.9 1.1-0.3 2.1-0.6 3.1-1 1-0.3 2.1-0.7 3.1-1 3.7-1.2 7.4-2.4 10.9-3.7 0.7-0.3 1.5-0.5 2.2-0.8 3.9-1.4 7.6-2.8 11.2-4.3 0.7-0.3 1.4-0.6 2.1-0.8 0.7-0.3 1.3-0.5 2-0.8 0.8-0.3 1.5-0.6 2.3-1l2.1-0.9c0.6-0.2 1.1-0.5 1.7-0.7 2.1-0.9 4.2-1.9 6.2-2.9V834z" p-id="2838"></path></svg> |
| | | <span style="margin-left: 8px">RAG对话</span> |
| | | <div class="add-chat"> |
| | | <i class="el-icon-plus"/>新建对话 |
| | | </div> |
| | | <div :class="{tab: true, activeTab: activeTab === 2}" style="margin-top: 2px" @click="changeTab(2)"> |
| | | <svg t="1743057471863" class="icon" viewBox="0 0 1029 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3047" width="16" height="16"> |
| | | <path :fill="activeTab === 2 ? 'blue' : 'grey'" d="M32.2592 294.4l409.6 211.2c19.2 12.8 44.8 12.8 70.4 12.8s51.2-6.4 70.4-12.8l409.6-211.2c38.4-19.2 38.4-51.2 0-70.4l-409.6-211.2c-19.2-6.4-44.8-12.8-70.4-12.8s-51.2 6.4-70.4 12.8l-409.6 211.2c-38.4 19.2-38.4 51.2 0 70.4z m441.6-204.8c12.8-6.4 25.6-6.4 38.4-6.4s32 6.4 38.4 6.4l339.2 172.8-339.2 172.8c-6.4 6.4-19.2 6.4-38.4 6.4-12.8 0-32-6.4-38.4-6.4l-339.2-172.8 339.2-172.8z" p-id="3048"></path> |
| | | <path :fill="activeTab === 2 ? 'blue' : 'grey'" d="M19.4592 550.4l403.2 204.8c25.6 12.8 57.6 19.2 89.6 19.2s64-6.4 89.6-19.2l403.2-204.8c12.8-6.4 25.6-32 12.8-51.2s-32-32-51.2-19.2l-403.2 204.8c-32 12.8-83.2 12.8-108.8 0l-403.2-204.8c-12.8-12.8-25.6-12.8-38.4 0-6.4 12.8-12.8 25.6-12.8 38.4 0 19.2 6.4 25.6 19.2 32z" p-id="3049"></path> |
| | | <path :fill="activeTab === 2 ? 'blue' : 'grey'" d="M1024.2592 748.8c-12.8-19.2-32-32-51.2-19.2l-403.2 204.8c-32 12.8-83.2 12.8-108.8 0l-403.2-204.8c-12.8-6.4-38.4 6.4-51.2 19.2-12.8 12.8-6.4 38.4 12.8 51.2l403.2 204.8c25.6 12.8 57.6 19.2 89.6 19.2s64-6.4 96-19.2l403.2-204.8c12.8-6.4 25.6-32 12.8-51.2z" p-id="3050"></path></svg> |
| | | <path fill="grey" d="M32.2592 294.4l409.6 211.2c19.2 12.8 44.8 12.8 70.4 12.8s51.2-6.4 70.4-12.8l409.6-211.2c38.4-19.2 38.4-51.2 0-70.4l-409.6-211.2c-19.2-6.4-44.8-12.8-70.4-12.8s-51.2 6.4-70.4 12.8l-409.6 211.2c-38.4 19.2-38.4 51.2 0 70.4z m441.6-204.8c12.8-6.4 25.6-6.4 38.4-6.4s32 6.4 38.4 6.4l339.2 172.8-339.2 172.8c-6.4 6.4-19.2 6.4-38.4 6.4-12.8 0-32-6.4-38.4-6.4l-339.2-172.8 339.2-172.8z" p-id="3048"></path> |
| | | <path fill="grey" d="M19.4592 550.4l403.2 204.8c25.6 12.8 57.6 19.2 89.6 19.2s64-6.4 89.6-19.2l403.2-204.8c12.8-6.4 25.6-32 12.8-51.2s-32-32-51.2-19.2l-403.2 204.8c-32 12.8-83.2 12.8-108.8 0l-403.2-204.8c-12.8-12.8-25.6-12.8-38.4 0-6.4 12.8-12.8 25.6-12.8 38.4 0 19.2 6.4 25.6 19.2 32z" p-id="3049"></path> |
| | | <path fill="grey" d="M1024.2592 748.8c-12.8-19.2-32-32-51.2-19.2l-403.2 204.8c-32 12.8-83.2 12.8-108.8 0l-403.2-204.8c-12.8-6.4-38.4 6.4-51.2 19.2-12.8 12.8-6.4 38.4 12.8 51.2l403.2 204.8c25.6 12.8 57.6 19.2 89.6 19.2s64-6.4 96-19.2l403.2-204.8c12.8-6.4 25.6-32 12.8-51.2z" p-id="3050"></path></svg> |
| | | <span style="margin-left: 8px">知识库管理</span> |
| | | </div> |
| | | </div> |
| | | <div class="session-list"> |
| | | <div class="session" v-for="(session, index) in sessionList" :key="'session' + index"> |
| | | <div style="width: 100%" @mouseenter="activeSession = index" @mouseleave="activeSession = null"> |
| | | <div>{{session.name}}</div> |
| | | <div :class="{session: true, 'active-session': currentSession == index}" v-for="(session, index) in sessionList" :key="'session' + index"> |
| | | <div style="width: 100%" @mouseenter="activeSession = index" @mouseleave="activeSession = null"> |
| | | <div @click="sessionChange(session, index)">{{session.name}}</div> |
| | | <div v-show="activeSession != null && activeSession == index" class="session-more"> |
| | | <el-dropdown @command="(command) => handleCommand(session, command)" trigger="click"> |
| | | <span class="el-dropdown-link"> |
| | |
| | | <el-dropdown-item command="del">删除</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | fileList: [], |
| | | activeTab: 0, |
| | | activeSession: null, |
| | | currentSession: null, |
| | | activeSetting: 'util', |
| | | enableAgent: false, |
| | | selectUtil: null, |
| | |
| | | this.changeRoute(this.activeTab) |
| | | }, |
| | | methods: { |
| | | sessionChange(session, index) { |
| | | console.log("触发了吗") |
| | | this.currentSession = index |
| | | if (this.$router.currentRoute.path !== "/chat") { |
| | | this.$router.push("/chat") |
| | | } |
| | | }, |
| | | renameSubmit() { |
| | | // TODO 保存到对话中 |
| | | this.renameShow = false |
| | |
| | | align-items: center; |
| | | border-bottom: 1px solid lightgray; |
| | | } |
| | | .add-chat { |
| | | width: 100%; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background-color: white; |
| | | border-radius: 8px; |
| | | margin-top: 15px; |
| | | margin-bottom: 15px; |
| | | user-select: none; |
| | | box-sizing: border-box; |
| | | } |
| | | .add-chat:hover { |
| | | cursor: pointer; |
| | | border: 1px solid lightgray; |
| | | } |
| | | .tab { |
| | | width: 100%; |
| | | line-height: 30px; |
| | |
| | | justify-content: flex-start; |
| | | border-radius: 8px; |
| | | align-items: center; |
| | | box-sizing: border-box; |
| | | } |
| | | .activeTab { |
| | | background-color: #bed7f5; |
| | | color: blue; |
| | | background-color: #dcdcdc; |
| | | } |
| | | .tab:hover { |
| | | cursor: pointer; |
| | | background-color: #bed7f5; |
| | | color: blue; |
| | | background-color: #dcdcdc; |
| | | } |
| | | .session-list { |
| | | margin-top: 20px; |
| | |
| | | padding: 10px 10px; |
| | | box-sizing: border-box; |
| | | position: relative; |
| | | margin-bottom: 4px; |
| | | } |
| | | .active-session { |
| | | background-color: #dcdcdc; |
| | | } |
| | | .session:hover { |
| | | background-color: #bed7f5; |
| | | background-color: #dcdcdc; |
| | | } |
| | | .session-more { |
| | | position: absolute; |
| | |
| | | .more:hover { |
| | | border-radius: 50%; |
| | | cursor: pointer; |
| | | background-color: white; |
| | | box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2); |
| | | background-color: #e8e8e8; |
| | | } |
| | | .setting { |
| | | margin-top: 20px; |