(function(m){
|
var Fun_docshowattr={
|
getDocInfo:function(){
|
m.ajax({
|
url:interaddress+ "ND/UnShare",
|
data:{catid:JSON.stringify(c),docid:JSON.stringify(d)},
|
crossDomain: true, //强制使用5+跨域
|
dataType:'json',//服务器返回json格式数据
|
type:'post',//HTTP请求类型
|
timeout:10000,//超时时间设置为10秒;
|
success:function(data){
|
|
},
|
error:function(xhr,type,errorThrown){
|
//异常处理
|
alert(type);
|
}
|
})
|
},
|
|
|
openinfo_istime:function (data) {
|
var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
|
var req = data.match(reg);
|
if (req == null)
|
return false;
|
return true;
|
},
|
openinfo_formatter_ttime:function (cellvalue) {
|
var cv_o = cellvalue.split(' ')[0];
|
|
var cv_t = cellvalue.split(' ')[1];
|
|
var date = new Date();
|
var time = cv_o;
|
var h_m = "";
|
if (cv_t)
|
h_m = cv_t.split(':')[0] + ':' + cv_t.split(':')[1];
|
if (cv_o.split('-').length == 3)
|
if (date.getFullYear() == cv_o.split('-')[0]) {
|
time = cv_o.split('-')[1] + '-' + cv_o.split('-')[2];
|
if (date.getMonth() + 1 == cv_o.split('-')[1]) {
|
if (date.getDate() == cv_o.split('-')[2])
|
time = "今天";
|
if (date.getDate() - 1 == cv_o.split('-')[2])
|
time = '昨天';
|
if (date.getDate() - 2 == cv_o.split('-')[2])
|
time = '前天';
|
}
|
}
|
return time + " " + h_m;
|
}
|
}
|
})(mui);
|