var contend = "";
var picVal = "";
var editorOption = {
//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
toolbars: [[
'undo', //撤销
'redo', //重做
'bold', //加粗
'indent', //首行缩进
//'snapscreen', //截图
'italic', //斜体
'underline', //下划线
// 'strikethrough', //删除线
'subscript', //下标
'fontborder', //字符边框
'superscript', //上标
'formatmatch', //格式刷
// 'blockquote', //引用
'pasteplain', //纯文本粘贴模式
'selectall', //全选
// 'print', //打印
'insertcode', //代码语言
'fontfamily', //字体
'fontsize', //字号
'paragraph', //段落格式
'simpleupload', //单图上传
'insertimage', //多图上传
'edittable', //表格属性
'edittd', //单元格属性
'link', //超链接
//'emotion', //表情
'spechars', //特殊字符
'searchreplace', //查询替换
'horizontal', //分隔线
'removeformat', //清除格式
'justifyleft', //居左对齐
'justifyright', //居右对齐
'justifycenter', //居中对齐
'justifyjustify', //两端对齐
'forecolor', //字体颜色
'backcolor', //背景色
'insertorderedlist', //有序列表
'insertunorderedlist', //无序列表
'fullscreen', //全屏
'directionalityltr', //从左向右输入
'directionalityrtl', //从右向左输入
'rowspacingtop', //段前距
'rowspacingbottom', //段后距
'time', //时间
'date', //日期
'unlink', //取消链接
//'anchor', //锚点
'simpleupload', //单图上传
//'insertimage', //多图上传
'edittable', //表格属性
'touppercase', //字母大写
'tolowercase', //字母小写
'imagecenter', //居中
//'wordimage', //图片转存
'edittip ', //编辑提示
'charts' // 图表
// 'help' //帮助
]],
//focus时自动清空初始化时的内容
autoClearinitialContent: true,
//关闭elementPath
elementPathEnabled: false,
scaleEnabled:true
};
//点击了编辑之后才能上传1可以,0不能
var uploadFlag = 0;
$(function(){
Commonjs.getJscrollpane.destroy();
$("#cancel").hide();
$('#datetimepicker1,#datetimepicker2').datetimepicker({
yearOffset:0,
lang:'ch',
timepicker:false,
format:'d/m/Y',
formatDate:'Y/m/d',
minDate:'-1970/01/02', // yesterday is minimum date
maxDate:'+1970/01/02' // and tommorow is maximum date calendar
});
$('#layer').click(function(){
var artBox=art.dialog({
lock: true,
icon:'question',
opacity:0.4,
width: 250,
title:'提示',
content: '页面模板会覆盖编辑区域已有组件,是否继续?',
ok: function () {
},
cancel: true
});
});
initImage();
function rightBox (){
$('.doctor-info-fl table.table-form').width($('.container-wrap .scroll-pane').outerWidth(true)-281-40);
$('.doctor-info-fr').height($(window).height()-$('.doctor-info-top').outerHeight(true)-111);
}
rightBox ();
var doctorScroll=$('.doctor-scroll-pane').height($(window).height()-$('.doctor-info-top').outerHeight(true)-111).jScrollPane({"autoReinitialise": true}).data('jsp');
$(window).resize(function(){
Commonjs.getJscrollpane.destroy();
Throttle(rightBox(),50,30);
var doctorScroll=$('.doctor-scroll-pane').height($(window).height()-$('.doctor-info-top').outerHeight(true)-111).jScrollPane({"autoReinitialise": true});
});
$('#cancel').on('click',function(){
uploadFlag = 0;
var $input=$('.table-input'),
$textarea=$('.table-textarea'),
$btn=$('#edit-btns');
$("#showBrief").hide();
$("#showInfo").html(contend);
$("#showInfo").show();
for(var i=0; i<$input.length; i++){
$input.eq(i).html($input.eq(i).find('input').val());
}
for(var j=0; j<$textarea.length; j++){
$textarea.eq(j).html($textarea.eq(j).find('textarea').val());
}
$btn.text('编辑').removeClass('edityes');
$(this).hide();
$("#hosLevel").hide();
$("#_hoslevel").show();
$("#tempImg").show();
$("#updateSmallImg").hide();
});
$('#edit-btns').on('click',function(){
uploadFlag = 1;
$("#cancel").hide();
var $input=$('.table-input'),
$textarea=$('.table-textarea'),
$btn=$(this);
$('.doctor-table-box').toggleClass('table-text');
$("#showBrief").show();
$("#showInfo").hide();
// $("#pic").attr("style","height:600px;position:fixed;top:100px");
$("#tempImg").show();
$("#updateSmallImg").hide();
if($(this).hasClass('edityes')){
$("#hosLevel").hide();
$("#_hoslevel").show();
$("#cancel").hide();
$("#showBrief").hide();
//$("#showInfo").text(UE.getEditor('editor').getContent());
$("#showInfo").show();
$btn.text('编辑').removeClass('edityes');
for(var i=0; i<$input.length; i++){
$input.eq(i).html($input.eq(i).find('input').val());
}
for(var j=0; j<$textarea.length; j++){
$textarea.eq(j).html($textarea.eq(j).find('textarea').val());
}
var temX = clearNoNum($("#hosX").html());
var temY =clearNoNum($("#hosY").html());
if(temX != $("#hosX").html() ){
art.dialog({
lock: true,
width: '300px',
height: '100px',
time: 3,
content: '经度,纬度请输入数字与小数点'
});
return false;
}
if(temY != $("#hosY").html() ){
art.dialog({
lock: true,
width: '300px',
height: '100px',
time: 3,
content: '经度,纬度输入数字与小数点'
});
return false;
}
var Service = {};
var page = {};
var code = 1012;
//alert("");
Service.HosRoute = $("#hosRoute").html();
Service.HosId = Commonjs.hospitalId;
Service.HosBrief = escape(UE.getEditor('editor').getContent());
Service.Address =$("#hosAddr").html();
Service.Level =$("#hosLevel").val();
Service.LevelName =$("#hosLevel").find("option:selected").text();
Service.HosName =$("#hosName").html();
//Service.Remark =$("#hosRemark").html();
Service.CoordinateX =clearNoNum($("#hosX").html());
Service.CoordinateY =clearNoNum($("#hosY").html());
Service.Province =$("#hosProvince").html();
Service.Tel =$("#hosTel").html();
Service.PhotoUrl ="";
var param = {};
var params = Commonjs.getParams(code,Service);//获取参数
param.Api = "UpdateHospital";
param.Params = Commonjs.jsonToString(params);
var d = Commonjs.ajax('./basic_callBasicApi.do',param,false);
if(d.RespCode == '10000'){
art.dialog({
lock: true,
width: '300px',
height: '100px',
time: 3,
content: d.RespMessage
});
}else{
art.dialog({
lock: true,
width: '300px',
height: '100px',
time: 3,
content: d.RespMessage
});
}
$("#editor").remove();
hospital.findData();
}else{
$("#tempImg").hide();
$("#updateSmallImg").show();
$("#hosLevel").show();
$("#_hoslevel").hide();
$("#cancel").show();
// $("#pic").attr("style","position:fixed;top:100px;height:500px;");
$btn.text('保存').addClass('edityes');
for(var i=0; i<$input.length; i++){
$input.eq(i).html($input.eq(i).find('textarea').val());
$input.eq(i).html('');
if($input.eq(i).hasClass('map')){
$('').appendTo($input.eq(i));
}
if($input.eq(i).hasClass('ask')){
$('