var EpChangeEdit = {
epChangeEditData : {},
};
EpChangeEdit.initFileTable = function(){
$("#fileTable").bootstrapTable({
url: Feng.ctxPath + "/common/api/listCurrencyFileType",
method: 'POST',
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
showRefresh: false, // 是否显示刷新按钮
clickToSelect: true, // 是否启用点击选中行
singleSelect: true, // 设置True 将禁止多选
striped: true, // 是否显示行间隔色
escape: true,
pagination: false, // 设置为 true 会在表格底部显示分页条
paginationHAlign: "left",
paginationDetailHAlign: "right",
sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
showColumns: false,
detailView: true, //是否显示父子表
pageList: [10, 30, 50],
queryParams: function (params) {
return $.extend({"type":"enterpriseChange"},params)
},
rowStyle: function (row, index) {
return {classes:"info"};
},
columns: EpChangeEdit.initFileTypeColumn(),
onPostBody: function () {
$("td.uitd_showTip").bind("mouseover", function () {
var htm = $(this).html();
$(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
});
},
onLoadSuccess: function (data) {
$("#fileTable").bootstrapTable('expandAllRows');
},
onExpandRow: function (index, row, $detail) {
var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentCommonFile", function (data) {
if(data==null||data.length==0){
return;
}
var html = '
- 附件原名
- 预览
- 操作
';
for(var key in data){
var sn = data[key].url.lastIndexOf(".");
var suffix = data[key].url.substring(sn+1,data[key].url.length);
var imgStr = "";
if(suffix=="pdf"||suffix=="PDF"){
imgStr = "";
}else if(suffix == "xlsx" || suffix=="XLSX" || suffix == 'xls' || suffix == 'XLS'){
imgStr = "";
}else{
imgStr = '
';
}
var btn = "" ;
html = html + '- '+data[key].id+'
\n'+
'- '+data[key].orignName+'
\n'+
'- '+imgStr+'
\n'+
'- '+btn+'
';
}
html = html + '
';
$detail.html(html);
$(".imgs").viewer({
// toolbar:false,
fullscreen:false
});
}, function (data) {
Feng.error("查询失败!" + data.responseJSON.message + "!");
});
var queryData = {};
queryData["mainId"] = $("#id").val();
queryData["typeId"] = row.id;
ajax.set(queryData);
ajax.start();
}
});
}
EpChangeEdit.initFileTypeColumn = function(){
return [
{field: 'selectItem', checkbox:false,visible:false},
{title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:"30%",'class': 'uitd_showTip',
formatter : function(value,row,index){
if(row.must==1){
return ' * '+ value;
}if(row.must==2){
return ''+value;
}
}
},
{title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width:"52%",'class': 'uitd_showTip'},
]
}
EpChangeEdit.downloadFile = function(id,type) {
window.location.href = Feng.ctxPath + '/api/common/downloadFile?id='+id+"&type="+type;
};
$(function() {
var arr = [
{"name":"newStreet","code":"un_street"},
{"name":"oldStreet","code":"un_street"},
{"name":"newTalentType","code":"un_enterprise_talentType"},
{"name":"oldTalentType","code":"un_enterprise_talentType"},
{"name":"oldIndustryField","code":"un_industryField"},
{"name":"newIndustryField","code":"un_industryField"}];
Feng.findChildDictBatch(JSON.stringify(arr))
$("select").each(function () {
$(this).val($(this).attr("value"));
})
if($("#type").val()==1){
$("#newTalentType,#oldTalentType,#oldIndustryField,#newIndustryField").parent().parent().attr("style","display:block");
}else{
$("#newTalentType,#oldTalentType,#oldIndustryField,#newIndustryField").parent().parent().attr("style","display:none");
}
});