cq
代码
var times= new Array ( ) ; ;
var day = new Date ( ) ;
var year = day. getFullYear ( ) + "-" ;
var mon = day. getMonth ( ) + 1 ;
var day = "-" + day. getDate ( ) ;
if ( mon < 10 ) {
mon = "0" + mon;
}
var nowTime = year + mon + day;
times. push ( nowTime)
$ ( "#time" ) . html ( nowTime)
var flag = true ;
layui. use ( 'laydate' , function ( ) {
var laydate = layui. laydate;
laydate. render ( {
elem: '#test28' ,
value: nowTime,
theme: '#0c74f6' ,
eventElem: '#iconTime' ,
trigger: 'click' ,
done: function ( value, date, endDate) {
var str = '<div class="span-toolbar-time"> ' +
'<div class="layui-input-inline">' +
'<span>' + value+ '</span>' +
'</div>' +
'<div class="layui-input-inline">' +
'<span class="removeclass"><i class="layui-icon">ဆ</i></span>' +
'</div>' +
'</div>' ;
times. push ( value) ;
$ ( "#timeSelect" ) . append ( str) ;
}
} ) ;
} ) ;
$ ( "body" ) . on ( 'click' , ".removeclass" , function ( ) {
var approvalName = $ ( this ) . parent ( ) . prev ( 'div.layui-input-inline' ) . children ( ) . val ( ) ;
var parentEle = $ ( this ) . parent ( ) . parent ( ) ;
var parentTime= parentEle[ 0 ] . innerText. substring ( 0 , 10 ) ;
var indexl= times. indexOf ( parentTime) ;
times. splice ( indexl, 1 ) ;
parentEle. remove ( ) ;
} ) ;
截图
konwleageBase
代码
$ ( function ( ) {
var ywgj = "" ;
var yygj = "" ;
var dbgj = "" ;
var url= "" ;
$. ajax ( {
type: "post" ,
url: ctx+ "knowledgeBase/dataItem" ,
data: {
type: "2"
} ,
dataType: "json" ,
success: function ( data) {
if ( serverUrl== '' || serverUrl== null ) {
layer. msg ( "诊断配置未配置" )
return ""
}
var result= data;
$. ajax ( {
type: "post" ,
url: ctx+ "knowledgeBase/getPicState" ,
dataType: "json" ,
success: function ( data) {
if ( data. picState!= 0 ) {
$. each ( result, function ( index, item) {
url= "/page/examine/knowledgeBase/images/" + item. EnglishName+ ".png"
if ( item. typeDetails == "1" ) {
ywgj += "<a href='" + serverUrl+ item. url+ "'><li style='width: 160px'><div class=\"img\"> <img src=" + url + " style=\"height:60px ;width=60px\"><div class=\"tool-text\">" + item. name+ "</div><div class=\"tool-text\">" + item. EnglishName+ "</div></div></li></a>"
} else if ( item. typeDetails == "2" ) {
yygj += "<a href='" + serverUrl+ item. url+ "'><li style='width: 160px'><div class=\"img\"> <img src=\"/page/examine/knowledgeBase/images/tool002.png\" style=\"height:60px ;width=60px\"/><div class=\"tool-text\" id=\"\">" + item. name+ "</div><div class=\"tool-text\">" + item. EnglishName+ "</div></div></li></a>"
} else {
dbgj += "<a href='" + serverUrl+ item. url+ "'><li style='width: 160px'><div class=\"img\"> <img src=\"/page/examine/knowledgeBase/images/tool003.png\" style=\"height:60px ;width=60px\"/><div class=\"tool-text\" id=\"\">" + item. name+ "</div><div class=\"tool-text\">" + item. EnglishName+ "</div></div></li></a>"
}
} )
$ ( "#ywgj" ) . html ( ywgj) ;
$ ( "#yygj" ) . html ( yygj) ;
$ ( "#dbgj" ) . html ( dbgj) ;
} else {
layer. msg ( "服务器离线" )
}
}
} )
}
} )
} )
private JSONArray getDetectionItems ( ) {
File file = new File (
Thread. currentThread ( ) . getContextClassLoader ( ) . getResource ( "/" ) . getPath ( ) + "tool.json" ) ;
String content = null ;
try {
content = FileUtils. readFileToString ( file, "UTF-8" ) ;
} catch ( IOException e) {
e. printStackTrace ( ) ;
}
JSONArray jsonArray = JSONArray. fromObject ( content) ;
return jsonArray;
}
截图