Commit 85fe6228 by 丁伟

1、迁移初始提交

parent 43b3e44e
......@@ -5,12 +5,13 @@ services:
mysql:
environment:
MYSQL_ROOT_PASSWORD: root
image: itc/mysql:5.5
image: itc/mariadb:10.2
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/log:/var/log/mysql
- /dockerv/ccpit.org/itc/sfzx/database:/var/lib/mysql
command: mysqld --lower_case_table_names=1
networks:
hx_net:
ipv4_address: 172.40.0.3
web:
depends_on:
- mysql
......@@ -18,6 +19,16 @@ services:
volumes:
- ./web:/usr/local/tomcat/webapps/ROOT
- ./logs:/logs
- ./upload:/upload
- ./upload.co.ccpit.org:/data/vhosts/upload.co.ccpit.org
ports:
- "30128:8080"
networks:
hx_net:
ipv4_address: 172.40.0.4
networks:
hx_net:
driver: bridge
ipam:
config:
- subnet: 172.40.0.0/24
......@@ -22,7 +22,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User;
import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -38,8 +37,7 @@ public class CoApplicationInfoService {
@Autowired
private LogInfoService logInfoService;
@Autowired
private LuceneUtil<CoApplicationInfo> luceneUtil;
public boolean addOrUpdateCoApplicationInfo(CoApplicationInfo coApplicationInfo, String operate,
String coApplicationInfoId, User user, HttpServletRequest request) {
boolean flag = false;
......@@ -48,7 +46,6 @@ public class CoApplicationInfoService {
coApplicationInfo.setCreator(user);
flag = coApplicationInfoDao.save(coApplicationInfo);
if (flag) {
luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo));
// 记录用户操作日志信息
logInfoService.recordLog(request, "新增CO数据信息");
}
......@@ -60,8 +57,6 @@ public class CoApplicationInfoService {
flag = coApplicationInfoDao.update(coApplicationInfo1);
if (flag) {
// 记录用户操作日志信息
luceneUtil.deleteIndex("n" + coApplicationInfoId);
luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo1));
logInfoService.recordLog(request, "修改CO数据信息");
}
}
......@@ -81,9 +76,8 @@ public class CoApplicationInfoService {
flag = coApplicationInfoDao.save(coApplicationInfo);
if (flag) {
//luceneUtil.createIndex(createCoApplicationInfosIndex(coApplicationInfo));
// 记录用户操作日志信息
//logInfoService.recordLog(request, "新增CO数据信息");
logInfoService.recordLog(request, "新增CO数据信息");
}
return flag;
......@@ -98,7 +92,6 @@ public class CoApplicationInfoService {
.valueOf(metadataId)));
coApplicationInfo.setDeleted(true);
flag = coApplicationInfoDao.update(coApplicationInfo);
luceneUtil.deleteIndex("n" + metadataId.toString());
}
return flag;
}
......
......@@ -32,7 +32,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User;
import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -58,8 +57,6 @@ public class NewsInfoService {
@Autowired
private LogInfoService logInfoService;
@Autowired
private LuceneUtil<NewsInfo> luceneUtil;
public boolean addOrUpdateNewsInfo(NewsInfo newsInfo, String operate,
String newsInfoId, User user, HttpServletRequest request) {
......@@ -69,7 +66,6 @@ public class NewsInfoService {
newsInfo.setCreator(user);
flag = newsInfoDao.save(newsInfo);
if (flag) {
luceneUtil.createIndex(createNewsInfosIndex(newsInfo));
// 记录用户操作日志信息
logInfoService.recordLog(request, "新增新闻数据信息");
}
......@@ -80,9 +76,7 @@ public class NewsInfoService {
newsInfo1.setModifyBy(user);
flag = newsInfoDao.update(newsInfo1);
if (flag) {
// 记录用户操作日志信息
luceneUtil.deleteIndex("n" + newsInfoId);
luceneUtil.createIndex(createNewsInfosIndex(newsInfo1));
logInfoService.recordLog(request, "修改新闻数据信息");
}
}
......@@ -98,7 +92,6 @@ public class NewsInfoService {
.valueOf(metadataId)));
newsInfo.setDeleted(true);
flag = newsInfoDao.update(newsInfo);
luceneUtil.deleteIndex("n" + metadataId.toString());
}
return flag;
}
......
......@@ -59,7 +59,6 @@ public class NoticeService {
Notice.setCreator(user);
flag = noticeDao.save(Notice);
if (flag) {
// luceneUtil.createIndex(createNoticesIndex(Notice));
// 记录用户操作日志信息
logInfoService.recordLog(request, "新增通知公告数据信息");
}
......@@ -71,8 +70,6 @@ public class NoticeService {
flag = noticeDao.update(Notice1);
if (flag) {
// 记录用户操作日志信息
// luceneUtil.deleteIndex("n" + NoticeId);
// luceneUtil.createIndex(createNoticesIndex(Notice1));
logInfoService.recordLog(request, "修改通知公告数据信息");
}
}
......@@ -93,7 +90,6 @@ public class NoticeService {
.valueOf(metadataId)));
Notice.setDeleted(true);
flag = noticeDao.update(Notice);
// luceneUtil.deleteIndex("n" + metadataId.toString());
}
return flag;
}
......
......@@ -38,7 +38,6 @@ public class QuestionService {
question.setCreator(user);
flag = questionDao.save(question);
if (flag) {
// luceneUtil.createIndex(createQuestionsIndex(Question));
// 记录用户操作日志信息
logInfoService.recordLog(request, "新增问题数据信息");
}
......@@ -50,8 +49,6 @@ public class QuestionService {
flag = questionDao.update(question1);
if (flag) {
// 记录用户操作日志信息
// luceneUtil.deleteIndex("n" + QuestionId);
// luceneUtil.createIndex(createQuestionsIndex(Question1));
logInfoService.recordLog(request, "修改问题数据信息");
}
}
......@@ -67,7 +64,6 @@ public class QuestionService {
.valueOf(metadataId)));
question.setDeleted(true);
flag = questionDao.update(question);
// luceneUtil.deleteIndex("n" + metadataId.toString());
}
return flag;
}
......
......@@ -25,7 +25,6 @@ import ccpit.base.logManage.LogInfoService;
import ccpit.base.user.User;
import ccpit.base.utils.DateConvert;
import ccpit.base.utils.StringUtil;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.base.utils.page.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,8 +35,6 @@ public class VisaAgencyService {
private VisaAgencyDao visaAgencyDao;
@Autowired
private LogInfoService logInfoService;
@Autowired
private LuceneUtil<VisaAgency> luceneUtil;
public boolean addOrUpdateVisaAgency(VisaAgency visaAgency, String operate,
String visaAgencyId, User user, HttpServletRequest request) {
......@@ -47,7 +44,6 @@ public class VisaAgencyService {
visaAgency.setCreator(user);
flag = visaAgencyDao.save(visaAgency);
if (flag) {
luceneUtil.createIndex(createVisaAgencysIndex(visaAgency));
// 记录用户操作日志信息
logInfoService.recordLog(request, "新增签证机构数据信息");
}
......@@ -59,8 +55,6 @@ public class VisaAgencyService {
flag = visaAgencyDao.update(visaAgency1);
if (flag) {
// 记录用户操作日志信息
luceneUtil.deleteIndex("n" + visaAgencyId);
luceneUtil.createIndex(createVisaAgencysIndex(visaAgency1));
logInfoService.recordLog(request, "修改签证机构数据信息");
}
}
......@@ -76,7 +70,6 @@ public class VisaAgencyService {
.valueOf(metadataId)));
visaAgency.setDeleted(true);
flag = visaAgencyDao.update(visaAgency);
luceneUtil.deleteIndex("n" + metadataId.toString());
}
return flag;
}
......
......@@ -25,7 +25,6 @@ import ccpit.base.controller.Page;
import ccpit.base.controller.PageRequest;
import ccpit.base.controller.ValidateCodeController;
import ccpit.base.user.User;
import ccpit.base.utils.lucene.LuceneUtil;
import ccpit.business.coApplication.CoApplicationInfo;
import ccpit.business.coApplication.CoApplicationInfoService;
import ccpit.business.noticeManage.Notice;
......@@ -66,8 +65,7 @@ public class IndexController extends BaseController {
private QuestionService questionService;
@Autowired
private CoApplicationInfoService coApplicationInfoService;
@Autowired
private LuceneUtil luceneUtil;
@Autowired
private TaxableGoodsService taxableGoodsService;
......@@ -263,13 +261,6 @@ public class IndexController extends BaseController {
return mv;
}
String[] searchFields = { "title" };
List<Map<String, Object>> lst = luceneUtil.SearchIndex(queryString,
searchFields);
List<String> result = new LinkedList<String>();
lst.stream().forEach(map -> {
// result.add(indexService.convertResult(map));
});
mv.addObject("result", result);
return mv;
}
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
......
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.ccpit.org/" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
......
......@@ -5,334 +5,343 @@ var dataGridHeight = "";
var bodyWidth = 0;
var bodyHeight = 0;
var editor = null;
var dataType_infoStatus = "通知类型";
var operation="";
$(function() {
divHeight = $("#queryDiv2").height();
dataGridWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight;
$("#addCentralNoticeWinId").window('close'); //添加会员基础信息窗口
initInputWidth();
$("#queryDiv").window('close');
initDataTable();
var dataType_infoStatus = "通知类型";
var operation = "";
$(function () {
divHeight = $("#queryDiv2").height();
dataGridWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight;
$("#addCentralNoticeWinId").window('close'); //添加会员基础信息窗口
initInputWidth();
$("#queryDiv").window('close');
initDataTable();
})
/**
* 初始化各输入框宽度
*/
function initInputWidth(){
editor = UE.getEditor('noticeContentId', {
initialFrameWidth : fixLongWidth(),
initialFrameHeight : 400
});
$("#titleId").attr("style","width:"+ (fixLongWidth()-2)+"px");
$("#titleId00").attr("style","width:"+ fixShortWidth()+"px");
$("#noticeTypeId").combobox({
url : '/admin/metadataManage/getMetadatasList?dataType='+encodeURI(encodeURI(dataType_infoStatus)),
width : fixShortWidth() + 4,
panelHeight : 'auto',
panelHeight : 'auto',
valueField : 'id',
textField : 'text',
onLoadSuccess : function() {
$("#infotatusId").combobox("select", "编辑中");
$("#infotatusId").combobox("setValue", 0);
}
});
function initInputWidth() {
editor = UE.getEditor('noticeContentId', {
initialFrameWidth: fixLongWidth(),
initialFrameHeight: 400
});
$("#titleId").attr("style", "width:" + (fixLongWidth() - 2) + "px");
$("#titleId00").attr("style", "width:" + fixShortWidth() + "px");
$("#noticeTypeId").combobox({
url: '/admin/metadataManage/getMetadatasList?dataType=' + encodeURI(encodeURI(dataType_infoStatus)),
width: fixShortWidth() + 4,
panelHeight: 'auto',
panelHeight: 'auto',
valueField: 'id',
textField: 'text',
onLoadSuccess: function () {
$("#infotatusId").combobox("select", "编辑中");
$("#infotatusId").combobox("setValue", 0);
}
});
}
//js时间戳格式化成日期格式
function timestampformat(timestamp) {
var date = new Date(timestamp);
var year = date.getFullYear();
var month = date.getMonth()+1;
var day = date.getDate();
return year+"-"+month+"-"+day;
}
var date = new Date(timestamp);
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
return year + "-" + month + "-" + day;
}
function initDataTable() {
$("#noticeTable").datagrid({
height: clientHeight - divHeight - 27,
nowrap: true,
striped: true,
pagination: true,
rownumbers: true,
pageList: [10, 20, 30, 40, 50],
autoRowHeight: false,
fitColumns: false,
singleSelect: false, //单选
checkOnSelect: true,
selectOnCheck: true,
remoteSort: true,
url: '/business/noticeManage/queryAllNotice',
columns: [[{
field: 'ck',
title: 'id',
width: 15,
checkbox: true
}, {
field: 'noticeTitle',
title: '标题',
width: '700',
align: 'center',
formatter: dataStyle
}, {
field: 'noticeType',
title: '类型',
width: '200',
align: 'center'
}, {
field: 'createTime',
title: '发布日期',
width: '200',
align: 'center'
}, {
field: 'creator',
title: '发布人',
width: '200',
align: 'center'
}, {
field: 'clickVolume',
title: '点击量',
width: '200',
align: 'center'
}
]]
});
}
//打开查看窗口 打开tab页
function viewData(id) {
$.getJSON("/business/noticeManage/queryNoticeById/" + id, function (data) {
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
});
$("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({
title: '查看通知公告信息',
width: addWinWidth,
height: addWinHeight,
left: (dataGridWidth - addWinWidth) / 2,
top: (bodyHeight - addWinHeight) / 2,
closable: true, // 否显示关闭按钮
collapsible: false, // 是否显示折叠按钮
minimizable: false, // 是否显示最小化按钮
maximizable: false, // 是否显示最大化按钮
close: true, // 初始是否关闭
modal: true
});
$("#buttonId01").hide();
$("#buttonId02").hide();
$("#addCentralNoticeWinId").window('open');
}
function dataStyle(val, row) {
return '<a class="" href="#" onclick="viewData(\'' + row.id + '\')">' + row.noticeTitle + '</a>';
}
function initDataTable(){
$("#noticeTable").datagrid({
height:clientHeight-divHeight-27,
nowrap : true,
striped : true,
pagination : true,
rownumbers : true,
pageList : [10,20,30,40,50],
autoRowHeight : false,
fitColumns : false,
singleSelect : false, //单选
checkOnSelect : true,
selectOnCheck : true,
remoteSort : true,
url : '/business/noticeManage/queryAllNotice',
columns : [ [ {
field : 'ck',
title : 'id',
width : 15,
checkbox : true
},{
field : 'noticeTitle',
title : '标题',
width : '700',
align : 'center',
formatter : dataStyle
},{
field : 'noticeType',
title : '类型',
width : '200',
align : 'center'
},{
field : 'createTime',
title : '发布日期',
width : '200',
align : 'center'
}, {
field : 'creator',
title : '发布人',
width : '200',
align : 'center'
},{
field : 'clickVolume',
title : '点击量',
width : '200',
align : 'center'
}
] ]
});
}
//打开查看窗口 打开tab页
function viewData(id){
$.getJSON("/business/noticeManage/queryNoticeById/" + id, function(data) {
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
});
$("#main_area").height((bodyHeight/5)*4);
$("#addCentralNoticeWinId").window({
title : '查看通知公告信息',
width : addWinWidth,
height : addWinHeight,
left : (dataGridWidth - addWinWidth)/2,
top : (bodyHeight - addWinHeight)/2,
closable : true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮
close : true, // 初始是否关闭
modal : true
});
$("#buttonId01").hide();
$("#buttonId02").hide();
$("#addCentralNoticeWinId").window('open');
}
function doSearch(value) {
var queryParams = null;
$("#CentralNoticeManageTable").datagrid({
queryParams: {
queryValue: value
}
});
}
function dataStyle(val, row) {
return '<a class="" href="#" onclick="viewData(\'' + row.id + '\')">'+ row.noticeTitle + '</a>';
}
function doSearch(value){
var queryParams = null;
$("#CentralNoticeManageTable").datagrid({
queryParams : {
queryValue : value
}
});
}
/**
* 打开新增窗口 基本信息
*/
function openAddWin(){
initInputWidth();
operation = "add";
$("#main_area").height();
$("#addCentralNoticeWinId").window({
title : '新增通知公告信息',
width : addWinWidth,
height : addWinHeight,
left : (dataGridWidth - addWinWidth)/2,
top : (bodyHeight - addWinHeight)/2,
closable : true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮
close : true, // 初始是否关闭
modal : true
});
$("#addCentralNoticeForm").form('clear');
$("#buttonId01").show();
$("#buttonId02").show();
editor.setContent('');
$("#addCentralNoticeWinId").window('open');
function openAddWin() {
initInputWidth();
operation = "add";
$("#main_area").height();
$("#addCentralNoticeWinId").window({
title: '新增通知公告信息',
width: addWinWidth,
height: addWinHeight,
left: (dataGridWidth - addWinWidth) / 2,
top: (bodyHeight - addWinHeight) / 2,
closable: true, // 否显示关闭按钮
collapsible: false, // 是否显示折叠按钮
minimizable: false, // 是否显示最小化按钮
maximizable: false, // 是否显示最大化按钮
close: true, // 初始是否关闭
modal: true
});
$("#addCentralNoticeForm").form('clear');
$("#buttonId01").show();
$("#buttonId02").show();
editor.setContent('');
$("#addCentralNoticeWinId").window('open');
}
/**
* 打开修改窗口 基本信息
*/
function openEditWin(){
$("#addCentralNoticeWinId").form('clear');
operation = "edit";
var rows = $('#noticeTable').datagrid('getSelections');
if(rows.length == 1){
var row = $('#noticeTable').datagrid('getSelected');
$.getJSON("/business/noticeManage/queryNoticeById/" + row.id, function(data) {
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
});
$("#main_area").height((bodyHeight/5)*4);
$("#addCentralNoticeWinId").window({
title : '修改信息',
width : addWinWidth,
height : addWinHeight,
left : (dataGridWidth - addWinWidth)/2,
top : (bodyHeight - addWinHeight)/2,
closable : true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮
close : true, // 初始是否关闭
modal : true
});
$("#buttonId01").show();
$("#buttonId02").show();
$("#addCentralNoticeWinId").window('open');
}else {
$.messager.alert('提示', '请选中一条记录 ', 'info');
}
function openEditWin() {
$("#addCentralNoticeWinId").form('clear');
operation = "edit";
var rows = $('#noticeTable').datagrid('getSelections');
if (rows.length == 1) {
var row = $('#noticeTable').datagrid('getSelected');
$.getJSON("/business/noticeManage/queryNoticeById/" + row.id, function (data) {
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
});
$("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({
title: '修改信息',
width: addWinWidth,
height: addWinHeight,
left: (dataGridWidth - addWinWidth) / 2,
top: (bodyHeight - addWinHeight) / 2,
closable: true, // 否显示关闭按钮
collapsible: false, // 是否显示折叠按钮
minimizable: false, // 是否显示最小化按钮
maximizable: false, // 是否显示最大化按钮
close: true, // 初始是否关闭
modal: true
});
$("#buttonId01").show();
$("#buttonId02").show();
$("#addCentralNoticeWinId").window('open');
} else {
$.messager.alert('提示', '请选中一条记录 ', 'info');
}
}
function openQueryWin(row){
var data = row
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
$("#main_area").height((bodyHeight/5)*4);
$("#addCentralNoticeWinId").window({
title : '查看通知公告信息',
width : addWinWidth,
height : addWinHeight,
left : (dataGridWidth - addWinWidth)/2,
top : (bodyHeight - addWinHeight)/2,
closable : true, // 否显示关闭按钮
collapsible : false, // 是否显示折叠按钮
minimizable : false, // 是否显示最小化按钮
maximizable : false, // 是否显示最大化按钮
close : true, // 初始是否关闭
modal : true
});
$("#buttonId01").hide();
$("#buttonId02").show();
$("#addCentralNoticeWinId").window('open');
function openQueryWin(row) {
var data = row
$("#addCentralNoticeForm").form('load', data);
editor.setContent(data.noticeContent);
$("#main_area").height((bodyHeight / 5) * 4);
$("#addCentralNoticeWinId").window({
title: '查看通知公告信息',
width: addWinWidth,
height: addWinHeight,
left: (dataGridWidth - addWinWidth) / 2,
top: (bodyHeight - addWinHeight) / 2,
closable: true, // 否显示关闭按钮
collapsible: false, // 是否显示折叠按钮
minimizable: false, // 是否显示最小化按钮
maximizable: false, // 是否显示最大化按钮
close: true, // 初始是否关闭
modal: true
});
$("#buttonId01").hide();
$("#buttonId02").show();
$("#addCentralNoticeWinId").window('open');
}
$("#professorNameId").combobox({
width:fixShortWidth()+4
width: fixShortWidth() + 4
})
//保存数据
function saveData(){
var centralNoticeTitle = $("#titleId").val();
if('add' == operation){
$.getJSON("/business/noticeManage/isExistNotice?noticeTitle="+encodeURI(encodeURI(centralNoticeTitle)),function(json){
if(json.flag){
$.messager.alert('提示', json.info, 'error');
}else {
url = "/business/noticeManage/addOrUpdateNotice?operate="+operation;
$('#addCentralNoticeForm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(data){
var data = eval("("+data+")");
if (data.flag){
$.messager.alert('提示', data.info, 'ok');
closeWindow();
initDataTable();
} else {
$.messager.alert("提示",data.info,'error');
}
}
});
}
})
}
if('edit' == operation){
var row = $('#noticeTable').datagrid('getSelected');
url = "/business/noticeManage/addOrUpdateNotice?operate="+operation+"&noticeId="+row.id;
$('#addCentralNoticeForm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(data){
var data = eval("("+data+")")
if (data.flag){
$.messager.alert('提示',data.info, 'ok');
closeWindow();
initDataTable();
} else {
$.messager.alert("提示",data.info,'error');
}
}
});
}
function saveData() {
var centralNoticeTitle = $("#titleId").val();
if ('add' == operation) {
$.getJSON("/business/noticeManage/isExistNotice?noticeTitle=" + encodeURI(encodeURI(centralNoticeTitle)), function (json) {
if (json.flag) {
$.messager.alert('提示', json.info, 'error');
} else {
url = "/business/noticeManage/addOrUpdateNotice?operate=" + operation;
$('#addCentralNoticeForm').form('submit', {
url: url,
onSubmit: function () {
return $(this).form('validate');
},
success: function (data) {
var data = eval("(" + data + ")");
if (data.flag) {
$.messager.alert('提示', data.info, 'ok');
closeWindow();
initDataTable();
} else {
$.messager.alert("提示", data.info, 'error');
}
}
});
}
})
}
if ('edit' == operation) {
var row = $('#noticeTable').datagrid('getSelected');
url = "/business/noticeManage/addOrUpdateNotice?operate=" + operation + "&noticeId=" + row.id;
$('#addCentralNoticeForm').form('submit', {
url: url,
onSubmit: function () {
return $(this).form('validate');
},
success: function (data) {
var data = eval("(" + data + ")")
if (data.flag) {
$.messager.alert('提示', data.info, 'ok');
closeWindow();
initDataTable();
} else {
$.messager.alert("提示", data.info, 'error');
}
}
});
}
}
//删除
function deleteNotice(){
var rows = $('#noticeTable').datagrid('getChecked');
if (rows.length !=0 ){
var jsonIds = arrayTojson(rows);
$.messager.confirm("删除","确定删除?",function(r){
if (r){
var postUrl = '/business/noticeManage/deleteNotices';
$.post(postUrl,{
"ids":jsonIds},function(result){
if (result.flag){
$.messager.alert('提示',result.info,'ok');
initDataTable();
} else {
$.messager.alert('提示',result.info,'error');
initDataTable();
return;
}
},'json');
}
});
}else{
$.messager.alert('提示', '请选中一条要删除记录', 'info');
}
function deleteNotice() {
var rows = $('#noticeTable').datagrid('getChecked');
if (rows.length != 0) {
var jsonIds = arrayTojson(rows);
$.messager.confirm("删除", "确定删除?", function (r) {
if (r) {
var postUrl = '/business/noticeManage/deleteNotices';
$.post(postUrl, {
"ids": jsonIds
}, function (result) {
if (result.flag) {
$.messager.alert('提示', result.info, 'ok');
initDataTable();
} else {
$.messager.alert('提示', result.info, 'error');
initDataTable();
return;
}
}, 'json');
}
});
} else {
$.messager.alert('提示', '请选中一条要删除记录', 'info');
}
}
//关闭窗口 基础信息
function closeWindow(){
$("#addCentralNoticeWinId").window('close');
function closeWindow() {
$("#addCentralNoticeWinId").window('close');
}
/**
* id数组转换为json字符串
*/
function arrayTojson(arr) {
var jsonIds = "[";
for ( var i = 0; i < arr.length; i++) {
if (i == arr.length - 1) {
jsonIds += arr[i].id;
} else {
jsonIds += arr[i].id + ",";
}
}
jsonIds += "]";
function arrayTojson(arr) {
var jsonIds = "[";
for (var i = 0; i < arr.length; i++) {
if (i == arr.length - 1) {
jsonIds += arr[i].id;
} else {
jsonIds += arr[i].id + ",";
}
}
jsonIds += "]";
return jsonIds;
return jsonIds;
}
//查询
//查询
function queryData() {
var noticeTitle = $("#titleId00").val();
var queryParams = null;
$("#noticeTable").datagrid({
queryParams : {
noticeTitle : noticeTitle
}
});
var noticeTitle = $("#titleId00").val();
var queryParams = null;
$("#noticeTable").datagrid({
queryParams: {
noticeTitle: noticeTitle
}
});
}
// 清空查询条件框
function clearQueryForm() {
$("#queryFormId2").form('clear');
queryData();
$("#queryFormId2").form('clear');
queryData();
}
\ No newline at end of file
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