增加医慧功能1.1

This commit is contained in:
zrh050423 2024-12-10 12:58:16 +08:00
parent e7509b3943
commit 77a5fd1057
4 changed files with 49 additions and 44 deletions

View File

@ -4,7 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="89b6391e-b093-4f28-95c9-b45ddeb7aae0" name="更改" comment="基础框架" /> <list default="true" id="89b6391e-b093-4f28-95c9-b45ddeb7aae0" name="更改" comment="基础框架">
<change beforePath="$PROJECT_DIR$/medical-frontend/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/medical-frontend/package-lock.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/medical-frontend/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/medical-frontend/package.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -35,26 +38,26 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"com.codeium.enabled": "true", &quot;com.codeium.enabled&quot;: &quot;true&quot;,
"git-widget-placeholder": "Vue", &quot;git-widget-placeholder&quot;: &quot;Vue&quot;,
"ignore.virus.scanning.warn.message": "true", &quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
"kotlin-language-version-configured": "true", &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
"last_opened_file_path": "D:/mycode/Spingboot/HealthSystem/medical-frontend", &quot;last_opened_file_path&quot;: &quot;D:/mycode/Spingboot/HealthSystem/medical-frontend&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.detected.package.tslint": "true", &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"node.js.selected.package.tslint": "(autodetect)", &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"project.structure.last.edited": "项目", &quot;project.structure.last.edited&quot;: &quot;项目&quot;,
"project.structure.proportion": "0.0", &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
"project.structure.side.proportion": "0.2", &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
"settings.editor.selected.configurable": "vcs.Git", &quot;settings.editor.selected.configurable&quot;: &quot;vcs.Git&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
} }
}]]></component> }</component>
<component name="SharedIndexes"> <component name="SharedIndexes">
<attachedChunks> <attachedChunks>
<set> <set>
@ -80,6 +83,7 @@
<workItem from="1733666330234" duration="91000" /> <workItem from="1733666330234" duration="91000" />
<workItem from="1733666426312" duration="17000" /> <workItem from="1733666426312" duration="17000" />
<workItem from="1733666445148" duration="81000" /> <workItem from="1733666445148" duration="81000" />
<workItem from="1733802734282" duration="13000" />
</task> </task>
<task id="LOCAL-00001" summary="基础框架"> <task id="LOCAL-00001" summary="基础框架">
<option name="closed" value="true" /> <option name="closed" value="true" />

View File

@ -8,7 +8,7 @@
"name": "medical-frontend", "name": "medical-frontend",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"axios": "^1.4.0", "axios": "^1.7.9",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"element-plus": "^2.3.9", "element-plus": "^2.3.9",
"pinia": "^2.1.6", "pinia": "^2.1.6",
@ -987,9 +987,10 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.7.8", "version": "1.7.9",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", "resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
"license": "MIT",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",

View File

@ -9,18 +9,18 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"vue": "^3.3.4", "axios": "^1.7.9",
"vue-router": "^4.2.4",
"element-plus": "^2.3.9",
"axios": "^1.4.0",
"pinia": "^2.1.6",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"tesseract.js": "^4.1.1" "element-plus": "^2.3.9",
"pinia": "^2.1.6",
"tesseract.js": "^4.1.1",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"vite": "^4.4.9",
"@element-plus/icons-vue": "^2.1.0", "@element-plus/icons-vue": "^2.1.0",
"sass": "^1.65.1" "@vitejs/plugin-vue": "^4.2.3",
"sass": "^1.65.1",
"vite": "^4.4.9"
} }
} }

View File

@ -34,8 +34,14 @@ const messages = ref([]);
const callBackend = async (message) => { const callBackend = async (message) => {
try { try {
const response = await axios.post('http://10.138.4.249:8080/ai/main', { const response = await axios.post('http://10.10.10.44:11434/api/generate', {
message: message "model":"llama3.3:latest",
"prompt": message,
"stream": false
}, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
}); });
return response.data; return response.data;
} catch (error) { } catch (error) {
@ -59,19 +65,13 @@ const sendMessage = async () => {
return; return;
} }
messages.value.push({ sender: 'user', content: inputMessage.value }); messages.value.push({ sender: 'user', content: inputMessage.value });
let putmessage=inputMessage.value;
inputMessage.value = ''; inputMessage.value = '';
try { try {
const response = await callBackend(inputMessage.value); const response = await callBackend(putmessage);
console.log('响应内容:', response); //
// messages.value.push({ sender: 'ai', content: response.response });
if (response.status === 'success' && response.data) {
messages.value.push({ sender: 'ai', content: response.data.generation });
} else {
//
messages.value.push({ sender: 'ai', content: '发生错误,请重试' });
}
} catch (error) { } catch (error) {
// //
console.error('请求失败:', error); // console.error('请求失败:', error); //