提交 eefd9ef5 编写于 作者: chengxiang.li's avatar chengxiang.li

bug fix

上级 a889b313
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
</div> </div>
<!-- 已选数量不能超过20个 提示 --> <!-- 已选数量不能超过20个 提示 -->
<div class="tips-wrap" @mousedown.prevent="preventDefault">
<el-dialog <el-dialog
title="提示" title="提示"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -82,10 +83,13 @@ ...@@ -82,10 +83,13 @@
center> center>
<span>最多只能选择20种疾病</span> <span>最多只能选择20种疾病</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="limitTipsVisible = false">我知道了</el-button> <!-- <el-button type="primary" >我知道了</el-button> -->
<div class="know-confirm" @mousedown.prevent="hideNumLimitTips" >我知道了</div>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -148,14 +152,26 @@ ...@@ -148,14 +152,26 @@
this.searchList = []; this.searchList = [];
this.searchInput = '' this.searchInput = ''
}, },
preventDefault() {
// console.log('prevent>>>>>>>>>>>>>>>>>>>')
},
hideNumLimitTips() {
this.limitTipsVisible = false;
},
isSearchLiSelected(item) { isSearchLiSelected(item) {
return this.hasItem(this.choosedList, item) > -1 ? true : false; return this.hasItem(this.choosedList, item) > -1 ? true : false;
}, },
handleSearchLiClick(item) { handleSearchLiClick(item) {
let hasIndex = this.hasItem(this.choosedList, item); let hasIndex = this.hasItem(this.choosedList, item);
if( hasIndex > -1 ){ if( hasIndex > -1 ){
this.choosedList.splice(hasIndex, 1); this.choosedList.splice(hasIndex, 1);
}else{ }else{
// 已选20个后,不能再添加,出Tips
if( this.choosedList && this.choosedList.length == 20 ){
this.limitTipsVisible = true;
return;
}
this.choosedList.push(item); this.choosedList.push(item);
} }
}, },
...@@ -205,6 +221,10 @@ ...@@ -205,6 +221,10 @@
that.totalPageNum = Math.ceil(res.data.total/that.pageSize); // 总页数 that.totalPageNum = Math.ceil(res.data.total/that.pageSize); // 总页数
let list = res.data.icdContentsList || []; let list = res.data.icdContentsList || [];
if(list.length > 0){ if(list.length > 0){
if(that.searchInput == ''){
that.searchList = [];
return;
}
that.searchList = list; that.searchList = list;
that.hasNoResult = false; that.hasNoResult = false;
}else{ }else{
...@@ -282,11 +302,16 @@ ...@@ -282,11 +302,16 @@
} }
}, },
handleEachCommonLiClick(item) { handleEachCommonLiClick(item) {
console.log('ddd', item); // console.log('ddd', item);
let hasIndex = this.hasItem(this.choosedList, item); let hasIndex = this.hasItem(this.choosedList, item);
if( hasIndex > -1 ){ if( hasIndex > -1 ){
this.choosedList.splice(hasIndex, 1); this.choosedList.splice(hasIndex, 1);
}else{ }else{
// 已选20个后,不能再添加,出Tips
if( this.choosedList && this.choosedList.length == 20 ){
this.limitTipsVisible = true;
return;
}
this.choosedList.push(item); this.choosedList.push(item);
} }
}, },
...@@ -523,6 +548,21 @@ ...@@ -523,6 +548,21 @@
text-align: center; text-align: center;
margin: 20px auto; margin: 20px auto;
} }
}
.tips-wrap {
.know-confirm{
width: 98px;
height: 40px;
background: #449284;
border-radius: 4px;
text-align: center;
line-height: 40px;
color: #FFF;
margin: 0 auto;
font-size: 14px;
cursor: pointer;
}
} }
} }
</style> </style>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册