Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jfV5portal
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
管理员
jfV5portal
Commits
8e4486a4
Commit
8e4486a4
authored
Aug 06, 2018
by
周添尉
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
7182ca27
921abd56
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
2221 additions
and
196 deletions
+2221
-196
business-apps.xml
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
+10
-0
icon.css
...tent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
+7
-0
index.jsp
WebContent/jfcas04/index.jsp
+4
-3
index.js
WebContent/jfcas04/js/index.js
+5
-4
calendarCompanyTab.jsp
WebContent/jwapp/pages/calendar/calendarCompanyTab.jsp
+31
-0
calendarCompanyTabDetail.jsp
WebContent/jwapp/pages/calendar/calendarCompanyTabDetail.jsp
+39
-0
calendarTab.jsp
WebContent/jwapp/pages/calendar/calendarTab.jsp
+31
-0
calendarTabDetail.jsp
WebContent/jwapp/pages/calendar/calendarTabDetail.jsp
+40
-0
calendarCompanyTab.js
WebContent/jwapp/pages/calendar/js/calendarCompanyTab.js
+640
-0
calendarModule.js
WebContent/jwapp/pages/calendar/js/calendarModule.js
+31
-0
calendarTab.js
WebContent/jwapp/pages/calendar/js/calendarTab.js
+675
-0
jwAppPortletModule.js
WebContent/jwapp/pages/portlet/js/jwAppPortletModule.js
+0
-6
struts-ext.xml
src/struts-ext.xml
+17
-0
CalendarBusiness.java
src_jwapp/com/jw/app/business/CalendarBusiness.java
+23
-0
PortletBusiness.java
src_jwapp/com/jw/app/business/PortletBusiness.java
+0
-5
CalendarBusinessImpl.java
...pp/com/jw/app/business/calendar/CalendarBusinessImpl.java
+225
-0
calendarDAO.java
src_jwapp/com/jw/app/business/calendar/calendarDAO.java
+34
-0
calendarDAO.xml
src_jwapp/com/jw/app/business/calendar/calendarDAO.xml
+151
-0
PortletBusinessImpl.java
...wapp/com/jw/app/business/portlet/PortletBusinessImpl.java
+0
-52
PortletDAO.java
src_jwapp/com/jw/app/business/portlet/PortletDAO.java
+0
-7
PortletDAO.xml
src_jwapp/com/jw/app/business/portlet/PortletDAO.xml
+0
-48
actAction.java
src_jwapp/com/jw/app/calendar/action/actAction.java
+110
-0
dataAction.java
src_jwapp/com/jw/app/calendar/action/dataAction.java
+119
-0
viewAction.java
src_jwapp/com/jw/app/calendar/action/viewAction.java
+29
-0
actAction.java
src_jwapp/com/jw/app/portlet/action/actAction.java
+0
-29
dataAction.java
src_jwapp/com/jw/app/portlet/action/dataAction.java
+0
-42
No files found.
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
View file @
8e4486a4
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
<value>
classpath:com/jw/app/business/store/share/storeShareDAO.xml
</value>
<value>
classpath:com/jw/app/business/store/share/storeShareDAO.xml
</value>
<value>
classpath:com/jw/app/business/store/user/storeUserDAO.xml
</value>
<value>
classpath:com/jw/app/business/store/user/storeUserDAO.xml
</value>
<value>
classpath:com/jw/app/business/userchoice/userchoiceDAO.xml
</value>
<value>
classpath:com/jw/app/business/userchoice/userchoiceDAO.xml
</value>
<value>
classpath:com/jw/app/business/calendar/calendarDAO.xml
</value>
</list>
</list>
</property>
</property>
</bean>
</bean>
...
@@ -65,6 +66,10 @@
...
@@ -65,6 +66,10 @@
<property
name=
"mapperInterface"
value=
"com.jw.app.business.portal.content.ContentDAO"
/>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.portal.content.ContentDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
</bean>
<bean
id=
"calendarDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.calendar.calendarDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
<!-- BusinessInterFace -->
<!-- BusinessInterFace -->
<bean
id=
"PortletBusiness"
<bean
id=
"PortletBusiness"
class=
"com.jw.app.business.portlet.PortletBusinessImpl"
>
class=
"com.jw.app.business.portlet.PortletBusinessImpl"
>
...
@@ -106,6 +111,11 @@
...
@@ -106,6 +111,11 @@
<property
name=
"userchoiceDAO"
ref=
"userchoiceDAO"
/>
<property
name=
"userchoiceDAO"
ref=
"userchoiceDAO"
/>
</bean>
</bean>
<bean
id=
"CalendarBusiness"
class=
"com.jw.app.business.calendar.CalendarBusinessImpl"
>
<property
name=
"calendarDAO"
ref=
"calendarDAO"
/>
</bean>
<!-- DAO -->
<!-- DAO -->
<bean
id=
"portletDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<bean
id=
"portletDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.portlet.PortletDAO"
/>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.portlet.PortletDAO"
/>
...
...
WebContent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
View file @
8e4486a4
...
@@ -339,4 +339,10 @@
...
@@ -339,4 +339,10 @@
}
}
.icon-ext-05_40 {
.icon-ext-05_40 {
background:url('
../../../../
images
/
icons
/(
05
,
40
).
png
') no-repeat left center;
background:url('
../../../../
images
/
icons
/(
05
,
40
).
png
') no-repeat left center;
}
.icon-ext-06_10 {
background:url('
../../../../
images
/
icons
/(
06
,
10
).
png
') no-repeat left center;
}
.icon-ext-13_48 {
background:url('
../../../../
images
/
icons
/(
13
,
48
).
png
'
)
no-repeat
left
center
;
}
}
\ No newline at end of file
WebContent/jfcas04/index.jsp
View file @
8e4486a4
...
@@ -5,9 +5,10 @@
...
@@ -5,9 +5,10 @@
<head>
<head>
<title>
首页
</title>
<title>
首页
</title>
<jsp:include
page=
"header.jsp"
></jsp:include>
<jsp:include
page=
"header.jsp"
></jsp:include>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${ctx}/jwapp/pages/portlet/js/jwAppPortletModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/apps/js/jwAppAppsModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${ctx}/jwapp/pages/apps/js/jwAppAppsModule.js"
charset=
"utf-8"
></script>
<script
src=
"${ctx}/jfcas04/js/index.js"
></script>
<script
type=
"text/javascript"
src=
"${ctx}/jwapp/pages/calendar/js/calendarModule.js"
></script>
<script
type=
"text/javascript"
src=
"${ctx}/jfcas04/js/index.js"
></script>
</head>
</head>
<body>
<body>
<!-- 头部 -->
<!-- 头部 -->
...
...
WebContent/jfcas04/js/index.js
View file @
8e4486a4
...
@@ -1258,9 +1258,10 @@ function init_index_fullCalendar() {
...
@@ -1258,9 +1258,10 @@ function init_index_fullCalendar() {
/*eventLimit : true, // allow "more" link when too many events*/
/*eventLimit : true, // allow "more" link when too many events*/
//events : ctx+'/date.json'
//events : ctx+'/date.json'
events
:
function
(
start
,
end
,
timezone
,
callback
)
{
events
:
function
(
start
,
end
,
timezone
,
callback
)
{
var
result
=
jwAppPortletModel
.
jwAppsPortletDataAction
.
listCalendarInfo
({
var
result
=
calendarModule
.
data
.
listCalendarInfo
({
FIELD_START_TIME
:
start
.
_i
,
FIELD_START_TIME
:
start
.
_i
,
FIELD_END_TIME
:
end
.
_i
FIELD_END_TIME
:
end
.
_i
,
pageSize
:
999
});
});
var
listData
=
result
.
rowSet
;
var
listData
=
result
.
rowSet
;
var
json
=
[];
var
json
=
[];
...
@@ -1438,7 +1439,7 @@ function index_removeDay() {
...
@@ -1438,7 +1439,7 @@ function index_removeDay() {
//删除日历的事件
//删除日历的事件
$
(
'#index_calendar'
).
fullCalendar
(
'removeEvents'
,
$
(
'#index_calendarId'
).
val
())
$
(
'#index_calendar'
).
fullCalendar
(
'removeEvents'
,
$
(
'#index_calendarId'
).
val
())
//删除数据库的数据
//删除数据库的数据
var
result
=
jwAppPortletModel
.
jwAppsPortletActAction
.
removeCalendarInfo
({
var
result
=
calendarModule
.
act
.
removeCalendarInfo
({
UUID
:
$
(
'#index_calendarId'
).
val
()
UUID
:
$
(
'#index_calendarId'
).
val
()
});
});
if
(
result
.
NAME
==
3
){
if
(
result
.
NAME
==
3
){
...
@@ -1467,7 +1468,7 @@ function index_submitClick() {
...
@@ -1467,7 +1468,7 @@ function index_submitClick() {
jsonDate
.
FIELD_END_TIME
=
$
(
'#index_calendarEnd'
).
val
();
jsonDate
.
FIELD_END_TIME
=
$
(
'#index_calendarEnd'
).
val
();
jsonDate
.
FIELD_ALLDAY
=
$
(
'#index_isAllDay'
).
prop
(
'checked'
)?
1
:
0
;
jsonDate
.
FIELD_ALLDAY
=
$
(
'#index_isAllDay'
).
prop
(
'checked'
)?
1
:
0
;
jsonDate
.
FIELD_COLOR
=
$
(
'#index_calendarColor'
).
val
();
jsonDate
.
FIELD_COLOR
=
$
(
'#index_calendarColor'
).
val
();
jwAppPortletModel
.
jwAppsPortletActAction
.
saveCalendarInfo
(
jsonDate
);
calendarModule
.
act
.
saveCalendarInfo
(
jsonDate
);
$
(
'#index_calendar'
).
fullCalendar
(
'refetchEvents'
);
//重新获取所有事件数据
$
(
'#index_calendar'
).
fullCalendar
(
'refetchEvents'
);
//重新获取所有事件数据
//保存到数据库
//保存到数据库
...
...
WebContent/jwapp/pages/calendar/calendarCompanyTab.jsp
0 → 100644
View file @
8e4486a4
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
<!-- spectrum(颜色)的css -->
<link rel="stylesheet" type="text/css" href="${ctx}/lib/plug/jqueryColour/spectrum.css">
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="calendarTab_searchForm" style="float:left">
<input id="FIELD_USER_ID" name="FIELD_USER_ID" type="hidden"/>
内容: <input id="FIELD_TITLE" name="FIELD_TITLE" type="text" style="width: 300px" >
从<input class="easyui-datetimebox" id="FIELD_START_TIME" name="FIELD_START_TIME" style="width:150px"/>
到 <input class="easyui-datetimebox" id="FIELD_END_TIME" name="FIELD_END_TIME" style="width:150px"/>
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<span id="calendarTab_changeperson"></span>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="userChoice" style="overflow:auto;"></div>
<!-- spectrum(颜色)的js -->
<script type="text/javascript" src="/jfV5portal/lib/plug/jqueryColour/spectrum.js"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarCompanyTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/calendar/calendarCompanyTabDetail.jsp
0 → 100644
View file @
8e4486a4
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>日程内容:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>开始时间:</span></td>
<td style="width: 85%">
<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>结束时间:</span></td>
<td style="width: 85%">
<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>背景颜色:</span></td>
<td style="width: 85%">
<input id="COLOR" name="FIELD_COLOR" style="width:100px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>是否全天:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" id="ALLDAY" name="FIELD_ALLDAY" style="width:100px" />
</td>
</tr>
<tr>
</table>
</form>
\ No newline at end of file
WebContent/jwapp/pages/calendar/calendarTab.jsp
0 → 100644
View file @
8e4486a4
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="studentTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
<!-- spectrum(颜色)的css -->
<link rel="stylesheet" type="text/css" href="${ctx}/lib/plug/jqueryColour/spectrum.css">
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="calendarTab_searchForm" style="float:left">
<input id="FIELD_USER_ID" name="FIELD_USER_ID" type="hidden"/>
内容: <input id="FIELD_TITLE" name="FIELD_TITLE" type="text" style="width: 300px" >
从<input class="easyui-datetimebox" id="FIELD_START_TIME" name="FIELD_START_TIME" style="width:150px"/>
到 <input class="easyui-datetimebox" id="FIELD_END_TIME" name="FIELD_END_TIME" style="width:150px"/>
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<span id="calendarTab_changeperson"></span>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="userChoice" style="overflow:auto;"></div>
<!-- spectrum(颜色)的js -->
<script type="text/javascript" src="/jfV5portal/lib/plug/jqueryColour/spectrum.js"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/calendar/js/calendarTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/calendar/calendarTabDetail.jsp
0 → 100644
View file @
8e4486a4
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}" />
<input type="hidden" name="FIELD_USER_ID" id="USER_ID" value="${is_row.USER_ID}" />
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>日程内容:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" data-options="required:true" id="TITLE" name="FIELD_TITLE" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>开始时间:</span></td>
<td style="width: 85%">
<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>结束时间:</span></td>
<td style="width: 85%">
<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>背景颜色:</span></td>
<td style="width: 85%">
<input id="COLOR" name="FIELD_COLOR" style="width:100px" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable"><span>是否全天:</span></td>
<td style="width: 85%">
<input class="easyui-textbox" id="ALLDAY" name="FIELD_ALLDAY" style="width:100px" />
</td>
</tr>
<tr>
</table>
</form>
\ No newline at end of file
WebContent/jwapp/pages/calendar/js/calendarCompanyTab.js
0 → 100644
View file @
8e4486a4
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var
ls_width
=
$
(
window
).
width
();
var
ls_height
=
$
(
window
).
height
();
var
local_page
=
1
;
var
rows
=
20
;
var
listPageSize
=
[
10
,
20
,
50
,
100
,
500
,
1000
];
var
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
var
tab_n
=
0
;
//重置分页参数
function
resetQueryData
(){
queryData
=
""
;
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var
ls_module_id
=
'2'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载是否全天数据
var
v_allday_data
=
[{
CODE_ID
:
'0'
,
CODE_NAME
:
'否'
},{
CODE_ID
:
'1'
,
CODE_NAME
:
'是'
}];
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"日历管理"
;
var
is_column
=
[
[
{
field
:
'TITLE'
,
title
:
'内容'
,
width
:
380
,
align
:
'left'
},
{
field
:
'START_TIME'
,
title
:
'开始时间'
,
width
:
120
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
if
(
row
.
ALLDAY
==
0
){
return
value
.
substring
(
0
,
10
);
}
return
value
;
}},
{
field
:
'END_TIME'
,
title
:
'结束时间'
,
width
:
120
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
if
(
row
.
ALLDAY
==
0
){
return
value
.
substring
(
0
,
10
);
}
return
value
;
}},
{
field
:
'ALLDAY'
,
title
:
'全天'
,
width
:
50
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
return
value
==
0
?
"否"
:
"是"
;
}},
{
field
:
'COLOR'
,
title
:
'背景色'
,
width
:
100
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
return
'<span style="color:'
+
value
+
'">'
+
value
+
'</span>'
;
}},
{
field
:
'CREATE_USER'
,
title
:
'创建人员'
,
width
:
100
,
align
:
'center'
},
{
field
:
'CREATE_TIME'
,
title
:
'创建时间'
,
width
:
120
,
align
:
'center'
}
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
if
(
row
.
STATUS
==
'1'
){
return
'color:green;height:30px;'
;
}
else
{
return
'color:blue;height:30px;'
;
}
}
//展示列表
datagrid
(
"list"
,
ls_title
,
gaowj
.
WEB_APP_NAME
+
"/calendarData_listCalendarCompanyInfo"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-ext-moremenu
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span>"
+
"<span data-p1="
+
index
+
" class=
\"
easyui-tooltip
\"
style=
\"
color:blue;cursor:pointer;
\"
>更多</span>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
function
getOptionMenu
(
data
,
index
){
var
returnData
=
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>编辑</a> | <span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a>"
;
return
returnData
;
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
var
is_menu_count
=
2
;
return
is_menu_count
;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function
addRow
(){
var
is_row
=
{
OPETYPE
:
'insert'
};
openEditRow
(
"calendarView_calendarTabDetail"
,
is_row
,
"新增"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载增加子页面成功后的回调
function
addUrlOnloadCallback
(
is_row
){
$
(
"#USER_ID"
).
val
(
$
(
"#FIELD_USER_ID"
).
val
());
$
(
'#ALLDAY'
).
val
(
1
);
$
(
'#COLOR'
).
val
(
'#ECC'
);
$
(
'#ALLDAY'
).
combobox
({
data
:
v_allday_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
onSelect
:
function
(
record
){
changeDateBox
(
record
);
}
});
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
var
tomorrow
=
new
Date
();
tomorrow
.
setTime
(
tomorrow
.
getTime
()
+
24
*
60
*
60
*
1000
);
$
(
"#START_TIME"
).
datebox
(
'setValue'
,
formatDtoStrDay
(
new
Date
()));
$
(
"#END_TIME"
).
datebox
(
'setValue'
,
formatDtoStrDay
(
tomorrow
));
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
initColorAssembly
(
'#ECC'
);
}
//保存
function
insertData
(
is_entity
){
var
v_result
=
calendarModule
.
act
.
saveCalendarCompanyInfo
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
//加载修改子页面
function
editRow
(
index
)
{
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'update'
;
openEditRow
(
"calendarView_calendarTabDetail"
,
is_row
[
0
],
"编辑"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载修改子页面成功后的回调
function
updateUrlOnloadCallback
(
is_row
){
var
new_is_row
=
{};
for
(
k
in
is_row
){
new_is_row
[
'FIELD_'
+
k
]
=
is_row
[
k
];
}
$
(
"#inputForm"
).
form
(
'load'
,
new_is_row
);
$
(
'#ALLDAY'
).
combobox
({
data
:
v_allday_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
onSelect
:
function
(
record
){
changeDateBox
(
record
);
}
});
if
(
$
(
'#ALLDAY'
).
val
()
==
0
){
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
else
{
$
(
"#START_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#END_TIME"
).
datetimebox
({
required
:
true
});
$
(
'#START_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
initColorAssembly
(
is_row
.
COLOR
);
}
//保存
function
updateData
(
is_entity
){
var
v_result
=
calendarModule
.
act
.
saveCalendarCompanyInfo
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
UUID
=
code
;
var
v_result
=
calendarModule
.
act
.
removeCalendarCompanyInfo
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需删除的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
UUID
=
code
;
var
v_result
=
calendarModule
.
act
.
removeCalendarInfo
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#calendarTab_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#calendarTab_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
}
/****/
/**
* 序号:10
* 功能:高级查询弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载高级查询子页面
function
advsearchRow
(){
var
is_row
=
{
OPETYPE
:
'ww'
};
openAdvsearchRow
(
"studentView_studentAdvsearch"
,
is_row
,
"高级查询"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载高级查询子页面成功后的回调
function
addAdvsearchCallback
(
is_row
){
$
(
'#adv_STATUS'
).
combobox
({
data
:
v_statusquery_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
$
(
'#adv_SEX'
).
combobox
({
data
:
v_sexquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
$
(
'#adv_NATION'
).
combobox
({
data
:
v_nationquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'200'
});
}
//高级查询
function
advsearchData
(
is_entity
){
is_entity
.
FIELD_START_TIME
=
strToDateObj
(
is_entity
.
FIELD_START_TIME
);
is_entity
.
FIELD_END_TIME
=
strToDateObj
(
is_entity
.
FIELD_END_TIME
);
$
(
'#list'
).
datagrid
(
'load'
,
is_entity
);
}
/****/
/**
* 序号:11
* 功能:处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
uploadcommonRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
var
is_row
=
{
MAINDATA_ID
:
code
,
MODULE_ID
:
ls_module_id
};
var
editUrl
=
"uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="
+
ls_module_id
+
"&FIELD_MAINDATA_ID="
+
code
;
openViewIframRow
(
"uploadcommon"
,
editUrl
,
is_row
,
"毕业证附件"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
/****/
/**
* 序号:12
* 功能:批量处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
uploadcommonBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
var
is_row
=
{
MAINDATA_ID
:
code
,
MODULE_ID
:
ls_module_id
};
var
editUrl
=
"uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="
+
ls_module_id
+
"&FIELD_MAINDATA_ID="
+
code
;
openViewIframRow
(
"uploadcommon"
,
editUrl
,
is_row
,
"批量毕业证附件"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
/****/
/**
* 初始化颜色组件
*/
function
initColorAssembly
(
color
){
$
(
"#COLOR"
).
spectrum
({
/*allowEmpty:true,*/
color
:
color
,
showInput
:
true
,
containerClassName
:
"full-spectrum"
,
showInitial
:
true
,
showPalette
:
true
,
showSelectionPalette
:
true
,
showAlpha
:
true
,
maxPaletteSize
:
10
,
preferredFormat
:
"hex"
,
localStorageKey
:
"spectrum.demo"
,
move
:
function
(
color
)
{
//updateBorders(color);
},
show
:
function
()
{},
beforeShow
:
function
()
{},
hide
:
function
(
color
)
{
var
hexColor
=
"transparent"
;
if
(
color
)
{
hexColor
=
color
.
toHexString
();
}
$
(
"#docs-content"
).
css
(
"border-color"
,
hexColor
);
$
(
this
).
val
(
color
);
},
palette
:
[
[
"rgb(0, 0, 0)"
,
"rgb(67, 67, 67)"
,
"rgb(102, 102, 102)"
,
/*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
"rgb(204, 204, 204)"
,
"rgb(217, 217, 217)"
,
/*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/
"rgb(255, 255, 255)"
],
[
"rgb(152, 0, 0)"
,
"rgb(255, 0, 0)"
,
"rgb(255, 153, 0)"
,
"rgb(255, 255, 0)"
,
"rgb(0, 255, 0)"
,
"rgb(0, 255, 255)"
,
"rgb(74, 134, 232)"
,
"rgb(0, 0, 255)"
,
"rgb(153, 0, 255)"
,
"rgb(255, 0, 255)"
],
[
"rgb(230, 184, 175)"
,
"rgb(244, 204, 204)"
,
"rgb(252, 229, 205)"
,
"rgb(255, 242, 204)"
,
"rgb(217, 234, 211)"
,
"rgb(208, 224, 227)"
,
"rgb(201, 218, 248)"
,
"rgb(207, 226, 243)"
,
"rgb(217, 210, 233)"
,
"rgb(234, 209, 220)"
,
"rgb(221, 126, 107)"
,
"rgb(234, 153, 153)"
,
"rgb(249, 203, 156)"
,
"rgb(255, 229, 153)"
,
"rgb(182, 215, 168)"
,
"rgb(162, 196, 201)"
,
"rgb(164, 194, 244)"
,
"rgb(159, 197, 232)"
,
"rgb(180, 167, 214)"
,
"rgb(213, 166, 189)"
,
"rgb(204, 65, 37)"
,
"rgb(224, 102, 102)"
,
"rgb(246, 178, 107)"
,
"rgb(255, 217, 102)"
,
"rgb(147, 196, 125)"
,
"rgb(118, 165, 175)"
,
"rgb(109, 158, 235)"
,
"rgb(111, 168, 220)"
,
"rgb(142, 124, 195)"
,
"rgb(194, 123, 160)"
,
"rgb(166, 28, 0)"
,
"rgb(204, 0, 0)"
,
"rgb(230, 145, 56)"
,
"rgb(241, 194, 50)"
,
"rgb(106, 168, 79)"
,
"rgb(69, 129, 142)"
,
"rgb(60, 120, 216)"
,
"rgb(61, 133, 198)"
,
"rgb(103, 78, 167)"
,
"rgb(166, 77, 121)"
,
/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
"rgb(91, 15, 0)"
,
"rgb(102, 0, 0)"
,
"rgb(120, 63, 4)"
,
"rgb(127, 96, 0)"
,
"rgb(39, 78, 19)"
,
"rgb(12, 52, 61)"
,
"rgb(28, 69, 135)"
,
"rgb(7, 55, 99)"
,
"rgb(32, 18, 77)"
,
"rgb(76, 17, 48)"
]
]
});
}
function
changeDateBox
(
record
){
var
startTime
;
var
endTime
;
var
startInput
=
$
(
'<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />'
);
var
endInput
=
$
(
'<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />'
);
var
startFather
=
$
(
"#START_TIME"
).
parent
();
var
endFather
=
$
(
"#END_TIME"
).
parent
();
if
(
record
.
CODE_ID
==
0
){
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
!=
null
&&!
''
==
startTime
){
startTime
+=
' 00:00:00'
;
}
if
(
endTime
!=
null
&&!
''
==
endTime
){
endTime
+=
' 00:00:00'
;
}
//$("#START_TIME").before('<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />');
//$("#END_TIME").before('<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />');
$
(
"#START_TIME"
).
datebox
(
'destroy'
);
$
(
"#END_TIME"
).
datebox
(
'destroy'
);
startFather
.
append
(
startInput
);
endFather
.
append
(
endInput
);
//非全天
$
(
"#START_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#END_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#START_TIME"
).
datetimebox
(
'setValue'
,
startTime
);
$
(
"#END_TIME"
).
datetimebox
(
'setValue'
,
endTime
);
$
(
'#START_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
else
{
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
!=
null
&&!
''
==
startTime
){
startTime
=
startTime
.
substring
(
0
,
9
);
}
if
(
endTime
!=
null
&&!
''
==
endTime
){
endTime
=
endTime
.
substring
(
0
,
9
);
}
//$("#START_TIME").before('<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />');
//$("#END_TIME").before('<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />');
$
(
"#START_TIME"
).
datetimebox
(
'destroy'
);
$
(
"#END_TIME"
).
datetimebox
(
'destroy'
);
startFather
.
append
(
startInput
);
endFather
.
append
(
endInput
);
//全天
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
$
(
"#START_TIME"
).
datebox
(
'setValue'
,
startTime
);
$
(
"#END_TIME"
).
datebox
(
'setValue'
,
endTime
);
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
}
\ No newline at end of file
WebContent/jwapp/pages/calendar/js/calendarModule.js
0 → 100644
View file @
8e4486a4
//此乃本模块与后台交互的方法接口部分
var
calendarModule
=
function
(
format
)
{
this
.
module
=
""
;
this
.
action
=
""
;
this
.
format
=
format
;
};
//定义数据交互
calendarModule
.
prototype
=
BusinessObject
;
//获取当前登录人的日历信息
calendarModule
.
prototype
.
listCalendarInfo
=
function
(){};
//保存当前登录人的日历信息
calendarModule
.
prototype
.
saveCalendarInfo
=
function
(){};
//删除当前登录人的日历信息
calendarModule
.
prototype
.
removeCalendarInfo
=
function
(){};
//获取公司日历信息
calendarModule
.
prototype
.
listCalendarCompanyInfo
=
function
(){};
//保存公司日历信息
calendarModule
.
prototype
.
saveCalendarCompanyInfo
=
function
(){};
//删除公司日历信息
calendarModule
.
prototype
.
removeCalendarCompanyInfo
=
function
(){};
//创建一个数据操作对象,然后再后续使用
calendarModule
.
act
=
new
calendarModule
(
"json"
).
delegate
(
"calendarAct"
);
//创建一个数据获取对象,然后再后续使用
calendarModule
.
data
=
new
calendarModule
(
"json"
).
delegate
(
"calendarData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
WebContent/jwapp/pages/calendar/js/calendarTab.js
0 → 100644
View file @
8e4486a4
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var
ls_width
=
$
(
window
).
width
();
var
ls_height
=
$
(
window
).
height
();
var
local_page
=
1
;
var
rows
=
20
;
var
listPageSize
=
[
10
,
20
,
50
,
100
,
500
,
1000
];
var
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
var
tab_n
=
0
;
//重置分页参数
function
resetQueryData
(){
queryData
=
""
;
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var
ls_module_id
=
'2'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载是否全天数据
var
v_allday_data
=
[{
CODE_ID
:
'0'
,
CODE_NAME
:
'否'
},{
CODE_ID
:
'1'
,
CODE_NAME
:
'是'
}];
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"日历管理"
;
var
is_column
=
[
[
{
field
:
'TITLE'
,
title
:
'内容'
,
width
:
380
,
align
:
'left'
},
{
field
:
'START_TIME'
,
title
:
'开始时间'
,
width
:
120
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
if
(
row
.
ALLDAY
==
0
){
return
value
.
substring
(
0
,
10
);
}
return
value
;
}},
{
field
:
'END_TIME'
,
title
:
'结束时间'
,
width
:
120
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
if
(
row
.
ALLDAY
==
0
){
return
value
.
substring
(
0
,
10
);
}
return
value
;
}},
{
field
:
'ALLDAY'
,
title
:
'全天'
,
width
:
50
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
return
value
==
0
?
"否"
:
"是"
;
}},
{
field
:
'COLOR'
,
title
:
'背景色'
,
width
:
100
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
return
'<span style="color:'
+
value
+
'">'
+
value
+
'</span>'
;
}},
{
field
:
'CREATE_USER'
,
title
:
'创建人员'
,
width
:
100
,
align
:
'center'
},
{
field
:
'CREATE_TIME'
,
title
:
'创建时间'
,
width
:
120
,
align
:
'center'
}
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
var
changeperson
=
'<a href="#" id="id_changeperson" class="easyui-linkbutton" data-options="plain:true" onclick="javascript:changepersonRow()">人员切换</a>'
;
if
(
gaowj
.
SEESION_EMID
==
'6666'
||
gaowj
.
SEESION_EMID
==
'admin'
){
$
(
'#calendarTab_changeperson'
).
html
(
changeperson
);
$
(
'#id_changeperson'
).
linkbutton
({
iconCls
:
'icon-ext-00_46'
});
}
else
{
$
(
'#calendarTab_changeperson'
).
html
(
''
);
}
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
if
(
row
.
STATUS
==
'1'
){
return
'color:green;height:30px;'
;
}
else
{
return
'color:blue;height:30px;'
;
}
}
//展示列表
datagrid
(
"list"
,
ls_title
,
gaowj
.
WEB_APP_NAME
+
"/calendarData_listCalendarInfo"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-ext-moremenu
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span>"
+
"<span data-p1="
+
index
+
" class=
\"
easyui-tooltip
\"
style=
\"
color:blue;cursor:pointer;
\"
>更多</span>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
function
getOptionMenu
(
data
,
index
){
var
returnData
=
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>编辑</a> | <span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a>"
;
return
returnData
;
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
var
is_menu_count
=
2
;
return
is_menu_count
;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function
addRow
(){
var
is_row
=
{
OPETYPE
:
'insert'
};
openEditRow
(
"calendarView_calendarTabDetail"
,
is_row
,
"新增"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载增加子页面成功后的回调
function
addUrlOnloadCallback
(
is_row
){
$
(
"#USER_ID"
).
val
(
$
(
"#FIELD_USER_ID"
).
val
());
$
(
'#ALLDAY'
).
val
(
1
);
$
(
'#COLOR'
).
val
(
'#ECC'
);
$
(
'#ALLDAY'
).
combobox
({
data
:
v_allday_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
onSelect
:
function
(
record
){
changeDateBox
(
record
);
}
});
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
var
tomorrow
=
new
Date
();
tomorrow
.
setTime
(
tomorrow
.
getTime
()
+
24
*
60
*
60
*
1000
);
$
(
"#START_TIME"
).
datebox
(
'setValue'
,
formatDtoStrDay
(
new
Date
()));
$
(
"#END_TIME"
).
datebox
(
'setValue'
,
formatDtoStrDay
(
tomorrow
));
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
initColorAssembly
(
'#ECC'
);
}
//保存
function
insertData
(
is_entity
){
var
v_result
=
calendarModule
.
act
.
saveCalendarInfo
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
//加载修改子页面
function
editRow
(
index
)
{
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'update'
;
openEditRow
(
"calendarView_calendarTabDetail"
,
is_row
[
0
],
"编辑"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载修改子页面成功后的回调
function
updateUrlOnloadCallback
(
is_row
){
var
new_is_row
=
{};
for
(
k
in
is_row
){
new_is_row
[
'FIELD_'
+
k
]
=
is_row
[
k
];
}
$
(
"#inputForm"
).
form
(
'load'
,
new_is_row
);
$
(
'#ALLDAY'
).
combobox
({
data
:
v_allday_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
onSelect
:
function
(
record
){
changeDateBox
(
record
);
}
});
if
(
$
(
'#ALLDAY'
).
val
()
==
0
){
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
else
{
$
(
"#START_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#END_TIME"
).
datetimebox
({
required
:
true
});
$
(
'#START_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
initColorAssembly
(
is_row
.
COLOR
);
}
//保存
function
updateData
(
is_entity
){
var
v_result
=
calendarModule
.
act
.
saveCalendarInfo
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
UUID
=
code
;
var
v_result
=
calendarModule
.
act
.
removeCalendarInfo
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需删除的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
UUID
=
code
;
var
v_result
=
calendarModule
.
act
.
removeCalendarInfo
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#calendarTab_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#calendarTab_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
}
/****/
/**
* 序号:10
* 功能:高级查询弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载高级查询子页面
function
advsearchRow
(){
var
is_row
=
{
OPETYPE
:
'ww'
};
openAdvsearchRow
(
"studentView_studentAdvsearch"
,
is_row
,
"高级查询"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
//加载高级查询子页面成功后的回调
function
addAdvsearchCallback
(
is_row
){
$
(
'#adv_STATUS'
).
combobox
({
data
:
v_statusquery_data
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
$
(
'#adv_SEX'
).
combobox
({
data
:
v_sexquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
$
(
'#adv_NATION'
).
combobox
({
data
:
v_nationquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'200'
});
}
//高级查询
function
advsearchData
(
is_entity
){
is_entity
.
FIELD_START_TIME
=
strToDateObj
(
is_entity
.
FIELD_START_TIME
);
is_entity
.
FIELD_END_TIME
=
strToDateObj
(
is_entity
.
FIELD_END_TIME
);
$
(
'#list'
).
datagrid
(
'load'
,
is_entity
);
}
/****/
/**
* 序号:11
* 功能:处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
uploadcommonRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
var
is_row
=
{
MAINDATA_ID
:
code
,
MODULE_ID
:
ls_module_id
};
var
editUrl
=
"uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="
+
ls_module_id
+
"&FIELD_MAINDATA_ID="
+
code
;
openViewIframRow
(
"uploadcommon"
,
editUrl
,
is_row
,
"毕业证附件"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
/****/
/**
* 序号:12
* 功能:批量处理接口附件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
uploadcommonBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
var
is_row
=
{
MAINDATA_ID
:
code
,
MODULE_ID
:
ls_module_id
};
var
editUrl
=
"uploadFileCommonView_uploadfileCommonTab?FIELD_MODULE_ID="
+
ls_module_id
+
"&FIELD_MAINDATA_ID="
+
code
;
openViewIframRow
(
"uploadcommon"
,
editUrl
,
is_row
,
"批量毕业证附件"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
/**
* 序号:23
* 功能:管理人员切换人员管理个人文件
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2018-07-23
* 单位:
* 备注:需更改
**/
function
changepersonRow
(){
var
is_title
=
"人员选择"
;
var
modifyUrl
=
gaowj
.
WEB_APP_NAME
+
"/userchoiceView_userChoice?singleSelect=true"
;
openViewIframRow1
(
"userChoice"
,
modifyUrl
,
null
,
is_title
,
true
,
0.95
,
0.95
,
0
,
0
);
}
/****/
/**
* 初始化颜色组件
*/
function
initColorAssembly
(
color
){
$
(
"#COLOR"
).
spectrum
({
/*allowEmpty:true,*/
color
:
color
,
showInput
:
true
,
containerClassName
:
"full-spectrum"
,
showInitial
:
true
,
showPalette
:
true
,
showSelectionPalette
:
true
,
showAlpha
:
true
,
maxPaletteSize
:
10
,
preferredFormat
:
"hex"
,
localStorageKey
:
"spectrum.demo"
,
move
:
function
(
color
)
{
//updateBorders(color);
},
show
:
function
()
{},
beforeShow
:
function
()
{},
hide
:
function
(
color
)
{
var
hexColor
=
"transparent"
;
if
(
color
)
{
hexColor
=
color
.
toHexString
();
}
$
(
"#docs-content"
).
css
(
"border-color"
,
hexColor
);
$
(
this
).
val
(
color
);
},
palette
:
[
[
"rgb(0, 0, 0)"
,
"rgb(67, 67, 67)"
,
"rgb(102, 102, 102)"
,
/*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
"rgb(204, 204, 204)"
,
"rgb(217, 217, 217)"
,
/*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/
"rgb(255, 255, 255)"
],
[
"rgb(152, 0, 0)"
,
"rgb(255, 0, 0)"
,
"rgb(255, 153, 0)"
,
"rgb(255, 255, 0)"
,
"rgb(0, 255, 0)"
,
"rgb(0, 255, 255)"
,
"rgb(74, 134, 232)"
,
"rgb(0, 0, 255)"
,
"rgb(153, 0, 255)"
,
"rgb(255, 0, 255)"
],
[
"rgb(230, 184, 175)"
,
"rgb(244, 204, 204)"
,
"rgb(252, 229, 205)"
,
"rgb(255, 242, 204)"
,
"rgb(217, 234, 211)"
,
"rgb(208, 224, 227)"
,
"rgb(201, 218, 248)"
,
"rgb(207, 226, 243)"
,
"rgb(217, 210, 233)"
,
"rgb(234, 209, 220)"
,
"rgb(221, 126, 107)"
,
"rgb(234, 153, 153)"
,
"rgb(249, 203, 156)"
,
"rgb(255, 229, 153)"
,
"rgb(182, 215, 168)"
,
"rgb(162, 196, 201)"
,
"rgb(164, 194, 244)"
,
"rgb(159, 197, 232)"
,
"rgb(180, 167, 214)"
,
"rgb(213, 166, 189)"
,
"rgb(204, 65, 37)"
,
"rgb(224, 102, 102)"
,
"rgb(246, 178, 107)"
,
"rgb(255, 217, 102)"
,
"rgb(147, 196, 125)"
,
"rgb(118, 165, 175)"
,
"rgb(109, 158, 235)"
,
"rgb(111, 168, 220)"
,
"rgb(142, 124, 195)"
,
"rgb(194, 123, 160)"
,
"rgb(166, 28, 0)"
,
"rgb(204, 0, 0)"
,
"rgb(230, 145, 56)"
,
"rgb(241, 194, 50)"
,
"rgb(106, 168, 79)"
,
"rgb(69, 129, 142)"
,
"rgb(60, 120, 216)"
,
"rgb(61, 133, 198)"
,
"rgb(103, 78, 167)"
,
"rgb(166, 77, 121)"
,
/*"rgb(133, 32, 12)", "rgb(153, 0, 0)", "rgb(180, 95, 6)", "rgb(191, 144, 0)", "rgb(56, 118, 29)",
"rgb(19, 79, 92)", "rgb(17, 85, 204)", "rgb(11, 83, 148)", "rgb(53, 28, 117)", "rgb(116, 27, 71)",*/
"rgb(91, 15, 0)"
,
"rgb(102, 0, 0)"
,
"rgb(120, 63, 4)"
,
"rgb(127, 96, 0)"
,
"rgb(39, 78, 19)"
,
"rgb(12, 52, 61)"
,
"rgb(28, 69, 135)"
,
"rgb(7, 55, 99)"
,
"rgb(32, 18, 77)"
,
"rgb(76, 17, 48)"
]
]
});
}
function
changeDateBox
(
record
){
var
startTime
;
var
endTime
;
var
startInput
=
$
(
'<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />'
);
var
endInput
=
$
(
'<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />'
);
var
startFather
=
$
(
"#START_TIME"
).
parent
();
var
endFather
=
$
(
"#END_TIME"
).
parent
();
if
(
record
.
CODE_ID
==
0
){
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
!=
null
&&!
''
==
startTime
){
startTime
+=
' 00:00:00'
;
}
if
(
endTime
!=
null
&&!
''
==
endTime
){
endTime
+=
' 00:00:00'
;
}
//$("#START_TIME").before('<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />');
//$("#END_TIME").before('<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />');
$
(
"#START_TIME"
).
datebox
(
'destroy'
);
$
(
"#END_TIME"
).
datebox
(
'destroy'
);
startFather
.
append
(
startInput
);
endFather
.
append
(
endInput
);
//非全天
$
(
"#START_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#END_TIME"
).
datetimebox
({
required
:
true
});
$
(
"#START_TIME"
).
datetimebox
(
'setValue'
,
startTime
);
$
(
"#END_TIME"
).
datetimebox
(
'setValue'
,
endTime
);
$
(
'#START_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datetimebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
else
{
startTime
=
$
(
"#START_TIME"
).
datetimebox
(
'getValue'
);
endTime
=
$
(
"#END_TIME"
).
datetimebox
(
'getValue'
);
if
(
startTime
!=
null
&&!
''
==
startTime
){
startTime
=
startTime
.
substring
(
0
,
9
);
}
if
(
endTime
!=
null
&&!
''
==
endTime
){
endTime
=
endTime
.
substring
(
0
,
9
);
}
//$("#START_TIME").before('<input id="START_TIME" name="FIELD_START_TIME" style="width:300px" />');
//$("#END_TIME").before('<input id="END_TIME" name="FIELD_END_TIME" style="width:300px" />');
$
(
"#START_TIME"
).
datetimebox
(
'destroy'
);
$
(
"#END_TIME"
).
datetimebox
(
'destroy'
);
startFather
.
append
(
startInput
);
endFather
.
append
(
endInput
);
//全天
$
(
"#START_TIME"
).
datebox
({
required
:
true
});
$
(
"#END_TIME"
).
datebox
({
required
:
true
});
$
(
"#START_TIME"
).
datebox
(
'setValue'
,
startTime
);
$
(
"#END_TIME"
).
datebox
(
'setValue'
,
endTime
);
$
(
'#START_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
endTime
=
$
(
"#END_TIME"
).
datebox
(
'getValue'
);
if
(
endTime
==
null
||
endTime
==
''
){
return
true
;
}
return
new
Date
(
endTime
).
getTime
()
>=
date
;
}
});
$
(
'#END_TIME'
).
datebox
(
'calendar'
).
calendar
({
validator
:
function
(
date
){
var
startTime
=
$
(
"#START_TIME"
).
datebox
(
'getValue'
);
if
(
startTime
==
null
||
startTime
==
''
){
return
true
;
}
return
new
Date
(
startTime
).
getTime
()
<=
date
;
}
});
}
}
//选单位和人员后回调方法
function
closeCallback1
(
is_entity
){
var
ret_uuids
=
$
(
'#return_text'
).
text
();
if
(
ret_uuids
==
''
||
ret_uuids
==
null
||
ret_uuids
==
undefined
){
return
;
}
$
(
"#FIELD_USER_ID"
).
val
(
ret_uuids
);
searchRow
();
}
\ No newline at end of file
WebContent/jwapp/pages/portlet/js/jwAppPortletModule.js
View file @
8e4486a4
...
@@ -16,12 +16,6 @@ jwAppPortletModel.prototype.listAllPortletColumns = function(){};
...
@@ -16,12 +16,6 @@ jwAppPortletModel.prototype.listAllPortletColumns = function(){};
jwAppPortletModel
.
prototype
.
listAllPTemplate
=
function
(){};
jwAppPortletModel
.
prototype
.
listAllPTemplate
=
function
(){};
//保存用户的资源列表
//保存用户的资源列表
jwAppPortletModel
.
prototype
.
saveLayout
=
function
(){};
jwAppPortletModel
.
prototype
.
saveLayout
=
function
(){};
//获取当前登录人的日历信息
jwAppPortletModel
.
prototype
.
listCalendarInfo
=
function
(){};
//保存当前登录人的日历信息
jwAppPortletModel
.
prototype
.
saveCalendarInfo
=
function
(){};
//删除当前登录人的日历信息
jwAppPortletModel
.
prototype
.
removeCalendarInfo
=
function
(){};
//创建一个数据操作对象,然后再后续使用
//创建一个数据操作对象,然后再后续使用
jwAppPortletModel
.
jwAppsPortletActAction
=
new
jwAppPortletModel
(
"json"
).
delegate
(
"frontPortletAct"
);
jwAppPortletModel
.
jwAppsPortletActAction
=
new
jwAppPortletModel
(
"json"
).
delegate
(
"frontPortletAct"
);
...
...
src/struts-ext.xml
View file @
8e4486a4
...
@@ -89,6 +89,23 @@
...
@@ -89,6 +89,23 @@
<action
name=
"userchoiceView_*"
class=
"com.jw.app.userchoice.action.viewAction"
method=
"{1}"
>
<action
name=
"userchoiceView_*"
class=
"com.jw.app.userchoice.action.viewAction"
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/userchoice/{1}.jsp
</result>
<result
name=
"{1}"
>
/jwapp/pages/userchoice/{1}.jsp
</result>
</action>
</action>
<!-- 日历相关 -->
<action
name=
"calendarAct_*"
class=
"com.jw.app.calendar.action.actAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"calendarData_*"
class=
"com.jw.app.calendar.action.dataAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"calendarView_*"
class=
"com.jw.app.calendar.action.viewAction"
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/calendar/{1}.jsp
</result>
</action>
</package>
</package>
<package
name=
"src_jwapp_store"
extends=
"gaowj"
>
<package
name=
"src_jwapp_store"
extends=
"gaowj"
>
<action
name=
"storeAct_*"
class=
"com.jw.app.store.action.actAction"
<action
name=
"storeAct_*"
class=
"com.jw.app.store.action.actAction"
...
...
src_jwapp/com/jw/app/business/CalendarBusiness.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
business
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
@Service
public
interface
CalendarBusiness
{
Page
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
Map
<
String
,
Object
>
save_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar
(
String
uuid
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_calendar_by_company
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
Map
<
String
,
Object
>
save_calendar_by_company
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar_company
(
String
uuid
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/PortletBusiness.java
View file @
8e4486a4
...
@@ -18,9 +18,4 @@ public interface PortletBusiness {
...
@@ -18,9 +18,4 @@ public interface PortletBusiness {
void
saveLayout
(
String
columnsId
,
List
<
Map
<
String
,
Object
>>
list
)
throws
BusinessException
;
void
saveLayout
(
String
columnsId
,
List
<
Map
<
String
,
Object
>>
list
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
Map
<
String
,
Object
>
save_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar
(
String
uuid
)
throws
BusinessException
;
}
}
src_jwapp/com/jw/app/business/calendar/CalendarBusinessImpl.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
business
.
calendar
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SessionUtil
;
import
com.jw.app.business.CalendarBusiness
;
import
com.jw.app.business.utils.DateTools
;
public
class
CalendarBusinessImpl
implements
CalendarBusiness
{
private
calendarDAO
calendarDAO
;
public
calendarDAO
getCalendarDAO
()
{
return
calendarDAO
;
}
public
void
setCalendarDAO
(
calendarDAO
calendarDAO
)
{
this
.
calendarDAO
=
calendarDAO
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
if
(
query
.
get
(
"START_TIME"
)
!=
null
)
{
try
{
query
.
put
(
"START_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"START_TIME"
).
toString
())));
}
catch
(
NumberFormatException
e
)
{
try
{
query
.
put
(
"START_TIME"
,
DateTools
.
strToDate
(
query
.
get
(
"START_TIME"
).
toString
()));
}
catch
(
ParseException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
}
}
if
(
query
.
get
(
"END_TIME"
)
!=
null
)
{
try
{
query
.
put
(
"END_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"END_TIME"
).
toString
())));
}
catch
(
NumberFormatException
e
)
{
try
{
query
.
put
(
"END_TIME"
,
DateTools
.
strToDate
(
query
.
get
(
"END_TIME"
).
toString
()));
}
catch
(
ParseException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
}
}
if
(
query
.
get
(
"TITLE"
)
!=
null
&&
!
""
.
equals
(
query
.
get
(
"TITLE"
)))
{
query
.
put
(
"TITLE_LIKE"
,
"%"
+
query
.
get
(
"TITLE"
)
+
"%"
);
}
if
(
query
.
get
(
"USER_ID"
)
==
null
||
""
.
equals
(
query
.
get
(
"USER_ID"
)))
{
// 默认查询当前登陆人
query
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
}
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
List
<
Map
<
String
,
Object
>>
items
=
calendarDAO
.
list_calendar_by_user
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
calendarDAO
.
list_count_calendar_by_user
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
Map
<
String
,
Object
>
save_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
{
if
(
info
.
get
(
"UUID"
)
==
null
||
""
.
equals
(
info
.
get
(
"UUID"
)))
{
// 表示新增
info
.
put
(
"UUID"
,
UUID
.
randomUUID
().
toString
());
if
(
info
.
get
(
"USER_ID"
)
==
null
||
""
.
equals
(
info
.
get
(
"USER_ID"
)))
{
// 如果没有传USER_ID过来,则使用当前登录人id
info
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
}
info
.
put
(
"CREATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"CREATE_TIME"
,
new
Date
());
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k
:
info
.
keySet
())
{
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
calendarDAO
.
insert_calendar
(
info
);
}
else
{
// 表示更新
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
// 防止修改记录的所属人
info
.
remove
(
"USER_ID"
);
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k
:
info
.
keySet
())
{
if
(
"UUID"
.
equals
(
k
))
{
continue
;
}
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
calendarDAO
.
update_calendar
(
info
);
}
return
info
;
}
@Override
public
void
delete_calendar
(
String
uuid
)
throws
BusinessException
{
for
(
String
u
:
uuid
.
split
(
","
))
{
calendarDAO
.
delete_calendar
(
u
);
}
}
@Override
public
Page
<
Map
<
String
,
Object
>>
list_calendar_by_company
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
if
(
query
.
get
(
"START_TIME"
)
!=
null
)
{
try
{
query
.
put
(
"START_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"START_TIME"
).
toString
())));
}
catch
(
NumberFormatException
e
)
{
try
{
query
.
put
(
"START_TIME"
,
DateTools
.
strToDate
(
query
.
get
(
"START_TIME"
).
toString
()));
}
catch
(
ParseException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
}
}
if
(
query
.
get
(
"END_TIME"
)
!=
null
)
{
try
{
query
.
put
(
"END_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"END_TIME"
).
toString
())));
}
catch
(
NumberFormatException
e
)
{
try
{
query
.
put
(
"END_TIME"
,
DateTools
.
strToDate
(
query
.
get
(
"END_TIME"
).
toString
()));
}
catch
(
ParseException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
}
}
if
(
query
.
get
(
"TITLE"
)
!=
null
&&
!
""
.
equals
(
query
.
get
(
"TITLE"
)))
{
query
.
put
(
"TITLE_LIKE"
,
"%"
+
query
.
get
(
"TITLE"
)
+
"%"
);
}
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
List
<
Map
<
String
,
Object
>>
items
=
calendarDAO
.
list_calendar_by_company
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
calendarDAO
.
list_count_calendar_by_company
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
Map
<
String
,
Object
>
save_calendar_by_company
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
{
if
(
info
.
get
(
"UUID"
)
==
null
||
""
.
equals
(
info
.
get
(
"UUID"
)))
{
// 表示新增
info
.
put
(
"UUID"
,
UUID
.
randomUUID
().
toString
());
info
.
put
(
"CREATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"CREATE_TIME"
,
new
Date
());
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k
:
info
.
keySet
())
{
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
calendarDAO
.
insert_calendar_by_company
(
info
);
}
else
{
// 表示更新
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k
:
info
.
keySet
())
{
if
(
"UUID"
.
equals
(
k
))
{
continue
;
}
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
calendarDAO
.
update_calendar_by_company
(
info
);
}
return
info
;
}
@Override
public
void
delete_calendar_company
(
String
uuid
)
throws
BusinessException
{
for
(
String
u
:
uuid
.
split
(
","
))
{
calendarDAO
.
delete_calendar_by_company
(
u
);
}
}
}
src_jwapp/com/jw/app/business/calendar/calendarDAO.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
business
.
calendar
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
calendarDAO
{
List
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
list_count_calendar_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
void
insert_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
update_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar
(
String
uuid
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_calendar_by_company
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
list_count_calendar_by_company
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_calendar_by_company
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
void
insert_calendar_by_company
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
update_calendar_by_company
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar_by_company
(
String
uuid
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/calendar/calendarDAO.xml
0 → 100644
View file @
8e4486a4
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jw.app.business.calendar.calendarDAO"
>
<sql
id=
"where_user"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"USER_ID != null and USER_ID != ''"
>
and t.USER_ID = #{USER_ID}
</if>
<if
test=
"TITLE_LIKE != null and TITLE_LIKE != ''"
>
and t.TITLE LIKE #{TITLE_LIKE}
</if>
<!-- 开始时间或者结束时间,有一个在用户传进来的时间范围内就给予显示 -->
<if
test=
"START_TIME != null and START_TIME != '' and END_TIME != null and END_TIME != ''"
>
<![CDATA[
and ((t.START_TIME >
= #{START_TIME} and t.START_TIME
<
= #{END_TIME}) or (t.END_TIME >= #{START_TIME} and t.END_TIME
<
= #{END_TIME}))
]]>
</if>
<if
test=
"START_TIME != null and START_TIME != '' and (END_TIME == null or END_TIME == '')"
>
<![CDATA[
and ((t.START_TIME >
= #{START_TIME}) or (t.END_TIME >= #{START_TIME} ))
]]>
</if>
<if
test=
"(END_TIME != null and END_TIME != '' and START_TIME == null or START_TIME == '')"
>
<![CDATA[
and ((t.START_TIME <= #{END_TIME}) or (t.END_TIME <= #{END_TIME}))
]]>
</if>
</trim>
</where>
</sql>
<sql
id=
"where_company"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"TITLE_LIKE != null and TITLE_LIKE != ''"
>
and t.TITLE LIKE #{TITLE_LIKE}
</if>
<!-- 开始时间或者结束时间,有一个在用户传进来的时间范围内就给予显示 -->
<if
test=
"START_TIME != null and START_TIME != '' and END_TIME != null and END_TIME != ''"
>
<![CDATA[
and ((t.START_TIME >
= #{START_TIME} and t.START_TIME
<
= #{END_TIME}) or (t.END_TIME >= #{START_TIME} and t.END_TIME
<
= #{END_TIME}))
]]>
</if>
<if
test=
"START_TIME != null and START_TIME != '' and (END_TIME == null or END_TIME == '')"
>
<![CDATA[
and ((t.START_TIME >
= #{START_TIME}) or (t.END_TIME >= #{START_TIME} ))
]]>
</if>
<if
test=
"(END_TIME != null and END_TIME != '' and START_TIME == null or START_TIME == '')"
>
<![CDATA[
and ((t.START_TIME <= #{END_TIME}) or (t.END_TIME <= #{END_TIME}))
]]>
</if>
</trim>
</where>
</sql>
<select
id=
"list_calendar_by_user"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
select * from b_t_ufp_calendar t
]]>
<include
refid=
"where_user"
/>
ORDER BY t.create_time DESC
</select>
<select
id=
"list_count_calendar_by_user"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
select count(*) from b_t_ufp_calendar t
]]>
<include
refid=
"where_user"
/>
ORDER BY t.create_time DESC
</select>
<insert
id=
"insert_calendar"
parameterType=
"java.util.List"
>
insert into b_t_ufp_calendar(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_calendar"
parameterType=
"java.util.List"
>
update b_t_ufp_calendar set
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete
id=
"delete_calendar"
parameterType=
"String"
>
delete from b_t_ufp_calendar where UUID=#{uuid}
</delete>
<select
id=
"list_calendar_by_company"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
select * from b_t_ufp_calendar_company t
]]>
<include
refid=
"where_company"
/>
ORDER BY t.create_time DESC
</select>
<select
id=
"list_count_calendar_by_company"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
select count(*) from b_t_ufp_calendar_company t
]]>
<include
refid=
"where_company"
/>
ORDER BY t.create_time DESC
</select>
<insert
id=
"insert_calendar_by_company"
parameterType=
"java.util.List"
>
insert into b_t_ufp_calendar_company(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_calendar_by_company"
parameterType=
"java.util.List"
>
update b_t_ufp_calendar_company set
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete
id=
"delete_calendar_by_company"
parameterType=
"String"
>
delete from b_t_ufp_calendar_company where UUID=#{uuid}
</delete>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/business/portlet/PortletBusinessImpl.java
View file @
8e4486a4
...
@@ -191,58 +191,6 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -191,58 +191,6 @@ public class PortletBusinessImpl implements PortletBusiness {
}
}
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
query
.
put
(
"START_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"START_TIME"
).
toString
())));
query
.
put
(
"END_TIME"
,
new
Date
(
Long
.
valueOf
(
query
.
get
(
"END_TIME"
).
toString
())));
return
portletDAO
.
list_calendar_by_user
(
query
);
}
@Override
public
Map
<
String
,
Object
>
save_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
{
if
(
info
.
get
(
"UUID"
)==
null
||
""
.
equals
(
info
.
get
(
"UUID"
))){
//表示新增
info
.
put
(
"UUID"
,
UUID
.
randomUUID
().
toString
());
info
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
info
.
put
(
"CREATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"CREATE_TIME"
,
new
Date
());
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k:
info
.
keySet
()){
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
portletDAO
.
insert_calendar
(
info
);
}
else
{
//表示更新
info
.
put
(
"UPDATE_USER"
,
SessionUtil
.
getEmid
());
info
.
put
(
"UPDATE_TIME"
,
new
Date
());
List
<
Map
<
String
,
Object
>>
listField
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
String
k:
info
.
keySet
()){
if
(
"UUID"
.
equals
(
k
)){
continue
;
}
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
k
);
field
.
put
(
"value"
,
info
.
get
(
k
));
listField
.
add
(
field
);
}
info
.
put
(
"list"
,
listField
);
portletDAO
.
update_calendar
(
info
);
}
return
info
;
}
@Override
public
void
delete_calendar
(
String
uuid
)
throws
BusinessException
{
portletDAO
.
delete_calendar
(
uuid
);
}
private
List
<
Map
<
String
,
Object
>>
mapToList
(
Map
<
String
,
Object
>
map
)
{
private
List
<
Map
<
String
,
Object
>>
mapToList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
entity
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
entity
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
...
...
src_jwapp/com/jw/app/business/portlet/PortletDAO.java
View file @
8e4486a4
...
@@ -8,7 +8,6 @@ import org.apache.ibatis.session.RowBounds;
...
@@ -8,7 +8,6 @@ import org.apache.ibatis.session.RowBounds;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
PortletDAO
{
public
interface
PortletDAO
{
List
<
Map
<
String
,
Object
>>
list_calendar_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_portlet_template_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_portlet_template_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
...
@@ -23,10 +22,4 @@ public interface PortletDAO {
...
@@ -23,10 +22,4 @@ public interface PortletDAO {
void
delete_portlet_template_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
void
delete_portlet_template_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
void
insert_portlet_template_user
(
List
<
Map
<
String
,
Object
>>
entity
)
throws
BusinessException
;
void
insert_portlet_template_user
(
List
<
Map
<
String
,
Object
>>
entity
)
throws
BusinessException
;
void
insert_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
update_calendar
(
Map
<
String
,
Object
>
info
)
throws
BusinessException
;
void
delete_calendar
(
String
uuid
)
throws
BusinessException
;
}
}
src_jwapp/com/jw/app/business/portlet/PortletDAO.xml
View file @
8e4486a4
...
@@ -152,51 +152,4 @@
...
@@ -152,51 +152,4 @@
</trim>
</trim>
<![CDATA[ ) ]]>
<![CDATA[ ) ]]>
</insert>
</insert>
<select
id=
"list_calendar_by_user"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
select * from b_t_ufp_calendar t
]]>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND |OR"
>
<if
test=
"USER_ID != null and USER_ID != ''"
>
and t.USER_ID = #{USER_ID}
</if>
<!-- 开始时间或者结束时间,有一个在用户传进来的时间范围内就给予显示 -->
<![CDATA[
and ((t.START_TIME >
= #{START_TIME} and t.START_TIME
<
= #{END_TIME}) or (t.END_TIME >= #{START_TIME} and t.END_TIME
<
= #{END_TIME}))
]]>
</trim>
ORDER BY t.create_time DESC
</select>
<insert
id=
"insert_calendar"
parameterType=
"java.util.List"
>
insert into b_t_ufp_calendar(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
#{field.value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_calendar"
parameterType=
"java.util.List"
>
update b_t_ufp_calendar set
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"list"
item=
"field"
>
${field.key}=#{field.value},
</foreach>
</trim>
where UUID=#{UUID}
</update>
<delete
id=
"delete_calendar"
parameterType=
"String"
>
delete from b_t_ufp_calendar where UUID=#{uuid}
</delete>
</mapper>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/calendar/action/actAction.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
calendar
.
action
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.CalendarBusiness
;
import
com.jw.app.business.utils.Status
;
import
net.sf.json.JSONObject
;
public
class
actAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
124457626402410251L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
/**
* 保存日历信息
*
* @return
* @throws BusinessException
*/
public
String
saveCalendarInfo
()
throws
BusinessException
{
Map
<
String
,
Object
>
info
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
try
{
info
=
QueryParamUtil
.
StringToDate
(
info
);
info
.
remove
(
"OPETYPE"
);
business
.
save_calendar
(
info
);
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_ERR
));
}
return
"json"
;
}
/**
* 删除日历信息
*
* @return
* @throws BusinessException
*/
public
String
removeCalendarInfo
()
throws
BusinessException
{
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
try
{
business
.
delete_calendar
(
RequestUtils
.
getString
(
request
,
"UUID"
));
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_ERR
));
}
return
"json"
;
}
/**
* 保存公司日历信息
*
* @return
* @throws BusinessException
*/
public
String
saveCalendarCompanyInfo
()
throws
BusinessException
{
Map
<
String
,
Object
>
info
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
try
{
info
=
QueryParamUtil
.
StringToDate
(
info
);
info
.
remove
(
"OPETYPE"
);
business
.
save_calendar_by_company
(
info
);
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_ERR
));
}
return
"json"
;
}
/**
* 删除公司日历信息
*
* @return
* @throws BusinessException
*/
public
String
removeCalendarCompanyInfo
()
throws
BusinessException
{
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
try
{
business
.
delete_calendar_company
(
RequestUtils
.
getString
(
request
,
"UUID"
));
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_ERR
));
}
return
"json"
;
}
}
src_jwapp/com/jw/app/calendar/action/dataAction.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
calendar
.
action
;
import
java.sql.SQLException
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.CalendarBusiness
;
import
net.sf.json.JSONObject
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1838735286131979745L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
int
rows
=
20
;
// 每页显示的记录数
private
int
page
=
1
;
// 当前第几页
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
public
int
getRows
()
{
rows
=
getPageSize
();
return
rows
;
}
public
void
setRows
(
int
rows
)
{
setPageSize
(
rows
);
this
.
rows
=
getPageSize
();
}
public
int
getPage
()
{
page
=
getPageNo
();
return
page
;
}
public
void
setPage
(
int
page
)
{
setPageNo
(
page
);
this
.
page
=
getPageNo
();
}
/**
* 获取日历信息列表
*
* @return
* @throws BusinessException
*/
public
String
listCalendarInfo
()
throws
BusinessException
{
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageData
=
business
.
list_calendar_by_user
(
pageNo
,
pageSize
,
query
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
pageData
.
getItems
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageData
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 获取公司日历列表
*
* @return
* @throws BusinessException
*/
public
String
listCalendarCompanyInfo
()
throws
BusinessException
{
CalendarBusiness
business
=
BusinessManager
.
getBusiness
(
CalendarBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageData
=
business
.
list_calendar_by_company
(
pageNo
,
pageSize
,
query
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
pageData
.
getItems
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageData
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/calendar/action/viewAction.java
0 → 100644
View file @
8e4486a4
package
com
.
jw
.
app
.
calendar
.
action
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.exception.BusinessException
;
public
class
viewAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6713122465589081789L
;
public
String
calendarTab
()
throws
BusinessException
{
return
"calendarTab"
;
}
public
String
calendarTabDetail
()
throws
BusinessException
{
return
"calendarTabDetail"
;
}
public
String
calendarCompanyTab
()
throws
BusinessException
{
return
"calendarCompanyTab"
;
}
public
String
calendarCompanyTabDetail
()
throws
BusinessException
{
return
"calendarCompanyTabDetail"
;
}
}
src_jwapp/com/jw/app/portlet/action/actAction.java
View file @
8e4486a4
...
@@ -10,12 +10,10 @@ import com.gaowj.business.comp.BusinessManager;
...
@@ -10,12 +10,10 @@ import com.gaowj.business.comp.BusinessManager;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.PortletBusiness
;
import
com.jw.app.business.PortletBusiness
;
import
com.jw.app.business.utils.QueryParamUtil
;
import
com.jw.app.business.utils.Status
;
import
com.jw.app.business.utils.Status
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
net.sf.json.util.JSONUtils
;
public
class
actAction
extends
BasicAction
{
public
class
actAction
extends
BasicAction
{
...
@@ -53,31 +51,4 @@ public class actAction extends BasicAction {
...
@@ -53,31 +51,4 @@ public class actAction extends BasicAction {
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_OK
));
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_OK
));
return
"json"
;
return
"json"
;
}
}
public
String
saveCalendarInfo
()
throws
BusinessException
{
Map
<
String
,
Object
>
info
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
PortletBusiness
business
=
BusinessManager
.
getBusiness
(
PortletBusiness
.
class
);
try
{
info
=
QueryParamUtil
.
StringToDate
(
info
);
business
.
save_calendar
(
info
);
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
UPDATE_ERR
));
}
return
"json"
;
}
public
String
removeCalendarInfo
()
throws
BusinessException
{
PortletBusiness
business
=
BusinessManager
.
getBusiness
(
PortletBusiness
.
class
);
try
{
business
.
delete_calendar
(
RequestUtils
.
getString
(
request
,
"UUID"
));
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_OK
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatus
(
Status
.
DELETE_ERR
));
}
return
"json"
;
}
}
}
src_jwapp/com/jw/app/portlet/action/dataAction.java
View file @
8e4486a4
...
@@ -172,46 +172,4 @@ public class dataAction extends BasicAction {
...
@@ -172,46 +172,4 @@ public class dataAction extends BasicAction {
}
}
return
"json"
;
return
"json"
;
}
}
/**
* 获取当前登录人的日历信息
* @return
* @throws BusinessException
*/
public
String
listCalendarInfo
()
throws
BusinessException
{
PortletBusiness
business
=
BusinessManager
.
getBusiness
(
PortletBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
//设置当前登陆人
query
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list_calendar_by_user
(
query
);
for
(
Map
<
String
,
Object
>
rm
:
listData
)
{
if
(
rm
.
get
(
"P_TYPE"
)==
null
||!
rm
.
get
(
"P_TYPE"
).
equals
(
"3"
))
{
rm
.
remove
(
"RSS_CONTENT"
);
rm
.
remove
(
"TAKE_CONTENT"
);
}
}
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listData
.
size
());
data
.
put
(
"pageCount"
,
listData
.
size
());
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
listData
.
size
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment