Commit 2c3969e9 authored by agping's avatar agping

1

parent c3fd6966
......@@ -45,6 +45,12 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
_doc.on('click', '.add-pic', function() {
follow.getaddPicList();
});
_doc.on('click', '.pdf-pre-a', function() {
var file_id = $(this).parent('li').attr('id') - 0 ;
var _url = '/index/downloadFile';
window.open(_url + '?file_id=' + file_id);
});
$("#search").click(function() {
user.getList(1);
});
......@@ -184,6 +190,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
user.addDeleteNewsEvent(file_id);
};
});
//图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src);
......@@ -222,6 +229,12 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
}
});
},
//下载 pdf
// downloadPDF:function(){
// var _url = '/index/downloadFile'
// window.open(_url + 'file_id=' + excel);
// },
//点击编辑 调用的接口
text_details: function() {
var news_id = getUrlParam('id'); //地址栏获取的商铺或者街铺id
......@@ -257,9 +270,11 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="" title="点击可下载">{2}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])),
'2': file_paths[i]['file_former_name']
}));
}
} else {}
......@@ -332,8 +347,10 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
for ( var i= 0 ; i < _fujianObj.length ; i++ ){
var one_name = _fujianObj[i].getAttribute('data-filename'); //附件取得是data-filename
var one_name_html = _fujianObj[i].innerHTML; //附件取得是data-filename
_data['annex_file_name['+i+'][0]'] = one_name;
_data['annex_file_name['+i+'][1]'] = one_name_html;
// _data['annex_file_name['+i+'][''']'] = one_name + ','+one_name_html;
// _data['annex_file_name['+i+'][1]'] = one_name_html;
_data['annex_file_name['+i+'][file_name]'] = one_name;
_data['annex_file_name['+i+'][file_former_name]'] = one_name_html;
}
}
/*if(_fujianObj.length === 1) {
......@@ -351,7 +368,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
$("#modal_add_user").modal('hide'); //提交成功 关闭模态框
// user.getList(1);
alert('提交成功')
window.location.href = '/index/business_school';
// window.location.href = '/index/business_school';
console.log(66);
} else {
alert(data.msg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment