|
@@ -2,90 +2,64 @@ require('./css/index.less');
|
|
|
const $ = require("jquery");
|
|
|
const {post,getUrlArgObject } = require('./js/util.js');
|
|
|
const {api} = require('./js/api.js');
|
|
|
-const emptyImg = require("./images/empty1.png");
|
|
|
-const nullImg = require("./images/null.png");
|
|
|
+const iconWarn = require("./images/icon_warn.png");
|
|
|
+const emptyImg = require("./images/empty.png");
|
|
|
|
|
|
let behospitalCode = getUrlArgObject("behospitalCode") ||''
|
|
|
let hospitalId = getUrlArgObject("hospitalId") ||''
|
|
|
let modeId = getUrlArgObject("modeId") || ''
|
|
|
|
|
|
-/*function setListHei(){
|
|
|
- $(".flawList").css({
|
|
|
- height:$(window).height()-90+'px'
|
|
|
- })
|
|
|
+function setListHei(){
|
|
|
+ $(".flawList").css({
|
|
|
+ height:$(window).height()-90+'px'
|
|
|
+ })
|
|
|
}
|
|
|
-setListHei()*/
|
|
|
+setListHei()
|
|
|
|
|
|
-function errorShow(){
|
|
|
- const str = `
|
|
|
- <div class="empty">
|
|
|
- <img class="emptyImg" src="${emptyImg}" />
|
|
|
- <div class="emptyTxt">抱歉,缺陷找不到了</div>
|
|
|
- </div>
|
|
|
- `;
|
|
|
- $('.flawList').html(str);
|
|
|
-}
|
|
|
|
|
|
function getFLawList(){
|
|
|
- post(api.analyzeRun,{behospitalCode:behospitalCode,hospitalId:hospitalId}).then(function(res){
|
|
|
- if(res.data.code==='0'){
|
|
|
- const data = res.data.data;
|
|
|
- renderFlawList(data||{})
|
|
|
- }else{
|
|
|
- errorShow();
|
|
|
- }
|
|
|
+ post(api.analyzeRun,{behospitalCode:behospitalCode,hospitalId:hospitalId, modeId:modeId}).then(function(res){
|
|
|
+ if(res.data.code==='0'){
|
|
|
+ const data = res.data.data&&res.data.data.msgDTOList;
|
|
|
+ renderFlawList(data)
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch(e =>{
|
|
|
|
|
|
- }).catch(e =>{
|
|
|
-
|
|
|
- });
|
|
|
+ });
|
|
|
};
|
|
|
getFLawList()
|
|
|
|
|
|
-function renderFlawList(data){
|
|
|
- let str = `<table>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>来源</th>
|
|
|
- <th>缺陷详情</th>
|
|
|
- <th width="105">扣分</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>`;
|
|
|
- const flawList = (data&&data.msgDTOList)||[];
|
|
|
- const {level,num,numScore, scoreRes}=data;
|
|
|
- for(let i = 0; i < flawList.length; i++){
|
|
|
- /*let flawItem = `<div class="flawItem">
|
|
|
- <span class="flawItemIconBox"><img class="flawItemIcon" src="${iconWarn}" /></span>
|
|
|
- <span class="flawItemMsgBox">${flawList[i].msg}${flawList[i].info ? "("+flawList[i].info + ")" :''}</span>
|
|
|
- <span class="flawItemScore fr">评分: <span class="flawItemNum">-${flawList[i].score}</span></span>
|
|
|
- </div>`*/
|
|
|
- let flawItem = `<tr class="flawItem">
|
|
|
- <td>${flawList[i].modelName}</td>
|
|
|
- <td><div class="flawItemMsgBox">${flawList[i].msg}${flawList[i].info ? "("+flawList[i].info + ")" :''}</div></td>
|
|
|
- <td class="flawItemScore"><span class="flawItemNum">${flawList[i].score}</span></td>
|
|
|
+function renderFlawList(flawList){
|
|
|
+ let str = `<table>`;
|
|
|
+ for(let i = 0; i < flawList.length; i++){
|
|
|
+ /*let flawItem = `<div class="flawItem">
|
|
|
+ <span class="flawItemIconBox"><img class="flawItemIcon" src="${iconWarn}" /></span>
|
|
|
+ <span class="flawItemMsgBox">${flawList[i].msg}${flawList[i].info ? "("+flawList[i].info + ")" :''}</span>
|
|
|
+ <span class="flawItemScore fr">评分: <span class="flawItemNum">-${flawList[i].score}</span></span>
|
|
|
+ </div>`*/
|
|
|
+ let flawItem = `<tr class="flawItem">
|
|
|
+ <td><div class="flawItemMsgBox"><img class="flawItemIcon" src="${iconWarn}" />${flawList[i].msg}${flawList[i].info ? "("+flawList[i].info + ")" :''}</div></td>
|
|
|
+ <td class="flawItemScore">评分: <span class="flawItemNum">-${flawList[i].score}</span></td>
|
|
|
</tr>`;
|
|
|
- str += flawItem;
|
|
|
-
|
|
|
- }
|
|
|
- str+="</tbody></table>";
|
|
|
- if(flawList===null||flawList.length === 0){
|
|
|
- str = `
|
|
|
+ str += flawItem;
|
|
|
+
|
|
|
+ }
|
|
|
+ str+="</table>";
|
|
|
+ if(flawList.length === 0){
|
|
|
+ str = `
|
|
|
<div class="empty">
|
|
|
- <img class="emptyImg" src="${nullImg}" />
|
|
|
- <div class="emptyTxt">恭喜您,病历未发现缺陷</div>
|
|
|
+ <img class="emptyImg" src="${emptyImg}" />
|
|
|
+ <div class="emptyTxt">暂无缺陷~</div>
|
|
|
</div>
|
|
|
`;
|
|
|
- /*$('.flawList').html(str);
|
|
|
- return;*/
|
|
|
- }
|
|
|
- $("#level").text(level);
|
|
|
- $("#score").text(scoreRes);
|
|
|
- $("#num").text(num);
|
|
|
- $("#flawMark").text(numScore);
|
|
|
- $(".sum-box").show();
|
|
|
-
|
|
|
- $('.flawList').html(str);
|
|
|
- replaceSrc();
|
|
|
+ }
|
|
|
+ $('.flawList').html(str);
|
|
|
+ replaceSrc();
|
|
|
+ $('.flawNum').html(flawList.length)
|
|
|
}
|
|
|
function replaceSrc(){
|
|
|
var browser=navigator.appName;
|
|
@@ -101,3 +75,7 @@ function replaceSrc(){
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+$(window).on("resize", function(){
|
|
|
+ setListHei()
|
|
|
+})
|