Browse Source

bug修改

qxp 5 năm trước cách đây
mục cha
commit
2b8a14c362
25 tập tin đã thay đổi với 1066 bổ sung131 xóa
  1. 86 0
      bin/uat/start_dgtly-admin.sh
  2. 86 0
      bin/uat/start_dgtly-api.sh
  3. 1 1
      suishenbang-admin/src/main/resources/application-dev.yml
  4. 1 1
      suishenbang-admin/src/main/resources/application-test.yml
  5. 57 0
      suishenbang-admin/src/main/resources/application-uat-druid.yml
  6. 138 0
      suishenbang-admin/src/main/resources/application-uat.yml
  7. 2 2
      suishenbang-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.js
  8. 1 1
      suishenbang-admin/src/main/resources/templates/appIndex.html
  9. 1 1
      suishenbang-admin/src/main/resources/templates/index.html
  10. 9 9
      suishenbang-admin/src/main/resources/templates/system/dept/add.html
  11. 1 1
      suishenbang-admin/src/main/resources/templates/system/dept/dept.html
  12. 27 27
      suishenbang-admin/src/main/resources/templates/system/dept/edit.html
  13. 1 1
      suishenbang-admin/src/main/resources/templates/system/role/role.html
  14. 3 0
      suishenbang-admin/src/main/resources/templates/system/user/user.html
  15. 1 1
      suishenbang-api/src/main/resources/application-dev.yml
  16. 1 1
      suishenbang-api/src/main/resources/application-test.yml
  17. 57 0
      suishenbang-api/src/main/resources/application-uat-druid.yml
  18. 104 0
      suishenbang-api/src/main/resources/application-uat.yml
  19. 3 0
      suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml
  20. 104 18
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/add.html
  21. 3 3
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/banner.html
  22. 99 19
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/edit.html
  23. 139 20
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/add.html
  24. 139 23
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/edit.html
  25. 2 2
      suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/wxMagnet.html

+ 86 - 0
bin/uat/start_dgtly-admin.sh

@@ -0,0 +1,86 @@
+#!/bin/bash
+
+AppName=suishenbang-admin.jar
+
+#JVM参数
+JVM_OPTS="-Dname=$AppName  -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
+APP_HOME=`pwd`
+LOG_PATH=$APP_HOME/logs/$AppName.log
+
+if [ "$1" = "" ];
+then
+    echo -e "\033[0;31m 未输入操作名 \033[0m  \033[0;34m {start|stop|restart|status} \033[0m"
+    exit 1
+fi
+
+if [ "$AppName" = "" ];
+then
+    echo -e "\033[0;31m 未输入应用名 \033[0m"
+    exit 1
+fi
+
+function start()
+{
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
+
+	if [ x"$PID" != x"" ]; then
+	    echo "$AppName is running..."
+	else
+		nohup java -jar  $JVM_OPTS $AppName --spring.profiles.active=uat > $LOG_PATH 2>&1 &
+		echo "Start $AppName success..."
+	fi
+}
+
+function stop()
+{
+    echo "Stop $AppName"
+	
+	PID=""
+	query(){
+		PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
+	}
+
+	query
+	if [ x"$PID" != x"" ]; then
+		kill -TERM $PID
+		echo "$AppName (pid:$PID) exiting..."
+		while [ x"$PID" != x"" ]
+		do
+			sleep 1
+			query
+		done
+		echo "$AppName exited."
+	else
+		echo "$AppName already stopped."
+	fi
+}
+
+function restart()
+{
+    stop
+    sleep 2
+    start
+}
+
+function status()
+{
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
+    if [ $PID != 0 ];then
+        echo "$AppName is running..."
+    else
+        echo "$AppName is not running..."
+    fi
+}
+
+case $1 in
+    start)
+    start;;
+    stop)
+    stop;;
+    restart)
+    restart;;
+    status)
+    status;;
+    *)
+
+esac

+ 86 - 0
bin/uat/start_dgtly-api.sh

@@ -0,0 +1,86 @@
+#!/bin/bash
+
+AppName=suishenbang-api.jar
+
+#JVM参数
+JVM_OPTS="-Dname=$AppName  -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps  -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
+APP_HOME=`pwd`
+LOG_PATH=$APP_HOME/logs/$AppName.log
+
+if [ "$1" = "" ];
+then
+    echo -e "\033[0;31m 未输入操作名 \033[0m  \033[0;34m {start|stop|restart|status} \033[0m"
+    exit 1
+fi
+
+if [ "$AppName" = "" ];
+then
+    echo -e "\033[0;31m 未输入应用名 \033[0m"
+    exit 1
+fi
+
+function start()
+{
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
+
+	if [ x"$PID" != x"" ]; then
+	    echo "$AppName is running..."
+	else
+		nohup java -jar  $JVM_OPTS $AppName --spring.profiles.active=uat > $LOG_PATH 2>&1 &
+		echo "Start $AppName success..."
+	fi
+}
+
+function stop()
+{
+    echo "Stop $AppName"
+	
+	PID=""
+	query(){
+		PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'`
+	}
+
+	query
+	if [ x"$PID" != x"" ]; then
+		kill -TERM $PID
+		echo "$AppName (pid:$PID) exiting..."
+		while [ x"$PID" != x"" ]
+		do
+			sleep 1
+			query
+		done
+		echo "$AppName exited."
+	else
+		echo "$AppName already stopped."
+	fi
+}
+
+function restart()
+{
+    stop
+    sleep 2
+    start
+}
+
+function status()
+{
+    PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l`
+    if [ $PID != 0 ];then
+        echo "$AppName is running..."
+    else
+        echo "$AppName is not running..."
+    fi
+}
+
+case $1 in
+    start)
+    start;;
+    stop)
+    stop;;
+    restart)
+    restart;;
+    status)
+    status;;
+    *)
+
+esac

+ 1 - 1
suishenbang-admin/src/main/resources/application-dev.yml

@@ -5,7 +5,7 @@ ruoyi:
   # 版本
   version: 4.0.0
   # 版权年份
-  copyrightYear: 2019
+  copyrightYear: 2020
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)

+ 1 - 1
suishenbang-admin/src/main/resources/application-test.yml

@@ -5,7 +5,7 @@ ruoyi:
   # 版本
   version: 4.0.0
   # 版权年份
-  copyrightYear: 2019
+  copyrightYear: 2020
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)

+ 57 - 0
suishenbang-admin/src/main/resources/application-uat-druid.yml

@@ -0,0 +1,57 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://pc-uf637rafh16b6nl16.rwlb.rds.aliyuncs.com:3306/ssbtest?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: ssbtest
+                password: Ssbtest#0812
+            # 从库数据源
+            slave:
+                # 从数据源开关/默认关闭
+                enabled: false
+                url: 
+                username: 
+                password: 
+            # 初始连接数
+            initialSize: 10
+            # 最小连接池数量
+            minIdle: 20
+            # 最大连接池数量
+            maxActive: 40
+            # 配置获取连接等待超时的时间
+            maxWait: 60000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            timeBetweenEvictionRunsMillis: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            minEvictableIdleTimeMillis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            maxEvictableIdleTimeMillis: 900000
+            # 配置检测连接是否有效
+            validationQuery: SELECT 1 FROM DUAL
+            testWhileIdle: true
+            testOnBorrow: false
+            testOnReturn: false
+            webStatFilter: 
+                enabled: true
+            statViewServlet:
+                enabled: true
+                # 设置白名单,不填则允许所有访问
+                allow:
+                url-pattern: /druid/*
+                # 控制台管理用户名和密码
+                login-username: 
+                login-password: 
+            filter:
+                stat:
+                    enabled: true
+                    # 慢SQL记录
+                    log-slow-sql: true
+                    slow-sql-millis: 5000
+                    merge-sql: true
+                wall:
+                    config:
+                        multi-statement-allow: true

+ 138 - 0
suishenbang-admin/src/main/resources/application-uat.yml

@@ -0,0 +1,138 @@
+# 项目相关配置
+ruoyi:
+  # 名称
+  name: suishenbang-oneportal
+  # 版本
+  version: 4.0.0
+  # 版权年份
+  copyrightYear: 2020
+  # 实例演示开关
+  demoEnabled: true
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: /home/admin/priject/file
+  # 获取ip地址开关
+  addressEnabled: true
+  cloudPath: http://suishenbangtest.nipponpaint.com.cn/gateway/
+#经销商微信接口相关配置
+customer:
+  appid: ap4f8e6a38b6142187
+  appsecret: d5c234b37e9f9ecb47a71ba6a788bd3e
+  #正式域名 https://ac.nipponpaint.com.cn
+  domain: https://ac.nipponpaint.com.cn
+
+
+# 开发环境配置
+server:
+  # 服务器的HTTP端口,默认为80
+  port: 10000
+  servlet:
+    # 应用的访问路径
+    context-path: /oneportal
+  tomcat:
+    # tomcat的URI编码
+    uri-encoding: UTF-8
+    # tomcat最大线程数,默认为200
+    max-threads: 800
+    # Tomcat启动初始化的线程数,默认值25
+    min-spare-threads: 30
+ 
+# 日志配置
+logging:
+  level:
+    com.dgtly: debug
+    org.springframework: warn
+
+# 用户配置
+user:
+  password:
+    # 密码错误{maxRetryCount}次锁定10分钟
+    maxRetryCount: 5
+
+# Spring配置
+spring:
+  # 模板引擎
+  thymeleaf:
+    mode: HTML
+    encoding: utf-8
+    # 禁用缓存
+    cache: false
+  # 资源信息
+  messages:
+    # 国际化资源文件路径
+    basename: static/i18n/messages
+  jackson:
+    time-zone: GMT+8
+    date-format: yyyy-MM-dd HH:mm:ss
+  profiles:
+    include: uat-druid
+  # 文件上传
+  servlet:
+     multipart:
+       # 单个文件大小
+       max-file-size:  10MB
+       # 设置总上传的文件大小
+       max-request-size:  20MB
+  # 服务模块
+  devtools:
+    restart:
+      # 热部署开关
+      enabled: true
+
+# MyBatis
+mybatis:
+    # 搜索指定包别名
+    typeAliasesPackage: com.dgtly.**.domain
+    # 配置mapper的扫描,找到所有的mapper.xml映射文件
+    mapperLocations: classpath*:mapper/**/*Mapper.xml
+    # 加载全局的配置文件
+    configLocation: classpath:mybatis/mybatis-config.xml
+
+# PageHelper分页插件
+pagehelper: 
+  helperDialect: mysql
+  reasonable: true
+  supportMethodsArguments: true
+  params: count=countSql 
+
+# Shiro
+shiro:
+  user:
+    # 登录地址
+    loginUrl: /login
+    # 权限认证失败地址
+    unauthorizedUrl: /unauth
+    # 首页地址
+    indexUrl: /index
+    # 验证码开关
+    captchaEnabled: true
+    # 验证码类型 math 数组计算 char 字符
+    captchaType: math
+  cookie:
+    # 设置Cookie的域名 默认空,即当前访问的域名
+    domain: 
+    # 设置cookie的有效访问路径
+    path: /
+    # 设置HttpOnly属性
+    httpOnly: true
+    # 设置Cookie的过期时间,天为单位
+    maxAge: 30
+  session:
+    # Session超时时间,-1代表永不过期(默认30分钟)
+    expireTime: 30
+    # 同步session到数据库的周期(默认1分钟)
+    dbSyncPeriod: 1
+    # 相隔多久检查一次session的有效性,默认就是10分钟
+    validationInterval: 10
+    # 同一个用户最大会话数,比如2的意思是同一个账号允许最多同时两个人登录(默认-1不限制)
+    maxSession: -1
+    # 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
+    kickoutAfter: false
+
+# 防止XSS攻击
+xss: 
+  # 过滤开关
+  enabled: true
+  # 排除链接(多个用逗号分隔)
+  excludes: /system/notice/*
+  # 匹配链接
+  urlPatterns: /system/*,/monitor/*,/tool/*

+ 2 - 2
suishenbang-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.js

@@ -51,12 +51,12 @@
                 },
                 zoomIn: function ()
                 {
-                    this.ratio*=1.1;
+                    this.ratio*=1.05;
                     setBackground();
                 },
                 zoomOut: function ()
                 {
-                    this.ratio*=0.9;
+                    this.ratio*=0.95;
                     setBackground();
                 }
             },

+ 1 - 1
suishenbang-admin/src/main/resources/templates/appIndex.html

@@ -136,7 +136,7 @@
                     th:src="@{/system/main}" frameborder="0" seamless></iframe>
         </div>
         <div class="footer">
-            <div class="pull-right">© [[${copyrightYear}]] DGT Copyright </div>
+            <div class="pull-right">© [[${copyrightYear}]] libang Copyright </div>
         </div>
     </div>
     <!--右侧部分结束-->

+ 1 - 1
suishenbang-admin/src/main/resources/templates/index.html

@@ -226,7 +226,7 @@
                     th:src="@{/system/main}" frameborder="0" seamless></iframe>
         </div>
         <div class="footer">
-            <div class="pull-right">© [[${copyrightYear}]] DGT Copyright </div>
+            <div class="pull-right">© [[${copyrightYear}]] libang Copyright </div>
         </div>
     </div>
     <!--右侧部分结束-->

+ 9 - 9
suishenbang-admin/src/main/resources/templates/system/dept/add.html

@@ -46,15 +46,15 @@
 <!--					<input class="form-control" type="text" name="email">-->
 <!--				</div>-->
 <!--			</div>-->
-			<div class="form-group">
-				<label class="col-sm-3 control-label">部门状态:</label>
-				<div class="col-sm-8">
-				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
-						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
-					</div>
-				</div>
-			</div>
+			<!--<div class="form-group">-->
+				<!--<label class="col-sm-3 control-label">部门状态:</label>-->
+				<!--<div class="col-sm-8">-->
+				    <!--<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">-->
+						<!--<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">-->
+						<!--<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
+					<!--</div>-->
+				<!--</div>-->
+			<!--</div>-->
 		</form>
 	</div>
 	<th:block th:include="include :: footer" />

+ 1 - 1
suishenbang-admin/src/main/resources/templates/system/dept/dept.html

@@ -94,7 +94,7 @@
 		            title: '操作',
 		            align: 'left',
 		            formatter: function(value, row, index) {
-		                if (row.parentId != 0) {
+		                if (row.parentId != -1) {
 		                    var actions = [];
 		                    actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
 		                    actions.push('<a class="btn btn-info  btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\')"><i class="fa fa-plus"></i>新增</a> ');

+ 27 - 27
suishenbang-admin/src/main/resources/templates/system/dept/edit.html

@@ -29,33 +29,33 @@
 					<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
 				</div>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">负责人:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="leader" th:field="*{leader}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">联系电话:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="phone" th:field="*{phone}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">邮箱:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="email" th:field="*{email}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">部门状态:</label>
-				<div class="col-sm-8">
-					<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
-						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
-						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
-					</div>
-				</div>
-			</div>
+			<!--<div class="form-group">-->
+				<!--<label class="col-sm-3 control-label">负责人:</label>-->
+				<!--<div class="col-sm-8">-->
+					<!--<input class="form-control" type="text" name="leader" th:field="*{leader}">-->
+				<!--</div>-->
+			<!--</div>-->
+			<!--<div class="form-group">-->
+				<!--<label class="col-sm-3 control-label">联系电话:</label>-->
+				<!--<div class="col-sm-8">-->
+					<!--<input class="form-control" type="text" name="phone" th:field="*{phone}">-->
+				<!--</div>-->
+			<!--</div>-->
+			<!--<div class="form-group">-->
+				<!--<label class="col-sm-3 control-label">邮箱:</label>-->
+				<!--<div class="col-sm-8">-->
+					<!--<input class="form-control" type="text" name="email" th:field="*{email}">-->
+				<!--</div>-->
+			<!--</div>-->
+			<!--<div class="form-group">-->
+				<!--<label class="col-sm-3 control-label">部门状态:</label>-->
+				<!--<div class="col-sm-8">-->
+					<!--<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">-->
+						<!--<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">-->
+						<!--<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
+					<!--</div>-->
+				<!--</div>-->
+			<!--</div>-->
 		</form>
 	</div>
 	<th:block th:include="include :: footer" />

+ 1 - 1
suishenbang-admin/src/main/resources/templates/system/role/role.html

@@ -140,7 +140,7 @@
         /* 角色管理-分配企业微信磁贴权限 */
         function wxMagnet(roleId) {
             var url = ctx + 'wxportal/magnet/selectMagnetTree/' + roleId;
-            $.modal.open("分配磁贴", url,400,600);
+            $.modal.open("分配磁贴", url,400);
         }
 		
 		/* 角色状态显示 */

+ 3 - 0
suishenbang-admin/src/main/resources/templates/system/user/user.html

@@ -37,6 +37,9 @@
 								<li>
 									登录名称:<input type="text" name="loginName"/>
 								</li>
+								<li>
+									用户名称:<input type="text" name="userName"/>
+								</li>
 								<li>
 									手机号码:<input type="text" name="phonenumber"/>
 								</li>

+ 1 - 1
suishenbang-api/src/main/resources/application-dev.yml

@@ -5,7 +5,7 @@ ruoyi:
   # 版本
   version: 4.0.0
   # 版权年份
-  copyrightYear: 2019
+  copyrightYear: 2020
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
   profile: D:/home
   # 获取ip地址开关

+ 1 - 1
suishenbang-api/src/main/resources/application-test.yml

@@ -5,7 +5,7 @@ ruoyi:
   # 版本
   version: 4.0.0
   # 版权年份
-  copyrightYear: 2019
+  copyrightYear: 2020
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
   profile: /home/suishenbang/file
   # 获取ip地址开关

+ 57 - 0
suishenbang-api/src/main/resources/application-uat-druid.yml

@@ -0,0 +1,57 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://pc-uf637rafh16b6nl16.rwlb.rds.aliyuncs.com:3306/ssbtest?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: ssbtest
+                password: Ssbtest#0812
+            # 从库数据源
+            slave:
+                # 从数据源开关/默认关闭
+                enabled: false
+                url: 
+                username: 
+                password: 
+            # 初始连接数
+            initialSize: 5
+            # 最小连接池数量
+            minIdle: 10
+            # 最大连接池数量
+            maxActive: 20
+            # 配置获取连接等待超时的时间
+            maxWait: 60000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            timeBetweenEvictionRunsMillis: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            minEvictableIdleTimeMillis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            maxEvictableIdleTimeMillis: 900000
+            # 配置检测连接是否有效
+            validationQuery: SELECT 1 FROM DUAL
+            testWhileIdle: true
+            testOnBorrow: false
+            testOnReturn: false
+            webStatFilter: 
+                enabled: true
+            statViewServlet:
+                enabled: true
+                # 设置白名单,不填则允许所有访问
+                allow:
+                url-pattern: /druid/*
+                # 控制台管理用户名和密码
+                login-username: 
+                login-password: 
+            filter:
+                stat:
+                    enabled: true
+                    # 慢SQL记录
+                    log-slow-sql: true
+                    slow-sql-millis: 1000
+                    merge-sql: true
+                wall:
+                    config:
+                        multi-statement-allow: true

+ 104 - 0
suishenbang-api/src/main/resources/application-uat.yml

@@ -0,0 +1,104 @@
+# 项目相关配置1
+ruoyi:
+  # 名称
+  name: dgtly_oneportal
+  # 版本
+  version: 4.0.0
+  # 版权年份
+  copyrightYear: 2020
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: /home/admin/priject/file
+  # 获取ip地址开关
+  addressEnabled: true
+  #是否开启swagger
+  openSwagger: true
+#接口安全验证
+security:
+  #接口过期时间
+  apiTimeOut: 50
+  #接口的plat和对应的AppKey 支持多个用,号分割
+  platMap: "{steelfurniture:'cd72c223-923f-44a3-aede-b9f07dcd56b8'}"
+  #开发模式下 可以使用swagger测试 放过验签环节
+  isDev: true
+
+
+# 开发环境配置
+server:
+  # 服务器的HTTP端口,默认为80
+  port: 10001
+  servlet:
+    # 应用的访问路径
+    context-path: /api
+  tomcat:
+    # tomcat的URI编码
+    uri-encoding: UTF-8
+    # tomcat最大线程数,默认为200
+    max-threads: 800
+    # Tomcat启动初始化的线程数,默认值25
+    min-spare-threads: 30
+ 
+# 日志配置
+logging:
+  level:
+    com.dgtly: debug
+    org.springframework: warn
+# Spring配置
+spring:
+  jackson:
+    time-zone: GMT+8
+    date-format: yyyy-MM-dd HH:mm:ss
+    #字段为空不生效
+    default-property-inclusion: non_null
+  profiles:
+    include: dev-druid
+  # 文件上传
+  servlet:
+     multipart:
+       # 单个文件大小
+       max-file-size:  10MB
+       # 设置总上传的文件大小
+       max-request-size:  20MB
+  # 服务模块
+  devtools:
+    restart:
+      # 热部署开关
+      enabled: true
+  # redis配置
+#  redis:
+#      # Redis数据库索引(默认为0)
+#      database: 0
+#      # Redis服务器地址
+#      host: 192.168.100.254
+#      # Redis服务器连接端口
+#      port: 6379
+#      # Redis服务器连接密码(默认为空)
+#      password:
+#
+#      # 连接超时时间(毫秒)
+#      timeout: 500ms
+#      pool:
+#        jedis:
+#         # 连接池最大连接数(使用负值表示没有限制)
+#          max-active: 8
+#          # 连接池最大阻塞等待时间(使用负值表示没有限制)
+#          max-wait: -1
+#          # 连接池中的最大空闲连接
+#          max-idle: 8
+#          # 连接池中的最小空闲连接
+#          min-idle: 0
+# MyBatis
+mybatis:
+    # 搜索指定包别名
+    typeAliasesPackage: com.dgtly.**.domain
+    # 配置mapper的扫描,找到所有的mapper.xml映射文件
+    mapperLocations: classpath*:mapper/**/*Mapper.xml
+    # 加载全局的配置文件
+    configLocation: classpath:mybatis/mybatis-config.xml
+qiyeweixin:
+  #企业微信id
+  corpid: wx5fd543ad17678381
+  #企业应用的凭证密钥
+  #Cs9omiMVyz3cLm2D5T51i4bCDarHhIdl5uTaj__E-38  随身邦
+  corpsecret: Cs9omiMVyz3cLm2D5T51i4bCDarHhIdl5uTaj__E-38
+  #应用id
+  agentId: 1000038

+ 3 - 0
suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -109,6 +109,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and sysUserExt.salesLevel != ''">
             AND suse.sales_level = #{sysUserExt.salesLevel}
         </if>
+		<if test="userName != null and userName != ''">
+			AND u.user_name like concat('%', #{userName}, '%')
+		</if>
 		<if test="phonenumber != null and phonenumber != ''">
 			AND u.phonenumber like concat('%', #{phonenumber}, '%')
 		</if>

+ 104 - 18
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/add.html

@@ -2,6 +2,7 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
     <th:block th:include="include :: header('新增企业微信门户首页banner图')" />
+    <th:block th:include="include :: cropbox-css" />
     <style>
 
         .bannerImg{
@@ -11,10 +12,28 @@
             color: black;
             text-align: center
         }
+        .thumbBox_L{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 730px;
+            height: 390px;
+            margin-left: -365px;
+            margin-top: -195px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .imageBox_L{
+            margin: 0 auto;
+            width: 800px;
+            height: 450px;
+        }
     </style>
 </head>
 <body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div1">
         <form class="form-horizontal m" id="form-banner-add">
 
             <div class="form-group">    
@@ -47,34 +66,98 @@
             </div>
         </form>
     </div>
+
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">
+        <div class="imageBox imageBox_L" style="margin: 0 auto;">
+            <div class="thumbBox_L" ></div>
+            <div class="spinner" style="display: none">Loading...</div>
+        </div>
+        <div class="action" style="margin: 10px auto;">
+            <div class="new-contentarea tc">
+                <a href="javascript:void(0)" class="upload-img"> <label for="avatar">上传图像</label> </a>
+                <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+            </div>
+            <input type="button"  onclick="upBg()" class="btn-info Btnsty_peyton"  value="上传" />
+            <input type="button"  onclick="back()" class="btn-info Btnsty_peyton "  value="返回" />
+        </div>
+    </div>
+
     <th:block th:include="include :: footer" />
+    <th:block th:include="include :: cropbox-js" />
     <script type="text/javascript">
         var prefix = ctx + "wxportal/banner"
-        $("#form-banner-add").validate({
-            focusCleanup: true
-        });
+        var imgUrl = '[[${imgUrl}]]';
+        var options = {
+            thumbBox: '.thumbBox_L',
+            spinner: '.spinner',
+            imgSrc: $.common.isEmpty(imgUrl) ? ctx + 'img/profile.jpg' : ctx +imgUrl
+        }
+        $(function(){
+            $("#form-banner-add").validate({
+                focusCleanup: true
+            });
+
+            cropper = $('.imageBox').cropbox(options);
+            $('#avatar').on('change', function() {
+                var reader = new FileReader();
+                reader.onload = function(e) {
+                    options.imgSrc = e.target.result;
+                    //根据MIME判断上传的文件是不是图片类型
+                    if((options.imgSrc).indexOf("image/")==-1){
+                        $.modal.alertWarning("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
+                    } else {
+                        cropper = $('.imageBox').cropbox(options);
+                    }
+                }
+                reader.readAsDataURL(this.files[0]);
+            })
+
+
+            $('#btnZoomIn').on('click', function(){
+                cropper.zoomIn();
+            })
+
+            $('#btnZoomOut').on('click', function(){
+                cropper.zoomOut();
+            })
+        })
+
+
 
         function submitHandler() {
             if ($.validate.form()) {
                 $.operate.save(prefix + "/add", $('#form-banner-add').serialize());
             }
         }
+
+        function back() {
+            $("#div1").show();
+            $("#div2").hide();
+        }
+
+
+
+
         /*上传背景图片*/
         function imgUpload() {
-            var imgUrl = $("#input_imgUrl").val();
-
-            var options = {
-                title: "上传Banner图像",
-                width: 900,
-                height: 650,
-                url:  prefix + '/imgUpload?&bgUrl='+imgUrl,
-                btn:["上传","取消"],
-                callBack :upImg
-            };
-            $.modal.openOptions(options);
+
+            $("#div1").hide();
+            $("#div2").show();
+            var imgUrl =$("#input_imgUrl").val();
+            if(imgUrl==null||imgUrl==''){
+                imgUrl =  ctx + 'img/profile.jpg';
+            }else{
+                imgUrl = ctx+$("#input_imgUrl").val();
+            }
+            options = {
+                thumbBox: '.thumbBox_L',
+                spinner: '.spinner',
+                imgSrc:imgUrl
+            }
+            cropper = $('.imageBox').cropbox(options);
         }
-        function upImg(index, layero) {
-            var img = window.frames[0].cropper.getBlob();
+        function upBg() {
+            var img =cropper.getBlob();
             var formdata = new FormData();
             formdata.append("file", img);
             $.ajax({
@@ -87,8 +170,11 @@
                     if(result.code==0){
                         $("#input_imgUrl").val(result.data.fileName);
                         $("#div-imgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
-                        layer.close(index);
+                        $("#div1").show();
+                        $("#div2").hide();
                     }else{
+                        $("#div1").show();
+                        $("#div2").hide();
                         $.modal.alertWarning(result.msg);
                     }
 

+ 3 - 3
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/banner.html

@@ -119,7 +119,7 @@
             $.table.init(options);
         });
         function addNew(){
-            $.modal.open("添加" + $.table._option.modalName, $.operate.addUrl(0),950,700);
+            $.modal.openFull("添加" + $.table._option.modalName, $.operate.addUrl(0));
 
         }
         function editBanner(id){
@@ -130,9 +130,9 @@
                     return;
                 }
                 var url = $.table._option.updateUrl.replace("{id}", row[$.table._option.uniqueId]);
-                $.modal.open("修改" + $.table._option.modalName, url,950,750);
+                $.modal.openFull("修改" + $.table._option.modalName, url);
             } else {
-                $.modal.open("修改" + $.table._option.modalName, $.operate.editUrl(id),950,750);
+                $.modal.openFull("修改" + $.table._option.modalName, $.operate.editUrl(id));
             }
         }
     </script>

+ 99 - 19
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/banner/edit.html

@@ -2,6 +2,7 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
     <th:block th:include="include :: header('修改企业微信门户首页banner图')" />
+    <th:block th:include="include :: cropbox-css" />
     <style>
         .bg-lg{
             width: 365px;
@@ -10,10 +11,28 @@
             color: black;
             text-align: center
         }
+        .thumbBox_L{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 730px;
+            height: 390px;
+            margin-left: -365px;
+            margin-top: -195px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .imageBox_L{
+            margin: 0 auto;
+            width: 800px;
+            height: 450px;
+        }
     </style>
 </head>
 <body class="white-bg">
-    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div1">
         <form class="form-horizontal m" id="form-banner-edit" th:object="${wxBanner}">
             <input name="bannerId" th:field="*{bannerId}" type="hidden">
 
@@ -47,31 +66,90 @@
             </div>
         </form>
     </div>
+
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">
+        <div class="imageBox imageBox_L" style="margin: 0 auto;">
+            <div class="thumbBox_L" ></div>
+            <div class="spinner" style="display: none">Loading...</div>
+        </div>
+        <div class="action" style="margin: 10px auto;">
+            <div class="new-contentarea tc">
+                <a href="javascript:void(0)" class="upload-img"> <label for="avatar">上传图像</label> </a>
+                <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+            </div>
+            <input type="button"  onclick="upBg()" class="btn-info Btnsty_peyton"  value="上传" />
+            <input type="button"  onclick="back()" class="btn-info Btnsty_peyton "  value="返回" />
+        </div>
+    </div>
+
     <th:block th:include="include :: footer" />
+    <th:block th:include="include :: cropbox-js" />
     <script type="text/javascript">
         var prefix = ctx + "wxportal/banner";
-        $("#form-banner-edit").validate({
-            focusCleanup: true
-        });
+        var imgUrl = '[[${imgUrl}]]';
+        var options = {
+            thumbBox: '.thumbBox_L',
+            spinner: '.spinner',
+            imgSrc: $.common.isEmpty(imgUrl) ? ctx + 'img/profile.jpg' : ctx +imgUrl
+        }
+        $(function(){
+            $("#form-banner-add").validate({
+                focusCleanup: true
+            });
+
+            cropper = $('.imageBox').cropbox(options);
+            $('#avatar').on('change', function() {
+                var reader = new FileReader();
+                reader.onload = function(e) {
+                    options.imgSrc = e.target.result;
+                    //根据MIME判断上传的文件是不是图片类型
+                    if((options.imgSrc).indexOf("image/")==-1){
+                        $.modal.alertWarning("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
+                    } else {
+                        cropper = $('.imageBox').cropbox(options);
+                    }
+                }
+                reader.readAsDataURL(this.files[0]);
+            })
+
+
+            $('#btnZoomIn').on('click', function(){
+                cropper.zoomIn();
+            })
+
+            $('#btnZoomOut').on('click', function(){
+                cropper.zoomOut();
+            })
+        })
+
+        function back() {
+            $("#div1").show();
+            $("#div2").hide();
+        }
+
 
 
 
         /*上传背景图片*/
         function imgUpload() {
-            var imgUrl = $("#input_imgUrl").val();
-            var options = {
-                title: "上传背景图像",
-                width: 900,
-                height: 650,
-                url:  prefix + '/imgUpload?imgUrl='+imgUrl,
-                btn:["上传","取消"],
-                callBack :upImg
-            };
-            $.modal.openOptions(options);
-        }
 
-        function upImg(index, layero) {
-            var img = window.frames[0].cropper.getBlob();
+            $("#div1").hide();
+            $("#div2").show();
+            var imgUrl =$("#input_imgUrl").val();
+            if(imgUrl==null||imgUrl==''){
+                imgUrl =  ctx + 'img/profile.jpg';
+            }else{
+                imgUrl = ctx+$("#input_imgUrl").val();
+            }
+            options = {
+                thumbBox: '.thumbBox_L',
+                spinner: '.spinner',
+                imgSrc:imgUrl
+            }
+            cropper = $('.imageBox').cropbox(options);
+        }
+        function upBg() {
+            var img =cropper.getBlob();
             var formdata = new FormData();
             formdata.append("file", img);
             $.ajax({
@@ -83,10 +161,12 @@
                 success: function(result) {
                     if(result.code==0){
                         $("#input_imgUrl").val(result.data.fileName);
-
                         $("#div-bgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
-                        layer.close(index);
+                        $("#div1").show();
+                        $("#div2").hide();
                     }else{
+                        $("#div1").show();
+                        $("#div2").hide();
                         $.modal.alertWarning(result.msg);
                     }
 

+ 139 - 20
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/add.html

@@ -2,6 +2,7 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
 	<th:block th:include="include :: header('新增磁贴')" />
+    <th:block th:include="include :: cropbox-css" />
     <style>
         .bg-sm{
             width: 124px;
@@ -24,10 +25,61 @@
             color: black;
             text-align: center
         }
+        .thumbBox_S{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 238px;
+            height: 218px;
+            margin-left: -119px;
+            margin-top: -109px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .thumbBox_M{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 360px;
+            height: 300px;
+            margin-left:-180px;
+            margin-top: -150px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .thumbBox_L{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 730px;
+            height: 320px;
+            margin-left: -365px;
+            margin-top: -160px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .imageBox_S{
+            margin: 0 auto;
+            width: 400px;
+        }
+        .imageBox_M{
+            margin: 0 auto;
+            width: 400px;
+        }
+        .imageBox_L{
+            margin: 0 auto;
+            width: 800px;
+        }
     </style>
 </head>
 <body class="white-bg">
-	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div1">
 		<form class="form-horizontal m" id="form-magnet-add">
 
 			<div class="form-group">
@@ -84,10 +136,33 @@
 			</div>
 		</form>
 	</div>
+
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">
+        <div  id="imageBox" >
+            <div id="thumbBox" ></div>
+            <div class="spinner" style="display: none">Loading...</div>
+        </div>
+        <div class="action" style="margin: 10px auto;">
+            <div class="new-contentarea tc">
+                <a href="javascript:void(0)" class="upload-img"> <label for="avatar">选择图片</label> </a>
+                <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+            </div>
+            <input type="button"  onclick="upBg()" class="btn-info Btnsty_peyton"  value="上传" />
+            <input type="button"  onclick="back()" class="btn-info Btnsty_peyton "  value="返回" />
+        </div>
+
+    </div>
 	<th:block th:include="include :: footer" />
+    <th:block th:include="include :: cropbox-js" />
     <script th:inline="javascript">
     var prefix = ctx + "wxportal/magnet";
-
+    var cropper;
+    var size = "S";
+    var options = {
+        thumbBox: '.thumbBox_'+size,
+        spinner: '.spinner',
+        imgSrc: ctx + 'img/profile.jpg'
+    }
     $(function(){
         //form校验
         $("#form-magnet-add").validate({
@@ -122,6 +197,32 @@
             },
             focusCleanup: true
         });
+
+
+        $('#avatar').on('change', function() {
+            var reader = new FileReader();
+            reader.onload = function(e) {
+                options.imgSrc = e.target.result;
+                //根据MIME判断上传的文件是不是图片类型
+                if((options.imgSrc).indexOf("image/")==-1){
+                    $.modal.alertWarning("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
+                } else {
+                    cropper = $('.imageBox').cropbox(options);
+                }
+            }
+            reader.readAsDataURL(this.files[0]);
+        })
+
+
+        $('#btnZoomIn').on('click', function(){
+            cropper.zoomIn();
+        })
+
+        $('#btnZoomOut').on('click', function(){
+            cropper.zoomOut();
+        })
+
+
         sizeChange();
     })
 
@@ -131,29 +232,33 @@
             $.operate.save(prefix + "/add", $('#form-magnet-add').serialize());
         }
     }
+    function back() {
+        $("#div1").show();
+        $("#div2").hide();
+    }
+
 
 
     /*上传背景图片*/
     function bgUpload() {
-        var size = $("#sel_magnetSize").val();
-        var bgUrl = $("#input_bgUrl").val();
-        var w = 500;
-        if(size=="L"){
-            w= 900;
+        $("#div1").hide();
+        $("#div2").show();
+        var imgUrl =$("#input_bgUrl").val();
+        if(imgUrl==null||imgUrl==''){
+            imgUrl =  ctx + 'img/profile.jpg';
+        }else{
+            imgUrl = ctx+$("#input_bgUrl").val();
+        }
+         options = {
+            thumbBox: '.thumbBox_'+size,
+            spinner: '.spinner',
+            imgSrc:imgUrl
         }
-        var options = {
-            title: "上传背景图像",
-            width: w,
-            height: 600,
-            url:  ctx + 'wxportal/magnet/bgUpload?size='+size+"&bgUrl="+bgUrl,
-            btn:["上传","取消"],
-            callBack :upBg
-        };
-        $.modal.openOptions(options);
+        cropper = $('.imageBox').cropbox(options);
     }
 
-    function upBg(index, layero) {
-        var img = window.frames[0].cropper.getBlob();
+    function upBg() {
+        var img = cropper.getBlob();
         var formdata = new FormData();
         formdata.append("file", img);
         $.ajax({
@@ -166,8 +271,11 @@
                 if(result.code==0){
                     $("#input_bgUrl").val(result.data.fileName);
                     $("#div-bgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
-                    layer.close(index);
+                    $("#div1").show();
+                    $("#div2").hide();
                 }else{
+                    $("#div1").show();
+                    $("#div2").hide();
                     $.modal.alertWarning(result.msg);
                 }
 
@@ -175,16 +283,27 @@
         })
     }
     function sizeChange(){
-        var size = $("#sel_magnetSize").val();
+        size = $("#sel_magnetSize").val();
         $("#div-bgUrl").removeClass("bg-sm");
         $("#div-bgUrl").removeClass("bg-md");
         $("#div-bgUrl").removeClass("bg-lg");
+        $("#imageBox").removeClass();
+        $("#thumbBox").removeClass();
         if(size=="l"||size=="L"){
             $("#div-bgUrl").addClass("bg-lg");
+            size = "L";
+            $("#imageBox").addClass("imageBox imageBox_L");
+            $("#thumbBox").addClass("thumbBox_L");
         }else if(size=="m"||size=="M"){
             $("#div-bgUrl").addClass("bg-md");
+            size = "M";
+            $("#imageBox").addClass("imageBox imageBox_M");
+            $("#thumbBox").addClass("thumbBox_M");
         }else if(size=="s"||size=="S"){
             $("#div-bgUrl").addClass("bg-sm");
+            size = "S";
+            $("#imageBox").addClass("imageBox imageBox_S");
+            $("#thumbBox").addClass("thumbBox_S");
         }
     }
 

+ 139 - 23
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/edit.html

@@ -2,6 +2,7 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
 	<th:block th:include="include :: header('修改磁贴')" />
+    <th:block th:include="include :: cropbox-css" />
     <style>
         .bg-sm{
             width: 124px;
@@ -24,10 +25,61 @@
             color: black;
             text-align: center
         }
+        .thumbBox_S{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 238px;
+            height: 218px;
+            margin-left: -119px;
+            margin-top: -109px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .thumbBox_M{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 360px;
+            height: 300px;
+            margin-left:-180px;
+            margin-top: -150px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .thumbBox_L{
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            width: 730px;
+            height: 320px;
+            margin-left: -365px;
+            margin-top: -160px;
+            box-sizing: border-box;
+            border: 1px solid rgb(102, 102, 102);
+            box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
+            background: none repeat scroll 0% 0% transparent;
+        }
+        .imageBox_S{
+            margin: 0 auto;
+            width: 400px;
+        }
+        .imageBox_M{
+            margin: 0 auto;
+            width: 400px;
+        }
+        .imageBox_L{
+            margin: 0 auto;
+            width: 800px;
+        }
     </style>
 </head>
 <body class="white-bg">
-	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div1">
         <form class="form-horizontal m" id="form-magnet-edit"  th:object="${wxMagnet}">
             <input type="hidden" name="magnetId" th:field="*{magnetId}">
             <div class="form-group">
@@ -85,10 +137,34 @@
                 </div>
             </div>
         </form>
+    </div>
+
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">
+        <div  id="imageBox" >
+            <div id="thumbBox" ></div>
+            <div class="spinner" style="display: none">Loading...</div>
+        </div>
+        <div class="action" style="margin: 10px auto;">
+            <div class="new-contentarea tc">
+                <a href="javascript:void(0)" class="upload-img"> <label for="avatar">选择图片</label> </a>
+                <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+            </div>
+            <input type="button"  onclick="upBg()" class="btn-info Btnsty_peyton"  value="上传" />
+            <input type="button"  onclick="back()" class="btn-info Btnsty_peyton "  value="返回" />
+        </div>
+
     </div>
 	<th:block th:include="include :: footer" />
+    <th:block th:include="include :: cropbox-js" />
 	 <script th:inline="javascript">
         var prefix = ctx + "wxportal/magnet";
+        var cropper;
+        var size = "S";
+        var options = {
+            thumbBox: '.thumbBox_'+size,
+            spinner: '.spinner',
+            imgSrc: ctx + 'img/profile.jpg'
+        }
         $(function() {
             $("#form-magnet-edit").validate({
                 onkeyup: false,
@@ -127,6 +203,30 @@
                 focusCleanup: true
             });
 
+            $('#avatar').on('change', function() {
+                var reader = new FileReader();
+                reader.onload = function(e) {
+                    options.imgSrc = e.target.result;
+                    //根据MIME判断上传的文件是不是图片类型
+                    if((options.imgSrc).indexOf("image/")==-1){
+                        $.modal.alertWarning("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
+                    } else {
+                        cropper = $('.imageBox').cropbox(options);
+                    }
+                }
+                reader.readAsDataURL(this.files[0]);
+            })
+
+
+            $('#btnZoomIn').on('click', function(){
+                cropper.zoomIn();
+            })
+
+            $('#btnZoomOut').on('click', function(){
+                cropper.zoomOut();
+            })
+
+
             sizeChange();
         });
         
@@ -136,29 +236,32 @@
 	        }
 	    }
 
+        function back() {
+            $("#div1").show();
+            $("#div2").hide();
+        }
+
         /*上传背景图片*/
         function bgUpload() {
-            var size = $("#sel_magnetSize").val();
-            var bgUrl = $("#input_bgUrl").val();
-            //bgUrl = bgUrl.substring(1,bgUrl.length);
-
-            var w = 500;
-            if(size=="L"){
-                w= 900;
+            $("#div1").hide();
+            $("#div2").show();
+            var imgUrl =$("#input_bgUrl").val();
+            if(imgUrl==null||imgUrl==''){
+                imgUrl =  ctx + 'img/profile.jpg';
+            }else{
+                imgUrl = ctx+$("#input_bgUrl").val();
+            }
+            debugger
+            options = {
+                thumbBox: '.thumbBox_'+size,
+                spinner: '.spinner',
+                imgSrc:imgUrl
             }
-            var options = {
-                title: "上传背景图像",
-                width: w,
-                height: 600,
-                url:  ctx + 'wxportal/magnet/bgUpload?size='+size+"&bgUrl="+bgUrl,
-                btn:["上传","取消"],
-                callBack :upBg
-            };
-            $.modal.openOptions(options);
+            cropper = $('.imageBox').cropbox(options);
         }
 
-        function upBg(index, layero) {
-            var img = window.frames[0].cropper.getBlob();
+        function upBg() {
+            var img = cropper.getBlob();
             var formdata = new FormData();
             formdata.append("file", img);
             $.ajax({
@@ -171,30 +274,43 @@
                     if(result.code==0){
                         $("#input_bgUrl").val(result.data.fileName);
                         $("#div-bgUrl").html("<img src='"+result.data.url+"' style='width;100%;height:100%;'>");
-                        layer.close(index);
+                        $("#div1").show();
+                        $("#div2").hide();
                     }else{
+                        $("#div1").show();
+                        $("#div2").hide();
                         $.modal.alertWarning(result.msg);
                     }
 
                 }
             })
         }
+
         function sizeChange(){
-            var size = $("#sel_magnetSize").val();
+            size = $("#sel_magnetSize").val();
             $("#div-bgUrl").removeClass("bg-sm");
             $("#div-bgUrl").removeClass("bg-md");
             $("#div-bgUrl").removeClass("bg-lg");
+            $("#imageBox").removeClass();
+            $("#thumbBox").removeClass();
             if(size=="l"||size=="L"){
                 $("#div-bgUrl").addClass("bg-lg");
+                size = "L";
+                $("#imageBox").addClass("imageBox imageBox_L");
+                $("#thumbBox").addClass("thumbBox_L");
             }else if(size=="m"||size=="M"){
                 $("#div-bgUrl").addClass("bg-md");
+                size = "M";
+                $("#imageBox").addClass("imageBox imageBox_M");
+                $("#thumbBox").addClass("thumbBox_M");
             }else if(size=="s"||size=="S"){
                 $("#div-bgUrl").addClass("bg-sm");
+                size = "S";
+                $("#imageBox").addClass("imageBox imageBox_S");
+                $("#thumbBox").addClass("thumbBox_S");
             }
         }
 
-
-
     </script>
 </body>
 </html>

+ 2 - 2
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/wxMagnet.html

@@ -159,13 +159,13 @@
 
 
         function addNew(){
-            $.modal.open("添加" + $.table._option.modalName, $.operate.addUrl(0),950,700);
+            $.modal.openFull("添加" + $.table._option.modalName, $.operate.addUrl(0));
 
         }
 
         function editMagnet(id){
 
-            $.modal.open("修改" + $.table._option.modalName, $.operate.editUrl(id),950,700);
+            $.modal.openFull("修改" + $.table._option.modalName, $.operate.editUrl(id));
 
         }
 	</script>