7.17
This commit is contained in:
+126
-53
@@ -11,7 +11,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- <backNav :navName="'发病例交流帖'"></backNav> -->
|
||||
<view class="form">
|
||||
<scroll-view class="form" id="form" scroll-y="true">
|
||||
<view class="textbox">
|
||||
<up--textarea
|
||||
autoHeight
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="bottom">
|
||||
<view class="toolbox">
|
||||
<view
|
||||
@@ -131,7 +131,7 @@
|
||||
</view>
|
||||
<view class="bottombtn">
|
||||
<view class="left">
|
||||
<view class="draft" @click="showDraft = true">草稿箱</view>
|
||||
<view class="draft" @click="openDraftList">草稿箱</view>
|
||||
<view class="vote" @click="showVote = true">
|
||||
投票
|
||||
<up--image
|
||||
@@ -240,7 +240,18 @@
|
||||
><up-icon name="close" color="#4B5563" size="20"></up-icon
|
||||
></view>
|
||||
</view>
|
||||
<view class="draftlist">
|
||||
<view class="draftlist" v-if="draftList.length==0">
|
||||
<div class="nodata">
|
||||
<up-empty
|
||||
marginTop="120rpx"
|
||||
text="草稿箱为空"
|
||||
mode="list"
|
||||
:icon="draftImg"
|
||||
>
|
||||
</up-empty>
|
||||
</div>
|
||||
</view>
|
||||
<view class="draftlist" v-if="draftList.length>0">
|
||||
<view
|
||||
class="cell"
|
||||
v-for="(item, index) in draftList"
|
||||
@@ -254,7 +265,7 @@
|
||||
<view class="smalltitle">病例信息</view>
|
||||
<view
|
||||
class="con ellipsis-two-lines"
|
||||
v-html="item.exchange_content"
|
||||
v-html="fromatImg(item.exchange_content)"
|
||||
></view>
|
||||
</view>
|
||||
<view class="row" v-else-if="item.exchange_summary">
|
||||
@@ -264,7 +275,7 @@
|
||||
<view
|
||||
class="con ellipsis-two-lines"
|
||||
v-if="item.exchange_summary"
|
||||
v-html="item.exchange_summary"
|
||||
v-html="fromatImg(item.exchange_summary)"
|
||||
></view>
|
||||
</view>
|
||||
|
||||
@@ -380,8 +391,8 @@
|
||||
>
|
||||
<view class="right" @click="confirmCase">确定</view>
|
||||
</view>
|
||||
<view class="casecon">
|
||||
<view v-show="level == 1" >
|
||||
<scroll-view class="casecon" scroll-y="true">
|
||||
<view v-show="level == 1" calss="casePadding">
|
||||
<up-radio-group
|
||||
v-model="caseValue1"
|
||||
|
||||
@@ -401,7 +412,7 @@
|
||||
</view>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view v-show="level == 2" >
|
||||
<view v-show="level == 2" calss="casePadding">
|
||||
<up-radio-group
|
||||
v-model="caseValue2"
|
||||
iconPlacement="right"
|
||||
@@ -420,7 +431,7 @@
|
||||
</view>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view v-show="level == 3" >
|
||||
<view v-show="level == 3" calss="casePadding">
|
||||
<up-radio-group
|
||||
v-model="caseValue3"
|
||||
|
||||
@@ -429,7 +440,7 @@
|
||||
>
|
||||
<view
|
||||
class="column"
|
||||
v-for="item in labelObj.list2"
|
||||
v-for="item in labelObj.list3"
|
||||
:key="item.app_iden"
|
||||
>
|
||||
<up-radio
|
||||
@@ -440,7 +451,7 @@
|
||||
</view>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
@@ -451,6 +462,7 @@ import photoImg from "@/static/photo.png";
|
||||
import addImg from "@/static/add.png";
|
||||
import videoImg from "@/static/videoicon.png";
|
||||
import voteImg from "@/static/vote.png";
|
||||
import draftImg from "@/static/draft.png";
|
||||
import api from "@/api/api";
|
||||
import dayjs from "dayjs";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
@@ -503,7 +515,7 @@ const imgList = ref([]);
|
||||
const videoList = ref([]);
|
||||
const editorCtx = ref(null);
|
||||
const editorCtxResult = ref(null);
|
||||
const isFocusInfo = ref(true);
|
||||
const isFocusInfo = ref(false);
|
||||
const isFocusResult = ref(false);
|
||||
const labelList = ref([]);
|
||||
const goBack = () => {
|
||||
@@ -511,6 +523,11 @@ const goBack = () => {
|
||||
delta: 1,
|
||||
});
|
||||
};
|
||||
const openDraftList=()=>{
|
||||
|
||||
getDraftList();
|
||||
showDraft.value=true;
|
||||
}
|
||||
const closeCase = () => {
|
||||
showCase.value = false;
|
||||
};
|
||||
@@ -550,7 +567,7 @@ const clearVote = () => {
|
||||
form.case_exchange_vote.valid_day = 7;
|
||||
};
|
||||
const saveVote = () => {
|
||||
console.log(voteData);
|
||||
|
||||
if (voteData.vote_title == "") {
|
||||
uni.showToast({
|
||||
title: "请输入投票标题",
|
||||
@@ -573,30 +590,31 @@ const saveVote = () => {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < voteData.case_exchange_vote_option.length; i++) {
|
||||
if (voteData.case_exchange_vote_option[i].option_value == "") {
|
||||
uni.showToast({
|
||||
title: "投票选项不能为空",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (voteData.case_exchange_vote_option[i].option_value.length > 16) {
|
||||
uni.showToast({
|
||||
title: "第" + (i + 1) + "个投票选项超过16个字符",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (voteData.case_exchange_vote_option.length < 2) {
|
||||
uni.showToast({
|
||||
title: "至少添加两个选项",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
Object.assign(form.case_exchange_vote, voteData);
|
||||
// for (let i = 0; i < voteData.case_exchange_vote_option.length; i++) {
|
||||
// if (voteData.case_exchange_vote_option[i].option_value == "") {
|
||||
// uni.showToast({
|
||||
// title: "投票选项不能为空",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// if (voteData.case_exchange_vote_option[i].option_value.length > 16) {
|
||||
// uni.showToast({
|
||||
// title: "第" + (i + 1) + "个投票选项超过16个字符",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// if (voteData.case_exchange_vote_option.length < 2) {
|
||||
// uni.showToast({
|
||||
// title: "至少添加两个选项",
|
||||
// icon: "none",
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
//Object.assign(form.case_exchange_vote, voteData);
|
||||
form.case_exchange_vote=voteData
|
||||
showVote.value = false;
|
||||
};
|
||||
const fromatDay = (value) => {
|
||||
@@ -609,13 +627,29 @@ const fromatDay = (value) => {
|
||||
return dayjs(value).format("YYYY-MM-DD");
|
||||
}
|
||||
};
|
||||
|
||||
const fromatImg = (val) => {
|
||||
if(val){
|
||||
return val.replace(/\<img/gi, '<img class="imgstyle"');
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
|
||||
};
|
||||
const ready = (e) => {
|
||||
console.log(e);
|
||||
editorCtx.value = e;
|
||||
|
||||
let html =
|
||||
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
|
||||
editorCtx.value.initHtml(html);
|
||||
|
||||
// setTimeout(()=>{
|
||||
uni.hideKeyboard();
|
||||
uni.pageScrollTo({
|
||||
scrollTop:0,
|
||||
selector:"#form"
|
||||
// })
|
||||
})
|
||||
};
|
||||
const readyResult = (e) => {
|
||||
editorCtxResult.value = e;
|
||||
@@ -630,9 +664,16 @@ const focusInfo = () => {
|
||||
isFocusInfo.value = true;
|
||||
};
|
||||
const blurInfo = () => {
|
||||
setTimeout(() => {
|
||||
isFocusInfo.value = false;
|
||||
}, 2000)
|
||||
// #ifdef MP-WEIXIN
|
||||
isFocusInfo.value = false;
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
setTimeout(() => {
|
||||
isFocusInfo.value = false;
|
||||
}, 2000)
|
||||
|
||||
// #endif
|
||||
};
|
||||
const focusResult = () => {
|
||||
isFocusResult.value = true;
|
||||
@@ -691,7 +732,7 @@ const saveDraft = async () => {
|
||||
const res = await editorCtx.value.getLastContent();
|
||||
form.exchange_content = res.html;
|
||||
|
||||
const resResult = await editorCtx.value.getLastContent();
|
||||
const resResult = await editorCtxResult.value.getLastContent();
|
||||
form.exchange_summary = resResult.html;
|
||||
if(labelList.value.length>0){
|
||||
form.case_exchange_label = labelList.value;
|
||||
@@ -721,7 +762,7 @@ const editDraft = (index) => {
|
||||
labelList.value = exchange_label;
|
||||
form.exchange_summary = exchange_summary;
|
||||
form.case_exchange_vote = exchange_vote;
|
||||
editorCtxResult.value.initHtml(exchange_content);
|
||||
editorCtxResult.value.initHtml(exchange_summary);
|
||||
Object.assign(voteData, draft);
|
||||
showDraft.value = false;
|
||||
};
|
||||
@@ -732,6 +773,7 @@ const willDelDraft = (id) => {
|
||||
};
|
||||
const confirmDel = () => {
|
||||
showModal.value = false;
|
||||
console.log(delType.value);
|
||||
if (delType.value == "delDraft") {
|
||||
delDraft(delId.value);
|
||||
} else if (delType.value == "saveDraft") {
|
||||
@@ -758,14 +800,16 @@ const alertSave = async () => {
|
||||
goBack()
|
||||
}else{
|
||||
const res = await editorCtx.value.getLastContent();
|
||||
const initInfo =
|
||||
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p>";
|
||||
//let html = editorCtx.value.exportHtml(res.html);
|
||||
//const initInfo= "<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
|
||||
const resContent = await editorCtxResult.value.getLastContent();
|
||||
//let reshtml = editorCtxResult.value.exportHtml(resContent.html);
|
||||
if (
|
||||
form.exchange_title ||
|
||||
res.html ||
|
||||
resContent.html ||
|
||||
res.html!=initInfo ||
|
||||
resContent.text ||
|
||||
(form.case_exchange_vote &&
|
||||
form.case_exchange_vote.vote_title &&
|
||||
form.case_exchange_label &&
|
||||
@@ -781,7 +825,7 @@ const alertSave = async () => {
|
||||
};
|
||||
const publish = async () => {
|
||||
const initInfo =
|
||||
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p><br/><br/>";
|
||||
"<p>【患者信息】:</p><br/><p>【主诉】:</p><br/><p>【现病史及既往史】:</p><br/><p>【检查】:</p><br/><p>【临床诊断】:</p><br/><p>【治疗经过及结果】:</p>";
|
||||
if (form.exchange_title == "") {
|
||||
uni.showToast({
|
||||
title: "请输入标题",
|
||||
@@ -994,7 +1038,7 @@ const getDraftList = () => {
|
||||
};
|
||||
const getCaseLabel = (lev,pid=0) => {
|
||||
api.getCaseLabel({
|
||||
pid:pid
|
||||
pId:pid
|
||||
}).then((res) => {
|
||||
if (lev == 1) {
|
||||
labelObj.list1 = res.data.data;
|
||||
@@ -1078,7 +1122,7 @@ const openLabelPop=()=>{
|
||||
getCaseLabel(1,0);
|
||||
}
|
||||
onLoad(() => {
|
||||
getDraftList();
|
||||
//getDraftList();
|
||||
|
||||
});
|
||||
|
||||
@@ -1094,7 +1138,7 @@ onLoad(() => {
|
||||
.casepop{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: calc(100vh - 750rpx);
|
||||
max-height: calc(100vh - 400rpx);
|
||||
.continue{
|
||||
color: #2878ff !important;
|
||||
}
|
||||
@@ -1103,8 +1147,16 @@ onLoad(() => {
|
||||
flex:1;
|
||||
overflow-y: scroll;
|
||||
padding-top: 10rpx;
|
||||
max-height: calc(100vh - 700rpx);
|
||||
min-height: 350rpx;
|
||||
|
||||
padding-bottom: 20rpx;
|
||||
:deep(.u-radio){
|
||||
margin-bottom: 10px!important;
|
||||
margin-top: 0px!important;
|
||||
}
|
||||
.casePadding{
|
||||
padding-bottom: 0rpx;
|
||||
}
|
||||
.column {
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 2rpx solid #e5e7eb;
|
||||
@@ -1329,7 +1381,7 @@ onLoad(() => {
|
||||
}
|
||||
}
|
||||
#editor {
|
||||
padding: 0 30rpx;
|
||||
padding: 0 10rpx;
|
||||
height: calc(100vh - 700rpx);
|
||||
}
|
||||
#editorRes {
|
||||
@@ -1671,7 +1723,7 @@ onLoad(() => {
|
||||
|
||||
.sickbox {
|
||||
display: flex;
|
||||
padding: 25rpx 25rpx 0;
|
||||
padding: 25rpx 25rpx 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.add {
|
||||
@@ -1743,4 +1795,25 @@ onLoad(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.ql-container){
|
||||
padding-bottom: 25rpx;
|
||||
height: calc(100vh - 700rpx);
|
||||
}
|
||||
:deep(.ql-container) img{
|
||||
max-width:100%;
|
||||
position: relative;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
:deep(.ql-container) image{
|
||||
max-width:100%;
|
||||
position: relative;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.con {
|
||||
:deep(.imgstyle){
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user