@ -572,8 +572,10 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
if ( obj . value == "2" || obj . value == "1" ) {
if ( ! $ . isEmpty ( resourcesInfoShowTable ) || ! $ . isEmpty ( resourcesInfoShowPPTTable ) ) {
resourcesInfoShowTable . reload ( { data : [ ] } ) ;
resourcesInfoShowPPTTable . reload ( { data : [ ] } ) ;
/ * r e s o u r c e s I n f o S h o w T a b l e . r e l o a d ( { d a t a : [ ] } ) ;
resourcesInfoShowPPTTable . reload ( { data : [ ] } ) ; * /
resourcesInfoShowTable = [ ] ;
resourcesInfoShowPPTTable = [ ] ;
}
}
@ -647,7 +649,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
} else {
tableData4 = [ ] ;
}
console . log ( tableData4 )
var getTpl = tableData4 _demo . innerHTML
, view = document . getElementById ( 'tableData4_view' ) ;
laytpl ( getTpl ) . render ( { list : tableData4 } , function ( html ) {
@ -663,11 +665,11 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
//PPT资源库button
$ ( "#pptClick" ) . click ( function ( obj ) {
updataResourcesOpenRe ( 2 ) ;
updataResourcesOpenRe ( '' , '2,3' ) ;
} ) ;
/*资源库上传弹出框*/
function updataResourcesOpenRe ( resourcesInfoType ) {
function updataResourcesOpenRe ( resourcesInfoType ,resourcesInfoTypePlural ) {
checkStatusData = [ ] ;
layer . open ( {
type : 1 ,
@ -678,16 +680,16 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
area : [ '820px' , '600px' ] ,
content : $ ( "#edit_dialog" ) ,
success : function ( layero , index ) {
loadResourcesInfo ( resourcesInfoType );
loadResourcesInfo ( resourcesInfoType ,resourcesInfoTypePlural );
$ ( ".search" ) . unbind ( ) ;
$ ( ".search" ) . click ( function ( ) { searchList ( resourcesInfoType ); } ) ; //搜索
$ ( ".search" ) . click ( function ( ) { searchList ( resourcesInfoType ,resourcesInfoTypePlural ); } ) ; //搜索
table . reload ( 'resourcesInfoTable' ) ; //刷新table
} , yes : function ( index ) {
var checkStatus = table . checkStatus ( "resourcesInfoTable" ) ; //获取选中行状态
var dataNew = checkStatus . data , ids = Common . concatBatchId ( dataNew , "resourcesInfoId" ) ; //获取选中行数据
if ( resourcesInfoType == 1 ) {
resourcesInfoShowInfo ( dataNew )
} else if ( resourcesInfoType == 2 ) {
} else if ( resourcesInfoType Plural == '2,3' ) {
resourcesInfoShowPPTInfo ( dataNew )
}
@ -700,7 +702,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
//资源库表格
function loadResourcesInfo ( resourcesInfoType ) {
function loadResourcesInfo ( resourcesInfoType ,resourcesInfoTypePlural ) {
$ ( "#edit_dialog input[name='resourcesInfoName']" ) . val ( "" ) ;
resourcesInfoTable = table . render ( {
elem : '#resourcesInfoTable' ,
@ -710,7 +712,7 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
even : true ,
//url: Common.ctxPath + '/jlw/resourcesInfo/list.json' // 数据接口
url : Common . ctxPath + '/jlw/resourcesInfo/resourcesList.json' // 数据接口
, where : getParamRe ( resourcesInfoType )
, where : getParamRe ( resourcesInfoType ,resourcesInfoTypePlural )
, page : Lib . tablePage // 开启分页
, limit : 10 ,
cols : [ [ // 表头
@ -853,9 +855,9 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
/*资源表格搜索*/
/*资源表格搜索*/
function searchList ( resourcesInfoType ) {
function searchList ( resourcesInfoType ,resourcesInfoTypePlural ) {
resourcesInfoTable . reload ( {
where : getParamRe ( resourcesInfoType ),
where : getParamRe ( resourcesInfoType ,resourcesInfoTypePlural ),
page : {
curr : 1
}
@ -863,11 +865,13 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
}
/*资源库搜索条件*/
function getParamRe ( resourcesInfoType ){
function getParamRe ( resourcesInfoType ,resourcesInfoTypePlural ){
var param = {
"courseInfoFullId" : $ ( "#edit_dialog select[name='courseInfoId_1']" ) . val ( ) ,
"resourcesInfoName" : $ ( "#edit_dialog input[name = 'resourcesInfoName']" ) . val ( ) ,
"resourcesInfoType" : resourcesInfoType
"courseInfoId_0" : $ ( "#edit_dialog select[name='courseInfoId_0']" ) . val ( ) ,
"resourcesInfoName" : $ ( "#edit_dialog input[name = 'resourcesInfoName']" ) . val ( ) ,
"resourcesInfoType" : resourcesInfoType ,
"resourcesInfoTypePlural" : resourcesInfoTypePlural
} ;
return param ;
}