diff --git a/package.json b/package.json index ab59e9f77ac5ff860e9c895619f6400e22cf0b4d..b9e9938374b35e95e8546046ac3b5cb285889c8f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "codemirror": "^6.0.1", "dayjs": "1.11.9", "echarts": "^5.5.1", - "element-plus": "2.3.12", + "element-plus": "2.2.34", "highlight.js": "11.10.0", "marked": "4.3", "pinia": "2.1.6", diff --git a/src/App.vue b/src/App.vue index 592032d84e77869d0bd1a7675c5b2f5078a8a299..b832b239669365ea05cd1b2828180b30308c2dfd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,11 +1,11 @@ diff --git a/src/assets/images/routerCopilot.png b/src/assets/images/routerCopilot.png new file mode 100644 index 0000000000000000000000000000000000000000..7e3205580ec0c6710dcf2de0bbee510ec55950f8 Binary files /dev/null and b/src/assets/images/routerCopilot.png differ diff --git a/src/assets/images/routerCopilotSelected.png b/src/assets/images/routerCopilotSelected.png new file mode 100644 index 0000000000000000000000000000000000000000..fb3dd0a7659ded22a612c5cace3fbdc7281477fd Binary files /dev/null and b/src/assets/images/routerCopilotSelected.png differ diff --git a/src/assets/images/witchainD.png b/src/assets/images/witchainD.png new file mode 100644 index 0000000000000000000000000000000000000000..8cfc3bb07403a16cf8d125ba53d0898b0ee71b04 Binary files /dev/null and b/src/assets/images/witchainD.png differ diff --git a/src/assets/svgs/WitchainDSelected.svg b/src/assets/svgs/WitchainDSelected.svg new file mode 100644 index 0000000000000000000000000000000000000000..1b20a6d1711e583bb2dae13709cc26688a86f90a --- /dev/null +++ b/src/assets/svgs/WitchainDSelected.svg @@ -0,0 +1,19 @@ + + + Created with Pixso. + + + + + + + + + + + + + + + + diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 5d955b6ac188fecb4466990e3d8bd0c196f652fc..0bd437e00cb634a3e0d99953971de2666381f915 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -13,14 +13,16 @@ import ReportPopover from "src/views/dialogue/components/ReportPopover.vue"; import { onMounted, watch, onBeforeUnmount,reactive } from "vue"; import * as echarts from 'echarts'; import color from 'src/assets/color'; -import { Linetooltip , Circlelegend } from './chartsCss' import i18n from 'src/i18n'; import { storeToRefs } from 'pinia'; import { useLangStore } from 'src/store' +import JsonFormComponent from './JsonFormComponent.vue' +import { Metadata } from "srcapis/paths/type"; +import DialogueFlow from "./DialogueFlow.vue"; +import DialogueThought from "./DialogueThought.vue"; const { user_selected_plugins } = storeToRefs(useHistorySessionStore()); import { Suggest } from 'src/apis/paths/type'; const { params } = storeToRefs(useHistorySessionStore()); - const { language } = storeToRefs(useLangStore()); const { changeLanguage } = useLangStore(); const echartsDraw = ref(); @@ -68,11 +70,8 @@ export interface DialoguePanelProps { // modeOptions:any; } -import JsonFormComponent from './JsonFormComponent.vue' -import { Metadata } from "srcapis/paths/type"; -import DialogueFlow from "./DialogueFlow.vue"; -import { emit, title } from "process"; +const thoughtContent = ref(''); var option = ref(); var show = ref(false); const size = reactive({ @@ -238,18 +237,23 @@ const contentAfterMark = computed(() => { if (!props.content) { return ""; } + //xxs将大于号转为html实体以防歧义;将< >替换为正常字符; let str = marked.parse( xss(props.content[props.currentSelected]) .replace(/>/g, ">") .replace(/</g, "<") ) + //将table提取出来中加一个
父节点控制溢出 let tableStart = str.indexOf(''); if(tableStart!== -1){ str = str.slice(0, tableStart) + '
' + str.slice(tableStart, str.indexOf('
') + ''.length).replace('', '
') + str.slice(str.indexOf('') + ''.length); } - //将table提取出来中加一个
父节点控制溢出 - return str; - //xxs将大于号转为html实体以防歧义;将< >替换为正常字符; + //仅获取第一个遇到的 think 标签 + if(str.match(/([\s\S]*?)<\/think>/)){ + thoughtContent.value = str.match(/([\s\S]*?)<\/think>/)[1]; + } + //将标签替换为空 + return str.replace(/([\s\S]*?)<\/think>/g,''); }); @@ -380,12 +384,6 @@ const selectQuestion = (item:Suggest) => { }; -// const selectQuestion = (item:object) => { -// let question = item.question; -// let user_selected_flow = item.flow; -// emits('handleSendMessage',question,user_selected_flow); -// }; - const popperSize = () => { if(language.value == "EN"){ size.width = 418; @@ -449,6 +447,7 @@ const handleSendMessage = async (question, user_selected_flow, user_selected_plu
+
diff --git a/src/components/dialoguePanel/DialogueThought.vue b/src/components/dialoguePanel/DialogueThought.vue new file mode 100644 index 0000000000000000000000000000000000000000..1a5af0ee60b2d61ac031cc86b9a04887e00f64ec --- /dev/null +++ b/src/components/dialoguePanel/DialogueThought.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 60af04e8b6bc4535d7c9854bcd8df7d77066d525..02c108dc1c925284f8e51ecb0ba5362362f7502a 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -9,6 +9,7 @@ export default { like: 'Like', }, main: { + question:"Recommended Questions", describe1:"Hi! I'm", describe2:", and I'm happy to be of service.", left_describe:"Feel free to ask me, your AI assistant, about any of these topics, or anything else that's on your mind!~", diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index 522e13b705297b4a770131a06f21ada62076f8a5..f77ed7984e9df0de7b718bdd0388ce69cef2ad5d 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -9,6 +9,7 @@ export default { like: '喜欢', }, main: { + question:"推荐问题", describe1: '你好,我是', describe2: ',很高兴为你服务', left_describe: '作为你的智能助手,你可以试着问我关于以下方面的内容哦~', diff --git a/src/router/index.ts b/src/router/index.ts index a43c6a9b2685a030293dd24e382558430f4d4180..a22ae84da85288afc66a7561e8c2ecea6cd72d03 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -7,24 +7,36 @@ // IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // PURPOSE. // See the Mulan PSL v2 for more details. -import { createRouter, createWebHistory } from 'vue-router'; +import { createRouter, createWebHashHistory } from 'vue-router'; import NotFoundComponent from 'src/views/404.vue'; import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'; const router = createRouter({ - history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? '/eulercopilot/' : '/'), + history: createWebHashHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? '/eulercopilot/' : '/'), routes: [ { path: '/', name: 'dialogue', - component: (): Promise => - import('src/views/dialogue/dialogueView.vue'), + component: (): Promise => + import('src/views/dialogue/Copilot.vue'), }, { path: '/login', name: 'dialogue-login', - component: (): Promise => - import('src/views/dialogue/dialogueView.vue'), + component: (): Promise => + import('src/views/dialogue/Copilot.vue'), + }, + { + path: '/copilot', + name: 'copilot', + component: (): Promise => + import('src/views/dialogue/Copilot.vue'), + }, + { + path: '/tools', + name: 'tools', + component: (): Promise => + import('src/views/tools/index.vue'), }, { path: '/404', diff --git a/src/views/dialogue/Copilot.vue b/src/views/dialogue/Copilot.vue index e9d50896b8b3450f129f5377c9ebe9ddeb2bad06..11c69e77f76ea5d74ba1318cde4bfc8cf13cbd97 100644 --- a/src/views/dialogue/Copilot.vue +++ b/src/views/dialogue/Copilot.vue @@ -51,16 +51,16 @@ const initCopilot = async (): Promise => { } userinfo.value.organization = type; const currRoute = router.currentRoute; - if (currRoute.value.path === '/') { + if ( ['/copilot','/'].includes(currRoute.value?.path)) { const isLogin = await getUserInfo(); if (isLogin) { await api.getRecognitionMode() await api.stopGeneration(); await getHistorySession(); setPlugins(); - } - return; } + return; + } }; const dialogVisible = ref(false); @@ -117,9 +117,7 @@ watch(
-
- -
+ + :visible="agreeDialogVisiable" + :content="tip" + :need-check="false" + height="300px" + agreement-name="内测声明" + @submit="agreeDialogVisiable = false" + > diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index ca910a6b65512ca47d207d55464f3c0c00849801..2c34518f9f60c437be4725c6afdfa21d3e492adf 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -207,11 +207,6 @@ function hanleAsideVisible(): void {
- - - {{ $t('history.new_chat') }} - -
@@ -441,7 +436,6 @@ function hanleAsideVisible(): void { } .history-record { - margin-top: 15px; flex: 1; display: flex; height: calc(100% - 55px - 80px); diff --git a/src/views/dialogue/components/InitalPanel.vue b/src/views/dialogue/components/InitalPanel.vue index f665d12d22b7cda3a259ac2b6d9eecb902c298d2..bfb24cd7c6cf8b7e7b6c7b2ccbb3a7a00d7fee58 100644 --- a/src/views/dialogue/components/InitalPanel.vue +++ b/src/views/dialogue/components/InitalPanel.vue @@ -1,135 +1,100 @@