增加医慧功能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" />
</component>
<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="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -35,26 +38,26 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"com.codeium.enabled": "true",
"git-widget-placeholder": "Vue",
"ignore.virus.scanning.warn.message": "true",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/mycode/Spingboot/HealthSystem/medical-frontend",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "项目",
"project.structure.proportion": "0.0",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "vcs.Git",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;com.codeium.enabled&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;Vue&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/mycode/Spingboot/HealthSystem/medical-frontend&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;project.structure.last.edited&quot;: &quot;项目&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;vcs.Git&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
@ -80,6 +83,7 @@
<workItem from="1733666330234" duration="91000" />
<workItem from="1733666426312" duration="17000" />
<workItem from="1733666445148" duration="81000" />
<workItem from="1733802734282" duration="13000" />
</task>
<task id="LOCAL-00001" summary="基础框架">
<option name="closed" value="true" />

View File

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

View File

@ -9,18 +9,18 @@
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"element-plus": "^2.3.9",
"axios": "^1.4.0",
"pinia": "^2.1.6",
"axios": "^1.7.9",
"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": {
"@vitejs/plugin-vue": "^4.2.3",
"vite": "^4.4.9",
"@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) => {
try {
const response = await axios.post('http://10.138.4.249:8080/ai/main', {
message: message
const response = await axios.post('http://10.10.10.44:11434/api/generate', {
"model":"llama3.3:latest",
"prompt": message,
"stream": false
}, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
}
});
return response.data;
} catch (error) {
@ -59,19 +65,13 @@ const sendMessage = async () => {
return;
}
messages.value.push({ sender: 'user', content: inputMessage.value });
let putmessage=inputMessage.value;
inputMessage.value = '';
try {
const response = await callBackend(inputMessage.value);
console.log('响应内容:', response); //
const response = await callBackend(putmessage);
//
if (response.status === 'success' && response.data) {
messages.value.push({ sender: 'ai', content: response.data.generation });
} else {
//
messages.value.push({ sender: 'ai', content: '发生错误,请重试' });
}
messages.value.push({ sender: 'ai', content: response.response });
} catch (error) {
//
console.error('请求失败:', error); //