123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <!DOCTYPE html>
- <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
- <head>
- <th:block th:include="include :: header('编辑banner')" />
- </head>
- <body class="white-bg">
- <div class="wrapper wrapper-content animated fadeInRight ibox-content">
- <form class="form-horizontal m" id="form-dict-edit" th:object="${banner}">
- <input name="bannerId" type="hidden" th:field="*{bannerId}" />
- <div class="form-group">
- <label class="col-sm-2 control-label">banner名称:</label>
- <div class="col-sm-10">
- <input name="bannerName" id="bannerName" class="form-control" type="text" placeholder="请输入banner名称" th:field="*{bannerName}" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">图片:</label>
- <div class="col-sm-10">
- <img src="" id="picImage" style="width:250px;height:90px;" alt="" th:src="*{bannerPic}">
- <input type="file" id="picUploadFile" name="uploadFile" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
- <button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
- <input type="hidden" id="bannerPic" name="bannerPic" th:field="*{bannerPic}" class="form-control validate[required]"/>
- </div>
- </div>
- <div class="form-group" id="chargeSkipType">
- <label class="col-sm-2 control-label">跳转类型:</label>
- <div class="col-sm-10">
- <select name="skipType" id="skipType" class="form-control m-b" th:with="type=${@dict.getType('skip_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{skipType}"></option>
- </select>
- <input id="skipUri" name="skipUri" class="form-control" type="text" th:field="*{skipUri}"/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">排序:</label>
- <div class="col-sm-10">
- <input id="seqNo" min="1" name="seqNo" class="form-control" type="number" th:field="*{seqNo}" placeholder="请输入排序" required/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">激活设置:</label>
- <div class="col-sm-10">
- <select name="bannerStatus" id="bannerStatus" class="form-control m-b" th:with="type=${@dict.getType('activation_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{bannerStatus}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">平台:</label>
- <div class="col-sm-10">
- <select name="osType" id="osType" class="form-control m-b" th:with="type=${@dict.getType('system_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{osType}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">用户:</label>
- <div class="col-sm-10">
- <select name="isNewUser" id="isNewUser" class="form-control m-b" th:with="type=${@dict.getType('is_news_type')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isNewUser}"></option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">显示位置:</label>
- <div class="col-sm-10">
- <select name="viewType" id="viewType" class="form-control m-b" th:with="type=${@dict.getType('banner_view_position')}">
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{viewType}"></option>
- </select>
- </div>
- </div>
- <div class="form-group select-time" >
- <label class="col-sm-2 control-label">开始时间:</label>
- <div class="col-sm-10">
- <input id="startDate" name="startTime" class="form-control time-input" type="text" th:field="*{startTime}" placeholder="请输入开始时间"/>
- </div>
- </div>
- <div class="form-group select-time" >
- <label class="col-sm-2 control-label">结束时间:</label>
- <div class="col-sm-10">
- <input id="endDate" name="endTime" class="form-control time-input" type="text" th:field="*{endTime}" placeholder="请输入结束时间"/>
- </div>
- </div>
- </form>
- </div>
- <th:block th:include="include :: footer" />
- <th:block th:include="include :: summernote-js" />
- <script type="text/javascript">
- var prefix = ctx + "operation/banner";
- $("#form-dict-edit").validate({
- focusCleanup: true
- });
- /**
- * 图片上传
- */
- $('#picUploadBtn').on('click',function () {
- if($('#picUploadFile').get(0).files[0]==undefined){
- $.modal.alertError("请选择要上传的文件!");
- return;
- }
- var formData = new FormData();
- formData.append("file", $('#picUploadFile').get(0).files[0]);
- $.ajax({
- url: ctx + "file/upload",
- data: formData,
- type: "post",
- processData: false,
- contentType: false,
- success: function(result) {
- $('#picImage').attr('src',result.data);
- $("input[name='bannerPic']").val(result.data);
- }
- })
- });
- function submitHandler() {
- if ($.validate.form()) {
- $.operate.save(prefix + "/edit", $('#form-dict-edit').serialize());
- }
- }
- </script>
- </body>
- </html>
|