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
6be3d484
Commit
6be3d484
authored
Aug 08, 2018
by
罗绍泽
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
parents
5fd9581a
524708dd
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
5353 additions
and
695 deletions
+5353
-695
applicationContext-business.xml
...ent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
+66
-18
business-apps.xml
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
+10
-0
disk_lump_noFile.png
WebContent/custom/images/disk_lump_noFile.png
+0
-0
disk_txt.png
WebContent/custom/images/disk_txt.png
+0
-0
header-simple-1.0.jsp
WebContent/gaowj/header-simple-1.0.jsp
+4
-4
icon.css
...tent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
+7
-0
login.jsp
WebContent/jfcas01/login.jsp
+11
-0
login.jsp
WebContent/jfcas02/login.jsp
+11
-0
login.jsp
WebContent/jfcas03/login.jsp
+11
-0
common.css
WebContent/jfcas04/css/common.css
+54
-3
disk.jsp
WebContent/jfcas04/disk.jsp
+12
-6
index.jsp
WebContent/jfcas04/index.jsp
+4
-3
disk.js
WebContent/jfcas04/js/disk.js
+753
-447
disk.js.bak
WebContent/jfcas04/js/disk.js.bak
+2122
-0
index.js
WebContent/jfcas04/js/index.js
+5
-4
login.jsp
WebContent/jfcas04/login.jsp
+11
-0
jwAppAppsModule.js
WebContent/jwapp/pages/apps/js/jwAppAppsModule.js
+2
-2
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
+2
-8
storePersonalTabDetail.jsp
...tent/jwapp/pages/storepersonal/storePersonalTabDetail.jsp
+1
-0
xcConfirm.css
WebContent/lib/plug/xcConfirm/css/xcConfirm.css
+1
-1
nav4.jsp
WebContent/nav4.jsp
+5
-4
struts-ext.xml
src/struts-ext.xml
+22
-5
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
storePersonalDAO.xml
...p/com/jw/app/business/store/personal/storePersonalDAO.xml
+1
-3
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
actAction.java
src_jwapp/com/jw/app/store/action/personal/actAction.java
+50
-3
CasAction.java
src_system/com/gaowj/system/login/CasAction.java
+10
-1
No files found.
WebContent/WEB-INF/conf/gaowj/bl/applicationContext-business.xml
View file @
6be3d484
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<!-- 配置初始化大小、最小、最大 -->
<!-- 配置初始化大小、最小、最大 -->
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"maxActive"
value=
"
2
0"
/>
<property
name=
"maxActive"
value=
"
50
0"
/>
<!-- 配置获取连接等待超时的时间 -->
<!-- 配置获取连接等待超时的时间 -->
<property
name=
"maxWait"
value=
"60000"
/>
<property
name=
"maxWait"
value=
"60000"
/>
...
@@ -38,17 +38,33 @@
...
@@ -38,17 +38,33 @@
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<!--
配置一个连接在池中最小生存的时间,单位是毫秒
-->
<!--
超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭
-->
<property
name=
"
minEvictableIdleTimeMillis"
value=
"300000"
/>
<property
name=
"
removeAbandoned"
value=
"true"
/>
<!-- 超过时间限制多长,单位秒 -->
<property
name=
"removeAbandonedTimeout"
value=
"60"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property
name=
"maxEvictableIdleTimeMillis"
value=
"300000"
/>
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<!-- 申请连接的时候检测 -->
<property
name=
"testWhileIdle"
value=
"true"
/>
<property
name=
"testWhileIdle"
value=
"true"
/>
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnBorrow"
value=
"false"
/>
<property
name=
"testOnBorrow"
value=
"false"
/>
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnReturn"
value=
"false"
/>
<property
name=
"testOnReturn"
value=
"false"
/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property
name=
"poolPreparedStatements"
value=
"true"
/>
<property
name=
"keepAlive"
value=
"true"
/>
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"20"
/>
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property
name=
"poolPreparedStatements"
value=
"false"
/>
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"0"
/>
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property
name=
"filters"
value=
"stat"
/>
<property
name=
"filters"
value=
"stat"
/>
...
@@ -65,7 +81,7 @@
...
@@ -65,7 +81,7 @@
<!-- 配置初始化大小、最小、最大 -->
<!-- 配置初始化大小、最小、最大 -->
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"maxActive"
value=
"
2
0"
/>
<property
name=
"maxActive"
value=
"
50
0"
/>
<!-- 配置获取连接等待超时的时间 -->
<!-- 配置获取连接等待超时的时间 -->
<property
name=
"maxWait"
value=
"60000"
/>
<property
name=
"maxWait"
value=
"60000"
/>
...
@@ -73,17 +89,33 @@
...
@@ -73,17 +89,33 @@
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<!-- 超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"300000"
/>
<property
name=
"removeAbandoned"
value=
"true"
/>
<!-- 超过时间限制多长,单位秒 -->
<property
name=
"removeAbandonedTimeout"
value=
"60"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property
name=
"maxEvictableIdleTimeMillis"
value=
"300000"
/>
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<!-- 申请连接的时候检测 -->
<property
name=
"testWhileIdle"
value=
"true"
/>
<property
name=
"testWhileIdle"
value=
"true"
/>
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnBorrow"
value=
"false"
/>
<property
name=
"testOnBorrow"
value=
"false"
/>
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnReturn"
value=
"false"
/>
<property
name=
"testOnReturn"
value=
"false"
/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property
name=
"poolPreparedStatements"
value=
"true"
/>
<property
name=
"keepAlive"
value=
"true"
/>
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"20"
/>
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property
name=
"poolPreparedStatements"
value=
"false"
/>
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"0"
/>
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property
name=
"filters"
value=
"stat"
/>
<property
name=
"filters"
value=
"stat"
/>
...
@@ -100,7 +132,7 @@
...
@@ -100,7 +132,7 @@
<!-- 配置初始化大小、最小、最大 -->
<!-- 配置初始化大小、最小、最大 -->
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"initialSize"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"minIdle"
value=
"1"
/>
<property
name=
"maxActive"
value=
"
2
0"
/>
<property
name=
"maxActive"
value=
"
50
0"
/>
<!-- 配置获取连接等待超时的时间 -->
<!-- 配置获取连接等待超时的时间 -->
<property
name=
"maxWait"
value=
"60000"
/>
<property
name=
"maxWait"
value=
"60000"
/>
...
@@ -108,17 +140,33 @@
...
@@ -108,17 +140,33 @@
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<property
name=
"timeBetweenEvictionRunsMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<!-- 超过时间限制是否回收,对于建立时间超过removeAbandonedTimeout的连接强制关闭 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"300000"
/>
<property
name=
"removeAbandoned"
value=
"true"
/>
<!-- 超过时间限制多长,单位秒 -->
<property
name=
"removeAbandonedTimeout"
value=
"60"
/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒:1分钟 -->
<property
name=
"minEvictableIdleTimeMillis"
value=
"60000"
/>
<!-- 配置一个连接在池中最长生存的时间,单位是毫秒:5分钟 -->
<property
name=
"maxEvictableIdleTimeMillis"
value=
"300000"
/>
<!-- 用来检测连接是否有效的sql,要求是一个查询语句 -->
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<property
name=
"validationQuery"
value=
"SELECT 'x'"
/>
<!-- 申请连接的时候检测 -->
<property
name=
"testWhileIdle"
value=
"true"
/>
<property
name=
"testWhileIdle"
value=
"true"
/>
<!-- 申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnBorrow"
value=
"false"
/>
<property
name=
"testOnBorrow"
value=
"false"
/>
<!-- 归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 -->
<property
name=
"testOnReturn"
value=
"false"
/>
<property
name=
"testOnReturn"
value=
"false"
/>
<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
<!-- 连接池中的minIdle数量以内的连接,空闲时间超过minEvictableIdleTimeMillis,则会执行keepAlive操作 -->
<property
name=
"poolPreparedStatements"
value=
"true"
/>
<property
name=
"keepAlive"
value=
"true"
/>
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"20"
/>
<!-- 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭 -->
<property
name=
"poolPreparedStatements"
value=
"false"
/>
<!-- 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true -->
<property
name=
"maxPoolPreparedStatementPerConnectionSize"
value=
"0"
/>
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
<property
name=
"filters"
value=
"stat"
/>
<property
name=
"filters"
value=
"stat"
/>
...
...
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
View file @
6be3d484
...
@@ -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/custom/images/disk_lump_noFile.png
0 → 100644
View file @
6be3d484
4.81 KB
WebContent/custom/images/disk_txt.png
0 → 100644
View file @
6be3d484
19.7 KB
WebContent/gaowj/header-simple-1.0.jsp
View file @
6be3d484
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="/WEB-INF/tld/functions.tld" %>
<%@ taglib prefix="fn" uri="/WEB-INF/tld/functions.tld" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ page language="java" import="java.util.Map
,java.util.Date,java.text.SimpleDateFormat
" pageEncoding="utf-8"%>
<%@ page language="java" import="java.util.Map" pageEncoding="utf-8"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
<%
String localPath = request.getContextPath();
String localPath = request.getContextPath();
...
@@ -20,9 +20,9 @@
...
@@ -20,9 +20,9 @@
String emdepart = (String)sessionUser.get("EMDEPART");//用户单位ID
String emdepart = (String)sessionUser.get("EMDEPART");//用户单位ID
String emdepartname = (String)sessionUser.get("EMDEPARTNAME");//用户单位名称
String emdepartname = (String)sessionUser.get("EMDEPARTNAME");//用户单位名称
String emname = (String)sessionUser.get("EMNAME");//用户姓名
String emname = (String)sessionUser.get("EMNAME");//用户姓名
Date beforetime = (Date
)sessionUser.get("BEFORETIME");//上次登录时间
String beforetime = (String
)sessionUser.get("BEFORETIME");//上次登录时间
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String beforetime_s =
formatter.format(beforetime)
;
String beforetime_s =
beforetime
;
String loginip = (String)sessionUser.get("LOGINIP");//登录IP
String loginip = (String)sessionUser.get("LOGINIP");//登录IP
//
//
%>
%>
...
...
WebContent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
View file @
6be3d484
...
@@ -340,3 +340,9 @@
...
@@ -340,3 +340,9 @@
.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/jfcas01/login.jsp
View file @
6be3d484
...
@@ -466,6 +466,17 @@ $(document).ready(function () {
...
@@ -466,6 +466,17 @@ $(document).ready(function () {
// 点击记住密码
// 点击记住密码
$
(
"#remember"
).
live
(
'click'
,
function
()
{
$
(
"#remember"
).
live
(
'click'
,
function
()
{
updateCookie
();
updateCookie
();
if
(
$
(
"#remember"
).
attr
(
'checked'
)
!=
'checked'
)
{
$
(
'#username'
).
val
(
''
);
$
(
'#password'
).
val
(
''
);
$
(
'.login_yzm>input'
).
val
(
''
);
$
(
'#username'
).
next
(
'label'
).
remove
();
$
(
'#password'
).
next
(
'label'
).
remove
();
$
(
'.login_yzm>input'
).
next
(
'label'
).
remove
();
init_login_tip
(
$
(
'#username'
),
'请输入账号'
);
init_login_tip
(
$
(
'#password'
),
'请输入密码'
);
init_login_tip
(
$
(
'.login_yzm>input'
),
'请输入验证码'
);
}
});
});
// 点击重置
// 点击重置
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
...
...
WebContent/jfcas02/login.jsp
View file @
6be3d484
...
@@ -465,6 +465,17 @@ $(document).ready(function () {
...
@@ -465,6 +465,17 @@ $(document).ready(function () {
// 点击记住密码
// 点击记住密码
$
(
"#remember"
).
live
(
'click'
,
function
()
{
$
(
"#remember"
).
live
(
'click'
,
function
()
{
updateCookie
();
updateCookie
();
if
(
$
(
"#remember"
).
attr
(
'checked'
)
!=
'checked'
)
{
$
(
'#username'
).
val
(
''
);
$
(
'#password'
).
val
(
''
);
$
(
'.login_yzm>input'
).
val
(
''
);
$
(
'#username'
).
next
(
'label'
).
remove
();
$
(
'#password'
).
next
(
'label'
).
remove
();
$
(
'.login_yzm>input'
).
next
(
'label'
).
remove
();
init_login_tip
(
$
(
'#username'
),
'请输入账号'
);
init_login_tip
(
$
(
'#password'
),
'请输入密码'
);
init_login_tip
(
$
(
'.login_yzm>input'
),
'请输入验证码'
);
}
});
});
// 点击重置
// 点击重置
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
...
...
WebContent/jfcas03/login.jsp
View file @
6be3d484
...
@@ -318,6 +318,17 @@ $(document).ready(function () {
...
@@ -318,6 +318,17 @@ $(document).ready(function () {
// 点击记住密码
// 点击记住密码
$
(
"#remember"
).
live
(
'click'
,
function
()
{
$
(
"#remember"
).
live
(
'click'
,
function
()
{
updateCookie
();
updateCookie
();
if
(
$
(
"#remember"
).
attr
(
'checked'
)
!=
'checked'
)
{
$
(
'#username'
).
val
(
''
);
$
(
'#password'
).
val
(
''
);
$
(
'.login_yzm>input'
).
val
(
''
);
$
(
'#username'
).
next
(
'label'
).
remove
();
$
(
'#password'
).
next
(
'label'
).
remove
();
$
(
'.login_yzm>input'
).
next
(
'label'
).
remove
();
init_login_tip
(
$
(
'#username'
),
'请输入账号'
);
init_login_tip
(
$
(
'#password'
),
'请输入密码'
);
init_login_tip
(
$
(
'.login_yzm>input'
),
'请输入验证码'
);
}
});
});
// 点击重置
// 点击重置
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
...
...
WebContent/jfcas04/css/common.css
View file @
6be3d484
...
@@ -996,6 +996,7 @@ a{
...
@@ -996,6 +996,7 @@ a{
text-align
:
center
;
text-align
:
center
;
padding-top
:
22px
;
padding-top
:
22px
;
cursor
:
pointer
;
cursor
:
pointer
;
padding-bottom
:
25px
;
}
}
.disk_content_header
>
div
:first-child
span
{
.disk_content_header
>
div
:first-child
span
{
margin
:
0
15px
0
5px
;
margin
:
0
15px
0
5px
;
...
@@ -1017,6 +1018,7 @@ a{
...
@@ -1017,6 +1018,7 @@ a{
border
:
1px
solid
transparent
;
border
:
1px
solid
transparent
;
padding
:
15px
15px
10px
;
padding
:
15px
15px
10px
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
text-align
:
center
;
}
}
.disk_content_lump
>
div
>
div
:hover
{
.disk_content_lump
>
div
>
div
:hover
{
background
:
#F5FBFF
;
background
:
#F5FBFF
;
...
@@ -1036,8 +1038,7 @@ a{
...
@@ -1036,8 +1038,7 @@ a{
cursor
:
pointer
;
cursor
:
pointer
;
color
:
#2CA4F0
;
color
:
#2CA4F0
;
}
}
.disk_content_lump
img
{
.disk_content_lump
>
div
>
div
>
img
{
width
:
100%
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.disk_content_lump
img
+
div
{
.disk_content_lump
img
+
div
{
...
@@ -1046,10 +1047,30 @@ a{
...
@@ -1046,10 +1047,30 @@ a{
cursor
:
default
;
cursor
:
default
;
height
:
30px
;
height
:
30px
;
line-height
:
30px
;
line-height
:
30px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
.disk_content_lump
img
+
div
+
input
{
.disk_content_lump
img
+
div
+
input
{
height
:
30px
;
height
:
30px
;
}
}
.disk_content_lump_noFile
{
margin-top
:
30px
;
text-align
:
center
;
}
.disk_content_lump_noFile
>
img
+
p
{
margin
:
20px
0
30px
;
}
.disk_content_lump_noFile
span
{
color
:
white
;
background
:
#8ED3FF
;
padding
:
5px
12px
;
border-radius
:
3px
;
cursor
:
pointer
;
}
.disk_content_lump_noFile
span
:hover
{
background
:
#4eaeec
;
}
/***************右键菜单样式*******************/
/***************右键菜单样式*******************/
.disk_menu
{
.disk_menu
{
width
:
128px
;
width
:
128px
;
...
@@ -1091,6 +1112,7 @@ a{
...
@@ -1091,6 +1112,7 @@ a{
}
}
.disk_content_list_fileName
>
div
:first-child
{
.disk_content_list_fileName
>
div
:first-child
{
padding
:
0px
;
padding
:
0px
;
text-align
:
center
;
}
}
.disk_content_list_fileName
>
div
:first-child
+
div
>
div
:first-child
{
.disk_content_list_fileName
>
div
:first-child
+
div
>
div
:first-child
{
height
:
34px
;
height
:
34px
;
...
@@ -1141,6 +1163,35 @@ a{
...
@@ -1141,6 +1163,35 @@ a{
font-size
:
16px
;
font-size
:
16px
;
margin-right
:
-1px
;
margin-right
:
-1px
;
}
}
.disk_move_search
{
margin
:
10px
5px
3px
;
}
.disk_move_search
>
input
{
outline
:
none
;
border
:
1px
solid
#f2f2f2
;
border-radius
:
4px
;
height
:
30px
;
line-height
:
28px
;
padding-left
:
6px
;
color
:
#bbb
;
width
:
70%
;
}
.disk_move_search
>
span
{
border
:
1px
solid
#f2f2f2
;
height
:
30px
;
line-height
:
28px
;
color
:
#333
;
display
:
inline-block
;
width
:
25%
;
margin-left
:
5%
;
vertical-align
:
bottom
;
text-align
:
center
;
cursor
:
pointer
;
border-radius
:
4px
;
}
.disk_move_search
>
span
:hover
{
background
:
#f3f3f3
;
}
.disk_move_btn
{
.disk_move_btn
{
height
:
40px
;
height
:
40px
;
line-height
:
40px
;
line-height
:
40px
;
...
@@ -1365,7 +1416,7 @@ a{
...
@@ -1365,7 +1416,7 @@ a{
color
:
#333
;
color
:
#333
;
border-top
:
1px
solid
#f3f0f0
;
border-top
:
1px
solid
#f3f0f0
;
}
}
.disk_rubbishBtn
,
.disk_shareCodeBtn
{
.disk_rubbishBtn
,
.disk_shareCodeBtn
,
.disk_enjoyBtn
{
display
:
none
;
display
:
none
;
}
}
.disk_createShare
{
.disk_createShare
{
...
...
WebContent/jfcas04/disk.jsp
View file @
6be3d484
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
<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=
"${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/storepersonal/js/storePersonalModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/store/js/storeModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/storeshare/js/storeShareModule.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${pageContext.request.contextPath}/jwapp/pages/user/js/jwAppUserModule.js"
charset=
"utf-8"
></script>
<script
src=
"${ctx}/jfcas04/js/disk.js"
></script>
<script
src=
"${ctx}/jfcas04/js/disk.js"
></script>
</head>
</head>
<body>
<body>
...
@@ -15,13 +19,13 @@
...
@@ -15,13 +19,13 @@
<!-- 内容部分 -->
<!-- 内容部分 -->
<div
class=
"disk_container container-fluid"
>
<div
class=
"disk_container container-fluid"
>
<div
class=
"row disk_search"
>
<div
class=
"row disk_search"
>
<div
class=
"col-md-
3
"
>
<div
class=
"col-md-
2
"
>
<div
class=
"col-md-
3
"
onclick=
"location.href='disk'"
><img
src=
"${ctx}/custom/images/disk_home.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div>
<div
class=
"col-md-
6
"
onclick=
"location.href='disk'"
><img
src=
"${ctx}/custom/images/disk_home.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div>
<
div
class=
"col-md-3
"
><img
src=
"${ctx}/custom/images/disk_last.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div>
<
%
--
<
div
class=
"col-md-3"
id=
"disk_backFolder_prev"
onclick=
"disk_backFolder_prev(this)
"
><img
src=
"${ctx}/custom/images/disk_last.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div>
<div
class=
"col-md-3"
><img
src=
"${ctx}/custom/images/disk_next.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div
>
<div
class=
"col-md-3"
id=
"disk_backFolder_next"
onclick=
"disk_backFolder_next(this)"
><img
src=
"${ctx}/custom/images/disk_next.png"
wdith=
"14"
height=
"14"
/><span>
|
</span></div>
--%
>
<div
id=
"disk_rubbish"
class=
"col-md-
3
"
onclick=
"disk_rubbish()"
><img
src=
"${ctx}/custom/images/disk_circle.png"
wdith=
"14"
height=
"14"
/></div>
<div
id=
"disk_rubbish"
class=
"col-md-
6
"
onclick=
"disk_rubbish()"
><img
src=
"${ctx}/custom/images/disk_circle.png"
wdith=
"14"
height=
"14"
/></div>
</div>
</div>
<div
class=
"col-md-
6
"
>
<div
class=
"col-md-
7
"
>
<div
class=
"disk_search_center"
>
<div
class=
"disk_search_center"
>
<a
href=
"disk"
><span
class=
"glyphicon glyphicon-folder-close"
></span><span>
我的网盘
</span><span
class=
"glyphicon glyphicon-triangle-right"
></span></a>
<a
href=
"disk"
><span
class=
"glyphicon glyphicon-folder-close"
></span><span>
我的网盘
</span><span
class=
"glyphicon glyphicon-triangle-right"
></span></a>
<!-- <a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> -->
<!-- <a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> -->
...
@@ -49,6 +53,7 @@
...
@@ -49,6 +53,7 @@
<a
class=
"disk_rubbishBtn disk_document_default"
href=
"javascript:disk_reductionFolder()"
><img
src=
"/jfV5portal/custom/images/disk_return.png"
width=
"16"
height=
"16"
><span>
还原文件
</span></a>
<a
class=
"disk_rubbishBtn disk_document_default"
href=
"javascript:disk_reductionFolder()"
><img
src=
"/jfV5portal/custom/images/disk_return.png"
width=
"16"
height=
"16"
><span>
还原文件
</span></a>
<a
class=
"disk_rubbishBtn disk_document_default"
href=
"javascript:disk_thoroughDeleteFolder()"
><img
src=
"/jfV5portal/custom/images/disk_thoroughDelete.png"
width=
"16"
height=
"16"
><span>
彻底删除
</span></a>
<a
class=
"disk_rubbishBtn disk_document_default"
href=
"javascript:disk_thoroughDeleteFolder()"
><img
src=
"/jfV5portal/custom/images/disk_thoroughDelete.png"
width=
"16"
height=
"16"
><span>
彻底删除
</span></a>
<a
class=
"disk_shareCodeBtn disk_document_default"
href=
"javascript:disk_cancelShareCode()"
><img
src=
"/jfV5portal/custom/images/disk_cancelShare.png"
width=
"14"
height=
"14"
><span>
取消分享
</span></a>
<a
class=
"disk_shareCodeBtn disk_document_default"
href=
"javascript:disk_cancelShareCode()"
><img
src=
"/jfV5portal/custom/images/disk_cancelShare.png"
width=
"14"
height=
"14"
><span>
取消分享
</span></a>
<a
class=
"disk_enjoyBtn disk_document_default"
href=
"javascript:disk_cancelEnjoy()"
><img
src=
"/jfV5portal/custom/images/disk_cancelShare.png"
width=
"14"
height=
"14"
><span>
取消共享
</span></a>
</div>
</div>
<div
class=
"col-md-1"
><span
onclick=
"disk_content_toggle(this)"
class=
"disk_content_toggleBtn glyphicon glyphicon-th-large"
title=
"切换到列表模式"
></span></div>
<div
class=
"col-md-1"
><span
onclick=
"disk_content_toggle(this)"
class=
"disk_content_toggleBtn glyphicon glyphicon-th-large"
title=
"切换到列表模式"
></span></div>
</div>
</div>
...
@@ -162,6 +167,7 @@
...
@@ -162,6 +167,7 @@
<li
onclick=
"disk_downFolder(this)"
class=
"disk_menu_clickBtn"
>
下载
</li>
<li
onclick=
"disk_downFolder(this)"
class=
"disk_menu_clickBtn"
>
下载
</li>
<li
onclick=
"disk_moveFolder(this)"
class=
"disk_menu_clickBtn"
>
移动到
</li>
<li
onclick=
"disk_moveFolder(this)"
class=
"disk_menu_clickBtn"
>
移动到
</li>
<li
onclick=
"disk_enjoyFolder(this)"
class=
"disk_menu_clickBtn"
>
共享
</li>
<li
onclick=
"disk_enjoyFolder(this)"
class=
"disk_menu_clickBtn"
>
共享
</li>
<li
onclick=
"disk_cancelEnjoy(this)"
class=
"disk_menu_clickBtn"
style=
"display:none;"
>
取消共享
</li>
</ul>
</ul>
</div>
</div>
...
...
WebContent/jfcas04/index.jsp
View file @
6be3d484
...
@@ -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/disk.js
View file @
6be3d484
$
(
function
()
{
$
(
function
()
{
/*for(var i =1;i<=9;i++){
var str = "";
for(var j = 1;j<=i;j++){
str = str + (j + '*' + i + '=' + (i*j)) + ' ';
}
console.log(str)
}*/
//去掉尾部的一个div
//去掉尾部的一个div
$
(
'.index_footer'
).
next
().
remove
();
$
(
'.index_footer'
).
next
().
remove
();
...
@@ -9,30 +17,9 @@ $(function() {
...
@@ -9,30 +17,9 @@ $(function() {
//初始化块状显示
//初始化块状显示
init_disk_lump
();
init_disk_lump
();
//初始化块状的单击效果
//init_disk_lump_click();
//初始化块状的双击效果
//init_disk_lump_dbClick();
//初始化块状的文件名的单击效果
//init_disk_click_div_edit();
//初始化块状的文本框失去焦点的效果
//init_disk_input_blur();
//初始化块状的鼠标移动效果
//init_disk_lump_hover();
//绑定键盘shift和ctrl键来多选
//绑定键盘shift和ctrl键来多选
init_disk_window_multiple
();
init_disk_window_multiple
();
//绑定鼠标的按下来多选
//init_disk_window_mouseDownMultiple();
//去掉拖动图片时默认的提示
//init_disk_window_imgDefault();
//点击容器外时取消选中状态
//点击容器外时取消选中状态
$
(
document
).
click
(
function
(
e
){
$
(
document
).
click
(
function
(
e
){
//console.log($(e.target));
//console.log($(e.target));
...
@@ -57,33 +44,6 @@ $(function() {
...
@@ -57,33 +44,6 @@ $(function() {
})
})
//去掉拖动图片时默认的提示
function
init_disk_window_imgDefault
(){
//IE下需要在document的mousemove里面取消默认事件;要用原生JS的事件不能用JQuery
document
.
onmousemove
=
function
(
e
){
var
ev
=
e
||
event
;
ev
.
cancelBubble
=
true
;
ev
.
returnValue
=
false
;
}
$
(
"img"
).
mousedown
(
function
(
event
){
//FF下需要在mousedown取消默认操作;
event
.
preventDefault
();
event
.
stopPropagation
();
$
(
this
).
bind
(
"mousemove"
,
function
(
event
){});
})
}
//绑定鼠标的按下来多选
function
init_disk_window_mouseDownMultiple
(){
$
(
window
).
mousedown
(
function
(
e
){
$
(
'.disk_content_lump'
).
data
(
'mouseDownSelect'
,
true
);
}).
mouseup
(
function
(){
$
(
'.disk_content_lump'
).
data
(
'mouseDownSelect'
,
false
);
});
}
//绑定键盘shift和ctrl键来多选
//绑定键盘shift和ctrl键来多选
function
init_disk_window_multiple
(){
function
init_disk_window_multiple
(){
$
(
window
).
keydown
(
function
(
e
){
$
(
window
).
keydown
(
function
(
e
){
...
@@ -106,59 +66,14 @@ function init_index_contaner_minHeight() {
...
@@ -106,59 +66,14 @@ function init_index_contaner_minHeight() {
//初始化块状显示
//初始化块状显示
function
init_disk_lump
(){
function
init_disk_lump
(){
var
infos
=
[
//获得初始化文件列表
{
id
:
'uuid1'
,
fileName
:
'公司文件'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder_company'
,
fileSize
:
'200KB'
},
var
infos
=
init_disk_infos
(
'0'
);
{
id
:
'uuid2'
,
fileName
:
'共享文件'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder_share'
,
fileSize
:
'100KB'
},
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
},
]
//渲染块状
//渲染块状
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
init_disk_createLump
(
infos
[
i
]);
init_disk_createLump
(
infos
[
i
]);
}
}
}
}
//绑定块状的单击效果
function
init_disk_lump_click
(){
$
(
'.disk_content_lump>div>div'
).
each
(
function
(
index
,
element
){
$
(
element
).
bind
(
'click'
,
function
(){
disk_lump_click
(
this
);
})
})
}
//初始化块状的双击效果
function
init_disk_lump_dbClick
(){
$
(
'.disk_content_lump>div>div'
).
each
(
function
(
index
,
element
){
$
(
element
).
bind
(
'dblclick'
,
function
(){
disk_lump_dbClick
(
this
);
})
})
}
//初始化块状的文件名的单击效果
function
init_disk_click_div_edit
(){
$
(
'.disk_content_lump>div>div>div'
).
each
(
function
(
index
,
element
){
$
(
element
).
bind
(
'click'
,
function
(){
disk_click_div_edit
(
this
);
})
})
}
//初始化块状的文本框失去焦点的效果
function
init_disk_input_blur
(){
$
(
'.disk_content_lump>div>div>input'
).
each
(
function
(
index
,
element
){
$
(
element
).
bind
(
'blur'
,
function
(){
disk_input_blur
(
this
);
})
})
}
//初始化块状的文件名的单击效果
//初始化块状的文件名的单击效果
function
init_disk_lump_fileName_click
(){
function
init_disk_lump_fileName_click
(){
$
(
'.disk_content_lump>div>div>div'
).
each
(
function
(
index
,
element
){
$
(
'.disk_content_lump>div>div>div'
).
each
(
function
(
index
,
element
){
...
@@ -168,17 +83,6 @@ function init_disk_lump_fileName_click(){
...
@@ -168,17 +83,6 @@ function init_disk_lump_fileName_click(){
})
})
}
}
//初始化块状的鼠标移动效果
function
init_disk_lump_hover
(){
$
(
'.disk_content_lump>div>div'
).
hover
(
function
(){
//如果是可以多选时
if
(
$
(
this
).
parents
(
'.disk_content_lump'
).
data
(
'mouseDownSelect'
)){
//然后给自己加个样式
$
(
this
).
addClass
(
'disk_content_lump_click'
);
}
},
function
(){})
}
//根据一个json数据来初始化块状列表
//根据一个json数据来初始化块状列表
function
init_disk_createLump
(
lump_json
){
function
init_disk_createLump
(
lump_json
){
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
...
@@ -195,10 +99,18 @@ function init_disk_createLump(lump_json){
...
@@ -195,10 +99,18 @@ function init_disk_createLump(lump_json){
$create_container
.
append
(
$create_content
);
$create_container
.
append
(
$create_content
);
//先初始化图片
init_disk_select_fileImg
(
lump_json
);
init_disk_select_fileImg
(
lump_json
);
var
$create_img
=
$
(
'<img src="'
+
ctx
+
'/custom/images/'
+
lump_json
.
fileImg
+
'" />'
);
//如果是图片显示时
var
$create_div
=
$
(
'<div></div>'
).
text
(
lump_json
.
fileName
);
var
$create_img
=
$
(
'<img height="90" />'
);
if
(
lump_json
.
fileImg
){
$create_img
.
attr
(
'src'
,
ctx
+
'/custom/images/'
+
lump_json
.
fileImg
);
}
else
{
$create_img
.
attr
(
'src'
,
ctx
+
'/photo/photo.jsp?ls_photo='
+
lump_json
.
FILE_SAVE_PATH
+
lump_json
.
FILE_SVAE_NAME
);
}
var
$create_div
=
$
(
'<div></div>'
).
text
(
lump_json
.
FILE_NAME
);
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
//如果是回收站时,则鼠标移动到文件名时去掉原来的效果
//如果是回收站时,则鼠标移动到文件名时去掉原来的效果
$create_div
.
hover
(
function
(){
$create_div
.
hover
(
function
(){
...
@@ -209,14 +121,16 @@ function init_disk_createLump(lump_json){
...
@@ -209,14 +121,16 @@ function init_disk_createLump(lump_json){
}
}
else
{
else
{
//如果不是显示回收站的时候
//如果不是显示回收站的时候
//编辑
$create_div
.
bind
(
'click'
,
function
(){
$create_div
.
bind
(
'click'
,
function
(){
disk_click_div_edit
(
this
);
disk_click_div_edit
(
this
);
})
})
//双击
$create_content
.
bind
(
'dblclick'
,
function
(){
$create_content
.
bind
(
'dblclick'
,
function
(){
disk_lump_dbClick
(
this
);
disk_lump_dbClick
(
this
);
})
})
}
}
var
$create_input
=
$
(
'<input type="text" class="form-control"/>'
).
val
(
lump_json
.
fileName
);
var
$create_input
=
$
(
'<input type="text" class="form-control"/>'
).
val
(
lump_json
.
FILE_NAME
);
//输入框失去焦点时
//输入框失去焦点时
$create_input
.
bind
(
'blur'
,
function
(){
$create_input
.
bind
(
'blur'
,
function
(){
disk_input_blur
(
this
);
disk_input_blur
(
this
);
...
@@ -233,6 +147,11 @@ function disk_addFolder(handler){
...
@@ -233,6 +147,11 @@ function disk_addFolder(handler){
return
;
return
;
}
}
//如果一开始是没有文件时,就先去掉
if
(
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_noFile'
).
length
!=
0
){
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_noFile'
).
remove
();
}
//如果为列表时
//如果为列表时
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//列表的添加文件
//列表的添加文件
...
@@ -243,15 +162,12 @@ function disk_addFolder(handler){
...
@@ -243,15 +162,12 @@ function disk_addFolder(handler){
//缩略图的添加文件
//缩略图的添加文件
disk_addFolder_lump
();
disk_addFolder_lump
();
}
}
}
}
//列表的添加文件
//列表的添加文件
function
disk_addFolder_list
(){
function
disk_addFolder_list
(){
var
date
=
$
.
jfbrother
.
dateToStr
(
'yyyy-MM-dd'
);
var
rowId
=
$
.
jfbrother
.
uuid
();
var
list_data
=
{
UUID
:
''
,
UPDATE_TIME
:
date
,
FILE_NAME
:
'新建文件夹'
,
fileImg
:
'disk_module5_close.png'
,
FILE_TYPE
:
'folder'
,
FILE_SIZE
:
0
};
var
date
=
$
.
jfbrother
.
dateToStr
();
var
list_data
=
{
id
:
rowId
,
fileName
:
'新建文件夹'
,
fileImg
:
'disk_module5.png'
,
lastTime
:
date
,
fileType
:
'文件夹'
,
fileSize
:
'-'
};
//跳到第一页
//跳到第一页
//$('#disk_content_list').bootstrapTable('selectPage', 1); //Jump to the first page
//$('#disk_content_list').bootstrapTable('selectPage', 1); //Jump to the first page
...
@@ -265,9 +181,9 @@ function disk_addFolder_list(){
...
@@ -265,9 +181,9 @@ function disk_addFolder_list(){
//取消之前的选中
//取消之前的选中
$
(
'#disk_content_list'
).
bootstrapTable
(
'uncheckAll'
);
$
(
'#disk_content_list'
).
bootstrapTable
(
'uncheckAll'
);
//根据id来选中新增的那一行
//根据
uu
id来选中新增的那一行
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
rowId
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
list_data
.
UUID
){
$
(
'#disk_content_list'
).
bootstrapTable
(
'check'
,
$
(
element
).
data
(
'index'
));
$
(
'#disk_content_list'
).
bootstrapTable
(
'check'
,
$
(
element
).
data
(
'index'
));
var
$div
=
$
(
element
).
find
(
'.disk_content_list_fileName>div'
).
eq
(
1
).
find
(
'div'
);
var
$div
=
$
(
element
).
find
(
'.disk_content_list_fileName>div'
).
eq
(
1
).
find
(
'div'
);
$div
.
hide
();
$div
.
hide
();
...
@@ -281,20 +197,14 @@ function disk_addFolder_list(){
...
@@ -281,20 +197,14 @@ function disk_addFolder_list(){
})
})
}
}
//缩略图的添加文件
//缩略图的添加文件
夹
function
disk_addFolder_lump
(){
function
disk_addFolder_lump
(){
var
rowId
=
$
.
jfbrother
.
uuid
();
var
lump_data
=
{
FILE_NAME
:
'新建文件夹'
,
fileImg
:
'disk_module5_close.png'
,
FILE_TYPE
:
'folder'
,
FILE_SIZE
:
'0'
};
var
date
=
$
.
jfbrother
.
dateToStr
();
var
jum_data
=
{
id
:
rowId
,
fileName
:
'新建文件夹'
,
fileImg
:
'disk_module5.png'
,
lastTime
:
date
,
fileType
:
'文件夹'
,
fileSize
:
'-'
};
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
var
$create_container
=
$
(
'<div></div>'
).
addClass
(
'col-md-2'
);
var
$create_container
=
$
(
'<div></div>'
).
addClass
(
'col-md-2'
);
$disk_content_lump
.
append
(
$create_container
);
$disk_content_lump
.
append
(
$create_container
);
var
$create_content
=
$
(
'<div></div>'
).
addClass
(
'disk_content_lump_click'
);
var
$create_content
=
$
(
'<div></div>'
).
addClass
(
'disk_content_lump_click'
);
//把数据存放起来
$create_content
.
data
(
'lump_data'
,
jum_data
);
$create_content
.
bind
(
'click'
,
function
(){
$create_content
.
bind
(
'click'
,
function
(){
disk_lump_click
(
this
);
disk_lump_click
(
this
);
})
})
...
@@ -302,13 +212,13 @@ function disk_addFolder_lump(){
...
@@ -302,13 +212,13 @@ function disk_addFolder_lump(){
disk_lump_dbClick
(
this
);
disk_lump_dbClick
(
this
);
})
})
$create_container
.
append
(
$create_content
);
$create_container
.
append
(
$create_content
);
var
$create_img
=
$
(
'<img
src="'
+
ctx
+
'/custom/images/'
+
jum_data
.
fileImg
+
'" />'
);
var
$create_img
=
$
(
'<img
width="125" height="90" src="'
+
ctx
+
'/custom/images/'
+
lump_data
.
fileImg
+
'" />'
);
var
$create_div
=
$
(
'<div></div>'
).
text
(
jum_data
.
fileName
);
var
$create_div
=
$
(
'<div></div>'
).
text
(
lump_data
.
FILE_NAME
);
$create_div
.
bind
(
'click'
,
function
(){
$create_div
.
bind
(
'click'
,
function
(){
disk_click_div_edit
(
this
);
disk_click_div_edit
(
this
);
})
})
$create_div
.
hide
();
$create_div
.
hide
();
var
$create_input
=
$
(
'<input type="text" class="form-control"/>'
).
val
(
jum_data
.
fileName
);
var
$create_input
=
$
(
'<input type="text" class="form-control"/>'
).
val
(
lump_data
.
FILE_NAME
);
//输入框失去焦点时
//输入框失去焦点时
$create_input
.
bind
(
'blur'
,
function
(){
$create_input
.
bind
(
'blur'
,
function
(){
disk_input_blur
(
this
);
disk_input_blur
(
this
);
...
@@ -322,7 +232,13 @@ function disk_addFolder_lump(){
...
@@ -322,7 +232,13 @@ function disk_addFolder_lump(){
//点击文件名时的编辑效果
//点击文件名时的编辑效果
function
disk_click_div_edit
(
handler
){
function
disk_click_div_edit
(
handler
){
var
lump_data
=
$
(
handler
).
parent
().
data
(
'lump_data'
);
if
(
$
(
handler
).
parent
().
hasClass
(
'disk_content_lump_click'
)){
if
(
$
(
handler
).
parent
().
hasClass
(
'disk_content_lump_click'
)){
//如果是公司文件或者是共享文件时,则不做编辑操作,直接是双击点击去的效果
if
(
lump_data
.
apiIndex
==
'1'
||
lump_data
.
apiIndex
==
'2'
){
disk_lump_dbClick
(
$
(
handler
).
parent
());
}
else
{
$
(
handler
).
hide
();
$
(
handler
).
hide
();
$
(
handler
).
next
().
show
();
$
(
handler
).
next
().
show
();
//输入框获得焦点
//输入框获得焦点
...
@@ -330,10 +246,12 @@ function disk_click_div_edit(handler){
...
@@ -330,10 +246,12 @@ function disk_click_div_edit(handler){
//输入框的内容全选
//输入框的内容全选
$
(
handler
).
next
().
select
();
$
(
handler
).
next
().
select
();
}
}
}
}
}
//文本框失去焦点时
//文本框失去焦点时
function
disk_input_blur
(
handler
){
function
disk_input_blur
(
handler
){
var
lump_data
=
$
(
handler
).
parent
().
data
(
'lump_data'
);
//隐藏输入框,显示div容器
//隐藏输入框,显示div容器
$
(
handler
).
hide
();
$
(
handler
).
hide
();
var
input_val
=
$
(
handler
).
val
();
var
input_val
=
$
(
handler
).
val
();
...
@@ -341,20 +259,57 @@ function disk_input_blur(handler){
...
@@ -341,20 +259,57 @@ function disk_input_blur(handler){
if
(
input_val
==
''
){
if
(
input_val
==
''
){
input_val
=
'新建文件夹'
;
input_val
=
'新建文件夹'
;
}
}
//如果文件夹存在时,就自动加个(序号),遍历之前的容器
//如果文件夹存在时,就自动加个(序号),遍历之前的容器
disk_find_folder
(
$
(
handler
),
input_val
);
disk_find_folder
(
$
(
handler
),
input_val
);
var
count
=
$
(
handler
).
data
(
'count'
);
var
count
=
$
(
handler
).
data
(
'count'
);
count
==
0
?
input_val
=
input_val
:
input_val
=
input_val
+
'('
+
count
+
')'
;
count
==
0
?
input_val
=
input_val
:
input_val
=
input_val
+
'('
+
count
+
')'
;
//给input和div赋值
$
(
handler
).
prev
().
show
().
text
(
input_val
);
$
(
handler
).
prev
().
show
().
text
(
input_val
);
$
(
handler
).
val
(
input_val
)
//如果是列表需要做一次更新
//如果值存在那就表示是修改操作,否则是添加操作
if
(
lump_data
&&
lump_data
.
UUID
!=
''
){
//块状和列表的编辑
//保存到数据库
//文件的uuid和文件名去保存
var
result
=
storePersonalModule
.
storePersonalActAction
.
updateStorePersonal
({
FIELD_UUID
:
lump_data
.
UUID
,
FIELD_FILE_NAME
:
input_val
,
FIELD_FATHER_ID
:
lump_data
.
FATHER_ID
,
FIELD_ISFILE
:
lump_data
.
ISFILE
});
}
else
{
//列表的添加
//获得目录的最后一个数据
var
nav_lump_data
=
$
(
'.disk_search_center>a:last'
).
data
(
'lump_data'
);
//如果不存在则父节点是根节点
var
parentId
;
if
(
nav_lump_data
){
parentId
=
nav_lump_data
.
UUID
;
}
else
{
parentId
=
'A'
;
}
var
uuid
=
$
.
jfbrother
.
uuid
();
var
date
=
$
.
jfbrother
.
dateToStr
(
'yyyy-MM-dd'
);
var
list_lump_data
=
{
UUID
:
uuid
,
FILE_NAME
:
input_val
,
FILE_TYPE
:
'folder'
,
FILE_SIZE
:
0
,
UPDATE_TIME
:
date
,
FATHER_ID
:
parentId
,
FIELD_ISFILE
:
'0'
};
var
insert_result
=
storePersonalModule
.
storePersonalActAction
.
insertStorePersonal
({
FIELD_UUID
:
uuid
,
FIELD_MODULE_ID
:
'3'
,
FIELD_ISFILE
:
'0'
,
FIELD_FATHER_ID
:
parentId
,
FIELD_FILE_NAME
:
input_val
});
//绑定数据
$
(
handler
).
parent
().
data
(
'lump_data'
,
list_lump_data
);
//如果是列表需要做一次更新,否则列表时的input和data绑定的值不会做修改
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
$
(
'#disk_content_list'
).
bootstrapTable
(
'updateRow'
,{
$
(
'#disk_content_list'
).
bootstrapTable
(
'updateRow'
,{
index
:
$
(
handler
).
parents
(
'tr'
).
data
(
'index'
),
index
:
$
(
handler
).
parents
(
'tr'
).
data
(
'index'
),
row
:{
fileName
:
input_val
}
row
:
list_lump_data
});
});
}
}
}
}
}
//递归查找文件夹是否存在
//递归查找文件夹是否存在
...
@@ -412,30 +367,166 @@ function disk_lump_click(handler){
...
@@ -412,30 +367,166 @@ function disk_lump_click(handler){
//双击块状
//双击块状
function
disk_lump_dbClick
(
handler
){
function
disk_lump_dbClick
(
handler
){
//正处在编辑时不能双击
//文件的数据
if
(
$
(
handler
).
find
(
'input'
).
css
(
'display'
)
!=
'none'
){
var
lump_data
=
$
(
handler
).
data
(
'lump_data'
);
return
;
//console.log(lump_data)
}
//添加目录的导航效果
var
$search_center
=
$
(
'.disk_search_center'
);
var
$create_a
=
$
(
'<a onclick="disk_backFolder(this)"></a>'
);
var
$create_span1
=
$
(
'<span></span>'
).
text
(
$
(
handler
).
find
(
'div'
).
text
());
var
$create_span2
=
$
(
'<span></span>'
).
addClass
(
'glyphicon glyphicon-triangle-right'
);
$create_a
.
append
(
$create_span1
).
append
(
$create_span2
);
$search_center
.
append
(
$create_a
);
//重新渲染块状
//重新渲染块状
disk_dbClick_custom
(
$
(
handler
).
find
(
'input'
),
lump_data
,
function
(
infos
){
//先清空容器
//先清空容器
$
(
'.disk_content_lump'
).
html
(
''
);
$
(
'.disk_content_lump'
).
html
(
''
);
var
infos
=
[
if
(
infos
.
length
!=
0
){
{
id
:
'uuid20'
,
fileName
:
'我的文件1'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder'
,
fileSize
:
'200KB'
},
{
id
:
'uuid21'
,
fileName
:
'我的文件2'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder'
,
fileSize
:
'100KB'
},
]
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
init_disk_createLump
(
infos
[
i
]);
init_disk_createLump
(
infos
[
i
]);
}
}
}
//没文件时的显示
else
{
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
var
$no_file_content
=
$
(
'<div></div>'
).
addClass
(
'disk_content_lump_noFile'
);
var
$no_file_img
=
$
(
'<img src='
+
ctx
+
'/custom/images/disk_lump_noFile.png width="131" height="116" />'
);
var
$no_file_text
;
var
$no_file_btn
;
//如果是公司文件时
if
(
lump_data
.
apiIndex
==
'1'
){
$no_file_text
=
$
(
'<p></p>'
).
text
(
'暂无数据~'
);
}
//如果是共享文件时
else
if
(
lump_data
.
apiIndex
==
'2'
){
$no_file_text
=
$
(
'<p></p>'
).
text
(
'暂无共享数据~'
);
}
//如果为普通文件时
else
{
$no_file_text
=
$
(
'<p></p>'
).
text
(
'超大空间等你来填满,快来上传吧~'
);
$no_file_btn
=
$
(
'<p><span onclick="disk_uploadFolder()">上传文件</span></p>'
);
}
$disk_content_lump
.
append
(
$no_file_content
);
$no_file_content
.
append
(
$no_file_img
).
append
(
$no_file_text
).
append
(
$no_file_btn
);
}
});
//如果是公司文件时,则隐藏所有的按钮
if
(
lump_data
.
FILE_TYPE
==
'folder_company'
){
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
//显示下载按钮
$
(
'.disk_content_header>div:first-child>a'
).
eq
(
1
).
show
();
}
else
if
(
lump_data
.
FILE_TYPE
==
'folder_share'
){
//显示取消共享的按钮
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
$
(
'.disk_enjoyBtn'
).
show
();
}
}
//把自身的uuid当做parentId来查找下面的子目录,不穿则表示查找跟节点,获得的可以是回收站可以是正常文件delete_flag 1为回收站的文件,0是正常文件
function
init_disk_infos
(
delete_flag
,
lump_data
){
var
infos
;
//如果没传入值,表示是查找根目录
if
(
!
lump_data
){
infos
=
storePersonalModule
.
storePersonalDataAction
.
listAll_storePersonalnofile
().
rowSet
;
var
results
=
[];
//把重复的parentId!=A的过滤掉,以及带有删除标识的判断下
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
if
(
delete_flag
==
'0'
){
if
(
infos
[
i
].
FATHER_ID
==
'A'
&&
infos
[
i
].
DELETE_FLAG
==
delete_flag
){
results
.
push
(
infos
[
i
]);
}
}
else
{
if
(
infos
[
i
].
DELETE_FLAG
==
delete_flag
){
results
.
push
(
infos
[
i
]);
}
}
}
//做个一个标识,来标识是要调用哪个api
for
(
var
i
=
0
;
i
<
results
.
length
;
i
++
){
results
[
i
].
apiIndex
=
'0'
;
}
if
(
delete_flag
==
'0'
){
//把公司文件和共享文件写死
var
default_infos
=
[
{
UUID
:
'B'
,
FILE_NAME
:
'公司文件'
,
UPDATE_TIME
:
''
,
FILE_TYPE
:
'folder_company'
,
FILE_SIZE
:
0
,
apiIndex
:
'1'
},
{
UUID
:
'C'
,
FILE_NAME
:
'共享文件'
,
UPDATE_TIME
:
''
,
FILE_TYPE
:
'folder_share'
,
FILE_SIZE
:
0
,
apiIndex
:
'2'
},
];
results
=
default_infos
.
concat
(
results
);
}
return
results
;
}
if
(
lump_data
.
apiIndex
==
'1'
){
//如果uuid==B的时候为根节点
if
(
lump_data
.
UUID
==
'B'
){
infos
=
storeModule
.
storeDataAction
.
list_storenofile
().
rowSet
;
}
//否则为其子节点
else
{
infos
=
storeModule
.
storeDataAction
.
list_storenofile
({
FIELD_FATHER_ID
:
lump_data
.
UUID
}).
rowSet
;
}
//做个一个标识,来标识是要调用哪个api
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
infos
[
i
].
apiIndex
=
'1'
;
}
}
else
if
(
lump_data
.
apiIndex
==
'2'
){
//如果是共享文件时
//如果uuid==C的时候为根节点
if
(
lump_data
.
UUID
==
'C'
){
infos
=
[];
var
storeShare_list
=
storeShareModule
.
storeShareDataAction
.
list
().
rowSet
;
//先获得共享的数据,再根据FILE_UUID去查找普通文件信息
for
(
var
i
=
0
;
i
<
storeShare_list
.
length
;
i
++
){
var
v_query
=
{}
;
v_query
.
FIELD_UUID
=
storeShare_list
[
i
].
FILE_UUID
;
var
result_storeShare_list
=
storePersonalModule
.
storePersonalDataAction
.
listAll_storePersonalnofile
(
v_query
).
rowSet
;
//把共享中的FILE_UUID,CREATE_NAME,CREATOR_ID,SHARE_ID,SHARE_NAME,SHARE_TIME保留下来
result_storeShare_list
[
0
].
FILE_UUID
=
storeShare_list
[
i
].
UUID
;
result_storeShare_list
[
0
].
CREATE_NAME
=
storeShare_list
[
i
].
CREATE_NAME
;
result_storeShare_list
[
0
].
CREATOR_ID
=
storeShare_list
[
i
].
CREATOR_ID
;
result_storeShare_list
[
0
].
SHARE_ID
=
storeShare_list
[
i
].
SHARE_ID
;
result_storeShare_list
[
0
].
SHARE_NAME
=
storeShare_list
[
i
].
SHARE_NAME
;
result_storeShare_list
[
0
].
SHARE_TIME
=
storeShare_list
[
i
].
SHARE_TIME
;
infos
.
push
(
result_storeShare_list
[
0
]);
}
}
else
{
infos
=
storePersonalModule
.
storePersonalDataAction
.
listAll_storePersonalnofile
({
FIELD_FATHER_ID
:
lump_data
.
UUID
}).
rowSet
;
//遍历下给每个数据加上共享信息
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
//用索引i来区别下,不然会出现同一个FILE_UUID
infos
[
i
].
FILE_UUID
=
lump_data
.
FILE_UUID
+
i
;
infos
[
i
].
CREATE_NAME
=
lump_data
.
CREATE_NAME
;
infos
[
i
].
CREATOR_ID
=
lump_data
.
CREATOR_ID
;
infos
[
i
].
SHARE_ID
=
lump_data
.
SHARE_ID
;
infos
[
i
].
SHARE_NAME
=
lump_data
.
SHARE_NAME
;
infos
[
i
].
SHARE_TIME
=
lump_data
.
SHARE_TIME
;
}
}
//做个一个标识,来标识是要调用哪个api
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
infos
[
i
].
apiIndex
=
'2'
;
}
}
else
{
//如果是普通文件时
infos
=
storePersonalModule
.
storePersonalDataAction
.
listAll_storePersonalnofile
({
FIELD_FATHER_ID
:
lump_data
.
UUID
}).
rowSet
;
//把删除后的文件去掉
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
if
(
infos
[
i
].
DELETE_FLAG
!=
delete_flag
){
infos
.
splice
(
i
,
1
);
//做个一个标识,来标识是要调用哪个api
infos
[
i
].
apiIndex
=
'0'
;
}
}
}
return
infos
;
}
}
//容器的右键效果
//容器的右键效果
...
@@ -443,6 +534,7 @@ function init_disk_contextmenu(){
...
@@ -443,6 +534,7 @@ function init_disk_contextmenu(){
$
(
'.disk_content_lump,.disk_content_list'
).
bind
(
'contextmenu'
,
function
(
e
){
$
(
'.disk_content_lump,.disk_content_list'
).
bind
(
'contextmenu'
,
function
(
e
){
var
$disk_menu
;
var
$disk_menu
;
var
lump_data
;
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
$disk_menu
=
$
(
'#disk_rubbish_menu'
);
$disk_menu
=
$
(
'#disk_rubbish_menu'
);
}
}
...
@@ -454,8 +546,8 @@ function init_disk_contextmenu(){
...
@@ -454,8 +546,8 @@ function init_disk_contextmenu(){
}
}
//console.log($(e.target));
//console.log($(e.target));
//如果是正在编辑的时候就不做操作
//如果是正在编辑的时候就不做操作
,如果是没有文件时
if
(
$
(
e
.
target
).
is
(
'input'
)){
if
(
$
(
e
.
target
).
is
(
'input'
)
||
$
(
e
.
target
).
hasClass
(
'disk_content_lump_noFile'
)
||
$
(
e
.
target
).
parents
(
'.disk_content_lump_noFile'
).
length
==
1
){
return
false
;
return
false
;
}
}
...
@@ -465,8 +557,10 @@ function init_disk_contextmenu(){
...
@@ -465,8 +557,10 @@ function init_disk_contextmenu(){
if
(
$
(
e
.
target
).
hasClass
(
'fixed-table-body'
)){
if
(
$
(
e
.
target
).
hasClass
(
'fixed-table-body'
)){
//去掉之前选中的列
//去掉之前选中的列
//$('#disk_content_list').bootstrapTable('uncheckAll');
//$('#disk_content_list').bootstrapTable('uncheckAll');
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
removeClass
(
'disk_menu_noClick'
);
var
a_length
=
$
(
'.disk_search_center>a'
).
eq
(
1
).
length
;
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
if
(
a_length
!=
0
){
lump_data
=
$
(
'.disk_search_center>a'
).
eq
(
1
).
data
(
'lump_data'
);
}
}
}
//点击文件夹
//点击文件夹
else
if
(
$
(
e
.
target
).
parents
(
'tbody'
).
length
==
1
){
else
if
(
$
(
e
.
target
).
parents
(
'tbody'
).
length
==
1
){
...
@@ -475,9 +569,7 @@ function init_disk_contextmenu(){
...
@@ -475,9 +569,7 @@ function init_disk_contextmenu(){
//选中当前的列
//选中当前的列
$
(
'#disk_content_list'
).
bootstrapTable
(
'check'
,
$
(
e
.
target
).
parents
(
'tr'
).
data
(
'index'
));
$
(
'#disk_content_list'
).
bootstrapTable
(
'check'
,
$
(
e
.
target
).
parents
(
'tr'
).
data
(
'index'
));
lump_data
=
$
(
e
.
target
).
parents
(
'tr'
).
find
(
'.disk_content_list_fileName>div'
).
eq
(
1
).
data
(
'lump_data'
);
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
removeClass
(
'disk_menu_noClick'
);
}
}
//点击了分页和table的头部
//点击了分页和table的头部
else
if
(
$
(
e
.
target
).
parents
(
'thead'
).
length
==
1
||
$
(
e
.
target
).
hasClass
(
'fixed-table-pagination'
)
||
$
(
e
.
target
).
parents
(
'.fixed-table-pagination'
).
length
==
1
){
else
if
(
$
(
e
.
target
).
parents
(
'thead'
).
length
==
1
||
$
(
e
.
target
).
hasClass
(
'fixed-table-pagination'
)
||
$
(
e
.
target
).
parents
(
'.fixed-table-pagination'
).
length
==
1
){
...
@@ -487,21 +579,24 @@ function init_disk_contextmenu(){
...
@@ -487,21 +579,24 @@ function init_disk_contextmenu(){
//如果是缩略图的模式时
//如果是缩略图的模式时
else
{
else
{
//右键时,切换是否可以点击的按钮
//右键时,切换是否可以点击的按钮
if
(
$
(
e
.
target
).
hasClass
(
'disk_content_lump'
)){
if
(
$
(
e
.
target
).
hasClass
(
'disk_content_lump'
)
||
$
(
e
.
target
).
hasClass
(
'col-md-2'
)){
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
removeClass
(
'disk_menu_noClick'
);
var
a_length
=
$
(
'.disk_search_center>a'
).
eq
(
1
).
length
;
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
if
(
a_length
!=
0
){
lump_data
=
$
(
'.disk_search_center>a'
).
eq
(
1
).
data
(
'lump_data'
);
}
}
}
else
{
else
{
//先去掉之前选中的
//先去掉之前选中的
$
(
e
.
target
).
parents
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
).
removeClass
(
'disk_content_lump_click'
);
$
(
e
.
target
).
parents
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
).
removeClass
(
'disk_content_lump_click'
);
//然后给自己加个样式
//然后给自己加个样式
$
(
e
.
target
).
parents
(
'.col-md-2'
).
children
(
'div'
).
addClass
(
'disk_content_lump_click'
);
$
(
e
.
target
).
parents
(
'.col-md-2'
).
children
(
'div'
).
addClass
(
'disk_content_lump_click'
);
lump_data
=
$
(
e
.
target
).
parents
(
'.col-md-2'
).
children
(
'div'
).
data
(
'lump_data'
);
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
removeClass
(
'disk_menu_noClick'
);
}
}
}
}
//菜单的显示
init_disk_menu_toggle
(
$disk_menu
,
lump_data
);
//显示菜单
//显示菜单
$disk_menu
.
show
();
$disk_menu
.
show
();
...
@@ -535,67 +630,103 @@ function init_disk_contextmenu(){
...
@@ -535,67 +630,103 @@ function init_disk_contextmenu(){
})
})
}
}
//删除文件夹
//菜单的切换显示
function
disk_deleteFolder
(
handler
){
function
init_disk_menu_toggle
(
disk_menu
,
lump_data
){
//右键删除时,如果是不能点击时
var
$disk_menu
=
disk_menu
;
if
(
handler
&&
$
(
handler
).
hasClass
(
'disk_menu_noClick'
)){
if
(
!
lump_data
){
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
removeClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
return
;
return
;
}
}
//如果是列表时
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是列表时
var
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
if
(
list_rows
.
length
==
0
){
var
txt3
=
"请选择要删除的文件!!!"
;
var
option3
=
{
title
:
"提示"
,
btn
:
parseInt
(
"0001"
,
2
)
}
window
.
wxc
.
xcConfirm
(
txt3
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option3
);
}
else
{
else
{
var
txt4
=
"是否要删除选中的文件!!!"
;
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
addClass
(
'disk_menu_noClick'
);
var
option4
=
{
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
removeClass
(
'disk_menu_noClick'
);
title
:
"删除提示"
,
onOk
:
function
(){
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
//根据id来删除行
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
id
);
}
}
}
}
window
.
wxc
.
xcConfirm
(
txt4
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option4
);
//如果是在首页点击了公司文件则不显示重命名,分享,删除,移动到,共享
if
(
$
(
'.disk_search_center>a'
).
eq
(
0
).
next
().
length
==
0
&&
lump_data
.
FILE_TYPE
==
'folder_company'
){
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
2
).
removeClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
6
).
removeClass
(
'disk_menu_noClick'
);
return
;
}
}
//如果是在首页点击了共享文件时,则不显示重命名,分享,删除,移动到,共享,下载
if
(
$
(
'.disk_search_center>a'
).
eq
(
0
).
next
().
length
==
0
&&
lump_data
.
FILE_TYPE
==
'folder_share'
){
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
2
).
removeClass
(
'disk_menu_noClick'
);
return
;
}
}
else
{
//普通文件的空白位置
//如果是块状时
if
(
lump_data
.
apiIndex
==
'0'
&&
lump_data
.
FATHER_ID
==
'A'
&&
$
(
'.disk_search_center>a'
).
eq
(
0
).
next
().
length
!=
0
){
var
lump_rows
=
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
);
$disk_menu
.
find
(
'.disk_menu_noClickBtn'
).
removeClass
(
'disk_menu_noClick'
);
if
(
lump_rows
.
length
==
0
){
$disk_menu
.
find
(
'.disk_menu_clickBtn'
).
addClass
(
'disk_menu_noClick'
);
var
txt1
=
"请选择要删除的文件!!!"
;
var
option1
=
{
title
:
"提示"
,
btn
:
parseInt
(
"0001"
,
2
)
}
}
window
.
wxc
.
xcConfirm
(
txt1
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option1
);
//如果点击了公司文件的空白位置
if
(
lump_data
.
UUID
==
'B'
){
$disk_menu
.
find
(
'li'
).
addClass
(
'disk_menu_noClick'
);
}
//如果点击了共享文件的空白位置
if
(
lump_data
.
UUID
==
'C'
&&
lump_data
.
apiIndex
==
'2'
){
$disk_menu
.
find
(
'li'
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li:last'
).
hide
();
}
else
if
(
lump_data
.
apiIndex
==
'2'
){
$disk_menu
.
find
(
'li'
).
eq
(
3
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
4
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
5
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
6
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
7
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
8
).
addClass
(
'disk_menu_noClick'
);
//根目录显示取消共享的操作,子目录不显示
if
(
$
(
'.disk_search_center>a'
).
eq
(
1
).
next
().
length
==
0
){
$disk_menu
.
find
(
'li:last'
).
show
();
$disk_menu
.
find
(
'li:last'
).
removeClass
(
'disk_menu_noClick'
);
}
}
else
{
else
{
var
txt2
=
"是否要删除选中的文件!!!"
;
$disk_menu
.
find
(
'li:last'
).
hide
();
var
option2
=
{
title
:
"删除提示"
,
onOk
:
function
(){
for
(
var
i
=
0
;
i
<
lump_rows
.
length
;
i
++
){
$
(
lump_rows
[
i
]).
parent
().
remove
();
}
}
}
}
}
window
.
wxc
.
xcConfirm
(
txt2
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option2
);
//如果是公司文件
if
(
lump_data
.
apiIndex
==
'1'
){
$disk_menu
.
find
(
'li'
).
eq
(
3
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
4
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
5
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
7
).
addClass
(
'disk_menu_noClick'
);
$disk_menu
.
find
(
'li'
).
eq
(
8
).
addClass
(
'disk_menu_noClick'
);
}
}
//如果是文件时,则不显示打开文件夹的按钮
if
(
lump_data
.
ISFILE
==
'1'
){
$disk_menu
.
find
(
'li'
).
eq
(
2
).
addClass
(
'disk_menu_noClick'
);
}
}
}
}
//删除文件夹
function
disk_deleteFolder
(
handler
){
disk_confirm
(
handler
,
'删除'
,
function
(
list_rows
,
uuids
){
//删除数据库的信息
var
result
=
disk_deleteFolder_sql
(
uuids
);
});
}
//数据库的删除文件
function
disk_deleteFolder_sql
(
uuids
){
var
result
=
storePersonalModule
.
storePersonalActAction
.
deleteStorePersonal
({
FIELD_CODE
:
uuids
});
return
result
;
}
//缩略图与列表的切换
//缩略图与列表的切换
function
disk_content_toggle
(
handler
){
function
disk_content_toggle
(
handler
){
//获得文件目录的最后一个数据
var
lump_data
=
$
(
'.disk_search_center>a:last'
).
data
(
'lump_data'
);
var
infos
;
//重新渲染块状
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
infos
=
init_disk_infos
(
'1'
,
lump_data
);
}
else
{
infos
=
init_disk_infos
(
'0'
,
lump_data
);
}
//绑定一个data来区别切换的状态toggleList==true为切换到了list
//绑定一个data来区别切换的状态toggleList==true为切换到了list
if
(
!
$
(
handler
).
data
(
'toggleList'
)){
if
(
!
$
(
handler
).
data
(
'toggleList'
)){
//列表形式
//列表形式
...
@@ -603,67 +734,24 @@ function disk_content_toggle(handler){
...
@@ -603,67 +734,24 @@ function disk_content_toggle(handler){
$
(
handler
).
attr
(
'title'
,
'切换到缩略图模式'
);
$
(
handler
).
attr
(
'title'
,
'切换到缩略图模式'
);
$
(
handler
).
removeClass
(
'glyphicon-th-large'
).
addClass
(
'glyphicon-th-list'
);
$
(
handler
).
removeClass
(
'glyphicon-th-large'
).
addClass
(
'glyphicon-th-list'
);
//如果是共享文件的列表显示时
if
(
lump_data
&&
lump_data
.
apiIndex
==
'2'
){
init_disk_enjoy_list
(
infos
);
}
else
{
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
//重新渲染列表
var
infos
=
[
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
}
]
init_disk_rubbish_list
(
infos
);
init_disk_rubbish_list
(
infos
);
}
}
else
{
else
{
//重新渲染列表
var
infos
=
[
{
id
:
'uuid1'
,
fileName
:
'公司文件'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder_company'
,
fileSize
:
'200KB'
},
{
id
:
'uuid2'
,
fileName
:
'共享文件'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder_share'
,
fileSize
:
'100KB'
},
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
}
]
init_disk_list
(
infos
);
init_disk_list
(
infos
);
}
}
}
}
}
else
{
else
{
//缩略图形式
//缩略图形式
$
(
handler
).
data
(
'toggleList'
,
false
);
$
(
handler
).
data
(
'toggleList'
,
false
);
$
(
handler
).
attr
(
'title'
,
'切换到列表模式'
);
$
(
handler
).
attr
(
'title'
,
'切换到列表模式'
);
$
(
handler
).
removeClass
(
'glyphicon-th-list'
).
addClass
(
'glyphicon-th-large'
);
$
(
handler
).
removeClass
(
'glyphicon-th-list'
).
addClass
(
'glyphicon-th-large'
);
//重新渲染块状
if
(
$
(
'#disk_rubbish'
).
data
(
'rubbish'
)){
var
infos
=
[
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
}
]
}
else
{
var
infos
=
[
{
id
:
'uuid1'
,
fileName
:
'公司文件'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder_company'
,
fileSize
:
'200KB'
},
{
id
:
'uuid2'
,
fileName
:
'共享文件'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder_share'
,
fileSize
:
'100KB'
},
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
}
]
}
//先清空容器
//先清空容器
$
(
'.disk_content_lump'
).
html
(
''
);
$
(
'.disk_content_lump'
).
html
(
''
);
//渲染块状
//渲染块状
...
@@ -674,12 +762,131 @@ function disk_content_toggle(handler){
...
@@ -674,12 +762,131 @@ function disk_content_toggle(handler){
$
(
'.disk_content_lump,.disk_content_list'
).
toggle
();
$
(
'.disk_content_lump,.disk_content_list'
).
toggle
();
}
}
//初始化共享文件的列表
function
init_disk_enjoy_list
(
infos
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
init_disk_select_fileImg
(
infos
[
i
]);
}
$
(
'#disk_content_list'
).
bootstrapTable
(
'destroy'
).
bootstrapTable
({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data
:
infos
,
cache
:
false
,
// 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination
:
false
,
// 在表格底部显示分页组件,默认false
pageList
:
[
5
,
10
,
15
,
20
],
// 设置页面可以显示的数据条数
pageSize
:
10
,
// 页面数据条数
pageNumber
:
1
,
// 首页页码,
uniqueId
:
'FILE_UUID'
,
//clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams
:
function
(
params
){
var
temp
=
{
//这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset
:
params
.
offset
,
//页码
pageSize
:
this
.
pageSize
,
pageNumber
:
this
.
pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return
temp
;
},
columns
:
[
{
checkbox
:
true
,
// 显示一个勾选框
align
:
'center'
,
// 居中显示
valign
:
'middle'
},{
field
:
'FILE_NAME'
,
title
:
'文件名称'
,
align
:
'left'
,
valign
:
'middle'
,
width
:
400
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
fileImg
){
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/custom/images/'
+
row
.
fileImg
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
else
{
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/photo/photo.jsp?ls_photo='
+
row
.
FILE_SAVE_PATH
+
row
.
FILE_SVAE_NAME
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
}
},
{
field
:
'SHARE_TIME'
,
title
:
'共享时间'
,
align
:
'center'
,
valign
:
'middle'
,
order
:
'asc'
,
sortable
:
'true'
},
{
field
:
'FILE_TYPE'
,
title
:
'类型'
,
align
:
'center'
,
valign
:
'middle'
},{
field
:
'FILE_SIZE'
,
title
:
'大小'
,
align
:
'center'
,
valign
:
'middle'
,
formatter
:
function
(
value
,
row
,
index
)
{
return
$
.
jfbrother
.
fileSizeToStr
(
row
.
FILE_SIZE
);
}
},{
field
:
'SHARE_NAME'
,
title
:
'共享目标人'
,
align
:
'center'
,
valign
:
'middle'
},{
field
:
'CREATE_NAME'
,
title
:
'创建人'
,
align
:
'center'
,
valign
:
'middle'
}
],
//选中时隐藏菜单
onCheck
:
function
(
row
){
$
(
'#disk_menu'
).
hide
();
},
//当用户点击某一列的时候触发
onClickCell
:
function
(
field
,
value
,
row
,
$element
){
if
(
field
==
'FILE_NAME'
){
//编辑,把td传入
disk_editFolder_list
(
$element
);
}
},
//当用户双击某一行的时候触发
onDblClickRow
:
function
(
row
,
$element
){
//根据file_uuid重新渲染列表
disk_list_dbClick
(
row
,
$element
);
},
//当用户单击某一行的时候触发
onClickRow
:
function
(
row
,
$element
){
//选中这行
//在根据file_uuid来获得对象
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
row
.
FILE_UUID
){
var
index
=
$
(
element
).
data
(
'index'
);
//如果正处于编辑状态那就选中,否则就反着选
if
(
$
(
element
).
find
(
'.disk_content_list_fileName input'
).
css
(
'display'
)
!=
'none'
||!
$
(
element
).
find
(
'input[type="checkbox"]'
).
prop
(
'checked'
)){
$
(
'#disk_content_list'
).
bootstrapTable
(
'check'
,
index
);
}
else
{
$
(
'#disk_content_list'
).
bootstrapTable
(
'uncheck'
,
index
);
}
}
})
}
//
})
}
//初始化文件的列表
//初始化文件的列表
function
init_disk_list
(
infos
){
function
init_disk_list
(
infos
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
init_disk_select_fileImg
(
infos
[
i
]);
init_disk_select_fileImg
(
infos
[
i
]);
}
}
$
(
'#disk_content_list'
).
bootstrapTable
(
'destroy'
).
bootstrapTable
({
$
(
'#disk_content_list'
).
bootstrapTable
(
'destroy'
).
bootstrapTable
({
/* showColumns:true,
/* showColumns:true,
showToggle:true,
showToggle:true,
...
@@ -693,7 +900,7 @@ function init_disk_list(infos){
...
@@ -693,7 +900,7 @@ function init_disk_list(infos){
pageList
:
[
5
,
10
,
15
,
20
],
// 设置页面可以显示的数据条数
pageList
:
[
5
,
10
,
15
,
20
],
// 设置页面可以显示的数据条数
pageSize
:
10
,
// 页面数据条数
pageSize
:
10
,
// 页面数据条数
pageNumber
:
1
,
// 首页页码,
pageNumber
:
1
,
// 首页页码,
uniqueId
:
'
id
'
,
uniqueId
:
'
UUID
'
,
//clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
//clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams
:
function
(
params
){
queryParams
:
function
(
params
){
var
temp
=
{
//这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
var
temp
=
{
//这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
...
@@ -713,31 +920,39 @@ function init_disk_list(infos){
...
@@ -713,31 +920,39 @@ function init_disk_list(infos){
align
:
'center'
,
// 居中显示
align
:
'center'
,
// 居中显示
valign
:
'middle'
valign
:
'middle'
},{
},{
field
:
'
fileName
'
,
field
:
'
FILE_NAME
'
,
title
:
'文件名称'
,
title
:
'文件名称'
,
align
:
'left'
,
align
:
'left'
,
valign
:
'middle'
,
valign
:
'middle'
,
width
:
400
,
width
:
400
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/custom/images/'
+
row
.
fileImg
+
'" height="44" ></div><div class="col-md-10"><div>'
+
value
+
'</div><input type="text" value='
+
value
+
' class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
if
(
row
.
fileImg
){
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/custom/images/'
+
row
.
fileImg
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
else
{
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/photo/photo.jsp?ls_photo='
+
row
.
FILE_SAVE_PATH
+
row
.
FILE_SVAE_NAME
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
}
}
},
{
},
{
field
:
'
lastTime
'
,
field
:
'
UPDATE_TIME
'
,
title
:
'修改时间'
,
title
:
'修改时间'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
,
valign
:
'middle'
,
order
:
'asc'
,
order
:
'asc'
,
sortable
:
'true'
sortable
:
'true'
},
{
},
{
field
:
'
fileType
'
,
field
:
'
FILE_TYPE
'
,
title
:
'类型'
,
title
:
'类型'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
valign
:
'middle'
},{
},{
field
:
'
fileSize
'
,
field
:
'
FILE_SIZE
'
,
title
:
'大小'
,
title
:
'大小'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
valign
:
'middle'
,
formatter
:
function
(
value
,
row
,
index
)
{
return
$
.
jfbrother
.
fileSizeToStr
(
row
.
FILE_SIZE
);
}
}
}
],
],
//选中时隐藏菜单
//选中时隐藏菜单
...
@@ -746,22 +961,22 @@ function init_disk_list(infos){
...
@@ -746,22 +961,22 @@ function init_disk_list(infos){
},
},
//当用户点击某一列的时候触发
//当用户点击某一列的时候触发
onClickCell
:
function
(
field
,
value
,
row
,
$element
){
onClickCell
:
function
(
field
,
value
,
row
,
$element
){
if
(
field
==
'
fileName
'
){
if
(
field
==
'
FILE_NAME
'
){
//编辑,把td传入
//编辑,把td传入
disk_editFolder_list
(
$element
);
disk_editFolder_list
(
$element
);
}
}
},
},
//当用户双击某一行的时候触发
//当用户双击某一行的时候触发
onDblClickRow
:
function
(
row
,
$element
){
onDblClickRow
:
function
(
row
,
$element
){
//根据id重新渲染列表
//根据
uu
id重新渲染列表
disk_list_dbClick
(
row
,
$element
);
disk_list_dbClick
(
row
,
$element
);
},
},
//当用户单击某一行的时候触发
//当用户单击某一行的时候触发
onClickRow
:
function
(
row
,
$element
){
onClickRow
:
function
(
row
,
$element
){
//选中这行
//选中这行
//在根据id来获得对象
//在根据
uu
id来获得对象
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
row
.
id
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
row
.
UUID
){
var
index
=
$
(
element
).
data
(
'index'
);
var
index
=
$
(
element
).
data
(
'index'
);
//如果正处于编辑状态那就选中,否则就反着选
//如果正处于编辑状态那就选中,否则就反着选
if
(
$
(
element
).
find
(
'.disk_content_list_fileName input'
).
css
(
'display'
)
!=
'none'
||!
$
(
element
).
find
(
'input[type="checkbox"]'
).
prop
(
'checked'
)){
if
(
$
(
element
).
find
(
'.disk_content_list_fileName input'
).
css
(
'display'
)
!=
'none'
||!
$
(
element
).
find
(
'input[type="checkbox"]'
).
prop
(
'checked'
)){
...
@@ -796,7 +1011,7 @@ function init_disk_rubbish_list(infos){
...
@@ -796,7 +1011,7 @@ function init_disk_rubbish_list(infos){
pageList
:
[
5
,
10
,
15
,
20
],
// 设置页面可以显示的数据条数
pageList
:
[
5
,
10
,
15
,
20
],
// 设置页面可以显示的数据条数
pageSize
:
10
,
// 页面数据条数
pageSize
:
10
,
// 页面数据条数
pageNumber
:
1
,
// 首页页码,
pageNumber
:
1
,
// 首页页码,
uniqueId
:
'
id
'
,
uniqueId
:
'
UUID
'
,
clickToSelect
:
true
,
//True to select checkbox or radiobox when the column is clicked.
clickToSelect
:
true
,
//True to select checkbox or radiobox when the column is clicked.
queryParams
:
function
(
params
){
queryParams
:
function
(
params
){
var
temp
=
{
//这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
var
temp
=
{
//这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
...
@@ -816,28 +1031,33 @@ function init_disk_rubbish_list(infos){
...
@@ -816,28 +1031,33 @@ function init_disk_rubbish_list(infos){
align
:
'center'
,
// 居中显示
align
:
'center'
,
// 居中显示
valign
:
'middle'
valign
:
'middle'
},{
},{
field
:
'
fileName
'
,
field
:
'
FILE_NAME
'
,
title
:
'文件名称'
,
title
:
'文件名称'
,
align
:
'left'
,
align
:
'left'
,
valign
:
'middle'
,
valign
:
'middle'
,
width
:
400
,
width
:
400
,
formatter
:
function
(
value
,
row
,
index
)
{
formatter
:
function
(
value
,
row
,
index
)
{
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/custom/images/'
+
row
.
fileImg
+
'" height="44" ></div><div class="col-md-10"><div style="color:#666;cursor:text;">'
+
value
+
'</div><input type="text" value='
+
value
+
' class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
if
(
row
.
fileImg
){
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/custom/images/'
+
row
.
fileImg
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
else
{
return
'<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'
+
ctx
+
'/photo/photo.jsp?ls_photo='
+
row
.
FILE_SAVE_PATH
+
row
.
FILE_SVAE_NAME
+
'" height="44" ></div><div class="col-md-10" data-lump_data=
\'
'
+
JSON
.
stringify
(
row
)
+
'
\'
><div>'
+
value
+
'</div><input type="text" value=
\'
'
+
value
+
'
\'
class="form-control" onblur="disk_input_blur(this)" /></div></div>'
;
}
}
}
},
{
},
{
field
:
'
lastTime
'
,
field
:
'
UPDATE_TIME
'
,
title
:
'删除时间'
,
title
:
'删除时间'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
,
valign
:
'middle'
,
order
:
'asc'
,
order
:
'asc'
,
sortable
:
'true'
sortable
:
'true'
},
{
},
{
field
:
'
fileType
'
,
field
:
'
FILE_TYPE
'
,
title
:
'类型'
,
title
:
'类型'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
valign
:
'middle'
},{
},{
field
:
'
fileSize
'
,
field
:
'
FILE_SIZE
'
,
title
:
'大小'
,
title
:
'大小'
,
align
:
'center'
,
align
:
'center'
,
valign
:
'middle'
valign
:
'middle'
...
@@ -879,6 +1099,11 @@ function disk_editFolder(handler){
...
@@ -879,6 +1099,11 @@ function disk_editFolder(handler){
//列表的编辑
//列表的编辑
function
disk_editFolder_list
(
handler
){
function
disk_editFolder_list
(
handler
){
var
lump_data
=
$
(
handler
).
find
(
'div'
).
eq
(
2
).
data
(
'lump_data'
);
//如果是公司文件或者是共享文件则不能编辑
if
(
lump_data
.
apiIndex
==
'1'
||
lump_data
.
apiIndex
==
'2'
){
return
;
}
var
$input
=
$
(
handler
).
find
(
'input'
);
var
$input
=
$
(
handler
).
find
(
'input'
);
$input
.
prev
().
hide
();
$input
.
prev
().
hide
();
$input
.
show
();
$input
.
show
();
...
@@ -888,28 +1113,50 @@ function disk_editFolder_list(handler){
...
@@ -888,28 +1113,50 @@ function disk_editFolder_list(handler){
//双击列表时
//双击列表时
function
disk_list_dbClick
(
row
,
handler
){
function
disk_list_dbClick
(
row
,
handler
){
disk_dbClick_custom
(
$
(
handler
).
find
(
'.disk_content_list_fileName input'
),
row
,
function
(
infos
){
//如果是共享文件,那就显示共享的列表
if
(
row
.
apiIndex
==
'2'
){
init_disk_enjoy_list
(
infos
);
}
else
{
init_disk_list
(
infos
);
}
});
//如果是公司文件时
if
(
row
.
FILE_TYPE
==
'folder_company'
){
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
//显示下载按钮
$
(
'.disk_content_header>div:first-child>a'
).
eq
(
1
).
show
();
}
else
if
(
row
.
FILE_TYPE
==
'folder_share'
){
//显示取消共享的按钮
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
$
(
'.disk_enjoyBtn'
).
show
();
}
}
//块状以及列表的双击点击事件的提取,返回一个数组,callback回调
function
disk_dbClick_custom
(
edit_input
,
lump_data
,
callback
){
//正处在编辑时不能双击
//正处在编辑时不能双击
if
(
$
(
handler
).
find
(
'.disk_content_list_fileName input'
).
css
(
'display'
)
!=
'none'
){
if
(
$
(
edit_input
).
css
(
'display'
)
!=
'none'
){
return
;
}
//如果是文件时,则不能做点击效果
if
(
lump_data
.
ISFILE
==
'1'
){
alert
(
'在线预览'
)
return
;
return
;
}
}
//添加目录的导航效果
//添加目录的导航效果
var
$search_center
=
$
(
'.disk_search_center'
);
var
$search_center
=
$
(
'.disk_search_center'
);
var
$create_a
=
$
(
'<a onclick="disk_backFolder(this)"></a>'
);
var
$create_a
=
$
(
'<a onclick="disk_backFolder(this)"></a>'
)
.
data
(
'lump_data'
,
lump_data
);
;
var
$create_span1
=
$
(
'<span></span>'
).
text
(
$
(
handler
).
find
(
'.disk_content_list_fileName input'
).
val
());
var
$create_span1
=
$
(
'<span></span>'
).
text
(
$
(
edit_input
).
val
());
var
$create_span2
=
$
(
'<span></span>'
).
addClass
(
'glyphicon glyphicon-triangle-right'
);
var
$create_span2
=
$
(
'<span></span>'
).
addClass
(
'glyphicon glyphicon-triangle-right'
);
$create_a
.
append
(
$create_span1
).
append
(
$create_span2
);
$create_a
.
append
(
$create_span1
).
append
(
$create_span2
);
$search_center
.
append
(
$create_a
);
$search_center
.
append
(
$create_a
);
var
infos
=
init_disk_infos
(
'0'
,
lump_data
);
//重新渲染列表,模拟几条数据
if
(
typeof
callback
==
'function'
){
var
infos
=
[
callback
(
infos
);
{
id
:
'uuid8'
,
fileName
:
'我的文件1'
,
fileImg
:
'disk_module5.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder'
,
fileSize
:
'200KB'
},
}
{
id
:
'uuid9'
,
fileName
:
'我的文件2'
,
fileImg
:
'disk_module5.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder'
,
fileSize
:
'100KB'
},
{
id
:
'uuid10'
,
fileName
:
'我的文件3'
,
fileImg
:
'disk_module5.png'
,
lastTime
:
'2018-06-15 12:50'
,
fileType
:
'folder'
,
fileSize
:
'50KB'
}
]
init_disk_list
(
infos
);
}
}
//进入文件夹
//进入文件夹
...
@@ -922,9 +1169,17 @@ function disk_enterFolder(handler){
...
@@ -922,9 +1169,17 @@ function disk_enterFolder(handler){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是列表时
//如果是列表时
var
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
var
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
//在根据id来获得对象
var
uuid
;
//如果是共享文件,并且是共享文件的子目录,则根据file_uuid来获得对象
if
(
list_rows
[
0
].
apiIndex
==
'2'
&&
$
(
'.disk_search_center>a'
).
eq
(
0
).
next
().
length
!=
0
){
uuid
=
list_rows
[
0
].
FILE_UUID
;
}
//否则就用uuid来获得对象
else
{
uuid
=
list_rows
[
0
].
UUID
;
}
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
$
(
'#disk_content_list tr'
).
each
(
function
(
index
,
element
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
list_rows
[
0
].
id
){
if
(
$
(
element
).
data
(
'uniqueid'
)
==
uu
id
){
disk_list_dbClick
(
list_rows
[
0
],
$
(
element
));
disk_list_dbClick
(
list_rows
[
0
],
$
(
element
));
return
false
;
return
false
;
}
}
...
@@ -945,39 +1200,24 @@ function disk_backFolder(handler){
...
@@ -945,39 +1200,24 @@ function disk_backFolder(handler){
}
}
//清除之后的a
//清除之后的a
$
(
handler
).
nextAll
(
'a'
).
remove
();
$
(
handler
).
nextAll
(
'a'
).
remove
();
var
lump_data
=
$
(
handler
).
data
(
'lump_data'
);
//获得数据列表
var
lump_infos
=
init_disk_infos
(
'0'
,
lump_data
);
//重新渲染数据
//重新渲染数据
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是列表时
//如果是列表时
//重新渲染列表
//重新渲染列表
var
list_infos
=
[
//如果是共享文件,那就显示共享的列表
{
id
:
'uuid1'
,
fileName
:
'公司文件'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder_company'
,
fileSize
:
'200KB'
},
if
(
lump_data
.
apiIndex
==
'2'
){
{
id
:
'uuid2'
,
fileName
:
'共享文件'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder_share'
,
fileSize
:
'100KB'
},
init_disk_enjoy_list
(
lump_infos
);
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
}
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
else
{
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
init_disk_list
(
lump_infos
);
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
}
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
}
]
init_disk_list
(
list_infos
);
}
}
else
{
else
{
//如果是块状时
//如果是块状时
//根据一个json数据去渲染块状
//根据一个json数据去渲染块状
var
lump_infos
=
[
{
id
:
'uuid1'
,
fileName
:
'公司文件'
,
fileImg
:
'disk_module1.png'
,
lastTime
:
'2018-06-19 14:20'
,
fileType
:
'folder_company'
,
fileSize
:
'200KB'
},
{
id
:
'uuid2'
,
fileName
:
'共享文件'
,
fileImg
:
'disk_module2.png'
,
lastTime
:
'2018-06-18 15:50'
,
fileType
:
'folder_share'
,
fileSize
:
'100KB'
},
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
},
]
//渲染块状
//渲染块状
//先清空容器
//先清空容器
$
(
'.disk_content_lump'
).
html
(
''
);
$
(
'.disk_content_lump'
).
html
(
''
);
...
@@ -1033,6 +1273,7 @@ function disk_moveFolder(handler){
...
@@ -1033,6 +1273,7 @@ function disk_moveFolder(handler){
var
strVar
=
""
;
var
strVar
=
""
;
strVar
+=
"<div style=
\"
width:268px;padding:0px;border-radius:5px;overflow:hidden;
\"
>
\
n"
;
strVar
+=
"<div style=
\"
width:268px;padding:0px;border-radius:5px;overflow:hidden;
\"
>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_title
\"
><span>移动文件<
\
/span><span onclick=
\"
$.fancybox.close()
\"
class=
\"
glyphicon glyphicon-remove
\"
><
\
/span><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_title
\"
><span>移动文件<
\
/span><span onclick=
\"
$.fancybox.close()
\"
class=
\"
glyphicon glyphicon-remove
\"
><
\
/span><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_search
\"
><input placeholder=
\"
搜索文件夹
\"
type=
\"
text
\"
><span onclick=
\"
alert('搜索')
\"
>搜索</span><
\
/div>
\
n"
;
strVar
+=
" <div id=
\"
disk_move_tree
\"
style=
\"
height:220px;overflow:auto;
\"
class=
\"
ztree disk_move_tree
\"
><
\
/div>
\
n"
;
strVar
+=
" <div id=
\"
disk_move_tree
\"
style=
\"
height:220px;overflow:auto;
\"
class=
\"
ztree disk_move_tree
\"
><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_btn
\"
>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_btn
\"
>
\
n"
;
strVar
+=
" <span onclick=
\"
disk_moveFolder_save()
\"
>确定<
\
/span><span onclick=
\"
$.fancybox.close()
\"
>取消<
\
/span>
\
n"
;
strVar
+=
" <span onclick=
\"
disk_moveFolder_save()
\"
>确定<
\
/span><span onclick=
\"
$.fancybox.close()
\"
>取消<
\
/span>
\
n"
;
...
@@ -1069,31 +1310,71 @@ function disk_moveFolder_save(){
...
@@ -1069,31 +1310,71 @@ function disk_moveFolder_save(){
}
}
//选择共享人之后的保存
//选择共享人之后的保存
,做了多选文件的共享(暂时只能单文件)
function
disk_enjoyUser_save
(){
function
disk_enjoyUser_save
(
lump_data
){
var
treeObj
=
$
.
fn
.
zTree
.
getZTreeObj
(
"disk_enjoyUser_tree"
);
var
treeObj
=
$
.
fn
.
zTree
.
getZTreeObj
(
"disk_enjoyUser_tree"
);
var
nodes
=
treeObj
.
getSelectedNodes
();
var
nodes
=
treeObj
.
getSelectedNodes
();
console
.
log
(
nodes
)
var
query
=
{};
var
uuids
=
''
;
var
userIds
=
''
;
for
(
var
i
=
0
;
i
<
lump_data
.
length
;
i
++
){
uuids
=
uuids
+
lump_data
[
i
].
UUID
+
','
;
}
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
){
userIds
=
userIds
+
nodes
[
i
].
USER_ID
+
','
;
}
uuids
=
uuids
.
substring
(
0
,
uuids
.
length
-
1
);
userIds
=
userIds
.
substring
(
0
,
userIds
.
length
-
1
);
query
.
FIELD_CODE
=
uuids
;
query
.
FIELD_USER_ID
=
userIds
;
var
result
=
storePersonalModule
.
storePersonalActAction
.
shareStorePersonal
(
query
);
$
.
fancybox
.
close
();
$
.
fancybox
.
close
();
}
//重新渲染显示的内容
//取消共享操作
function
disk_cancelEnjoy
(
handler
){
//如果是子目录中的共享,则做个提示操作
if
(
$
(
'.disk_search_center>a'
).
eq
(
1
).
next
().
length
!=
0
){
var
txt
=
'只能取消共享根目录!!!'
;
var
option
=
{
title
:
'取消共享提示'
,
btn
:
parseInt
(
"0001"
,
2
)
}
window
.
wxc
.
xcConfirm
(
txt
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
error
,
option
);
return
;
}
disk_confirm
(
handler
,
'取消共享'
,
function
(
list_rows
,
uuids
){
//数据库的取消共享信息
var
result
=
disk_cancelEnjoy_sql
(
uuids
);
});
}
//取消共享的数据库操作
function
disk_cancelEnjoy_sql
(
uuids
){
var
query
=
{};
query
.
FIELD_CODE
=
uuids
;
//先软删除
var
result1
=
storeShareModule
.
storeShareActAction
.
deleteStoreShare
(
query
);
//再真正的删除
var
result2
=
storeShareModule
.
storeShareActAction
.
deleteTrueStoreShare
(
query
);
}
}
//初始化文件时移动的目录
//初始化文件时移动的目录
function
init_disk_move_tree
(
rows_data
){
function
init_disk_move_tree
(
rows_data
){
var
infos
=
infos
=
storePersonalModule
.
storePersonalDataAction
.
listAll_storePersonalnofile
().
rowSet
;
console
.
log
(
infos
)
var
ztreeData
=
[
var
ztreeData
=
[
{
pid
:
'0'
,
id
:
'A'
,
name
:
"公司文件"
,
fileType
:
'folder_company'
},
{
pid
:
'0'
,
id
:
'A'
,
name
:
"公司文件"
,
FILE_TYPE
:
'folder_company'
},
{
pid
:
'A'
,
id
:
'A1'
,
name
:
'我的文件夹1'
,
fileType
:
'folder'
},
{
pid
:
'A'
,
id
:
'A1'
,
name
:
'我的文件夹1'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A'
,
id
:
'A2'
,
name
:
'我的文件夹2'
,
fileType
:
'folder'
},
{
pid
:
'A'
,
id
:
'A2'
,
name
:
'我的文件夹2'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A'
,
id
:
'A3'
,
name
:
'我的文件夹3'
,
fileType
:
'folder'
},
{
pid
:
'A'
,
id
:
'A3'
,
name
:
'我的文件夹3'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A'
,
id
:
'A4'
,
name
:
'我的文件夹4'
,
fileType
:
'folder'
},
{
pid
:
'A'
,
id
:
'A4'
,
name
:
'我的文件夹4'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A4'
,
id
:
'A5'
,
name
:
'我的文件夹5'
,
fileType
:
'folder'
},
{
pid
:
'A4'
,
id
:
'A5'
,
name
:
'我的文件夹5'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A5'
,
id
:
'A6'
,
name
:
'我的文件夹5'
,
fileType
:
'folder'
},
{
pid
:
'A5'
,
id
:
'A6'
,
name
:
'我的文件夹5'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'A6'
,
id
:
'A7'
,
name
:
'我的文件夹5'
,
fileType
:
'folder'
},
{
pid
:
'A6'
,
id
:
'A7'
,
name
:
'我的文件夹5'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'0'
,
id
:
'B'
,
name
:
'共享文件'
,
fileType
:
'folder_share'
},
{
pid
:
'0'
,
id
:
'B'
,
name
:
'共享文件'
,
FILE_TYPE
:
'folder_share'
},
{
pid
:
'B'
,
id
:
'B4'
,
name
:
'我的文件夹5'
,
fileType
:
'folder'
},
{
pid
:
'B'
,
id
:
'B4'
,
name
:
'我的文件夹5'
,
FILE_TYPE
:
'folder'
},
{
pid
:
'B'
,
id
:
'B4'
,
name
:
'我的文件夹6'
,
fileType
:
'folder'
}
{
pid
:
'B'
,
id
:
'B4'
,
name
:
'我的文件夹6'
,
FILE_TYPE
:
'folder'
}
];
];
for
(
var
i
=
0
;
i
<
ztreeData
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
ztreeData
.
length
;
i
++
){
...
@@ -1149,25 +1430,23 @@ function init_disk_move_tree(rows_data){
...
@@ -1149,25 +1430,23 @@ function init_disk_move_tree(rows_data){
//初始化共享人的树
//初始化共享人的树
function
init_disk_enjoyUser_tree
(
rows_data
){
function
init_disk_enjoyUser_tree
(
rows_data
){
var
ztreeData
=
[
/*var result = jwAppUserModel.jwAppsUserDataAction.listALLUserUnit();*/
{
pid
:
'0'
,
id
:
'A'
,
name
:
'技术部'
,
icon
:
'custom/images/disk_enjoy_users.png'
},
var
ztreeData
;
{
pid
:
'A'
,
id
:
'A1'
,
name
:
'联系人1'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
$
.
ajax
({
{
pid
:
'A'
,
id
:
'A2'
,
name
:
'联系人2'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
url
:
'userchoiceData_listUser'
,
{
pid
:
'A'
,
id
:
'A3'
,
name
:
'联系人3'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
type
:
'post'
,
{
pid
:
'A'
,
id
:
'A4'
,
name
:
'联系人4'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
async
:
false
,
{
pid
:
'A'
,
id
:
'A5'
,
name
:
'联系人5'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
success
:
function
(
data
){
{
pid
:
'A'
,
id
:
'A6'
,
name
:
'联系人6'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
ztreeData
=
data
.
rowSet
;
{
pid
:
'A'
,
id
:
'A7'
,
name
:
'联系人7'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
}
{
pid
:
'A'
,
id
:
'A8'
,
name
:
'联系人8'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
})
{
pid
:
'A'
,
id
:
'A9'
,
name
:
'联系人9'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
{
pid
:
'A'
,
id
:
'A10'
,
name
:
'联系人10'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
{
pid
:
'A'
,
id
:
'A11'
,
name
:
'联系人11'
,
icon
:
'custom/images/disk_enjoy_user.png'
},
{
pid
:
'A'
,
id
:
'A12'
,
name
:
'联系人12'
,
icon
:
'custom/images/disk_enjoy_user.png'
}
];
/*for(var i =0;i<ztreeData.length;i++){
for
(
var
i
=
0
;
i
<
ztreeData
.
length
;
i
++
){
init_disk_select_fileImg(ztreeData[i]);
ztreeData
[
i
].
icon
=
'custom/images/disk_enjoy_users.png'
;
}*/
//所有都显示文件夹的样子
//ztreeData[i].isParent=true;
}
console
.
log
(
ztreeData
)
//还要做一步过滤
//还要做一步过滤
//1.把自身及以下文件过滤掉
//1.把自身及以下文件过滤掉
...
@@ -1189,9 +1468,12 @@ function init_disk_enjoyUser_tree(rows_data){
...
@@ -1189,9 +1468,12 @@ function init_disk_enjoyUser_tree(rows_data){
data
:
{
data
:
{
simpleData
:
{
simpleData
:
{
enable
:
true
,
enable
:
true
,
idKey
:
"
id
"
,
idKey
:
"
USER_ID
"
,
pIdKey
:
"
pid
"
,
pIdKey
:
"
PARENT_ID
"
,
rootPId
:
0
rootPId
:
0
},
key
:
{
name
:
"USER_NAME"
}
}
},
},
view
:
{
view
:
{
...
@@ -1223,13 +1505,13 @@ function init_disk_enjoyUser_tree(rows_data){
...
@@ -1223,13 +1505,13 @@ function init_disk_enjoyUser_tree(rows_data){
//初始化文件的图片
//初始化文件的图片
function
init_disk_select_fileImg
(
ztreeData
){
function
init_disk_select_fileImg
(
ztreeData
){
if
(
',jpg,png,jpeg,gif,'
.
indexOf
(
','
+
ztreeData
.
fileType
+
','
)
==-
1
){
if
(
',jpg,png,jpeg,gif,'
.
indexOf
(
','
+
ztreeData
.
FILE_TYPE
+
','
)
==-
1
){
//非图片类型需要判断显示的图片
//非图片类型需要判断显示的图片
//iconOpen:文件夹树形结构打开图片
//iconOpen:文件夹树形结构打开图片
//iconClose:文件夹树形结构关闭图片
//iconClose:文件夹树形结构关闭图片
//icon:文件夹树形结构叶子图片
//icon:文件夹树形结构叶子图片
//fileImg:桌面显示图片
//fileImg:桌面显示图片
switch
(
ztreeData
.
fileType
)
{
switch
(
ztreeData
.
FILE_TYPE
)
{
case
'folder_company'
:
case
'folder_company'
:
ztreeData
.
iconOpen
=
'custom/images/disk_module1.png'
;
ztreeData
.
iconOpen
=
'custom/images/disk_module1.png'
;
ztreeData
.
iconClose
=
'custom/images/disk_module1_close.png'
;
ztreeData
.
iconClose
=
'custom/images/disk_module1_close.png'
;
...
@@ -1264,13 +1546,13 @@ function init_disk_select_fileImg(ztreeData){
...
@@ -1264,13 +1546,13 @@ function init_disk_select_fileImg(ztreeData){
ztreeData
.
fileImg
=
'disk_rar.png'
;
ztreeData
.
fileImg
=
'disk_rar.png'
;
break
;
break
;
case
'txt'
:
case
'txt'
:
ztreeData
.
fileImg
=
'disk_
unknow
.png'
;
ztreeData
.
fileImg
=
'disk_
txt
.png'
;
break
;
break
;
case
'ppt'
:
case
'ppt'
:
ztreeData
.
fileImg
=
'disk_ppt.png'
;
ztreeData
.
fileImg
=
'disk_ppt.png'
;
break
;
break
;
case
'pdf'
:
case
'pdf'
:
ztreeData
.
fileImg
=
=
'disk_pdf.png'
;
ztreeData
.
fileImg
=
'disk_pdf.png'
;
break
;
break
;
case
'excel'
:
case
'excel'
:
ztreeData
.
fileImg
=
'disk_excel.png'
;
ztreeData
.
fileImg
=
'disk_excel.png'
;
...
@@ -1570,16 +1852,10 @@ function disk_rubbish(){
...
@@ -1570,16 +1852,10 @@ function disk_rubbish(){
$
(
'.disk_content_toggleBtn'
).
show
();
$
(
'.disk_content_toggleBtn'
).
show
();
//标记下是否是切换到了回收站
//标记下是否是切换到了回收站
$
(
'#disk_rubbish'
).
data
(
'rubbish'
,
true
);
$
(
'#disk_rubbish'
).
data
(
'rubbish'
,
true
);
//模拟几条垃圾数据
var
infos
=
[
//获取回收站的列表
{
id
:
'uuid5'
,
fileName
:
'压缩文件夹'
,
fileImg
:
'disk_rar.png'
,
lastTime
:
'2018-06-18 12:10'
,
fileType
:
'rar'
,
fileSize
:
'1MB'
},
var
infos
=
init_disk_infos
(
'1'
);
{
id
:
'uuid6'
,
fileName
:
'我的文档'
,
fileImg
:
'disk_word.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'word'
,
fileSize
:
'200KB'
},
{
id
:
'uuid7'
,
fileName
:
'我的EXCEL'
,
fileImg
:
'disk_excel.png'
,
lastTime
:
'2018-06-19 8:10'
,
fileType
:
'excel'
,
fileSize
:
'100KB'
},
{
id
:
'uuid8'
,
fileName
:
'我的PPT'
,
fileImg
:
'disk_ppt.png'
,
lastTime
:
'2018-06-17 8:10'
,
fileType
:
'ppt'
,
fileSize
:
'500KB'
},
{
id
:
'uuid9'
,
fileName
:
'我的PDF'
,
fileImg
:
'disk_pdf.png'
,
lastTime
:
'2018-06-19 23:10'
,
fileType
:
'pdf'
,
fileSize
:
'500KB'
},
{
id
:
'uuid10'
,
fileName
:
'超级狙击手.png'
,
fileImg
:
'disk_uploadImg.png'
,
lastTime
:
'2018-06-19 20:10'
,
fileSize
:
'50KB'
,
fileType
:
'png'
},
{
id
:
'uuid11'
,
fileName
:
'disk_unknow.bsl'
,
fileImg
:
'disk_unknow.png'
,
lastTime
:
'2018-06-19 22:10'
,
fileType
:
'未知文件格式'
,
fileSize
:
'30KB'
},
]
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
$
(
'.disk_content_header>div:first-child>a'
).
hide
();
$
(
'.disk_rubbishBtn'
).
show
();
$
(
'.disk_rubbishBtn'
).
show
();
...
@@ -1593,6 +1869,14 @@ function disk_rubbish(){
...
@@ -1593,6 +1869,14 @@ function disk_rubbish(){
//先清空容器
//先清空容器
$
(
'.disk_content_lump'
).
html
(
''
);
$
(
'.disk_content_lump'
).
html
(
''
);
//渲染块状
//渲染块状
if
(
infos
.
length
==
0
){
var
$disk_content_lump
=
$
(
'.disk_content_lump'
);
var
$no_file_content
=
$
(
'<div></div>'
).
addClass
(
'disk_content_lump_noFile'
);
var
$no_file_img
=
$
(
'<img src='
+
ctx
+
'/custom/images/disk_lump_noFile.png width="131" height="116" />'
);
var
$no_file_text
=
$
(
'<p></p>'
).
text
(
'暂无删除的记录~'
);
$disk_content_lump
.
append
(
$no_file_content
);
$no_file_content
.
append
(
$no_file_img
).
append
(
$no_file_text
);
}
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
infos
.
length
;
i
++
){
init_disk_createLump
(
infos
[
i
]);
init_disk_createLump
(
infos
[
i
]);
}
}
...
@@ -1601,125 +1885,143 @@ function disk_rubbish(){
...
@@ -1601,125 +1885,143 @@ function disk_rubbish(){
//还原文件
//还原文件
function
disk_reductionFolder
(
handler
){
function
disk_reductionFolder
(
handler
){
//右键还原文件时,如果是不能点击时
disk_confirm
(
handler
,
'还原'
,
function
(
list_rows
,
uuids
){
//删除数据库的信息
var
result
=
disk_reductionFolder_sql
(
uuids
);
});
}
//数据库的还原操作
function
disk_reductionFolder_sql
(
uuids
){
var
result
=
storePersonalModule
.
storePersonalActAction
.
resumeStorePersonal
({
FIELD_CODE
:
uuids
});
return
result
;
}
//彻底删除文件
function
disk_thoroughDeleteFolder
(
handler
){
disk_confirm
(
handler
,
'彻底删除'
,
function
(
list_rows
,
uuids
){
//删除数据库的信息
var
result
=
disk_thoroughDeleteFolder_sql
(
uuids
);
});
}
//数据库的彻底删除操作
function
disk_thoroughDeleteFolder_sql
(
uuids
){
var
result
=
storePersonalModule
.
storePersonalActAction
.
deleteTrueStorePersonal
({
FIELD_CODE
:
uuids
});
return
result
;
}
//提示操作的提取
function
disk_confirm
(
handler
,
txt
,
sqlCallback
,
customCallback
){
//右键操作时,如果是不能点击时
if
(
handler
&&
$
(
handler
).
hasClass
(
'disk_menu_noClick'
)){
if
(
handler
&&
$
(
handler
).
hasClass
(
'disk_menu_noClick'
)){
return
;
return
;
}
}
var
list_rows
;
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是列表时
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
var
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
if
(
list_rows
.
length
==
0
){
var
txt3
=
"请选择要还原的文件!!!"
;
var
option3
=
{
title
:
"还原提示"
,
btn
:
parseInt
(
"0001"
,
2
)
}
window
.
wxc
.
xcConfirm
(
txt3
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option3
);
}
}
else
{
else
{
var
txt4
=
"是否要还原选中的文件!!!"
;
list_rows
=
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
);
var
option4
=
{
title
:
"还原提示"
,
onOk
:
function
(){
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
//根据id来删除行
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
id
);
//然后做还原操作
}
}
}
}
if
(
list_rows
.
length
==
0
){
window
.
wxc
.
xcConfirm
(
txt4
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option4
);
var
txt1
=
'请选择要'
+
txt
+
'的文件或文件夹!!!'
;
}
}
else
{
//如果是块状时
var
lump_rows
=
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
);
if
(
lump_rows
.
length
==
0
){
var
txt1
=
"请选择要还原的文件!!!"
;
var
option1
=
{
var
option1
=
{
title
:
"还原提示"
,
title
:
txt
+
'提示'
,
btn
:
parseInt
(
"0001"
,
2
)
btn
:
parseInt
(
"0001"
,
2
)
}
}
window
.
wxc
.
xcConfirm
(
txt1
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option1
);
window
.
wxc
.
xcConfirm
(
txt1
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option1
);
return
;
}
var
txt3
=
'是否要'
+
txt
+
'选中的文件或文件夹!!!'
;
var
option3
=
{
title
:
txt
+
'提示'
,
onOk
:
function
(){
//获得删除的数据列表
var
lump_datas
=
[];
var
uuids
=
''
;
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
var
list_row_obj
;
if
(
$
(
list_rows
[
i
]).
data
(
'lump_data'
)){
list_row_obj
=
$
(
list_rows
[
i
]).
data
(
'lump_data'
);
}
}
else
{
else
{
var
txt2
=
"是否要还原选中的文件!!!"
;
list_row_obj
=
list_rows
[
i
]
;
}
//存在公司文件或者是共享文件则退出
if
(
list_row_obj
.
FILE_TYPE
==
'folder_company'
||
list_row_obj
.
FILE_TYPE
==
'folder_share'
){
var
txt2
=
'存在无法'
+
txt
+
'的文件夹!!!'
;
var
option2
=
{
var
option2
=
{
title
:
"还原提示"
,
title
:
txt
+
'提示'
,
onOk
:
function
(){
btn
:
parseInt
(
"0001"
,
2
)
//先做删除
for
(
var
i
=
0
;
i
<
lump_rows
.
length
;
i
++
){
$
(
lump_rows
[
i
]).
parent
().
remove
();
}
}
//再还原
window
.
wxc
.
xcConfirm
(
txt2
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
error
,
option2
);
return
;
}
}
//存在下级目录或文件,已共享文件,已分享文件时则退出
var
error_txt
=
''
;
if
(
list_row_obj
.
apiIndex
==
'0'
&&
list_row_obj
.
FILENUMBER
>
0
){
error_txt
=
'存在下级文件或目录或回收站里存在下级文件或目录,无法删除!'
;
}
}
window
.
wxc
.
xcConfirm
(
txt2
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option2
);
if
(
list_row_obj
.
apiIndex
==
'0'
&&
list_row_obj
.
GXCOUNT
>
0
){
error_txt
=
'存在已共享文件或目录,无法删除!'
;
}
}
if
(
list_row_obj
.
apiIndex
==
'0'
&&
list_row_obj
.
FXCOUNT
>
0
){
error_txt
=
'存在已分享文件或目录,无法删除!'
;
}
}
}
if
(
error_txt
!=
''
){
var
txt4
=
error_txt
;
//彻底删除文件
var
option4
=
{
function
disk_thoroughDeleteFolder
(
handler
){
title
:
'删除提示'
,
//右键彻底删除文件时,如果是不能点击时
btn
:
parseInt
(
"0001"
,
2
)
if
(
handler
&&
$
(
handler
).
hasClass
(
'disk_menu_noClick'
)){
}
window
.
wxc
.
xcConfirm
(
txt4
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
error
,
option4
);
return
;
return
;
}
}
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是共享文件时,则FILE_UUID是真正的UUID
//如果是列表时
if
(
list_row_obj
.
apiIndex
==
'2'
){
var
list_rows
=
$
(
'#disk_content_list'
).
bootstrapTable
(
'getSelections'
);
uuids
=
uuids
+
list_row_obj
.
FILE_UUID
+
','
;
if
(
list_rows
.
length
==
0
){
var
txt3
=
"请选择要彻底删除的文件!!!"
;
var
option3
=
{
title
:
"彻底删除提示"
,
btn
:
parseInt
(
"0001"
,
2
)
}
window
.
wxc
.
xcConfirm
(
txt3
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option3
);
}
}
else
{
else
{
var
txt4
=
"是否要彻底删除选中的文件!!!"
;
uuids
=
uuids
+
list_row_obj
.
UUID
+
','
;
var
option4
=
{
title
:
"彻底删除提示"
,
onOk
:
function
(){
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
//根据id来删除行
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
id
);
//然后做彻底删除操作
}
}
lump_datas
.
push
(
list_row_obj
);
}
}
uuids
=
uuids
.
substring
(
0
,
uuids
.
length
-
1
);
if
(
typeof
sqlCallback
==
'function'
){
sqlCallback
(
list_rows
,
uuids
);
}
}
window
.
wxc
.
xcConfirm
(
txt4
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option4
);
if
(
typeof
customCallback
==
'function'
){
customCallback
.
call
();
}
}
else
{
//删除页面的
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
if
(
$
(
'.disk_content_toggleBtn'
).
data
(
'toggleList'
)){
//如果是共享文件那就根据file_uuid来删除行
if
(
list_rows
[
i
].
apiIndex
==
'2'
){
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
FILE_UUID
);
}
}
//否则根据uuid来删除行
else
{
else
{
//如果是块状时
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
UUID
);
var
lump_rows
=
$
(
'.disk_content_lump'
).
find
(
'.disk_content_lump_click'
);
if
(
lump_rows
.
length
==
0
){
var
txt1
=
"请选择要彻底删除的文件!!!"
;
var
option1
=
{
title
:
"彻底删除提示"
,
btn
:
parseInt
(
"0001"
,
2
)
}
}
window
.
wxc
.
xcConfirm
(
txt1
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
confirm
,
option1
);
}
}
else
{
else
{
var
txt2
=
"是否要彻底删除选中的文件!!!"
;
$
(
list_rows
[
i
]).
parent
().
remove
();
var
option2
=
{
title
:
"彻底删除提示"
,
onOk
:
function
(){
//先做删除
for
(
var
i
=
0
;
i
<
lump_rows
.
length
;
i
++
){
console
.
log
(
$
(
lump_rows
[
i
]).
data
(
'lump_data'
))
$
(
lump_rows
[
i
]).
parent
().
remove
();
}
}
//再彻底删除
}
}
}
}
window
.
wxc
.
xcConfirm
(
txt2
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option2
);
}
}
}
}
window
.
wxc
.
xcConfirm
(
txt3
,
window
.
wxc
.
xcConfirm
.
typeEnum
.
warning
,
option3
);
}
}
//文件的共享
//文件的共享
...
@@ -1948,14 +2250,13 @@ function disk_enjoyFolder(handler){
...
@@ -1948,14 +2250,13 @@ function disk_enjoyFolder(handler){
}
}
}
}
console
.
log
(
rows_data
)
var
strVar
=
""
;
var
strVar
=
""
;
strVar
+=
"<div style=
\"
width:268px;padding:0px;border-radius:5px;overflow:hidden;
\"
>
\
n"
;
strVar
+=
"<div style=
\"
width:268px;padding:0px;border-radius:5px;overflow:hidden;
\"
>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_title
\"
><span>选择要共享的人<
\
/span><span onclick=
\"
$.fancybox.close()
\"
class=
\"
glyphicon glyphicon-remove
\"
><
\
/span><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_title
\"
><span>选择要共享的人<
\
/span><span onclick=
\"
$.fancybox.close()
\"
class=
\"
glyphicon glyphicon-remove
\"
><
\
/span><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_search
\"
><input placeholder=
\"
搜索人员
\"
type=
\"
text
\"
><span onclick=
\"
alert('搜索')
\"
>搜索</span><
\
/div>
\
n"
;
strVar
+=
" <div id=
\"
disk_enjoyUser_tree
\"
style=
\"
height:220px;overflow:auto;
\"
class=
\"
ztree disk_move_tree
\"
><
\
/div>
\
n"
;
strVar
+=
" <div id=
\"
disk_enjoyUser_tree
\"
style=
\"
height:220px;overflow:auto;
\"
class=
\"
ztree disk_move_tree
\"
><
\
/div>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_btn
\"
>
\
n"
;
strVar
+=
" <div class=
\"
disk_move_btn
\"
>
\
n"
;
strVar
+=
" <span
onclick=
\"
disk_enjoyUser_save()
\"
>确定<
\
/span><span onclick=
\"
$.fancybox.close()
\"
>取消<
\
/span>
\
n"
;
strVar
+=
" <span>确定<
\
/span><span onclick=
\"
$.fancybox.close()
\"
>取消<
\
/span>
\
n"
;
strVar
+=
" <
\
/div>
\
n"
;
strVar
+=
" <
\
/div>
\
n"
;
strVar
+=
"<
\
/div>
\
n"
;
strVar
+=
"<
\
/div>
\
n"
;
...
@@ -1973,6 +2274,10 @@ function disk_enjoyFolder(handler){
...
@@ -1973,6 +2274,10 @@ function disk_enjoyFolder(handler){
}
}
});
});
$
(
'.disk_move_btn>span'
).
eq
(
0
).
bind
(
'click'
,
function
(){
disk_enjoyUser_save
(
rows_data
);
})
//初始化文件目录
//初始化文件目录
init_disk_enjoyUser_tree
(
rows_data
);
init_disk_enjoyUser_tree
(
rows_data
);
}
}
...
@@ -2023,8 +2328,8 @@ function disk_cancelShareCode(handler){
...
@@ -2023,8 +2328,8 @@ function disk_cancelShareCode(handler){
title
:
"取消分享提示"
,
title
:
"取消分享提示"
,
onOk
:
function
(){
onOk
:
function
(){
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
list_rows
.
length
;
i
++
){
//根据id来删除行
//根据
uu
id来删除行
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
id
);
$
(
'#disk_content_list'
).
bootstrapTable
(
'removeByUniqueId'
,
list_rows
[
i
].
UUID
);
//然后做取消分享操作
//然后做取消分享操作
}
}
}
}
...
@@ -2120,3 +2425,4 @@ function init_disk_shareCode_list(infos){
...
@@ -2120,3 +2425,4 @@ function init_disk_shareCode_list(infos){
}
}
})
})
}
}
WebContent/jfcas04/js/disk.js.bak
0 → 100644
View file @
6be3d484
$(function() {
//去掉尾部的一个div
$('.index_footer').next().remove();
//初始化容器的最小高度
init_index_contaner_minHeight();
//初始化块状显示
init_disk_lump();
//初始化块状的单击效果
//init_disk_lump_click();
//初始化块状的双击效果
//init_disk_lump_dbClick();
//初始化块状的文件名的单击效果
//init_disk_click_div_edit();
//初始化块状的文本框失去焦点的效果
//init_disk_input_blur();
//初始化块状的鼠标移动效果
//init_disk_lump_hover();
//绑定键盘shift和ctrl键来多选
init_disk_window_multiple();
//绑定鼠标的按下来多选
//init_disk_window_mouseDownMultiple();
//去掉拖动图片时默认的提示
//init_disk_window_imgDefault();
//点击容器外时取消选中状态
$(document).click(function(e){
//console.log($(e.target));
//去掉右键的菜单
$('#disk_menu').hide();
$('#disk_rubbish_menu').hide();
$('#disk_shareCode_menu').hide();
//如果不需要取消选中的文件时,或者是fancybox的内容,或者是点击了菜单上面的按钮,或者是提示框时
if($(e.target).parents('.xcConfirm').length==1||$(e.target).parents('.disk_rubbsh_menu').length==1||$(e.target).parents('.disk_menu').length==1||$(e.target).parents('.fancybox-overlay').length==1||$(e.target).hasClass('disk_document_default')||$(e.target).parent().hasClass('disk_document_default')){
return;
}
//去掉选中状态
$('.disk_content_lump').find('.disk_content_lump_click').removeClass('disk_content_lump_click');
});
//容器的右键效果
init_disk_contextmenu();
})
//去掉拖动图片时默认的提示
function init_disk_window_imgDefault(){
//IE下需要在document的mousemove里面取消默认事件;要用原生JS的事件不能用JQuery
document.onmousemove = function(e){
var ev = e || event;
ev.cancelBubble=true;
ev.returnValue = false;
}
$("img").mousedown(function(event){
//FF下需要在mousedown取消默认操作;
event.preventDefault();
event.stopPropagation();
$(this).bind("mousemove",function(event){});
})
}
//绑定鼠标的按下来多选
function init_disk_window_mouseDownMultiple(){
$(window).mousedown(function(e){
$('.disk_content_lump').data('mouseDownSelect',true);
}).mouseup(function(){
$('.disk_content_lump').data('mouseDownSelect',false);
});
}
//绑定键盘shift和ctrl键来多选
function init_disk_window_multiple(){
$(window).keydown(function(e){
if(e.ctrlKey||e.shiftKey){
$('.disk_content_lump').data('ctrlSelect',true);
}
}).keyup(function(){
$('.disk_content_lump').data('ctrlSelect',false);
});
}
//初始化容器的最小高度
function init_index_contaner_minHeight() {
var conrainer_height = $.jfbrother.getViewSizeWithScrollbar().height - $('.indedx_header').outerHeight(true) - $('.indedx_header_logo').outerHeight(true) - $('.index_center').outerHeight(true) - $('.index_insert_module').outerHeight(true) - $('.index_footer').outerHeight(true)- $('.disk_search').outerHeight(true) - $('.disk_content_header').outerHeight(true);
//如果原始的高度比屏幕小时再添加最小高度(块状容器)
if ($('.disk_content_lump').outerHeight() < conrainer_height) {
$('.disk_content_lump').css('minHeight', conrainer_height);
}
}
//初始化块状显示
function init_disk_lump(){
var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'},
]
//渲染块状
for(var i = 0 ; i<infos.length;i++){
init_disk_createLump(infos[i]);
}
}
//绑定块状的单击效果
function init_disk_lump_click(){
$('.disk_content_lump>div>div').each(function(index,element){
$(element).bind('click',function(){
disk_lump_click(this);
})
})
}
//初始化块状的双击效果
function init_disk_lump_dbClick(){
$('.disk_content_lump>div>div').each(function(index,element){
$(element).bind('dblclick',function(){
disk_lump_dbClick(this);
})
})
}
//初始化块状的文件名的单击效果
function init_disk_click_div_edit(){
$('.disk_content_lump>div>div>div').each(function(index,element){
$(element).bind('click',function(){
disk_click_div_edit(this);
})
})
}
//初始化块状的文本框失去焦点的效果
function init_disk_input_blur(){
$('.disk_content_lump>div>div>input').each(function(index,element){
$(element).bind('blur',function(){
disk_input_blur(this);
})
})
}
//初始化块状的文件名的单击效果
function init_disk_lump_fileName_click(){
$('.disk_content_lump>div>div>div').each(function(index,element){
$(element).bind('click',function(){
disk_click_div_edit(this);
})
})
}
//初始化块状的鼠标移动效果
function init_disk_lump_hover(){
$('.disk_content_lump>div>div').hover(function(){
//如果是可以多选时
if($(this).parents('.disk_content_lump').data('mouseDownSelect')){
//然后给自己加个样式
$(this).addClass('disk_content_lump_click');
}
},function(){})
}
//根据一个json数据来初始化块状列表
function init_disk_createLump(lump_json){
var $disk_content_lump = $('.disk_content_lump');
var $create_container = $('<div></div>').addClass('col-md-2');
$disk_content_lump.append($create_container);
var $create_content = $('<div></div>');
//把数据存放起来
$create_content.data('lump_data',lump_json);
$create_content.bind('click',function(){
disk_lump_click(this);
})
$create_container.append($create_content);
init_disk_select_fileImg(lump_json);
var $create_img = $('<img src="'+ctx+'/custom/images/'+lump_json.fileImg+'" />');
var $create_div = $('<div></div>').text(lump_json.fileName);
if($('#disk_rubbish').data('rubbish')){
//如果是回收站时,则鼠标移动到文件名时去掉原来的效果
$create_div.hover(function(){
$(this).addClass('disk_rubbish_fileName');
},function(){
$(this).removeClass('disk_rubbish_fileName');
});
}
else{
//如果不是显示回收站的时候
$create_div.bind('click',function(){
disk_click_div_edit(this);
})
$create_content.bind('dblclick',function(){
disk_lump_dbClick(this);
})
}
var $create_input = $('<input type="text" class="form-control"/>').val(lump_json.fileName);
//输入框失去焦点时
$create_input.bind('blur',function(){
disk_input_blur(this);
})
$create_input.css('display','none');
$create_content.append($create_img).append($create_div).append($create_input);
}
//新建文件夹
function disk_addFolder(handler){
//右键新建文件时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
//如果为列表时
if($('.disk_content_toggleBtn').data('toggleList')){
//列表的添加文件
disk_addFolder_list();
}
//如果是块状的时候
else{
//缩略图的添加文件
disk_addFolder_lump();
}
}
//列表的添加文件
function disk_addFolder_list(){
var rowId = $.jfbrother.uuid();
var date = $.jfbrother.dateToStr();
var list_data = {id:rowId,fileName:'新建文件夹',fileImg:'disk_module5.png',lastTime:date,fileType:'文件夹',fileSize:'-'};
//跳到第一页
//$('#disk_content_list').bootstrapTable('selectPage', 1); //Jump to the first page
//添加一行数据
$('#disk_content_list').bootstrapTable('insertRow',{
index:0,
row:list_data
});
//取消之前的选中
$('#disk_content_list').bootstrapTable('uncheckAll');
//根据id来选中新增的那一行
$('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==rowId){
$('#disk_content_list').bootstrapTable('check',$(element).data('index'));
var $div = $(element).find('.disk_content_list_fileName>div').eq(1).find('div');
$div.hide();
$div.next().show();
//输入框获得焦点
$div.next().focus();
//输入框的内容全选
$div.next().select();
return false;
}
})
}
//缩略图的添加文件
function disk_addFolder_lump(){
var rowId = $.jfbrother.uuid();
var date = $.jfbrother.dateToStr();
var jum_data = {id:rowId,fileName:'新建文件夹',fileImg:'disk_module5.png',lastTime:date,fileType:'文件夹',fileSize:'-'};
var $disk_content_lump = $('.disk_content_lump');
var $create_container = $('<div></div>').addClass('col-md-2');
$disk_content_lump.append($create_container);
var $create_content = $('<div></div>').addClass('disk_content_lump_click');
//把数据存放起来
$create_content.data('lump_data',jum_data);
$create_content.bind('click',function(){
disk_lump_click(this);
})
$create_content.bind('dblclick',function(){
disk_lump_dbClick(this);
})
$create_container.append($create_content);
var $create_img = $('<img src="'+ctx+'/custom/images/'+jum_data.fileImg+'" />');
var $create_div = $('<div></div>').text(jum_data.fileName);
$create_div.bind('click',function(){
disk_click_div_edit(this);
})
$create_div.hide();
var $create_input = $('<input type="text" class="form-control"/>').val(jum_data.fileName);
//输入框失去焦点时
$create_input.bind('blur',function(){
disk_input_blur(this);
})
$create_content.append($create_img).append($create_div).append($create_input);
//输入框获得焦点
$create_input.focus();
//输入框的内容全选
$create_input.select();
}
//点击文件名时的编辑效果
function disk_click_div_edit(handler){
if($(handler).parent().hasClass('disk_content_lump_click')){
$(handler).hide();
$(handler).next().show();
//输入框获得焦点
$(handler).next().focus();
//输入框的内容全选
$(handler).next().select();
}
}
//文本框失去焦点时
function disk_input_blur(handler){
//隐藏输入框,显示div容器
$(handler).hide();
var input_val = $(handler).val();
//如果值为空时,则默认为新建文件夹
if(input_val==''){
input_val = '新建文件夹';
}
//如果文件夹存在时,就自动加个(序号),遍历之前的容器
disk_find_folder($(handler),input_val);
var count = $(handler).data('count');
count==0?input_val=input_val:input_val=input_val+'('+ count +')';
$(handler).prev().show().text(input_val);
//如果是列表需要做一次更新
if($('.disk_content_toggleBtn').data('toggleList')){
$('#disk_content_list').bootstrapTable('updateRow',{
index:$(handler).parents('tr').data('index'),
row:{fileName:input_val}
});
}
}
//递归查找文件夹是否存在
function disk_find_folder(handler,input_val,count){
var $handler = $(handler);
var val = input_val;
var count_value = count;
if(!count_value){
count_value = 0;
}
var flag = true;//表示不存在
//遍历除了自身的文件
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
$('#disk_content_list tbody>tr .disk_content_list_fileName input').not($(handler)).each(function(index,element){
count_value==0?result_val=val:result_val = val + '('+ count_value +')';
if($(element).prev().text()==result_val){
flag = false;
return false;
}
})
}
else{
//如果是块状时
$(handler).parents('.disk_content_lump').children().not($(handler).parents('.col-md-2')).each(function(index,element){
count_value==0?result_val=val:result_val = val + '('+ count_value +')';
if($(element).find('img+div').text()==result_val){
flag = false;
return false;
}
})
}
if(!flag){
count_value+=1;
disk_find_folder($handler,val,count_value);
}
else{
$handler.data('count',count_value);
}
}
//单击块状
function disk_lump_click(handler){
//去掉右键的菜单
$('#disk_menu').hide();
$.jfbrother.stopPropagation();
//如果是不可以多选时
if(!$(handler).parents('.disk_content_lump').data('ctrlSelect')){
//先去掉之前选中的
$(handler).parents('.disk_content_lump').find('.disk_content_lump_click').removeClass('disk_content_lump_click');
}
//然后给自己加个样式
$(handler).addClass('disk_content_lump_click');
}
//双击块状
function disk_lump_dbClick(handler){
//正处在编辑时不能双击
if($(handler).find('input').css('display')!='none'){
return;
}
//添加目录的导航效果
var $search_center = $('.disk_search_center');
var $create_a = $('<a onclick="disk_backFolder(this)"></a>');
var $create_span1 = $('<span></span>').text($(handler).find('div').text());
var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right');
$create_a.append($create_span1).append($create_span2);
$search_center.append($create_a);
//重新渲染块状
//先清空容器
$('.disk_content_lump').html('');
var infos = [
{id:'uuid20',fileName:'我的文件1',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder',fileSize:'200KB'},
{id:'uuid21',fileName:'我的文件2',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder',fileSize:'100KB'},
]
for(var i = 0 ;i<infos.length;i++){
init_disk_createLump(infos[i]);
}
}
//容器的右键效果
function init_disk_contextmenu(){
$('.disk_content_lump,.disk_content_list').bind('contextmenu',function(e){
var $disk_menu;
if($('#disk_rubbish').data('rubbish')){
$disk_menu = $('#disk_rubbish_menu');
}
else if($('#disk_shareCode').data('shareCode')){
$disk_menu = $('#disk_shareCode_menu');
}
else{
$disk_menu = $('#disk_menu');
}
//console.log($(e.target));
//如果是正在编辑的时候就不做操作
if($(e.target).is('input')){
return false;
}
//如果是列表模式时,或者是分享码的列表时
if($('.disk_content_toggleBtn').data('toggleList')||$('#disk_shareCode').data('shareCode')){
//点击空白的地方
if($(e.target).hasClass('fixed-table-body')){
//去掉之前选中的列
//$('#disk_content_list').bootstrapTable('uncheckAll');
$disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
}
//点击文件夹
else if($(e.target).parents('tbody').length==1){
//去掉之前选中的列
$('#disk_content_list').bootstrapTable('uncheckAll');
//选中当前的列
$('#disk_content_list').bootstrapTable('check',$(e.target).parents('tr').data('index'));
$disk_menu.find('.disk_menu_noClickBtn').addClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').removeClass('disk_menu_noClick');
}
//点击了分页和table的头部
else if($(e.target).parents('thead').length==1||$(e.target).hasClass('fixed-table-pagination')||$(e.target).parents('.fixed-table-pagination').length==1){
return false;
}
}
//如果是缩略图的模式时
else{
//右键时,切换是否可以点击的按钮
if($(e.target).hasClass('disk_content_lump')){
$disk_menu.find('.disk_menu_noClickBtn').removeClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').addClass('disk_menu_noClick');
}
else{
//先去掉之前选中的
$(e.target).parents('.disk_content_lump').find('.disk_content_lump_click').removeClass('disk_content_lump_click');
//然后给自己加个样式
$(e.target).parents('.col-md-2').children('div').addClass('disk_content_lump_click');
$disk_menu.find('.disk_menu_noClickBtn').addClass('disk_menu_noClick');
$disk_menu.find('.disk_menu_clickBtn').removeClass('disk_menu_noClick');
}
}
//显示菜单
$disk_menu.show();
var e = e || event;
var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
var scrollWidth = $.jfbrother.getScrollbarWidth();
//屏幕的高度与高度
var client_width = $.jfbrother.getViewSizeWithScrollbar().width;
var client_height = $.jfbrother.getViewSizeWithScrollbar().height;
//鼠标的位置
var mouse_left = e.clientX;
var mouse_top= e.clientY;
//菜单的宽高
var menu_width= $disk_menu.outerWidth(true);
var menu_height= $disk_menu.outerHeight(true);
//如果右边的超出了
if(client_width-mouse_left-scrollWidth<menu_width){
mouse_left = client_width - menu_width - scrollWidth;
}
//如果高度超出时
if(client_height-mouse_top<menu_height){
mouse_top = client_height - menu_height + scrollTop;
}
else{
mouse_top = mouse_top + scrollTop;
}
//当滑动滚动条时也能准确获取菜单位置
$disk_menu.css({'top':mouse_top+"px",'left':mouse_left+"px"});
//阻止默认事件
return false;
})
}
//删除文件夹
function disk_deleteFolder(handler){
//右键删除时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
//如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要删除的文件!!!";
var option3 = {
title: "提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要删除选中的文件!!!";
var option4 = {
title: "删除提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
else{
//如果是块状时
var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(lump_rows.length==0){
var txt1 = "请选择要删除的文件!!!";
var option1 = {
title: "提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
}
else{
var txt2 = "是否要删除选中的文件!!!";
var option2 = {
title: "删除提示",
onOk: function(){
for(var i = 0 ; i < lump_rows.length ; i ++){
$(lump_rows[i]).parent().remove();
}
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
}
//缩略图与列表的切换
function disk_content_toggle(handler){
//绑定一个data来区别切换的状态toggleList==true为切换到了list
if(!$(handler).data('toggleList')){
//列表形式
$(handler).data('toggleList',true);
$(handler).attr('title','切换到缩略图模式');
$(handler).removeClass('glyphicon-th-large').addClass('glyphicon-th-list');
if($('#disk_rubbish').data('rubbish')){
//重新渲染列表
var infos = [
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
init_disk_rubbish_list(infos);
}
else{
//重新渲染列表
var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
init_disk_list(infos);
}
}
else{
//缩略图形式
$(handler).data('toggleList',false);
$(handler).attr('title','切换到列表模式');
$(handler).removeClass('glyphicon-th-list').addClass('glyphicon-th-large');
//重新渲染块状
if($('#disk_rubbish').data('rubbish')){
var infos = [
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
}
else{
var infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
}
//先清空容器
$('.disk_content_lump').html('');
//渲染块状
for(var i = 0 ; i<infos.length;i++){
init_disk_createLump(infos[i]);
}
}
$('.disk_content_lump,.disk_content_list').toggle();
}
//初始化文件的列表
function init_disk_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
//clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ></div><div class="col-md-10"><div>'+ value +'</div><input type="text" value='+ value +' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}, {
field: 'lastTime',
title: '修改时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_menu').hide();
},
//当用户点击某一列的时候触发
onClickCell:function(field, value, row, $element){
if(field=='fileName'){
//编辑,把td传入
disk_editFolder_list($element);
}
},
//当用户双击某一行的时候触发
onDblClickRow:function(row, $element){
//根据id重新渲染列表
disk_list_dbClick(row,$element);
},
//当用户单击某一行的时候触发
onClickRow:function(row, $element){
//选中这行
//在根据id来获得对象
$('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==row.id){
var index = $(element).data('index');
//如果正处于编辑状态那就选中,否则就反着选
if($(element).find('.disk_content_list_fileName input').css('display')!='none'||!$(element).find('input[type="checkbox"]').prop('checked')){
$('#disk_content_list').bootstrapTable('check',index);
}
else{
$('#disk_content_list').bootstrapTable('uncheck',index);
}
}
})
}
//
})
}
//初始化回收站的列表
function init_disk_rubbish_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ></div><div class="col-md-10"><div style="color:#666;cursor:text;">'+ value +'</div><input type="text" value='+ value +' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}, {
field: 'lastTime',
title: '删除时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_rubbish_menu').hide();
}
})
}
//修改文件名
function disk_editFolder(handler){
//右键删除时,如果是不能点击时
if($(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
//在根据id来获得对象
$('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==list_rows[0].id){
disk_editFolder_list($(element).find('.disk_content_list_fileName').parent());
return false;
}
})
}
else{
//如果是块状时
var $lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
disk_click_div_edit($lump_rows.find('div'));
}
}
//列表的编辑
function disk_editFolder_list(handler){
var $input = $(handler).find('input');
$input.prev().hide();
$input.show();
$input.focus();
$input.select();
}
//双击列表时
function disk_list_dbClick(row,handler){
//正处在编辑时不能双击
if($(handler).find('.disk_content_list_fileName input').css('display')!='none'){
return;
}
//添加目录的导航效果
var $search_center = $('.disk_search_center');
var $create_a = $('<a onclick="disk_backFolder(this)"></a>');
var $create_span1 = $('<span></span>').text($(handler).find('.disk_content_list_fileName input').val());
var $create_span2 = $('<span></span>').addClass('glyphicon glyphicon-triangle-right');
$create_a.append($create_span1).append($create_span2);
$search_center.append($create_a);
//重新渲染列表,模拟几条数据
var infos = [
{id:'uuid8',fileName:'我的文件1',fileImg:'disk_module5.png',lastTime:'2018-06-19 14:20',fileType:'folder',fileSize:'200KB'},
{id:'uuid9',fileName:'我的文件2',fileImg:'disk_module5.png',lastTime:'2018-06-18 15:50',fileType:'folder',fileSize:'100KB'},
{id:'uuid10',fileName:'我的文件3',fileImg:'disk_module5.png',lastTime:'2018-06-15 12:50',fileType:'folder',fileSize:'50KB'}
]
init_disk_list(infos);
}
//进入文件夹
function disk_enterFolder(handler){
//右键进入文件夹时,如果是不能点击时
if($(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
//在根据id来获得对象
$('#disk_content_list tr').each(function(index,element){
if($(element).data('uniqueid')==list_rows[0].id){
disk_list_dbClick(list_rows[0],$(element));
return false;
}
})
}
else{
//如果是块状时
var $lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
disk_lump_dbClick($lump_rows);
}
}
//返回到最开始的展示情况
function disk_backFolder(handler){
//如果已经是最后一个了
if($(handler).next().length==0){
return;
}
//清除之后的a
$(handler).nextAll('a').remove();
//重新渲染数据
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
//重新渲染列表
var list_infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'}
]
init_disk_list(list_infos);
}
else{
//如果是块状时
//根据一个json数据去渲染块状
var lump_infos = [
{id:'uuid1',fileName:'公司文件',fileImg:'disk_module1.png',lastTime:'2018-06-19 14:20',fileType:'folder_company',fileSize:'200KB'},
{id:'uuid2',fileName:'共享文件',fileImg:'disk_module2.png',lastTime:'2018-06-18 15:50',fileType:'folder_share',fileSize:'100KB'},
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'},
]
//渲染块状
//先清空容器
$('.disk_content_lump').html('');
for(var i = 0 ; i<lump_infos.length;i++){
init_disk_createLump(lump_infos[i]);
}
}
}
//移动文件
function disk_moveFolder(handler){
//右键移动文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var rows;
//如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(rows.length==0){
var txt = "请选择要移动的文件!!!";
var option = {
title: "提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
return;
}
//获得选中的数据
var rows_data = [];
for(var i=0;i<rows.length;i++ ){
if($(rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(rows[i]);
}
}
console.log(rows_data)
var strVar = "";
strVar += "<div style=\"width:268px;padding:0px;border-radius:5px;overflow:hidden;\">\n";
strVar += " <div class=\"disk_move_title\"><span>移动文件<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div id=\"disk_move_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/div>\n";
strVar += " <div class=\"disk_move_btn\">\n";
strVar += " <span onclick=\"disk_moveFolder_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
/*$('.fancybox-opened').css('width','268px');*/
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//初始化文件目录
init_disk_move_tree(rows_data);
}
//文件移动的保存
function disk_moveFolder_save(){
var treeObj = $.fn.zTree.getZTreeObj("disk_move_tree");
var nodes = treeObj.getSelectedNodes();
console.log(nodes)
$.fancybox.close();
//重新渲染显示的内容
}
//选择共享人之后的保存
function disk_enjoyUser_save(){
var treeObj = $.fn.zTree.getZTreeObj("disk_enjoyUser_tree");
var nodes = treeObj.getSelectedNodes();
console.log(nodes)
$.fancybox.close();
//重新渲染显示的内容
}
//初始化文件时移动的目录
function init_disk_move_tree(rows_data){
var ztreeData = [
{pid:'0',id:'A',name:"公司文件",fileType:'folder_company'},
{pid:'A',id:'A1',name:'我的文件夹1',fileType:'folder'},
{pid:'A',id:'A2',name:'我的文件夹2',fileType:'folder'},
{pid:'A',id:'A3',name:'我的文件夹3',fileType:'folder'},
{pid:'A',id:'A4',name:'我的文件夹4',fileType:'folder'},
{pid:'A4',id:'A5',name:'我的文件夹5',fileType:'folder'},
{pid:'A5',id:'A6',name:'我的文件夹5',fileType:'folder'},
{pid:'A6',id:'A7',name:'我的文件夹5',fileType:'folder'},
{pid:'0',id:'B',name:'共享文件',fileType:'folder_share'},
{pid:'B',id:'B4',name:'我的文件夹5',fileType:'folder'},
{pid:'B',id:'B4',name:'我的文件夹6',fileType:'folder'}
];
for(var i =0;i<ztreeData.length;i++){
init_disk_select_fileImg(ztreeData[i]);
}
//还要做一步过滤
//1.把自身及以下文件过滤掉
//2.所有节点不是文件夹的过滤掉
var zTreeObj;
// zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
var setting = {
callback : {
onClick : function(event, treeId, treeNode) {
//$('#' + treeNode.tId).find('.curSelectedNode').removeClass('curSelectedNode');
}
},
data : {
simpleData : {
enable : true,
idKey : "id",
pIdKey : "pid",
rootPId : 0
}
},
view : {
nameIsHTML : true,
showTitle : true,
//双击节点时,是否自动展开父节点的标识,true / false 分别表示双击节点 切换 / 不切换 展开状态
dblClickExpand : true,
//点击节点时,按下 Ctrl 或 Cmd 键是否允许取消选择操作。
autoCancelSelected : false,
//是否显示连线
showLine: false
}
};
// zTree 的数据属性,深入使用请参考 API 文档(zTreeNode 节点数据详解)
zTreeObj = $.fn.zTree.init($("#disk_move_tree"), setting, ztreeData);
//展开根节点
/*function filter(node) {
return (node.pid == 0);
}
var filter_nodes = zTreeObj.getNodesByFilter(filter); // 查找根节点集合
for (var i = 0; i < filter_nodes.length; i++) {
zTreeObj.expandNode(filter_nodes[i], true, true, true);
}*/
}
//初始化共享人的树
function init_disk_enjoyUser_tree(rows_data){
var ztreeData = [
{pid:'0',id:'A',name:'技术部',icon:'custom/images/disk_enjoy_users.png'},
{pid:'A',id:'A1',name:'联系人1',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A2',name:'联系人2',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A3',name:'联系人3',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A4',name:'联系人4',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A5',name:'联系人5',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A6',name:'联系人6',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A7',name:'联系人7',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A8',name:'联系人8',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A9',name:'联系人9',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A10',name:'联系人10',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A11',name:'联系人11',icon:'custom/images/disk_enjoy_user.png'},
{pid:'A',id:'A12',name:'联系人12',icon:'custom/images/disk_enjoy_user.png'}
];
/*for(var i =0;i<ztreeData.length;i++){
init_disk_select_fileImg(ztreeData[i]);
}*/
//还要做一步过滤
//1.把自身及以下文件过滤掉
//2.所有节点不是文件夹的过滤掉
var zTreeObj;
// zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
var setting = {
callback : {
onClick : function(event, treeId, treeNode) {
//$('#' + treeNode.tId).find('.curSelectedNode').removeClass('curSelectedNode');
//如果是父节点时,则取消选中状态,但是要添加一个选中样式
if (treeNode.isParent) {
zTreeObj.cancelSelectedNode(treeNode);
$(event.target).addClass('curSelectedNode');
}
}
},
data : {
simpleData : {
enable : true,
idKey : "id",
pIdKey : "pid",
rootPId : 0
}
},
view : {
nameIsHTML : true,
showTitle : true,
//双击节点时,是否自动展开父节点的标识,true / false 分别表示双击节点 切换 / 不切换 展开状态
dblClickExpand : true,
//点击节点时,按下 Ctrl 或 Cmd 键是否允许取消选择操作。
autoCancelSelected : true,
//是否显示连线
showLine: false
}
};
// zTree 的数据属性,深入使用请参考 API 文档(zTreeNode 节点数据详解)
zTreeObj = $.fn.zTree.init($("#disk_enjoyUser_tree"), setting, ztreeData);
//展开根节点
/*function filter(node) {
return (node.pid == 0);
}
var filter_nodes = zTreeObj.getNodesByFilter(filter); // 查找根节点集合
for (var i = 0; i < filter_nodes.length; i++) {
zTreeObj.expandNode(filter_nodes[i], true, true, true);
}*/
}
//初始化文件的图片
function init_disk_select_fileImg(ztreeData){
if(',jpg,png,jpeg,gif,'.indexOf(','+ ztreeData.fileType +',')==-1){
//非图片类型需要判断显示的图片
//iconOpen:文件夹树形结构打开图片
//iconClose:文件夹树形结构关闭图片
//icon:文件夹树形结构叶子图片
//fileImg:桌面显示图片
switch (ztreeData.fileType) {
case 'folder_company':
ztreeData.iconOpen='custom/images/disk_module1.png';
ztreeData.iconClose='custom/images/disk_module1_close.png';
ztreeData.icon='custom/images/disk_module1_close.png';
ztreeData.fileImg='disk_module1_close.png';
break;
case 'folder_share':
ztreeData.iconOpen='custom/images/disk_module2.png';
ztreeData.iconClose='custom/images/disk_module2_close.png';
ztreeData.icon='custom/images/disk_module2_close.png';
ztreeData.fileImg='disk_module2_close.png';
break;
/*case 'folder_myFile':
ztreeData.iconOpen='custom/images/disk_module3.png';
ztreeData.iconClose='custom/images/disk_module3_close.png';
ztreeData.icon='custom/images/disk_module3_close.png';
ztreeData.fileImg='disk_module3_close.png';
break;
case 'folder_myShare':
ztreeData.iconOpen='custom/images/disk_module4.png';
ztreeData.iconClose='custom/images/disk_module4_close.png';
ztreeData.icon='custom/images/disk_module4_close.png';
ztreeData.fileImg='disk_module4_close.png';
break;*/
case 'folder':
ztreeData.iconOpen='custom/images/disk_module5.png';
ztreeData.iconClose='custom/images/disk_module5_close.png';
ztreeData.icon='custom/images/disk_module5_close.png';
ztreeData.fileImg='disk_module5_close.png';
break;
case 'rar':
ztreeData.fileImg='disk_rar.png';
break;
case 'txt':
ztreeData.fileImg='disk_unknow.png';
break;
case 'ppt':
ztreeData.fileImg='disk_ppt.png';
break;
case 'pdf':
ztreeData.fileImg=='disk_pdf.png';
break;
case 'excel':
ztreeData.fileImg='disk_excel.png';
break;
case 'word':
ztreeData.fileImg='disk_word.png';
break;
default:
ztreeData.fileImg='disk_unknow.png';
break;
}
}
}
//文件的下载
function disk_downFolder(handler){
//右键下载文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var list_rows;
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
var list_rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(list_rows.length==0){
var txt = "请选择要下载的文件!!!";
var option = {
title: "下载提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
}
else{
var txt2 = "是否要下载选中的文件!!!";
var option2 = {
title: "下载提示",
onOk: function(){
/*//获得选中的数据
var rows_data = [];
for(var i=0;i<list_rows.length;i++ ){
if($(list_rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(list_rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(list_rows[i]);
}
}*/
//下载文件
$('<a href="https://codeload.github.com/douban/douban-client/legacy.zip/master" download="proposed_file_name">Download</a>')[0].click();
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
//上传文件的显示
function disk_uploadFolder(handler){
//右键上传文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var strVar = "";
strVar += "<div class=\"row\" style=\"margin:0px;width:800px;padding: 0px;border-radius: 5px;overflow: hidden;\">\n";
strVar += " <div class=\"disk_move_title\"><span>选择文件上传<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_upload_content col-md-12\">\n";
strVar += " <div class=\"col-md-6 disk_upload_left_content\">\n";
strVar += " <div class=\"disk_upload_left_content_container\" id=\"disk_upload_drop\" >\n";
strVar += " <img src=\"custom/images/disk_uploadBg.png\" width=\"70\" height=\"60\" />\n";
strVar += " <div><span onclick=\"$(this).next().click()\">选择文件上传<\/span><input onchange=\"disk_upload_file()\" type=\"file\" style=\"display:none;\" multiple=\"multiple\" /><\/div>\n";
strVar += " <div>或者将文件拖拽到此处<\/div>\n";
strVar += " <div>可一次选择多个文件<\/div>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-6\">\n";
strVar += " <div class=\"col-md-12 disk_upload_right_header\">\n";
strVar += " <div class=\"col-md-7\">文件名<\/div>\n";
strVar += " <div class=\"col-md-5\">文件大小<\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_upload_right_content\">\n";
/*strVar += " <div class=\"col-md-12\">\n";
strVar += " <div class=\"col-md-7\"><span>1.<\/span><span title=\"ASP操作手册ASP操作手册ASP操作手册.doc\">ASP操作手册ASP操作手册ASP操作手册.doc<\/span><\/div>\n";
strVar += " <div class=\"col-md-5\">\n";
strVar += " <span>12KB<\/span>\n";
strVar += " <div class=\"progress disk_progress\" style=\"display:none;\">\n";
strVar += " <div style='width:50%' class=\"progress-bar progress-bar-striped active\" role=\"progressbar\" >\n";
strVar += " <!-- 50% -->\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <span class=\"glyphicon glyphicon-ok\" style=\"display:inline-block;\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-pause\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-remove\"><\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12\">\n";
strVar += " <div class=\"col-md-7\"><span>10.<\/span><span title=\"ASP操作手册.doc\">ASP操作手册.doc<\/span><\/div>\n";
strVar += " <div class=\"col-md-5\">\n";
strVar += " <span>1024KB<\/span>\n";
strVar += " <div class=\"progress disk_progress\">\n";
strVar += " <div style='width:90%' class=\"progress-bar progress-bar-striped active\" role=\"progressbar\" >\n";
strVar += " <!-- 50% -->\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <span class=\"glyphicon glyphicon-ok\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-pause\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-remove\"><\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12\">\n";
strVar += " <div class=\"col-md-7\"><span>110.<\/span><span title=\"ASP操作手册.doc\">ASP操作手册.doc<\/span><\/div>\n";
strVar += " <div class=\"col-md-5\">\n";
strVar += " <span>12KB<\/span>\n";
strVar += " <div class=\"progress disk_progress\">\n";
strVar += " <div style='width:20%' class=\"progress-bar progress-bar-striped active\" role=\"progressbar\" >\n";
strVar += " <!-- 50% -->\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <span class=\"glyphicon glyphicon-ok\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-pause\"><\/span>\n";
strVar += " <span class=\"glyphicon glyphicon-remove\"><\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";*/
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_upload_right_bottom\">\n";
strVar += " 已选择<span id=\"disk_upload_fileCount\">0<\/span>个文件,共<span id=\"disk_upload_fileSize\">0B<\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"disk_upload_btn col-md-12\">\n";
strVar += " <div class=\"col-md-6\"><\/div>\n";
strVar += " <div class=\"col-md-6\"><span>上传<\/span><span onclick='$.fancybox.close()'>取消<\/span><\/div>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//初始化文件的拖拉上传
init_disk_drop();
}
//初始化文件的拖拉上传
function init_disk_drop(){
var drop_content = $('#disk_upload_drop')[0];
//当被鼠标拖动的对象进入其容器范围内时触发此事件
drop_content.ondragenter = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#ccc');
}
//当被鼠标拖动的对象离开其容器范围内时触发此事件
drop_content.ondragleave = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#eee');
}
//当某被拖动的对象在另一对象容器范围内拖动时触发此事件
drop_content.ondragover = function(event) {
//阻止默认行为
$.jfbrother.preventDefualt();
$(this).css('borderColor','#ccc');
}
//在一个拖动过程中,释放鼠标键时触发此事件
drop_content.ondrop = function(event) {
$(this).css('borderColor','#eee');
//阻止默认行为
$.jfbrother.preventDefualt();
//拖入的文件必须是外部的,不能使浏览器内的
var files = event.dataTransfer.files;
for(var i=0;i<files.length;i++){
disk_create_uploadList(files[i]);
}
}
}
//文件的上传
function disk_upload_file(){
var files = event.currentTarget.files;
for(var i=0;i<files.length;i++){
disk_create_uploadList(files[i]);
}
}
//根据一个json来渲染上传文件的列表
function disk_create_uploadList(json_data){
var $contaner = $('<div></div>').addClass('col-md-12');
$contaner.data('upload_data',json_data);
var $contaner_left = $('<div></div>').addClass('col-md-7');
var $contaner_right = $('<div></div>').addClass('col-md-5');
$contaner.append($contaner_left).append($contaner_right);
//索引
var $index_span = $('<span></span>');
var file_index = $('.disk_upload_right_content>div').length+1;
$index_span.text(file_index+'.');
//文件名
var $file_name = $('<span></span>');
$file_name.attr('title',json_data.name);
$file_name.text(json_data.name);
$contaner_left.append($index_span).append($file_name);
//文件大小
var $file_size = $('<span></span>');
$file_size.text($.jfbrother.fileSizeToStr(json_data.size));
$file_size.attr('title',$.jfbrother.fileSizeToStr(json_data.size));
//进度条
var $progress = $('<div></div>').addClass('progress disk_progress');
var $progress_value = $('<div class="progress-bar progress-bar-striped active" role="progressbar"></div>');
$progress_value.css('width','0%');
$progress.append($progress_value);
//ok
var $ok_span = $('<span></span>').addClass('glyphicon glyphicon-ok');
//pause
var $pause_span = $('<span></span>').addClass('glyphicon glyphicon-pause');
$pause_span.bind('click',disk_uploadFile_stop);
//remove
var $remove_span = $('<span></span>').addClass('glyphicon glyphicon-remove');
$remove_span.bind('click',disk_uploadFile_remove);
$contaner_right.append($file_size).append($progress).append($ok_span).append($pause_span).append($remove_span);
$('.disk_upload_right_content').append($contaner);
//计算文件的大小以及个数
$('#disk_upload_fileCount').text(file_index);
var old_size = $('#disk_upload_fileSize').data('old_size') || 0;
var new_size = old_size + json_data.size;
$('#disk_upload_fileSize').text($.jfbrother.fileSizeToStr(new_size));
//把原来的大小存放起来,便于以后的计算
$('#disk_upload_fileSize').data('old_size',new_size);
}
//上传文件的删除
function disk_uploadFile_remove(){
//去掉上传信息
var $container = $(this).parent().parent();
var file_size = $container.data('upload_data').size;
//删除节点之后的所有文件信息的索引都减一
$container.nextAll().each(function(index,element){
var $span_index = $(element).children('div').eq(0).find('span').eq(0);
var index = $span_index.text();
$span_index.text(index.substring(0, index.length-1)-1+'.');
})
$container.remove();
//修改文件个数和大小
$('#disk_upload_fileCount').text($('#disk_upload_fileCount').text()-1);
var old_size = $('#disk_upload_fileSize').data('old_size');
var new_size = old_size-file_size;
$('#disk_upload_fileSize').text($.jfbrother.fileSizeToStr(new_size));
//把原来的大小存放起来,便于以后的计算
$('#disk_upload_fileSize').data('old_size',new_size);
}
//文件上传的暂停和开始
function disk_uploadFile_stop(){
if($(this).hasClass('glyphicon-pause')){
//暂停
}
else{
//开始
}
//进度条的动态效果
$(this).prev().prev().find('.progress-bar').toggleClass('active');
//修改图标
$(this).toggleClass('glyphicon-play');
$(this).toggleClass('glyphicon-pause');
}
//显示回收站
function disk_rubbish(){
//删掉目录导航栏
$('.disk_search_center>a').eq(0).nextAll().remove();
//显示切换按钮
$('.disk_content_toggleBtn').show();
//标记下是否是切换到了回收站
$('#disk_rubbish').data('rubbish',true);
//模拟几条垃圾数据
var infos = [
{id:'uuid5',fileName:'压缩文件夹',fileImg:'disk_rar.png',lastTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB'},
{id:'uuid6',fileName:'我的文档',fileImg:'disk_word.png',lastTime:'2018-06-19 8:10',fileType:'word',fileSize:'200KB'},
{id:'uuid7',fileName:'我的EXCEL',fileImg:'disk_excel.png',lastTime:'2018-06-19 8:10',fileType:'excel',fileSize:'100KB'},
{id:'uuid8',fileName:'我的PPT',fileImg:'disk_ppt.png',lastTime:'2018-06-17 8:10',fileType:'ppt',fileSize:'500KB'},
{id:'uuid9',fileName:'我的PDF',fileImg:'disk_pdf.png',lastTime:'2018-06-19 23:10',fileType:'pdf',fileSize:'500KB'},
{id:'uuid10',fileName:'超级狙击手.png',fileImg:'disk_uploadImg.png',lastTime:'2018-06-19 20:10',fileSize:'50KB',fileType:'png'},
{id:'uuid11',fileName:'disk_unknow.bsl',fileImg:'disk_unknow.png',lastTime:'2018-06-19 22:10',fileType:'未知文件格式',fileSize:'30KB'},
]
$('.disk_content_header>div:first-child>a').hide();
$('.disk_rubbishBtn').show();
//如果是列表时,或者是在分享码的列表时
if($('.disk_content_toggleBtn').data('toggleList')||$('#disk_shareCode').data('shareCode')){
//渲染列表
init_disk_rubbish_list(infos);
}
else{
//渲染块状
//先清空容器
$('.disk_content_lump').html('');
//渲染块状
for(var i = 0 ; i<infos.length;i++){
init_disk_createLump(infos[i]);
}
}
}
//还原文件
function disk_reductionFolder(handler){
//右键还原文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要还原的文件!!!";
var option3 = {
title: "还原提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要还原选中的文件!!!";
var option4 = {
title: "还原提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做还原操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
else{
//如果是块状时
var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(lump_rows.length==0){
var txt1 = "请选择要还原的文件!!!";
var option1 = {
title: "还原提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
}
else{
var txt2 = "是否要还原选中的文件!!!";
var option2 = {
title: "还原提示",
onOk: function(){
//先做删除
for(var i = 0 ; i < lump_rows.length ; i ++){
$(lump_rows[i]).parent().remove();
}
//再还原
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
}
//彻底删除文件
function disk_thoroughDeleteFolder(handler){
//右键彻底删除文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要彻底删除的文件!!!";
var option3 = {
title: "彻底删除提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要彻底删除选中的文件!!!";
var option4 = {
title: "彻底删除提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做彻底删除操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
else{
//如果是块状时
var lump_rows = $('.disk_content_lump').find('.disk_content_lump_click');
if(lump_rows.length==0){
var txt1 = "请选择要彻底删除的文件!!!";
var option1 = {
title: "彻底删除提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt1, window.wxc.xcConfirm.typeEnum.confirm,option1);
}
else{
var txt2 = "是否要彻底删除选中的文件!!!";
var option2 = {
title: "彻底删除提示",
onOk: function(){
//先做删除
for(var i = 0 ; i < lump_rows.length ; i ++){
console.log($(lump_rows[i]).data('lump_data'))
$(lump_rows[i]).parent().remove();
}
//再彻底删除
}
}
window.wxc.xcConfirm(txt2, window.wxc.xcConfirm.typeEnum.warning,option2);
}
}
}
//文件的共享
function disk_shareFolder(handler){
//右键分享文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var list_rows;
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
var list_rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(list_rows.length==0){
var txt = "请选择要分享的文件!!!";
var option = {
title: "分享提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
return;
}
//获得选中的数据
var rows_data = [];
for(var i=0;i<list_rows.length;i++ ){
if($(list_rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(list_rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(list_rows[i]);
}
}
console.log(rows_data)
var strVar = "";
strVar += "<div class=\"row\" style=\"margin:0px;width:468px;padding: 0px;border-radius: 5px;overflow: hidden;\">\n";
strVar += " <div class=\"disk_move_title\">分享文件 : <span><\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div class=\"disk_createShare\">\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">分享的形式 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <select class=\"form-control\" id=\"disk_createShare_after_password\">\n";
strVar += " <option value=\"0\">加密<\/option>\n";
strVar += " <option value=\"1\">公开<\/option>\n";
strVar += " <\/select>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">有效期选择 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <select class=\"form-control\" id=\"disk_createShare_after_date\">\n";
strVar += " <option>永久有效<\/option>\n";
strVar += " <option>7天<\/option>\n";
strVar += " <option>1天<\/option>\n";
strVar += " <\/select>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_btn\"> \n";
strVar += " <span onclick=\"disk_createShare()\">创建链接<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"disk_createShare_after\">\n";
strVar += " <div class=\"disk_createShare_after_title\"><span class=\"glyphicon glyphicon-ok\"><\/span><span>分享文件链接创建成功 , <\/span><span id=\"disk_createShare_after_time\"><\/span><\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\">\n";
strVar += " <div class=\"col-md-3\">分享链接 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <input type=\"text\" oninput=\"$(this).val($(this).data('value'));$(this).select()\" onfocus=\"$(this).select();\" class=\"form-control\" id=\"disk_createShare_after_link\"/>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div class=\"col-md-12 disk_createShare_content\" style=\"margin-bottom:30px;\">\n";
strVar += " <div class=\"col-md-3\">分享密码 : <\/div>\n";
strVar += " <div class=\"col-md-9\">\n";
strVar += " <div class=\"col-md-6\"><input oninput=\"$(this).val($(this).data('value'));$(this).select()\" onfocus=\"$(this).select();\" type=\"text\" class=\"form-control\" id=\"disk_createShare_after_pwd\"/><\/div>\n";
strVar += " <div class=\"col-md-6\"><span onclick=\"disk_share_copy()\">复制链接和分享码<\/span><\/div>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += " <div id=\"disk_share_copy_message\" style=\"display:none;text-align:center;margin-bottom:0px;\" class=\"col-md-12 alert alert-success\" role=\"alert\">\n";
strVar += " <a href=\"#\" class=\"alert-link\">复制成功<\/a>\n";
strVar += " <\/div>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
//分享文件
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//如果只有一个文件时
if(rows_data.length==1){
$('.disk_move_title>span').eq(0).text(rows_data[0].fileName);
$('.disk_move_title>span').eq(0).attr('title',rows_data[0].fileName);
}
else{
var fileNames = '';
for(var i = 0 ;i<rows_data.length;i++){
fileNames += rows_data[i].fileName + ',';
}
//截取掉最后一个','并且加个总个数
fileNames = fileNames.substring(0, fileNames.length-1) + '(共'+ rows_data.length +'项)';
$('.disk_move_title>span').eq(0).text(fileNames);
$('.disk_move_title>span').eq(0).attr('title',fileNames);
}
}
//创建分享链接
function disk_createShare(){
$('.disk_createShare').hide();
$('.disk_createShare_after').show();
//分享形式
var pwd = $('#disk_createShare_after_password').val();
//有效时间
var time = $('#disk_createShare_after_date').val();
if(time=='永久有效'){
$('#disk_createShare_after_time').text(time);
}
else{
$('#disk_createShare_after_time').text('链接'+time+'后失效');
}
//如果分享为加密时
if($('#disk_createShare_after_password').val()==0){
//随机产生4位的随机数
var rand = $.jfbrother.randomWord(true,4,4);
$('#disk_createShare_after_pwd').val(rand);
}
else{
//如果为公开时
$('#disk_createShare_after_pwd').parent().css('visibility','hidden');
$('#disk_createShare_after_pwd').parent().parent().prev().css('visibility','hidden');
$('#disk_createShare_after_pwd').parent().next().find('span').text('复制链接');
}
//把原来的值存放起来
$('#disk_createShare_after_pwd').data('value',$('#disk_createShare_after_pwd').val());
//链接
var old_href = location.href;
var new_href = old_href.substring(0, old_href.lastIndexOf('/'));
$('#disk_createShare_after_link').val(new_href+'/share');
//把原来的值存放起来
$('#disk_createShare_after_link').data('value',$('#disk_createShare_after_link').val());
}
//分享文件的链接和分享码
function disk_share_copy(){
//要复制的内容
var value;
if($('#disk_createShare_after_pwd').val()==''){
value = '链接 : '+$('#disk_createShare_after_link').val();
}
else{
value ='链接 : '+$('#disk_createShare_after_link').val()+' 密码 : '+$('#disk_createShare_after_pwd').val();
}
//创建一个新的输入框来存放
var oInput = $('<input type="text" />').val(value);
$('body').append(oInput);
//选中对象
oInput.select();
//执行浏览器复制命令
document.execCommand("Copy");
//复制后移除
oInput.remove();
//显示提示
$('#disk_share_copy_message').fadeIn();
//定时关闭了提示
setTimeout(function() {
$('#disk_share_copy_message').fadeOut();
}, 3000)
}
//共享文件
function disk_enjoyFolder(handler){
//右键共享文件时,如果是不能点击时
if(handler&&$(handler).hasClass('disk_menu_noClick')){
return;
}
var rows;
//如果是列表时
if($('.disk_content_toggleBtn').data('toggleList')){
//如果是列表时
rows = $('#disk_content_list').bootstrapTable('getSelections');
}
else{
//如果是块状时
rows = $('.disk_content_lump').find('.disk_content_lump_click');
}
if(rows.length==0){
var txt = "请选择要共享的文件!!!";
var option = {
title: "提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.confirm,option);
return;
}
//获得选中的数据
var rows_data = [];
for(var i=0;i<rows.length;i++ ){
if($(rows[i]).data('lump_data')){
//获得块状的数据
rows_data.push($(rows[i]).data('lump_data'));
}
else{
//获得列表的数据
rows_data.push(rows[i]);
}
}
console.log(rows_data)
var strVar = "";
strVar += "<div style=\"width:268px;padding:0px;border-radius:5px;overflow:hidden;\">\n";
strVar += " <div class=\"disk_move_title\"><span>选择要共享的人<\/span><span onclick=\"$.fancybox.close()\" class=\"glyphicon glyphicon-remove\"><\/span><\/div>\n";
strVar += " <div id=\"disk_enjoyUser_tree\" style=\"height:220px;overflow:auto;\" class=\"ztree disk_move_tree\"><\/div>\n";
strVar += " <div class=\"disk_move_btn\">\n";
strVar += " <span onclick=\"disk_enjoyUser_save()\">确定<\/span><span onclick=\"$.fancybox.close()\">取消<\/span>\n";
strVar += " <\/div>\n";
strVar += "<\/div>\n";
$.fancybox.open(strVar,{
//显示之前触发
beforeShow : function( instance, current ) {
//去掉fancybox原来的间距
/*$('.fancybox-opened').css('width','268px');*/
$('.fancybox-skin').css('padding','0');
},
//显示之后触发
afterShow : function( instance, current ){
//隐藏右上角的X
$('.fancybox-close').hide();
}
});
//初始化文件目录
init_disk_enjoyUser_tree(rows_data);
}
//我的分享码
function disk_shareCode(){
$('#disk_shareCode').data('shareCode',true);
//删掉目录导航栏
$('.disk_search_center>a').eq(0).nextAll().remove();
//隐藏切换视图的功能
$('.disk_content_toggleBtn').hide();
//模拟几条垃圾数据
var infos = [
{id:'uuid1',fileName:'分享文件1',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB',shareCode:'UkN5',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'},
{id:'uuid2',fileName:'分享文件2',shareTime:'2018-06-18 12:10',fileType:'word',fileSize:'2MB',shareCode:'5238',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'7天后'},
{id:'uuid3',fileName:'分享文件3',shareTime:'2018-06-18 12:10',fileType:'excel',fileSize:'5MB',shareCode:'fsdf',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'1天后'},
{id:'uuid4',fileName:'分享文件4',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'3MB',shareCode:'sd12',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'},
{id:'uuid5',fileName:'分享文件5',shareTime:'2018-06-18 12:10',fileType:'rar',fileSize:'1MB',shareCode:'tret',shareLink:'http://localhost:8080/jfV5portal/share',activeTime:'永久有效'}
]
//显示取消分享的按钮
$('.disk_content_header>div:first-child>a').hide();
$('.disk_shareCodeBtn').show();
//显示列表
$('.disk_content_list').show();
$('.disk_content_lump').hide();
//渲染列表
init_disk_shareCode_list(infos);
}
//取消分享
function disk_cancelShareCode(handler){
var list_rows = $('#disk_content_list').bootstrapTable('getSelections');
if(list_rows.length==0){
var txt3 = "请选择要取消分享的文件!!!";
var option3 = {
title: "取消分享提示",
btn:parseInt("0001",2)
}
window.wxc.xcConfirm(txt3, window.wxc.xcConfirm.typeEnum.confirm,option3);
}
else{
var txt4 = "是否要取消分享选中的文件!!!";
var option4 = {
title: "取消分享提示",
onOk: function(){
for(var i = 0; i<list_rows.length;i++){
//根据id来删除行
$('#disk_content_list').bootstrapTable('removeByUniqueId',list_rows[i].id);
//然后做取消分享操作
}
}
}
window.wxc.xcConfirm(txt4, window.wxc.xcConfirm.typeEnum.warning,option4);
}
}
//初始化我的分享码的列表
function init_disk_shareCode_list(infos){
for(var i=0;i<infos.length;i++){
init_disk_select_fileImg(infos[i]);
}
$('#disk_content_list').bootstrapTable('destroy').bootstrapTable({
/* showColumns:true,
showToggle:true,
showRefresh:true,
search:true, */
/* url: "bootstrap-table/data/data1.json", // 获取表格数据的url */
data:infos,
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
/* striped: true, //表格显示条纹,默认为false */
pagination: false, // 在表格底部显示分页组件,默认false
pageList: [5,10,15,20], // 设置页面可以显示的数据条数
pageSize: 10, // 页面数据条数
pageNumber: 1, // 首页页码,
uniqueId:'id',
clickToSelect:true,//True to select checkbox or radiobox when the column is clicked.
queryParams:function(params){
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
// limit: params.limit, //页面大小
offset: params.offset, //页码
pageSize:this.pageSize,
pageNumber:this.pageNumber
/* projectId: $("#projectId").val(),
requirement_Id:$("#requirement_Id").val(),
length: 6 */
};
return temp;
},
columns: [
{
checkbox: true, // 显示一个勾选框
align: 'center', // 居中显示
valign: 'middle'
},{
field: 'fileName',
title: '文件名称',
align: 'left',
valign: 'middle',
width:400,
formatter: function (value, row, index) {
return '<div class="row disk_content_list_fileName"><div class="col-md-2"><img src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" ></div><div class="col-md-10"><div style="color:#666;cursor:text;">'+ value +'</div><input type="text" value='+ value +' class="form-control" onblur="disk_input_blur(this)" /></div></div>';
}
}, {
field: 'shareTime',
title: '分享时间',
align: 'center',
valign: 'middle',
order:'asc',
sortable:'true'
}, {
field: 'fileType',
title: '类型',
align: 'center',
valign: 'middle'
},{
field: 'fileSize',
title: '大小',
align: 'center',
valign: 'middle'
},{
field: 'shareCode',
title: '分享码',
align: 'center',
valign: 'middle'
},{
field: 'shareLink',
title: '分享链接',
align: 'center',
valign: 'middle'
},{
field: 'activeTime',
title: '有效时间',
align: 'center',
valign: 'middle'
}
],
//选中时隐藏菜单
onCheck:function(row){
$('#disk_shareCode_menu').hide();
}
})
}
WebContent/jfcas04/js/index.js
View file @
6be3d484
...
@@ -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/jfcas04/login.jsp
View file @
6be3d484
...
@@ -320,6 +320,17 @@ $(document).ready(function () {
...
@@ -320,6 +320,17 @@ $(document).ready(function () {
// 点击记住密码
// 点击记住密码
$
(
"#remember"
).
live
(
'click'
,
function
()
{
$
(
"#remember"
).
live
(
'click'
,
function
()
{
updateCookie
();
updateCookie
();
if
(
$
(
"#remember"
).
attr
(
'checked'
)
!=
'checked'
)
{
$
(
'#username'
).
val
(
''
);
$
(
'#password'
).
val
(
''
);
$
(
'.login_yzm>input'
).
val
(
''
);
$
(
'#username'
).
next
(
'label'
).
remove
();
$
(
'#password'
).
next
(
'label'
).
remove
();
$
(
'.login_yzm>input'
).
next
(
'label'
).
remove
();
init_login_tip
(
$
(
'#username'
),
'请输入账号'
);
init_login_tip
(
$
(
'#password'
),
'请输入密码'
);
init_login_tip
(
$
(
'.login_yzm>input'
),
'请输入验证码'
);
}
});
});
// 点击重置
// 点击重置
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
$
(
"#b_cancel"
).
live
(
'click'
,
function
()
{
...
...
WebContent/jwapp/pages/apps/js/jwAppAppsModule.js
View file @
6be3d484
...
@@ -16,9 +16,9 @@ jwAppAppsModel.prototype.insert_installApp_byResourceId=function(){};
...
@@ -16,9 +16,9 @@ jwAppAppsModel.prototype.insert_installApp_byResourceId=function(){};
jwAppAppsModel
.
prototype
.
insert_unInstallApp_byResourceId
=
function
(){};
jwAppAppsModel
.
prototype
.
insert_unInstallApp_byResourceId
=
function
(){};
//创建一个数据操作对象,然后再后续使用
//创建一个数据操作对象,然后再后续使用
jwAppAppsModel
.
jwAppsAppsActAction
=
new
jwAppAppsModel
(
"json"
).
delegate
(
"
jwApps
AppstoreAct"
);
jwAppAppsModel
.
jwAppsAppsActAction
=
new
jwAppAppsModel
(
"json"
).
delegate
(
"
front
AppstoreAct"
);
//创建一个数据获取对象,然后再后续使用
//创建一个数据获取对象,然后再后续使用
jwAppAppsModel
.
jwAppsAppsDataAction
=
new
jwAppAppsModel
(
"json"
).
delegate
(
"
jwApps
AppstoreData"
);
jwAppAppsModel
.
jwAppsAppsDataAction
=
new
jwAppAppsModel
(
"json"
).
delegate
(
"
front
AppstoreData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
...
...
WebContent/jwapp/pages/calendar/calendarCompanyTab.jsp
0 → 100644
View file @
6be3d484
<%@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 @
6be3d484
<%@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 @
6be3d484
<%@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 @
6be3d484
<%@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 @
6be3d484
/**
* 序号: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 @
6be3d484
//此乃本模块与后台交互的方法接口部分
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 @
6be3d484
/**
* 序号: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 @
6be3d484
...
@@ -16,17 +16,11 @@ jwAppPortletModel.prototype.listAllPortletColumns = function(){};
...
@@ -16,17 +16,11 @@ 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
(
"
jwApps
PortletAct"
);
jwAppPortletModel
.
jwAppsPortletActAction
=
new
jwAppPortletModel
(
"json"
).
delegate
(
"
front
PortletAct"
);
//创建一个数据获取对象,然后再后续使用
//创建一个数据获取对象,然后再后续使用
jwAppPortletModel
.
jwAppsPortletDataAction
=
new
jwAppPortletModel
(
"json"
).
delegate
(
"
jwApps
PortletData"
);
jwAppPortletModel
.
jwAppsPortletDataAction
=
new
jwAppPortletModel
(
"json"
).
delegate
(
"
front
PortletData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
...
...
WebContent/jwapp/pages/storepersonal/storePersonalTabDetail.jsp
View file @
6be3d484
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}"/>
<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_UUID" id="UUID" value="${is_row.UUID}"/>
<input type="hidden" name="FATHER_PATH" id="FATHER_PATH" value="${is_row.UUID}"/>
<input type="hidden" name="FATHER_PATH" id="FATHER_PATH" value="${is_row.UUID}"/>
<input type="hidden" name="OLD_FILE_NAME" id="OLD_FILE_NAME" value="${is_row.FILE_NAME}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<tr>
<td class="tableStyleLable">
<td class="tableStyleLable">
...
...
WebContent/lib/plug/xcConfirm/css/xcConfirm.css
View file @
6be3d484
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
/* .xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;} */
/* .xcConfirm .popBox .txtBox{margin: 40px 100px; height: 100px; overflow: hidden;} */
.xcConfirm
.popBox
.txtBox
{
.xcConfirm
.popBox
.txtBox
{
margin
:
30px
100px
;
margin
:
30px
100px
;
height
:
57
px
;
height
:
61
px
;
overflow
:
hidden
;
overflow
:
hidden
;
margin-top
:
40px
;
margin-top
:
40px
;
}
}
...
...
WebContent/nav4.jsp
View file @
6be3d484
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<div class="indedx_header">
<div class="indedx_header">
<div onclick="location.href='interim'">
<div onclick="location.href='interim'">
...
@@ -9,10 +10,10 @@
...
@@ -9,10 +10,10 @@
<a href="javascript:void(0)" class="index_header_showMessage">
<a href="javascript:void(0)" class="index_header_showMessage">
<img src="${ctx}/custom/images/index4_loginmessage.png" width="12" height="12" />登录信息
<img src="${ctx}/custom/images/index4_loginmessage.png" width="12" height="12" />登录信息
<ul>
<ul>
<li><span>登录账号</span><span>
test001
</span></li>
<li><span>登录账号</span><span>
<s:property value="#session.userInfo['EMID']"/>
</span></li>
<li><span>姓名</span><span>
小周
</span></li>
<li><span>姓名</span><span>
<s:property value="#session.userInfo['EMNAME']"/>
</span></li>
<li><span>登录
时间</span><span>2018.02.22 12:24:38
</span></li>
<li><span>登录
IP</span><span><s:property value="#session.userInfo['LOGINIP']"/>
</span></li>
<li><span>上次时间</span><span>
2017.02.22 12:24:38
</span></li>
<li><span>上次时间</span><span>
<s:property value="#session.userInfo['BEFORETIME']"/>
</span></li>
</ul>
</ul>
</a><span>|</span>
</a><span>|</span>
<a href="#">
<a href="#">
...
...
src/struts-ext.xml
View file @
6be3d484
...
@@ -6,30 +6,30 @@
...
@@ -6,30 +6,30 @@
<struts>
<struts>
<package
name=
"src_jwapp"
extends=
"gaowj"
>
<package
name=
"src_jwapp"
extends=
"gaowj"
>
<!-- Portlet相关 -->
<!-- Portlet相关 -->
<action
name=
"
jwApps
PortletAct_*"
class=
"com.jw.app.portlet.action.actAction"
<action
name=
"
front
PortletAct_*"
class=
"com.jw.app.portlet.action.actAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
<param
name=
"root"
>
jsonObject
</param>
</result>
</result>
</action>
</action>
<action
name=
"
jwApps
PortletData_*"
class=
"com.jw.app.portlet.action.dataAction"
<action
name=
"
front
PortletData_*"
class=
"com.jw.app.portlet.action.dataAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
<param
name=
"root"
>
jsonObject
</param>
</result>
</result>
</action>
</action>
<action
name=
"
jwApps
PortletView_*"
class=
"com.jw.app.portlet.action.viewAction"
<action
name=
"
front
PortletView_*"
class=
"com.jw.app.portlet.action.viewAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/portlet/{1}.jsp
</result>
<result
name=
"{1}"
>
/jwapp/pages/portlet/{1}.jsp
</result>
</action>
</action>
<!-- 集成应用相关 -->
<!-- 集成应用相关 -->
<action
name=
"
jwApps
AppstoreAct_*"
class=
"com.jw.app.apps.action.actAction"
<action
name=
"
front
AppstoreAct_*"
class=
"com.jw.app.apps.action.actAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
<param
name=
"root"
>
jsonObject
</param>
</result>
</result>
</action>
</action>
<action
name=
"
jwApps
AppstoreData_*"
class=
"com.jw.app.apps.action.dataAction"
<action
name=
"
front
AppstoreData_*"
class=
"com.jw.app.apps.action.dataAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
<param
name=
"root"
>
jsonObject
</param>
...
@@ -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 @
6be3d484
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 @
6be3d484
...
@@ -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 @
6be3d484
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 @
6be3d484
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 @
6be3d484
<?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 @
6be3d484
...
@@ -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 @
6be3d484
...
@@ -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 @
6be3d484
...
@@ -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/business/store/personal/storePersonalDAO.xml
View file @
6be3d484
...
@@ -27,9 +27,7 @@
...
@@ -27,9 +27,7 @@
</foreach>
</foreach>
</trim>
</trim>
<where>
<where>
<if
test=
"UUID != null and UUID != ''"
>
UUID = #{UUID}
and UUID = #{UUID}
</if>
</where>
</where>
</update>
</update>
...
...
src_jwapp/com/jw/app/calendar/action/actAction.java
0 → 100644
View file @
6be3d484
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 @
6be3d484
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 @
6be3d484
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 @
6be3d484
...
@@ -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 @
6be3d484
...
@@ -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"
;
}
}
}
src_jwapp/com/jw/app/store/action/personal/actAction.java
View file @
6be3d484
...
@@ -71,6 +71,28 @@ public class actAction extends BasicAction {
...
@@ -71,6 +71,28 @@ public class actAction extends BasicAction {
//去除不要更新的字段
//去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
entity
.
remove
(
"OPETYPE"
);
//处理目录/文件重名的问题,处理是直接在文件和目录后加数字
// Map<String,Object> v_congfu_query = new HashMap<String,Object>();
// v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID"));
// v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID"));
// String isfile_1 = (String) entity.get("ISFILE");
// if(StringUtils.equals(isfile_1, "1")){
// String fname = (String) entity.get("FILE_NAME");
// fname = fname.substring(0,fname.lastIndexOf("."));
// v_congfu_query.put("FILE_NAME",fname);
// }else{
// v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME"));
// }
// int ret_count = business.listCount_storePersonal(v_congfu_query);
// if(ret_count>0){
// String fname = (String) entity.get("FILE_NAME");
// if(StringUtils.equals(isfile_1, "1")){
// fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1);
// }else{
// fname = fname + "("+ret_count+")";
// }
// entity.put("FILE_NAME",fname);
// }
//处理超限问题
//处理超限问题
StoreUserBusiness
business_storeuser
=
BusinessManager
.
getBusiness
(
StoreUserBusiness
.
class
);
StoreUserBusiness
business_storeuser
=
BusinessManager
.
getBusiness
(
StoreUserBusiness
.
class
);
Map
<
String
,
Object
>
storeuserQuery
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
storeuserQuery
=
new
HashMap
<
String
,
Object
>();
...
@@ -205,7 +227,7 @@ public class actAction extends BasicAction {
...
@@ -205,7 +227,7 @@ public class actAction extends BasicAction {
}
}
}
}
//
//
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功
"
));
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功
,"
+
entity
.
get
(
"FILE_NAME"
)
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
...
@@ -224,8 +246,33 @@ public class actAction extends BasicAction {
...
@@ -224,8 +246,33 @@ public class actAction extends BasicAction {
StorePersonalBusiness
business
=
BusinessManager
.
getBusiness
(
StorePersonalBusiness
.
class
);
StorePersonalBusiness
business
=
BusinessManager
.
getBusiness
(
StorePersonalBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
father_path
=
request
.
getParameter
(
"FATHER_PATH"
);
String
father_path
=
request
.
getParameter
(
"FATHER_PATH"
);
// String old_file_name = request.getParameter("OLD_FILE_NAME");
try
{
try
{
// String is_fname = (String) entity.get("FILE_NAME");
// if(!StringUtils.equals(is_fname, old_file_name)){
// //处理目录/文件重名的问题,处理是直接在文件和目录后加数字
// Map<String,Object> v_congfu_query = new HashMap<String,Object>();
// v_congfu_query.put("FATHER_ID", entity.get("FATHER_ID"));
// v_congfu_query.put("CREATOR_ID", entity.get("CREATOR_ID"));
// String isfile_1 = (String) entity.get("ISFILE");
// if(StringUtils.equals(isfile_1, "1")){
// String fname = (String) entity.get("FILE_NAME");
// fname = fname.substring(0,fname.lastIndexOf("."));
// v_congfu_query.put("FILE_NAME",fname);
// }else{
// v_congfu_query.put("FILE_NAME", entity.get("FILE_NAME"));
// }
// int ret_count = business.listCount_storePersonal(v_congfu_query);
// if(ret_count>0){
// String fname = (String) entity.get("FILE_NAME");
// if(StringUtils.equals(isfile_1, "1")){
// fname = fname.substring(0,fname.lastIndexOf("."))+"("+ret_count+")."+fname.substring(fname.lastIndexOf(".")+1);
// }else{
// fname = fname + "("+ret_count+")";
// }
// entity.put("FILE_NAME",fname);
// }
// }
//去除不要更新的字段
//去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
entity
.
remove
(
"OPETYPE"
);
boolean
is_save2db
=
Boolean
.
parseBoolean
(
PropUtil
.
getValue
(
"uploadfile_savetodb"
,
"quartz_service"
,
"true"
));
boolean
is_save2db
=
Boolean
.
parseBoolean
(
PropUtil
.
getValue
(
"uploadfile_savetodb"
,
"quartz_service"
,
"true"
));
...
@@ -325,7 +372,7 @@ public class actAction extends BasicAction {
...
@@ -325,7 +372,7 @@ public class actAction extends BasicAction {
}
}
}
}
//
//
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功
"
));
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功
,"
+
entity
.
get
(
"FILE_NAME"
)
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
src_system/com/gaowj/system/login/CasAction.java
View file @
6be3d484
package
com
.
gaowj
.
system
.
login
;
package
com
.
gaowj
.
system
.
login
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.jasig.cas.client.authentication.AttributePrincipal
;
import
org.jasig.cas.client.authentication.AttributePrincipal
;
...
@@ -36,7 +38,10 @@ public class CasAction extends BasicAction {
...
@@ -36,7 +38,10 @@ public class CasAction extends BasicAction {
Map
<
String
,
Object
>
query
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
query
=
new
HashMap
<
String
,
Object
>();
query
.
put
(
"EMID"
,
username
);
query
.
put
(
"EMID"
,
username
);
Map
<
String
,
Object
>
userInfoI
=
systemOpeBusiness
.
listLoginUserInfo
(
query
).
get
(
0
);
Map
<
String
,
Object
>
userInfoI
=
null
;
List
<
Map
<
String
,
Object
>>
listUser
=
systemOpeBusiness
.
listLoginUserInfo
(
query
);
if
(
listUser
.
size
()>
0
){
userInfoI
=
systemOpeBusiness
.
listLoginUserInfo
(
query
).
get
(
0
);
Map
<
String
,
Object
>
sessionUser
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
sessionUser
=
new
HashMap
<
String
,
Object
>();
String
u_all_m
=
systemOpeBusiness
.
getUserAllModule
(
userInfoI
.
get
(
"CODE"
).
toString
());
String
u_all_m
=
systemOpeBusiness
.
getUserAllModule
(
userInfoI
.
get
(
"CODE"
).
toString
());
sessionUser
.
put
(
"CODE"
,
userInfoI
.
get
(
"CODE"
));
sessionUser
.
put
(
"CODE"
,
userInfoI
.
get
(
"CODE"
));
...
@@ -46,12 +51,14 @@ public class CasAction extends BasicAction {
...
@@ -46,12 +51,14 @@ public class CasAction extends BasicAction {
sessionUser
.
put
(
"EMDEPART"
,
userInfoI
.
get
(
"EMDEPART"
));
sessionUser
.
put
(
"EMDEPART"
,
userInfoI
.
get
(
"EMDEPART"
));
sessionUser
.
put
(
"EMNAME"
,
userInfoI
.
get
(
"EMNAME"
));
sessionUser
.
put
(
"EMNAME"
,
userInfoI
.
get
(
"EMNAME"
));
sessionUser
.
put
(
"BEFORETIME"
,
userInfoI
.
get
(
"BEFORETIME"
));
sessionUser
.
put
(
"BEFORETIME"
,
userInfoI
.
get
(
"BEFORETIME"
));
sessionUser
.
put
(
"BEFORETIME"
,
jt
.
date3string
((
Date
)
userInfoI
.
get
(
"BEFORETIME"
)));
sessionUser
.
put
(
"SESSIONID"
,
request
.
getSession
().
getId
());
sessionUser
.
put
(
"SESSIONID"
,
request
.
getSession
().
getId
());
sessionUser
.
put
(
"CURRENTTIME"
,
jt
.
now_datetime
());
sessionUser
.
put
(
"CURRENTTIME"
,
jt
.
now_datetime
());
sessionUser
.
put
(
"LOGINIP"
,
request
.
getRemoteAddr
());
sessionUser
.
put
(
"LOGINIP"
,
request
.
getRemoteAddr
());
sessionUser
.
put
(
"SERVERIP"
,
request
.
getLocalAddr
());
sessionUser
.
put
(
"SERVERIP"
,
request
.
getLocalAddr
());
sessionUser
.
put
(
"QUANXIAN"
,
u_all_m
);
sessionUser
.
put
(
"QUANXIAN"
,
u_all_m
);
sessionUser
.
put
(
"SESSIONUSER"
,
request
.
getSession
());
request
.
getSession
().
setAttribute
(
"userInfo"
,
sessionUser
);
request
.
getSession
().
setAttribute
(
"userInfo"
,
sessionUser
);
//增加登陆日志
//增加登陆日志
Map
<
String
,
Object
>
log
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
log
=
new
HashMap
<
String
,
Object
>();
...
@@ -60,6 +67,8 @@ public class CasAction extends BasicAction {
...
@@ -60,6 +67,8 @@ public class CasAction extends BasicAction {
log
.
put
(
"OPETYPE"
,
"B/S登陆"
);
log
.
put
(
"OPETYPE"
,
"B/S登陆"
);
systemOpeBusiness
.
insert_log
(
log
);
systemOpeBusiness
.
insert_log
(
log
);
}
}
}
String
strRedirecturl
=
request
.
getParameter
(
"redirectUrl"
);
String
strRedirecturl
=
request
.
getParameter
(
"redirectUrl"
);
String
toUrl
=
""
;
String
toUrl
=
""
;
if
(
strRedirecturl
!=
null
&&
strRedirecturl
.
length
()
>
0
)
{
if
(
strRedirecturl
!=
null
&&
strRedirecturl
.
length
()
>
0
)
{
...
...
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