Browse Source

添加诊断结果图像检测和相似病例查询

lyn7568 5 years ago
parent
commit
738f97c7f0

+ 2 - 1
src/api/api.js

@ -30,4 +30,5 @@ export const pageTaskOne = '/ajax/task/qo'
30 30
export const taskResult = '/ajax/task/result/'
31 31
export const uploadTask = '/ajax/task/upload'
32 32
export const newTask = '/ajax/task/new'
33
export const pageRelateTask = '/ajax/task/relate'
33
export const pageRelateSearchTask = '/ajax/task/searchTxt'
34
export const pageRelateImageTask = '/ajax/task/searchJpg'

+ 2 - 2
src/views/diagnosticLog/index.vue

@ -14,7 +14,7 @@
14 14
              v-model="selectMode"
15 15
              @change="selectChange">
16 16
              <el-option label="全部诊断疾病" value="" selected></el-option>
17
              <el-option label="先心病房缺" value="1"></el-option>
17
              <el-option label="先天性心脏病房间隔缺损" value="1"></el-option>
18 18
            </el-select>
19 19
            <el-button type="primary" @click="pageQueryList">搜索</el-button>
20 20
            <el-button type="primary" @click="refreshList" plain>刷新列表</el-button>
@ -170,7 +170,7 @@ export default {
170 170
                obj[i].stateMsg = stateMsg(obj[i].state)
171 171
              }
172 172
              if (obj[i].taskType === 1) {
173
                obj[i].taskType = '先心病房缺'
173
                obj[i].taskType = '先天性心脏病房间隔缺损'
174 174
              }
175 175
            }
176 176
          }

+ 132 - 26
src/views/diagnosticLog/resultShow.vue

@ -37,7 +37,7 @@
37 37
                  <el-row :gutter="20" v-if="tableResult && tableResult.length>0">
38 38
                    <el-col :span="6" v-for="item in tableResult" :key="item.index">
39 39
                      <div class="res-pic">
40
                        <img class="res-pic" :src="item.img" :alt="item.img || '图片缺失'" />
40
                        <img class="res-pic" :src="item.img" :onerror="imgerror" />
41 41
                      </div>
42 42
                      <p class="res-word" :style="item.text === '文件缺失' ? 'color: #F56C6C': ''">{{item.text}}</p>
43 43
                    </el-col>
@ -50,21 +50,41 @@
50 50
        </div>
51 51
      </div>
52 52
    </el-card>
53
    <!-- <el-card style="margin-top:10px">
54
      <div slot="header">
55
        <span @click="queryRelateInfo">查看相似病例>></span>
56
      </div>
57
      <div class="box-content" v-loading="relateLoading" element-loading-text="查找中...">
58
        <div class="box-main">
59
          <el-carousel :interval="5000" arrow="always" v-if="relateData.length">
60
            <el-carousel-item v-for="item in relateData" :key="item">
61
              <img :src="item" :alt="item || '病例文件缺失'" width="100%">
62
            </el-carousel-item>
63
          </el-carousel>
64
          <span v-else style="color:#F56C6C">未发现相似病例</span>
53
    <el-tabs type="border-card" class="box-card-2" v-model="activeName" @tab-click="handelTabTurn">
54
      <el-tab-pane label="搜索相似诊断" name="first">
55
        <el-input placeholder="请输入诊断结果" @keyup.enter.native="queryRelateInfo" v-model="searchInput" class="input-with-select">
56
          <el-button slot="append" icon="el-icon-search" @click.native="queryRelateInfo"></el-button>
57
        </el-input>
58
        <div class="box-content" v-loading="relateLoading" element-loading-text="查找中...">
59
          <div class="box-main">
60
            <el-carousel :interval="5000" arrow="always" :autoplay="false" v-if="relateData.length">
61
              <el-carousel-item v-for="(item,index) in relateData" :key="item">
62
                <div class="res-pic">
63
                  <img :src="item" :onerror="imgerror">
64
                </div>
65
                <p class="res-txt">{{index+1}}/{{relateData.length}}</p>
66
              </el-carousel-item>
67
            </el-carousel>
68
            <span v-if="!relateData.length && ifSearchedText" class="no-data-text">未发现相似病例</span>
69
          </div>
65 70
        </div>
66
      </div>
67
    </el-card> -->
71
      </el-tab-pane>
72
      <el-tab-pane label="比对相似影像" name="second">
73
        <div class="box-content" v-loading="relateVideoLoading" element-loading-text="查找中...">
74
          <div class="box-main">
75
            <el-carousel :interval="5000" arrow="always" :autoplay="false" v-if="relateVideoData.length">
76
              <el-carousel-item v-for="(item,index) in relateVideoData" :key="item">
77
                <div class="res-pic">
78
                  <img :src="item" :onerror="imgerror">
79
                </div>
80
                <p class="res-txt">{{index+1}}/{{relateVideoData.length}}</p>
81
              </el-carousel-item>
82
            </el-carousel>
83
            <span v-if="!relateVideoData.length && ifSearchedJpg" class="no-data-text">未发现相似病例</span>
84
          </div>
85
        </div>
86
      </el-tab-pane>
87
    </el-tabs>
68 88
    <PicPreview v-if="tableResult && tableResult.length>0" ref="PicPreview" :previewList="tableResult"></PicPreview>
69 89
  </div>
70 90
</template>
@ -72,7 +92,7 @@
72 92
<script>
73 93
import axios from 'axios'
74 94
import queryBase from '@/utils/queryBase'
75
import { taskResult, pageTaskOne, pageRelateTask } from '@/api/api'
95
import { taskResult, pageTaskOne, pageRelateSearchTask, pageRelateImageTask } from '@/api/api'
76 96
import { urlParse, parseTime } from '@/utils'
77 97
import '@/styles/roleuser.scss'
78 98
import PicPreview from '@/components/PicturePreview'
@ -80,12 +100,20 @@ import PicPreview from '@/components/PicturePreview'
80 100
export default {
81 101
  data() {
82 102
    return {
103
      activeName: 'first',
83 104
      tableData: {},
84 105
      tableResult: [],
85 106
      tableLoading: false,
86 107
      relateData: [],
87 108
      relateLoading: false,
88
      resultId: ''
109
      relateVideoData: [],
110
      relateVideoLoading: false,
111
      resultId: '',
112
      searchInput: '',
113
      ifSearchImage: true,
114
      ifSearchedText: false,
115
      ifSearchedJpg: false,
116
      imgerror: "this.src='/static/no-data-pic.png';this.onerror=null"
89 117
    }
90 118
  },
91 119
  components: {
@ -95,7 +123,6 @@ export default {
95 123
    this.resultId = urlParse('id')
96 124
    this.queryTaskCon()
97 125
    this.queryResultCon()
98
    // this.queryRelateInfo()
99 126
  },
100 127
  methods: {
101 128
    queryTaskCon() {
@ -114,7 +141,7 @@ export default {
114 141
            obj.modifyTime = parseTime(obj.modifyTime)
115 142
          }
116 143
          if (obj.taskType === 1) {
117
            obj.taskType = '先心病房缺'
144
            obj.taskType = '先天性心脏病房间隔缺损'
118 145
          }
119 146
          queryBase.getUserBase(obj.uid, function(sc, value) {
120 147
            if (sc) {
@ -187,19 +214,57 @@ export default {
187 214
    },
188 215
    queryRelateInfo() {
189 216
      var that = this
217
      if (!that.searchInput) {
218
        return
219
      }
190 220
      that.relateLoading = true
191
      that.$http.get(pageRelateTask, {
192
        dataNum: that.searchText,
193
        taskType: that.selectMode,
194
        pageSize: that.pageSize,
195
        pageNo: that.pageNo
221
      that.$http.get(pageRelateSearchTask, {
222
        txt: that.searchInput,
223
        id: that.resultId
196 224
      }, function(res) {
197 225
        that.relateLoading = false
198
        if (res.success && res.data) {
199
          const obj = res.data.data
226
        if (res.success) {
227
          const obj = res.data
228
          if (obj.length > 0) {
229
            var url = '/task/searchTxt/result/'
230
            for (let i = 0; i < obj.length; ++i) {
231
              var index = obj[i].lastIndexOf('\/')
232
              obj[i] = url + obj[i].substring(index + 1, obj[i].length)
233
            }
234
          }
200 235
          that.relateData = obj
236
          that.ifSearchedText = true
201 237
        }
202 238
      })
239
    },
240
    queryRelateVideoInfo() {
241
      var that = this
242
      that.relateVideoLoading = true
243
      that.$http.get(pageRelateImageTask, {
244
        id: that.resultId
245
      }, function(res) {
246
        that.relateVideoLoading = false
247
        if (res.success) {
248
          const obj = res.data
249
          if (obj.length > 0) {
250
            var url = '/task/searchJpg/result/'
251
            for (let i = 0; i < obj.length; ++i) {
252
              var index = obj[i].lastIndexOf('\/')
253
              obj[i] = url + obj[i].substring(index + 1, obj[i].length)
254
            }
255
          }
256
          that.relateVideoData = obj
257
          that.ifSearchedJpg = true
258
        }
259
      })
260
    },
261
    handelTabTurn(tab, event) {
262
      if (this.activeName === 'second') {
263
        if (this.ifSearchImage) {
264
          this.queryRelateVideoInfo()
265
          this.ifSearchImage = false
266
        }
267
      }
203 268
    }
204 269
  }
205 270
}
@ -246,5 +311,46 @@ export default {
246 311
      }
247 312
    }
248 313
  }
314
  .box-card-2{
315
    margin-top:20px;
316
    .box-main{
317
      min-height: 100px;
318
      .el-carousel{
319
        margin-top:10px;
320
      }
321
      .el-carousel__item{
322
        background: #d3dce6
323
      }
324
      .res-pic{
325
        display: flex;
326
        align-items: center;
327
        justify-content: center;
328
        box-sizing:border-box;
329
        width:100%;
330
        height:302px;
331
        border-radius: 4px;
332
        background-size:cover;
333
        background-position: center center;
334
        img{
335
          max-width: 100%;
336
          max-height: 100%;
337
        }
338
      }
339
      .res-txt{
340
        position: absolute;
341
        bottom: 0;
342
        left: 0;
343
        right: 0;
344
        text-align: center;
345
      }
346
    }
347
  }
348
  .no-data-text{
349
    display: block;
350
    padding: 8% 40px;
351
    color:#F56C6C;
352
    text-align: center;
353
    font-size: 14px;
354
  }
249 355
}
250 356
</style>

+ 2 - 2
src/views/diagnosticLog/startDiag.1.vue

@ -74,11 +74,11 @@
74 74
        dataBh: '',
75 75
        multipleSelection: [],
76 76
        tableResult: [{
77
          type: '先心病房缺(先天性心脏病房间隔缺损)',
77
          type: '先天性心脏病房间隔缺损',
78 78
          check: 1,
79 79
          dis: 1
80 80
        }, {
81
          type: '先心病室缺(先天性心脏病间隔缺损)',
81
          type: '先天性心脏病间隔缺损',
82 82
          check: 0,
83 83
          dis: 0
84 84
        }, {

+ 1 - 1
src/views/diagnosticLog/startDiag.vue

@ -69,7 +69,7 @@
69 69
        multipleSelection: [],
70 70
        fileMutList: [],
71 71
        tableResult: [{
72
          type: '先(房间隔缺损)',
72
          type: '先天性心脏病房间隔缺损',
73 73
          check: 1,
74 74
          dis: 1
75 75
        }, {

BIN
static/no-data-pic.png