success:function(data){
var dataObj = JSON.parse(data);
var tanchuHtml = "";
for (var i = 0; i < dataObj.R.length; i++) {
dataObj.RADDIAGNOSIS = dataObj.R[i].RADDIAGNOSIS;//变量相等
dataObj.RADMANIFEA = dataObj.R[i].RADMANIFEA;//变量相等
//替换[?]为__
if (dataObj.R[i].RADMANIFEA.indexOf('[?]×[?]' || '[?]') > 0 || dataObj.R[i].RADDIAGNOSIS.indexOf('[?]×[?]' || '[?]') > 0) {
//a.1
aRADMANIFEA = dataObj.R[i].RADMANIFEA.replace(/([?])/g,'__');
var bRADMANIFEA = aRADMANIFEA.replace(/[|]/g,"");
dataObj.RADMANIFEA = bRADMANIFEA.replace(/__/g,'<input class="keyinput" maxlength="4" type="number" style="30px;border:0;border-bottom:1px solid #ccc;">');
//b.1
aRADDIAGNOSIS = dataObj.R[i].RADDIAGNOSIS.replace(/([?])/g,'__');
var bRADDIAGNOSIS = aRADDIAGNOSIS.replace(/[|]/g,"");
dataObj.RADDIAGNOSIS = bRADDIAGNOSIS.replace(/__/g,'<input class="keyinput" maxlength="4" type="number" style="30px;border:0;border-bottom:1px solid #ccc;">');
}
//替换{右侧|左侧|双侧}为对应下拉框
if(dataObj.R[i].RADMANIFEA.indexOf('}') > 0 || dataObj.R[i].RADDIAGNOSIS.indexOf('}') > 0) {
var str = dataObj.RADMANIFEA;
var str2 = dataObj.RADDIAGNOSIS;
var thisId = 0;//默认从0开始
//a.2
var result = str.replace(/[^{)]+(?=})/g, function(item){
thisId++;//动态累加
var itemResult = '<select class="+'class'+thisId+" onchange="change(this);">';
var selectData = item.split("|");
$.each(selectData,function(i,v){
itemResult+="<option value='"+v+"'>"+v+"</option>";
})
itemResult+="</select>"
return itemResult;
});//替换下拉框
dselect = result.replace(/({)/g,'');//去除{
dataselect = dselect.replace(/(})/g,'');//去除}
//b.2
var result2 = str2.replace(/[^{)]+(?=})/g, function(item){
thisId++;
var itemResult2 = '<select class="+'class'+thisId+" onchange="change(this);">';
var selectData2 = item.split("|");
$.each(selectData2,function(i,v){
itemResult2+="<option>"+v+"</option>";
})
itemResult2+="</select>"
return itemResult2;
});
dselect2 = result2.replace(/({)/g,'');
dataselect2 = dselect2.replace(/(})/g,'');
dataObj.RADDIAGNOSIS = dataselect2;//各自赋值
dataObj.RADMANIFEA = dataselect;//各自赋值
}
tanchuHtml += '<div class="tanchu_p"><h5>影像学表现:</h5><div><input class="ainput" type="checkbox" checked="checked"><p class="img_one">'+dataObj.RADDIAGNOSIS+'</p></div></div>'
tanchuHtml += '<div class="tanchu_p"><h5>影像学意见:</h5><div><input class="ainput" type="checkbox" checked="checked"><p class="img_two">'+dataObj.RADMANIFEA+'</p></div></div>'
$('.tanchuAll').html(tanchuHtml);
};
var top=($(window).height()-$(".tanchu").height())/2;//让其弹出层在中间显示
var left=($(window).width()-$(".tanchu").width())/2-128;//让其弹出层在中间显示
var scrollTop=$(document).scrollTop();
var scrollLeft=$(document).scrollLeft();
$(".tanchu").css({position:'absolute', 'top':top + scrollTop, 'left':left + scrollLeft}).stop().fadeIn()//弹出层显示
$(".mask").show();//遮罩层显示
$('body').addClass('current_body');
},