diff --git a/src/assets/base.css b/src/assets/base.css index 2d43f5aefffb810d19d2731d713687bf3f576344..18e8cf0ccedaaf60f7653be727f45287668a196e 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -1,11 +1,11 @@ @font-face { - font-family: 'HarmonyOS_Sans_SC_Medium'; - src: url('./fonts/HarmonyOS_Sans_SC_Medium.ttf'); + font-family: 'HarmonyOS_Sans_SC_Regular'; + src: url('./fonts/HarmonyOS_Sans_SC_Regular.ttf'); font-weight: normal; font-style: normal; } * { - font-family: HarmonyOS_Sans_SC_Medium, 'Helvetica Neue', Helvetica, + font-family: HarmonyOS_Sans_SC_Regular, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif; } diff --git a/src/assets/fonts/HarmonyOS_Sans_SC_Regular.ttf b/src/assets/fonts/HarmonyOS_Sans_SC_Regular.ttf new file mode 100755 index 0000000000000000000000000000000000000000..aff150a137831c29d4d3cba994ac1b8e3a9940fa Binary files /dev/null and b/src/assets/fonts/HarmonyOS_Sans_SC_Regular.ttf differ diff --git a/src/components/dialoguePanel/DialoguePanel.vue b/src/components/dialoguePanel/DialoguePanel.vue index 9969fc15beda7dde800e5fc1b091aaa53fe4dc17..73a1f5bd16cb12ce5a0ee2636052581cfc271a90 100644 --- a/src/components/dialoguePanel/DialoguePanel.vue +++ b/src/components/dialoguePanel/DialoguePanel.vue @@ -73,7 +73,7 @@ export interface DialoguePanelProps { isWorkFlowDebug: boolean; } import JsonFormComponent from './JsonFormComponent.vue'; -import { Metadata } from 'srcapis/paths/type'; +import { Metadata } from 'src/apis/paths/type'; import DialogueFlow from './DialogueFlow.vue'; var option = ref(); diff --git a/src/store/conversation.ts b/src/store/conversation.ts index 38c637eb057822c4dff7186e139916094dbc7980..90524b99b9fbe732107cb6652209a3bb126bd61a 100644 --- a/src/store/conversation.ts +++ b/src/store/conversation.ts @@ -232,6 +232,7 @@ export const useSessionStore = defineStore('conversation', () => { echartsObj.value = {}; txt2imgPath.value = ''; let addItem = ''; + let tempMessage = ''; while (isEnd) { if (isPaused.value) { // 手动暂停输出 @@ -256,9 +257,14 @@ export const useSessionStore = defineStore('conversation', () => { break; } // 这里删除了\n\n - const lines = decodedValue - .split('\n\n') - .filter((line) => line.startsWith('data: {')); + + if(!decodedValue.endsWith('}\n\n') || tempMessage){ + tempMessage += decodedValue; + } + + if(tempMessage && !tempMessage.endsWith('}\n\n')) continue; + + const lines = tempMessage ? tempMessage.split('data:') : decodedValue.split('data:'); // 获取最后一个 const lastLine = lines[lines.length - 1] || {}; if (!judgeJson(JSON.stringify(lastLine))) { @@ -267,6 +273,7 @@ export const useSessionStore = defineStore('conversation', () => { } else { addItem = ''; } + // pa lines.forEach((line) => { // 这里json解析 diff --git a/src/views/dialogue/components/AppInitalPreview.vue b/src/views/dialogue/components/AppInitalPreview.vue index 8e2a050bd2719bab207b9fea448b033c71b1dd7c..551359214516cccd127666939d023b7e7423d400 100644 --- a/src/views/dialogue/components/AppInitalPreview.vue +++ b/src/views/dialogue/components/AppInitalPreview.vue @@ -110,7 +110,7 @@ watch( font-size: 16px; background-color: var(--o-bg-color-base); font-family: - HarmonyOS_Sans_SC_Medium, + HarmonyOS_Sans_SC_Regular, system-ui, -apple-system, BlinkMacSystemFont, @@ -133,7 +133,7 @@ watch( } textarea::-webkit-input-placeholder { - font-family: HarmonyOS_Sans_SC_Medium; + font-family: HarmonyOS_Sans_SC_Regular; } } diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index 1eff8ebd579e46248295ab4b330deca01f72e6db..76e7963eb6728488c3ef5deb61ed07b4f03f18b9 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -1119,7 +1119,7 @@ button[disabled]:hover { font-size: 16px; background-color: var(--o-bg-color-base); font-family: - HarmonyOS_Sans_SC_Medium, + HarmonyOS_Sans_SC_Regular, system-ui, -apple-system, BlinkMacSystemFont, @@ -1142,7 +1142,7 @@ button[disabled]:hover { } textarea::-webkit-input-placeholder { - font-family: HarmonyOS_Sans_SC_Medium; + font-family: HarmonyOS_Sans_SC_Regular; } } diff --git a/src/views/dialogue/components/InitalPanel.vue b/src/views/dialogue/components/InitalPanel.vue index f5a9fbb949304cfc7ba8c22bcee804fbc2f07602..127ac038ca8e2fb836d87205e95c969137b74837 100644 --- a/src/views/dialogue/components/InitalPanel.vue +++ b/src/views/dialogue/components/InitalPanel.vue @@ -236,7 +236,7 @@ onMounted(() => { display: flex; align-items: center; color: var(--o-text-color-secondary); - font-family: HarmonyOS_Sans_SC_Medium; + font-family: HarmonyOS_Sans_SC_Regular; font-size: 12px; line-height: 16px; cursor: pointer;