Bladeren bron

病例生成AI助手

liyanyan 1 maand geleden
bovenliggende
commit
942d1feb37
2 gewijzigde bestanden met toevoegingen van 174 en 48 verwijderingen
  1. 19 15
      src/views/allcase/caseViews.vue
  2. 155 33
      src/views/allcase/components/CaseQualityBox2.vue

+ 19 - 15
src/views/allcase/caseViews.vue

@@ -360,23 +360,27 @@ export default {
 
   },
   mounted() {
-    this.valData = this.storageGet('getData');
-    this.ruleId = this.storageGet('getDataRule');
-    let xqItemError = this.storageGet('xqItemError');
-    if(xqItemError){
-      this.xqItemError = JSON.parse(xqItemError);
-      // this.is_VueDragResize= true;
-    }
-
-    if (this.valData) {
-      if (this.$route.query.from !== 'forewarning') {
-        this.funQuery();
-      }
-      this.getCaseQualityResults();
-    }
-    this.getTree();
+    this.getInitData();
   },
+  activated() {},
   methods: {
+    getInitData() {
+      this.valData = this.storageGet('getData');
+      this.ruleId = this.storageGet('getDataRule');
+      let xqItemError = this.storageGet('xqItemError');
+      if(xqItemError){
+        this.xqItemError = JSON.parse(xqItemError);
+        // this.is_VueDragResize= true;
+      }
+
+      if (this.valData) {
+        if (this.$route.query.from !== 'forewarning') {
+          this.funQuery();
+        }
+        this.getCaseQualityResults();
+      }
+      this.getTree();
+    },
     clickzbjg(){
       this.is_VueDragResize = true;
     },

+ 155 - 33
src/views/allcase/components/CaseQualityBox2.vue

@@ -6,40 +6,70 @@
     </el-tab-pane>
   </el-tabs>
 
-  <div v-if="tabsActive == 1">
-    <div style="width: 420px;">
-      <div class="message" style="overflow-y: auto;max-height: 480px;height: 480px;background-color: white;border-radius: 10px;">
-        <div v-for="(item,index) in chatMessages" :key="index">
-          <div v-if="item.role == 'user'" class="user-message">
-            <el-avatar  style="margin-left: 10px;" src="static/img/avatar07.7b002992.png" fit="contain"></el-avatar>
-            <div class="user-content" style="line-height: 40px;background-color: #00C797;margin-left: 10px;border-radius: 5px;padding: 0 10px 0 10px;">
-              {{item.content}}
-            </div>
+  <div v-if="tabsActive == 1" style="height: 100%">
+    <div class="taskNameListAndMessage">
+          <el-menu
+            :default-active="currentTaskName"
+            class="el-menu-vertical-demo"
+          >
+           <div v-for="item in taskNameList">
+            <el-submenu :index="`${item.id}`" v-if="item.child">
+              <template slot="title">
+                <span style="padding-left:20px">{{item.name}}</span>
+              </template>
+              <div v-for="element in item.child">
+                <el-submenu :index="`${element.parent_id}-${element.id}`" v-if="element.child">
+                  <template slot="title">
+                    <span style="padding-left:40px">{{element.name}}</span>
+                  </template>
+                  <el-menu-item  v-for="elementItem in element.child" :index="`${item.id}-${elementItem.parent_id}-${elementItem.id}`"  @click="handleTaskNameSelect(elementItem, `${item.id}-${elementItem.parent_id}-${elementItem.id}`)">
+                    <span slot="title">{{elementItem.name}}</span>
+                  </el-menu-item>
+                </el-submenu>
+                <el-menu-item :index="`${element.parent_id}-${element.id}`" v-else  @click="handleTaskNameSelect(element, `${element.parent_id}-${element.id}`)">
+                  <span slot="title">{{element.name}}</span>
+                </el-menu-item>
+              </div>
+            </el-submenu>
+            <el-menu-item :index="`${item.id}`" v-else @click="handleTaskNameSelect(item, item.id)">
+              <span slot="title">{{item.name}}</span>
+            </el-menu-item>
           </div>
-          <div v-if="item.role == 'assistant'" class="record-message" style="display: flex;justify-content: right;margin-bottom: 20px;">
-            <div class="record-avatar" style="box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);width: 360px;margin-right: 10px;margin-left:10px; padding: 0 10px 0 10px;background-color: white;border-radius: 5px;line-height: 40px;">
-              {{item.content}}
+        </el-menu>
+        <div class="messageBox" v-if="currentTaskName">
+          <div class="message">
+            <div v-for="(item,index) in chatMessages" :key="index">
+              <div v-if="item.role == 'user'" class="user-message">
+                <div class="user-content">
+                  {{item.content}}
+                </div>
+                <el-avatar src="static/img/avatar07.7b002992.png" fit="contain"></el-avatar>
+              </div>
+              <div v-if="item.role == 'assistant'" class="record-message">
+                <el-avatar :src="require('../../../assets/images/jiqiren.png')" fit="contain"></el-avatar>
+                <div class="record-content">
+                  {{item.content}}
+                </div>
+              </div>
             </div>
-            <el-avatar  style="margin-right: 10px;" :src="require('../../../assets/images/jiqiren.png')" fit="contain"></el-avatar>
           </div>
-        </div>
-      </div>
-      <div style="margin: 20px;border-top: 1px solid blue;border-right: 1px solid blue;border-radius: 10px;display: flex;background-color: white">
-        <div style="width: 80px;border-radius: 10px 0 0 10px;  background-color: #DDDDDD;display: flex;flex-wrap: wrap;justify-content: center;padding-bottom: 5px;">
-          <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 病历</button>
-          <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 检查</button>
-          <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 检验</button>
-          <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“知识库</button>
-        </div>
-        <div style="width: calc(100% - 90px)">
-          <textarea v-model="inputMessage" placeholder="请输入您的问题,帮您深度解答" style="height: 80px;border: none;outline:none; width: 100%;padding: 10px;"></textarea>
-          <div style="display: flex;margin-bottom: 10px;">
-            <el-icon class="iconfont zj-damuzhi" style="margin-left: 20px;line-height: 35px;"></el-icon>
-            <el-icon class="iconfont zj-zanxia" style="margin-left: 20px;line-height: 35px;"></el-icon>
-            <el-button @click="sendMessage" type="primary" style="margin-left: auto;height: 30px;line-height: 0;margin-right: 10px;">发送</el-button>
+          <div class="sendMessageBox">
+            <!-- <div style="width: 80px;border-radius: 10px 0 0 10px;  background-color: #DDDDDD;display: flex;flex-wrap: wrap;justify-content: center;padding-bottom: 5px;">
+              <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 病历</button>
+              <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 检查</button>
+              <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“ 检验</button>
+              <button style="width: 60px;margin-top: 5px;border-radius: 5px;border: 1px solid blue;color: blue">“知识库</button>
+            </div> -->
+            <div style="width: calc(100%)">
+              <textarea class="inputText" v-model="inputMessage" placeholder="请输入您的问题,帮您深度解答"></textarea>
+              <el-row type="flex" justify="end">
+                <!-- <el-icon class="iconfont zj-damuzhi" style="margin-left: 20px;line-height: 35px;"></el-icon>
+                <el-icon class="iconfont zj-zanxia" style="margin-left: 20px;line-height: 35px;"></el-icon> -->
+                <el-button type="primary" @click="sendMessage()" icon="el-icon-top" circle></el-button>
+              </el-row>
+            </div>
           </div>
         </div>
-      </div>
     </div>
   </div>
 
@@ -172,6 +202,8 @@
         tableData: [],
         is_show: true,
         quality_type: 2,  // 1、首页质控 2、病例质控
+        taskNameList: [],
+        currentTaskName: ''
       }
     },
     computed: {
@@ -203,11 +235,24 @@
     },
     created(){
       this.getTableData();
+      this.getTaskNameList();
     },
     methods: {
+      getTaskNameList() {
+        this.$axios2.get('/big_model/get_task_name', {}).then(res => {
+          if(res.code == 200){            
+            this.taskNameList = res.data || []
+          }
+        })
+      },
+      handleTaskNameSelect(menuItem, indexId) {
+        console.log(menuItem);
+        this.currentTaskName = indexId
+        this.sendMessage(menuItem.name)
+      },
       //发送消息
-      async sendMessage(){
-        const messages = this.inputMessage.trim();
+      async sendMessage(params){
+        const messages = params ? params : this.inputMessage.trim();
         if (messages){
           //添加用户信息到聊天记录
           this.chatMessages.push({
@@ -321,8 +366,85 @@
 </script>
 
 <style lang="scss" scoped>
-.message{border-bottom: 1px solid gray;margin-bottom: 20px;}
-.user-message{display: flex;margin-bottom: 20px;margin-top: 10px;}
+::v-deep.el-submenu {
+  &>.el-submenu__title {
+    padding-left: 0 !important;
+
+    .el-submenu__icon-arrow {
+      display: block !important;
+    }
+  }
+}
+.taskNameListAndMessage {
+  height: 100%;
+  overflow-y: auto;
+  background-color: white;
+  border-radius: 10px;
+  display: flex;
+  .el-menu-vertical-demo {
+    width:340px;
+    height: 100%;
+    overflow-y: scroll
+  }
+}
+.messageBox {
+  width: 420px;
+  display: flex;
+  flex-direction: column;
+  height: calc(100vh - 250px);
+  
+  .message {
+    flex: 1;
+    margin-bottom: 20px;
+    max-height: 85%;
+    overflow-y: auto;
+    height: 480px;
+    background-color: white;
+    border-radius: 10px;
+    .user-message{
+      display: flex;
+      margin: 10px 10px 20px 10px;
+      justify-content: right;
+      .user-content {
+        line-height: 40px;
+        background-color: #bee2f8;
+        margin-right: 10px;
+        border-radius: 5px;
+        padding: 0 10px 0 10px;
+      }
+    }
+    .record-message {
+      display: flex;
+      margin: 10px 10px 20px 10px;
+      .record-content {
+        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
+        width: 360px;
+        margin-left:10px; 
+        padding: 0 10px 0 10px;
+        border-radius: 5px;
+        line-height: 40px;
+      }
+    }
+  }
+
+  .sendMessageBox {
+    margin: 10px;
+    padding: 10px;
+    border: 1px solid #bbb;
+    border-radius: 8px;
+    display: flex;
+    height: 150px;
+    .inputText {
+      height: 80px;
+      border: none;
+      outline:none; 
+      width: 100%;
+      resize: none;
+    }
+  }
+}
+
+
 
 ::v-deep .el-scrollbar__wrap {
   overflow-x: hidden;