|
@@ -2,8 +2,8 @@
|
|
|
* commonFileType管理初始化
|
|
|
*/
|
|
|
var UnCommonFiletype = {
|
|
|
- id: "UnCommonFiletypeTable", //表格id
|
|
|
- seItem: null, //选中的条目
|
|
|
+ id: "UnCommonFiletypeTable", //表格id
|
|
|
+ seItem: null, //选中的条目
|
|
|
table: null,
|
|
|
layerIndex: -1
|
|
|
};
|
|
@@ -13,68 +13,68 @@ var UnCommonFiletype = {
|
|
|
*/
|
|
|
UnCommonFiletype.initColumn = function () {
|
|
|
return [
|
|
|
- {field: 'selectItem', radio: true},
|
|
|
- {title: '优秀人才类别', field: 'type', visible: true, align: 'center', valign: 'middle','class':'uitd_showTip',width: 100,
|
|
|
- formatter: function (value, row, index){
|
|
|
- if (value==null || value==''){
|
|
|
- return "";
|
|
|
- } else if (value == 1){
|
|
|
- return "晋江市优秀人才";
|
|
|
- }else if(value==2){
|
|
|
- return "集成电路优秀人才";
|
|
|
- }else{
|
|
|
- return "";
|
|
|
- }
|
|
|
+ {field: 'selectItem', radio: true},
|
|
|
+ {title: '优秀人才类别', field: 'type', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: 100,
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == null || value == '') {
|
|
|
+ return "";
|
|
|
+ } else if (value == 1) {
|
|
|
+ return "晋江市优秀人才";
|
|
|
+ } else if (value == 2) {
|
|
|
+ return "集成电路优秀人才";
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
}
|
|
|
- },
|
|
|
- {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle',width: 100},
|
|
|
- {title: '附件名称', field: 'name', visible: true, align: 'center', valign: 'middle',width: 200,'class': 'uitd_showTip'},
|
|
|
- {title: '附件类型api', field: 'api', visible: true, align: 'center', valign: 'middle',width: 100,'class': 'uitd_showTip'},
|
|
|
- {title: '必传', field: 'must', visible: true, align: 'center', valign: 'middle',width: 80,
|
|
|
- formatter: function (value, row, index){
|
|
|
- if (value==null || value==''){
|
|
|
- return "";
|
|
|
- } else if (value == 1){
|
|
|
- return "是";
|
|
|
- }else if(value==2){
|
|
|
- return "否";
|
|
|
- }else{
|
|
|
- return "";
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: 100},
|
|
|
+ {title: '附件名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: 200, 'class': 'uitd_showTip'},
|
|
|
+ {title: '附件类型api', field: 'api', visible: true, align: 'center', valign: 'middle', width: 100, 'class': 'uitd_showTip'},
|
|
|
+ {title: '必传', field: 'must', visible: true, align: 'center', valign: 'middle', width: 80,
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == null || value == '') {
|
|
|
+ return "";
|
|
|
+ } else if (value == 1) {
|
|
|
+ return "是";
|
|
|
+ } else if (value == 2) {
|
|
|
+ return "否";
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
}
|
|
|
- },
|
|
|
- {title: '生效', field: 'active', visible: true, align: 'center', valign: 'middle',width: 80,
|
|
|
- formatter: function (value, row, index){
|
|
|
- if (value==null || value==''){
|
|
|
- return "";
|
|
|
- } else if (value == 1){
|
|
|
- return "有效";
|
|
|
- }else if(value==2){
|
|
|
- return "无效";
|
|
|
- }else{
|
|
|
- return "";
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '生效', field: 'active', visible: true, align: 'center', valign: 'middle', width: 80,
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == null || value == '') {
|
|
|
+ return "";
|
|
|
+ } else if (value == 1) {
|
|
|
+ return "有效";
|
|
|
+ } else if (value == 2) {
|
|
|
+ return "无效";
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: 80,
|
|
|
- formatter: function (value, row, index) {
|
|
|
- if(value==null||value==''){
|
|
|
- return "无";
|
|
|
- }
|
|
|
- var sn = value.lastIndexOf(".");
|
|
|
- var suffix = value.substring(sn+1,value.length);
|
|
|
- if(suffix=="pdf"||suffix=="PDF"){
|
|
|
- return "<button type='button' onclick=\"Feng.showPdf('"+value+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
|
|
|
- }else if(suffix == "xlsx" || suffix=="XLSX" || suffix == 'xls' || suffix == 'XLS'){
|
|
|
- return "<button type='button' onclick=\"Feng.showExcel('"+value+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
|
|
|
- }else{
|
|
|
- return '<img class=\"imgUrl\" src=\"'+value+'\" style=\"width:25px;height:25px;\">';
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: 80,
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value == null || value == '') {
|
|
|
+ return "无";
|
|
|
}
|
|
|
- },
|
|
|
- {title: '排序', field: 'sn', visible: true, align: 'center', valign: 'middle',width: 80,},
|
|
|
- {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width: 300,'class': 'uitd_showTip'}
|
|
|
+ var sn = value.lastIndexOf(".");
|
|
|
+ var suffix = value.substring(sn + 1, value.length);
|
|
|
+ if (suffix == "pdf" || suffix == "PDF") {
|
|
|
+ return "<button type='button' onclick=\"Feng.showPdf('" + value + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
|
|
|
+ } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
|
|
|
+ return "<button type='button' onclick=\"Feng.showExcel('" + value + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
|
|
|
+ } else {
|
|
|
+ return '<img class=\"imgUrl\" src=\"' + value + '\" style=\"width:25px;height:25px;\">';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {title: '排序', field: 'sn', visible: true, align: 'center', valign: 'middle', width: 80, },
|
|
|
+ {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: 300, 'class': 'uitd_showTip'}
|
|
|
];
|
|
|
};
|
|
|
|
|
@@ -83,10 +83,10 @@ UnCommonFiletype.initColumn = function () {
|
|
|
*/
|
|
|
UnCommonFiletype.check = function () {
|
|
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
|
|
- if(selected.length == 0){
|
|
|
+ if (selected.length == 0) {
|
|
|
Feng.info("请先选中表格中的某一记录!");
|
|
|
return false;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
UnCommonFiletype.seItem = selected[0];
|
|
|
return true;
|
|
|
}
|
|
@@ -102,7 +102,7 @@ UnCommonFiletype.openAddUnCommonFiletype = function () {
|
|
|
area: ['1200px', '500px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/unCommonFiletype/unCommonFiletype_add'
|
|
|
+ content: '/admin/filetype/add'
|
|
|
});
|
|
|
UnCommonFiletype.layerIndex = index;
|
|
|
};
|
|
@@ -118,7 +118,7 @@ UnCommonFiletype.openUnCommonFiletypeDetail = function () {
|
|
|
area: ['1200px', '500px'], //宽高
|
|
|
fix: false, //不固定
|
|
|
maxmin: true,
|
|
|
- content: Feng.ctxPath + '/unCommonFiletype/unCommonFiletype_update/' + UnCommonFiletype.seItem.id
|
|
|
+ content: '/admin/filetype/edit/id/' + UnCommonFiletype.seItem.id
|
|
|
});
|
|
|
this.layerIndex = index;
|
|
|
}
|
|
@@ -129,18 +129,18 @@ UnCommonFiletype.openUnCommonFiletypeDetail = function () {
|
|
|
*/
|
|
|
UnCommonFiletype.delete = function () {
|
|
|
if (this.check()) {
|
|
|
- var operation = function(){
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/unCommonFiletype/delete", function (data) {
|
|
|
- if(data.code==200){
|
|
|
+ var operation = function () {
|
|
|
+ var ajax = new $ax("/admin/filetype/delete", function (data) {
|
|
|
+ if (data.code == 200) {
|
|
|
Feng.success(data.msg);
|
|
|
UnCommonFiletype.table.refresh();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Feng.error(data.msg);
|
|
|
}
|
|
|
}, function (data) {
|
|
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
- ajax.set("unCommonFiletypeId",UnCommonFiletype.seItem.id);
|
|
|
+ ajax.set("id", UnCommonFiletype.seItem.id);
|
|
|
ajax.start();
|
|
|
}
|
|
|
Feng.confirm("是否刪除该附件类型?", operation);
|
|
@@ -160,7 +160,7 @@ UnCommonFiletype.search = function () {
|
|
|
UnCommonFiletype.table.refresh({query: queryData});
|
|
|
};
|
|
|
|
|
|
-UnCommonFiletype.reset = function(){
|
|
|
+UnCommonFiletype.reset = function () {
|
|
|
$("#type").val("");
|
|
|
$("#project").val("");
|
|
|
$("#must").val("");
|
|
@@ -168,39 +168,38 @@ UnCommonFiletype.reset = function(){
|
|
|
}
|
|
|
|
|
|
$(function () {
|
|
|
- showsmsselect();
|
|
|
var defaultColunms = UnCommonFiletype.initColumn();
|
|
|
- var table = new BSTable(UnCommonFiletype.id, "/unCommonFiletype/list", defaultColunms);
|
|
|
+ var table = new BSTable(UnCommonFiletype.id, "/admin/filetype/list", defaultColunms);
|
|
|
table.setPaginationType("server");
|
|
|
- table.setOnLoadSuccess(function(){
|
|
|
+ table.setOnLoadSuccess(function () {
|
|
|
$(".imgUrl").viewer({
|
|
|
// toolbar:false,
|
|
|
- fullscreen:false
|
|
|
+ fullscreen: false
|
|
|
});
|
|
|
});
|
|
|
UnCommonFiletype.table = table.init();
|
|
|
});
|
|
|
|
|
|
function showsmsselect() {
|
|
|
- var ajax = new $ax(Feng.ctxPath + "/company/selectAll", function(data){
|
|
|
+ var ajax = new $ax(Feng.ctxPath + "/company/selectAll", function (data) {
|
|
|
var h = "";
|
|
|
- $.each(data, function(key, value) {
|
|
|
+ $.each(data, function (key, value) {
|
|
|
|
|
|
h += "<option value='" + value.id + "'>" + value.shortName //下拉框序言的循环数据
|
|
|
- + "</option>";
|
|
|
+ + "</option>";
|
|
|
});
|
|
|
$("#checkCompany").append(h);//append 添加进去并展示
|
|
|
$("#checkCompany").on(
|
|
|
- "change",
|
|
|
- function(a, b, c) {
|
|
|
- $("#contentID").val(
|
|
|
- $("#checkCompany option:selected").val());
|
|
|
+ "change",
|
|
|
+ function (a, b, c) {
|
|
|
+ $("#contentID").val(
|
|
|
+ $("#checkCompany option:selected").val());
|
|
|
|
|
|
- $("#contentName").val(
|
|
|
- $("#checkCompany option:selected").text());
|
|
|
+ $("#contentName").val(
|
|
|
+ $("#checkCompany option:selected").text());
|
|
|
|
|
|
- })
|
|
|
- },function(data){
|
|
|
+ })
|
|
|
+ }, function (data) {
|
|
|
Feng.error("获取company数据失败!" + data.responseJSON.message + "!");
|
|
|
});
|
|
|
ajax.set(this.unCommonFiletypeInfoData);
|