-
+
@@ -121,67 +194,85 @@
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'laydate', 'laytpl'], function(){
+ }).use(['index', 'table', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
+ var $win = $(window);
+ var table = layui.table;
var form = layui.form;
+ var admin = layui.admin;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
- function closeBox() {
- parent.layer.close(parent.layer.getFrameIndex(window.name));
+ // 初始化内容
+ function initData() {
+ initPlanStartTimeDateTime();
+ initPlanEndTimeDateTime();
+ initSignUpStartTimeDateTime();
+ initSignUpEndTimeDateTime();
+ initWorkerCatalogSelect();
}
+ initData();
- function refreshDownloadTemplet(fileName, file) {
- var dataRander = {};
- dataRander[fileName] = file;
-
- laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
- document.getElementById(fileName +'FileBox').innerHTML = html;
+ // 初始化培训工种下拉选择
+ function initWorkerCatalogSelect() {
+ laytpl(document.getElementById('workerCatalogSelectTemplate').innerHTML).render([], function(html) {
+ document.getElementById('workerCatalogSelectTemplateBox').innerHTML = html;
});
- }
-
- // 初始化文件列表
- function initFileList(fileName, ids, callback) {
- var dataForm = {};
- dataForm[fileName] = ids;
- form.val('dataForm', dataForm);
-
- if(!ids) {
- refreshDownloadTemplet(fileName, []);
- if(callback) {
- callback(fileName, []);
- }
- return;
- }
-
- top.restAjax.get(top.restAjax.path('api/file/list', []), {
- ids: ids
- }, null, function(code, data) {
- refreshDownloadTemplet(fileName, data);
- if(callback) {
- callback(fileName, data);
- }
+ /*top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/cbb5f8a8-595c-4df4-b38e-7cbb715f754f', []), {}, null, function(code, data, args) {
+ laytpl(document.getElementById('workerCatalogSelectTemplate').innerHTML).render(data, function(html) {
+ document.getElementById('workerCatalogSelectTemplateBox').innerHTML = html;
+ });
+ form.render('select', 'workerCatalogSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
+ });*/
+ }
+
+ // 初始化表格
+ function initTable() {
+ table.render({
+ elem: '#dataTable',
+ id: 'dataTable',
+ url: top.restAjax.path('', []),
+ width: admin.screen() > 1 ? '100%' : '',
+ height: $win.height() - 90,
+ limit: 20,
+ limits: [20, 40, 60, 80, 100, 200],
+ toolbar: '#headerToolBar',
+ request: {
+ pageName: 'page',
+ limitName: 'rows'
+ },
+ cols: [
+ [
+ {type: 'checkbox', fixed: 'left'},
+ {
+ field: 'rowNum',
+ width: 80,
+ title: '序号',
+ fixed: 'left',
+ align: 'center',
+ templet: '{{d.LAY_INDEX}}'
+ }
+ ]
+ ],
+ page: false,
+ parseData: function (data) {
+ return {
+ 'code': 0,
+ 'msg': '',
+ 'count': data.total,
+ 'data': data.rows
+ };
+ }
});
}
- // 初始化视频
- function initVideo(fileName, data) {
- for(var i = 0, item; item = data[i++];) {
- var player = new ckplayer({
- container: '#'+ fileName + i,
- variable: 'player',
- flashplayer: false,
- video: {
- file: 'route/file/download/true/'+ item.fileId,
- type: 'video/mp4'
- }
- });
- }
+ function closeBox() {
+ parent.layer.close(parent.layer.getFrameIndex(window.name));
}
// 初始化培训开始时间时间戳
@@ -224,16 +315,6 @@
});
}
-
- // 初始化内容
- function initData() {
- initPlanStartTimeDateTime();
- initPlanEndTimeDateTime();
- initSignUpStartTimeDateTime();
- initSignUpEndTimeDateTime();
- }
- initData();
-
// 提交表单
form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) {