Преглед на файлове

3.1 名医名方→名医医案→疾病→新增疾病搜索框

cc12458 преди 1 година
родител
ревизия
006a6f0218
променени са 1 файла, в които са добавени 16 реда и са изтрити 3 реда
  1. 16 3
      src/views/knowledge/DoctorCaseBefore.vue

+ 16 - 3
src/views/knowledge/DoctorCaseBefore.vue

@@ -4,7 +4,12 @@
       <div :class="['tabs-item',activeName==0?'active':'']" @click="handleTab('0')">专家</div>
       <div :class="['tabs-item',activeName==1?'active':'']" @click="handleTab('1')">疾病</div>
     </div>
-    <div class="content">
+    <form v-if="activeName === '1'" style="width: 350px;margin: 12px auto 0;" @submit.stop="handleSearch()">
+      <el-input placeholder="请输入关键词搜索" v-model="keyword" clearable @clear="handleSearch()">
+        <el-button slot="append" icon="el-icon-search" @click="handleSearch()"></el-button>
+      </el-input>
+    </form>
+    <div class="content" :class="{searchable: activeName === '1'}">
       <div class="content-item" v-for="(item,index) in list" :key="index">
         <div class="en">{{item.pyCode}}</div>
         <div class="list">
@@ -26,6 +31,7 @@ export default {
   data() {
     return {
       activeName: "0",
+      keyword: "",
       list: []
     };
   },
@@ -33,6 +39,9 @@ export default {
     this.initData();
   },
   methods: {
+    handleSearch() {
+      this.initData();
+    },
     handleTab(active) {
       this.activeName = active;
       this.initData();
@@ -45,7 +54,8 @@ export default {
     // 初始化数据
     async initData() {
       let res = await getDoctorCaseIndexL({
-        indextype: this.activeName
+        indextype: this.activeName,
+        keyWord: this.activeName === '1' ? this.keyword : '',
       });
       if (res.code == 0) {
         let isPy = /^[A-Za-z]/;
@@ -90,7 +100,7 @@ export default {
 .container {
   height: calc(100vh - 100px);
   background: #fff;
-  overflow: auto;
+  overflow: hidden;
 }
 
 .tabs {
@@ -115,6 +125,9 @@ export default {
 }
 
 .content {
+  &.searchable {
+    height: calc(100% - 40px - 40px);
+  }
   height: calc(100% - 40px);
   box-sizing: border-box;
   padding: 20px;