Compare commits
2 Commits
00a54db6bc
...
61821f8d6e
Author | SHA1 | Date |
---|---|---|
deng | 61821f8d6e | 5 months ago |
罗玲玲 | 0e4bd6901d | 5 months ago |
@ -0,0 +1,213 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
import com.service.StoreupService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/storeup")
|
||||
public class StoreupController {
|
||||
@Autowired
|
||||
private StoreupService storeupService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup, HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup, HttpServletRequest request){
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( StoreupEntity storeup){
|
||||
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
return R.ok().put("data", storeupService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(StoreupEntity storeup){
|
||||
EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
|
||||
StoreupView storeupView = storeupService.selectView(ew);
|
||||
return R.ok("查询收藏表成功").put("data", storeupView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
StoreupEntity storeup = storeupService.selectById(id);
|
||||
return R.ok().put("data", storeup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
|
||||
storeupService.insert(storeup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(storeup);
|
||||
storeupService.updateById(storeup);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
storeupService.deleteBatchIds(Arrays.asList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提醒接口
|
||||
*/
|
||||
@RequestMapping("/remind/{columnName}/{type}")
|
||||
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
|
||||
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
|
||||
map.put("column", columnName);
|
||||
map.put("type", type);
|
||||
|
||||
if(type.equals("2")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar c = Calendar.getInstance();
|
||||
Date remindStartDate = null;
|
||||
Date remindEndDate = null;
|
||||
if(map.get("remindstart")!=null) {
|
||||
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
|
||||
c.setTime(new Date());
|
||||
c.add(Calendar.DAY_OF_MONTH,remindStart);
|
||||
remindStartDate = c.getTime();
|
||||
map.put("remindstart", sdf.format(remindStartDate));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
|
||||
c.setTime(new Date());
|
||||
c.add(Calendar.DAY_OF_MONTH,remindEnd);
|
||||
remindEndDate = c.getTime();
|
||||
map.put("remindend", sdf.format(remindEndDate));
|
||||
}
|
||||
}
|
||||
|
||||
Wrapper<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
|
||||
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
|
||||
}
|
||||
|
||||
|
||||
int count = storeupService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,216 @@
|
||||
package com.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.utils.ValidatorUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.annotation.IgnoreAuth;
|
||||
|
||||
import com.entity.WeixiuchuliEntity;
|
||||
import com.entity.view.WeixiuchuliView;
|
||||
|
||||
import com.service.WeixiuchuliService;
|
||||
import com.service.TokenService;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.R;
|
||||
import com.utils.MD5Util;
|
||||
import com.utils.MPUtil;
|
||||
import com.utils.CommonUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 维修处理
|
||||
* 后端接口
|
||||
* @author
|
||||
* @email
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/weixiuchuli")
|
||||
public class WeixiuchuliController {
|
||||
@Autowired
|
||||
private WeixiuchuliService weixiuchuliService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端列表
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(@RequestParam Map<String, Object> params,WeixiuchuliEntity weixiuchuli, HttpServletRequest request){
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("fangzhu")) {
|
||||
weixiuchuli.setFangzhuzhanghao((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
if(tableName.equals("yonghu")) {
|
||||
weixiuchuli.setYonghuming((String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
|
||||
PageUtils page = weixiuchuliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiuchuli), params), params));
|
||||
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params,WeixiuchuliEntity weixiuchuli, HttpServletRequest request){
|
||||
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
|
||||
PageUtils page = weixiuchuliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiuchuli), params), params));
|
||||
return R.ok().put("data", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/lists")
|
||||
public R list( WeixiuchuliEntity weixiuchuli){
|
||||
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( weixiuchuli, "weixiuchuli"));
|
||||
return R.ok().put("data", weixiuchuliService.selectListView(ew));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@RequestMapping("/query")
|
||||
public R query(WeixiuchuliEntity weixiuchuli){
|
||||
EntityWrapper< WeixiuchuliEntity> ew = new EntityWrapper< WeixiuchuliEntity>();
|
||||
ew.allEq(MPUtil.allEQMapPre( weixiuchuli, "weixiuchuli"));
|
||||
WeixiuchuliView weixiuchuliView = weixiuchuliService.selectView(ew);
|
||||
return R.ok("查询维修处理成功").put("data", weixiuchuliView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后端详情
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
WeixiuchuliEntity weixiuchuli = weixiuchuliService.selectById(id);
|
||||
return R.ok().put("data", weixiuchuli);
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端详情
|
||||
*/
|
||||
@RequestMapping("/detail/{id}")
|
||||
public R detail(@PathVariable("id") Long id){
|
||||
WeixiuchuliEntity weixiuchuli = weixiuchuliService.selectById(id);
|
||||
return R.ok().put("data", weixiuchuli);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 后端保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request){
|
||||
weixiuchuli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(weixiuchuli);
|
||||
weixiuchuliService.insert(weixiuchuli);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端保存
|
||||
*/
|
||||
@RequestMapping("/add")
|
||||
public R add(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request){
|
||||
weixiuchuli.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
||||
//ValidatorUtils.validateEntity(weixiuchuli);
|
||||
weixiuchuliService.insert(weixiuchuli);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request){
|
||||
//ValidatorUtils.validateEntity(weixiuchuli);
|
||||
weixiuchuliService.updateById(weixiuchuli);//全部更新
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
weixiuchuliService.deleteBatchIds(Arrays.asList(ids));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 提醒接口
|
||||
*/
|
||||
@RequestMapping("/remind/{columnName}/{type}")
|
||||
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
|
||||
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
|
||||
map.put("column", columnName);
|
||||
map.put("type", type);
|
||||
|
||||
if(type.equals("2")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar c = Calendar.getInstance();
|
||||
Date remindStartDate = null;
|
||||
Date remindEndDate = null;
|
||||
if(map.get("remindstart")!=null) {
|
||||
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
|
||||
c.setTime(new Date());
|
||||
c.add(Calendar.DAY_OF_MONTH,remindStart);
|
||||
remindStartDate = c.getTime();
|
||||
map.put("remindstart", sdf.format(remindStartDate));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
|
||||
c.setTime(new Date());
|
||||
c.add(Calendar.DAY_OF_MONTH,remindEnd);
|
||||
remindEndDate = c.getTime();
|
||||
map.put("remindend", sdf.format(remindEndDate));
|
||||
}
|
||||
}
|
||||
|
||||
Wrapper<WeixiuchuliEntity> wrapper = new EntityWrapper<WeixiuchuliEntity>();
|
||||
if(map.get("remindstart")!=null) {
|
||||
wrapper.ge(columnName, map.get("remindstart"));
|
||||
}
|
||||
if(map.get("remindend")!=null) {
|
||||
wrapper.le(columnName, map.get("remindend"));
|
||||
}
|
||||
|
||||
String tableName = request.getSession().getAttribute("tableName").toString();
|
||||
if(tableName.equals("fangzhu")) {
|
||||
wrapper.eq("fangzhuzhanghao", (String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
if(tableName.equals("yonghu")) {
|
||||
wrapper.eq("yonghuming", (String)request.getSession().getAttribute("username"));
|
||||
}
|
||||
|
||||
int count = weixiuchuliService.selectCount(wrapper);
|
||||
return R.ok().put("count", count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.StoreupEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
*/
|
||||
public interface StoreupDao extends BaseMapper<StoreupEntity> {
|
||||
|
||||
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Pagination page,@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.dao;
|
||||
|
||||
import com.entity.WeixiuchuliEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.vo.WeixiuchuliVO;
|
||||
import com.entity.view.WeixiuchuliView;
|
||||
|
||||
|
||||
/**
|
||||
* 维修处理
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
*/
|
||||
public interface WeixiuchuliDao extends BaseMapper<WeixiuchuliEntity> {
|
||||
|
||||
List<WeixiuchuliVO> selectListVO(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
WeixiuchuliVO selectVO(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
List<WeixiuchuliView> selectListView(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
List<WeixiuchuliView> selectListView(Pagination page,@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
WeixiuchuliView selectView(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.StoreupEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
|
||||
/**
|
||||
* 收藏表
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-04 18:46:21
|
||||
*/
|
||||
public interface StoreupService extends IService<StoreupEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<StoreupEntity> wrapper);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.utils.PageUtils;
|
||||
import com.entity.WeixiuchuliEntity;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.entity.vo.WeixiuchuliVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.entity.view.WeixiuchuliView;
|
||||
|
||||
|
||||
/**
|
||||
* 维修处理
|
||||
*
|
||||
* @author
|
||||
* @email
|
||||
* @date 2021-03-04 18:46:21
|
||||
*/
|
||||
public interface WeixiuchuliService extends IService<WeixiuchuliEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<WeixiuchuliVO> selectListVO(Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
WeixiuchuliVO selectVO(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
List<WeixiuchuliView> selectListView(Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
WeixiuchuliView selectView(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params,Wrapper<WeixiuchuliEntity> wrapper);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.StoreupDao;
|
||||
import com.entity.StoreupEntity;
|
||||
import com.service.StoreupService;
|
||||
import com.entity.vo.StoreupVO;
|
||||
import com.entity.view.StoreupView;
|
||||
|
||||
@Service("storeupService")
|
||||
public class StoreupServiceImpl extends ServiceImpl<StoreupDao, StoreupEntity> implements StoreupService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<StoreupEntity> page = this.selectPage(
|
||||
new Query<StoreupEntity>(params).getPage(),
|
||||
new EntityWrapper<StoreupEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper) {
|
||||
Page<StoreupView> page =new Query<StoreupView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupVO selectVO(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreupView selectView(Wrapper<StoreupEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.Wrapper;
|
||||
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.utils.PageUtils;
|
||||
import com.utils.Query;
|
||||
|
||||
|
||||
import com.dao.WeixiuchuliDao;
|
||||
import com.entity.WeixiuchuliEntity;
|
||||
import com.service.WeixiuchuliService;
|
||||
import com.entity.vo.WeixiuchuliVO;
|
||||
import com.entity.view.WeixiuchuliView;
|
||||
|
||||
@Service("weixiuchuliService")
|
||||
public class WeixiuchuliServiceImpl extends ServiceImpl<WeixiuchuliDao, WeixiuchuliEntity> implements WeixiuchuliService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
Page<WeixiuchuliEntity> page = this.selectPage(
|
||||
new Query<WeixiuchuliEntity>(params).getPage(),
|
||||
new EntityWrapper<WeixiuchuliEntity>()
|
||||
);
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params, Wrapper<WeixiuchuliEntity> wrapper) {
|
||||
Page<WeixiuchuliView> page =new Query<WeixiuchuliView>(params).getPage();
|
||||
page.setRecords(baseMapper.selectListView(page,wrapper));
|
||||
PageUtils pageUtil = new PageUtils(page);
|
||||
return pageUtil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WeixiuchuliVO> selectListVO(Wrapper<WeixiuchuliEntity> wrapper) {
|
||||
return baseMapper.selectListVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeixiuchuliVO selectVO(Wrapper<WeixiuchuliEntity> wrapper) {
|
||||
return baseMapper.selectVO(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WeixiuchuliView> selectListView(Wrapper<WeixiuchuliEntity> wrapper) {
|
||||
return baseMapper.selectListView(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WeixiuchuliView selectView(Wrapper<WeixiuchuliEntity> wrapper) {
|
||||
return baseMapper.selectView(wrapper);
|
||||
}
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
<template>
|
||||
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
||||
<use :xlink:href="iconName" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SvgIcon',
|
||||
props: {
|
||||
iconClass: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
className: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iconName() {
|
||||
return `#icon-${this.iconClass}`
|
||||
},
|
||||
svgClass() {
|
||||
if (this.className) {
|
||||
return 'svg-icon ' + this.className
|
||||
} else {
|
||||
return 'svg-icon'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.svg-icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
@ -1,109 +0,0 @@
|
||||
<template>
|
||||
<el-breadcrumb class="app-breadcrumb" separator="(●'◡'●)" style="height:50px;backgroundColor:rgba(79, 73, 73, 1);borderRadius:0px;padding:0px 20px 0px 20px;boxShadow:;borderWidth:2px;borderStyle:;borderColor:rgba(193, 180, 180, 0.5);">
|
||||
<transition-group name="breadcrumb" class="box" :style="1==1?'justifyContent:flex-start;':1==2?'justifyContent:center;':'justifyContent:flex-end;'">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.name }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.name }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
import { generateTitle } from '@/utils/i18n'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
levelList: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getBreadcrumb()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getBreadcrumb()
|
||||
this.breadcrumbStyleChange()
|
||||
},
|
||||
methods: {
|
||||
generateTitle,
|
||||
getBreadcrumb() {
|
||||
// only show routes with meta.title
|
||||
let route = this.$route
|
||||
let matched = route.matched.filter(item => item.meta)
|
||||
const first = matched[0]
|
||||
matched = [{ path: '/index' }].concat(matched)
|
||||
|
||||
this.levelList = matched.filter(item => item.meta)
|
||||
},
|
||||
isDashboard(route) {
|
||||
const name = route && route.name
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === 'Index'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
const { params } = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const { redirect, path } = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(path)
|
||||
},
|
||||
breadcrumbStyleChange(val) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__separator').forEach(el=>{
|
||||
el.innerText = "(●'◡'●)"
|
||||
el.style.color = "rgba(235, 90, 170, 1)"
|
||||
})
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner a').forEach(el=>{
|
||||
el.style.color = "rgba(196, 212, 244, 1)"
|
||||
})
|
||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner .no-redirect').forEach(el=>{
|
||||
el.style.color = "rgba(244, 149, 32, 1)"
|
||||
})
|
||||
|
||||
let str = "vertical"
|
||||
if("vertical" === str) {
|
||||
let headHeight = "60px"
|
||||
headHeight = parseInt(headHeight) + 10 + 'px'
|
||||
document.querySelectorAll('.app-breadcrumb').forEach(el=>{
|
||||
el.style.marginTop = headHeight
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-breadcrumb {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.no-redirect {
|
||||
color: #97a8be;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||
<transition-group name="breadcrumb">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.name }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.name }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pathToRegexp from 'path-to-regexp'
|
||||
import { generateTitle } from '@/utils/i18n'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
levelList: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.getBreadcrumb()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getBreadcrumb()
|
||||
},
|
||||
methods: {
|
||||
generateTitle,
|
||||
getBreadcrumb() {
|
||||
// only show routes with meta.title
|
||||
console.log(this.$route)
|
||||
let matched = this.$route.matched.filter(item => item.meta)
|
||||
const first = matched[0]
|
||||
matched = [{ path: '/index' }].concat(matched)
|
||||
|
||||
this.levelList = matched.filter(item => item.meta)
|
||||
},
|
||||
isDashboard(route) {
|
||||
const name = route && route.name
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === 'Index'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
const { params } = this.$route
|
||||
var toPath = pathToRegexp.compile(path)
|
||||
return toPath(params)
|
||||
},
|
||||
handleLink(item) {
|
||||
const { redirect, path } = item
|
||||
if (redirect) {
|
||||
this.$router.push(redirect)
|
||||
return
|
||||
}
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-breadcrumb.el-breadcrumb {
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 50px;
|
||||
margin-left: 8px;
|
||||
|
||||
.no-redirect {
|
||||
color: #97a8be;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,60 +0,0 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="header">
|
||||
<span>{{title}}</span>
|
||||
<span>
|
||||
<el-tag size="small" :type="titleTag">{{titleUnit}}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
{{content}}
|
||||
<span class="unit">{{contentUnit}}</span>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>{{bottomTitle}}</span>
|
||||
<span>
|
||||
{{bottomContent}}
|
||||
<i :class="bottomIcon"></i>
|
||||
</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: [
|
||||
"title",
|
||||
"titleTag",
|
||||
"titleUnit",
|
||||
"content",
|
||||
"contentUnit",
|
||||
"bottomTitle",
|
||||
"bottomContent",
|
||||
"bottomIcon"
|
||||
]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box-card {
|
||||
margin-right: 10px;
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.content {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
.unit {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,101 +0,0 @@
|
||||
<template>
|
||||
<div class="home-comment">
|
||||
<div class="title">用户留言</div>
|
||||
<div class="comment-list">
|
||||
<div v-for="(item,index) in list" v-bind:key="index" class="comment-item">
|
||||
<div class="user-content">
|
||||
<el-image
|
||||
class="avator"
|
||||
:src="item.avator"
|
||||
></el-image>
|
||||
<span class="user">{{item.name}}</span>
|
||||
</div>
|
||||
<div class="comment">{{item.content}}</div>
|
||||
<div class="create-time">{{item.createTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content:
|
||||
"你以为只要长得漂亮就有男生喜欢?你以为只要有了钱漂亮妹子就自己贴上来了?你以为学霸就能找到好工作?我告诉你吧,这些都是真的!",
|
||||
createTime: "5月02日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator:
|
||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
},
|
||||
{
|
||||
name: "MaskLin",
|
||||
avator: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
||||
content: "作者太帅了",
|
||||
createTime: "5月04日 00:00"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.home-comment {
|
||||
background: #ffffff;
|
||||
.title {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
}
|
||||
.comment-list {
|
||||
padding: 10px;
|
||||
.comment-item {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
.user-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
font-weight: bold;
|
||||
line-height: 50px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.avator {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.comment {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
color: #888888;
|
||||
}
|
||||
.create-time {
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
color: #888888;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,55 +0,0 @@
|
||||
<template>
|
||||
<div class="home-progress">
|
||||
<div class="title">月访问量</div>
|
||||
<div class="tip">同上期增长</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="20"
|
||||
status="success"
|
||||
></el-progress>
|
||||
<div class="title">月用户量</div>
|
||||
<div class="tip">同上期增长</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="50"
|
||||
status="success"
|
||||
></el-progress>
|
||||
<div class="title">月收入</div>
|
||||
<div class="tip">同上期减少</div>
|
||||
<el-progress
|
||||
class="progress"
|
||||
:text-inside="true"
|
||||
:stroke-width="24"
|
||||
:percentage="28"
|
||||
status="exception"
|
||||
></el-progress>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.home-progress {
|
||||
background: #ffffff;
|
||||
height: 400px;
|
||||
padding: 20px;
|
||||
.title {
|
||||
color: #666666;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.tip {
|
||||
color: #888888;
|
||||
font-size: 16px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.progress {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<el-aside class="index-aside" width="200px">
|
||||
<div class="index-aside-inner">
|
||||
<el-menu default-active="1">
|
||||
<el-menu-item @click="menuHandler('/')" index="1">
|
||||
<!-- <i class="el-icon-s-home"></i> -->
|
||||
首页
|
||||
</el-menu-item>
|
||||
<sub-menu
|
||||
v-for="menu in menuList"
|
||||
:key="menu.menuId"
|
||||
:menu="menu"
|
||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
||||
></sub-menu>
|
||||
</el-menu>
|
||||
</div>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import SubMenu from "@/components/index/IndexAsideSub";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
dynamicMenuRoutes: []
|
||||
};
|
||||
},
|
||||
components: {
|
||||
SubMenu
|
||||
},
|
||||
mounted() {
|
||||
// 获取动态菜单数据并且渲染
|
||||
this.menuList = JSON.parse(sessionStorage.getItem("menuList") || "[]");
|
||||
this.dynamicMenuRoutes = JSON.parse(
|
||||
sessionStorage.getItem("dynamicMenuRoutes") || "[]"
|
||||
);
|
||||
},
|
||||
methods: {
|
||||
menuHandler(path) {
|
||||
this.$router.push({ path: path });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.index-aside {
|
||||
margin-top: 80px;
|
||||
overflow: hidden;
|
||||
.index-aside-inner {
|
||||
width: 217px;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,240 +0,0 @@
|
||||
<template>
|
||||
<el-aside class="index-aside" height="100vh" width="210px">
|
||||
<div class="index-aside-inner menulist" style="height:100%">
|
||||
<div v-for="item in menuList" :key="item.roleName" v-if="role==item.roleName" class="menulist-item" style="height:100%;broder:0;background-color:#988181">
|
||||
<div class="menulistImg" style="backgroundColor:#ff0000;padding:25px 0" v-if="false && menulistStyle == 'vertical'">
|
||||
<el-image v-if="'http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg'" src="http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg" fit="cover" />
|
||||
</div>
|
||||
<el-menu mode="vertical" :unique-opened="true" class="el-menu-demo" style="height:100%;" background-color="#988181" text-color="#111010" active-text-color="#99EFED" default-active="0">
|
||||
<el-menu-item index="0" :style="menulistBorderBottom" @click="menuHandler('')"><i v-if="true" class="el-icon-s-home" />首页</el-menu-item>
|
||||
<el-submenu :index="1+''" :style="menulistBorderBottom">
|
||||
<template slot="title">
|
||||
<i v-if="true" class="el-icon-user-solid" />
|
||||
<span>个人中心</span>
|
||||
</template>
|
||||
<el-menu-item :index="1-1" @click="menuHandler('updatePassword')">修改密码</el-menu-item>
|
||||
<el-menu-item :index="1-2" @click="menuHandler('center')">个人信息</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu :style="menulistBorderBottom" v-for=" (menu,index) in item.backMenu" :key="menu.menu" :index="index+2+''">
|
||||
<template slot="title">
|
||||
<i v-if="true" :class="icons[index]" />
|
||||
<span>{{ menu.menu }}</span>
|
||||
</template>
|
||||
<el-menu-item v-for=" (child,sort) in menu.child" :key="sort" :index="(index+2)+'-'+sort" @click="menuHandler(child.tableName)">{{ child.menu }}</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import menu from '@/utils/menu'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
dynamicMenuRoutes: [],
|
||||
role: '',
|
||||
icons: [
|
||||
'el-icon-s-cooperation',
|
||||
'el-icon-s-order',
|
||||
'el-icon-s-platform',
|
||||
'el-icon-s-fold',
|
||||
'el-icon-s-unfold',
|
||||
'el-icon-s-operation',
|
||||
'el-icon-s-promotion',
|
||||
'el-icon-s-release',
|
||||
'el-icon-s-ticket',
|
||||
'el-icon-s-management',
|
||||
'el-icon-s-open',
|
||||
'el-icon-s-shop',
|
||||
'el-icon-s-marketing',
|
||||
'el-icon-s-flag',
|
||||
'el-icon-s-comment',
|
||||
'el-icon-s-finance',
|
||||
'el-icon-s-claim',
|
||||
'el-icon-s-custom',
|
||||
'el-icon-s-opportunity',
|
||||
'el-icon-s-data',
|
||||
'el-icon-s-check',
|
||||
'el-icon-s-grid',
|
||||
'el-icon-menu',
|
||||
'el-icon-chat-dot-square',
|
||||
'el-icon-message',
|
||||
'el-icon-postcard',
|
||||
'el-icon-position',
|
||||
'el-icon-microphone',
|
||||
'el-icon-close-notification',
|
||||
'el-icon-bangzhu',
|
||||
'el-icon-time',
|
||||
'el-icon-odometer',
|
||||
'el-icon-crop',
|
||||
'el-icon-aim',
|
||||
'el-icon-switch-button',
|
||||
'el-icon-full-screen',
|
||||
'el-icon-copy-document',
|
||||
'el-icon-mic',
|
||||
'el-icon-stopwatch',
|
||||
],
|
||||
menulistStyle: 'vertical',
|
||||
menulistBorderBottom: {},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const menus = menu.list()
|
||||
this.menuList = menus
|
||||
this.role = this.$storage.get('role')
|
||||
},
|
||||
created(){
|
||||
setTimeout(()=>{
|
||||
this.menulistStyleChange()
|
||||
},10)
|
||||
this.icons.sort(()=>{
|
||||
return (0.5-Math.random())
|
||||
})
|
||||
this.lineBorder()
|
||||
},
|
||||
methods: {
|
||||
lineBorder() {
|
||||
let style = 'vertical'
|
||||
let w = '1px'
|
||||
let s = 'solid'
|
||||
let c = '#ccc'
|
||||
if(style == 'vertical') {
|
||||
this.menulistBorderBottom = {
|
||||
borderBottomWidth: w,
|
||||
borderBottomStyle: s,
|
||||
borderBottomColor: c
|
||||
}
|
||||
} else {
|
||||
this.menulistBorderBottom = {
|
||||
borderRightWidth: w,
|
||||
borderRightStyle: s,
|
||||
borderRightColor: c
|
||||
}
|
||||
}
|
||||
},
|
||||
menuHandler(name) {
|
||||
let router = this.$router
|
||||
name = '/'+name
|
||||
router.push(name)
|
||||
},
|
||||
// 菜单
|
||||
setMenulistHoverColor(){
|
||||
let that = this
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist .el-menu-item').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "#988181"
|
||||
})
|
||||
el.addEventListener("focus", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
||||
})
|
||||
})
|
||||
document.querySelectorAll('.menulist .el-submenu__title').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "#988181"
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
setMenulistIconColor() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist .el-submenu__title .el-submenu__icon-arrow').forEach(el=>{
|
||||
el.style.color = "rgba(153, 153, 153, 1)"
|
||||
})
|
||||
})
|
||||
},
|
||||
menulistStyleChange() {
|
||||
this.setMenulistIconColor()
|
||||
this.setMenulistHoverColor()
|
||||
this.setMenulistStyleHeightChange()
|
||||
let str = "vertical"
|
||||
if("horizontal" === str) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.el-container .el-container').forEach(el=>{
|
||||
el.style.display = "block"
|
||||
el.style.paddingTop = "60px" // header 高度
|
||||
})
|
||||
document.querySelectorAll('.el-aside').forEach(el=>{
|
||||
el.style.width = "100%"
|
||||
el.style.height = "62px"
|
||||
el.style.paddingTop = '0'
|
||||
})
|
||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
||||
el.style.paddingTop = '0'
|
||||
})
|
||||
})
|
||||
}
|
||||
if("vertical" === str) {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
||||
el.style.paddingTop = "60px"
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
setMenulistStyleHeightChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-menu-item').forEach(el=>{
|
||||
el.style.height = "62px"
|
||||
el.style.lineHeight = "62px"
|
||||
})
|
||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-submenu>.el-submenu__title').forEach(el=>{
|
||||
el.style.height = "62px"
|
||||
el.style.lineHeight = "62px"
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.index-aside {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.menulistImg {
|
||||
padding: 24px 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-image {
|
||||
margin: 0 auto;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.index-aside-inner {
|
||||
height: 100%;
|
||||
margin-right: -17px;
|
||||
margin-bottom: -17px;
|
||||
overflow: scroll;
|
||||
overflow-x: hidden !important;
|
||||
padding-top: 60px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,76 +0,0 @@
|
||||
<template>
|
||||
<el-aside class="index-aside" width="200px">
|
||||
<div class="index-aside-inner">
|
||||
<div v-for="item in menuList" v-bind:key="item.roleName">
|
||||
<el-menu
|
||||
background-color="#263238"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
default-active="0"
|
||||
v-if="role==item.roleName"
|
||||
>
|
||||
<el-menu-item @click="menuHandler('home')" index="0">首页</el-menu-item>
|
||||
<el-submenu
|
||||
:index="1+''"
|
||||
>
|
||||
<template slot="title">
|
||||
<span>个人中心</span>
|
||||
</template>
|
||||
<el-menu-item
|
||||
@click="menuHandler('updatePassword')"
|
||||
:index="1-1"
|
||||
>修改密码</el-menu-item>
|
||||
<el-menu-item
|
||||
@click="menuHandler('center')"
|
||||
:index="1-2"
|
||||
>个人信息</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-submenu
|
||||
v-for=" (menu,index) in item.backMenu"
|
||||
v-bind:key="menu.menu"
|
||||
:index="index+2+''"
|
||||
>
|
||||
<template slot="title">
|
||||
<span>{{menu.menu}}</span>
|
||||
</template>
|
||||
<el-menu-item
|
||||
v-for=" (child,sort) in menu.child"
|
||||
v-bind:key="sort"
|
||||
@click="menuHandler(child.tableName)"
|
||||
:index="(index+2)+'-'+sort"
|
||||
>{{child.menu}}</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-menu>
|
||||
</div>
|
||||
</div>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import menu from "@/utils/menu";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
dynamicMenuRoutes: [],
|
||||
role: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let menus = menu.list();
|
||||
this.menuList = menus;
|
||||
this.role = this.$storage.get("role");
|
||||
console.log(this.menuList)
|
||||
console.log(this.role)
|
||||
},
|
||||
methods: {
|
||||
menuHandler(name) {
|
||||
this.$router.push({
|
||||
name: name
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<el-submenu v-if="menu.list && menu.list.length >= 1" :index="menu.menuId + ''">
|
||||
<template slot="title">
|
||||
<span>{{ menu.name }}</span>
|
||||
</template>
|
||||
<sub-menu
|
||||
v-for="item in menu.list"
|
||||
:key="item.menuId"
|
||||
:menu="item"
|
||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
||||
></sub-menu>
|
||||
</el-submenu>
|
||||
<el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
|
||||
<span>{{ menu.name }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SubMenu from "./IndexAsideSub";
|
||||
export default {
|
||||
name: "sub-menu",
|
||||
props: {
|
||||
menu: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
dynamicMenuRoutes: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SubMenu
|
||||
},
|
||||
methods: {
|
||||
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
|
||||
gotoRouteHandle(menu) {
|
||||
var route = this.dynamicMenuRoutes.filter(
|
||||
item => item.meta.menuId === menu.menuId
|
||||
);
|
||||
if (route.length >= 1) {
|
||||
if (route[0].component != null) {
|
||||
this.$router.replace({ name: route[0].name });
|
||||
} else {
|
||||
this.$router.push({ name: "404" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,183 +0,0 @@
|
||||
<template>
|
||||
<!-- <el-header>
|
||||
<el-menu background-color="#00c292" text-color="#FFFFFF" active-text-color="#FFFFFF" mode="horizontal">
|
||||
<div class="fl title">{{this.$project.projectName}}</div>
|
||||
<div class="fr logout" style="display:flex;">
|
||||
<el-menu-item index="3">
|
||||
<div>{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="onLogout" index="2">
|
||||
<div>退出登录</div>
|
||||
</el-menu-item>
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-header> -->
|
||||
<div class="navbar" :style="{backgroundColor:heads.headBgColor,height:heads.headHeight,boxShadow:heads.headBoxShadow,lineHeight:heads.headHeight}">
|
||||
<div class="title-menu" :style="{justifyContent:heads.headTitleStyle=='1'?'flex-start':'center'}">
|
||||
<el-image v-if="heads.headTitleImg" class="title-img" :style="{width:heads.headTitleImgWidth,height:heads.headTitleImgHeight,boxShadow:heads.headTitleImgBoxShadow,borderRadius:heads.headTitleImgBorderRadius}" :src="heads.headTitleImgUrl" fit="cover"></el-image>
|
||||
<div class="title-name" :style="{color:heads.headFontColor,fontSize:heads.headFontSize}">{{this.$project.projectName}}</div>
|
||||
</div>
|
||||
<div class="right-menu">
|
||||
<div class="user-info" :style="{color:heads.headUserInfoFontColor,fontSize:heads.headUserInfoFontSize}">{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
||||
<div class="logout" :style="{color:heads.headLogoutFontColor,fontSize:heads.headLogoutFontSize}" @click="onLogout">退出登录</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
ruleForm: {},
|
||||
user: {},
|
||||
heads: {"headLogoutFontHoverColor":"rgba(41, 42, 42, 1)","headFontSize":"20px","headUserInfoFontColor":"rgba(238, 221, 129, 1)","headBoxShadow":"0 1px 6px #444","headTitleImgHeight":"44px","headLogoutFontHoverBgColor":"rgba(247, 142, 142, 1)","headFontColor":"rgba(153, 239, 237, 1)","headTitleImg":false,"headHeight":"60px","headTitleImgBorderRadius":"22px","headTitleImgUrl":"http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg","headBgColor":"#4F4949","headTitleImgBoxShadow":"0 1px 6px #444","headLogoutFontColor":"rgba(153, 239, 237, 1)","headUserInfoFontSize":"16px","headTitleImgWidth":"44px","headTitleStyle":"2","headLogoutFontSize":"16px"},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.setHeaderStyle()
|
||||
},
|
||||
mounted() {
|
||||
let sessionTable = this.$storage.get("sessionTable")
|
||||
this.$http({
|
||||
url: sessionTable + '/session',
|
||||
method: "get"
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.user = data.data;
|
||||
} else {
|
||||
let message = this.$message
|
||||
message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onLogout() {
|
||||
let storage = this.$storage
|
||||
let router = this.$router
|
||||
storage.remove("Token");
|
||||
router.replace({
|
||||
name: "login"
|
||||
});
|
||||
},
|
||||
onIndexTap(){
|
||||
window.location.href = `${this.$base.indexUrl}`
|
||||
},
|
||||
setHeaderStyle() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.navbar .right-menu .logout').forEach(el=>{
|
||||
el.addEventListener("mouseenter", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = this.heads.headLogoutFontHoverBgColor
|
||||
el.style.color = this.heads.headLogoutFontHoverColor
|
||||
})
|
||||
el.addEventListener("mouseleave", e => {
|
||||
e.stopPropagation()
|
||||
el.style.backgroundColor = "transparent"
|
||||
el.style.color = this.heads.headLogoutFontColor
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.navbar {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
width: 100%;
|
||||
padding: 0 34px;
|
||||
box-sizing: border-box;
|
||||
background-color: #ff00ff;
|
||||
position: relative;
|
||||
z-index: 111;
|
||||
|
||||
.right-menu {
|
||||
position: absolute;
|
||||
right: 34px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
z-index: 111;
|
||||
|
||||
.user-info {
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.logout {
|
||||
font-size: 16px;
|
||||
color: red;
|
||||
padding: 0 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.title-menu {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.title-img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 22px;
|
||||
box-shadow: 0 1px 6px #444;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.title-name {
|
||||
font-size: 24px;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .el-header .fr {
|
||||
// float: right;
|
||||
// }
|
||||
|
||||
// .el-header .fl {
|
||||
// float: left;
|
||||
// }
|
||||
|
||||
// .el-header {
|
||||
// width: 100%;
|
||||
// color: #333;
|
||||
// text-align: center;
|
||||
// line-height: 60px;
|
||||
// padding: 0;
|
||||
// z-index: 99;
|
||||
// }
|
||||
|
||||
// .logo {
|
||||
// width: 60px;
|
||||
// height: 60px;
|
||||
// margin-left: 70px;
|
||||
// }
|
||||
|
||||
// .avator {
|
||||
// width: 40px;
|
||||
// height: 40px;
|
||||
// background: #ffffff;
|
||||
// border-radius: 50%;
|
||||
// }
|
||||
|
||||
// .title {
|
||||
// color: #ffffff;
|
||||
// font-size: 20px;
|
||||
// font-weight: bold;
|
||||
// margin-left: 20px;
|
||||
// }
|
||||
</style>
|
@ -1,89 +0,0 @@
|
||||
<template>
|
||||
<el-header>
|
||||
<el-menu background-color="#00c292" text-color="#FFFFFF" active-text-color="#FFFFFF" mode="horizontal">
|
||||
<div class="fl title">{{this.$project.projectName}}</div>
|
||||
<div class="fr logout" style="display:flex;">
|
||||
<el-menu-item index="3">
|
||||
<div>{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
||||
</el-menu-item>
|
||||
<el-menu-item @click="onLogout" index="2">
|
||||
<div>退出登录</div>
|
||||
</el-menu-item>
|
||||
</div>
|
||||
</el-menu>
|
||||
</el-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
ruleForm: {},
|
||||
user: {}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$http({
|
||||
url: `${this.$storage.get("sessionTable")}/session`,
|
||||
method: "get"
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.user = data.data;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onLogout() {
|
||||
this.$storage.remove("Token");
|
||||
this.$router.replace({
|
||||
name: "login"
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-header .fr {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.el-header .fl {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.el-header {
|
||||
width: 100%;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
padding: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
margin-left: 70px;
|
||||
}
|
||||
|
||||
.avator {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #ffffff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|
@ -1,124 +0,0 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<bread-crumbs :title="title" class="bread-crumbs"></bread-crumbs>
|
||||
<router-view class="router-view"></router-view>
|
||||
</el-main>
|
||||
</template>
|
||||
<script>
|
||||
import menu from "@/utils/menu";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menuList: [],
|
||||
role: "",
|
||||
currentIndex: -2,
|
||||
itemMenu: [],
|
||||
title: ''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let menus = menu.list();
|
||||
this.menuList = menus;
|
||||
this.role = this.$storage.get("role");
|
||||
},
|
||||
methods: {
|
||||
menuHandler(menu) {
|
||||
this.$router.push({
|
||||
name: menu.tableName
|
||||
});
|
||||
this.title = menu.menu;
|
||||
},
|
||||
titleChange(index, menus) {
|
||||
this.currentIndex = index
|
||||
this.itemMenu = menus;
|
||||
console.log(menus);
|
||||
},
|
||||
homeChange(index) {
|
||||
this.itemMenu = [];
|
||||
this.title = ""
|
||||
this.currentIndex = index
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
});
|
||||
},
|
||||
centerChange(index) {
|
||||
this.itemMenu = [{
|
||||
"buttons": ["新增", "查看", "修改", "删除"],
|
||||
"menu": "修改密码",
|
||||
"tableName": "updatePassword"
|
||||
}, {
|
||||
"buttons": ["新增", "查看", "修改", "删除"],
|
||||
"menu": "个人信息",
|
||||
"tableName": "center"
|
||||
}];
|
||||
this.title = ""
|
||||
this.currentIndex = index
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
background: #00c292;
|
||||
}
|
||||
|
||||
.nav-list {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
margin-top: 20px;
|
||||
|
||||
.nav-title {
|
||||
display: inline-block;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
padding: 15px 25px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.nav-title.active {
|
||||
color: #555;
|
||||
cursor: default;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
margin-top: 20px;
|
||||
background: #FFFFFF;
|
||||
padding: 15px 0;
|
||||
|
||||
.menu {
|
||||
padding: 15px 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-main {
|
||||
background-color: #F6F8FA;
|
||||
padding: 0 24px;
|
||||
// padding-top: 60px;
|
||||
}
|
||||
|
||||
.router-view {
|
||||
padding: 10px;
|
||||
margin-top: 10px;
|
||||
background: #FFFFFF;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bread-crumbs {
|
||||
width: 100%;
|
||||
// border-bottom: 1px solid #e9eef3;
|
||||
// border-top: 1px solid #e9eef3;
|
||||
margin-top: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,524 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<!-- 列表页 -->
|
||||
<div v-if="showFlag">
|
||||
<el-form :inline="true" :model="searchForm" class="form-content">
|
||||
<el-row :gutter="20" class="slt" :style="{justifyContent:contents.searchBoxPosition=='1'?'flex-start':contents.searchBoxPosition=='2'?'center':'flex-end'}">
|
||||
<el-form-item :label="contents.inputTitle == 1 ? '收藏名称' : ''">
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 1" prefix-icon="el-icon-search" v-model="searchForm.name" placeholder="收藏名称" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 2" suffix-icon="el-icon-search" v-model="searchForm.name" placeholder="收藏名称" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 0" v-model="searchForm.name" placeholder="收藏名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="contents.searchBtnIcon == 1 && contents.searchBtnIconPosition == 1" icon="el-icon-search" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}</el-button>
|
||||
<el-button v-if="contents.searchBtnIcon == 1 && contents.searchBtnIconPosition == 2" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}<i class="el-icon-search el-icon--right"/></el-button>
|
||||
<el-button v-if="contents.searchBtnIcon == 0" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row class="ad" :style="{justifyContent:contents.btnAdAllBoxPosition=='1'?'flex-start':contents.btnAdAllBoxPosition=='2'?'center':'flex-end'}">
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','新增') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 1"
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','新增') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 2"
|
||||
type="success"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}<i class="el-icon-plus el-icon--right" /></el-button>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','新增') && contents.btnAdAllIcon == 0"
|
||||
type="success"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','删除') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 1 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','删除') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 2 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}<i class="el-icon-delete el-icon--right" /></el-button>
|
||||
<el-button
|
||||
v-if="isAuth('storeup','删除') && contents.btnAdAllIcon == 0 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}</el-button>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="table-content">
|
||||
<el-table class="tables" :size="contents.tableSize" :show-header="contents.tableShowHeader"
|
||||
:header-row-style="headerRowStyle" :header-cell-style="headerCellStyle"
|
||||
:border="contents.tableBorder"
|
||||
:fit="contents.tableFit"
|
||||
:stripe="contents.tableStripe"
|
||||
:row-style="rowStyle"
|
||||
:cell-style="cellStyle"
|
||||
:style="{width: '100%',fontSize:contents.tableContentFontSize,color:contents.tableContentFontColor}"
|
||||
v-if="isAuth('storeup','查看')"
|
||||
:data="dataList"
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandler">
|
||||
<el-table-column v-if="contents.tableSelection"
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="索引" v-if="contents.tableIndex" type="index" width="50" />
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="name"
|
||||
header-align="center"
|
||||
label="收藏名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign" prop="picture"
|
||||
header-align="center"
|
||||
width="200"
|
||||
label="收藏图片">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.picture">
|
||||
<img :src="scope.row.picture.split(',')[0]" width="100" height="100">
|
||||
</div>
|
||||
<div v-else>无图片</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="300" :align="contents.tableAlign"
|
||||
header-align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isAuth('storeup','查看') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="success" icon="el-icon-tickets" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}</el-button>
|
||||
<el-button v-if="isAuth('storeup','查看') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="success" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}<i class="el-icon-tickets el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('storeup','查看') && contents.tableBtnIcon == 0" type="success" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}</el-button>
|
||||
<el-button v-if="isAuth('storeup','修改') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="primary" icon="el-icon-edit" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}</el-button>
|
||||
<el-button v-if="isAuth('storeup','修改') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="primary" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}<i class="el-icon-edit el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('storeup','修改') && contents.tableBtnIcon == 0" type="primary" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}</el-button>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-button v-if="isAuth('storeup','删除') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="danger" icon="el-icon-delete" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}</el-button>
|
||||
<el-button v-if="isAuth('storeup','删除') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="danger" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}<i class="el-icon-delete el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('storeup','删除') && contents.tableBtnIcon == 0" type="danger" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
clsss="pages"
|
||||
:layout="layouts"
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="Number(contents.pageEachNum)"
|
||||
:total="totalPage"
|
||||
:small="contents.pageStyle"
|
||||
class="pagination-content"
|
||||
:background="contents.pageBtnBG"
|
||||
:style="{textAlign:contents.pagePosition==1?'left':contents.pagePosition==2?'center':'right'}"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加/修改页面 将父组件的search方法传递给子组件-->
|
||||
<add-or-update v-if="addOrUpdateFlag" :parent="this" ref="addOrUpdate"></add-or-update>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import AddOrUpdate from "./add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
searchForm: {
|
||||
key: ""
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
showFlag: true,
|
||||
sfshVisiable: false,
|
||||
shForm: {},
|
||||
chartVisiable: false,
|
||||
addOrUpdateFlag:false,
|
||||
contents:{"searchBtnFontColor":"#333","pagePosition":"1","inputFontSize":"14px","inputBorderRadius":"22px","tableBtnDelFontColor":"#333","tableBtnIconPosition":"1","searchBtnHeight":"40px","inputIconColor":"rgba(66, 130, 129, 1)","searchBtnBorderRadius":"22px","tableStripe":false,"btnAdAllWarnFontColor":"#333","tableBtnDelBgColor":"rgba(244, 150, 150, 1)","searchBtnIcon":"1","tableSize":"medium","searchBtnBorderStyle":"solid","tableSelection":true,"searchBtnBorderWidth":"1px","tableContentFontSize":"14px","searchBtnBgColor":"rgba(153, 239, 237, 1)","inputTitleSize":"14px","btnAdAllBorderColor":"#DCDFE6","pageJumper":true,"btnAdAllIconPosition":"1","searchBoxPosition":"1","tableBtnDetailFontColor":"#333","tableBtnHeight":"40px","pagePager":true,"searchBtnBorderColor":"#DCDFE6","tableHeaderFontColor":"rgba(33, 34, 35, 1)","inputTitle":"1","tableBtnBorderRadius":"22px","btnAdAllFont":"1","btnAdAllDelFontColor":"rgba(21, 20, 20, 1)","tableBtnIcon":"1","btnAdAllHeight":"40px","btnAdAllWarnBgColor":"rgba(238, 236, 126, 1)","btnAdAllBorderWidth":"1px","tableStripeFontColor":"#606266","tableBtnBorderStyle":"solid","inputHeight":"40px","btnAdAllBorderRadius":"22px","btnAdAllDelBgColor":"rgba(234, 93, 93, 0.69)","pagePrevNext":true,"btnAdAllAddBgColor":"rgba(153, 239, 237, 1)","searchBtnFont":"1","tableIndex":true,"btnAdAllIcon":"1","tableSortable":true,"pageSizes":true,"tableFit":true,"pageBtnBG":true,"searchBtnFontSize":"14px","tableBtnEditBgColor":"rgba(240, 242, 124, 1)","inputBorderWidth":"1px","inputFontPosition":"1","inputFontColor":"#333","pageEachNum":10,"tableHeaderBgColor":"rgba(152, 129, 129, 1)","inputTitleColor":"#333","btnAdAllBoxPosition":"1","tableBtnDetailBgColor":"rgba(171, 239, 239, 1)","inputIcon":"0","searchBtnIconPosition":"1","btnAdAllFontSize":"14px","inputBorderStyle":"solid","inputBgColor":"rgba(197, 174, 174, 0.32)","pageStyle":false,"pageTotal":true,"btnAdAllAddFontColor":"#333","tableBtnFont":"1","tableContentFontColor":"rgba(22, 22, 23, 1)","inputBorderColor":"rgba(152, 129, 129, 1)","tableShowHeader":true,"tableBtnFontSize":"14px","tableBtnBorderColor":"rgba(196, 210, 244, 1)","inputIconPosition":"1","tableBorder":true,"btnAdAllBorderStyle":"solid","tableBtnBorderWidth":"1px","tableStripeBgColor":"rgba(213, 197, 197, 1)","tableBtnEditFontColor":"#333","tableAlign":"center"},
|
||||
layouts: '',
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
this.getDataList();
|
||||
this.contentStyleChange()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
filters: {
|
||||
htmlfilter: function (val) {
|
||||
return val.replace(/<[^>]*>/g).replace(/undefined/g,'');
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
contentStyleChange() {
|
||||
this.contentSearchStyleChange()
|
||||
this.contentBtnAdAllStyleChange()
|
||||
this.contentSearchBtnStyleChange()
|
||||
this.contentTableBtnStyleChange()
|
||||
this.contentPageStyleChange()
|
||||
},
|
||||
contentSearchStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-input__inner').forEach(el=>{
|
||||
let textAlign = 'left'
|
||||
if(this.contents.inputFontPosition == 2) textAlign = 'center'
|
||||
if(this.contents.inputFontPosition == 3) textAlign = 'right'
|
||||
el.style.textAlign = textAlign
|
||||
el.style.height = this.contents.inputHeight
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
el.style.color = this.contents.inputFontColor
|
||||
el.style.fontSize = this.contents.inputFontSize
|
||||
el.style.borderWidth = this.contents.inputBorderWidth
|
||||
el.style.borderStyle = this.contents.inputBorderStyle
|
||||
el.style.borderColor = this.contents.inputBorderColor
|
||||
el.style.borderRadius = this.contents.inputBorderRadius
|
||||
el.style.backgroundColor = this.contents.inputBgColor
|
||||
})
|
||||
if(this.contents.inputTitle) {
|
||||
document.querySelectorAll('.form-content .slt .el-form-item__label').forEach(el=>{
|
||||
el.style.color = this.contents.inputTitleColor
|
||||
el.style.fontSize = this.contents.inputTitleSize
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
}
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-input__prefix').forEach(el=>{
|
||||
el.style.color = this.contents.inputIconColor
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
document.querySelectorAll('.form-content .slt .el-input__suffix').forEach(el=>{
|
||||
el.style.color = this.contents.inputIconColor
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
document.querySelectorAll('.form-content .slt .el-input__icon').forEach(el=>{
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
},10)
|
||||
|
||||
})
|
||||
},
|
||||
// 搜索按钮
|
||||
contentSearchBtnStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-button--success').forEach(el=>{
|
||||
el.style.height = this.contents.searchBtnHeight
|
||||
el.style.color = this.contents.searchBtnFontColor
|
||||
el.style.fontSize = this.contents.searchBtnFontSize
|
||||
el.style.borderWidth = this.contents.searchBtnBorderWidth
|
||||
el.style.borderStyle = this.contents.searchBtnBorderStyle
|
||||
el.style.borderColor = this.contents.searchBtnBorderColor
|
||||
el.style.borderRadius = this.contents.searchBtnBorderRadius
|
||||
el.style.backgroundColor = this.contents.searchBtnBgColor
|
||||
})
|
||||
})
|
||||
},
|
||||
// 新增、批量删除
|
||||
contentBtnAdAllStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .ad .el-button--success').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllAddFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllAddBgColor
|
||||
})
|
||||
document.querySelectorAll('.form-content .ad .el-button--danger').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllDelFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllDelBgColor
|
||||
})
|
||||
document.querySelectorAll('.form-content .ad .el-button--warning').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllWarnFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllWarnBgColor
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表格
|
||||
rowStyle({ row, rowIndex}) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
if(this.contents.tableStripe) {
|
||||
return {color:this.contents.tableStripeFontColor}
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
cellStyle({ row, rowIndex}){
|
||||
if (rowIndex % 2 == 1) {
|
||||
if(this.contents.tableStripe) {
|
||||
return {backgroundColor:this.contents.tableStripeBgColor}
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
headerRowStyle({ row, rowIndex}){
|
||||
return {color: this.contents.tableHeaderFontColor}
|
||||
},
|
||||
headerCellStyle({ row, rowIndex}){
|
||||
return {backgroundColor: this.contents.tableHeaderBgColor}
|
||||
},
|
||||
// 表格按钮
|
||||
contentTableBtnStyleChange(){
|
||||
// this.$nextTick(()=>{
|
||||
// setTimeout(()=>{
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--success').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnDetailFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnDetailBgColor
|
||||
// })
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--primary').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnEditFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnEditBgColor
|
||||
// })
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--danger').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnDelFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnDelBgColor
|
||||
// })
|
||||
|
||||
// }, 50)
|
||||
// })
|
||||
},
|
||||
// 分页
|
||||
contentPageStyleChange(){
|
||||
let arr = []
|
||||
|
||||
if(this.contents.pageTotal) arr.push('total')
|
||||
if(this.contents.pageSizes) arr.push('sizes')
|
||||
if(this.contents.pagePrevNext){
|
||||
arr.push('prev')
|
||||
if(this.contents.pagePager) arr.push('pager')
|
||||
arr.push('next')
|
||||
}
|
||||
if(this.contents.pageJumper) arr.push('jumper')
|
||||
this.layouts = arr.join()
|
||||
this.contents.pageEachNum = 10
|
||||
},
|
||||
|
||||
init () {
|
||||
},
|
||||
search() {
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
let params = {
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
sort: 'id',
|
||||
}
|
||||
if(this.searchForm.name!='' && this.searchForm.name!=undefined){
|
||||
params['name'] = '%' + this.searchForm.name + '%'
|
||||
}
|
||||
this.$http({
|
||||
url: "storeup/page",
|
||||
method: "get",
|
||||
params: params
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data.list;
|
||||
this.totalPage = data.data.total;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandler(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 添加/修改
|
||||
addOrUpdateHandler(id,type) {
|
||||
this.showFlag = false;
|
||||
this.addOrUpdateFlag = true;
|
||||
this.crossAddOrUpdateFlag = false;
|
||||
if(type!='info'){
|
||||
type = 'else';
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id,type);
|
||||
});
|
||||
},
|
||||
// 查看评论
|
||||
// 下载
|
||||
download(file){
|
||||
window.open(`${file}`)
|
||||
},
|
||||
// 删除
|
||||
deleteHandler(id) {
|
||||
var ids = id
|
||||
? [Number(id)]
|
||||
: this.dataListSelections.map(item => {
|
||||
return Number(item.id);
|
||||
});
|
||||
this.$confirm(`确定进行[${id ? "删除" : "批量删除"}]操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: "storeup/delete",
|
||||
method: "post",
|
||||
data: ids
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.slt {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ad {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pages {
|
||||
& /deep/ el-pagination__sizes{
|
||||
& /deep/ el-input__inner {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-button+.el-button {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.tables {
|
||||
& /deep/ .el-button--success {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(171, 239, 239, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button--primary {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(240, 242, 124, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button--danger {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(244, 150, 150, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button {
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,626 @@
|
||||
<template>
|
||||
<div class="main-content">
|
||||
<!-- 列表页 -->
|
||||
<div v-if="showFlag">
|
||||
<el-form :inline="true" :model="searchForm" class="form-content">
|
||||
<el-row :gutter="20" class="slt" :style="{justifyContent:contents.searchBoxPosition=='1'?'flex-start':contents.searchBoxPosition=='2'?'center':'flex-end'}">
|
||||
<el-form-item :label="contents.inputTitle == 1 ? '报修名称' : ''">
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 1" prefix-icon="el-icon-search" v-model="searchForm.baoxiumingcheng" placeholder="报修名称" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 2" suffix-icon="el-icon-search" v-model="searchForm.baoxiumingcheng" placeholder="报修名称" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 0" v-model="searchForm.baoxiumingcheng" placeholder="报修名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="contents.inputTitle == 1 ? '维修进度' : ''">
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 1" prefix-icon="el-icon-search" v-model="searchForm.weixiujindu" placeholder="维修进度" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 2" suffix-icon="el-icon-search" v-model="searchForm.weixiujindu" placeholder="维修进度" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 0" v-model="searchForm.weixiujindu" placeholder="维修进度" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="contents.inputTitle == 1 ? '房主姓名' : ''">
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 1" prefix-icon="el-icon-search" v-model="searchForm.fangzhuxingming" placeholder="房主姓名" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 2" suffix-icon="el-icon-search" v-model="searchForm.fangzhuxingming" placeholder="房主姓名" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 0" v-model="searchForm.fangzhuxingming" placeholder="房主姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="contents.inputTitle == 1 ? '用户名' : ''">
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 1" prefix-icon="el-icon-search" v-model="searchForm.yonghuming" placeholder="用户名" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 1 && contents.inputIconPosition == 2" suffix-icon="el-icon-search" v-model="searchForm.yonghuming" placeholder="用户名" clearable></el-input>
|
||||
<el-input v-if="contents.inputIcon == 0" v-model="searchForm.yonghuming" placeholder="用户名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="contents.searchBtnIcon == 1 && contents.searchBtnIconPosition == 1" icon="el-icon-search" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}</el-button>
|
||||
<el-button v-if="contents.searchBtnIcon == 1 && contents.searchBtnIconPosition == 2" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}<i class="el-icon-search el-icon--right"/></el-button>
|
||||
<el-button v-if="contents.searchBtnIcon == 0" type="success" @click="search()">{{ contents.searchBtnFont == 1?'查询':'' }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row class="ad" :style="{justifyContent:contents.btnAdAllBoxPosition=='1'?'flex-start':contents.btnAdAllBoxPosition=='2'?'center':'flex-end'}">
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','新增') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 1"
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','新增') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 2"
|
||||
type="success"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}<i class="el-icon-plus el-icon--right" /></el-button>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','新增') && contents.btnAdAllIcon == 0"
|
||||
type="success"
|
||||
@click="addOrUpdateHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'新增':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','删除') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 1 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}</el-button>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','删除') && contents.btnAdAllIcon == 1 && contents.btnAdAllIconPosition == 2 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}<i class="el-icon-delete el-icon--right" /></el-button>
|
||||
<el-button
|
||||
v-if="isAuth('weixiuchuli','删除') && contents.btnAdAllIcon == 0 && contents.tableSelection"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
type="danger"
|
||||
@click="deleteHandler()"
|
||||
>{{ contents.btnAdAllFont == 1?'删除':'' }}</el-button>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="table-content">
|
||||
<el-table class="tables" :size="contents.tableSize" :show-header="contents.tableShowHeader"
|
||||
:header-row-style="headerRowStyle" :header-cell-style="headerCellStyle"
|
||||
:border="contents.tableBorder"
|
||||
:fit="contents.tableFit"
|
||||
:stripe="contents.tableStripe"
|
||||
:row-style="rowStyle"
|
||||
:cell-style="cellStyle"
|
||||
:style="{width: '100%',fontSize:contents.tableContentFontSize,color:contents.tableContentFontColor}"
|
||||
v-if="isAuth('weixiuchuli','查看')"
|
||||
:data="dataList"
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandler">
|
||||
<el-table-column v-if="contents.tableSelection"
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="索引" v-if="contents.tableIndex" type="index" width="50" />
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="fangwumingcheng"
|
||||
header-align="center"
|
||||
label="房屋名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.fangwumingcheng}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="fangwuleixing"
|
||||
header-align="center"
|
||||
label="房屋类型">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.fangwuleixing}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="baoxiumingcheng"
|
||||
header-align="center"
|
||||
label="报修名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.baoxiumingcheng}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="leixing"
|
||||
header-align="center"
|
||||
label="类型">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.leixing}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="baoxiuriqi"
|
||||
header-align="center"
|
||||
label="报修日期">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.baoxiuriqi}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="weixiufankui"
|
||||
header-align="center"
|
||||
label="维修反馈">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.weixiufankui}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="weixiujindu"
|
||||
header-align="center"
|
||||
label="维修进度">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.weixiujindu}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="gengxinriqi"
|
||||
header-align="center"
|
||||
label="更新日期">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.gengxinriqi}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="fangzhuzhanghao"
|
||||
header-align="center"
|
||||
label="房主账号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.fangzhuzhanghao}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="fangzhuxingming"
|
||||
header-align="center"
|
||||
label="房主姓名">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.fangzhuxingming}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="yonghuming"
|
||||
header-align="center"
|
||||
label="用户名">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.yonghuming}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :sortable="contents.tableSortable" :align="contents.tableAlign"
|
||||
prop="lianxidianhua"
|
||||
header-align="center"
|
||||
label="联系电话">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.lianxidianhua}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="300" :align="contents.tableAlign"
|
||||
header-align="center"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="isAuth('weixiuchuli','查看') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="success" icon="el-icon-tickets" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}</el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','查看') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="success" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}<i class="el-icon-tickets el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','查看') && contents.tableBtnIcon == 0" type="success" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">{{ contents.tableBtnFont == 1?'详情':'' }}</el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','修改') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="primary" icon="el-icon-edit" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}</el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','修改') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="primary" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}<i class="el-icon-edit el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','修改') && contents.tableBtnIcon == 0" type="primary" size="mini" @click="addOrUpdateHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'修改':'' }}</el-button>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-button v-if="isAuth('weixiuchuli','删除') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 1" type="danger" icon="el-icon-delete" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}</el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','删除') && contents.tableBtnIcon == 1 && contents.tableBtnIconPosition == 2" type="danger" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}<i class="el-icon-delete el-icon--right" /></el-button>
|
||||
<el-button v-if="isAuth('weixiuchuli','删除') && contents.tableBtnIcon == 0" type="danger" size="mini" @click="deleteHandler(scope.row.id)">{{ contents.tableBtnFont == 1?'删除':'' }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
clsss="pages"
|
||||
:layout="layouts"
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="Number(contents.pageEachNum)"
|
||||
:total="totalPage"
|
||||
:small="contents.pageStyle"
|
||||
class="pagination-content"
|
||||
:background="contents.pageBtnBG"
|
||||
:style="{textAlign:contents.pagePosition==1?'left':contents.pagePosition==2?'center':'right'}"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加/修改页面 将父组件的search方法传递给子组件-->
|
||||
<add-or-update v-if="addOrUpdateFlag" :parent="this" ref="addOrUpdate"></add-or-update>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import AddOrUpdate from "./add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
searchForm: {
|
||||
key: ""
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
showFlag: true,
|
||||
sfshVisiable: false,
|
||||
shForm: {},
|
||||
chartVisiable: false,
|
||||
addOrUpdateFlag:false,
|
||||
contents:{"searchBtnFontColor":"#333","pagePosition":"1","inputFontSize":"14px","inputBorderRadius":"22px","tableBtnDelFontColor":"#333","tableBtnIconPosition":"1","searchBtnHeight":"40px","inputIconColor":"rgba(66, 130, 129, 1)","searchBtnBorderRadius":"22px","tableStripe":false,"btnAdAllWarnFontColor":"#333","tableBtnDelBgColor":"rgba(244, 150, 150, 1)","searchBtnIcon":"1","tableSize":"medium","searchBtnBorderStyle":"solid","tableSelection":true,"searchBtnBorderWidth":"1px","tableContentFontSize":"14px","searchBtnBgColor":"rgba(153, 239, 237, 1)","inputTitleSize":"14px","btnAdAllBorderColor":"#DCDFE6","pageJumper":true,"btnAdAllIconPosition":"1","searchBoxPosition":"1","tableBtnDetailFontColor":"#333","tableBtnHeight":"40px","pagePager":true,"searchBtnBorderColor":"#DCDFE6","tableHeaderFontColor":"rgba(33, 34, 35, 1)","inputTitle":"1","tableBtnBorderRadius":"22px","btnAdAllFont":"1","btnAdAllDelFontColor":"rgba(21, 20, 20, 1)","tableBtnIcon":"1","btnAdAllHeight":"40px","btnAdAllWarnBgColor":"rgba(238, 236, 126, 1)","btnAdAllBorderWidth":"1px","tableStripeFontColor":"#606266","tableBtnBorderStyle":"solid","inputHeight":"40px","btnAdAllBorderRadius":"22px","btnAdAllDelBgColor":"rgba(234, 93, 93, 0.69)","pagePrevNext":true,"btnAdAllAddBgColor":"rgba(153, 239, 237, 1)","searchBtnFont":"1","tableIndex":true,"btnAdAllIcon":"1","tableSortable":true,"pageSizes":true,"tableFit":true,"pageBtnBG":true,"searchBtnFontSize":"14px","tableBtnEditBgColor":"rgba(240, 242, 124, 1)","inputBorderWidth":"1px","inputFontPosition":"1","inputFontColor":"#333","pageEachNum":10,"tableHeaderBgColor":"rgba(152, 129, 129, 1)","inputTitleColor":"#333","btnAdAllBoxPosition":"1","tableBtnDetailBgColor":"rgba(171, 239, 239, 1)","inputIcon":"0","searchBtnIconPosition":"1","btnAdAllFontSize":"14px","inputBorderStyle":"solid","inputBgColor":"rgba(197, 174, 174, 0.32)","pageStyle":false,"pageTotal":true,"btnAdAllAddFontColor":"#333","tableBtnFont":"1","tableContentFontColor":"rgba(22, 22, 23, 1)","inputBorderColor":"rgba(152, 129, 129, 1)","tableShowHeader":true,"tableBtnFontSize":"14px","tableBtnBorderColor":"rgba(196, 210, 244, 1)","inputIconPosition":"1","tableBorder":true,"btnAdAllBorderStyle":"solid","tableBtnBorderWidth":"1px","tableStripeBgColor":"rgba(213, 197, 197, 1)","tableBtnEditFontColor":"#333","tableAlign":"center"},
|
||||
layouts: '',
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
this.getDataList();
|
||||
this.contentStyleChange()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
filters: {
|
||||
htmlfilter: function (val) {
|
||||
return val.replace(/<[^>]*>/g).replace(/undefined/g,'');
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
contentStyleChange() {
|
||||
this.contentSearchStyleChange()
|
||||
this.contentBtnAdAllStyleChange()
|
||||
this.contentSearchBtnStyleChange()
|
||||
this.contentTableBtnStyleChange()
|
||||
this.contentPageStyleChange()
|
||||
},
|
||||
contentSearchStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-input__inner').forEach(el=>{
|
||||
let textAlign = 'left'
|
||||
if(this.contents.inputFontPosition == 2) textAlign = 'center'
|
||||
if(this.contents.inputFontPosition == 3) textAlign = 'right'
|
||||
el.style.textAlign = textAlign
|
||||
el.style.height = this.contents.inputHeight
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
el.style.color = this.contents.inputFontColor
|
||||
el.style.fontSize = this.contents.inputFontSize
|
||||
el.style.borderWidth = this.contents.inputBorderWidth
|
||||
el.style.borderStyle = this.contents.inputBorderStyle
|
||||
el.style.borderColor = this.contents.inputBorderColor
|
||||
el.style.borderRadius = this.contents.inputBorderRadius
|
||||
el.style.backgroundColor = this.contents.inputBgColor
|
||||
})
|
||||
if(this.contents.inputTitle) {
|
||||
document.querySelectorAll('.form-content .slt .el-form-item__label').forEach(el=>{
|
||||
el.style.color = this.contents.inputTitleColor
|
||||
el.style.fontSize = this.contents.inputTitleSize
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
}
|
||||
setTimeout(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-input__prefix').forEach(el=>{
|
||||
el.style.color = this.contents.inputIconColor
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
document.querySelectorAll('.form-content .slt .el-input__suffix').forEach(el=>{
|
||||
el.style.color = this.contents.inputIconColor
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
document.querySelectorAll('.form-content .slt .el-input__icon').forEach(el=>{
|
||||
el.style.lineHeight = this.contents.inputHeight
|
||||
})
|
||||
},10)
|
||||
|
||||
})
|
||||
},
|
||||
// 搜索按钮
|
||||
contentSearchBtnStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .slt .el-button--success').forEach(el=>{
|
||||
el.style.height = this.contents.searchBtnHeight
|
||||
el.style.color = this.contents.searchBtnFontColor
|
||||
el.style.fontSize = this.contents.searchBtnFontSize
|
||||
el.style.borderWidth = this.contents.searchBtnBorderWidth
|
||||
el.style.borderStyle = this.contents.searchBtnBorderStyle
|
||||
el.style.borderColor = this.contents.searchBtnBorderColor
|
||||
el.style.borderRadius = this.contents.searchBtnBorderRadius
|
||||
el.style.backgroundColor = this.contents.searchBtnBgColor
|
||||
})
|
||||
})
|
||||
},
|
||||
// 新增、批量删除
|
||||
contentBtnAdAllStyleChange() {
|
||||
this.$nextTick(()=>{
|
||||
document.querySelectorAll('.form-content .ad .el-button--success').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllAddFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllAddBgColor
|
||||
})
|
||||
document.querySelectorAll('.form-content .ad .el-button--danger').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllDelFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllDelBgColor
|
||||
})
|
||||
document.querySelectorAll('.form-content .ad .el-button--warning').forEach(el=>{
|
||||
el.style.height = this.contents.btnAdAllHeight
|
||||
el.style.color = this.contents.btnAdAllWarnFontColor
|
||||
el.style.fontSize = this.contents.btnAdAllFontSize
|
||||
el.style.borderWidth = this.contents.btnAdAllBorderWidth
|
||||
el.style.borderStyle = this.contents.btnAdAllBorderStyle
|
||||
el.style.borderColor = this.contents.btnAdAllBorderColor
|
||||
el.style.borderRadius = this.contents.btnAdAllBorderRadius
|
||||
el.style.backgroundColor = this.contents.btnAdAllWarnBgColor
|
||||
})
|
||||
})
|
||||
},
|
||||
// 表格
|
||||
rowStyle({ row, rowIndex}) {
|
||||
if (rowIndex % 2 == 1) {
|
||||
if(this.contents.tableStripe) {
|
||||
return {color:this.contents.tableStripeFontColor}
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
cellStyle({ row, rowIndex}){
|
||||
if (rowIndex % 2 == 1) {
|
||||
if(this.contents.tableStripe) {
|
||||
return {backgroundColor:this.contents.tableStripeBgColor}
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
headerRowStyle({ row, rowIndex}){
|
||||
return {color: this.contents.tableHeaderFontColor}
|
||||
},
|
||||
headerCellStyle({ row, rowIndex}){
|
||||
return {backgroundColor: this.contents.tableHeaderBgColor}
|
||||
},
|
||||
// 表格按钮
|
||||
contentTableBtnStyleChange(){
|
||||
// this.$nextTick(()=>{
|
||||
// setTimeout(()=>{
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--success').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnDetailFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnDetailBgColor
|
||||
// })
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--primary').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnEditFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnEditBgColor
|
||||
// })
|
||||
// document.querySelectorAll('.table-content .tables .el-table__body .el-button--danger').forEach(el=>{
|
||||
// el.style.height = this.contents.tableBtnHeight
|
||||
// el.style.color = this.contents.tableBtnDelFontColor
|
||||
// el.style.fontSize = this.contents.tableBtnFontSize
|
||||
// el.style.borderWidth = this.contents.tableBtnBorderWidth
|
||||
// el.style.borderStyle = this.contents.tableBtnBorderStyle
|
||||
// el.style.borderColor = this.contents.tableBtnBorderColor
|
||||
// el.style.borderRadius = this.contents.tableBtnBorderRadius
|
||||
// el.style.backgroundColor = this.contents.tableBtnDelBgColor
|
||||
// })
|
||||
|
||||
// }, 50)
|
||||
// })
|
||||
},
|
||||
// 分页
|
||||
contentPageStyleChange(){
|
||||
let arr = []
|
||||
|
||||
if(this.contents.pageTotal) arr.push('total')
|
||||
if(this.contents.pageSizes) arr.push('sizes')
|
||||
if(this.contents.pagePrevNext){
|
||||
arr.push('prev')
|
||||
if(this.contents.pagePager) arr.push('pager')
|
||||
arr.push('next')
|
||||
}
|
||||
if(this.contents.pageJumper) arr.push('jumper')
|
||||
this.layouts = arr.join()
|
||||
this.contents.pageEachNum = 10
|
||||
},
|
||||
|
||||
init () {
|
||||
this.weixiujinduOptions = "维修中,已完成".split(',')
|
||||
},
|
||||
search() {
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
let params = {
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
sort: 'id',
|
||||
}
|
||||
if(this.searchForm.baoxiumingcheng!='' && this.searchForm.baoxiumingcheng!=undefined){
|
||||
params['baoxiumingcheng'] = '%' + this.searchForm.baoxiumingcheng + '%'
|
||||
}
|
||||
if(this.searchForm.weixiujindu!='' && this.searchForm.weixiujindu!=undefined){
|
||||
params['weixiujindu'] = '%' + this.searchForm.weixiujindu + '%'
|
||||
}
|
||||
if(this.searchForm.fangzhuxingming!='' && this.searchForm.fangzhuxingming!=undefined){
|
||||
params['fangzhuxingming'] = '%' + this.searchForm.fangzhuxingming + '%'
|
||||
}
|
||||
if(this.searchForm.yonghuming!='' && this.searchForm.yonghuming!=undefined){
|
||||
params['yonghuming'] = '%' + this.searchForm.yonghuming + '%'
|
||||
}
|
||||
this.$http({
|
||||
url: "weixiuchuli/page",
|
||||
method: "get",
|
||||
params: params
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.data.list;
|
||||
this.totalPage = data.data.total;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandler(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 添加/修改
|
||||
addOrUpdateHandler(id,type) {
|
||||
this.showFlag = false;
|
||||
this.addOrUpdateFlag = true;
|
||||
this.crossAddOrUpdateFlag = false;
|
||||
if(type!='info'){
|
||||
type = 'else';
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id,type);
|
||||
});
|
||||
},
|
||||
// 查看评论
|
||||
// 下载
|
||||
download(file){
|
||||
window.open(`${file}`)
|
||||
},
|
||||
// 删除
|
||||
deleteHandler(id) {
|
||||
var ids = id
|
||||
? [Number(id)]
|
||||
: this.dataListSelections.map(item => {
|
||||
return Number(item.id);
|
||||
});
|
||||
this.$confirm(`确定进行[${id ? "删除" : "批量删除"}]操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: "weixiuchuli/delete",
|
||||
method: "post",
|
||||
data: ids
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.search();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.slt {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ad {
|
||||
margin: 0 !important;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pages {
|
||||
& /deep/ el-pagination__sizes{
|
||||
& /deep/ el-input__inner {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.el-button+.el-button {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.tables {
|
||||
& /deep/ .el-button--success {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(171, 239, 239, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button--primary {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(240, 242, 124, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button--danger {
|
||||
height: 40px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(196, 210, 244, 1);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(244, 150, 150, 1);
|
||||
}
|
||||
|
||||
& /deep/ .el-button {
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,39 @@
|
||||
<?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.dao.StoreupDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.entity.StoreupEntity" id="storeupMap">
|
||||
<result property="userid" column="userid"/>
|
||||
<result property="refid" column="refid"/>
|
||||
<result property="tablename" column="tablename"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="picture" column="picture"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectListVO"
|
||||
resultType="com.entity.vo.StoreupVO" >
|
||||
SELECT * FROM storeup storeup
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVO"
|
||||
resultType="com.entity.vo.StoreupVO" >
|
||||
SELECT storeup.* FROM storeup storeup
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectListView"
|
||||
resultType="com.entity.view.StoreupView" >
|
||||
|
||||
SELECT storeup.* FROM storeup storeup
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectView"
|
||||
resultType="com.entity.view.StoreupView" >
|
||||
SELECT * FROM storeup storeup <where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,46 @@
|
||||
<?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.dao.WeixiuchuliDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.entity.WeixiuchuliEntity" id="weixiuchuliMap">
|
||||
<result property="fangwumingcheng" column="fangwumingcheng"/>
|
||||
<result property="fangwuleixing" column="fangwuleixing"/>
|
||||
<result property="baoxiumingcheng" column="baoxiumingcheng"/>
|
||||
<result property="leixing" column="leixing"/>
|
||||
<result property="baoxiuriqi" column="baoxiuriqi"/>
|
||||
<result property="weixiufankui" column="weixiufankui"/>
|
||||
<result property="weixiujindu" column="weixiujindu"/>
|
||||
<result property="gengxinriqi" column="gengxinriqi"/>
|
||||
<result property="fangzhuzhanghao" column="fangzhuzhanghao"/>
|
||||
<result property="fangzhuxingming" column="fangzhuxingming"/>
|
||||
<result property="yonghuming" column="yonghuming"/>
|
||||
<result property="lianxidianhua" column="lianxidianhua"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectListVO"
|
||||
resultType="com.entity.vo.WeixiuchuliVO" >
|
||||
SELECT * FROM weixiuchuli weixiuchuli
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectVO"
|
||||
resultType="com.entity.vo.WeixiuchuliVO" >
|
||||
SELECT weixiuchuli.* FROM weixiuchuli weixiuchuli
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectListView"
|
||||
resultType="com.entity.view.WeixiuchuliView" >
|
||||
|
||||
SELECT weixiuchuli.* FROM weixiuchuli weixiuchuli
|
||||
<where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
<select id="selectView"
|
||||
resultType="com.entity.view.WeixiuchuliView" >
|
||||
SELECT * FROM weixiuchuli weixiuchuli <where> 1=1 ${ew.sqlSegment}</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue