|
@@ -29,8 +29,8 @@
|
|
|
class="symp"
|
|
|
v-for="(it,ind) in symp"
|
|
|
:key="it.conceptId"
|
|
|
- @touchstart.prevent="touchstart(it)"
|
|
|
- @touchend.prevent="touchend(it)"
|
|
|
+ @touchstart.prevent="touchstart(it,ind)"
|
|
|
+ @touchend.prevent="touchend(it,ind)"
|
|
|
>{{it.description || it.name}}</span>
|
|
|
</div>
|
|
|
<p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明 <span @click="slideToggle" v-show="slide">{{slideTxt}}</span></p>
|
|
@@ -41,7 +41,12 @@
|
|
|
>
|
|
|
<p class="title"><span class="line"></span>{{nameStr}}</p>
|
|
|
<div class="bgResult">
|
|
|
- <p v-for="(value,index) in checkText">{{value.textP}}</p>
|
|
|
+ <template v-for="(value,index) in checkText">
|
|
|
+ <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
|
|
|
+ <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
|
|
|
+ <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
|
|
|
+ <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -116,7 +121,8 @@ export default {
|
|
|
start:{},
|
|
|
end:{},
|
|
|
slide:false,
|
|
|
- slideTxt:'展开'
|
|
|
+ slideTxt:'展开',
|
|
|
+ staticSymp:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -141,7 +147,9 @@ export default {
|
|
|
handler(newVal,oldVal){
|
|
|
const sympText = this.getSympText();
|
|
|
if(sympText){
|
|
|
- this.getPush(sympText);
|
|
|
+ if(this.chooseSymp.length>1){
|
|
|
+ this.getPush(sympText);
|
|
|
+ }
|
|
|
this.quesText = "请问您还有其他不适吗?";
|
|
|
}else{
|
|
|
this.getSympList();
|
|
@@ -170,6 +178,9 @@ export default {
|
|
|
}
|
|
|
let endTime = +new Date();
|
|
|
if(endTime - this.startTime < 500){//点击事件
|
|
|
+ if(this.chooseSymp.length == 0){
|
|
|
+ item.idx = 1
|
|
|
+ }
|
|
|
this.common(item,flg);
|
|
|
this.slideTxt = '展开'
|
|
|
}
|
|
@@ -189,7 +200,6 @@ export default {
|
|
|
that.message.title = "";
|
|
|
that.message.text = "暂无资料";
|
|
|
}
|
|
|
-
|
|
|
},600)
|
|
|
},
|
|
|
closeTip(){
|
|
@@ -235,11 +245,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
common(item,flg){
|
|
|
+ if(this.chooseSymp.length>12){
|
|
|
+ this.$store.commit('setSearchShow', false);
|
|
|
+ return
|
|
|
+ }
|
|
|
this.questId = item.questionId || item.id || item.conceptId;
|
|
|
const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
|
|
|
//将选中的name存到store中的text
|
|
|
- this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId });
|
|
|
- if (id) {
|
|
|
+ if (id&&this.chooseSymp.length == 0) {//只有第一次
|
|
|
const param = {
|
|
|
"age": this.age,
|
|
|
"id": id,
|
|
@@ -252,24 +265,44 @@ export default {
|
|
|
this.labelDetail = result.data;
|
|
|
if(this.chooseSymp.length == 0){
|
|
|
result.data.idx = 1
|
|
|
+ this.$store.commit('setText', { type: moduleCP['symp'], text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name), pId: this.questId,idx:flg });
|
|
|
+ }else{
|
|
|
+ this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId,idx:flg });
|
|
|
}
|
|
|
this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
|
|
|
if (mapping && mapping.length > 0) {
|
|
|
- this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
|
|
|
- if(flg){
|
|
|
- return
|
|
|
+ for(let i = 0;i < mapping.length;i++){
|
|
|
+ if(mapping[i].flag == 3){
|
|
|
+ this.staticSymp = mapping[i].questionDetailList
|
|
|
+ }
|
|
|
}
|
|
|
+ this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
|
|
|
this.$store.commit('setSearchShow', false);
|
|
|
this.chooseSymp.push(item);
|
|
|
} else {
|
|
|
this.chooseSymp.push(item);
|
|
|
this.$store.commit('setSearchShow', false);
|
|
|
}
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
+ }
|
|
|
+ }).catch(()=>{
|
|
|
+ if(this.chooseSymp.length == 1){
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
}
|
|
|
})
|
|
|
} else {//没有questionId或id
|
|
|
+ if(this.chooseSymp.length == 0){
|
|
|
+ item.idx = 1
|
|
|
+ this.$store.commit('setText', { type: moduleCP['symp'], text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name), pId: this.questId,idx:flg });
|
|
|
+ }else{
|
|
|
+ this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId,idx:flg });
|
|
|
+ }
|
|
|
this.chooseSymp.push(item);
|
|
|
- this.checkText = this.$store.state.symptom.text;
|
|
|
+ const sympText = this.getSympText();
|
|
|
+ this.getPush(sympText);
|
|
|
+ // this.checkText = this.$store.state.symptom.text;
|
|
|
}
|
|
|
},
|
|
|
showDetil(item,flg) {//搜索点开的详情
|
|
@@ -297,9 +330,30 @@ export default {
|
|
|
api.getPush(param).then((res) => {
|
|
|
const result = res.data;
|
|
|
if (result.code == 0) {
|
|
|
- this.symp = result.data.symptom;
|
|
|
+ let symp = result.data.symptom;
|
|
|
+ let symped = JSON.parse(JSON.stringify(this.chooseSymp));//已选症状
|
|
|
+ let sympStic = JSON.parse(JSON.stringify(this.staticSymp));//首次有无症状
|
|
|
+ let sympAll = sympStic.concat(symp);
|
|
|
+ var obj = {};
|
|
|
+ sympAll = sympAll.reduce(function(item, next) {
|
|
|
+ obj[next.name] ? '' : obj[next.name] = true && item.push(next);
|
|
|
+ return item;
|
|
|
+ }, []);
|
|
|
+ // console.log(sympAll,symped)
|
|
|
+ for(let i = 0;i < sympAll.length;i++){//去掉已选的已选症状
|
|
|
+ for(let j = 0;j < symped.length;j++){//去掉
|
|
|
+ if(symped[j].name == sympAll[i].name){
|
|
|
+ sympAll.splice(i,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.symp = sympAll.slice(0,12);
|
|
|
+ // this.symp = symp;
|
|
|
this.$refs.showHide.style.height = 'auto'
|
|
|
}
|
|
|
+ }).catch(()=>{
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
deletSymp(item, index) {
|