Преглед изворни кода

修改管理后台样式,计划替换成iframe

slambb пре 4 година
родитељ
комит
4abd5aa1ba

+ 70 - 1
src/main/java/com/YuyeTech/TPlat/controller/BackstageLevelController.java

@@ -9,6 +9,7 @@ import com.YuyeTech.TPlat.exception.UserException;
 import com.YuyeTech.TPlat.service.*;
 import com.YuyeTech.TPlat.utils.RSAUtils;
 import com.YuyeTech.TPlat.utils.ResultVOUtil;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.HttpServletRequest;
 import java.security.NoSuchAlgorithmException;
 import java.security.spec.InvalidKeySpecException;
 import java.util.*;
@@ -56,7 +58,9 @@ public class BackstageLevelController {
     public ModelAndView getLevelJumpList(
             @RequestParam(value = "numberType",defaultValue = "1") Integer numberType,
             Map<String, Object> map) {
-        map.put("list",levelJumpService.findLevelJumpDTOsByNumberType(numberType, Sort.Direction.ASC));
+             // map.put("list",levelJumpService.findLevelJumpsByNumberType(numberType, Sort.Direction.ASC));
+        List<LevelJump> levelJumps = levelJumpService.findLevelJumpsAll();
+        map.put("list",levelJumps);
         return new ModelAndView("/app/level", map);
     }
 
@@ -78,6 +82,71 @@ public class BackstageLevelController {
         //通过关卡获得荣誉
         List<LevelHonor> levelHonor = levelJumpService.findAllLevelHonor();
         map.put("levelHonor",levelHonor);
+        // 0:随便生成一组跳的数据
+        // 1:生成一组 左跳右跳
+        // 2:生成一组 左跳右跳原地
+        // 3:生成一组 左旋跳右旋跳
+        // 4:生成一组 左旋跳右旋跳
+        // 5:随便生成三组数据
+        String[] signNames = new String[]{
+                "随便生成一组跳的数据",
+                "生成一组 左跳右跳",
+                "生成一组 左跳右跳原地",
+                "生成一组 左旋跳右旋跳",
+                "生成一组 左旋跳右旋跳",
+                "随便生成三组数据"
+        };
+        List<Map> signTypeMap = new ArrayList<>();
+        for (int i=0;i<signNames.length;i++){
+            Map signTypes = new HashMap();
+            signTypes.put("value",i+"");
+            signTypes.put("name",signNames[i]);
+            signTypeMap.add(signTypes);
+        }
+        map.put("signTypeMap",signTypeMap);
+        return new ModelAndView("/app/level-detail", map);
+    }
+
+    @GetMapping("/detailItem")
+    public ModelAndView detailItem(
+            @RequestParam(value = "levelId") Integer levelId,
+            HttpServletRequest req,
+            Map<String, Object> map) {
+        LevelJump levelJump = levelJumpService.findById(levelId);
+        map.put("levelJump", levelJump);
+        //获取当前的解锁条件
+        List<Integer> conditionUnlockList = Pattern.compile(",").splitAsStream(levelJump.getConditionUnlock()).map((x) -> Integer.parseInt(x))
+                .collect(Collectors.toList());
+        map.put("unlockList",conditionUnlockList);
+        //通过关卡条件
+        List<LevelCondition> levelCondition = levelJumpService.findAllLevelCondition();
+        //解锁条件
+        map.put("levelCondition",levelCondition);
+        //通过关卡获得荣誉
+        List<LevelHonor> levelHonor = levelJumpService.findAllLevelHonor();
+        map.put("levelHonor",levelHonor);
+        // 0:随便生成一组跳的数据
+        // 1:生成一组 左跳右跳
+        // 2:生成一组 左跳右跳原地
+        // 3:生成一组 左旋跳右旋跳
+        // 4:生成一组 左旋跳右旋跳
+        // 5:随便生成三组数据
+        String[] signNames = new String[]{
+                "随便生成一组跳的数据",
+                "生成一组 左跳右跳",
+                "生成一组 左跳右跳原地",
+                "生成一组 左旋跳右旋跳",
+                "生成一组 左旋跳右旋跳",
+                "随便生成三组数据"
+        };
+        List<Map> signTypeMap = new ArrayList<>();
+        for (int i=0;i<signNames.length;i++){
+            Map signTypes = new HashMap();
+            signTypes.put("value",i+"");
+            signTypes.put("name",signNames[i]);
+            signTypeMap.add(signTypes);
+        }
+        map.put("signTypeMap",signTypeMap);
         return new ModelAndView("/app/level-detail", map);
     }
 

+ 21 - 0
src/main/java/com/YuyeTech/TPlat/controller/BackstageManagerController.java

@@ -154,4 +154,25 @@ public class BackstageManagerController {
         map.put("url", "/backstage_user/list");
         return new ModelAndView("common/success", map);
     }
+
+
+    /**
+     * 作为后台入口index
+     * @param request
+     * @param map
+     * @return
+     */
+    @GetMapping("/index")
+    public ModelAndView AdminLoginIndex(
+            HttpServletRequest request,
+            Map<String, Object> map) {
+
+        String url = "http://" + request.getServerName() //服务器地址
+                + ":"
+                + request.getServerPort()           //端口号
+                + request.getRequestURI();
+        log.info("后台入口:adminLogin url={}", url);
+
+        return new ModelAndView("index", map);
+    }
 }

+ 2 - 1
src/main/java/com/YuyeTech/TPlat/controller/LevelController.java

@@ -12,6 +12,7 @@ import com.YuyeTech.TPlat.utils.ResultVOUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.domain.Sort;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -198,7 +199,7 @@ public class LevelController {
             List<Map> _unlockMapList = new ArrayList<>();
             //单人条件下判断上一关一个条件
             if (numberType.equals(1)) {
-                List<LevelJump> levelJumpList = levelJumpService.findLevelJumpsByNumberType(numberType);
+                List<LevelJump> levelJumpList = levelJumpService.findLevelJumpsByNumberType(numberType, Sort.Direction.ASC);
                 for (int i = 0; i < levelJumpList.size(); i++) {
                     curLevelJump = levelJumpList.get(i);
                     if (curLevelJump.getId().equals(eventId)) {

+ 10 - 10
src/main/java/com/YuyeTech/TPlat/dataobject/LevelJump.java

@@ -20,23 +20,23 @@ public class LevelJump {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Integer id;
-    private String name;
-    private String describe;
-    private Integer rewardGold;
-    private Integer rewardDiamond;
+    private String name;//关卡名字
+    private String describe;//关卡描述
+    private Integer rewardGold;//奖励金币
+    private Integer rewardDiamond;//奖励钻石
     private Integer rewardHonor;//过关荣誉
-    private Integer consumeGold;
-    private Integer consumeDiamond;
-    private Integer signCount;
-    private String signType;
-    private Integer limitTime;
+    private Integer consumeGold;//消耗金币
+    private Integer consumeDiamond;//消耗钻石
+    private Integer signCount;//标志块的总数
+    private String signType;//标志块的种类
+    private Integer limitTime;//限时(秒),0-不限时
     /** 解锁条件类型. */
     private String conditionUnlock;
     /** 通过关卡时候的类型. */
     private Integer conditionPassed;
     /** 补充说明 */
     private String explain;
-    /** 人数类型 1单人 */
+    /** 人数类型 1单人 2pk*/
     private Integer numberType;
     /** 顺序设计,和number type 一起使用。用于游戏排序 */
     private Integer sort;

+ 3 - 1
src/main/java/com/YuyeTech/TPlat/service/LevelJumpService.java

@@ -17,12 +17,14 @@ import java.util.Map;
  */
 public interface LevelJumpService {
 
-    List<LevelJump> findLevelJumpsByNumberType(Integer numberType);
+    List<LevelJump> findLevelJumpsByNumberType(Integer numberType, Sort.Direction direction);
 
     List<LevelJumpDTO> findLevelJumpDTOsByNumberType(Integer numberType, Sort.Direction direction);
 
     Map  findLevelJumpsAll(String userId);
 
+    List<LevelJump> findLevelJumpsAll();
+
     LevelJump findById(Integer id);
 
     //查询全部条件,包括解锁和通关

+ 7 - 2
src/main/java/com/YuyeTech/TPlat/service/impl/LevelJumpServiceImpl.java

@@ -34,8 +34,13 @@ public class LevelJumpServiceImpl implements LevelJumpService {
     private UserLevelRepository userLevelRepository;
 
     @Override
-    public List<LevelJump> findLevelJumpsByNumberType(Integer numberType) {
-        return  levelJumpRepository.findAllByNumberType(numberType, Sort.by(Sort.Direction.ASC,"sort"));
+    public List<LevelJump> findLevelJumpsByNumberType(Integer numberType,Sort.Direction direction) {
+        return  levelJumpRepository.findAllByNumberType(numberType, Sort.by(direction,"sort"));
+    }
+
+    @Override
+    public List<LevelJump> findLevelJumpsAll() {
+        return levelJumpRepository.findAll();
     }
 
     @Override

+ 1 - 2
src/main/resources/application.yml

@@ -45,8 +45,7 @@ spring:
             enable: true
             required: true
     port: 465
-  thymeleaf:
-    cache: false
+
 
 #url 前缀
 server:

+ 244 - 0
src/main/resources/static/js/iframe/iframe.js

@@ -0,0 +1,244 @@
+//iframe.js
+(function ($, window, document, undefined) {
+    'use strict';
+
+    var pluginName = 'iframes';
+    var thisElement = '';
+    var height = '500px';//以这种形式出现的iframe,必须设置高度,不能设置100%
+    //入口方法
+    $.fn[pluginName] = function (options) {
+        var self = $(this);
+        thisElement = self;
+        if (this == null)
+            return null;
+        var data = this.data(pluginName);
+        if (!data) {
+            data = new BaseIframe(this, options);
+            self.data(pluginName, data);
+        }
+        return data;
+    };
+
+
+    var BaseIframe = function (element, options) {
+        this.$element = $(element);
+        this.options = $.extend(true, {}, this.default, options);
+        this.init();
+    }
+
+    //默认配置
+    BaseIframe.prototype.default = {
+        showIndex: 0, //默认显示页索引
+        loadAll: false//true=一次全部加在页面,false=只加在showIndex指定的页面,其他点击时加载,提高响应速度
+    }
+
+    //结构模板
+    BaseIframe.prototype.template = {
+        div_tabs: '<div class="row content-tabs"></div>',
+        nav_menuTabs: '<nav class="page-tabs J_menuTabs"></nav>',
+        nav_a: '<a href="javascript:;" class="J_menuTab" data-id="{0}" data-index="{1}" name="{2}">{3}</a>',//这里不能用id,id会追加代码到a标签内
+        div_content: '<div class="page-tabs-content" id="page-tabs"></div>',
+        div_iframe: '<div class="row J_mainContent" id="content-tabs"></div>',
+        iframe: '<iframe class="J_iframe" name="{0}" data-index="{1}" width="100%" height="{2}" src="{3}" frameborder="0" data-id="{4}" seamless style="display: none;"></iframe>',
+        a_close: '<i class="fa fa-remove" title="关闭" data-id="{0}"></i>'
+    }
+
+    //初始化
+    BaseIframe.prototype.init = function () {
+        if (!this.options.data || this.options.data.length == 0) {
+            console.error("请指定tab页数据");
+            return;
+        }
+        //当前显示的显示的页面是否超出索引
+        if (this.options.showIndex < 0 || this.options.showIndex > this.options.data.length - 1) {
+            console.error("showIndex超出了范围");
+            //指定为默认值
+            this.options.showIndex = this.default.showIndex;
+        }
+        if(this.options.height){
+            height = this.options.height;
+        }
+        //清除原来的tab页
+        this.$element.html("");
+        this.builder(this.options.data);
+    }
+
+    //使用模板搭建页面结构
+    BaseIframe.prototype.builder = function (data) {
+        var div_tabs = $(this.template.div_tabs);
+        var nav_menuTabs = $(this.template.nav_menuTabs);
+        var div_content = $(this.template.div_content);
+
+        var div_iframe = $(this.template.div_iframe);
+        for (var i = 0; i < data.length; i++) {
+            //nav-tab
+            var nav_a = $(this.template.nav_a.format(data[i].url,i,data[i].id ,data[i].text));
+            //如果可关闭,插入关闭图标,并绑定关闭事件
+            if (data[i].closeable) {
+                var a_close = $(this.template.a_close.format(data[i].id));
+
+                nav_a.append(" ");
+                nav_a.append(a_close);
+            }
+
+            div_content.append(nav_a);
+
+
+        }
+        nav_menuTabs.append(div_content);
+        div_tabs.append(nav_menuTabs);
+        this.$element.append(div_tabs);
+        this.$element.append(div_iframe);
+        this.loadData();
+    }
+
+    /**
+     * 添加Iframe
+     * */
+    BaseIframe.prototype.openIframe = function(dataUrl,menuName,dataIndex){
+        //console.log("openiframe",this);
+        // 获取标识数据
+        var flag = true;
+        if (dataUrl == undefined || $.trim(dataUrl).length == 0)return false;
+        thisElement.find("#content-tabs iframe").each(function(){
+            //console.log('id',$(this).data('id'));
+            //console.log('url',dataUrl);
+            if($(this).data('id') == dataUrl){
+
+                flag = false;
+            }
+        });
+
+
+        if(flag){
+
+            var iframe = $(this.template.iframe.format(menuName,dataIndex,height,dataUrl,dataUrl));
+
+            thisElement.find("#content-tabs").append(iframe);
+        }
+        BaseIframe.prototype.hidden_a(menuName);
+        return false;
+    }
+
+    /**加载数据*/
+    BaseIframe.prototype.loadData = function () {
+        var data = this.options.data;
+        //如果是当前页或者配置了一次性全部加载,否则点击tab页时加载
+        for (var i = 0; i < data.length; i++) {
+            if (this.options.loadAll || this.options.showIndex == i) {
+                if (data[i].url) {
+                    // 添加iframe
+                    var iframe = $(this.template.iframe.format(data[i].id,i,height,data[i].url,data[i].url));
+                    this.$element.find("#content-tabs").append(iframe);
+                } else {
+                    console.error("id=" + data[i].id + "的iframe页未指定url");
+                }
+            }
+        }
+        //console.log("this++",this);
+        //console.log("thisdafult++",BaseIframe.prototype.default);
+        if(data.length > 1){
+            this.$element.find("#content-tabs iframe").eq(this.options.showIndex).css("display","inline");
+            this.$element.find('#page-tabs a').eq(this.options.showIndex).addClass('active');
+        }else{
+            this.$element.find("#content-tabs iframe").eq(0).css("display","inline");
+            this.$element.find('#page-tabs a').eq(0).addClass('active');
+        }
+        //绑定事件
+        BaseIframe.prototype.eventses();
+        //$("#content-tabs iframe").css("height",height);
+        //console.log(thisElement.attr('id'));
+        //console.log(thisElement.html());
+    }
+
+    /**点击事件*/
+    BaseIframe.prototype.eventses = function () {
+        //console.log("thisElement",thisElement);
+        thisElement.find("#page-tabs a i").each(function(){
+            $(this).click(function(){
+                var id = $(this).data('id');
+                //console.log('ad0',id);
+                BaseIframe.prototype.remove(id);
+            });
+        });
+        thisElement.find("#page-tabs a").click(function(){
+            //console.log("点击a: ",this);
+            var dataUrl = $(this).data('id');
+            var menuName = $(this).text();
+            var name = $(this).attr('name');
+            var dataIndex = $(this).data('index');;
+            BaseIframe.prototype.openIframe(dataUrl,name,dataIndex);
+        });
+
+    }
+
+    //新增一个Iframe页
+    BaseIframe.prototype.addIframe = function (obj) {
+        var nav_a = $(this.template.nav_a.format(obj.url,$('#page-tabs a').length,obj.id ,obj.text));
+        //如果可关闭,插入关闭图标,并绑定关闭事件
+        if (obj.closeable) {
+            var a_close = $(this.template.a_close.format(obj.id));
+
+            nav_a.append(" ");
+            nav_a.append(a_close);
+        }
+
+        thisElement.find("#page-tabs").append(nav_a);
+
+        BaseIframe.prototype.eventses();
+    }
+
+    /**隐藏其他的,显示当前*/
+    BaseIframe.prototype.hidden_a = function(obj){
+        thisElement.find('#page-tabs a').each(function(){
+            $(this).removeClass('active');
+        });
+        thisElement.find('#content-tabs iframe').each(function(){
+            $(this).css("display","none");
+        });
+        thisElement.find("iframe[name='"+obj+"']").css("display","inline");
+        thisElement.find("a[name='"+obj+"']").addClass('active');
+        //console.log("height",height);
+        //thisElement.find("#content-tabs iframe").css("height",height);
+    }
+
+    //根据id获取活动也标签名
+    BaseIframe.prototype.find=function (tabId) {
+        return this.$element.find(".nav-tabs li a[href='#" + tabId + "']").text();
+    }
+
+    // 删除活动页
+    BaseIframe.prototype.remove=function (obj) {
+        thisElement.find("#content-tabs iframe[name='"+obj+"']").remove();
+        thisElement.find("#page-tabs a[name='"+obj+"']").remove();
+        thisElement.find('#page-tabs a').eq(0).addClass('active');
+        thisElement.find("#content-tabs iframe").eq(0).css("display","inline");
+        if(thisElement.find('#page-tabs a').length > 0){
+            var a = thisElement.find('#page-tabs a').eq(0);//找到第一个a标签取出数据
+            this.openIframe(a.data('id'),a.attr('name'),a.data('index'));
+        }
+    }
+
+    //根据id设置活动iframe页
+    BaseIframe.prototype.showIframe=function (tabId) {
+        var a = thisElement.find("#page-tabs a[name='" + tabId + "']");//找到a标签
+        //console.log("a标签",a);
+        var dataUrl = a.data('id');
+        var dataIndex = a.data('index');;
+        BaseIframe.prototype.openIframe(dataUrl,tabId,dataIndex);
+    }
+
+    //获取当前活动iframe页的ID
+    BaseIframe.prototype.getCurrentIframeId=function () {
+        var id=thisElement.find("#page-tabs .active a").attr("name");
+        console.log('id',id);
+        return id;
+    }
+
+    String.prototype.format = function () {
+        if (arguments.length == 0) return this;
+        for (var s = this, i = 0; i < arguments.length; i++)
+            s = s.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
+        return s;
+    };
+})(jQuery, window, document)

+ 152 - 68
src/main/resources/templates/app/level-detail.ftl

@@ -13,8 +13,8 @@
 
 
 </head>
-
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<#--offcanvas-active-->
+<body class="font-opensans sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">
@@ -41,90 +41,174 @@
         <div class="section-body">
             <div class="container-fluid">
                 <div class="row clearfix">
-                    <div class="col-md-12">
+                    <div class="col-md-10">
                         <div class="card">
                             <div class="card-body">
                                 <form name="formBasic" id="formBasic" role="form" method="post"
                                       enctype="multipart/form-data"
                                       action="">
-                                    <div class="form-group">
-                                        <label>关卡名称</label>
-                                        <input name="levelName" type="text" placeholder="输入关卡名称" class="form-control"
-                                               value="${(levelJump.name)!''}"/>
-                                    </div>
 
-                                    <div class="form-group">
-                                        <label>通过关卡的条件</label>
-                                        <select name="conditionPassed" class="form-control">
-                                            <#list levelCondition as conditionPassed>
-                                                <#if  conditionPassed.type == 1>
-                                                    <option  value="${conditionPassed.id}"
-                                                            <#if (levelJump.conditionPassed)?? && levelJump.conditionPassed == conditionPassed.limitType>
-                                                                selected
-                                                            </#if>
-                                                    >${conditionPassed.explain}
-                                                    </option>
-                                                </#if>
-                                            </#list>
-                                        </select>
-                                    </div>
-                                    <div class="form-group">
-                                        <label>解锁关卡的条件</label>
-                                        <select name="conditionPassed" class="form-control">
-                                            <#list levelCondition as conditionPassed>
-                                                <#if  conditionPassed.type == 0>
-                                                    <option  value="${conditionPassed.id}"
-                                                            <#if (levelJump.conditionPassed)?? && levelJump.conditionPassed == conditionPassed.limitType>
-                                                                selected
-                                                            </#if>
-                                                    >${conditionPassed.explain}
-                                                    </option>
-                                                </#if>
-                                            </#list>
-                                        </select>
-                                    </div>
-                                    <div class="form-group">
-                                        <label>解锁条件(可多选)</label>
-                                        <br/>
-                                        <div class="form-group multiselect_div">
-                                            <select id="multiselect-color2" name="multiselectUnlock" class="multiselect multiselect-custom" multiple="multiple">
+                                        <div class="form-group">
+                                            <label>关卡名称</label>
+                                            <input name="levelName" type="text" placeholder="输入关卡名称" class="form-control"
+                                                   value="${(levelJump.name)!''}"/>
+                                        </div>
+                                        <div class="form-group">
+                                            <label class="form-label">关卡简介</label>
+                                            <textarea name="levelDescribe" class="form-control" rows="5">${(levelJump.describe)!''}</textarea>
+                                        </div>
+                                        <div class="row">
+                                            <div class="col-sm-6 col-md-6">
+                                                <div class="form-group">
+                                                    <label class="form-label">奖励金币</label>
+                                                    <input name="levelRewardGold" type="number" placeholder="输入奖励金币" class="form-control"
+                                                           value="${(levelJump.rewardGold)!''}"/>
+                                                </div>
+                                            </div>
+                                            <div class="col-sm-6 col-md-6">
+                                                <div class="form-group">
+                                                    <label class="form-label">奖励钻石</label>
+                                                    <input name="levelRewardDiamond" type="number" placeholder="输入奖励钻石" class="form-control"
+                                                           value="${(levelJump.rewardDiamond)!''}"/>
+                                                </div>
+                                            </div>
+                                        </div>
+                                        <div class="row">
+                                            <div class="col-sm-6 col-md-6">
+                                                <div class="form-group">
+                                                    <label class="form-label">关卡消耗金币</label>
+                                                    <input name="levelConsumeGold" type="number" placeholder="输入奖励金币" class="form-control"
+                                                           value="${(levelJump.consumeGold)!''}"/>
+                                                </div>
+                                            </div>
+                                            <div class="col-sm-6 col-md-6">
+                                                <div class="form-group">
+                                                    <label class="form-label">关卡消耗钻石</label>
+                                                    <input name="levelConsumeDiamond" type="number" placeholder="输入奖励钻石" class="form-control"
+                                                           value="${(levelJump.consumeDiamond)!''}"/>
+                                                </div>
+                                            </div>
+                                        </div>
+
+                                        <div class="form-group">
+                                            <label class="form-label">奖励荣誉</label>
+                                            <div class="selectgroup selectgroup-pills">
                                                 <#list levelHonor as honor>
-                                                    <option value="${honor.name}">${honor.name}
-                                                    </option>
+                                                    <label class="selectgroup-item">
+                                                        <input type="radio" name="honor-radio" value="${honor.id}" class="selectgroup-input"
+                                                                <#if (levelJump.rewardHonor)?? && levelJump.rewardHonor == honor.type>
+                                                            checked = ""
+                                                                </#if>>
+                                                        <span class="selectgroup-button">${honor.name}</span>
+                                                    </label>
                                                 </#list>
 
-                                            </select>
+                                            </div>
+                                        </div>
+                                    <div class="col-sm-6 col-md-6">
+                                        <div class="form-group">
+                                            <label class="form-label">生成标志块总数,就是关卡预制数量</label>
+                                            <input name="levelSignCount" type="number" placeholder="输入标志块总数" class="form-control"
+                                                   value="${(levelJump.signCount)!''}"/>
                                         </div>
                                     </div>
-
                                     <div class="form-group">
-                                        <label>荣誉奖励</label>
-                                        <select name="conditionPassed" class="form-control">
-                                            <#list levelHonor as honor>
-                                                    <option  value="${honor.id}"
-                                                            <#if (levelJump.rewardHonor)?? && levelJump.rewardHonor == honor.type>
-                                                                selected
+                                        <label class="form-label">标志块的种类</label>
+                                        <div class="selectgroup selectgroup-pills">
+                                            <#list signTypeMap as signType>
+                                                <label class="selectgroup-item">
+                                                    <input type="radio" name="levelSignType" value="${signType.value}" class="selectgroup-input"
+                                                            <#if (levelJump.signType)?? && levelJump.signType == signType.value>
+                                                                checked = ""
                                                             </#if>
-                                                    >${honor.name}
-                                                    </option>
+                                                           >
+                                                    <span class="selectgroup-button">${signType.name}</span>
+                                                </label>
                                             </#list>
-                                        </select>
+
+                                        </div>
                                     </div>
 
+                                    <div class="row">
+                                        <div class="col-sm-6 col-md-6">
+                                            <div class="form-group">
+                                                <label>通过关卡的条件</label>
+                                                <select name="conditionPassed" class="form-control">
+                                                    <#list levelCondition as conditionPassed>
+                                                        <#if  conditionPassed.type == 1>
+                                                            <option  value="${conditionPassed.id}"
+                                                                    <#if (levelJump.conditionPassed)?? && levelJump.conditionPassed == conditionPassed.limitType>
+                                                                        selected
+                                                                    </#if>
+                                                            >${conditionPassed.explain}
+                                                            </option>
+                                                        </#if>
+                                                    </#list>
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="col-sm-6 col-md-6">
+                                            <div class="form-group">
+                                                <label>解锁关卡条件(可多选)</label>
+                                                <br/>
+                                                <div class="form-group multiselect_div">
+                                                    <select id="multiselect-color2" name="multiselectUnlock" class="multiselect multiselect-custom" multiple="multiple">
+                                                        <#list levelCondition as conditionPassed>
+                                                            <#if  conditionPassed.type == 0>
+                                                                <option  value="${conditionPassed.id}"
+                                                                         <#if (unlockList)??>
+                                                                             <#list unlockList as unlock >
+                                                                                 <#if (unlock)?? && unlock == conditionPassed.limitType>
+                                                                                     selected
+                                                                                 </#if>
+                                                                             </#list>
+                                                                         </#if>
+                                                                >${conditionPassed.explain}
+                                                                </option>
+                                                            </#if>
+                                                        </#list>
+                                                    </select>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="col-sm-6 col-md-6">
+                                        <div class="form-group">
+                                            <label class="form-label">总时间,限时(秒),0-不限时</label>
+                                            <input name="levelLimitTime" type="number" placeholder="输入限时时间" class="form-control"
+                                                   value="${(levelJump.signCount)!'0'}"/>
+                                        </div>
+                                    </div>
                                     <div class="form-group">
-                                        <label>关卡简介</label>
-                                        <input name="levelJumpDescribe" type="text" placeholder="输入关卡描述信息" class="form-control"
-                                               value="${(levelJump.describe)!''}"/>
+                                        <label class="form-label">补充说明</label>
+                                        <textarea name="levelDescribe" class="form-control" rows="5">${(levelJump.describe)!''}</textarea>
+                                    </div>
+                                    <div class="form-group">
+                                        <div class="form-label">关卡人数类型</div>
+                                        <div class="custom-controls-stacked">
+                                            <label class="custom-control custom-radio custom-control-inline">
+                                                <input type="radio" class="custom-control-input" name="numberType-radios" value="1"
+                                                        <#if (levelJump.numberType)?? && levelJump.numberType == 1>
+                                                         checked
+                                                        </#if>>
+                                                <span class="custom-control-label">单人</span>
+                                            </label>
+                                            <label class="custom-control custom-radio custom-control-inline">
+                                                <input type="radio" class="custom-control-input" name="numberType-radios" value="2"
+                                                        <#if (levelJump.numberType)?? && levelJump.numberType == 2>
+                                                        checked
+                                                        </#if>>
+                                                <span class="custom-control-label">多人</span>
+                                            </label>
+                                        </div>
+                                    </div>
+                                    <div class="card-footer">
+                                        <button type="submit" class="btn btn-block btn-primary"> <#if levelJump.id??>
+                                                提交修改
+                                            <#else >
+                                                创建关卡
+                                            </#if></button>
                                     </div>
-
-                                    <button type="submit" class="btn btn-block btn-primary">
-                                        <#if levelJump.id??>
-                                            提交修改
-                                        <#else >
-                                            创建游戏
-                                        </#if>
-                                    </button>
-
                                 </form>
 
                             </div>

+ 96 - 37
src/main/resources/templates/app/level.ftl

@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <#include "../common/header.ftl">
 <#setting number_format="#">
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">
@@ -23,50 +23,109 @@
         <#--    主要内容content-->
         <div class="section-body">
             <div class="container-fluid">
+                <ul class="nav nav-tabs page-header-tab">
+                    <li class="nav-item">
+                        <a class="nav-link active" id="pills-calendar-tab" data-toggle="pill" href="#pills-calendar" role="tab" aria-controls="pills-calendar" aria-selected="false">单人关卡</a>
+                    </li>
+                    <li class="nav-item">
+                        <a class="nav-link" id="pills-timeline-tab" data-toggle="pill" href="#pills-timeline" role="tab" aria-controls="pills-timeline" aria-selected="true">对战关卡</a>
+                    </li>
+                </ul>
+
                 <div class="row clearfix">
                     <div class="col-md-12 ">
-                        <div class="card">
-                            <div class="card-body">
-                                <table class="table table-bordered table-hover">
-                                    <thead>
-                                    <tr>
-                                        <th>
-                                            关卡id
-                                        </th>
-                                        <th>
-                                            关卡名
-                                        </th>
-                                        <th>描述</th>
-                                        <th>详情</th>
-                                    </tr>
-                                    </thead>
-                                    <tbody>
+                        <div class="tab-content" id="pills-tabContent">
+                            <div class="tab-pane fade show active" id="pills-calendar" role="tabpanel" aria-labelledby="pills-calendar-tab">
+                                <div class="card">
+                                    <div class="card-body">
+                                        <table class="table table-bordered table-hover">
+                                            <thead>
+                                            <tr>
+                                                <th>
+                                                    关卡id
+                                                </th>
+                                                <th>
+                                                    关卡名
+                                                </th>
+                                                <th>描述</th>
+                                                <th>详情</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody>
 
-                                    <#list list as item>
-                                        <tr>
-                                            <td>
-                                                ${item.id}
-                                            </td>
-                                            <td>
-                                                ${item.name}
-                                            </td>
-                                            <td>
-                                                ${item.describe}
-                                            </td>
-                                            <td>
-                                                <a href=""
-                                                   class="btn  btn-primary"
-                                                >详情</a>
-                                            </td>
-                                        </tr>
-                                    </#list>
+                                            <#list list as item>
+                                                <#if item.numberType == 1>
+                                                    <tr>
+                                                        <td>
+                                                            ${item.id}
+                                                        </td>
+                                                        <td>
+                                                            ${item.name}
+                                                        </td>
+                                                        <td>
+                                                            ${item.describe}
+                                                        </td>
+                                                        <td>
+                                                            <a href="${req.contextPath}/backstage_level/detailItem?levelId=${item.id}"
+                                                               class="btn  btn-primary"
+                                                            >详情</a>
+                                                        </td>
+                                                    </tr>
+                                                </#if>
+                                            </#list>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                </div>
+                            </div>
 
+                            <div class="tab-pane fade" id="pills-timeline" role="tabpanel" aria-labelledby="pills-timeline-tab">
+                                <div class="card">
+                                    <div class="card-body">
+                                        <table class="table table-bordered table-hover">
+                                            <thead>
+                                            <tr>
+                                                <th>
+                                                    关卡id
+                                                </th>
+                                                <th>
+                                                    关卡名
+                                                </th>
+                                                <th>描述</th>
+                                                <th>详情</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody>
 
-                                    </tbody>
-                                </table>
+                                            <#list list as item>
+                                                <#if item.numberType == 2>
+                                                    <tr>
+                                                        <td>
+                                                            ${item.id}
+                                                        </td>
+                                                        <td>
+                                                            ${item.name}
+                                                        </td>
+                                                        <td>
+                                                            ${item.describe}
+                                                        </td>
+                                                        <td>
+                                                            <a href="${req.contextPath}/backstage_level/detailItem?levelId=${item.id}"
+                                                               class="btn  btn-primary"
+                                                            >详情</a>
+                                                        </td>
+                                                    </tr>
+                                                </#if>
+                                            </#list>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                </div>
                             </div>
+
                         </div>
 
+
                     </div>
                 </div>
 

+ 1 - 1
src/main/resources/templates/ble/generate.ftl

@@ -6,7 +6,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/ble/list.ftl

@@ -6,7 +6,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/device/generate.ftl

@@ -6,7 +6,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/device/list.ftl

@@ -6,7 +6,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/game/detail.ftl

@@ -32,7 +32,7 @@
     }
 
 </style>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/game/list.ftl

@@ -6,7 +6,7 @@
     <#setting number_format="#">
 
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 119 - 7
src/main/resources/templates/index.ftl

@@ -1,10 +1,122 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Title</title>
-</head>
-<body>
-this is index page
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+<#include "common/header.ftl">
+<#setting number_format="#">
+<body class="font-opensans  sidebar_dark">
+<!-- Page Loader -->
+<div class="page-loader-wrapper">
+    <div class="loader">
+    </div>
+</div>
+<!-- Start main html -->
+<div id="main_content">
+    <#--边栏sidebar-->
+    <#include "common/iconMenu.ftl">
+    <#--主菜单-->
+    <#include "common/startMainMenu.ftl">
+    <div class="page">
+        <#assign title = "关卡列表">
+        <#-- 顶部栏-->
+        <#include "common/pageTop.ftl">
+
+        <#--    主要内容content-->
+        <div class="section-body">
+            <div class="container-fluid">
+                <ul class="nav nav-tabs page-header-tab" id="tabContainer">
+<#--                    <li class="nav-item">-->
+<#--                        <a class="nav-link active" id="pills-calendar-tab" data-toggle="pill" href="#pills-calendar" role="tab" aria-controls="pills-calendar" aria-selected="false">单人关卡</a>-->
+<#--                    </li>-->
+<#--                    <li class="nav-item">-->
+<#--                        <a class="nav-link" id="pills-timeline-tab" data-toggle="pill" href="#pills-timeline" role="tab" aria-controls="pills-timeline" aria-selected="true">对战关卡</a>-->
+<#--                    </li>-->
+                </ul>
+
+                <div class="row clearfix">
+                    <div class="col-md-12 ">
+                        <div class="tab-content" id="pills-tabContent">
+                            <div class="tab-pane fade show active" id="pills-calendar" role="tabpanel" aria-labelledby="pills-calendar-tab">
+                                <div class="card">
+                                    <div class="card-body">
+
+                                    </div>
+                                </div>
+                            </div>
+
+                            <div class="tab-pane fade" id="pills-timeline" role="tabpanel" aria-labelledby="pills-timeline-tab">
+                                <div class="card">
+                                    <div class="card-body">
+
+                                    </div>
+                                </div>
+                            </div>
+
+                        </div>
+
+
+                    </div>
+                </div>
+
+            </div>
+
+        </div>
+
+    </div>
+</div>
+
+<!-- jQuery and bootstrtap js -->
+<script src="../main-bundles/lib.vendor.bundle.js"></script>
+<!-- Start core js and page js -->
+<script src="../js/core.js"></script>
+
+<script src="../js/iframe/iframe.js"></script>
+
+<script>
+
+    var iframe = $("#tabContainer").iframes({
+        data: [ {
+            id: 'home',
+            text: '用户',
+            url: "/mgr/user_edit/47",
+            closeable: true
+        }, {
+            id: 'admineap2',
+            text: '日志列表',
+            url: "/menu/menu_edit/158"
+            ,closeable: true
+        }
+            /* , {
+                id: 'admineap',
+                text: '部门',
+                url: "/dept/dept_update/27"
+            }, {
+                id: 'menu',
+                text: '菜单',
+                url: "/menu/menu_edit/107"
+            },{
+                id: 'edit',
+                text: '百度一下',
+                url: "/blackboard/show",
+                //closeable: true
+            } */],
+        //showIndex: 1,
+        loadAll: false
+    })
+
+    iframe.addIframe({
+        id: 'admineap',
+        text: '部门',
+        url: "/dept/dept_update/27"
+        ,closeable: true
+    });
+
+    iframe.addIframe({
+        id: 'menu',
+        text: '菜单',
+        url: "/menu/menu_edit/107"
+        ,closeable: true
+    });
+    //iframe.showIframe('admineap');//根据数据属性id设置
+</script>
 </body>
-</html>
+</html>

+ 1 - 1
src/main/resources/templates/log/client.ftl

@@ -6,7 +6,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/picture/list.ftl

@@ -32,7 +32,7 @@
     </style>
 </head>
 
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/tag/list.ftl

@@ -21,7 +21,7 @@
     </style>
 </head>
 
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/user/detail.ftl

@@ -4,7 +4,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">

+ 1 - 1
src/main/resources/templates/user/list.ftl

@@ -3,7 +3,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <#include "../common/header.ftl">
 <#setting number_format="#">
-<body class="font-opensans  sidebar_dark offcanvas-active">
+<body class="font-opensans  sidebar_dark ">
 <!-- Page Loader -->
 <div class="page-loader-wrapper">
     <div class="loader">