| | |
| | | TQuestion.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: 'id', field: 'benefitsVideosId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '视频类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {1:"课后练习",2:"运动教学视频",3:"器材教学视频"}[data] |
| | |
| | | * 选择视频 回显视频封面 |
| | | * @param e |
| | | */ |
| | | TQuestion.oneChange = function (e) { |
| | | var id = $("#name").val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/benefits/getCoverDrawing/"+id, function(data){ |
| | | document.getElementById('img').src = data.coverDrawing; |
| | | $("#introduce").val(data.introduce); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | TQuestion.oneChange = function () { |
| | | let op = $('#siteType option:selected'); |
| | | if(op.val() == ""){ |
| | | $('#img').attr('src', "") |
| | | $('#introduce').text("") |
| | | }else{ |
| | | $('#img').attr('src', op.attr('coverDrawing')) |
| | | $('#introduce').text(op.attr('introduce')) |
| | | } |
| | | }; |
| | | /** |
| | | * 点击添加 |
| | |
| | | state:null |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | var id = obj.benefitsVideosId; |
| | | data1.ids.push(id); |
| | | }); |
| | | data1.state = 1; |
| | |
| | | state:null |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | var id = obj.benefitsVideosId; |
| | | data1.ids.push(id); |
| | | }); |
| | | data1.state = 2; |
| | |
| | | state:null |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | var id = obj.benefitsVideosId; |
| | | data1.ids.push(id); |
| | | }); |
| | | data1.state = 3; |
| | |
| | | data: JSON.stringify(data), |
| | | contentType: "application/json", |
| | | success: function (response) { |
| | | if (response === 500){ |
| | | if (!response){ |
| | | Feng.error("所选视频已经存在于当前福利视频分类下!"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.close(); |
| | | |
| | | }else{ |
| | | Feng.success("添加成功"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.close(); |
| | | } |
| | | }, |
| | | error: function (xhr, status, error) { |
| | |
| | | data: JSON.stringify(data), |
| | | contentType: "application/json", |
| | | success: function (response) { |
| | | Feng.success("添加成功"); |
| | | if (!response){ |
| | | Feng.error("所选视频已经存在于当前福利视频分类下!"); |
| | | }else{ |
| | | Feng.success("编辑成功"); |
| | | window.parent.TQuestion.table.refresh(); |
| | | TQuestion.close(); |
| | | } |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | Feng.error("添加失败!" + error); |