提交 5cd09588 authored 作者: zgy's avatar zgy

查询商品最新一条评论

上级 b6f640cd
...@@ -6,26 +6,28 @@ package com.diaoyun.zion.chinafrica.constant; ...@@ -6,26 +6,28 @@ package com.diaoyun.zion.chinafrica.constant;
public class KeyConstant { public class KeyConstant {
//AES加密KEY 不能随便更改!!! //AES加密KEY 不能随便更改!!!
public static final String AES_KEY="``8d47e4d5f4r7d4"; public static final String AES_KEY = "``8d47e4d5f4r7d4";
//验证码 //验证码
public static String IDENTIFY_CODE="identifyCode"; public static String IDENTIFY_CODE = "identifyCode";
//登录用户 //登录用户
public static String LOGIN_USER="loginUser"; public static String LOGIN_USER = "loginUser";
/** /**
* 存放在redis的key************************************************ * 存放在redis的key************************************************
*/ */
//优惠券 //优惠券
public final static String COUPON="coupon"; public final static String COUPON = "coupon";
/////////////////订单//////////////// /////////////////订单////////////////
//订单过期前缀 //订单过期前缀
public final static String ORDER_EXP="order_exp"; public final static String ORDER_EXP = "order_exp";
//订单详情前缀 //订单详情前缀
public final static String ORDER_DET="order_det"; public final static String ORDER_DET = "order_det";
/////////////////订单 END//////////////// /////////////////订单 END////////////////
//验证码前缀 //验证码前缀
public final static String CAPTCHA="captcha_"; public final static String CAPTCHA = "captcha_";
//手机验证码前缀 //手机验证码前缀
public final static String CAPTCHA_PHONE="captcha_phone"; public final static String CAPTCHA_PHONE = "captcha_phone";
//自定义id头部 //自定义id头部
public final static String CUSTOMIZE_ID="customizeId_"; public final static String CUSTOMIZE_ID = "customizeId_";
//shopify商品
public final static String SHOPIFY_ITEM = "shopify_item";
} }
package com.diaoyun.zion.chinafrica.controller; package com.diaoyun.zion.chinafrica.controller;
import com.diaoyun.zion.chinafrica.service.ShopifyService; import com.diaoyun.zion.chinafrica.service.ShopifyService;
import com.diaoyun.zion.chinafrica.service.TbCfItemCommentService;
import com.diaoyun.zion.master.base.Result; import com.diaoyun.zion.master.base.Result;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -20,6 +21,8 @@ public class ShopifyController { ...@@ -20,6 +21,8 @@ public class ShopifyController {
@Autowired @Autowired
private ShopifyService shopifyService; private ShopifyService shopifyService;
@Autowired
private TbCfItemCommentService tbCfItemCommentService;
/** /**
* 查询商品 * 查询商品
...@@ -36,7 +39,8 @@ public class ShopifyController { ...@@ -36,7 +39,8 @@ public class ShopifyController {
/** /**
* 查询分类商品 * 查询分类商品
* *
* @param product_type * @param product_type 商品分类
* @param product_id 商品ID
* @return * @return
*/ */
@ApiOperation(value = "查询分类商品") @ApiOperation(value = "查询分类商品")
...@@ -50,7 +54,7 @@ public class ShopifyController { ...@@ -50,7 +54,7 @@ public class ShopifyController {
/** /**
* 查看商品详情 * 查看商品详情
* *
* @param product_id * @param product_id 商品ID
* @return * @return
*/ */
@ApiOperation(value = "查看商品详情") @ApiOperation(value = "查看商品详情")
...@@ -60,4 +64,17 @@ public class ShopifyController { ...@@ -60,4 +64,17 @@ public class ShopifyController {
return shopifyService.queryProductsDetails(product_id); return shopifyService.queryProductsDetails(product_id);
} }
/**
* 查询商品最新一条评论
*
* @param itemId 商品ID
* @return
*/
@ApiOperation(value = "查询商品评论")
@GetMapping("/querylastcomment")
public Result queryLastComment(@ApiParam("商品ID") @RequestParam("itemId") String itemId) {
return tbCfItemCommentService.queryLastComment(itemId);
}
} }
package com.diaoyun.zion.chinafrica.dao;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntityExtends;
import com.diaoyun.zion.master.dao.BaseDao;
/**
* Dao
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public interface TbCfItemCommentDao extends BaseDao<TbCfItemCommentEntity> {
public TbCfItemCommentEntityExtends queryLastComment(String itemId);
}
package com.diaoyun.zion.chinafrica.dao;
import com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity;
import com.diaoyun.zion.master.dao.BaseDao;
/**
* Dao
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public interface TbCfReplyDao extends BaseDao<TbCfReplyEntity> {
}
package com.diaoyun.zion.chinafrica.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 tb_cf_item_comment
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public class TbCfItemCommentEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 商品评论ID
*/
private String id;
/**
* 评论人
*/
private String userId;
/**
* 订单ID
*/
private String orderId;
/**
* 商品ID
*/
private String itemId;
/**
* 商品评分
*/
private Integer itemScore;
/**
* 服务评分
*/
private Integer serviceScore;
/**
* 物流评分
*/
private Integer logisticsScore;
/**
* 价格评分
*/
private Integer priceScore;
/**
* 商品评论
*/
private String itemReview;
/**
* 点赞人数
*/
private Long likeNum;
/**
* 删除标志 0:正常 1:已删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 回复时间
*/
private Date replyTime;
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
/**
* 设置:商品评论ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:商品评论ID
*/
public String getId() {
return id;
}
/**
* 设置:评论人
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:评论人
*/
public String getUserId() {
return userId;
}
/**
* 设置:订单ID
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* 获取:订单ID
*/
public String getOrderId() {
return orderId;
}
/**
* 设置:商品ID
*/
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* 获取:商品ID
*/
public String getItemId() {
return itemId;
}
/**
* 设置:商品评分
*/
public void setItemScore(Integer itemScore) {
this.itemScore = itemScore;
}
/**
* 获取:商品评分
*/
public Integer getItemScore() {
return itemScore;
}
/**
* 设置:服务评分
*/
public void setServiceScore(Integer serviceScore) {
this.serviceScore = serviceScore;
}
/**
* 获取:服务评分
*/
public Integer getServiceScore() {
return serviceScore;
}
/**
* 设置:物流评分
*/
public void setLogisticsScore(Integer logisticsScore) {
this.logisticsScore = logisticsScore;
}
/**
* 获取:物流评分
*/
public Integer getLogisticsScore() {
return logisticsScore;
}
/**
* 设置:价格评分
*/
public void setPriceScore(Integer priceScore) {
this.priceScore = priceScore;
}
/**
* 获取:价格评分
*/
public Integer getPriceScore() {
return priceScore;
}
/**
* 设置:商品评论
*/
public void setItemReview(String itemReview) {
this.itemReview = itemReview;
}
/**
* 获取:商品评论
*/
public String getItemReview() {
return itemReview;
}
/**
* 设置:点赞人数
*/
public void setLikeNum(Long likeNum) {
this.likeNum = likeNum;
}
/**
* 获取:点赞人数
*/
public Long getLikeNum() {
return likeNum;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:回复时间
*/
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
/**
* 获取:回复时间
*/
public Date getReplyTime() {
return replyTime;
}
}
package com.diaoyun.zion.chinafrica.entity;
import java.util.Date;
/**
* @Auther: wudepeng
* @Date: 2019/11/18
* @Description: 商品评论(默认显示最新条信息)
*/
public class TbCfItemCommentEntityExtends {
/**
* 商品评论ID
*/
private String id;
/**
* 商品评论
*/
private String itemReview;
/**
* 创建时间
*/
private Date createTime;
/**
* 评论人
*/
private String username;
/**
* 评论数量
*/
private Long count;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getItemReview() {
return itemReview;
}
public void setItemReview(String itemReview) {
this.itemReview = itemReview;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
}
package com.diaoyun.zion.chinafrica.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 tb_cf_reply
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public class TbCfReplyEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 回复ID
*/
private String id;
/**
* 回复类型 0:商品 1:社区
*/
private Integer replyType;
/**
* 评论ID
*/
private String commentId;
/**
* 回复人
*/
private String userId;
/**
* 回复对象
*/
private String toUserId;
/**
* 回复内容
*/
private String replyMessage;
/**
* 删除标志 0:正常 1:已删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 设置:回复ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:回复ID
*/
public String getId() {
return id;
}
/**
* 设置:回复类型 0:商品 1:社区
*/
public void setReplyType(Integer replyType) {
this.replyType = replyType;
}
/**
* 获取:回复类型 0:商品 1:社区
*/
public Integer getReplyType() {
return replyType;
}
/**
* 设置:评论ID
*/
public void setCommentId(String commentId) {
this.commentId = commentId;
}
/**
* 获取:评论ID
*/
public String getCommentId() {
return commentId;
}
/**
* 设置:回复人
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:回复人
*/
public String getUserId() {
return userId;
}
/**
* 设置:回复对象
*/
public void setToUserId(String toUserId) {
this.toUserId = toUserId;
}
/**
* 获取:回复对象
*/
public String getToUserId() {
return toUserId;
}
/**
* 设置:回复内容
*/
public void setReplyMessage(String replyMessage) {
this.replyMessage = replyMessage;
}
/**
* 获取:回复内容
*/
public String getReplyMessage() {
return replyMessage;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
}
...@@ -13,5 +13,5 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -13,5 +13,5 @@ import org.springframework.web.bind.annotation.RequestParam;
public interface ShopifyService { public interface ShopifyService {
public Result queryShopifyProducts(); public Result queryShopifyProducts();
public Result queryProductsByType(String product_type,String product_id); public Result queryProductsByType(String product_type,String product_id);
Result queryProductsDetails(String product_id); public Result queryProductsDetails(String product_id);
} }
package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntityExtends;
import com.diaoyun.zion.master.base.Result;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public interface TbCfItemCommentService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfItemCommentEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfItemCommentEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfItemComment 实体
* @return 保存条数
*/
int save(TbCfItemCommentEntity tbCfItemComment);
/**
* 根据主键更新实体
*
* @param tbCfItemComment 实体
* @return 更新条数
*/
int update(TbCfItemCommentEntity tbCfItemComment);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
public Result queryLastComment(String itemId);
}
package com.diaoyun.zion.chinafrica.service;
import com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public interface TbCfReplyService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfReplyEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfReplyEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfReply 实体
* @return 保存条数
*/
int save(TbCfReplyEntity tbCfReply);
/**
* 根据主键更新实体
*
* @param tbCfReply 实体
* @return 更新条数
*/
int update(TbCfReplyEntity tbCfReply);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
}
...@@ -3,6 +3,7 @@ package com.diaoyun.zion.chinafrica.service.impl; ...@@ -3,6 +3,7 @@ package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.service.ShopifyService; import com.diaoyun.zion.chinafrica.service.ShopifyService;
import com.diaoyun.zion.chinafrica.vo.ShopifyConstant; import com.diaoyun.zion.chinafrica.vo.ShopifyConstant;
import com.diaoyun.zion.master.base.Result; import com.diaoyun.zion.master.base.Result;
import com.diaoyun.zion.master.common.RedisCache;
import com.diaoyun.zion.master.enums.ResultCodeEnum; import com.diaoyun.zion.master.enums.ResultCodeEnum;
import com.diaoyun.zion.master.util.HttpClientUtil; import com.diaoyun.zion.master.util.HttpClientUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -16,13 +17,13 @@ import org.slf4j.LoggerFactory; ...@@ -16,13 +17,13 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.github.pagehelper.page.PageMethod.startPage;
/** /**
* @Auther: wudepeng * @Auther: wudepeng
...@@ -32,6 +33,8 @@ import static com.github.pagehelper.page.PageMethod.startPage; ...@@ -32,6 +33,8 @@ import static com.github.pagehelper.page.PageMethod.startPage;
@Service("shopifyService") @Service("shopifyService")
public class ShopifyServiceImpl implements ShopifyService { public class ShopifyServiceImpl implements ShopifyService {
private static Logger logger = LoggerFactory.getLogger(ShopifyServiceImpl.class); private static Logger logger = LoggerFactory.getLogger(ShopifyServiceImpl.class);
@Resource
private RedisCache<Object> orderRedisCache;
/** /**
* 查询商品 * 查询商品
...@@ -89,6 +92,7 @@ public class ShopifyServiceImpl implements ShopifyService { ...@@ -89,6 +92,7 @@ public class ShopifyServiceImpl implements ShopifyService {
/** /**
* 查看商品详情 * 查看商品详情
*
* @param product_id * @param product_id
* @return * @return
*/ */
......
package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.dao.TbCfItemCommentDao;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity;
import com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntityExtends;
import com.diaoyun.zion.chinafrica.service.TbCfItemCommentService;
import com.diaoyun.zion.master.base.Result;
import com.diaoyun.zion.master.enums.ResultCodeEnum;
import com.diaoyun.zion.master.util.IdUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
@Service("tbCfItemCommentService")
public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
private static Logger logger = LoggerFactory.getLogger(TbCfItemCommentServiceImpl.class);
@Autowired
private TbCfItemCommentDao tbCfItemCommentDao;
@Override
public TbCfItemCommentEntity queryObject(String id) {
return tbCfItemCommentDao.queryObject(id);
}
@Override
public List<TbCfItemCommentEntity> queryList(Map<String, Object> map) {
return tbCfItemCommentDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfItemCommentDao.queryTotal(map);
}
@Override
public int save(TbCfItemCommentEntity tbCfItemComment) {
tbCfItemComment.setId(IdUtil.createIdbyUUID());
return tbCfItemCommentDao.save(tbCfItemComment);
}
@Override
public int update(TbCfItemCommentEntity tbCfItemComment) {
return tbCfItemCommentDao.update(tbCfItemComment);
}
@Override
public int delete(String id) {
return tbCfItemCommentDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return tbCfItemCommentDao.deleteBatch(ids);
}
/**
* 查询商品最新一条评论
*
* @param itemId
* @return
*/
@Override
public Result queryLastComment(String itemId) {
Result result = new Result();
try {
TbCfItemCommentEntityExtends lastComment = tbCfItemCommentDao.queryLastComment(itemId);
if (lastComment != null) {
result.setData(lastComment).setMessage("success");
logger.info("query comment success,the itemId is:" + itemId);
} else {
result.setCode(ResultCodeEnum.QUERY_ERROR.getCode()).setMessage("comment is null");
logger.error("comment is null,the itemId is:" + itemId);
}
} catch (Exception e) {
result.setCode(ResultCodeEnum.QUERY_ERROR.getCode()).setMessage(e.getMessage());
logger.error(e.getMessage());
}
return result;
}
}
package com.diaoyun.zion.chinafrica.service.impl;
import com.diaoyun.zion.chinafrica.dao.TbCfReplyDao;
import com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity;
import com.diaoyun.zion.chinafrica.service.TbCfReplyService;
import com.diaoyun.zion.master.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
@Service("tbCfReplyService")
public class TbCfReplyServiceImpl implements TbCfReplyService {
@Autowired
private TbCfReplyDao tbCfReplyDao;
@Override
public TbCfReplyEntity queryObject(String id) {
return tbCfReplyDao.queryObject(id);
}
@Override
public List<TbCfReplyEntity> queryList(Map<String, Object> map) {
return tbCfReplyDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfReplyDao.queryTotal(map);
}
@Override
public int save(TbCfReplyEntity tbCfReply) {
tbCfReply.setId(IdUtil.createIdbyUUID());
return tbCfReplyDao.save(tbCfReply);
}
@Override
public int update(TbCfReplyEntity tbCfReply) {
return tbCfReplyDao.update(tbCfReply);
}
@Override
public int delete(String id) {
return tbCfReplyDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return tbCfReplyDao.deleteBatch(ids);
}
}
<?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.diaoyun.zion.chinafrica.dao.TbCfItemCommentDao">
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity" id="tbCfItemCommentMap">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="orderId" column="order_id"/>
<result property="itemId" column="item_id"/>
<result property="itemScore" column="item_score"/>
<result property="serviceScore" column="service_score"/>
<result property="logisticsScore" column="logistics_score"/>
<result property="priceScore" column="price_score"/>
<result property="itemReview" column="item_review"/>
<result property="likeNum" column="like_num"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="replyTime" column="reply_time"/>
</resultMap>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity">
select
`id`,
`user_id`,
`order_id`,
`item_id`,
`item_score`,
`service_score`,
`logistics_score`,
`price_score`,
`item_review`,
`like_num`,
`del_flag`,
`create_time`,
`reply_time`,nick
from tb_cf_item_comment
where id = #{id}
</select>
<select id="queryLastComment" resultType="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntityExtends">
SELECT
c.id,
c.create_time,
c.item_review,
u.nick username,
m.count count
FROM
tb_cf_item_comment c
LEFT JOIN tb_cf_user_info u ON c.user_id = u.user_id
LEFT JOIN ( SELECT item_id, count(*) count FROM tb_cf_item_comment GROUP BY item_id ) m ON c.item_id = m.item_id
WHERE
c.item_id = #{itemId}
AND c.del_flag = 0
ORDER BY
c.create_time DESC
LIMIT 1
</select>
<select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity">
select
`id`,
`user_id`,
`order_id`,
`item_id`,
`item_score`,
`service_score`,
`logistics_score`,
`price_score`,
`item_review`,
`like_num`,
`del_flag`,
`create_time`,
`reply_time`
from tb_cf_item_comment
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_item_comment
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity">
insert into tb_cf_item_comment(
`id`,
`user_id`,
`order_id`,
`item_id`,
`item_score`,
`service_score`,
`logistics_score`,
`price_score`,
`item_review`,
`like_num`,
`del_flag`,
`create_time`,
`reply_time`)
values(
#{id},
#{userId},
#{orderId},
#{itemId},
#{itemScore},
#{serviceScore},
#{logisticsScore},
#{priceScore},
#{itemReview},
#{likeNum},
#{delFlag},
#{createTime},
#{replyTime})
</insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfItemCommentEntity">
update tb_cf_item_comment
<set>
<if test="userId != null">`user_id` = #{userId},</if>
<if test="orderId != null">`order_id` = #{orderId},</if>
<if test="itemId != null">`item_id` = #{itemId},</if>
<if test="itemScore != null">`item_score` = #{itemScore},</if>
<if test="serviceScore != null">`service_score` = #{serviceScore},</if>
<if test="logisticsScore != null">`logistics_score` = #{logisticsScore},</if>
<if test="priceScore != null">`price_score` = #{priceScore},</if>
<if test="itemReview != null">`item_review` = #{itemReview},</if>
<if test="likeNum != null">`like_num` = #{likeNum},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="replyTime != null">`reply_time` = #{replyTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_item_comment where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_item_comment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of 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.diaoyun.zion.chinafrica.dao.TbCfReplyDao">
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity" id="tbCfReplyMap">
<result property="id" column="id"/>
<result property="replyType" column="reply_type"/>
<result property="commentId" column="comment_id"/>
<result property="userId" column="user_id"/>
<result property="toUserId" column="to_user_id"/>
<result property="replyMessage" column="reply_message"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity">
select
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_reply
where id = #{id}
</select>
<select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity">
select
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_reply
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_reply
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity">
insert into tb_cf_reply(
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{replyType},
#{commentId},
#{userId},
#{toUserId},
#{replyMessage},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfReplyEntity">
update tb_cf_reply
<set>
<if test="replyType != null">`reply_type` = #{replyType}, </if>
<if test="commentId != null">`comment_id` = #{commentId}, </if>
<if test="userId != null">`user_id` = #{userId}, </if>
<if test="toUserId != null">`to_user_id` = #{toUserId}, </if>
<if test="replyMessage != null">`reply_message` = #{replyMessage}, </if>
<if test="delFlag != null">`del_flag` = #{delFlag}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_reply where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_reply where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
$(function () {
$("#sysConfigGrid").Grid({
url: '../sys/config/list',
colModel: [
{label: 'ID', name: 'id', key: true, hidden: true},
{label: '参数名', name: 'confKey', index: 'conf_key', width: 60},
{label: '参数值', name: 'confValue', index: 'conf_value', width: 100},
{label: '备注', name: 'remark', index: 'remark', width: 80}
]
});
});
var vm = new Vue({
el: '#sysConfig',
data: {
q: {
confKey: null
},
showList: true,
title: null,
config: {},
ruleValidate: {
confKey: [
{required: true, message: '参数名不能为空', trigger: 'blur'}
],
confValue: [
{required: true, message: '参数值不能为空', trigger: 'blur'}
]
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.config = {};
},
update: function () {
var id = getSelectedRow("#sysConfigGrid");
if (id == null) {
return;
}
Ajax.request({
url: "../sys/config/info/" + id,
async: true,
successCallback: function (r) {
vm.showList = false;
vm.title = "修改";
vm.config = r.config;
}
});
},
del: function (event) {
var ids = getSelectedRows("#sysConfigGrid");
if (ids == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/config/delete",
params: JSON.stringify(ids),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
saveOrUpdate: function (event) {
var url = vm.config.id == null ? "../sys/config/save" : "../sys/config/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.config),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
reload: function (event) {
vm.showList = true;
var page = $("#sysConfigGrid").jqGrid('getGridParam', 'page');
$("#sysConfigGrid").jqGrid('setGridParam', {
postData: {'confKey': vm.q.confKey},
page: page
}).trigger("reloadGrid");
},
reloadSearch: function () {
vm.q = {
confKey: ''
}
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
initialPage();
getGrid();
});
function initialPage() {
$(window).resize(function () {
TreeGrid.table.resetHeight({height: $(window).height() - 100});
});
}
function getGrid() {
var colunms = TreeGrid.initColumn();
var table = new TreeTable(TreeGrid.id, '../sys/dept/list', colunms);
table.setExpandColumn(2);
table.setIdField("deptId");
table.setCodeField("deptId");
table.setParentCodeField("parentId");
table.setExpandAll(true);
table.setHeight($(window).height() - 100);
table.init();
TreeGrid.table = table;
}
var TreeGrid = {
id: "sysDeptGrid",
table: null,
layerIndex: -1
};
/**
* 初始化表格的列
*/
TreeGrid.initColumn = function () {
var columns = [
{field: 'selectItem', radio: true},
{title: '部门ID', field: 'deptId', visible: false, align: 'center', valign: 'middle', width: '80px'},
{title: '部门名称', field: 'name', align: 'center', valign: 'middle', sortable: true, width: '180px'},
{title: '上级部门', field: 'parentName', align: 'center', valign: 'middle', sortable: true, width: '100px'},
{title: '排序号', field: 'orderNum', align: 'center', valign: 'middle', sortable: true, width: '100px'}]
return columns;
};
var setting = {
data: {
simpleData: {
enable: true,
idKey: "deptId",
pIdKey: "parentId",
rootPId: -1
},
key: {
url: "nourl"
}
}
};
var ztree;
var vm = new Vue({
el: '#sysDept',
data: {
showList: true,
title: null,
dept: {
parentName: null,
parentId: '01',
orderNum: 0
},
ruleValidate: {
name: [
{required: true, message: '部门名称不能为空', trigger: 'blur'}
]
}
},
methods: {
getDept: function () {
//加载部门树
Ajax.request({
url: "../sys/dept/select",
async: true,
successCallback: function (r) {
ztree = $.fn.zTree.init($("#sysDeptTree"), setting, r.deptList);
var node = ztree.getNodeByParam("deptId", vm.dept.parentId);
if (node) {
ztree.selectNode(node);
vm.dept.parentName = node.name;
} else {
node = ztree.getNodeByParam("deptId", '01');
ztree.selectNode(node);
vm.dept.parentName = node.name;
}
}
});
},
add: function () {
vm.showList = false;
vm.title = "新增";
var deptId = TreeGrid.table.getSelectedRow();
var parentId = '01';
if (deptId.length != 0) {
parentId = deptId[0].id;
}
vm.dept = {parentName: null, parentId: parentId, orderNum: 0};
vm.getDept();
},
update: function () {
var deptId = getDeptId();
if (deptId == null) {
return;
}
Ajax.request({
url: "../sys/dept/info/" + deptId,
async: true,
successCallback: function (r) {
vm.showList = false;
vm.title = "修改";
vm.dept = r.dept;
vm.getDept();
}
});
},
del: function () {
var deptId = getDeptId();
if (!deptId) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
type: "POST",
url: "../sys/dept/delete",
params: {"deptId": deptId},
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
saveOrUpdate: function (event) {
var url = vm.dept.deptId == null ? "../sys/dept/save" : "../sys/dept/update";
Ajax.request({
url: url,
contentType: "application/json",
params: JSON.stringify(vm.dept),
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
deptTree: function () {
openWindow({
title: "选择部门",
area: ['300px', '450px'],
content: jQuery("#sysDeptLayer"),
btn: ['确定', '取消'],
btn1: function (index) {
var node = ztree.getSelectedNodes();
//选择上级部门
vm.dept.parentId = node[0].deptId;
vm.dept.parentName = node[0].name;
layer.close(index);
}
});
},
reload: function () {
vm.showList = true;
TreeGrid.table.refresh();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
function getDeptId() {
var selected = $('#sysDeptGrid').bootstrapTreeTable('getSelections');
if (selected.length == 0) {
iview.Message.error("请选择一条记录");
return false;
} else {
return selected[0].id;
}
}
\ No newline at end of file
$(function () {
$("#sysDictGrid").Grid({
url: '../sys/dict/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '唯一标识', name: 'groupCode', index: 'group_code', width: 80},
{label: 'key', name: 'dictKey', index: 'dict_key', width: 80},
{label: 'value', name: 'dictValue', index: 'dict_value', width: 80},
{label: '备注', name: 'remark', index: 'remark', width: 80}]
});
});
let vm = new Vue({
el: '#sysDict',
data: {
showList: true,
title: null,
dict: {},
ruleValidate: {
groupCode: [
{required: true, message: '唯一标识不能为空', trigger: 'blur'}
]
},
q: {
groupCode: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.dict = {};
},
update: function (event) {
let id = getSelectedRow("#sysDictGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id)
},
saveOrUpdate: function (event) {
let url = vm.dict.id == null ? "../sys/dict/save" : "../sys/dict/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.dict),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#sysDictGrid");
if (ids == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/dict/delete",
params: JSON.stringify(ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function (id) {
Ajax.request({
url: "../sys/dict/info/" + id,
async: true,
successCallback: function (r) {
vm.dict = r.dict;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#sysDictGrid").jqGrid('getGridParam', 'page');
$("#sysDictGrid").jqGrid('setGridParam', {
postData: {'groupCode': vm.q.groupCode},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
groupCode: ''
}
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysDomainGrid").Grid({
url: '../sys/domain/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '域编码', name: 'domainCode', index: 'domain_code', width: 80},
{label: '域名称', name: 'domainName', index: 'domain_name', width: 80},
{label: '域地址', name: 'domainUrl', index: 'domain_url', width: 80},
{
label: '状态', name: 'domainStatus', index: 'domain_status', width: 80, formatter: function (value) {
return transStatus(value);
}
},
{
label: '创建时间', name: 'createTime', index: 'create_time', width: 80, formatter: function (value) {
return transDate(value);
}
},
{label: '备注', name: 'remark', index: 'remark', width: 80},
{
label: '图标', name: 'icon', index: 'icon', width: 80, formatter: function (value) {
if (!value) {
return '';
}
return '<i class="' + value + ' fa-lg">';
}
}]
});
});
let vm = new Vue({
el: '#sysDomain',
data: {
showList: true,
title: null,
domain: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
domainName: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.domain = {};
},
update: function (event) {
let id = getSelectedRow("#sysDomainGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id)
},
saveOrUpdate: function (event) {
let url = vm.domain.id == null ? "../sys/domain/save" : "../sys/domain/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.domain),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#sysDomainGrid");
if (ids == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/domain/delete",
params: JSON.stringify(ids),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function (id) {
Ajax.request({
url: "../sys/domain/info/" + id,
async: true,
successCallback: function (r) {
vm.domain = r.domain;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#sysDomainGrid").jqGrid('getGridParam', 'page');
$("#sysDomainGrid").jqGrid('setGridParam', {
postData: {'domainName': vm.q.domainName},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
domainName: ''
}
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysGeneratorGrid").Grid({
url: '../sys/generator/list',
colModel: [
{label: '表名', name: 'tableName', index: 'table_name', width: 100, key: true},
{label: 'Engine', name: 'engine', index: 'engine', width: 70},
{label: '表备注', name: 'tableComment', index: 'table_comment', width: 100},
{
label: '创建时间', name: 'createTime', index: 'create_time', width: 100, formatter: function (value) {
return transDate(value);
}
}
]
});
});
var vm = new Vue({
el: '#sysGenerator',
data: {
q: {
tableName: null
}
},
methods: {
query: function () {
$("#sysGeneratorGrid").jqGrid('setGridParam', {
postData: {'tableName': vm.q.tableName},
page: 1
}).trigger("reloadGrid");
},
reloadSearch: function () {
vm.q = {
tableName: ''
}
vm.query();
},
generator: function () {
var tableNames = getSelectedRows("#sysGeneratorGrid");
if (tableNames == null) {
return;
}
location.href = encodeURI("../sys/generator/code?tables=" + JSON.stringify(tableNames));
}
}
});
$(function () {
$("#sysLogGrid").Grid({
url: '../sys/log/list',
colModel: [
{label: 'id', name: 'id', key: true, hidden: true},
{label: '用户名', name: 'userName', index: 'user_name', width: 50},
{label: '用户操作', name: 'operation', index: 'operation', width: 70},
{label: '方法', name: 'title', index: 'title', width: 150},
{label: '请求参数', name: 'params', index: 'params', width: 80},
{label: 'IP地址', name: 'ip', index: 'ip', width: 70},
{
label: '创建时间', name: 'createDate', index: 'create_date', width: 90, formatter: function (value) {
return transDate(value);
}
}
]
});
});
var vm = new Vue({
el: '#sysLog',
data: {
q: {
key: null
},
isLogin: []
},
methods: {
query: function () {
vm.reload();
},
reload: function (event) {
let page = $("#sysLogGrid").jqGrid('getGridParam', 'page');
let operation = '';
if (vm.isLogin && vm.isLogin.length > 0) {
operation = vm.isLogin[0];
}
$("#sysLogGrid").jqGrid('setGridParam', {
postData: {'key': vm.q.key, 'operation': operation},
page: page
}).trigger("reloadGrid");
},
reloadSearch: function () {
vm.q = {
key: ''
}
vm.isLogin = [];
vm.query();
}
}
});
\ No newline at end of file
$(function () {
initialPage();
getGrid();
});
function initialPage() {
$(window).resize(function () {
TreeGrid.table.resetHeight({height: $(window).height() - 100});
});
}
function getGrid() {
var colunms = TreeGrid.initColumn();
var table = new TreeTable(TreeGrid.id, '../sys/menu/queryAll', colunms);
table.setExpandColumn(2);
table.setIdField("menuId");
table.setCodeField("menuId");
table.setParentCodeField("parentId");
table.setExpandAll(false);
table.setHeight($(window).height() - 100);
table.init();
TreeGrid.table = table;
}
var TreeGrid = {
id: "sysMenuGrid",
table: null,
layerIndex: -1
};
/**
* 初始化表格的列
*/
TreeGrid.initColumn = function () {
var columns = [
{field: 'selectItem', radio: true},
{title: '编号', field: 'menuId', visitable: false, align: 'center', valign: 'middle', width: '80px'},
{title: '名称', field: 'name', align: 'center', valign: 'middle', width: '180px'},
{title: '上级菜单', field: 'parentName', align: 'center', valign: 'middle', width: '100px'},
{
title: '图标',
field: 'icon',
align: 'center',
valign: 'middle',
width: '50px',
formatter: function (item, index) {
return item.icon == null ? '' : '<i class="' + item.icon + ' fa-lg"></i>';
}
},
{
title: '类型',
field: 'type',
align: 'center',
valign: 'middle',
width: '60px',
formatter: function (item) {
if (item.type === 0) {
return '<span class="label label-primary">目录</span>';
}
if (item.type === 1) {
return '<span class="label label-success">菜单</span>';
}
if (item.type === 2) {
return '<span class="label label-warning">按钮</span>';
}
}
},
{title: '排序', field: 'orderNum', align: 'center', valign: 'middle', width: '50px'},
{title: '菜单URL', field: 'url', align: 'center', valign: 'middle', width: '200px'},
{title: '授权标识', field: 'perms', align: 'center', valign: 'middle'},
{
title: '状态', field: 'status', align: 'center', valign: 'middle', width: '80px',
formatter: function (item) {
if (item.status === 1) {
return '<span class="label label-success">有效</span>';
}
return '<span class="label label-danger">无效</span>';
}
},
{title: '所属域', field: 'domainName', align: 'center', valign: 'middle'}];
return columns;
};
var setting = {
data: {
simpleData: {
enable: true,
idKey: "menuId",
pIdKey: "parentId",
rootPId: -1
},
key: {
url: "nourl"
}
}
};
var ztree;
var vm = new Vue({
el: '#sysMenu',
data: {
showList: true,
title: null,
menu: {
parentName: null,
parentId: 0,
type: 1,
orderNum: 0,
status: 1
},
q: {
menuName: '',
parentName: ''
},
ruleValidate: {
name: [
{required: true, message: '菜单名称不能为空', trigger: 'blur'}
],
url: [
{required: true, message: '菜单url不能为空', trigger: 'blur'}
],
parentName: [
{required: true, message: '上级菜单不能为空', trigger: 'blur'}
]
},
domainList: []
},
methods: {
selectIcon: function () {
openWindow({
type: 2,
title: '选取图标',
area: ['1030px', '500px'],
content: ['icon.html'],
btn: false
});
},
getDomains: function () {
Ajax.request({
url: '../sys/domain/queryAll',
params: {
'domainStatus': 1
},
async: true,
successCallback: function (r) {
vm.domainList = r.list;
}
});
},
getMenu: function (menuId) {
//加载菜单树
Ajax.request({
url: "../sys/menu/select",
async: true,
successCallback: function (r) {
ztree = $.fn.zTree.init($("#sysMenuTree"), setting, r.menuList);
var node = ztree.getNodeByParam("menuId", vm.menu.parentId);
if (node) {
ztree.selectNode(node);
vm.menu.parentName = node.name;
} else {
node = ztree.getNodeByParam("menuId", 0);
ztree.selectNode(node);
vm.menu.parentName = node.name;
}
}
});
},
add: function () {
vm.showList = false;
vm.title = "新增";
var menuId = TreeGrid.table.getSelectedRow();
var parentId = 0;
if (menuId.length != 0) {
parentId = menuId[0].id;
}
vm.menu = {parentName: null, parentId: parentId, type: 1, orderNum: 0, status: 1};
vm.getMenu();
vm.getDomains();
},
update: function (event) {
var menuId = TreeGrid.table.getSelectedRow();
if (menuId.length == 0) {
iview.Message.error("请选择一条记录");
return;
}
Ajax.request({
url: "../sys/menu/info/" + menuId[0].id,
async: true,
successCallback: function (r) {
vm.showList = false;
vm.title = "修改";
vm.menu = r.menu;
vm.getDomains();
vm.getMenu();
}
});
},
del: function (event) {
var menuIds = TreeGrid.table.getSelectedRow(), ids = [];
if (menuIds.length == 0) {
iview.Message.error("请选择一条记录");
return;
}
confirm('确定要删除选中的记录?', function () {
$.each(menuIds, function (idx, item) {
ids[idx] = item.id;
});
Ajax.request({
url: "../sys/menu/delete",
params: JSON.stringify(ids),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
saveOrUpdate: function (event) {
var url = vm.menu.menuId == null ? "../sys/menu/save" : "../sys/menu/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.menu),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
menuTree: function () {
openWindow({
title: "选择菜单",
area: ['300px', '450px'],
content: jQuery("#sysMenuLayer"),
btn: ['确定', '取消'],
btn1: function (index) {
var node = ztree.getSelectedNodes();
//选择上级菜单
vm.menu.parentId = node[0].menuId;
vm.menu.parentName = node[0].name;
layer.close(index);
}
});
},
query: function () {
vm.reload();
},
reload: function (event) {
vm.showList = true;
TreeGrid.table.refresh();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysOssGrid").Grid({
url: '../sys/oss/list',
colModel: [
{label: 'id', name: 'id', key: true, hidden: true},
{label: 'URL地址', name: 'url', index: 'url', width: 160},
{
label: '创建时间', name: 'createTime', index: 'create_time', width: 40, formatter: function (value) {
return transDate(value);
}
}
]
});
new AjaxUpload('#upload', {
action: '../sys/oss/upload',
name: 'file',
autoSubmit: true,
responseType: "json",
onSubmit: function (file, extension) {
if (vm.config.type == null) {
alert("云存储配置未配置");
return false;
}
if (!(extension && /^(jpg|jpeg|png|gif)$/.test(extension.toLowerCase()))) {
alert('只支持jpg、png、gif格式的图片!');
return false;
}
},
onComplete: function (file, r) {
if (r.code == 0) {
alert(r.url);
vm.reload();
} else {
alert(r.msg);
}
}
});
});
var vm = new Vue({
el: '#sysOss',
data: {
showList: true,
title: null,
config: {},
aliRuleValidate: {
aliyunDomain: [
{required: true, message: '阿里云绑定的域名不能为空', trigger: 'blur'}
],
aliyunAccessKeyId: [
{required: true, message: '阿里云AccessKeyId不能为空', trigger: 'blur'}
],
aliyunAccessKeySecret: [
{required: true, message: '阿里云AccessKeySecret不能为空', trigger: 'blur'}
],
aliyunBucketName: [
{required: true, message: '阿里云BucketName不能为空', trigger: 'blur'}
]
},
qcloudRuleValidate: {
qcloudDomain: [
{required: true, message: '腾讯云绑定的域名不能为空', trigger: 'blur'}
],
qcloudAppId: [
{required: true, message: '腾讯云AppId不能为空', trigger: 'blur'}
],
qcloudSecretId: [
{required: true, message: '腾讯云SecretId不能为空', trigger: 'blur'}
],
qcloudSecretKey: [
{required: true, message: '腾讯云SecretKey不能为空', trigger: 'blur'}
],
qcloudBucketName: [
{required: true, message: '腾讯云BucketName不能为空', trigger: 'blur'}
],
qcloudRegion: [
{required: true, message: 'Bucket所属地区不能为空', trigger: 'blur'}
]
}
},
created: function () {
this.getConfig();
},
methods: {
query: function () {
vm.reload();
},
getConfig: function () {
Ajax.request({
url: "../sys/oss/config",
async: true,
successCallback: function (r) {
vm.config = r.config;
}
});
},
addConfig: function () {
vm.showList = false;
vm.title = "云存储配置";
},
saveOrUpdate: function () {
var url = "../sys/oss/saveConfig";
Ajax.request({
url: url,
params: JSON.stringify(vm.config),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function () {
var ossIds = getSelectedRows("#sysOssGrid");
if (ossIds == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/oss/delete",
params: JSON.stringify(ossIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
lookImg: function () {
var grid = $("#sysOssGrid");
var id = grid.jqGrid('getGridParam', 'selrow');//根据点击行获得点击行的id(id为jsonReader: {id: "id" },)
if (!id) {
alert("请选择一条记录");
return;
}
var ids = grid.jqGrid('getGridParam', 'selarrrow');
var data = [];
for (var i = 0; i < ids.length; i++) {
id = ids[i];
var rowData = grid.jqGrid("getRowData", id);
var url = rowData.url;
data.push({"src": url});
}
eyeImages(data);
},
reload: function () {
vm.showList = true;
var page = $("#sysOssGrid").jqGrid('getGridParam', 'page');
$("#sysOssGrid").jqGrid('setGridParam', {
page: page
}).trigger("reloadGrid");
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysRoleGrid").Grid({
url: '../sys/role/list',
colModel: [
{label: '角色ID', name: 'roleId', index: "role_id", key: true, hidden: true},
{label: '角色名称', name: 'roleName', index: "role_id", width: 75},
{label: '所属部门', name: 'deptName', index: "dept_id", width: 75},
{label: '备注', name: 'remark', width: 100},
{
label: '创建时间', name: 'createTime', index: "create_time", width: 80, formatter: function (value) {
return transDate(value);
}
}
]
});
});
//菜单树
var menu_ztree;
var menu_setting = {
data: {
simpleData: {
enable: true,
idKey: "menuId",
pIdKey: "parentId",
rootPId: -1
},
key: {
url: "nourl"
}
},
check: {
enable: true,
nocheckInherit: true
}
};
//部门结构树
var dept_ztree;
var dept_setting = {
data: {
simpleData: {
enable: true,
idKey: "deptId",
pIdKey: "parentId",
rootPId: -1
},
key: {
url: "nourl"
}
}
};
//数据树
var data_ztree;
var data_setting = {
data: {
simpleData: {
enable: true,
idKey: "deptId",
pIdKey: "parentId",
rootPId: -1
},
key: {
url: "nourl"
}
},
check: {
enable: true,
nocheckInherit: true,
chkboxType: {"Y": "", "N": ""}
}
};
var vm = new Vue({
el: '#sysRole',
data: {
q: {
roleName: null
},
showList: true,
title: null,
role: {deptId: '', deptName: ''},
ruleValidate: {
roleName: [
{required: true, message: '角色名称不能为空', trigger: 'blur'}
]
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.role = {deptId: '', deptName: ''};
vm.getMenuTree(null);
vm.getDept();
vm.getDataTree();
},
update: function () {
var roleId = getSelectedRow("#sysRoleGrid");
if (roleId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getDataTree();
vm.getMenuTree(roleId);
},
del: function (event) {
var roleIds = getSelectedRows("#sysRoleGrid");
if (roleIds == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/role/delete",
params: JSON.stringify(roleIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getRole: function (roleId) {
Ajax.request({
url: "../sys/role/info/" + roleId,
async: true,
successCallback: function (r) {
vm.role = r.role;
vm.getDept();
//勾选角色所拥有的菜单
var menuIds = vm.role.menuIdList;
for (var i = 0; i < menuIds.length; i++) {
var node = menu_ztree.getNodeByParam("menuId", menuIds[i]);
menu_ztree.checkNode(node, true, false);
}
//勾选角色所拥有的部门数据权限
var deptIds = vm.role.deptIdList;
for (var i = 0; i < deptIds.length; i++) {
var node = data_ztree.getNodeByParam("deptId", deptIds[i]);
data_ztree.checkNode(node, true, false);
}
}
});
},
saveOrUpdate: function (event) {
//获取选择的菜单
var nodes = menu_ztree.getCheckedNodes(true);
var menuIdList = new Array();
for (var i = 0; i < nodes.length; i++) {
menuIdList.push(nodes[i].menuId);
}
vm.role.menuIdList = menuIdList;
//获取选择的数据
var nodes = data_ztree.getCheckedNodes(true);
var deptIdList = new Array();
for (var i = 0; i < nodes.length; i++) {
deptIdList.push(nodes[i].deptId);
}
vm.role.deptIdList = deptIdList;
var url = vm.role.roleId == null ? "../sys/role/save" : "../sys/role/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.role),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
getMenuTree: function (roleId) {
//加载菜单树
Ajax.request({
url: "../sys/menu/perms",
async: true,
successCallback: function (r) {
menu_ztree = $.fn.zTree.init($("#menuTree"), menu_setting, r.menuList);
//展开所有节点
menu_ztree.expandAll(true);
if (roleId != null) {
vm.getRole(roleId);
}
}
});
},
getDataTree: function () {
//加载菜单树
Ajax.request({
url: "../sys/dept/list",
async: true,
successCallback: function (r) {
data_ztree = $.fn.zTree.init($("#dataTree"), data_setting, r.list);
//展开所有节点
data_ztree.expandAll(true);
}
});
},
getDept: function () {
//加载部门树
Ajax.request({
url: "../sys/dept/list",
async: true,
successCallback: function (r) {
dept_ztree = $.fn.zTree.init($("#sysRoleTree"), dept_setting, r.list);
var node = dept_ztree.getNodeByParam("deptId", vm.role.deptId);
if (node != null) {
dept_ztree.selectNode(node);
vm.role.deptName = node.name;
}
}
});
},
selectDeptTree: function () {
openWindow({
title: "选择部门",
area: ['300px', '450px'],
content: jQuery("#sysRoleLayer"),
btn: ['确定', '取消'],
btn1: function (index) {
var node = dept_ztree.getSelectedNodes();
//选择上级部门
vm.role.deptId = node[0].deptId;
vm.role.deptName = node[0].name;
layer.close(index);
}
});
},
reload: function (event) {
vm.showList = true;
var page = $("#sysRoleGrid").jqGrid('getGridParam', 'page');
$("#sysRoleGrid").jqGrid('setGridParam', {
postData: {'roleName': vm.q.roleName},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
roleName: ''
}
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysScheduleGrid").Grid({
url: '../sys/schedule/list',
colModel: [
{label: '任务ID', name: 'jobId', index: 'job_id', width: 60, key: true},
{label: 'bean名称', name: 'beanName', index: 'bean_name', width: 100},
{label: '方法名称', name: 'methodName', index: 'method_name', width: 100},
{label: '参数', name: 'params', index: 'params', width: 100},
{label: 'cron表达式 ', name: 'cronExpression', index: 'cron_expression', width: 100},
{label: '备注 ', name: 'remark', index: 'remark', width: 100},
{
label: '状态', name: 'status', index: 'status', width: 60, formatter: function (value, options, row) {
return value === 0 ?
'<span class="label label-success">正常</span>' :
'<span class="label label-danger">暂停</span>';
}
}
]
});
});
var vm = new Vue({
el: '#sysSchedule',
data: {
q: {
beanName: null
},
showList: true,
title: null,
schedule: {},
ruleValidate: {
beanName: [
{required: true, message: 'bean名称不能为空', trigger: 'blur'}
],
methodName: [
{required: true, message: '方法名称不能为空', trigger: 'blur'}
],
cronExpression: [
{required: true, message: 'cron表达式不能为空', trigger: 'blur'}
]
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.schedule = {};
},
update: function () {
var jobId = getSelectedRow("#sysScheduleGrid");
if (jobId == null) {
return;
}
Ajax.request({
url: "../sys/schedule/info/" + jobId,
async: true,
successCallback: function (r) {
vm.showList = false;
vm.title = "修改";
vm.schedule = r.schedule;
}
});
},
saveOrUpdate: function (event) {
var url = vm.schedule.jobId == null ? "../sys/schedule/save" : "../sys/schedule/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.schedule),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
var jobIds = getSelectedRows("#sysScheduleGrid");
if (jobIds == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../sys/schedule/delete",
params: JSON.stringify(jobIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
pause: function (event) {
var jobIds = getSelectedRows("#sysScheduleGrid");
if (jobIds == null) {
return;
}
confirm('确定要暂停选中的记录?', function () {
Ajax.request({
url: "../sys/schedule/pause",
params: JSON.stringify(jobIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
resume: function (event) {
var jobIds = getSelectedRows("#sysScheduleGrid");
if (jobIds == null) {
return;
}
confirm('确定要恢复选中的记录?', function () {
Ajax.request({
url: "../sys/schedule/resume",
params: JSON.stringify(jobIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
runOnce: function (event) {
var jobIds = getSelectedRows("#sysScheduleGrid");
if (jobIds == null) {
return;
}
confirm('确定要立即执行选中的记录?', function () {
Ajax.request({
url: "../sys/schedule/run",
params: JSON.stringify(jobIds),
contentType: "application/json",
type: 'POST',
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
reload: function (event) {
vm.showList = true;
var page = $("#sysScheduleGrid").jqGrid('getGridParam', 'page');
$("#sysScheduleGrid").jqGrid('setGridParam', {
postData: {'beanName': vm.q.beanName},
page: page
}).trigger("reloadGrid");
},
reloadSearch: function () {
vm.q = {
beanName: ''
}
vm.query();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#sysScheduleLogGrid").Grid({
url: '../sys/scheduleLog/list',
colModel: [
{label: '日志ID', name: 'logId', index: 'log_id', key: true, hidden: true},
{label: '任务ID', name: 'jobId', index: 'job_id', width: 50},
{label: 'bean名称', name: 'beanName', index: 'bean_name', width: 60},
{label: '方法名称', name: 'methodName', index: 'method_name', width: 60},
{label: '参数', name: 'params', index: 'params', width: 60},
{
label: '状态', name: 'status', index: 'status', width: 50, formatter: function (value, options, row) {
return value === 0 ?
'<span class="label label-success">成功</span>' :
'<span class="label label-danger pointer" onclick="vm.showError(' + row.logId + ')">失败</span>';
}
},
{label: '耗时(单位:毫秒)', name: 'times', index: 'times', width: 70},
{
label: '执行时间', name: 'createTime', index: 'create_time', width: 80, formatter: function (value) {
return transDate(value);
}
}
],
footerrow: true,
gridComplete: function () {
var rowNum = parseInt($(this).getGridParam('records'), 10);
if (rowNum > 0) {
$(".ui-jqgrid-sdiv").show();
var times = jQuery(this).getCol('times', false, 'sum');
$(this).footerData("set", {
"jobId": "<font color='red'>合计<font>",
"times": "<font color='red'>" + times + "<font>"
});
} else {
$(".ui-jqgrid-sdiv").hide();
}
}
});
});
var vm = new Vue({
el: '#sysScheduleLog',
data: {
q: {
jobId: null
}
},
methods: {
query: function () {
$("#sysScheduleLogGrid").jqGrid('setGridParam', {
postData: {'jobId': vm.q.jobId},
page: 1
}).trigger("reloadGrid");
},
reloadSearch: function () {
vm.q = {
jobId: ''
}
vm.query();
},
showError: function (logId) {
Ajax.request({
url: "../sys/scheduleLog/info/" + logId,
successCallback: function (r) {
openWindow({
title: '失败信息',
area: ['600px', '400px'],
shadeClose: true,
content: r.log.error
});
}
});
},
back: function (event) {
history.go(-1);
}
}
});
$(function () {
$("#sysSmsLogGrid").Grid({
url: '../sys/smslog/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '操作人', name: 'userName', index: 'user_id', width: 80},
{label: '发送编号', name: 'sendId', index: 'send_id', width: 80},
{label: '发送内容', name: 'content', index: 'content', width: 80},
{
label: '发送时间', name: 'stime', index: 'stime', width: 100, formatter: function (value) {
return transDate(value, 'yyyy-MM-dd hh:mm:ss');
}
},
{label: '用户签名', name: 'sign', index: 'sign', width: 80},
{
label: '发送状态', name: 'sendStatus', index: 'send_status', width: 80, formatter: function (value) {
if (value === 0) {
return '<span class="label label-success">成功</span>';
}
return '<span class="label label-danger">失败</span>';
}
},
{label: '无效号码数', name: 'invalidNum', index: 'invalid_num', width: 80},
{label: '成功提交数', name: 'successNum', index: 'success_num', width: 80},
{label: '黑名单数', name: 'blackNum', index: 'black_num', width: 80},
{label: '返回消息', name: 'returnMsg', index: 'return_msg', width: 100}]
});
});
let vm = new Vue({
el: '#sysSmsLog',
data: {
showList: true,
title: null,
config: {},
ruleValidate: {
domain: [
{required: true, message: '发送域名不能为空', trigger: 'blur'}
],
name: [
{required: true, message: '用户名不能为空', trigger: 'blur'}
],
pwd: [
{required: true, message: '接口密钥不能为空', trigger: 'blur'}
],
sign: [
{required: true, message: '签名不能为空', trigger: 'blur'}
]
},
q: {
sendId: ''
}
},
methods: {
query: function () {
vm.reload();
},
addConfig: function (event) {
vm.showList = false;
vm.title = "短信配置";
vm.getConfig();
},
updateConfig: function (event) {
let url = "../sys/smslog/saveConfig";
Ajax.request({
url: url,
params: JSON.stringify(vm.config),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
getConfig: function () {
Ajax.request({
url: "../sys/smslog/config",
async: true,
successCallback: function (r) {
vm.config = r.config;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#sysSmsLogGrid").jqGrid('getGridParam', 'page');
$("#sysSmsLogGrid").jqGrid('setGridParam', {
postData: {'sendId': vm.q.sendId},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
sendId: ''
}
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.updateConfig()
});
},
handleReset: function (name) {
handleResetForm(this, name);
},
sendSms: function () {
openWindow({
type: 2,
title: '发送短信',
area: ['1030px', '500px'],
content: ['sendsms.html'],
cancel: function (index) {
vm.reload();
}
});
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfaddress/list',
colModel: [
{label: 'addressId', name: 'addressId', index: 'address_id', key: true, hidden: true},
{label: '用户id', name: 'userId', index: 'user_id', width: 80},
{label: '收货人', name: 'deliveryName', index: 'delivery_name', width: 80},
{label: '联系电话', name: 'phone', index: 'phone', width: 80},
{label: '是否为默认地址', name: 'defaultFlag', index: 'default_flag', width: 80},
{label: '地址详情', name: 'addressDetail', index: 'address_detail', width: 80},
{label: '所在国家code', name: 'addressCountryCode', index: 'address_country_code', width: 80},
{label: '所在国家', name: 'addressCountryName', index: 'address_country_name', width: 80},
{label: '所在州code', name: 'addressStateCode', index: 'address_state_code', width: 80},
{label: '所在州', name: 'addressStateName', index: 'address_state_name', width: 80},
{label: '所在区code', name: 'addressAreaCode', index: 'address_area_code', width: 80},
{label: '所在区', name: 'addressAreaName', index: 'address_area_name', width: 80},
{label: '标签code', name: 'labelCode', index: 'label_code', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
{label: '修改时间', name: 'updateTime', index: 'update_time', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfAddress: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfAddress = {};
},
update: function (event) {
let addressId = getSelectedRow("#jqGrid");
if (addressId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(addressId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfAddress.addressId == null ? "../tbcfaddress/save" : "../tbcfaddress/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfAddress),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let addressIds = getSelectedRows("#jqGrid");
if (addressIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfaddress/delete",
params: JSON.stringify(addressIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(addressId){
Ajax.request({
url: "../tbcfaddress/info/"+addressId,
async: true,
successCallback: function (r) {
vm.tbCfAddress = r.tbCfAddress;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfcartrecordr/list',
colModel: [
{label: 'cartRecordId', name: 'cartRecordId', index: 'cart_record_id', key: true, hidden: true},
{label: '商品id', name: 'itemId', index: 'item_id', width: 80},
{label: '用户id', name: 'userId', index: 'user_id', width: 80},
{label: '是否已经被勾选,0未勾选,1勾选', name: 'checkFlag', index: 'check_flag', width: 80},
{label: '是否有效', name: 'enableFlag', index: 'enable_flag', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfCartRecordR: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfCartRecordR = {};
},
update: function (event) {
let cartRecordId = getSelectedRow("#jqGrid");
if (cartRecordId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(cartRecordId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfCartRecordR.cartRecordId == null ? "../tbcfcartrecordr/save" : "../tbcfcartrecordr/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfCartRecordR),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let cartRecordIds = getSelectedRows("#jqGrid");
if (cartRecordIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfcartrecordr/delete",
params: JSON.stringify(cartRecordIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(cartRecordId){
Ajax.request({
url: "../tbcfcartrecordr/info/"+cartRecordId,
async: true,
successCallback: function (r) {
vm.tbCfCartRecordR = r.tbCfCartRecordR;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfcontact/list',
colModel: [
{label: 'contactId', name: 'contactId', index: 'contact_id', key: true, hidden: true},
{label: '联系方式', name: 'contactWay', index: 'contact_way', width: 80},
{label: '联系详情', name: 'contactDetail', index: 'contact_detail', width: 80},
{label: '是否有效', name: 'enableFlag', index: 'enable_flag', width: 80,formatter:yesOrNoFormat}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfContact: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfContact = {};
},
update: function (event) {
let contactId = getSelectedRow("#jqGrid");
if (contactId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(contactId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfContact.contactId == null ? "../tbcfcontact/save" : "../tbcfcontact/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfContact),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let contactIds = getSelectedRows("#jqGrid");
if (contactIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfcontact/delete",
params: JSON.stringify(contactIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(contactId){
Ajax.request({
url: "../tbcfcontact/info/"+contactId,
async: true,
successCallback: function (r) {
vm.tbCfContact = r.tbCfContact;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfcountryconfig/list',
colModel: [
{label: 'configId', name: 'configId', index: 'config_id', key: true, hidden: true},
{label: '地区编号', name: 'locationCode', index: 'location_code', width: 80},
{label: '地区类型', name: 'locationType', index: 'location_type', width: 80},
{label: '地区名称', name: 'locationName', index: 'location_name', width: 80},
{label: '上级编号', name: 'parentCode', index: 'parent_code', width: 80},
{label: '英文名', name: 'englishName', index: 'english_name', width: 80},
{label: '缩写名', name: 'shortName', index: 'short_name', width: 80},
{label: '是否有下一级', name: 'endFlag', index: 'end_flag', width: 80},
{label: '是否启用', name: 'enableFlag', index: 'enable_flag', width: 80,formatter:yesOrNoFormat}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfCountryConfig: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfCountryConfig = {};
},
update: function (event) {
let configId = getSelectedRow("#jqGrid");
if (configId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(configId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfCountryConfig.configId == null ? "../tbcfcountryconfig/save" : "../tbcfcountryconfig/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfCountryConfig),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let configIds = getSelectedRows("#jqGrid");
if (configIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfcountryconfig/delete",
params: JSON.stringify(configIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(configId){
Ajax.request({
url: "../tbcfcountryconfig/info/"+configId,
async: true,
successCallback: function (r) {
vm.tbCfCountryConfig = r.tbCfCountryConfig;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
差异被折叠。
$(function () {
$("#jqGrid").Grid({
url: '../tbcfcouponcategory/list',
colModel: [
{label: 'couponCategoryId', name: 'couponCategoryId', index: 'coupon_category_id', key: true, hidden: true},
{label: '优惠券类型名称 ', name: 'couponCategoryName', index: 'coupon_category_name', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfCouponCategory: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
handleSubmit2(){
console.log(111)
},
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfCouponCategory = {};
},
update: function (event) {
let couponCategoryId = getSelectedRow("#jqGrid");
if (couponCategoryId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(couponCategoryId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfCouponCategory.couponCategoryId == null ? "../tbcfcouponcategory/save" : "../tbcfcouponcategory/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfCouponCategory),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let couponCategoryIds = getSelectedRows("#jqGrid");
if (couponCategoryIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfcouponcategory/delete",
params: JSON.stringify(couponCategoryIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(couponCategoryId){
Ajax.request({
url: "../tbcfcouponcategory/info/"+couponCategoryId,
async: true,
successCallback: function (r) {
vm.tbCfCouponCategory = r.tbCfCouponCategory;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfcouponuse/list',
colModel: [
{label: 'useId', name: 'useId', index: 'use_id', key: true, hidden: true},
{label: '用户名称', name: 'name', index: 'name', width: 80},
{label: '优惠券名称', name: 'title', index: 'title', width: 80},
{label: '使用时间', name: 'useTime', index: 'use_time', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfCouponUse: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
handleSubmit1(){
console.log(111)
},
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfCouponUse = {};
},
update: function (event) {
let useId = getSelectedRow("#jqGrid");
if (useId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(useId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfCouponUse.useId == null ? "../tbcfcouponuse/save" : "../tbcfcouponuse/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfCouponUse),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let useIds = getSelectedRows("#jqGrid");
if (useIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfcouponuse/delete",
params: JSON.stringify(useIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(useId){
Ajax.request({
url: "../tbcfcouponuse/info/"+useId,
async: true,
successCallback: function (r) {
vm.tbCfCouponUse = r.tbCfCouponUse;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfdailyfinance/list',
colModel: [
{label: 'statisticsId', name: 'statisticsId', index: 'statistics_id', key: true, hidden: true},
{label: '下单数', name: 'orderCount', index: 'order_count', width: 80},
{label: '下单用户数', name: 'userCount', index: 'user_count', width: 80},
{label: '下单商品数', name: 'itemCount', index: 'item_count', width: 80},
{label: '平均价格', name: 'itemAveragePrice', index: 'item_average_price', width: 80},
{label: '下单总额', name: 'totalSales', index: 'total_sales', width: 80},
{label: '统计时间', name: 'statisticsTime', index: 'statistics_time', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfDailyFinance: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfDailyFinance = {};
},
update: function (event) {
let statisticsId = getSelectedRow("#jqGrid");
if (statisticsId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(statisticsId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfDailyFinance.statisticsId == null ? "../tbcfdailyfinance/save" : "../tbcfdailyfinance/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfDailyFinance),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let statisticsIds = getSelectedRows("#jqGrid");
if (statisticsIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfdailyfinance/delete",
params: JSON.stringify(statisticsIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(statisticsId){
Ajax.request({
url: "../tbcfdailyfinance/info/"+statisticsId,
async: true,
successCallback: function (r) {
vm.tbCfDailyFinance = r.tbCfDailyFinance;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfdescripiton/list',
colModel: [
{label: 'descripitionId', name: 'descripitionId', index: 'descripition_id', key: true, hidden: true},
{label: '商品品名', name: 'descripitionName', index: 'descripition_name', width: 80},
{label: '海关编码', name: 'descripitionCode', index: 'descripition_code', width: 80},
{label: '商品一级分类标题', name: 'goodtype', index: 'goodtype', width: 80},
{label: '商品二级分类标题', name: 'title', index: 'title', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfDescripiton: {},
Goodstype2:null,
Goodstype:null,
GoodstypeTwo:null,
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
changeGoodstype(){
let url = `/africa_shop/tbcfdescripiton/queryByItemType?typeId=${this.tbCfDescripiton.goodstypeId}`
console.log('url',url)
let that = this;
Ajax.request({
url: url,
type: "get",
contentType: "application/json",
successCallback: function (r) {
console.log('res',r)
if(r.code===0){
that.Goodstype2 = r.list
console.log(that.Goodstype2)
}
}
});
},
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfDescripiton = {};
},
update: function (event) {
let descripitionId = getSelectedRow("#jqGrid");
if (descripitionId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(descripitionId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfDescripiton.descripitionId == null ? "../tbcfdescripiton/save" : "../tbcfdescripiton/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfDescripiton),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let descripitionIds = getSelectedRows("#jqGrid");
if (descripitionIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfdescripiton/delete",
params: JSON.stringify(descripitionIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(descripitionId){
Ajax.request({
url: "../tbcfdescripiton/info/"+descripitionId,
async: true,
successCallback: function (r) {
vm.tbCfDescripiton = r.tbCfDescripiton;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
},
created() {
var that = this
$.get('../tbcfgoodstype/queryAll', function (res) {
// console.log(that,"this");
that.Goodstype = res.list;
// console.log(that.Goodstype);
});
$.get('../tbcfgoodstwotype/queryAll', function (res) {
// console.log(that,"this");
that.GoodstypeTwo = res.list;
// console.log(res);
});
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfexpresstemplate/list',
colModel: [
{label: 'templateId', name: 'templateId', index: 'template_id', key: true, hidden: true},
{label: '模板标题', name: 'templateTitle', index: 'template_title', width: 80},
{label: '商品类型 暂无用,用tb_cf_exp_cat_rel关联', name: 'itemCategoryId', index: 'item_category_id', width: 80, hidden: true},
{label: '快递费', name: 'expressFee', index: 'express_fee', width: 80},
{label: '国家编号', name: 'countryCode', index: 'country_code', width: 80, hidden: true},
{label: '创建日期', name: 'createTime', index: 'create_time', width: 80, hidden: true}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfExpressTemplate: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfExpressTemplate = {};
},
update: function (event) {
let templateId = getSelectedRow("#jqGrid");
if (templateId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(templateId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfExpressTemplate.templateId == null ? "../tbcfexpresstemplate/save" : "../tbcfexpresstemplate/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfExpressTemplate),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let templateIds = getSelectedRows("#jqGrid");
if (templateIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfexpresstemplate/delete",
params: JSON.stringify(templateIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(templateId){
Ajax.request({
url: "../tbcfexpresstemplate/info/"+templateId,
async: true,
successCallback: function (r) {
vm.tbCfExpressTemplate = r.tbCfExpressTemplate;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfexptemkeyword/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '模板id,express_template', name: 'templateId', index: 'template_id', width: 80},
{label: '关键字', name: 'keyword', index: 'keyword', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfExpTemKeyword: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfExpTemKeyword = {};
},
update: function (event) {
let id = getSelectedRow("#jqGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id);
},
saveOrUpdate: function (event) {
let url = vm.tbCfExpTemKeyword.id == null ? "../tbcfexptemkeyword/save" : "../tbcfexptemkeyword/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfExpTemKeyword),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#jqGrid");
if (ids == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfexptemkeyword/delete",
params: JSON.stringify(ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(id){
Ajax.request({
url: "../tbcfexptemkeyword/info/"+id,
async: true,
successCallback: function (r) {
vm.tbCfExpTemKeyword = r.tbCfExpTemKeyword;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcffee/list',
colModel: [
{label: 'feeId', name: 'feeId', index: 'fee_id', key: true, hidden: true},
//{label: '收费类型,1为百分比,目前只有一种收费方式', name: 'feeType', index: 'fee_type', width: 80},
//{label: '是否生效标志', name: 'enableFlag', index: 'enable_flag', width: 80},
{label: '收取费用百分比', name: 'feePercent', index: 'fee_percent', width: 80},
{label: '设置美元转换', name: 'feeRate', index: 'fee_rate', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfFee: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfFee = {};
},
update: function (event) {
let feeId = getSelectedRow("#jqGrid");
if (feeId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(feeId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfFee.feeId == null ? "../tbcffee/save" : "../tbcffee/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfFee),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let feeIds = getSelectedRows("#jqGrid");
if (feeIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcffee/delete",
params: JSON.stringify(feeIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(feeId){
Ajax.request({
url: "../tbcffee/info/"+feeId,
async: true,
successCallback: function (r) {
vm.tbCfFee = r.tbCfFee;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcffeedback/list',
colModel: [
{label: 'feedbackId', name: 'feedbackId', index: 'feedback_id', key: true, hidden: true},
{label: '问题', name: 'question', index: 'question', width: 80},
{label: '是否展示,1展示,0不展示', name: 'enableFlag', index: 'enable_flag', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80, hidden: true},
{label: '反馈问题类型,1为填写类型', name: 'questionType', index: 'question_type', width: 80, hidden: true},
{label: '排序,数字,倒序', name: 'sort', index: 'sort', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfFeedback: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfFeedback = {};
},
update: function (event) {
let feedbackId = getSelectedRow("#jqGrid");
if (feedbackId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(feedbackId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfFeedback.feedbackId == null ? "../tbcffeedback/save" : "../tbcffeedback/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfFeedback),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let feedbackIds = getSelectedRows("#jqGrid");
if (feedbackIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcffeedback/delete",
params: JSON.stringify(feedbackIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(feedbackId){
Ajax.request({
url: "../tbcffeedback/info/"+feedbackId,
async: true,
successCallback: function (r) {
vm.tbCfFeedback = r.tbCfFeedback;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcffeedbackrecord/list',
colModel: [
{label: 'recordId', name: 'recordId', index: 'record_id', key: true, hidden: true},
{label: '反馈用户id', name: 'userId', index: 'user_id', width: 80},
{label: '反馈问题id', name: 'feedbackId', index: 'feedback_id', width: 80},
{label: '反馈填写内容', name: 'answer', index: 'answer', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfFeedbackRecord: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfFeedbackRecord = {};
},
update: function (event) {
let recordId = getSelectedRow("#jqGrid");
if (recordId == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(recordId);
},
saveOrUpdate: function (event) {
let url = vm.tbCfFeedbackRecord.recordId == null ? "../tbcffeedbackrecord/save" : "../tbcffeedbackrecord/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfFeedbackRecord),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let recordIds = getSelectedRows("#jqGrid");
if (recordIds == null){
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcffeedbackrecord/delete",
params: JSON.stringify(recordIds),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function(recordId){
Ajax.request({
url: "../tbcffeedbackrecord/info/"+recordId,
async: true,
successCallback: function (r) {
vm.tbCfFeedbackRecord = r.tbCfFeedbackRecord;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function() {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论