From 27aa3005d9b05168f5d62ada3625165a207d5bdd Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期三, 26 二月 2025 14:07:15 +0800 Subject: [PATCH] wwl --- src/components/chat.vue | 86 +++++++++++++++++++++ src/views/login.vue | 5 + src/views/doctor/examination/index.vue | 77 ++++++++++++++----- src/api/doctor/examination.js | 8 + src/views/12.vue | 16 ++++ 5 files changed, 170 insertions(+), 22 deletions(-) diff --git a/src/api/doctor/examination.js b/src/api/doctor/examination.js index f86bb7b..4916e5e 100644 --- a/src/api/doctor/examination.js +++ b/src/api/doctor/examination.js @@ -45,7 +45,13 @@ params: {tjNUm:tjNUm,proId:proId} }) } - +export function yijian(tjNUm,proId) { + return request({ + url: '/hosp/order/chushenyemianyijianjiekou', + method: 'get', + params: {tjNUm:tjNUm,proId:proId} + }) +} // 鐐瑰嚮鎭㈠ export function huifu(tjNUm,proId) { return request({ diff --git a/src/components/chat.vue b/src/components/chat.vue new file mode 100644 index 0000000..557c405 --- /dev/null +++ b/src/components/chat.vue @@ -0,0 +1,86 @@ +<template> + <div> + <h2>DeepSeek 鑱婂ぉ</h2> + <textarea v-model="inputMessage" placeholder="璇疯緭鍏ユ秷鎭�"></textarea> + <button @click="sendMessage">鍙戦��</button> + <p>鍥炲: {{ reply }}</p> + <p v-if="error" style="color: red">{{ error }}</p> + </div> + </template> + + <script> + export default { + name: 'Chat', + data() { + return { + inputMessage: '', + reply: '', + error: '' + }; + }, + methods: { + async sendMessage() { + if (!this.inputMessage.trim()) { + this.error = '娑堟伅涓嶈兘涓虹┖'; + return; + } + this.error = ''; + this.reply = ''; + + try { + const response = await fetch('http://localhost:3001/chat', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ message: this.inputMessage }) + }); + + if (!response.ok) { + throw new Error('缃戠粶鍝嶅簲閿欒'); + } + + const reader = response.body.getReader(); + const decoder = new TextDecoder(); + + while (true) { + const { done, value } = await reader.read(); + if (done) break; + + const chunk = decoder.decode(value); + const lines = chunk.split('\n').filter(line => line.trim()); + for (const line of lines) { + if (line.startsWith('data: ')) { + const data = line.replace('data: ', ''); + if (data === '[DONE]') return; + try { + const parsedData = JSON.parse(data); + const content = parsedData.choices[0].delta.content; + if (content) { + this.reply += content; + } + } catch (err) { + console.error('瑙f瀽閿欒:', err); + } + } + } + } + } catch (err) { + this.error = '娴佸紡鍝嶅簲鍑洪敊'; + console.error('Fetch 閿欒:', err); + } + } + } + }; + </script> + + <style scoped> + textarea { + width: 300px; + height: 100px; + margin-bottom: 10px; + } + button { + padding: 5px 10px; + } + </style> \ No newline at end of file diff --git a/src/views/12.vue b/src/views/12.vue new file mode 100644 index 0000000..c7d0c64 --- /dev/null +++ b/src/views/12.vue @@ -0,0 +1,16 @@ +<template> + <div id="app"> + <chat /> + </div> +</template> + +<script> +import chat from '../components/chat.vue'; + +export default { + name: 'App', + components: { + chat + } +}; +</script> \ No newline at end of file diff --git a/src/views/doctor/examination/index.vue b/src/views/doctor/examination/index.vue index 3e35e8f..45c2ee0 100644 --- a/src/views/doctor/examination/index.vue +++ b/src/views/doctor/examination/index.vue @@ -92,7 +92,7 @@ </el-radio-group> <div style="width: 100%; margin-left: 10px; display: flex"> - <div style="width: 40.5%; margin-right: 20px"> + <div style="width: 45%"> <el-table id="ta" v-loading="loading" @@ -103,25 +103,26 @@ :row-class-name="tableRowClassName" highlight-current-row @current-change="handleCurrentChange" + > <!-- <el-table-column type="selection" width="40" align="center" /> --> <el-table-column label="浣撴鍙�" align="center" prop="tjNumber" - width="160px" + min-width="160" /> <el-table-column label="濮撳悕" align="center" prop="cusName" - width="80px" + min-width="80" /> <el-table-column label="鎬у埆" align="center" prop="cusSex" - width="50px" + min-width="50" > <template slot-scope="scope"> <span v-if="scope.row.cusSex == '0'">鐢�</span> @@ -139,20 +140,20 @@ label="鎵嬫満鍙�" align="center" prop="cusPhone" - width="100px" + min-width="100" /> <el-table-column label="鐧昏鏃堕棿" align="center" prop="tjTime" - width="120px" + min-width="120" /> <el-table-column v-if="checkStatus == '1'" label="瀹℃牳鐘舵��" align="center" prop="confirmStatus" - width="80px" + min-width="80" > <template slot-scope="scope"> <span @@ -174,7 +175,7 @@ </template> </el-table-column> <!-- v-hasPermi="['reservation:reservation:edit']" --> - <el-table-column label="鎿嶄綔" align="center" width="120px"> + <el-table-column label="鎿嶄綔" align="center" min-width="120px"> <template slot-scope="scope"> <el-button size="mini" @@ -208,7 +209,7 @@ </el-table-column> </el-table> </div> - <div style="width: 40%"> + <div style="width: 45%; margin-left: 5%"> <el-table v-loading="loading" border @@ -218,20 +219,21 @@ :data="xiangmuList" highlight-current-row @row-click="handleRowClick" + > <!-- <el-table-column type="selection" width="40" align="center" /> --> <el-table-column label="绉戝" align="center" prop="deptName" - width="100" + min-width="100" :show-overflow-tooltip="true" /> <el-table-column label="椤圭洰" align="center" prop="proName" - width="150" + min-width="150" :show-overflow-tooltip="true" /> <el-table-column @@ -239,7 +241,7 @@ align="center" prop="type" :show-overflow-tooltip="true" - width="100" + min-width="100" > <template slot-scope="scope"> <span @@ -283,7 +285,7 @@ label="妫�鏌ユ椂闂�" align="center" prop="bcupdateTime" - width="160" + min-width="160" /> <!-- <el-table-column label="淇濆瓨鍖荤敓" @@ -297,7 +299,7 @@ prop="zhupdateTime" width="160" /> --> - <el-table-column label="鎿嶄綔" align="center" width="120px"> + <el-table-column label="鎿嶄綔" align="center" min-width="120px"> <template slot-scope="scope"> <el-button size="mini" @@ -307,18 +309,18 @@ @click="qijian(scope.row)" >{{ scope.row.type === 0 ? "寮冩" : "鎭㈠" }}</el-button > - <!-- <el-button + <el-button size="mini" type="text" - @click="qijian(scope.row)" - >鎭㈠</el-button - > --> + @click="yijian(scope.row)" + >宸叉</el-button + > <el-button size="mini" type="text" :disabled="scope.row.type === 0 || scope.row.type === 2" @click="queryResultone(scope.row)" - >缁撴灉鏌ヨ</el-button + >缁撴灉</el-button > <!-- @click="chaxun(scope.row) " --> </template> @@ -401,6 +403,7 @@ cSWebGetPro, dataSynchronization, qijian, + yijian, resultList, typeOne, huifu, @@ -812,7 +815,24 @@ }); } }, - + yijian(row) { + const tjNUm = this.selectedTjNumber; + const proId = row.proId; + row.isLoading = true; + yijian(tjNUm, proId).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("宸叉鎴愬姛"); + cSWebGetPro(tjNUm).then((res) => { + if (res.code === 200) { + this.xiangmuList = res.data; + row.isLoading = false; + } + }); + } + }).catch(() => { + row.isLoading = false; + }); + }, handleRowClick(row, column, event) { // console.log(row, 2323); this.name = row.proName; @@ -958,4 +978,21 @@ .check-description.no-result { color: #bbb; /* 濡傛灉娌℃湁缁撹锛屾枃瀛椾负娣$伆鑹� */ } + +::v-deep .el-table { + width: 100% !important; +} + +::v-deep .el-table__body { + width: 100% !important; +} + +::v-deep .el-table__header { + width: 100% !important; +} + +/* 濡傛灉闇�瑕侀殣钘忔í鍚戞粴鍔ㄦ潯 */ +::v-deep .el-table__body-wrapper::-webkit-scrollbar-horizontal { + display: none; +} </style> \ No newline at end of file diff --git a/src/views/login.vue b/src/views/login.vue index 3a6ee04..81e9810 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -175,7 +175,7 @@ this.loginForm.hospId = "pbkwyy"; break; case '8095': - this.loginForm.hospId = "jdczgzyy"; + this.loginForm.hospId = "sqyy"; break; } Cookies.set("hospId", this.loginForm.hospId); @@ -191,6 +191,9 @@ case '9014': this.loginForm.hospId = "jdczgzyy"; break; + case '9015': + this.loginForm.hospId = "sqyy"; + break; } Cookies.set("hospId", this.loginForm.hospId); } -- Gitblit v1.8.0