Przeglądaj źródła

前端样式调整,父节点可选择

蔡德晨 5 lat temu
rodzic
commit
450ebb2fc7

+ 87 - 32
src/main/java/com/jeeplus/common/bos/BOSClientUtil.java

@@ -10,13 +10,17 @@ import org.junit.Test;
 import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
 
 public class BOSClientUtil {
-    private final static String accessKey= Global.getConfig("bos_access_key");
-    private final static String secretKey= Global.getConfig("bos_secret_key");
-    private final static String endpoint= Global.getConfig("bos_endpoint");
-    private final static String bucketName= Global.getConfig("bos_buck_name");
-    private static BosClient bosClient;
+    private final  String accessKey= Global.getConfig("bos_access_key");
+    private final  String secretKey= Global.getConfig("bos_secret_key");
+    private final  String endpoint= Global.getConfig("bos_endpoint");
+    private final  String bucketName= Global.getConfig("bos_buck_name");
+    private final  String urlTem = "https://BUCKNAME.su.bcebos.comKEY";
+    private  BosClient bosClient;
+
 
     public BOSClientUtil() {
         BosClientConfiguration config = new BosClientConfiguration();
@@ -30,7 +34,7 @@ public class BOSClientUtil {
      * 获取BosClient对象
      * @return
      */
-    public static BosClient getBosClient() {
+    public  BosClient getBosClient() {
         BosClientConfiguration config = new BosClientConfiguration();
         config.setMaxConnections(10);
         config.setCredentials(new DefaultBceCredentials(accessKey, secretKey));
@@ -44,7 +48,7 @@ public class BOSClientUtil {
      * @param objectKey 文件路径/文件名(可以用“/”来创建多层文件夹)
      * @return
      */
-    public static PutObjectResponse uploadFileToBos(File file,
+    public  PutObjectResponse uploadFileToBos(File file,
                                                     String objectKey) {
         return bosClient.putObject(bucketName, objectKey, file);
     }
@@ -55,7 +59,7 @@ public class BOSClientUtil {
      * @param objectKey 文件路径/文件名(可以用“/”来创建多层文件夹)
      * @return
      */
-    public static PutObjectResponse uploadInputStreamToBos(InputStream inputStream,
+    public  PutObjectResponse uploadInputStreamToBos(InputStream inputStream,
                                                            String objectKey) {
         return bosClient.putObject(bucketName, objectKey, inputStream);
     }
@@ -67,7 +71,7 @@ public class BOSClientUtil {
      * @param objectKey  文件路径/文件名(可以用“/”来创建多层文件夹)
      * @return 上传成功后的tag
      */
-    public static void deleteObject(String objectKey) {
+    public  void deleteObject(String objectKey) {
         bosClient.deleteObject(bucketName, objectKey);
     }
 
@@ -77,45 +81,96 @@ public class BOSClientUtil {
      * @param objectKey           文件夹和文件名
      * @return 目标文件的下载url
      */
-    public static String generatePresignedUrl(String objectKey) {
+    public  String generatePresignedUrl(String objectKey) {
         URL url = bosClient.generatePresignedUrl(bucketName, objectKey, -1);
         return url.toString();
     }
 
 
-    public static String upload(String path,File file){
+    public  String upload(String path,File file){
         String objectKey = path+file.getName();
         bosClient.putObject(bucketName, objectKey, file);
-        URL url = bosClient.generatePresignedUrl(bucketName, objectKey, -1);
-        return url.toString();
+        String url = urlTem.replace("BUCKNAME",bucketName).replace("KEY",objectKey);
+//        URL url = bosClient.generatePresignedUrl(bucketName, objectKey, -1);
+        return url;
     }
 
-    public static String upload(String path,InputStream inputStream){
-        String objectKey = path;
-        bosClient.putObject(bucketName, objectKey, inputStream);
-        URL url = bosClient.generatePresignedUrl(bucketName, objectKey, -1);
-        return url.toString();
+    public  String upload(String path,InputStream inputStream){
+        bosClient.putObject(bucketName, path, inputStream);
+        String url = urlTem.replace("BUCKNAME",bucketName).replace("KEY",path);
+//        URL url = bosClient.generatePresignedUrl(bucketName, objectKey, -1);
+        return url;
     }
 
+//    @Test
+//    public void testPut(){
+//        File file = new File("E:/bk1.png");
+//        String name = file.getName();
+//        BOSClientUtil.uploadFileToBos(file,"/test/"+name);
+//    }
+//
+//
+//    @Test
+//    public void testDel(){
+//        BOSClientUtil.deleteObject("/test/1.txt");
+//    }
+//
+//    @Test
+//    public void testUrl(){
+//        File file = new File("E:/bk1.png");
+//        String upload = BOSClientUtil.upload("/text1/", file);
+//        System.out.println(upload);
+//    }
+
     @Test
-    public void testPut(){
-        File file = new File("E:/bk1.png");
-        String name = file.getName();
-        BOSClientUtil.uploadFileToBos(file,"/test/"+name);
+    public void uploadAll(){
+        ArrayList<String> listFileName = new ArrayList<String>();
+        String filePath = "D:/IDEA workspace/total_process/src/main/webapp/static/";
+       getAllFileName(filePath,listFileName);
+       int count = 1;
+       int total = listFileName.size();
+       System.out.println(total);
+     for(String name : listFileName){
+           if(name != null) {
+               int statice = name.indexOf("static");
+               String name1 = name.substring(statice + 6, name.length());
+               File file = new File(name);
+//               System.out.println("/static"+name1);
+               bosClient.putObject(bucketName, "/static"+name1, file);
+//               BOSClientUtil.upload("/static"+name1,file);
+               System.out.println("---------正在上传   "+file.getName()+"-------");
+               System.out.println("上传第"+count+"个资源,共"+total+"个资源");
+               count++;
+//               try {
+//                   bosClient.deleteObject(bucketName, " /static" + name1);
+//               }catch (Exception e){
+//                   e.printStackTrace();
+//               }
+           }
+       }
     }
 
 
-    @Test
-    public void testDel(){
-        BOSClientUtil.deleteObject("/test/1.txt");
-    }
+public  void getAllFileName(String path, ArrayList<String> listFileName){
+     File file = new File(path);
+     File [] files = file.listFiles();
+    String [] names = file.list();
+    if(names != null){
+    String [] completNames = new String[names.length];
+   for(int i=0;i<names.length;i++){
+       if(files[i].isFile()) {
+           completNames[i] = path + names[i];
+       }
+   }
+   listFileName.addAll(Arrays.asList(completNames));
+  }
+  for(File a:files){
+    if(a.isDirectory()){//如果文件夹下有子文件夹,获取子文件夹下的所有文件全路径。
+           getAllFileName(a.getAbsolutePath().replaceAll("\\\\","/")+"/",listFileName);
+  }
+ }
+ }
 
-    @Test
-    public void testUrl(){
-        File file = new File("E:/bk1.png");
-        String upload = BOSClientUtil.upload("/text1/", file);
-        System.out.println(upload);
-    }
 
 
 }

+ 28 - 23
src/main/webapp/static/common/css/style.css

@@ -89,7 +89,9 @@ label{
 
 .navbar-default .nav > li > a:hover,
 .navbar-default .nav > li > a:focus {
-    /*background-color: #293846;*/background-color: #3ca0ec;
+    /*background-color: #293846;*/
+    background-color: #3ca0ec;
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
     color: white;
 }
 .skin-1
@@ -272,7 +274,8 @@ body.mini-navbar .nav li a{
 }
 
 .nav-item-bg{
-    background-color: #3ca0ec;
+    background: #3ca0ec;
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
     color:#ffffff;
 }
 .nav-item2-bg{
@@ -492,7 +495,9 @@ body.mini-navbar .navbar-default .nav > li > .nav-second-level li a {
 
 .navbar-fixed-top,
 .navbar-static-top {
-    /*background: #f3f3f4;*/ background: #0f92fb;
+    /*background: #f3f3f4;*/
+    background: #0f92fb;
+    background: linear-gradient(to bottom right,#1ebbe2, #72dbf5);
     /*height:70px;*/
     height: 55px;
 }
@@ -8593,43 +8598,43 @@ th .layui-table-cell{
 
 #schedule-bord .bord-left{
     background:#91d7e9; /* 一些不支持背景渐变的浏览器 */
-    background: -ms-linear-gradient(left,#91d7e9,#59c0da);
+    background: -ms-linear-gradient(left,#d00912,#f46703);
     filter:alpha(opacity=100 finishopacity=100 style=1 startx=0,starty=0,finishx=200,finishy=0) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#91d7e9,endcolorstr=#59c0da,gradientType=1);
-    background:-moz-linear-gradient(left,  #91d7e9, #59c0da);
-    background:-webkit-gradient(linear, left top, right top, from(#91d7e9), to(#59c0da));
-    background:-o-linear-gradient(left, #91d7e9, #59c0da);
-    background: linear-gradient(to right,#91d7e9, #59c0da);
+    background:-moz-linear-gradient(left,  #d00912, #f46703);
+    background:-webkit-gradient(linear, left top, right top, from(#d00912), to(#f46703));
+    background:-o-linear-gradient(left, #d00912, #f46703);
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
 
 }
 #notify-bord .bord-left{
     background: #86cf9f; /* 一些不支持背景渐变的浏览器 */
-    background: -ms-linear-gradient(left,#86cf9f,#6ebf6e);
+    background: -ms-linear-gradient(left,#058832,#6ebf6e);
     filter:alpha(opacity=100 finishopacity=100 style=1 startx=0,starty=0,finishx=200,finishy=0) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#86cf9f,endcolorstr=#6ebf6e,gradientType=1);
-    background:-moz-linear-gradient(left, #86cf9f, #6ebf6e);
-    background:-webkit-gradient(linear, left top, right top, from(#86cf9f), to(#6ebf6e));
-    background:-o-linear-gradient(left, #86cf9f, #6ebf6e);
-    background: linear-gradient(to right,#86cf9f, #6ebf6e);
+    background:-moz-linear-gradient(left, #058832, #6ebf6e);
+    background:-webkit-gradient(linear, left top, right top, from(#058832), to(#6ebf6e));
+    background:-o-linear-gradient(left, #058832, #6ebf6e);
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
 
 }
 #msg-bord .bord-left{
     background:#e49de0; /* 一些不支持背景渐变的浏览器 */
-    background: -ms-linear-gradient(left,#e49de0,#a488e4);
+    background: -ms-linear-gradient(left,#011180,#01c3ba);
     filter:alpha(opacity=100 finishopacity=100 style=1 startx=0,starty=0,finishx=200,finishy=0) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#e49de0,endcolorstr=#a488e4,gradientType=1);
-    background:-moz-linear-gradient(left,  #e49de0, #a488e4);
-    background:-webkit-gradient(linear, left top, right top, from(#e49de0), to(#a488e4));
-    background:-o-linear-gradient(left, #e49de0, #a488e4);
-    background: linear-gradient(to right,#e49de0, #a488e4);
+    background:-moz-linear-gradient(left,  #011180, #01c3ba);
+    background:-webkit-gradient(linear, left top, right top, from(#011180), to(#01c3ba));
+    background:-o-linear-gradient(left, #011180, #01c3ba);
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
 
 }
 #email-bord .bord-left,
 #statistics-bord .bord-left{
     background:#dada6a; /* 一些不支持背景渐变的浏览器 */
-    background: -ms-linear-gradient(left,#dada6a,#dbbc66);
+    background: -ms-linear-gradient(left,#824800,#f1c240);
     filter:alpha(opacity=100 finishopacity=100 style=1 startx=0,starty=0,finishx=200,finishy=0) progid:DXImageTransform.Microsoft.gradient(startcolorstr=#dada6a,endcolorstr=#dbbc66,gradientType=1);
-    background:-moz-linear-gradient(left,  #dada6a, #dbbc66);
-    background:-webkit-gradient(linear, left top, right top, from(#dada6a), to(#dbbc66));
-    background:-o-linear-gradient(left, #dada6a, #dbbc66);
-    background: linear-gradient(to right,#dada6a, #dbbc66);
+    background:-moz-linear-gradient(left,  #824800, #dbbc66);
+    background:-webkit-gradient(linear, left top, right top, from(#824800), to(#f1c240));
+    background:-o-linear-gradient(left, #824800, #f1c240);
+    background: linear-gradient(to right,#1ebbe2, #72dbf5);
 
 }
 .bord-more{

+ 1 - 1
src/main/webapp/webpage/modules/projectrecord/projectRecordsForm.jsp

@@ -459,7 +459,7 @@
                     <label class="layui-form-label">项目所在地:</label>
                     <div class="layui-input-block  with-icon">
                         <sys:treeselect id="area" name="area.id" value="${projectRecords.area.id}" labelName="area.name" labelValue="${projectRecords.area.name}"
-                                        title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                        title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">

+ 1 - 1
src/main/webapp/webpage/modules/workclientinfo/workClientInfoForm.jsp

@@ -395,7 +395,7 @@
                         <sys:treeselect id="area" name="area.id" value="${workClientInfo.area.id}" labelName="area.name"
                                         labelValue="${workClientInfo.area.name}"
                                         title="区域" url="/sys/area/treeData" cssClass="form-control required layui-input"
-                                        allowClear="true" notAllowSelectParent="true"/>
+                                        allowClear="true" notAllowSelectParent="false"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">