| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TSystemBulletin; |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TBroadcast tBroadcast) { |
| | | Boolean exit = tBroadcastService.isExit(tBroadcast.getId(), tBroadcast.getSort()); |
| | | if(exit){ |
| | | return new SuccessTip(500,"该排序已存在!"); |
| | | } |
| | | tBroadcast.setStatus(StatusEnum.NORMAL.getCode()); |
| | | tBroadcast.setCreateTime(new Date()); |
| | | tBroadcastService.insert(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tBroadcastId) { |
| | | TBroadcast tBroadcast = tBroadcastService.selectById(tBroadcastId); |
| | | if(1 == tBroadcast.getUpDown()){ |
| | | return new SuccessTip(500,"上架中的广播不可删除!"); |
| | | } |
| | | tBroadcast.setStatus(StatusEnum.DELETE.getCode()); |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TBroadcast tBroadcast) { |
| | | Boolean exit = tBroadcastService.isExit(tBroadcast.getId(), tBroadcast.getSort()); |
| | | if(exit){ |
| | | return new SuccessTip(500,"该排序已存在!"); |
| | | } |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | @RequestMapping(value = "/up") |
| | | @ResponseBody |
| | | public Object up(Integer id) { |
| | | |
| | | int count = tBroadcastService.selectCount(new EntityWrapper<TBroadcast>() |
| | | .eq("upDown", 1) |
| | | .ne("status", StatusEnum.DELETE.getCode())); |
| | | if(count>4){ |
| | | return new SuccessTip(500,"最多可上架5条广播!"); |
| | | } |
| | | TBroadcast tBroadcast = tBroadcastService.selectById(id); |
| | | tBroadcast.setUpDown(1); |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 下架 |
| | | */ |
| | | @RequestMapping(value = "/down") |
| | | @ResponseBody |
| | | public Object down(Integer id) { |
| | | TBroadcast tBroadcast = tBroadcastService.selectById(id); |
| | | tBroadcast.setUpDown(2); |
| | | tBroadcastService.updateById(tBroadcast); |
| | | return SUCCESS_TIP; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.modular.system.controller.util.LabelReplaceUtil; |
| | | import com.stylefeng.guns.modular.system.enums.HtmlTypeEnum; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.THtml; |
| | | import com.stylefeng.guns.modular.system.service.ITHtmlService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2023-03-24 10:50:08 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tHtml") |
| | | public class THtmlController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tHtml/"; |
| | | |
| | | @Autowired |
| | | private ITHtmlService tHtmlService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tHtml.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tHtml_add") |
| | | public String tHtmlAdd() { |
| | | return PREFIX + "tHtml_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tHtml_update/{tHtmlId}") |
| | | public String tHtmlUpdate(@PathVariable Integer tHtmlId, Model model) { |
| | | THtml tHtml = tHtmlService.selectById(tHtmlId); |
| | | model.addAttribute("item",tHtml); |
| | | LogObjectHolder.me().set(tHtml); |
| | | return PREFIX + "tHtml_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到积分说明 |
| | | */ |
| | | @RequestMapping("/integralExplain") |
| | | public String integralExplain(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.INTEGRAL_EXPLAIN.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "integralExplain.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到佣金规则说明 |
| | | */ |
| | | @RequestMapping("/commissionRuleExplain") |
| | | public String commissionRuleExplain(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.COMMISSION_RULE_EXPLAIN.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "commissionRuleExplain.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到行程录音说明 |
| | | */ |
| | | @RequestMapping("/tripRecordingExplain") |
| | | public String tripRecordingExplain(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.TRIP_RECORDING_EXPLAIN.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "tripRecordingExplain.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到预估价格说明 |
| | | */ |
| | | @RequestMapping("/estimatedPriceExplain") |
| | | public String estimatedPriceExplain(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.ESTIMATED_PRICE_EXPLAIN.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "estimatedPriceExplain.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到起步价说明 |
| | | */ |
| | | @RequestMapping("/startingFareExplain") |
| | | public String startingFareExplain(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.SPECIFICATION_STARTING_PRICE.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "estimatedPriceExplain.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到注销协议 |
| | | */ |
| | | @RequestMapping("/cancellationAgreement") |
| | | public String cancellationAgreement(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.CANCELLATION_AGREEMENT.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "cancellationAgreement.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到关于我们 |
| | | */ |
| | | @RequestMapping("/aboutUs") |
| | | public String aboutUs(Model model) { |
| | | THtml html = queryHtmlByType(HtmlTypeEnum.ABOUT_US.getCode()); |
| | | model.addAttribute("html",html); |
| | | return PREFIX + "aboutUs.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return tHtmlService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 通过类型查询配置 |
| | | */ |
| | | @RequestMapping(value = "/queryHtmlByType") |
| | | @ResponseBody |
| | | public THtml queryHtmlByType(Integer type) { |
| | | return tHtmlService.selectOne(new EntityWrapper<THtml>().eq("type", type).last("LIMIT 1")); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(THtml tHtml) { |
| | | tHtmlService.insert(tHtml); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tHtmlId) { |
| | | tHtmlService.deleteById(tHtmlId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(THtml tHtml) { |
| | | tHtml.setHtml(LabelReplaceUtil.replace(tHtml.getHtml())); |
| | | tHtmlService.updateById(tHtml); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tHtmlId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tHtmlId") Integer tHtmlId) { |
| | | return tHtmlService.selectById(tHtmlId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.THtml; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * H5富文本 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-24 |
| | | */ |
| | | public interface THtmlMapper extends BaseMapper<THtml> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.THtmlMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.THtml"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="html" property="html" /> |
| | | <result column="createTime" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, type, html, createTime |
| | | </sql> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.enums; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description H5富文本枚举 |
| | | * @Author xiaochen |
| | | * @Date 2023/02/15 9:42 |
| | | */ |
| | | public enum HtmlTypeEnum { |
| | | |
| | | /*类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)*/ |
| | | |
| | | AGENT_DRIVING_SERVICE_EXPLAIN(1, "代驾服务协议与隐私政策保护"), |
| | | CLAUSE(2, "法律条款"), |
| | | PERSONAL_INFORMATION_RULES(3, "个人信息处理规则"), |
| | | INTEGRAL_EXPLAIN(4, "积分说明"), |
| | | COMMISSION_RULE_EXPLAIN(5, "佣金规则说明"), |
| | | TRIP_RECORDING_EXPLAIN(6, "行程录音说明"), |
| | | ESTIMATED_PRICE_EXPLAIN(7,"预估价格说明"), |
| | | BASIC_REQUIREMENTS_JOINING(8, "加盟基本要求"), |
| | | JOINING_PROCESS(9, "加盟流程"), |
| | | SPECIFICATION_STARTING_PRICE(10, "起步价说明"), |
| | | CANCELLATION_AGREEMENT(11,"注销协议"), |
| | | ABOUT_US(12,"关于我们"), |
| | | DRIVER_EXPLAIN_CANCELLATION(13,"司机消单说明"); |
| | | |
| | | private String desc; |
| | | |
| | | |
| | | private int code; |
| | | |
| | | |
| | | HtmlTypeEnum(int code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static HtmlTypeEnum fromCode(Integer code) { |
| | | HtmlTypeEnum[] resultTypes = HtmlTypeEnum.values(); |
| | | for (HtmlTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 是否显示 1是 0否 |
| | | */ |
| | | private Boolean isShow; |
| | | private Boolean show; |
| | | |
| | | /** |
| | | * 上下架 1上架 2下架 |
| | | */ |
| | | private Integer upDown; |
| | | |
| | | public Boolean getIsShow() { |
| | | return isShow; |
| | | public Boolean getShow() { |
| | | return show; |
| | | } |
| | | |
| | | public void setIsShow(Boolean isShow) { |
| | | this.isShow = isShow; |
| | | public void setShow(Boolean show) { |
| | | this.show = show; |
| | | } |
| | | |
| | | |
| | | public Integer getUpDown() { |
| | | return upDown; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * H5富文本 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-24 |
| | | */ |
| | | @TableName("t_html") |
| | | public class THtml extends Model<THtml> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * H5内容 |
| | | */ |
| | | private String html; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date createTime; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getHtml() { |
| | | return html; |
| | | } |
| | | |
| | | public void setHtml(String html) { |
| | | this.html = html; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "THtml{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", html=" + html + |
| | | ", createTime=" + createTime + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | Boolean isExit(String id, Integer sort); |
| | | Boolean isExit(Integer id, Integer sort); |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.THtml; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * H5富文本 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-24 |
| | | */ |
| | | public interface ITHtmlService extends IService<THtml> { |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.enums.StatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TBroadcast; |
| | | import com.stylefeng.guns.modular.system.dao.TBroadcastMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITBroadcastService; |
| | |
| | | private TBroadcastMapper tBroadcastMapper; |
| | | |
| | | @Override |
| | | public Boolean isExit(String id, Integer sort) { |
| | | public Boolean isExit(Integer id, Integer sort) { |
| | | Integer count = tBroadcastMapper.selectCount(new EntityWrapper<TBroadcast>() |
| | | .eq("sort", sort)); |
| | | if (StringUtils.hasLength(id)) { |
| | | .eq("sort", sort) |
| | | .ne("status", StatusEnum.DELETE.getCode())); |
| | | if (Objects.nonNull(id)) { |
| | | // 修改 |
| | | TBroadcast tBroadcast = tBroadcastMapper.selectById(id); |
| | | return Objects.nonNull(tBroadcast) && !tBroadcast.getSort().equals(sort) && count > 0; |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.THtml; |
| | | import com.stylefeng.guns.modular.system.dao.THtmlMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITHtmlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * H5富文本 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2023-03-24 |
| | | */ |
| | | @Service |
| | | public class THtmlServiceImpl extends ServiceImpl<THtmlMapper, THtml> implements ITHtmlService { |
| | | |
| | | } |
| | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">滚动消息</label> |
| | | </div> |
| | | <label >滚动消息</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >消息内容:</label> |
| | | <input id="content" name="content" type="text" maxlength="200" style="height: 30px" required="required"> |
| | | <input id="content" name="content" type="text" maxlength="200" placeholder="请输入" style="height: 30px" required="required"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >是否显示:</label> |
| | | <select class="input-group col-sm-6" id="isShow" style="width: 180px;height: 30px" name="isShow"> |
| | | <select id="show" style="width: 180px;height: 30px" name="show"> |
| | | <option value="">选择是否显示</option> |
| | | <option value="1">是</option> |
| | | <option value="0">否</option> |
| | | <option value="true">是</option> |
| | | <option value="false">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.addSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="ibox-content" id="broadcastInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | |
| | | <input hidden id="id" value="${item.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >消息内容:</label> |
| | | <input id="content" value="${content}" type="text" maxlength="200" style="height: 30px" required="required"> |
| | | <input id="content" value="${item.content}" type="text" maxlength="200" style="height: 30px" required="required"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >排序:</label> |
| | | <input id="sort" value="${sort}" type="number" style="height: 30px" maxlength="4" placeholder="请输入" required="required"> |
| | | <input id="sort" value="${item.sort}" type="number" style="height: 30px" maxlength="4" placeholder="请输入" required="required"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >是否显示:</label> |
| | | <select class="input-group col-sm-6" id="isShow" style="width: 180px;height: 30px" name="isShow"> |
| | | <option value="">选择是否显示</option> |
| | | <option value="1">是</option> |
| | | <option value="0">否</option> |
| | | <select id="show" style="width: 180px;height: 30px"> |
| | | <option value="true"${item.show == true ? 'selected=selected' : ''}>是</option> |
| | | <option value="false"${item.show == false ? 'selected=selected' : ''}>否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>关于我们</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>关于我们</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>注销协议</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>注销协议</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>佣金规则说明</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>佣金规则说明</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>预估价格说明</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>预估价格说明</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>积分说明</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>积分说明</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>起步价说明</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>起步价说明</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="THtml.search()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="THtmlTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tHtml/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="THtml.openAddTHtml()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tHtml/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="THtml.openTHtmlDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tHtml/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="THtml.delete()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="THtmlTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="type" name="类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="html" name="H5内容" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="THtmlInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" value="${item.id}" underline="true"/> |
| | | <#input id="type" name="类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)" value="${item.type}" /> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="html" name="H5内容" value="${item.html}" underline="true"/> |
| | | <#input id="createTime" name="添加时间" value="${item.createTime}" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="THtmlInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>行程录音说明</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: left;"> |
| | | |
| | | <input hidden id="id" value="${html.id}"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <label>行程录音说明</label> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script> |
| | | @} |
| | |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '是否显示', field: 'isShow', visible: true, align: 'center', valign: 'middle', |
| | | {title: '是否显示', field: 'show', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.isShow){ |
| | | if (row.show){ |
| | | return '<span>是</span>' |
| | | }else { |
| | | return '<span>否</span>' |
| | |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.isShow){ |
| | | return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:red">下架</a>' |
| | | if (row.upDown === 1){ |
| | | return '<a href="#" onclick="TBroadcast.down('+row.id+')" style="color:red">下架</a>' |
| | | }else{ |
| | | return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:blue">上架</a>' +' ' + |
| | | return '<a href="#" onclick="TBroadcast.up('+row.id+')" style="color:blue">上架</a>' +' ' + |
| | | '<a href="#" onclick="TBroadcast.delete('+row.id+')" style="color:red">删除</a>' |
| | | } |
| | | } |
| | |
| | | */ |
| | | TBroadcast.delete = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) { |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("删除成功!"); |
| | | TBroadcast.table.refresh(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | TBroadcast.up = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/up", function (data) { |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("上架成功!"); |
| | | TBroadcast.table.refresh(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("上架失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 下架 |
| | | */ |
| | | TBroadcast.down = function (id) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/down", function (data) { |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("下架成功!"); |
| | | TBroadcast.table.refresh(); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("下架失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TBroadcast.search = function () { |
| | |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TBroadcastInfoDlg = { |
| | | tBroadcastInfoData : {} |
| | | tBroadcastInfoData : {}, |
| | | validateFields: { |
| | | content: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '消息内容不能为空' |
| | | } |
| | | } |
| | | }, |
| | | sort: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '排序不能为空' |
| | | } |
| | | } |
| | | }, |
| | | show: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择是否显示' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TBroadcastInfoDlg.validate = function () { |
| | | $('#broadcastInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#broadcastInfoForm').bootstrapValidator('validate'); |
| | | return $("#broadcastInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | .set('content') |
| | | .set('sort') |
| | | .set('status') |
| | | .set('show') |
| | | .set('upDown') |
| | | .set('createTime'); |
| | | } |
| | | |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/add", function(data){ |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("添加成功!"); |
| | | window.parent.TBroadcast.table.refresh(); |
| | | TBroadcastInfoDlg.close(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tBroadcast/update", function(data){ |
| | | if(500 == data.code){ |
| | | Feng.error(data.message); |
| | | return; |
| | | }else { |
| | | Feng.success("修改成功!"); |
| | | window.parent.TBroadcast.table.refresh(); |
| | | TBroadcastInfoDlg.close(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | Feng.initValidator("broadcastInfoForm", TBroadcastInfoDlg.validateFields); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var THtml = { |
| | | id: "THtmlTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | THtml.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)', field: 'type', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: 'H5内容', field: 'html', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | THtml.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | THtml.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | THtml.openAddTHtml = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tHtml/tHtml_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | THtml.openTHtmlDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tHtml/tHtml_update/' + THtml.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | THtml.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tHtml/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | THtml.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tHtmlId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | THtml.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | THtml.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = THtml.initColumn(); |
| | | var table = new BSTable(THtml.id, "/tHtml/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | THtml.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化详情对话框 |
| | | */ |
| | | var THtmlInfoDlg = { |
| | | tHtmlInfoData : {} |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | THtmlInfoDlg.clearData = function() { |
| | | this.tHtmlInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | THtmlInfoDlg.set = function(key, val) { |
| | | this.tHtmlInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | THtmlInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | THtmlInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.THtml.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | THtmlInfoDlg.collectData = function() { |
| | | if(UE.getEditor('html').hasContents()){ |
| | | $('#html').val(UE.getEditor('html').getContent()); |
| | | } |
| | | this |
| | | .set('id') |
| | | .set('type') |
| | | .set('html') |
| | | .set('createTime'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | THtmlInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tHtml/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.THtml.table.refresh(); |
| | | THtmlInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tHtmlInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | THtmlInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tHtml/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.THtml.table.refresh(); |
| | | THtmlInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tHtmlInfoData); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | THtmlInfoDlg.editor = UE.getEditor('html'); |
| | | }); |