diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFiling.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFiling.java new file mode 100644 index 0000000000..2d309254bb --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFiling.java @@ -0,0 +1,98 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFiling.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFiling
+ * Description: 价值客户备案申请.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "价值客户备案申请", description = "价值客户备案申请") +@TableName("bus_valcust_filing") +public class BusValcustFiling extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("创建人姓名") + private String createByName; // 创建人姓名 + @ApiModelProperty("申请编号") + private String billNo; // 申请编号 + @ApiModelProperty("分公司sid") + private String useOrgSid; // 分公司sid + @ApiModelProperty("分公司名称") + private String useOrgName; // 分公司名称 + @ApiModelProperty("申请部门sid") + private String applyDeptSid; // 申请部门sid + @ApiModelProperty("申请部门名称") + private String applyDeptName; // 申请部门名称 + @ApiModelProperty("合同编号") + private String contractNo; // 合同编号 + @ApiModelProperty("车型sid") + private String modelSid; // 车型sid + @ApiModelProperty("车型名称") + private String modelName; // 车型名称 + @ApiModelProperty("车辆sid") + private String vinSid; // 车辆sid + @ApiModelProperty("车架号") + private String vinNo; // 车架号 + @ApiModelProperty("0高开,1低开") + private String isGdk; + @ApiModelProperty("加装配置/销售让利金额") + private String money; // 加装配置/销售让利金额 + @ApiModelProperty("应收手续费") + private String ysMoney; // 应收手续费 + @ApiModelProperty("实收手续费") + private String ssMoney; // 实收手续费 + @ApiModelProperty("节点状态") + private String nodeState; // 节点状态 + @ApiModelProperty("流程定义id") + private String procDefId; // 流程定义id + @ApiModelProperty("环节定义id") + private String nodeId; // 环节定义id + @ApiModelProperty("流程实例id") + private String procInstId; // 流程实例id + @ApiModelProperty("任务id") + private String taskId; + @ApiModelProperty("销售订单sid") + private String saleOrderSid; + @ApiModelProperty("组织机构全路径sid") + private String orgSidPath; // 组织机构全路径sid + +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDetailsVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDetailsVo.java new file mode 100644 index 0000000000..c137a214e5 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDetailsVo.java @@ -0,0 +1,93 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + + +import com.yxt.common.core.vo.Vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingVo.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingVo
+ * Description: 价值客户备案申请 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "价值客户备案申请 视图数据详情", description = "价值客户备案申请 视图数据详情") +public class BusValcustFilingDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("创建人姓名") + private String createByName; // 创建人姓名 + @ApiModelProperty("申请编号") + private String billNo; // 申请编号 + @ApiModelProperty("分公司sid") + private String useOrgSid; // 分公司sid + @ApiModelProperty("分公司名称") + private String useOrgName; // 分公司名称 + @ApiModelProperty("申请部门sid") + private String applyDeptSid; // 申请部门sid + @ApiModelProperty("申请部门名称") + private String applyDeptName; // 申请部门名称 + @ApiModelProperty("合同编号") + private String contractNo; // 合同编号 + @ApiModelProperty("车型sid") + private String modelSid; // 车型sid + @ApiModelProperty("车型名称") + private String modelName; // 车型名称 + @ApiModelProperty("车辆sid") + private String vinSid; // 车辆sid + @ApiModelProperty("车架号") + private String vinNo; // 车架号 + @ApiModelProperty("0高开,1低开") + private String isGdk; + @ApiModelProperty("加装配置/销售让利金额") + private String money; // 加装配置/销售让利金额 + @ApiModelProperty("应收手续费") + private String ysMoney; // 应收手续费 + @ApiModelProperty("实收手续费") + private String ssMoney; // 实收手续费 + @ApiModelProperty("销售订单sid") + private String saleOrderSid; + @ApiModelProperty("流程定义id") + private String procDefId; // 流程定义id + @ApiModelProperty("流程实例id") + private String procInstId; // 流程实例id + @ApiModelProperty("组织机构全路径sid") + private String orgSidPath; // 组织机构全路径sid + +} \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDto.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDto.java new file mode 100644 index 0000000000..935f6db72b --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingDto.java @@ -0,0 +1,91 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + + +import com.yxt.common.core.dto.Dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingDto.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDto
+ * Description: 价值客户备案申请 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "价值客户备案申请 数据传输对象", description = "价值客户备案申请 数据传输对象") +public class BusValcustFilingDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("创建人sid") + private String createBySid; + @ApiModelProperty("创建人姓名") + private String createByName; // 创建人姓名 + @ApiModelProperty("申请编号") + private String billNo; // 申请编号 + @ApiModelProperty("分公司sid") + private String useOrgSid; // 分公司sid + @ApiModelProperty("分公司名称") + private String useOrgName; // 分公司名称 + @ApiModelProperty("申请部门sid") + private String applyDeptSid; // 申请部门sid + @ApiModelProperty("申请部门名称") + private String applyDeptName; // 申请部门名称 + @ApiModelProperty("合同编号") + private String contractNo; // 合同编号 + @ApiModelProperty("车型sid") + private String modelSid; // 车型sid + @ApiModelProperty("车型名称") + private String modelName; // 车型名称 + @ApiModelProperty("车辆sid") + private String vinSid; // 车辆sid + @ApiModelProperty("车架号") + private String vinNo; // 车架号 + @ApiModelProperty("0高开,1低开") + private String isGdk; + @ApiModelProperty("加装配置/销售让利金额") + private String money; // 加装配置/销售让利金额 + @ApiModelProperty("应收手续费") + private String ysMoney; // 应收手续费 + @ApiModelProperty("实收手续费") + private String ssMoney; // 实收手续费 + @ApiModelProperty("销售订单sid") + private String saleOrderSid; + @ApiModelProperty("组织机构全路径sid") + private String orgSidPath; // 组织机构全路径sid + +} \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeign.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeign.java new file mode 100644 index 0000000000..80bc8bf7e1 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeign.java @@ -0,0 +1,109 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingFeign.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingFeign
+ * Description: 价值客户备案申请.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "价值客户备案申请") +@FeignClient( + contextId = "anrui-buscenter-BusValcustFiling", + name = "anrui-buscenter", + path = "v1/busvalcustfiling", + fallback = BusValcustFilingFeignFallback.class) +public interface BusValcustFilingFeign { + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + @ResponseBody + public ResultBean> listPage(@RequestBody PagerQuery pq); + + @ApiOperation("新增或修改") + @PostMapping("/save") + @ResponseBody + public ResultBean save(@RequestBody BusValcustFilingDto dto); + + @ApiOperation("根据sid删除记录") + @DeleteMapping("/delBySids") + @ResponseBody + public ResultBean delBySids(@RequestBody String[] sids); + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + @ResponseBody + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid); + + @ApiOperation("提交审批流程") + @PostMapping("/submit") + public ResultBean submit(@RequestBody @Valid SubmitBusValcustFilingDto dto); + + @ApiOperation(value = "办理(同意)") + @PostMapping("/complete") + public ResultBean complete(@Valid @RequestBody BusValcustFilingCompleteDto query); + + @ApiOperation(value = "获取上一个环节") + @GetMapping(value = "/getPreviousNodesForReject") + ResultBean> getPreviousNodesForReject(@Valid @SpringQueryMap BusValcustFilingNodeQuery query); + + @ApiOperation(value = "获取下一个环节") + @GetMapping(value = "/getNextNodesForSubmit") + ResultBean> getNextNodesForSubmit(@Valid @SpringQueryMap BusValcustFilingNodeQuery query); + + @ApiOperation(value = "驳回任务") + @PostMapping(value = "/reject") + public ResultBean reject(@Valid @RequestBody BusValcustFilingTaskQuery query); + + @ApiOperation(value = "撤回流程") + @PostMapping(value = "/revokeProcess") + public ResultBean revokeProcess(@Valid @RequestBody BusValcustFilingTaskQuery query); + + @ApiOperation(value = "终止任务") + @PostMapping(value = "/breakProcess") + public ResultBean breakProcess(@Valid @RequestBody BusValcustFilingTaskQuery query); +} \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeignFallback.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeignFallback.java new file mode 100644 index 0000000000..2c31703da2 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingFeignFallback.java @@ -0,0 +1,108 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.*; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingFeignFallback.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingFeignFallback
+ * Description: 价值客户备案申请.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Component +public class BusValcustFilingFeignFallback implements BusValcustFilingFeign { + + @Override + public ResultBean> listPage(PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + return rb.setMsg("接口anrui-buscenter/busvalcustfiling/listPage无法访问"); + } + + @Override + public ResultBean save(BusValcustFilingDto dto){ + return ResultBean.fireFail().setMsg("接口anrui-buscenter/busvalcustfiling/save无法访问"); + } + + @Override + public ResultBean delBySids( String[] sids){ + return ResultBean.fireFail().setMsg("接口anrui-buscenter/busvalcustfiling/delBySids无法访问"); + } + + @Override + public ResultBean fetchDetailsBySid(String sid){ + ResultBean rb = ResultBean.fireFail(); + return rb.setMsg("接口anrui-buscenter/busvalcustfiling/fetchDetailsBySid无法访问"); + } + + @Override + public ResultBean submit(SubmitBusValcustFilingDto dto) { + return null; + } + + @Override + public ResultBean complete(BusValcustFilingCompleteDto query) { + return null; + } + + @Override + public ResultBean> getPreviousNodesForReject(BusValcustFilingNodeQuery query) { + return null; + } + + @Override + public ResultBean> getNextNodesForSubmit(BusValcustFilingNodeQuery query) { + return null; + } + + @Override + public ResultBean reject(BusValcustFilingTaskQuery query) { + return null; + } + + @Override + public ResultBean revokeProcess(BusValcustFilingTaskQuery query) { + return null; + } + + @Override + public ResultBean breakProcess(BusValcustFilingTaskQuery query) { + return null; + } +} \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingQuery.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingQuery.java new file mode 100644 index 0000000000..cc5da5e66e --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingQuery.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + + +import com.yxt.common.core.query.Query; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingQuery.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingQuery
+ * Description: 价值客户备案申请 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "价值客户备案申请 查询条件", description = "价值客户备案申请 查询条件") +public class BusValcustFilingQuery implements Query { + + @ApiModelProperty("车型") + private String modelName; + @ApiModelProperty("合同编号") + private String contractNo; + @ApiModelProperty("申请人姓名") + private String createByName; + @ApiModelProperty("申请开始日期") + private String createStartTime; + @ApiModelProperty("申请结束日期") + private String createEndTime; + @ApiModelProperty("组织机构全路径sid") + private String orgPath; + @ApiModelProperty("用户sid") + private String userSid; + private String menuUrl; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingVo.java new file mode 100644 index 0000000000..b7815d9309 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/BusValcustFilingVo.java @@ -0,0 +1,80 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.api.busvalcustfiling; + + +import com.yxt.common.core.vo.Vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingVo.java
+ * Class: com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingVo
+ * Description: 价值客户备案申请 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "价值客户备案申请 视图数据对象", description = "价值客户备案申请 视图数据对象") +public class BusValcustFilingVo implements Vo { + + private String sid; + + @ApiModelProperty("节点状态") + private String nodeState; + @ApiModelProperty("分公司名称") + private String useOrgName; + @ApiModelProperty("申请部门名称") + private String applyDeptName; + @ApiModelProperty("申请人姓名") + private String createByName; + @ApiModelProperty("申请日期") + private String createTime; + @ApiModelProperty("合同编号") + private String contractNo; + @ApiModelProperty("车型名称") + private String modelName; + @ApiModelProperty("车架号") + private String vinNo; + @ApiModelProperty("加装配置/销售让利金额") + private String money; + @ApiModelProperty("应收手续费") + private String ysMoney; + @ApiModelProperty("实收手续费") + private String ssMoney; + @ApiModelProperty("流程定义id") + private String procDefId; + @ApiModelProperty("流程实例id") + private String procInstId; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingCompleteDto.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingCompleteDto.java new file mode 100644 index 0000000000..94c4f87f04 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingCompleteDto.java @@ -0,0 +1,37 @@ +package com.yxt.anrui.buscenter.api.busvalcustfiling.flowable; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author dimengzhe + * @Date 2022/9/6 14:57 + * @Description + */ +@Data +public class BusValcustFilingCompleteDto implements Dto { + private static final long serialVersionUID = 6378752532534735663L; + + @ApiModelProperty(value = "用户sid") + private String userSid; + @ApiModelProperty(value = "节点id") + @NotBlank(message = "参数错误:taskDefKey") + private String taskDefKey; + @ApiModelProperty(value = "任务id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + @ApiModelProperty(value = "流程id(PC)") + private String instanceId; + @ApiModelProperty(value = "流程id(移动)") + private String procInsId; + @ApiModelProperty(value = "意见") + private String comment; + @ApiModelProperty(value = "业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + + private String orgPath; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeQuery.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeQuery.java new file mode 100644 index 0000000000..043d3991cf --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeQuery.java @@ -0,0 +1,25 @@ +package com.yxt.anrui.buscenter.api.busvalcustfiling.flowable; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author dimengzhe + * @Date 2022/9/6 15:04 + * @Description + */ +@Data +public class BusValcustFilingNodeQuery implements Query { + private static final long serialVersionUID = 9117613683840483366L; + + @ApiModelProperty(value = "环节定义id") + @NotBlank(message = "参数错误:taskDefKey") + private String taskDefKey; + @ApiModelProperty(value = "业务sid") + private String businessSid; + @ApiModelProperty(value = "0 上一环节 1下一环节") + private Integer next; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeVo.java new file mode 100644 index 0000000000..a1998bc3e6 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingNodeVo.java @@ -0,0 +1,26 @@ +package com.yxt.anrui.buscenter.api.busvalcustfiling.flowable; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author dimengzhe + * @Date 2022/9/6 15:03 + * @Description + */ +@Data +public class BusValcustFilingNodeVo implements Vo { + private static final long serialVersionUID = -833419512294877848L; + + @ApiModelProperty(value = "节点名称") + private String name; + @ApiModelProperty(value = "节点id") + private String id; + @ApiModelProperty(value = "审批组") + private List candidateGroups; + @ApiModelProperty(value = "是否是最后环节") + private String endTask; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingTaskQuery.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingTaskQuery.java new file mode 100644 index 0000000000..7fae309f35 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/BusValcustFilingTaskQuery.java @@ -0,0 +1,48 @@ +package com.yxt.anrui.buscenter.api.busvalcustfiling.flowable; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author dimengzhe + * @Date 2022/9/6 15:06 + * @Description + */ +@Data +public class BusValcustFilingTaskQuery implements Query { + private static final long serialVersionUID = 1288615499873178778L; + + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("任务Id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + /** + * 终止、驳回 + */ + @ApiModelProperty("任务意见") + private String comment; + /** + * 终止、撤回、驳回 + */ + @ApiModelProperty("用户Sid") + private String userSid; + /** + * 终止 + */ + @ApiModelProperty("流程实例Id(PC)") + private String instanceId; + + @ApiModelProperty("流程实例Id(移动)") + private String procInsId; +} diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/SubmitBusValcustFilingDto.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/SubmitBusValcustFilingDto.java new file mode 100644 index 0000000000..56b3ac53a1 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busvalcustfiling/flowable/SubmitBusValcustFilingDto.java @@ -0,0 +1,24 @@ +package com.yxt.anrui.buscenter.api.busvalcustfiling.flowable; + +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liuguohui + * @version 1.0 + * @description + * @date 2022/04/13 + */ +@ApiModel("提交") +@Data +public class SubmitBusValcustFilingDto extends BusValcustFilingDto { + + @ApiModelProperty("意见") + private String comment; + @ApiModelProperty("流程实例id") + private String instanceId; + @ApiModelProperty("任务id") + private String taskId; +} diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.java new file mode 100644 index 0000000000..93fdf0cfa7 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.java @@ -0,0 +1,70 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.biz.busvalcustfiling; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFiling; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingVo; + +import java.util.List; +import java.util.Map; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingMapper.java
+ * Class: com.yxt.anrui.buscenter.biz.busvalcustfiling.BusValcustFilingMapper
+ * Description: 价值客户备案申请.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BusValcustFilingMapper extends BaseMapper { + + //@Update("update bus_valcust_filing set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from bus_valcust_filing") + List selectListVo(); + + int updateFlowFiled(Map map); + + String selectNum(String billNo); +} \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.xml b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.xml new file mode 100644 index 0000000000..ea3ead94fd --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + UPDATE bus_valcust_filing + SET nodeState=#{nodeState}, nodeId=#{taskDefKey} + + , procDefId=#{procDefId} + + + , procInstId=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid=#{sid} + + + + \ No newline at end of file diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingRest.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingRest.java new file mode 100644 index 0000000000..971b048fe9 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingRest.java @@ -0,0 +1,142 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.biz.busvalcustfiling; + +import cn.hutool.core.bean.BeanUtil; +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.*; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFiling; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingQuery; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDetailsVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDto; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingFeign; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingFeignFallback.java
+ * Class: com.yxt.anrui.buscenter.biz.busvalcustfiling.BusValcustFilingRest
+ * Description: 价值客户备案申请.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "价值客户备案申请") +@RestController("com.yxt.anrui.buscenter.biz.busvalcustfiling.BusValcustFilingRest") +@RequestMapping("v1/busvalcustfiling") +public class BusValcustFilingRest implements BusValcustFilingFeign { + + @Autowired + private BusValcustFilingService busValcustFilingService; + + @Override + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = busValcustFilingService.listPageVo(pq); + return rb.success().setData(pv); + } + + @Override + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BusValcustFilingDto dto){ + ResultBean rb = ResultBean.fireFail(); + busValcustFilingService.saveOrUpdateDto(dto); + return rb.success(); + } + + @Override + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + busValcustFilingService.delBySids(sids); + return rb.success(); + } + + @Override + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BusValcustFilingDetailsVo vo = busValcustFilingService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } + + @Override + public ResultBean submit(SubmitBusValcustFilingDto dto) { + return busValcustFilingService.submit(dto); + } + + @Override + public ResultBean complete(BusValcustFilingCompleteDto query) { + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BUSVALCUSTFILING.getProDefId()); + return busValcustFilingService.complete(bv); + } + + @Override + public ResultBean> getPreviousNodesForReject(BusValcustFilingNodeQuery query) { + return busValcustFilingService.getPreviousNodesForReject(query); + } + + @Override + public ResultBean> getNextNodesForSubmit(BusValcustFilingNodeQuery query) { + return busValcustFilingService.getNextNodesForSubmit(query); + } + + @Override + public ResultBean reject(BusValcustFilingTaskQuery query) { + return busValcustFilingService.reject(query); + } + + @Override + public ResultBean revokeProcess(BusValcustFilingTaskQuery query) { + return busValcustFilingService.revokeProcess(query); + } + + @Override + public ResultBean breakProcess(BusValcustFilingTaskQuery query) { + return busValcustFilingService.breakProcess(query); + } +} diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingService.java new file mode 100644 index 0000000000..b8b2faa591 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvalcustfiling/BusValcustFilingService.java @@ -0,0 +1,496 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.buscenter.biz.busvalcustfiling; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.anrui.base.common.utils.Rule; +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.BusValcustFilingNodeQuery; +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.BusValcustFilingNodeVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.BusValcustFilingTaskQuery; +import com.yxt.anrui.buscenter.api.busvalcustfiling.flowable.SubmitBusValcustFilingDto; +import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationVo; +import com.yxt.anrui.flowable.api.flow.FlowProcessMapQuery; +import com.yxt.anrui.flowable.api.flow.FlowableFeign; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; +import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; +import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; +import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; +import com.yxt.anrui.portal.api.sysuser.SysUserFeign; +import com.yxt.anrui.riskcenter.api.loancreditappealapply.LoanCreditAppealApply; +import com.yxt.anrui.riskcenter.api.loancreditappealapply.flowable.LoanCreditApplyNodeVo; +import com.yxt.anrui.riskcenter.api.loancreditappealapply.flowable.SubmitLoanCreditApplyDto; +import com.yxt.messagecenter.api.message.MessageFeign; +import com.yxt.messagecenter.api.message.MessageFlowVo; +import com.yxt.messagecenter.api.message.MessageFlowableQuery; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFiling; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingQuery; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDetailsVo; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDto; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingFeign; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * Project: anrui-buscenter(价值客户备案申请)
+ * File: BusValcustFilingService.java
+ * Class: com.yxt.anrui.buscenter.biz.busvalcustfiling.BusValcustFilingService
+ * Description: 价值客户备案申请 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-09-15 11:38:12
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BusValcustFilingService extends MybatisBaseService { + + @Autowired + private SysUserFeign sysUserFeign; + @Autowired + private FlowableFeign flowableFeign; + @Autowired + private MessageFeign messageFeign; + @Autowired + private FlowTaskFeign flowTaskFeign; + @Autowired + SysOrganizationFeign sysOrganizationFeign; + + public PagerVo listPageVo(PagerQuery pq) { + BusValcustFilingQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + //========================================数据授权开始 + if (StringUtils.isNotBlank(query.getMenuUrl())) { + //======================= + PrivilegeQuery privilegeQuery = new PrivilegeQuery(); + privilegeQuery.setOrgPath(query.getOrgPath()); + privilegeQuery.setMenuUrl(query.getMenuUrl()); + privilegeQuery.setUserSid(query.getUserSid()); + ResultBean defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); + if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { + //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) + String orgSidPath = query.getOrgPath(); + orgSidPath = orgSidPath + "/"; + int i1 = orgSidPath.indexOf("/"); + int i2 = orgSidPath.indexOf("/", i1 + 1); + int i3 = orgSidPath.indexOf("/", i2 + 1); + int i4 = orgSidPath.indexOf("/", i3 + 1); + String orgLevelKey = defaultIdReltBean.getData(); + if ("1".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i1); + qw.like("bf.orgSidPath", orgSidPath); + } else if ("2".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i2); + qw.like("bf.orgSidPath", orgSidPath); + } else if ("3".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i3); + qw.like("bf.orgSidPath", orgSidPath); + } else if ("4".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i4); + qw.like("bf.orgSidPath", orgSidPath); + } else if ("5".equals(orgLevelKey)) { + qw.eq("bf.createBySid", query.getUserSid()); + } else { + PagerVo p = new PagerVo<>(); + return p; + } + } else { + PagerVo p = new PagerVo<>(); + return p; + } + if (StringUtils.isNotBlank(query.getContractNo())) { + qw.like("bf.contractNo", query.getContractNo()); + } + if (StringUtils.isNotBlank(query.getCreateByName())) { + qw.like("bf.createByName", query.getCreateByName()); + } + if (StringUtils.isNotBlank(query.getModelName())){ + qw.like("bf.modelName",query.getModelName()); + } + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (bf.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (bf.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public ResultBean saveOrUpdateDto(BusValcustFilingDto dto) { + ResultBean rb = ResultBean.fireFail(); + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + //生成单据编号 + String billNo = ""; + SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); + String date = DateUtil.format(DateUtil.date(), "yyyyMM"); + billNo = "JZKHBA" + sysOrganizationVo.getOrgCode() + date; + String i = baseMapper.selectNum(billNo); + if (StringUtils.isNotBlank(i)) { + billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); + } else { + billNo = Rule.getBillNo(billNo, 0); + } + dto.setBillNo(billNo); + String sid = this.insertByDto(dto); + return rb.success().setData(sid); + } + this.updateByDto(dto); + return rb.success().setData(dtoSid); + } + + public String insertByDto(BusValcustFilingDto dto) { + BusValcustFiling entity = new BusValcustFiling(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + entity.setNodeState("待提交"); + baseMapper.insert(entity); + return entity.getSid(); + } + + public void updateByDto(BusValcustFilingDto dto) { + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BusValcustFiling entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BusValcustFilingDetailsVo fetchDetailsVoBySid(String sid) { + BusValcustFiling entity = fetchBySid(sid); + BusValcustFilingDetailsVo vo = new BusValcustFilingDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public ResultBean submit(SubmitBusValcustFilingDto dto) { + ResultBean rb = ResultBean.fireFail(); + BusValcustFiling busValcustFiling = fetchBySid(dto.getSid()); + int r = submitBusinessData(dto, busValcustFiling); + if (r == 3) { + return rb.setMsg("该申请不存在"); + } + if (r == 0) { + return rb.setMsg("操作失败!提交的数据不一致"); + } + //新增修改保存 + ResultBean resultBean = saveOrUpdateDto(dto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + String businessSid = resultBean.getData(); + //创建BusinessVariables实体对象 + BusinessVariables bv = new BusinessVariables(); + //流程中的参数赋值、若有网关,则赋值网关中判断的字段。 + Map variables = new HashMap<>(); + //用户的部门全路径sid + bv.setOrgSidPath(dto.getOrgSidPath()); + //业务sid + bv.setBusinessSid(businessSid); + //用户sid + bv.setUserSid(dto.getCreateBySid()); + //若app移动端有此功能,则传递appMap参数 + Map appMap = new HashMap<>(); + //需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。 + variables.put("app", appMap); + //流程定义id + bv.setModelId(ProcDefEnum.BUSVALCUSTFILING.getProDefId()); + bv.setFormVariables(variables); + if (r == 1) { + ResultBean voResultBean = flowableFeign.startProcess(bv); + UpdateFlowFieldVo ufVo = voResultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(ufVo)); + //极光推送 + busValcustFiling = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("价值客户备案申请"); + messageFlowableQuery.setMsgContent(busValcustFiling.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("价值客户备案申请"); + messageFeign.pushMessage(messageFlowableQuery); + return voResultBean; + } + if (r == 2) { + // ToDo:驳回到发起人后再次提交 + if (StringUtils.isBlank(dto.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + bv.setTaskId(busValcustFiling.getTaskId()); + bv.setTaskDefKey(busValcustFiling.getNodeId()); + bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); + bv.setInstanceId(dto.getInstanceId()); + return complete(bv); + } + return rb; + } + + private int updateFlowFiled(Map map) { + return baseMapper.updateFlowFiled(map); + } + + private synchronized int submitBusinessData(SubmitBusValcustFilingDto dto, BusValcustFiling busValcustFiling) { + int r = 0; + if (StringUtils.isBlank(dto.getSid())) { + r = 1; + } else { + if (busValcustFiling != null) { + String businessTaskId = busValcustFiling.getTaskId(); + if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { + //新提交 + r = 1; + } else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { + //二次提交//只有数据一致的时候才能进行下一步 + r = 2; + } + } else { + r = 3; + } + + } + return r; + } + + public ResultBean complete(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + String businessSid = bv.getBusinessSid(); + BusValcustFiling busValcustFiling = fetchBySid(businessSid); + Map variables = new HashMap<>(); + Map appMap = new HashMap<>(); + variables.put("app", appMap); + FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); + if (StringUtils.isBlank(busValcustFiling.getProcDefId())) { + flowProcessMapQuery.setProDefKey(bv.getModelId()); + } else { + flowProcessMapQuery.setProDefKey(busValcustFiling.getProcDefId()); + } + flowProcessMapQuery.setVariables(variables); + variables = flowableFeign.getMap(flowProcessMapQuery).getData(); + //======================================= + bv.setFormVariables(variables); + bv.setOrgSidPath(busValcustFiling.getOrgSidPath()); + if (bv.getTaskId().equals(busValcustFiling.getTaskId())) { + ResultBean resultBean = flowableFeign.handleProsess(bv); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + UpdateFlowFieldVo ufVo = resultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { + } else { + //极光推送 + busValcustFiling = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + ufVo.setProcDefId(busValcustFiling.getProcDefId()); + ufVo.setProcInsId(busValcustFiling.getProcInstId()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("价值客户备案申请"); + messageFlowableQuery.setMsgContent(busValcustFiling.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("价值客户备案申请"); + messageFeign.pushMessage(messageFlowableQuery); + } + return rb.success().setData(resultBean.getData()); + } else { + return rb.setMsg("操作失败!提交的数据不一致"); + } + } + + public ResultBean> getPreviousNodesForReject(BusValcustFilingNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BUSVALCUSTFILING.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), BusValcustFilingNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } + + public ResultBean> getNextNodesForSubmit(BusValcustFilingNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.BUSVALCUSTFILING.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), BusValcustFilingNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } + + public ResultBean reject(BusValcustFilingTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + String businessSid = query.getBusinessSid(); + BusValcustFiling busValcustFiling = fetchBySid(businessSid); + if (busValcustFiling == null) { + return rb.setMsg("该申请不存在"); + } + String businessTaskId = busValcustFiling.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + if (StringUtils.isBlank(query.getComment())) { + return rb.setMsg("请填写意见"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + Map variables = new HashMap<>(); + Map appMap = new HashMap<>(); + variables.put("app", appMap); + flowTaskVo.setValues(variables); + ResultBean resultBean = flowableFeign.taskReject(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + UpdateFlowFieldVo ufVo = resultBean.getData(); + Map map = BeanUtil.beanToMap(ufVo); + //更新业务中的流程相关的参数 + updateFlowFiled(map); + //极光推送 + busValcustFiling = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + String procId = busValcustFiling.getProcInstId(); + ufVo.setProcInsId(procId); + ufVo.setProcDefId(busValcustFiling.getProcDefId()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("价值客户备案申请"); + ResultBean> listResultBean = flowTaskFeign.getLatestTasks(procId); + String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); + List receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); + if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(busValcustFiling.getCreateBySid())) { + messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); + } else { + messageFlowableQuery.setMsgContent(busValcustFiling.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + } + messageFlowableQuery.setMsgTitle("价值客户备案申请"); + messageFeign.pushMessage(messageFlowableQuery); + return rb.success(); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } + + public ResultBean revokeProcess(BusValcustFilingTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + BusValcustFiling busValcustFiling = fetchBySid(query.getBusinessSid()); + String businessTaskId = busValcustFiling.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.revokeProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败,提交的数据不一致!"); + } + + public ResultBean breakProcess(BusValcustFilingTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + if (StringUtils.isBlank(query.getComment())) { + return rb.setMsg("请填写意见"); + } + BusValcustFiling busValcustFiling = fetchBySid(query.getBusinessSid()); + String businessTaskId = busValcustFiling.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (query.getUserSid().equals(busValcustFiling.getCreateBySid())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + updateFlowFiled(map); + return rb.success().setData(resultBean.getData()); + } else { + if (businessTaskId.equals(query.getTaskId())) { + FlowTaskVo flowTaskVo = new FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + updateFlowFiled(map); + return rb.success().setData(resultBean.getData()); + } + } + + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } +} \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finbillapplication/FinBillApplicationService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finbillapplication/FinBillApplicationService.java index 044a42f409..f452e43679 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finbillapplication/FinBillApplicationService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finbillapplication/FinBillApplicationService.java @@ -61,6 +61,8 @@ import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingDto; +import com.yxt.anrui.buscenter.api.busvalcustfiling.BusValcustFilingFeign; import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; import com.yxt.anrui.fin.api.finbillapplication.*; @@ -205,6 +207,8 @@ public class FinBillApplicationService extends MybatisBaseService createQueryWrapper(FinBillApplicationQuery query) { // todo: 这里根据具体业务调整查询条件 @@ -753,78 +757,68 @@ public class FinBillApplicationService extends MybatisBaseService finBillVehicleVos = finBillVehicleService.fetchVehBySid(businessSid); List finBillTrailerVos = finBillTrailerService.fetchByMainSid(businessSid); - for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { - int count = finVehicleInvoiceService.selectCountByVinSid(finBillVehicleVo.getVehSid()); - if (count == 0) { - FinVehicleInvoiceDto finVehicleInvoiceDto = new FinVehicleInvoiceDto(); - finVehicleInvoiceDto.setInvoiceTitle(finBillApplication.getOpenTickUnitName()); - finVehicleInvoiceDto.setContractNo(finBillApplication.getContractNo()); - finVehicleInvoiceDto.setCustomerName(finBillApplication.getCustomerName()); - finVehicleInvoiceDto.setVehicleSid(finBillVehicleVo.getVehSid()); - finVehicleInvoiceDto.setVIN(finBillVehicleVo.getVinNo()); - finVehicleInvoiceDto.setInvoiceTypeKey(finBillVehicleVo.getBillTypeKey()); - finVehicleInvoiceDto.setInvoiceType(finBillVehicleVo.getBillTypeValue()); - finVehicleInvoiceDto.setInvoiceAmount(finBillApplication.getOneBillMoney()); - finVehicleInvoiceDto.setBillingStateKey("001"); - finVehicleInvoiceDto.setBillingState("未开票"); - finVehicleInvoiceDto.setTransferStateKey("001"); - finVehicleInvoiceDto.setTransferState("未移交"); - finVehicleInvoiceDto.setVehicleType("主车"); - finVehicleInvoiceDto.setBillingSid(finBillApplication.getSid()); - finVehicleInvoiceDto.setInvoicingName(finBillVehicleVo.getOpenTickName()); - finVehicleInvoiceDto.setCreateBySid(finBillApplication.getCreateBySid()); - BusArrearsCarryVehicleApplyVo busArrearsCarryVehicleApplyVo = busArrearsCarryVehicleApplyFeign.selComByVehSid(finBillVehicleVo.getVehSid()).getData(); - if (busArrearsCarryVehicleApplyVo == null){ - finVehicleInvoiceDto.setBusinessStateKey(finBillApplication.getBillStateKey()); - finVehicleInvoiceDto.setBusinessState(finBillApplication.getBillStateValue()); - }else { - finVehicleInvoiceDto.setBusinessStateKey("005"); - finVehicleInvoiceDto.setBusinessState("欠款提车"); - } - finVehicleInvoiceDto.setUseOrgSid(finBillApplication.getUseOrgSid()); - FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.fetchDetailsVoBySid(finBillVehicleVo.getOpenTickSid()); - if (StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { - finVehicleInvoiceDto.setAddress(finCompanyInvoicingDetailsVo.getAddress()); - finVehicleInvoiceDto.setTelPhone(finCompanyInvoicingDetailsVo.getPhone()); - finVehicleInvoiceDto.setOpeningBank(finCompanyInvoicingDetailsVo.getBankName()); - finVehicleInvoiceDto.setBankNum(finCompanyInvoicingDetailsVo.getBankAccount()); - finVehicleInvoiceDto.setTaxpayerNo(finCompanyInvoicingDetailsVo.getTaxpayerNo()); - } else { - CrmCustomerTempVo crmCustomerTempVo = crmCustomerTempFeign.fetchSid(finBillVehicleVo.getOpenTickSid()).getData(); - finVehicleInvoiceDto.setTelPhone(crmCustomerTempVo.getMobile()); - finVehicleInvoiceDto.setTaxpayerNo(crmCustomerTempVo.getIDNumber()); - } - finVehicleInvoiceDto.setIsTakeTicket("是"); - finVehicleInvoiceService.mySave(finVehicleInvoiceDto); + if (!data.getSingleFinalPrice().equals(finBillApplication.getOneBillMoney())){//是高低开 + BusValcustFilingDto busValcustFilingDto = new BusValcustFilingDto(); + busValcustFilingDto.setCreateBySid(finBillApplication.getCreateBySid()); + busValcustFilingDto.setCreateByName(finBillApplication.getCreateByName()); + busValcustFilingDto.setOrgSidPath(finBillApplication.getOrgSidPath()); + busValcustFilingDto.setUseOrgSid(finBillApplication.getUseOrgSid()); + SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(finBillApplication.getUseOrgSid()).getData(); + busValcustFilingDto.setUseOrgName(sysOrganizationVo.getName()); + busValcustFilingDto.setApplyDeptSid(finBillApplication.getDeptSid()); + busValcustFilingDto.setApplyDeptName(finBillApplication.getDeptName()); + busValcustFilingDto.setContractNo(finBillApplication.getContractNo()); + busValcustFilingDto.setModelSid(finBillApplication.getModelSid()); + busValcustFilingDto.setModelName(finBillApplication.getModelName()); + String vinSid = ""; + String vinNo = ""; + for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { + vinSid = vinSid + finBillVehicleVo.getVehSid() + ","; + vinNo = vinNo + finBillVehicleVo.getVinNo() + ","; } - } - if (finBillTrailerVos != null) { - for (FinBillTrailerVo finBillTrailerVo : finBillTrailerVos) { - String gcVinNo = finBillTrailerVo.getGcVinNo(); - BaseTrailerDetailsVo baseTrailerDetailsVo = baseTrailerFeign.fetchByGcVinNo(gcVinNo).getData(); - int count = finVehicleInvoiceService.selectCountByVinSid(baseTrailerDetailsVo.getSid()); + busValcustFilingDto.setVinSid(vinSid.substring(0,vinSid.lastIndexOf(","))); + busValcustFilingDto.setVinNo(vinNo.substring(0,vinNo.lastIndexOf(","))); + BigDecimal money = finBillApplication.getOneBillMoney().subtract(data.getSingleFinalPrice()); + int i = money.compareTo(BigDecimal.ZERO); + if (i == 1){ + busValcustFilingDto.setIsGdk("0"); + }else { + busValcustFilingDto.setIsGdk("1"); + } + busValcustFilingDto.setMoney(money.abs().toString()); + busValcustFilingDto.setSaleOrderSid(busSalesOrder.getSid()); + busValcustFilingFeign.save(busValcustFilingDto); + }else {//不是高低开 + for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { + int count = finVehicleInvoiceService.selectCountByVinSid(finBillVehicleVo.getVehSid()); if (count == 0) { FinVehicleInvoiceDto finVehicleInvoiceDto = new FinVehicleInvoiceDto(); finVehicleInvoiceDto.setInvoiceTitle(finBillApplication.getOpenTickUnitName()); finVehicleInvoiceDto.setContractNo(finBillApplication.getContractNo()); finVehicleInvoiceDto.setCustomerName(finBillApplication.getCustomerName()); - finVehicleInvoiceDto.setVehicleSid(baseTrailerDetailsVo.getSid()); - finVehicleInvoiceDto.setVIN(gcVinNo); - finVehicleInvoiceDto.setInvoiceTypeKey(finBillTrailerVo.getBillTypeKey()); - finVehicleInvoiceDto.setInvoiceType(finBillTrailerVo.getBillTypeValue()); - finVehicleInvoiceDto.setInvoiceAmount(new BigDecimal(finBillTrailerVo.getOneBillMoney())); + finVehicleInvoiceDto.setVehicleSid(finBillVehicleVo.getVehSid()); + finVehicleInvoiceDto.setVIN(finBillVehicleVo.getVinNo()); + finVehicleInvoiceDto.setInvoiceTypeKey(finBillVehicleVo.getBillTypeKey()); + finVehicleInvoiceDto.setInvoiceType(finBillVehicleVo.getBillTypeValue()); + finVehicleInvoiceDto.setInvoiceAmount(finBillApplication.getOneBillMoney()); finVehicleInvoiceDto.setBillingStateKey("001"); finVehicleInvoiceDto.setBillingState("未开票"); finVehicleInvoiceDto.setTransferStateKey("001"); finVehicleInvoiceDto.setTransferState("未移交"); - finVehicleInvoiceDto.setVehicleType("挂车"); + finVehicleInvoiceDto.setVehicleType("主车"); finVehicleInvoiceDto.setBillingSid(finBillApplication.getSid()); - finVehicleInvoiceDto.setInvoicingName(finBillTrailerVo.getOpenTickName()); + finVehicleInvoiceDto.setInvoicingName(finBillVehicleVo.getOpenTickName()); finVehicleInvoiceDto.setCreateBySid(finBillApplication.getCreateBySid()); - finVehicleInvoiceDto.setBusinessStateKey(finBillApplication.getBillStateKey()); - finVehicleInvoiceDto.setBusinessState(finBillApplication.getBillStateValue()); + BusArrearsCarryVehicleApplyVo busArrearsCarryVehicleApplyVo = busArrearsCarryVehicleApplyFeign.selComByVehSid(finBillVehicleVo.getVehSid()).getData(); + if (busArrearsCarryVehicleApplyVo == null){ + finVehicleInvoiceDto.setBusinessStateKey(finBillApplication.getBillStateKey()); + finVehicleInvoiceDto.setBusinessState(finBillApplication.getBillStateValue()); + }else { + finVehicleInvoiceDto.setBusinessStateKey("005"); + finVehicleInvoiceDto.setBusinessState("欠款提车"); + } finVehicleInvoiceDto.setUseOrgSid(finBillApplication.getUseOrgSid()); - FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.fetchDetailsVoBySid(finBillTrailerVo.getOpenTickSid()); + FinCompanyInvoicingDetailsVo finCompanyInvoicingDetailsVo = finCompanyInvoicingService.fetchDetailsVoBySid(finBillVehicleVo.getOpenTickSid()); if (StringUtils.isNotBlank(finCompanyInvoicingDetailsVo.getBankAccount())) { finVehicleInvoiceDto.setAddress(finCompanyInvoicingDetailsVo.getAddress()); finVehicleInvoiceDto.setTelPhone(finCompanyInvoicingDetailsVo.getPhone()); @@ -832,7 +826,7 @@ public class FinBillApplicationService extends MybatisBaseService + + anrui-system-ui + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + + + + 1629107336958 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-node_modules + + + + diff --git a/anrui-reportcenter-ui/.travis.yml b/anrui-reportcenter-ui/.travis.yml new file mode 100644 index 0000000000..f4be7a0855 --- /dev/null +++ b/anrui-reportcenter-ui/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/anrui-reportcenter-ui/LICENSE b/anrui-reportcenter-ui/LICENSE new file mode 100644 index 0000000000..61515750df --- /dev/null +++ b/anrui-reportcenter-ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/anrui-reportcenter-ui/README-zh.md b/anrui-reportcenter-ui/README-zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/anrui-reportcenter-ui/README.md b/anrui-reportcenter-ui/README.md new file mode 100644 index 0000000000..a2f3c71543 --- /dev/null +++ b/anrui-reportcenter-ui/README.md @@ -0,0 +1,90 @@ +# vue-admin-template + +English | [简体中文](./README-zh.md) + +> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint + +**Live demo:** http://panjiachen.github.io/vue-admin-template + + +**The current version is `v4.0+` build on `vue-cli`. If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0), it does not rely on `vue-cli`** + +## Build Setup + +```bash +# clone the project +git clone https://github.com/PanJiaChen/vue-admin-template.git + +# enter the project directory +cd vue-admin-template + +# install dependency +npm install + +# develop +npm run dev +``` + +This will automatically open http://localhost:9528 + +## Build + +```bash +# build for test environment +npm run build:stage + +# build for production environment +npm run build:prod +``` + +## Advanced + +```bash +# preview the release environment effect +npm run preview + +# preview the release environment effect + static resource analysis +npm run preview -- --report + +# code format check +npm run lint + +# code format check and auto fix +npm run lint -- --fix +``` + +Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information + +## Demo + +![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif) + +## Extra + +If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control) + +For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) + +## Related Project + +- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) + +- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) + +- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) + +- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312) + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + +## License + +[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license. + +Copyright (c) 2017-present PanJiaChen diff --git a/anrui-reportcenter-ui/babel.config.js b/anrui-reportcenter-ui/babel.config.js new file mode 100644 index 0000000000..fb82b2715f --- /dev/null +++ b/anrui-reportcenter-ui/babel.config.js @@ -0,0 +1,14 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html + 'plugins': ['dynamic-import-node'] + } + } +} diff --git a/anrui-reportcenter-ui/build/index.js b/anrui-reportcenter-ui/build/index.js new file mode 100644 index 0000000000..0c57de2aad --- /dev/null +++ b/anrui-reportcenter-ui/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/anrui-reportcenter-ui/jest.config.js b/anrui-reportcenter-ui/jest.config.js new file mode 100644 index 0000000000..143cdc868c --- /dev/null +++ b/anrui-reportcenter-ui/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/anrui-reportcenter-ui/jsconfig.json b/anrui-reportcenter-ui/jsconfig.json new file mode 100644 index 0000000000..ed079e2b9b --- /dev/null +++ b/anrui-reportcenter-ui/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/anrui-reportcenter-ui/mock/index.js b/anrui-reportcenter-ui/mock/index.js new file mode 100644 index 0000000000..c514c13573 --- /dev/null +++ b/anrui-reportcenter-ui/mock/index.js @@ -0,0 +1,57 @@ +const Mock = require('mockjs') +const { param2Obj } = require('./utils') + +const user = require('./user') +const table = require('./table') + +const mocks = [ + ...user, + ...table +] + +// for front mock +// please use it cautiously, it will redefine XMLHttpRequest, +// which will cause many of your third-party libraries to be invalidated(like progress event). +function mockXHR() { + // mock patch + // https://github.com/nuysoft/Mock/issues/300 + Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send + Mock.XHR.prototype.send = function() { + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + + if (this.responseType) { + this.custom.xhr.responseType = this.responseType + } + } + this.proxy_send(...arguments) + } + + function XHR2ExpressReqWrap(respond) { + return function(options) { + let result = null + if (respond instanceof Function) { + const { body, type, url } = options + // https://expressjs.com/en/4x/api.html#req + result = respond({ + method: type, + body: JSON.parse(body), + query: param2Obj(url) + }) + } else { + result = respond + } + return Mock.mock(result) + } + } + + for (const i of mocks) { + Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) + } +} + +module.exports = { + mocks, + mockXHR +} + diff --git a/anrui-reportcenter-ui/mock/mock-server.js b/anrui-reportcenter-ui/mock/mock-server.js new file mode 100644 index 0000000000..8941ec0f80 --- /dev/null +++ b/anrui-reportcenter-ui/mock/mock-server.js @@ -0,0 +1,81 @@ +const chokidar = require('chokidar') +const bodyParser = require('body-parser') +const chalk = require('chalk') +const path = require('path') +const Mock = require('mockjs') + +const mockDir = path.join(process.cwd(), 'mock') + +function registerRoutes(app) { + let mockLastIndex + const { mocks } = require('./index.js') + const mocksForServer = mocks.map(route => { + return responseFake(route.url, route.type, route.response) + }) + for (const mock of mocksForServer) { + app[mock.type](mock.url, mock.response) + mockLastIndex = app._router.stack.length + } + const mockRoutesLength = Object.keys(mocksForServer).length + return { + mockRoutesLength: mockRoutesLength, + mockStartIndex: mockLastIndex - mockRoutesLength + } +} + +function unregisterRoutes() { + Object.keys(require.cache).forEach(i => { + if (i.includes(mockDir)) { + delete require.cache[require.resolve(i)] + } + }) +} + +// for mock server +const responseFake = (url, type, respond) => { + return { + url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), + type: type || 'get', + response(req, res) { + console.log('request invoke:' + req.path) + res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) + } + } +} + +module.exports = app => { + // parse app.body + // https://expressjs.com/en/4x/api.html#req.body + app.use(bodyParser.json()) + app.use(bodyParser.urlencoded({ + extended: true + })) + + const mockRoutes = registerRoutes(app) + var mockRoutesLength = mockRoutes.mockRoutesLength + var mockStartIndex = mockRoutes.mockStartIndex + + // watch files, hot reload mock server + chokidar.watch(mockDir, { + ignored: /mock-server/, + ignoreInitial: true + }).on('all', (event, path) => { + if (event === 'change' || event === 'add') { + try { + // remove mock routes stack + app._router.stack.splice(mockStartIndex, mockRoutesLength) + + // clear routes cache + unregisterRoutes() + + const mockRoutes = registerRoutes(app) + mockRoutesLength = mockRoutes.mockRoutesLength + mockStartIndex = mockRoutes.mockStartIndex + + console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) + } catch (error) { + console.log(chalk.redBright(error)) + } + } + }) +} diff --git a/anrui-reportcenter-ui/mock/table.js b/anrui-reportcenter-ui/mock/table.js new file mode 100644 index 0000000000..bd0e0133e1 --- /dev/null +++ b/anrui-reportcenter-ui/mock/table.js @@ -0,0 +1,29 @@ +const Mock = require('mockjs') + +const data = Mock.mock({ + 'items|30': [{ + id: '@id', + title: '@sentence(10, 20)', + 'status|1': ['published', 'draft', 'deleted'], + author: 'name', + display_time: '@datetime', + pageviews: '@integer(300, 5000)' + }] +}) + +module.exports = [ + { + url: '/vue-admin-template/table/list', + type: 'get', + response: config => { + const items = data.items + return { + code: 20000, + data: { + total: items.length, + items: items + } + } + } + } +] diff --git a/anrui-reportcenter-ui/mock/user.js b/anrui-reportcenter-ui/mock/user.js new file mode 100644 index 0000000000..7555338562 --- /dev/null +++ b/anrui-reportcenter-ui/mock/user.js @@ -0,0 +1,84 @@ + +const tokens = { + admin: { + token: 'admin-token' + }, + editor: { + token: 'editor-token' + } +} + +const users = { + 'admin-token': { + roles: ['admin'], + introduction: 'I am a super administrator', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Super Admin' + }, + 'editor-token': { + roles: ['editor'], + introduction: 'I am an editor', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Normal Editor' + } +} + +module.exports = [ + // user login + { + url: '/vue-admin-template/user/login', + type: 'post', + response: config => { + const { username } = config.body + const token = tokens[username] + + // mock error + if (!token) { + return { + code: 60204, + message: 'Account and password are incorrect.' + } + } + + return { + code: 20000, + data: token + } + } + }, + + // get user info + { + url: '/vue-admin-template/user/info\.*', + type: 'get', + response: config => { + const { token } = config.query + const info = users[token] + + // mock error + if (!info) { + return { + code: 50008, + message: 'Login failed, unable to get user details.' + } + } + + return { + code: 20000, + data: info + } + } + }, + + // user logout + { + url: '/vue-admin-template/user/logout', + type: 'post', + response: _ => { + return { + code: 20000, + data: 'success' + } + } + } +] diff --git a/anrui-reportcenter-ui/mock/utils.js b/anrui-reportcenter-ui/mock/utils.js new file mode 100644 index 0000000000..95cc27d5fe --- /dev/null +++ b/anrui-reportcenter-ui/mock/utils.js @@ -0,0 +1,25 @@ +/** + * @param {string} url + * @returns {Object} + */ +function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +module.exports = { + param2Obj +} diff --git a/anrui-reportcenter-ui/package.json b/anrui-reportcenter-ui/package.json new file mode 100644 index 0000000000..48c94f7525 --- /dev/null +++ b/anrui-reportcenter-ui/package.json @@ -0,0 +1,69 @@ +{ + "name": "admin-template", + "version": "4.4.0", + "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", + "author": "Pan ", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit" + }, + "dependencies": { + "axios": "0.18.1", + "core-js": "^3.22.5", + "element-ui": "2.13.2", + "js-cookie": "2.2.0", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path-to-regexp": "2.4.0", + "portfinder": "^1.0.21", + "qs": "^6.9.4", + "sass-resources-loader": "^2.1.1", + "viewerjs": "^1.9.0", + "vue": "2.6.10", + "vue-amap": "^0.5.10", + "vue-router": "3.0.6", + "vuex": "3.1.0", + "vuex-persistedstate": "^4.0.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.4", + "@vue/cli-plugin-eslint": "4.4.4", + "@vue/cli-plugin-unit-jest": "4.4.4", + "@vue/cli-service": "4.4.4", + "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "9.5.1", + "babel-eslint": "10.1.0", + "babel-jest": "23.6.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "babel-polyfill": "^6.26.0", + "chalk": "2.4.2", + "connect": "3.6.6", + "eslint": "6.7.2", + "eslint-plugin-vue": "6.2.2", + "html-webpack-plugin": "3.2.0", + "mockjs": "1.0.1-beta3", + "runjs": "4.3.2", + "sass": "1.26.8", + "sass-loader": "8.0.2", + "script-ext-html-webpack-plugin": "2.1.3", + "serve-static": "1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vue-template-compiler": "2.6.10" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ], + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "license": "MIT" +} diff --git a/anrui-reportcenter-ui/postcss.config.js b/anrui-reportcenter-ui/postcss.config.js new file mode 100644 index 0000000000..10473efcf8 --- /dev/null +++ b/anrui-reportcenter-ui/postcss.config.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + 'plugins': { + // to edit target browsers: use "browserslist" field in package.json + 'autoprefixer': {} + } +} diff --git a/anrui-reportcenter-ui/public/favicon.ico b/anrui-reportcenter-ui/public/favicon.ico new file mode 100644 index 0000000000..34b63ac63a Binary files /dev/null and b/anrui-reportcenter-ui/public/favicon.ico differ diff --git a/anrui-reportcenter-ui/public/image/liuchengtu.jpg b/anrui-reportcenter-ui/public/image/liuchengtu.jpg new file mode 100644 index 0000000000..8d891be497 Binary files /dev/null and b/anrui-reportcenter-ui/public/image/liuchengtu.jpg differ diff --git a/anrui-reportcenter-ui/public/index.html b/anrui-reportcenter-ui/public/index.html new file mode 100644 index 0000000000..fa2be9164a --- /dev/null +++ b/anrui-reportcenter-ui/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= webpackConfig.name %> + + + +
+ + + diff --git a/anrui-reportcenter-ui/src/App.vue b/anrui-reportcenter-ui/src/App.vue new file mode 100644 index 0000000000..c65a59abd6 --- /dev/null +++ b/anrui-reportcenter-ui/src/App.vue @@ -0,0 +1,14 @@ + + + diff --git a/anrui-reportcenter-ui/src/api/Common/Upload.js b/anrui-reportcenter-ui/src/api/Common/Upload.js new file mode 100644 index 0000000000..6f5f0c578a --- /dev/null +++ b/anrui-reportcenter-ui/src/api/Common/Upload.js @@ -0,0 +1,4 @@ +import request from '@/utils/request' +// 上传图片 + +export const uploadFile = '/api/riskcenter/file/upload' diff --git a/anrui-reportcenter-ui/src/api/Common/areaPicker.js b/anrui-reportcenter-ui/src/api/Common/areaPicker.js new file mode 100644 index 0000000000..ed87a6bf8d --- /dev/null +++ b/anrui-reportcenter-ui/src/api/Common/areaPicker.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' + +//区域获取省 +// export function getProvince(data) { +// return request({ +// url: '/system/region/getProvince', +// method: 'get' +// }) +// } +// //根据省sid获取该省的所有市 +// export function getCity(data) { +// return request({ +// url: '/system/region/getCity', +// method: 'get', +// params: data +// }) +// } +// //根据市sid获取该市的所有县区 +// export function getCounty(data) { +// return request({ +// url: '/system/region/getCounty', +// method: 'get', +// params: data +// }) +// } +// 获取省/portal/v1/regions/getProvince +export function getProvince(data) { + return request({ + url: '/portal/v1/regions/getProvince',data, + method: 'get', + params:data, + }) +} +// 根据省sid获取该省的所有市 +export function getCity(data) { + return request({ + url: '/portal/v1/regions/getCity', + params:data, + method: 'get', + }) +} +// 根据市sid获取该市的所有县区 +export function getCounty(data) { + return request({ + url: '/portal/v1/regions/getCounty', + method: 'get', + params:data, + }) +} diff --git a/anrui-reportcenter-ui/src/api/Common/dictcommons.js b/anrui-reportcenter-ui/src/api/Common/dictcommons.js new file mode 100644 index 0000000000..d952e303a6 --- /dev/null +++ b/anrui-reportcenter-ui/src/api/Common/dictcommons.js @@ -0,0 +1,135 @@ +import request from '@/utils/request' + +export function typeValues(data) { + return request({ + url: '/portal/v1/dictcommons/typeValues', + method: 'get', + params: data + }) +} + +// 根据当前登录人orgSidPath(全路径sid)查询分公司 +export function getOrgSidByPath(data) { + return request({ + url: '/portal/v1/sysstafforg/getOrgSidByPath', + method: 'get', + params: data + }) +} + +// 根据分公司sid查询分公司名称 +export function fetchBySid(sid) { + return request({ + url: 'portal/v1/sysorganization/fetchBySid/' + sid, + method: 'get' + }) +} + +// 根据当前登录用户sid获取本分公司下的销售部门和销售专员 +export function selectOrgList(data) { + return request({ + url: '/portal/v1/sysorganization/selectOrgList', + method: 'get', + params: data + }) +} + +// 根据当前登录用户全路径sidPath获取本分公司下的资方信息 +export function selectListByOrgPath(data) { + return request({ + url: '/riskcenter/v1/loanfinbank/selectListByOrgPath', + method: 'get', + params: data + }) +} + +// 根据当前登录用户的分公司sid获取本分公司下的车型信息 +export function selModelByUseOrgSid(data) { + return request({ + url: '/base/basevehmodelconfig/selModelByUseOrgSid', + method: 'post', + params: data + }) +} + +// 根据当前登录用户的全路径sidPath、用户sid、客户类型(01个人、02企业)等获取客户信息 +export function selectCustomerList(data) { + return request({ + url: '/crm/v1/crmcustomertemp/selectCustomerList', + method: 'get', + params: data + }) +} + +// 当前用户创建申请时判断该用户是否有该菜单的操作权限 +export function selectHaveMessage(data) { + return request({ + url: '/portal/v1/sysuser/selectHaveMessage ', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + +// 根据当前登录用户的角色获取菜单分页列表页面右上角按钮的隐藏 +export function getButtonPermissions(data) { + return request({ + url: '/portal/v1/sysfunction/getButtonPermissions', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + +// 根据分公司sid获取该分公司下的所有供应商 +export function getGysByOrgSid(data) { + return request({ + url: '/base/v1/basemanufacturer/getGysByOrgSid', + method: 'post', + params: data + }) +} + +// 根据分公司sid获取该分公司下的所有供应商 +export function getGysTypeByOrgSid(data) { + return request({ + url: '/base/v1/basemanufacturer/getGysTypeByOrgSid', + method: 'post', + params: data + }) +} + +// 根据分公司全路径sid和车型sid获取合格证公告型号 +export function getAnnounceList(data) { + return request({ + url: '/base/v1/basevehmodelannouncementmodel/getAnnounceList', + method: 'get', + params: data + }) +} + +// 根据分公司全路径sid、当前登录用户sid、是否打包获取已备案(有效期内)的产品政策信息 +export function selectList(data) { + return request({ + url: '/riskcenter/v1/LoanFinPolicy/selectList', + method: 'get', + params: data + }) +} + +// 获取产品政策下的其它融信息,或分公司下备案通过的其它融 +export function selectListByOther(data) { + return request({ + url: '/riskcenter/v1/LoanFinOtherPolicy/selectList', + method: 'get', + params: data + }) +} + +// 销售订单--编辑、详情初始化 +export function fetchDetails(data) { + return request({ + url: '/buscenter/v1/bussalesorder/fetchDetailsBySid/' + data, + method: 'get' + }) +} diff --git a/anrui-reportcenter-ui/src/api/Common/permission.js b/anrui-reportcenter-ui/src/api/Common/permission.js new file mode 100644 index 0000000000..5c3b5622ca --- /dev/null +++ b/anrui-reportcenter-ui/src/api/Common/permission.js @@ -0,0 +1,13 @@ +import request from '@/utils/request' +// 请求按钮权限 +export default { + + // 查询分页列表,输入当前路径和userSid,返回 + buttonPermission: function(params) { + return request({ + url: '/demopackage/v1/demo/buttonPermission', + method: 'post', + data: params + }) + } +} diff --git a/anrui-reportcenter-ui/src/api/User/login.js b/anrui-reportcenter-ui/src/api/User/login.js new file mode 100644 index 0000000000..ef4554b83a --- /dev/null +++ b/anrui-reportcenter-ui/src/api/User/login.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' +import qs from 'qs' + +class user { + login(data) { // 登录 + return request({ + url: '/system/user/login', + method: 'post', + data + }) + } + logout(data) { // 退出 + return request({ + url: '/portal/v1/sysuser/signOut', + method: 'post', + data: qs.stringify(data) + }) + } + updatePassword(data) { // 退出修改密码 + return request({ + url: '/portal/v1/sysuser/updatePassword', + method: 'post', + data: qs.stringify(data) + }) + } + reGetPwd(data){ + return request({ + url: `/system/user/reGetPwd/${data.userName}/${data.userPhone}`, + method: 'post', + data: qs.stringify(data) + }) + } + +} + +export default new user() \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/api/system/Role/role.js b/anrui-reportcenter-ui/src/api/system/Role/role.js new file mode 100644 index 0000000000..c7fe6d1736 --- /dev/null +++ b/anrui-reportcenter-ui/src/api/system/Role/role.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' +import qs from 'qs' +let tokens = window.sessionStorage.getItem('token'); +// +export function rolemenus(data) { + return request({ + url: '/system/v1/rolemenus/'+data.roleSid, + method: 'get', + params: data + }) +} + +// 获取左侧菜单 +export function getrolemenus(data) { + return request({ + url: '/portal/v1/sysmenu/sourcemenutree', + data: data, + method: 'POST', + async: false, + headers: {'Content-Type': 'application/json'} + }) +} + +// 获取角色的主页菜单 +export function sourcesofrole(data) { + return request({ + url: '/system/v1/rolemenus/sourcesofrole', + method: 'POST', + data: data, + headers: {'Content-Type': 'application/json'} + }) +} + +// 根据token值获取登录后的用户信息 +export function loginDetails(data) { + return request({ + url: '/portal/v1/sysuser/loginDetails', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} diff --git a/anrui-reportcenter-ui/src/api/user.js b/anrui-reportcenter-ui/src/api/user.js new file mode 100644 index 0000000000..4e137c4512 --- /dev/null +++ b/anrui-reportcenter-ui/src/api/user.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' +import qs from 'qs' +//登录 +export function login(data) { + return request({ + url: '/portal/v1/sysuser/login', + method: 'post', + data: data, + headers: {'Content-Type': 'application/json'} + }) +} +// 用户注册 +export function registUser(data) { + return request({ + url: '/system/user/save', + method: 'post', + data, + headers:{'Content-Type':'application/x-www-form-urlencoded;'} + }) +} +// 获取手机验证码 +export function getVerificationCode(data) { + return request({ + url: '/system/user/getVerificationCode', + method: 'get', + params: data + }) +} + +// 获取登录验证码 +export function imgCode() { + return request({ + url: '/system/api/defaultBlendCode?temm=' + new Date().getTime(), + method: 'get' + }) +} + +// 获取用信息 +export function getInfo(token) { + return request({ + url: '/system/user/loginDetails', + method: 'post', + }) +} diff --git a/anrui-reportcenter-ui/src/assets/404_images/404.png b/anrui-reportcenter-ui/src/assets/404_images/404.png new file mode 100644 index 0000000000..3d8e2305cc Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/404_images/404.png differ diff --git a/anrui-reportcenter-ui/src/assets/404_images/404_cloud.png b/anrui-reportcenter-ui/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000000..c6281d0901 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/404_images/404_cloud.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/anrui.png b/anrui-reportcenter-ui/src/assets/home/anrui.png new file mode 100644 index 0000000000..31de90aed0 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/anrui.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon1.png b/anrui-reportcenter-ui/src/assets/home/bIcon1.png new file mode 100644 index 0000000000..f2c1381a50 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon1.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon2.png b/anrui-reportcenter-ui/src/assets/home/bIcon2.png new file mode 100644 index 0000000000..4076e7e9bf Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon2.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon3.png b/anrui-reportcenter-ui/src/assets/home/bIcon3.png new file mode 100644 index 0000000000..bbc6c51bb4 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon3.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon4.png b/anrui-reportcenter-ui/src/assets/home/bIcon4.png new file mode 100644 index 0000000000..a7ef26fec9 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon4.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon5.png b/anrui-reportcenter-ui/src/assets/home/bIcon5.png new file mode 100644 index 0000000000..6840128871 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon5.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon6.png b/anrui-reportcenter-ui/src/assets/home/bIcon6.png new file mode 100644 index 0000000000..61c88a8628 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon6.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon7.png b/anrui-reportcenter-ui/src/assets/home/bIcon7.png new file mode 100644 index 0000000000..209f1a5dff Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon7.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bIcon8.png b/anrui-reportcenter-ui/src/assets/home/bIcon8.png new file mode 100644 index 0000000000..f2c2e33164 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bIcon8.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/bottomBg.png b/anrui-reportcenter-ui/src/assets/home/bottomBg.png new file mode 100644 index 0000000000..334f6146cc Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/bottomBg.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/line.png b/anrui-reportcenter-ui/src/assets/home/line.png new file mode 100644 index 0000000000..b828cc3c60 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/line.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/ltBg.png b/anrui-reportcenter-ui/src/assets/home/ltBg.png new file mode 100644 index 0000000000..7c487f7f63 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/ltBg.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/ltIcon1.png b/anrui-reportcenter-ui/src/assets/home/ltIcon1.png new file mode 100644 index 0000000000..0c17623e86 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/ltIcon1.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/ltIcon2.png b/anrui-reportcenter-ui/src/assets/home/ltIcon2.png new file mode 100644 index 0000000000..f4f2531580 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/ltIcon2.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/ltIcon3.png b/anrui-reportcenter-ui/src/assets/home/ltIcon3.png new file mode 100644 index 0000000000..a69ef7ceef Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/ltIcon3.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/ltIcon4.png b/anrui-reportcenter-ui/src/assets/home/ltIcon4.png new file mode 100644 index 0000000000..740cfb3ebe Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/ltIcon4.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/notice.png b/anrui-reportcenter-ui/src/assets/home/notice.png new file mode 100644 index 0000000000..f964245d6b Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/notice.png differ diff --git a/anrui-reportcenter-ui/src/assets/home/rtBg.png b/anrui-reportcenter-ui/src/assets/home/rtBg.png new file mode 100644 index 0000000000..987b9cbed3 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/home/rtBg.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/arrow.png b/anrui-reportcenter-ui/src/assets/images/arrow.png new file mode 100644 index 0000000000..9e4c33b99f Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/arrow.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/bdrysh.png b/anrui-reportcenter-ui/src/assets/images/bdrysh.png new file mode 100644 index 0000000000..c0acee9aba Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/bdrysh.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/btn.png b/anrui-reportcenter-ui/src/assets/images/btn.png new file mode 100644 index 0000000000..4aaf9f01c7 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/btn.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/cdgl.png b/anrui-reportcenter-ui/src/assets/images/cdgl.png new file mode 100644 index 0000000000..d3e20f9f94 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/cdgl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/cxjl.png b/anrui-reportcenter-ui/src/assets/images/cxjl.png new file mode 100644 index 0000000000..99285003e1 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/cxjl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/czsc.png b/anrui-reportcenter-ui/src/assets/images/czsc.png new file mode 100644 index 0000000000..00a8f4f379 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/czsc.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/dwrysh.png b/anrui-reportcenter-ui/src/assets/images/dwrysh.png new file mode 100644 index 0000000000..f9804b7d53 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/dwrysh.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/dwxxgl.png b/anrui-reportcenter-ui/src/assets/images/dwxxgl.png new file mode 100644 index 0000000000..c1d9769c98 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/dwxxgl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/dy.png b/anrui-reportcenter-ui/src/assets/images/dy.png new file mode 100644 index 0000000000..de8157ed79 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/dy.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/head.png b/anrui-reportcenter-ui/src/assets/images/head.png new file mode 100644 index 0000000000..abd71010e4 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/head.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/info.png b/anrui-reportcenter-ui/src/assets/images/info.png new file mode 100644 index 0000000000..b681da30da Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/info.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/jcxx.png b/anrui-reportcenter-ui/src/assets/images/jcxx.png new file mode 100644 index 0000000000..d9c40674a2 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/jcxx.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/jggl.png b/anrui-reportcenter-ui/src/assets/images/jggl.png new file mode 100644 index 0000000000..ab4c742f96 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/jggl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/jlsc.png b/anrui-reportcenter-ui/src/assets/images/jlsc.png new file mode 100644 index 0000000000..6061b81ac0 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/jlsc.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/jsgl.png b/anrui-reportcenter-ui/src/assets/images/jsgl.png new file mode 100644 index 0000000000..2da71f4e4f Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/jsgl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/jsxd.png b/anrui-reportcenter-ui/src/assets/images/jsxd.png new file mode 100644 index 0000000000..e5b3ed049b Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/jsxd.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/OAKQ.png b/anrui-reportcenter-ui/src/assets/images/login/OAKQ.png new file mode 100644 index 0000000000..d237cfb05a Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/OAKQ.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/bg2-img.png b/anrui-reportcenter-ui/src/assets/images/login/bg2-img.png new file mode 100644 index 0000000000..b53bf40c3f Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/bg2-img.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/bgimg.jpg b/anrui-reportcenter-ui/src/assets/images/login/bgimg.jpg new file mode 100644 index 0000000000..1bd964a85a Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/bgimg.jpg differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/nose.png b/anrui-reportcenter-ui/src/assets/images/login/nose.png new file mode 100644 index 0000000000..b6c8086a96 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/nose.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/pasw.png b/anrui-reportcenter-ui/src/assets/images/login/pasw.png new file mode 100644 index 0000000000..5244bc45be Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/pasw.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/login/user.png b/anrui-reportcenter-ui/src/assets/images/login/user.png new file mode 100644 index 0000000000..e370214533 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/login/user.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/lzrysh.png b/anrui-reportcenter-ui/src/assets/images/lzrysh.png new file mode 100644 index 0000000000..03125a1180 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/lzrysh.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/headerimg.png b/anrui-reportcenter-ui/src/assets/images/org/headerimg.png new file mode 100644 index 0000000000..661f06b7e7 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/headerimg.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/jian.png b/anrui-reportcenter-ui/src/assets/images/org/jian.png new file mode 100644 index 0000000000..1e528b099f Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/jian.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/sfz.png b/anrui-reportcenter-ui/src/assets/images/org/sfz.png new file mode 100644 index 0000000000..7f79b47936 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/sfz.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/sqs.png b/anrui-reportcenter-ui/src/assets/images/org/sqs.png new file mode 100644 index 0000000000..8071e21033 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/sqs.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/success.png b/anrui-reportcenter-ui/src/assets/images/org/success.png new file mode 100644 index 0000000000..6a54c31950 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/success.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/org/yyzz.png b/anrui-reportcenter-ui/src/assets/images/org/yyzz.png new file mode 100644 index 0000000000..2a1101991a Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/org/yyzz.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/place.png b/anrui-reportcenter-ui/src/assets/images/place.png new file mode 100644 index 0000000000..5e36be9d35 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/place.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/qjsh.png b/anrui-reportcenter-ui/src/assets/images/qjsh.png new file mode 100644 index 0000000000..85c2ce8937 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/qjsh.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/ryda.png b/anrui-reportcenter-ui/src/assets/images/ryda.png new file mode 100644 index 0000000000..4cddf396a7 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/ryda.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/rzgl.png b/anrui-reportcenter-ui/src/assets/images/rzgl.png new file mode 100644 index 0000000000..068ae3bb90 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/rzgl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/select.png b/anrui-reportcenter-ui/src/assets/images/select.png new file mode 100644 index 0000000000..0a70ffa2d9 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/select.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/sjcc.png b/anrui-reportcenter-ui/src/assets/images/sjcc.png new file mode 100644 index 0000000000..6f01ae0849 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/sjcc.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/sjzd.png b/anrui-reportcenter-ui/src/assets/images/sjzd.png new file mode 100644 index 0000000000..06af6b9810 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/sjzd.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/tjfx.png b/anrui-reportcenter-ui/src/assets/images/tjfx.png new file mode 100644 index 0000000000..e097e3d130 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/tjfx.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/tjfx2.png b/anrui-reportcenter-ui/src/assets/images/tjfx2.png new file mode 100644 index 0000000000..681993c9d8 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/tjfx2.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/wenjian.png b/anrui-reportcenter-ui/src/assets/images/wenjian.png new file mode 100644 index 0000000000..163e441dba Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/wenjian.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/xgmm.png b/anrui-reportcenter-ui/src/assets/images/xgmm.png new file mode 100644 index 0000000000..46b8d5c705 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/xgmm.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/xtbg.png b/anrui-reportcenter-ui/src/assets/images/xtbg.png new file mode 100644 index 0000000000..8ac2bfc3ad Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/xtbg.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/xtgl.png b/anrui-reportcenter-ui/src/assets/images/xtgl.png new file mode 100644 index 0000000000..2eeed54e4c Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/xtgl.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/xxzx.png b/anrui-reportcenter-ui/src/assets/images/xxzx.png new file mode 100644 index 0000000000..0e3c1501d2 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/xxzx.png differ diff --git a/anrui-reportcenter-ui/src/assets/images/zwsm.png b/anrui-reportcenter-ui/src/assets/images/zwsm.png new file mode 100644 index 0000000000..948916931f Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/images/zwsm.png differ diff --git a/anrui-reportcenter-ui/src/assets/loginImg/account.png b/anrui-reportcenter-ui/src/assets/loginImg/account.png new file mode 100644 index 0000000000..0531b4a147 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/loginImg/account.png differ diff --git a/anrui-reportcenter-ui/src/assets/loginImg/bgImg.png b/anrui-reportcenter-ui/src/assets/loginImg/bgImg.png new file mode 100644 index 0000000000..94dba71d8c Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/loginImg/bgImg.png differ diff --git a/anrui-reportcenter-ui/src/assets/loginImg/logo.png b/anrui-reportcenter-ui/src/assets/loginImg/logo.png new file mode 100644 index 0000000000..a56f153dc7 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/loginImg/logo.png differ diff --git a/anrui-reportcenter-ui/src/assets/loginImg/password.png b/anrui-reportcenter-ui/src/assets/loginImg/password.png new file mode 100644 index 0000000000..9426a01194 Binary files /dev/null and b/anrui-reportcenter-ui/src/assets/loginImg/password.png differ diff --git a/anrui-reportcenter-ui/src/components/AreaPicker/index.vue b/anrui-reportcenter-ui/src/components/AreaPicker/index.vue new file mode 100644 index 0000000000..105c64750f --- /dev/null +++ b/anrui-reportcenter-ui/src/components/AreaPicker/index.vue @@ -0,0 +1,151 @@ + + + + + + diff --git a/anrui-reportcenter-ui/src/components/Breadcrumb/index.vue b/anrui-reportcenter-ui/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000000..29f9a04c9d --- /dev/null +++ b/anrui-reportcenter-ui/src/components/Breadcrumb/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/ButtonBar/index.vue b/anrui-reportcenter-ui/src/components/ButtonBar/index.vue new file mode 100644 index 0000000000..963a81e972 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/ButtonBar/index.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/E-image/index.vue b/anrui-reportcenter-ui/src/components/E-image/index.vue new file mode 100644 index 0000000000..9401ce4561 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/E-image/index.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/ErrorLog/index.vue b/anrui-reportcenter-ui/src/components/ErrorLog/index.vue new file mode 100644 index 0000000000..6119c0374f --- /dev/null +++ b/anrui-reportcenter-ui/src/components/ErrorLog/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/Hamburger/index.vue b/anrui-reportcenter-ui/src/components/Hamburger/index.vue new file mode 100644 index 0000000000..368b002154 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/Screenfull/index.vue b/anrui-reportcenter-ui/src/components/Screenfull/index.vue new file mode 100644 index 0000000000..4735604530 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/Screenfull/index.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/SizeSelect/index.vue b/anrui-reportcenter-ui/src/components/SizeSelect/index.vue new file mode 100644 index 0000000000..e88065b49f --- /dev/null +++ b/anrui-reportcenter-ui/src/components/SizeSelect/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/anrui-reportcenter-ui/src/components/SvgIcon/index.vue b/anrui-reportcenter-ui/src/components/SvgIcon/index.vue new file mode 100644 index 0000000000..b07ded2af3 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/ThemePicker/index.vue b/anrui-reportcenter-ui/src/components/ThemePicker/index.vue new file mode 100644 index 0000000000..3879c5ad02 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/ThemePicker/index.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/amap/amap.vue b/anrui-reportcenter-ui/src/components/amap/amap.vue new file mode 100644 index 0000000000..c7d643c478 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/amap/amap.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/imgCodeRole/index.vue b/anrui-reportcenter-ui/src/components/imgCodeRole/index.vue new file mode 100644 index 0000000000..852d9f324e --- /dev/null +++ b/anrui-reportcenter-ui/src/components/imgCodeRole/index.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/pagination/index.vue b/anrui-reportcenter-ui/src/components/pagination/index.vue new file mode 100644 index 0000000000..fae5a55f63 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/pagination/index.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/pagination/pageye.vue b/anrui-reportcenter-ui/src/components/pagination/pageye.vue new file mode 100644 index 0000000000..c69dca4b4d --- /dev/null +++ b/anrui-reportcenter-ui/src/components/pagination/pageye.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/passwordSafe/index.vue b/anrui-reportcenter-ui/src/components/passwordSafe/index.vue new file mode 100644 index 0000000000..847af1bcb9 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/passwordSafe/index.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/publicPage/financialscheme.vue b/anrui-reportcenter-ui/src/components/publicPage/financialscheme.vue new file mode 100644 index 0000000000..2911d3bff7 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/publicPage/financialscheme.vue @@ -0,0 +1,852 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/publicPage/financialschemeEdit.vue b/anrui-reportcenter-ui/src/components/publicPage/financialschemeEdit.vue new file mode 100644 index 0000000000..645e18d327 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/publicPage/financialschemeEdit.vue @@ -0,0 +1,484 @@ + + + + diff --git a/anrui-reportcenter-ui/src/components/publicPage/financialschemeInfo.vue b/anrui-reportcenter-ui/src/components/publicPage/financialschemeInfo.vue new file mode 100644 index 0000000000..95619dcac3 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/publicPage/financialschemeInfo.vue @@ -0,0 +1,321 @@ + + + + diff --git a/anrui-reportcenter-ui/src/components/publicPage/salesOrder.vue b/anrui-reportcenter-ui/src/components/publicPage/salesOrder.vue new file mode 100644 index 0000000000..d307b433d0 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/publicPage/salesOrder.vue @@ -0,0 +1,477 @@ + + + + diff --git a/anrui-reportcenter-ui/src/components/tab-search/index.vue b/anrui-reportcenter-ui/src/components/tab-search/index.vue new file mode 100644 index 0000000000..0ad9150257 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/tab-search/index.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/uploadFile/upload.vue b/anrui-reportcenter-ui/src/components/uploadFile/upload.vue new file mode 100644 index 0000000000..4c242e6d3b --- /dev/null +++ b/anrui-reportcenter-ui/src/components/uploadFile/upload.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/uploadFile/uploadImg.vue b/anrui-reportcenter-ui/src/components/uploadFile/uploadImg.vue new file mode 100644 index 0000000000..4a0aa2282d --- /dev/null +++ b/anrui-reportcenter-ui/src/components/uploadFile/uploadImg.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/components/viewerjs/index.vue b/anrui-reportcenter-ui/src/components/viewerjs/index.vue new file mode 100644 index 0000000000..3d6f841569 --- /dev/null +++ b/anrui-reportcenter-ui/src/components/viewerjs/index.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/icons/index.js b/anrui-reportcenter-ui/src/icons/index.js new file mode 100644 index 0000000000..2c6b309c96 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/anrui-reportcenter-ui/src/icons/svg/dashboard.svg b/anrui-reportcenter-ui/src/icons/svg/dashboard.svg new file mode 100644 index 0000000000..5317d37029 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/example.svg b/anrui-reportcenter-ui/src/icons/svg/example.svg new file mode 100644 index 0000000000..46f42b5323 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/eye-open.svg b/anrui-reportcenter-ui/src/icons/svg/eye-open.svg new file mode 100644 index 0000000000..88dcc98e6c --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/eye.svg b/anrui-reportcenter-ui/src/icons/svg/eye.svg new file mode 100644 index 0000000000..16ed2d872d --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/form.svg b/anrui-reportcenter-ui/src/icons/svg/form.svg new file mode 100644 index 0000000000..dcbaa185a8 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/link.svg b/anrui-reportcenter-ui/src/icons/svg/link.svg new file mode 100644 index 0000000000..48197ba4da --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/nested.svg b/anrui-reportcenter-ui/src/icons/svg/nested.svg new file mode 100644 index 0000000000..06713a86c6 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/password.svg b/anrui-reportcenter-ui/src/icons/svg/password.svg new file mode 100644 index 0000000000..e291d85df2 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/table.svg b/anrui-reportcenter-ui/src/icons/svg/table.svg new file mode 100644 index 0000000000..0e3dc9dea5 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/tree.svg b/anrui-reportcenter-ui/src/icons/svg/tree.svg new file mode 100644 index 0000000000..dd4b7dd22f --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svg/user.svg b/anrui-reportcenter-ui/src/icons/svg/user.svg new file mode 100644 index 0000000000..0ba0716a62 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/icons/svgo.yml b/anrui-reportcenter-ui/src/icons/svgo.yml new file mode 100644 index 0000000000..d11906aec2 --- /dev/null +++ b/anrui-reportcenter-ui/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/anrui-reportcenter-ui/src/layout/components/AppMain.vue b/anrui-reportcenter-ui/src/layout/components/AppMain.vue new file mode 100644 index 0000000000..a8f3718274 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/AppMain.vue @@ -0,0 +1,48 @@ + + + + + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Navbar.vue b/anrui-reportcenter-ui/src/layout/components/Navbar.vue new file mode 100644 index 0000000000..685479217d --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Navbar.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/FixiOSBug.js b/anrui-reportcenter-ui/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000000..bc14856f07 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/Item.vue b/anrui-reportcenter-ui/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000000..aa1f5da4de --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/Link.vue b/anrui-reportcenter-ui/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000000..530b3d5b37 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/Logo.vue b/anrui-reportcenter-ui/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000000..040fab6469 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/SidebarItem.vue b/anrui-reportcenter-ui/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000000..e955f1b933 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,117 @@ + + + + diff --git a/anrui-reportcenter-ui/src/layout/components/Sidebar/index.vue b/anrui-reportcenter-ui/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000000..5199d3e9bb --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/Sidebar/index.vue @@ -0,0 +1,123 @@ + + + diff --git a/anrui-reportcenter-ui/src/layout/components/TagsView/ScrollPane.vue b/anrui-reportcenter-ui/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000000..e8d682bd9c --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/layout/components/TagsView/index.vue b/anrui-reportcenter-ui/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000000..ff1f8da266 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/TagsView/index.vue @@ -0,0 +1,324 @@ + + + + + + + diff --git a/anrui-reportcenter-ui/src/layout/components/index.js b/anrui-reportcenter-ui/src/layout/components/index.js new file mode 100644 index 0000000000..686faf6f80 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/components/index.js @@ -0,0 +1,4 @@ +export { default as Navbar } from './Navbar' +export { default as Sidebar } from './Sidebar' +export { default as AppMain } from './AppMain' +export { default as TagsView } from './TagsView/index.vue' diff --git a/anrui-reportcenter-ui/src/layout/index.vue b/anrui-reportcenter-ui/src/layout/index.vue new file mode 100644 index 0000000000..a8f77411f0 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/layout/mixin/ResizeHandler.js b/anrui-reportcenter-ui/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000000..e8d0df8c23 --- /dev/null +++ b/anrui-reportcenter-ui/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/anrui-reportcenter-ui/src/main.js b/anrui-reportcenter-ui/src/main.js new file mode 100644 index 0000000000..35adacd3a7 --- /dev/null +++ b/anrui-reportcenter-ui/src/main.js @@ -0,0 +1,154 @@ +import 'babel-polyfill' +import Vue from 'vue' +import 'normalize.css/normalize.css' // A modern alternative to CSS resets +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import '@/styles/index.scss' // global css +import App from './App' +import store from './store' +import router from './router' + +import '@/icons' // icon +// 全局自定义组件 +import Pagination from '@/components/pagination/index.vue' +import tabsearch from '@/components/tab-search/index.vue' +import eimage from '@/components/E-image/index.vue' +import Print from '@/utils/print' // 引入附件的js文件 +import { setStorage, setDefaultOrgPathName, setDefaultOrgPath } from './utils/auth.js' +import VueAMap from 'vue-amap' +import request from '@/utils/request' + +Vue.use(ElementUI) + +// import '@/permission' //权限控制 + +Vue.prototype.$userInfo = null // 用户信息 + +Vue.component('Pagination', Pagination) + +Vue.component('tab-search', tabsearch) + +Vue.component('eimage', eimage) + +Vue.use(Print) // 注册 +Vue.use(VueAMap) +VueAMap.initAMapApiLoader({ + key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请 + plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加 + v: '1.4.4', + uiVersion: '1.0' +}) + +Vue.config.productionTip = false + +let token = null +token = GetQueryString('token') +// token = getQueryVariable('token') + +if (token) { + setStorage(token) + let href = window.location.href + // href = href.split(`token=${token}`)[0] + // window.location.href = href.slice(0, href.length - 1) +} + +function GetQueryString(name) { + var one = window.location.href.indexOf('?token=') + 7 + if (one < 7) + return null + var two = window.location.href.lastIndexOf('&') // + 1 + var data = window.location.href.substr(one) + if (two > one) { + data = window.location.href.slice(one, two) + console.log('token', data) + } + if (data) { + return data + } + return null + // var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') + // var se = window.location.search.substr(1) + // var hr = window.location.href.substr(window.location.href.indexOf("?")+1) + // var r = hr.match( reg) + // if (r != null) + // return unescape(r[2]); + // return null +} + +function getQueryVariable(variable) { + var query = window.location.search.substring(1) + // console.log('main:query'+ query) + var vars = query.split('&') + for (var i = 0; i < vars.length; i++) { + var pair = vars[i].split('=') + // console.log('main:pair-0', pair[0]) + // console.log('main:pair-1', pair[1]) + if (pair[0] == variable) { + return pair[1] + } + } + return (false) +} + +var one = window.location.href.indexOf('&organizationData') + 18 +if (parseInt(one) > 18) { + const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 + var data1 = decodeURIComponent(data) + if (data1 !== undefined) { + const obj = JSON.parse(data1) + setDefaultOrgPath(obj.defaultOrgPath) + setDefaultOrgPathName(obj.defaultOrgPathName) + } +} + +// 获取登录用户信息 +function getUserInfo() { + return request({ + url: '/portal/v1/sysuser/loginDetails', + method: 'post', + headers: { + 'Content-Type': 'application/json' + } + }).then(rep => { + const data = rep.data + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + departmentName: data.departmentName, // 部门名称 + departmentSid: data.departmentSid, // 部门sid + isAdmin: data.isAdmin, + staffSid: data.staffSid, // 业务员sid + userSid: data.sid, + orgSid: data.organizationSid, // 单位sid + Orgname: data.organizationName, + dwjb: data.dwjb, + orgNamePath: data.orgNamePath, // 使用组织全路径名称 + orgSidPath: data.orgSidPath, // 使用组织全路径Sid + pNameAndDepartmentNameAndPostName: data.pNameAndDepartmentNameAndPostName + } + //结果存入缓存 + window.sessionStorage.setItem('staffSid', user.staffSid) + window.sessionStorage.setItem('userSid', user.userSid) + window.sessionStorage.setItem('Orgname', user.Orgname) + window.sessionStorage.setItem('orgSid', user.orgSid) + window.sessionStorage.setItem('departmentName', user.departmentName) + window.sessionStorage.setItem('name', user.name) + window.sessionStorage.setItem('user', user) + window.sessionStorage.setItem('departmentName', user.departmentName) + window.sessionStorage.setItem('departmentSid', user.departmentSid) + window.sessionStorage.setItem('orgNamePath', user.orgNamePath) + window.sessionStorage.setItem('orgSidPath', user.orgSidPath) + window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) + }) +} + +getUserInfo() + +export default getUserInfo() diff --git a/anrui-reportcenter-ui/src/permission.js b/anrui-reportcenter-ui/src/permission.js new file mode 100644 index 0000000000..9f1976886a --- /dev/null +++ b/anrui-reportcenter-ui/src/permission.js @@ -0,0 +1,33 @@ +import router from './router' +import store from './store' +import NProgress from 'nprogress' // progress bar +import 'nprogress/nprogress.css' // progress bar style +import getPageTitle from '@/utils/get-page-title' +NProgress.configure({ showSpinner: false }) // NProgress Configuration +import { getStorage } from '@/utils/auth' // get token from cookie +import { getRoleRouter } from '@/router/modules/components.js' +const whiteList = ['/login', '/registUser', '/registOrg'] // no redirect whitelist +router.beforeEach(async(to, from, next) => { + NProgress.start() + document.title = getPageTitle(to.meta.title) + const hasToken = window.sessionStorage.getItem('token') + if (hasToken) { + const userInfo = store.getters.userInfo + if (userInfo) { + next() + NProgress.done() + } else { + await store.dispatch('user/getInfo') + let userRoles = await getRoleRouter(store.getters.userInfo.userSid) + router.options.routes = userRoles + router.addRoutes(userRoles) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: + } + } else { + window.location.href = process.env.VUE_APP_URL + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/anrui-reportcenter-ui/src/router/index.js b/anrui-reportcenter-ui/src/router/index.js new file mode 100644 index 0000000000..3f9cc7c48c --- /dev/null +++ b/anrui-reportcenter-ui/src/router/index.js @@ -0,0 +1,440 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' +/* 所有角色可以访问/没有权限要求的基页 */ + +export const constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [{ + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue') + }] + }, + { + path: '/', + redirect: 'index' + }, + { + path: '/index', + component: Layout, + redirect: '/index', + children: [{ + path: '/index', + component: () => + import('@/views/index.vue'), + name: 'index', + meta: { + title: '主页', + noCache: true, + affix: true + } + }] + }, + { + path: '/404', + component: () => + import('@/views/404'), + hidden: true + }, + { + path: '/capital', + component: Layout, + redirect: '/capital', + meta: { + title: '资方管理' + }, + children: [ + { + path: '/capital/capital', + component: () => import('@/views/capital/capital.vue'), + name: 'Capital', + meta: { title: '资方管理', noCache: true } + } + ] + }, + { + path: '/financialpolicymanagement', + component: Layout, + redirect: '/financialpolicymanagement', + meta: { + title: '金融产品政策管理' + }, + children: [ + { + path: '/financialpolicymanagement/financialpolicymanagement', + component: () => import('@/views/financialpolicymanagement/financialpolicymanagement.vue'), + name: 'FinancialPolicyManagement', + meta: { title: '金融产品政策管理', noCache: true } + } + ] + }, + { + path: '/financialpolicyreporting', + component: Layout, + redirect: '/financialpolicyreporting', + meta: { + title: '金融产品政策报备' + }, + children: [ + { + path: '/financialpolicyreporting/financialpolicyreporting', + component: () => import('@/views/financialpolicyreporting/financialpolicyreporting.vue'), + name: 'FinancialPolicyrReporting', + meta: { title: '金融产品政策报备', noCache: true } + } + ] + }, + { + path: '/otherfinancialpolicymanagement', + component: Layout, + redirect: '/otherfinancialpolicymanagement', + meta: { + title: '其它融产品管理' + }, + children: [ + { + path: '/otherfinancialpolicymanagement/otherfinancialpolicymanagement', + component: () => import('@/views/otherfinancialpolicymanagement/otherfinancialpolicymanagement.vue'), + name: 'OtherFinancialPolicyManagement', + meta: { title: '其它融产品管理', noCache: true } + } + ] + }, + { + path: '/otherfinancialproductsreport', + component: Layout, + redirect: '/otherfinancialproductsreport', + meta: { + title: '其它融产品报备' + }, + children: [ + { + path: '/otherfinancialproductsreport/otherfinancialproductsreport', + component: () => import('@/views/otherfinancialproductsreport/otherfinancialproductsreport.vue'), + name: 'OtherFinancialProductsReport', + meta: { title: '其它融产品报备', noCache: true } + } + ] + }, + { + path: '/customizedfinancialsolutions', + component: Layout, + redirect: '/customizedfinancialsolutions', + meta: { + title: '公司定制金融方案' + }, + children: [ + { + path: '/customizedfinancialsolutions/customizedfinancialsolutions', + component: () => import('@/views/customizedfinancialsolutions/customizedfinancialsolutions.vue'), + name: 'CustomizedFinancialSolutions', + meta: { title: '公司定制金融方案', noCache: true } + } + ] + }, + { + path: '/creditauditmanagement', + component: Layout, + redirect: '/creditauditmanagement', + meta: { + title: '贷前信用审核管理' + }, + children: [ + { + path: '/creditauditmanagement/creditauditmanagement', + component: () => import('@/views/creditauditmanagement/creditauditmanagement.vue'), + name: 'CreditAuditManagement', + meta: { title: '贷前信用审核管理', noCache: true } + } + ] + }, + { + path: '/financialclerkbycreditvetting', + component: Layout, + redirect: '/financialclerkbycreditvetting', + meta: { + title: '金融内勤信用审核管理' + }, + children: [ + { + path: '/financialclerkbycreditvetting/financialclerkbycreditvetting', + component: () => import('@/views/financialclerkbycreditvetting/financialclerkbycreditvetting.vue'), + name: 'FinancialClerkByCreditVetting', + meta: { title: '金融内勤信用审核管理', noCache: true } + } + ] + }, + { + path: '/creditauditappeal', + component: Layout, + redirect: '/creditauditappeal', + meta: { + title: '贷前信用审核申诉' + }, + children: [ + { + path: '/creditauditappeal/creditauditappeal', + component: () => import('@/views/creditauditappeal/creditauditappeal.vue'), + name: 'CreditAuditAppeal', + meta: { title: '贷前信用审核申诉', noCache: true } + } + ] + }, + { + path: '/homevisitpreparation', + component: Layout, + redirect: '/homevisitpreparation', + meta: { + title: '家访准备管理' + }, + children: [ + { + path: '/homevisitpreparation/homevisittobeprepared', + component: () => import('@/views/homevisitpreparation/homevisittobeprepared.vue'), + name: 'HomeVisitToBePrepared', + meta: { title: '家访准备管理', noCache: true } + } + ] + }, + { + path: '/riskcontrolparameter', + component: Layout, + redirect: '/riskcontrolparameter', + meta: { + title: '风控参数设置' + }, + children: [ + { + path: '/riskcontrolparameter/riskcontrolparameter', + component: () => import('@/views/riskcontrolparameter/riskcontrolparameter.vue'), + name: 'RiskControlParameter', + meta: { title: '风控参数设置', noCache: true } + } + ] + }, + { + path: '/homevisitdatareview', + component: Layout, + redirect: '/homevisitdatareview', + meta: { + title: '家访资料审核' + }, + children: [ + { + path: '/homevisitdatareview/homevisitdatatobereviewed', + component: () => import('@/views/homevisitdatareview/homevisitdatatobereviewed.vue'), + name: 'HomeVisitDataReview', + meta: { title: '家访资料审核', noCache: true } + } + ] + }, + { + path: '/managementcreditaudit', + component: Layout, + redirect: '/managementcreditaudit', + meta: { + title: '资方信审终审结果' + }, + children: [ + { + path: '/managementcreditaudit/managementcreditaudit', + component: () => import('@/views/managementcreditaudit/managementcreditaudit.vue'), + name: 'ManagementCreditAudit', + meta: { title: '资方信审终审结果', noCache: true } + } + ] + }, + { + path: '/warrantinformation', + component: Layout, + redirect: '/warrantinformation', + meta: { + title: '权证资料管理' + }, + children: [ + { + path: '/warrantinformation/warrantinformation', + component: () => import('@/views/warrantinformation/warrantinformation.vue'), + name: 'WarrantInformation', + meta: { title: '权证资料管理', noCache: true } + } + ] + }, + { + path: '/repaymentschedule', + component: Layout, + redirect: '/repaymentschedule', + meta: { + title: '还款计划表' + }, + children: [ + { + path: '/repaymentschedule/repaymentschedule', + component: () => import('@/views/repaymentschedule/repaymentschedule.vue'), + name: 'RepaymentSchedule', + meta: { title: '还款计划表', noCache: true } + } + ] + }, + { + path: '/unsecuredbusiness', + component: Layout, + redirect: '/unsecuredbusiness', + meta: { + title: '非担保信审' + }, + children: [ + { + path: '/unsecuredbusiness/unsecuredbusiness', + component: () => import('@/views/unsecuredbusiness/unsecuredbusiness.vue'), + name: 'UnsecuredBusiness', + meta: { title: '非担保信审', noCache: true } + } + ] + }, + { + path: '/loandatareview', + component: Layout, + redirect: '/loandatareview', + meta: { + title: '放款资料审核' + }, + children: [ + { + path: '/loandatareview/loandatareview', + component: () => import('@/views/loandatareview/loandatareview.vue'), + name: 'LoanDataReview', + meta: { title: '放款资料审核', noCache: true } + } + ] + }, + + // 流程审批 + // 金融产品政策报备--编辑 + { + path: '/jinrongzhengceFlow/financialpolicyreportingEdit', + component: () => + import('@/views/workFlow/jinrongzhengceFlow/financialpolicyreportingEdit.vue'), + name: 'FinancialPolicyReportingEdit' + }, + // 金融产品政策报备--待办 + { + path: '/jinrongzhengceFlow/financialpolicyreportingDaiBanInfo', + component: () => + import('@/views/workFlow/jinrongzhengceFlow/financialpolicyreportingDaiBanInfo.vue'), + name: 'FinancialPolicyReportingBaiBanInfo' + }, + // 金融产品政策报备--待办--总经理跳转风控中心 + { + path: '/jinrongzhengceFlow/financialpolicyreportingByDivisionOperateInfo', + component: () => + import('@/views/workFlow/jinrongzhengceFlow/financialpolicyreportingByDivisionOperateInfo.vue'), + name: 'FinancialPolicyReportingByDivisionOperateInfo' + }, + // 金融产品政策报备--已办 + { + path: '/jinrongzhengceFlow/financialpolicyreportingYiBanInfo', + component: () => + import('@/views/workFlow/jinrongzhengceFlow/financialpolicyreportingYiBanInfo.vue'), + name: 'FinancialPolicyReportingYiBanInfo' + }, + + // 流程审批 + // 其它融产品报备--编辑 + { + path: '/qitarongchanpinFlow/otherfinancialproductsreportEdit', + component: () => + import('@/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportEdit.vue'), + name: 'OtherFinancialProductsReportEdit' + }, + // 其它融产品报备--待办 + { + path: '/qitarongchanpinFlow/otherfinancialproductsreportDaiBan', + component: () => + import('@/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportDaiBan.vue'), + name: 'OtherFinancialProductsReportDaiBan' + }, + // 其它融产品报备--待办--总经理跳转风控中心 + { + path: '/qitarongchanpinFlow/otherfinancialproductsreportByDivisionOperate', + component: () => + import('@/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportByDivisionOperate.vue'), + name: 'OtherFinancialProductsReportByDivisionOperate' + }, + // 其它融产品报备--已办 + { + path: '/qitarongchanpinFlow/otherfinancialproductsreportYiBan', + component: () => + import('@/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportYiBan.vue'), + name: 'OtherFinancialProductsReportYiBan' + }, + // 信用申诉--编辑 + { + path: '/xinyongshensuFlow/creditauditappealEdit', + component: () => + import('@/views/workFlow/xinyongshensuFlow/creditauditappealEdit.vue'), + name: 'CreditAuditAppealEdit' + }, + // 信用申诉--待办 + { + path: '/xinyongshensuFlow/creditauditappealDaiBan', + component: () => + import('@/views/workFlow/xinyongshensuFlow/creditauditappealDaiBan.vue'), + name: 'CreditAuditAppealDaiBan' + }, + // 信用申诉--已办 + { + path: '/xinyongshensuFlow/creditauditappealYiBan', + component: () => + import('@/views/workFlow/xinyongshensuFlow/creditauditappealYiBan.vue'), + name: 'CreditAuditAppealYiBan' + }, + + + // 公司定制金融方案--编辑 + { + path: '/dingzhijinrongFlow/customizedfinancialsolutionsEdit', + component: () => + import('@/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsEdit.vue'), + name: 'CustomizedFinancialSolutionsEdit' + }, + // 公司定制金融方案--待办 + { + path: '/dingzhijinrongFlow/customizedfinancialsolutionsDaiBan', + component: () => + import('@/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsDaiBan.vue'), + name: 'CustomizedFinancialSolutionsDaiBan' + }, + // 公司定制金融方案--已办 + { + path: '/dingzhijinrongFlow/customizedfinancialsolutionsYiban', + component: () => + import('@/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsYiban.vue'), + name: 'CustomizedFinancialSolutionsYiBan' + } + // 404 page must be placed at the end !!! + // { path: '*', redirect: '/404', hidden: true } +] + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/anrui-reportcenter-ui/src/router/modules/components.js b/anrui-reportcenter-ui/src/router/modules/components.js new file mode 100644 index 0000000000..b0ee40be70 --- /dev/null +++ b/anrui-reportcenter-ui/src/router/modules/components.js @@ -0,0 +1,34 @@ +const Layout = () => import('@/layout') +/* 权限路由 */ +/* 获取权限路由列表 */ +import { getrolemenus } from '@/api/system/Role/role.js' +import { getSession } from '@/utils/auth.js' + +export async function getRoleRouter(userSid) { + const rolemenus = await getrolemenus({ userSid: userSid }) + const userRoles = resRouter(rolemenus.data) + userRoles.push({ path: '*', redirect: '/404', hidden: true }) + return userRoles +} + +function resRouter(menus) { // 递归,将后台传来数组 + for (var i = 0; i < menus.length; i++) { + if (menus[i].children && menus[i].children.length != 0) { + resRouter(menus[i].children) + } + if (menus[i].children.length == 0) { + delete menus[i].children + delete menus[i].redirect + } + if (menus[i].component != '') { + menus[i].component = eval(menus[i].path.substr(1)) + menus[i] = { + path: menus[i].path, + component: Layout, + redirect: menus[i].path, + children: [menus[i]] + } + } + } + return menus +} diff --git a/anrui-reportcenter-ui/src/settings.js b/anrui-reportcenter-ui/src/settings.js new file mode 100644 index 0000000000..647f65bb57 --- /dev/null +++ b/anrui-reportcenter-ui/src/settings.js @@ -0,0 +1,16 @@ +module.exports = { + + title: '安瑞集团信息化平台', + + /** + * @type {boolean} true | false + * @description Whether fix the header + */ + fixedHeader: false, + + /** + * @type {boolean} true | false + * @description Whether show the logo in sidebar + */ + sidebarLogo: false +} diff --git a/anrui-reportcenter-ui/src/store/getters.js b/anrui-reportcenter-ui/src/store/getters.js new file mode 100644 index 0000000000..33a426a94e --- /dev/null +++ b/anrui-reportcenter-ui/src/store/getters.js @@ -0,0 +1,17 @@ +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + userInfo: state => state.user.userInfo, + menus: state => state.user.menus, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permission_routes: state => state.permission.routes, + errorLogs: state => state.errorLog.logs +} +export default getters diff --git a/anrui-reportcenter-ui/src/store/index.js b/anrui-reportcenter-ui/src/store/index.js new file mode 100644 index 0000000000..d0cb3aa71b --- /dev/null +++ b/anrui-reportcenter-ui/src/store/index.js @@ -0,0 +1,39 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import getters from './getters' + +Vue.use(Vuex) + +// https://webpack.js.org/guides/dependency-management/#requirecontext +const modulesFiles = require.context('./modules', true, /\.js$/) + +// you do not need `import app from './modules/app'` +// it will auto require all vuex module from modules file +const modules = modulesFiles.keys().reduce((modules, modulePath) => { + // set './app.js' => 'app' + const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') + const value = modulesFiles(modulePath) + modules[moduleName] = value.default + return modules +}, {}) + +const store = new Vuex.Store({ + state: { + counter: 0, + distributionSid: '', + modelName:'' + }, + mutations: { + + }, + actions: { + + }, + getters: { + + }, + modules, + getters +}) + +export default store diff --git a/anrui-reportcenter-ui/src/store/modules/app.js b/anrui-reportcenter-ui/src/store/modules/app.js new file mode 100644 index 0000000000..45d89bb964 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/app.js @@ -0,0 +1,56 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false + }, + device: 'desktop', + size: Cookies.get('size') || 'medium' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + }, + SET_SIZE: (state, size) => { + state.size = size + Cookies.set('size', size) + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + }, + setSize({ commit }, size) { + commit('SET_SIZE', size) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-reportcenter-ui/src/store/modules/errorLog.js b/anrui-reportcenter-ui/src/store/modules/errorLog.js new file mode 100644 index 0000000000..6b01f95754 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/errorLog.js @@ -0,0 +1,28 @@ +const state = { + logs: [] +} + +const mutations = { + ADD_ERROR_LOG: (state, log) => { + state.logs.push(log) + }, + CLEAR_ERROR_LOG: (state) => { + state.logs.splice(0) + } +} + +const actions = { + addErrorLog({ commit }, log) { + commit('ADD_ERROR_LOG', log) + }, + clearErrorLog({ commit }) { + commit('CLEAR_ERROR_LOG') + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-reportcenter-ui/src/store/modules/permission.js b/anrui-reportcenter-ui/src/store/modules/permission.js new file mode 100644 index 0000000000..aeb5ee5397 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/permission.js @@ -0,0 +1,69 @@ +import { asyncRoutes, constantRoutes } from '@/router' + +/** + * Use meta.role to determine if the current user has permission + * @param roles + * @param route + */ +function hasPermission(roles, route) { + if (route.meta && route.meta.roles) { + return roles.some(role => route.meta.roles.includes(role)) + } else { + return true + } +} + +/** + * Filter asynchronous routing tables by recursion + * @param routes asyncRoutes + * @param roles + */ +export function filterAsyncRoutes(routes, roles) { + const res = [] + + routes.forEach(route => { + const tmp = { ...route } + if (hasPermission(roles, tmp)) { + if (tmp.children) { + tmp.children = filterAsyncRoutes(tmp.children, roles) + } + res.push(tmp) + } + }) + + return res +} + +const state = { + routes: [], + addRoutes: [] +} + +const mutations = { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + } +} + +const actions = { + generateRoutes({ commit }, roles) { + return new Promise(resolve => { + let accessedRoutes + if (roles.includes('admin')) { + accessedRoutes = asyncRoutes || [] + } else { + accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) + } + commit('SET_ROUTES', accessedRoutes) + resolve(accessedRoutes) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-reportcenter-ui/src/store/modules/settings.js b/anrui-reportcenter-ui/src/store/modules/settings.js new file mode 100644 index 0000000000..110533f738 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/settings.js @@ -0,0 +1,35 @@ +import variables from '@/styles/element-variables.scss' +import defaultSettings from '@/settings' + +const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings + +const state = { + theme: variables.theme, + showSettings: showSettings, + tagsView: tagsView, + fixedHeader: fixedHeader, + sidebarLogo: sidebarLogo +} + +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + // eslint-disable-next-line no-prototype-builtins + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/anrui-reportcenter-ui/src/store/modules/tagsView.js b/anrui-reportcenter-ui/src/store/modules/tagsView.js new file mode 100644 index 0000000000..57e72421e6 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/tagsView.js @@ -0,0 +1,160 @@ +const state = { + visitedViews: [], + cachedViews: [] +} + +const mutations = { + ADD_VISITED_VIEW: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_CACHED_VIEW: (state, view) => { + if (state.cachedViews.includes(view.name)) return + if (!view.meta.noCache) { + state.cachedViews.push(view.name) + } + }, + + DEL_VISITED_VIEW: (state, view) => { + for (const [i, v] of state.visitedViews.entries()) { + if (v.path === view.path) { + state.visitedViews.splice(i, 1) + break + } + } + }, + DEL_CACHED_VIEW: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + index > -1 && state.cachedViews.splice(index, 1) + }, + + DEL_OTHERS_VISITED_VIEWS: (state, view) => { + state.visitedViews = state.visitedViews.filter(v => { + return v.meta.affix || v.path === view.path + }) + }, + DEL_OTHERS_CACHED_VIEWS: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + if (index > -1) { + state.cachedViews = state.cachedViews.slice(index, index + 1) + } else { + // if index = -1, there is no cached tags + state.cachedViews = [] + } + }, + + DEL_ALL_VISITED_VIEWS: state => { + // keep affix tags + const affixTags = state.visitedViews.filter(tag => tag.meta.affix) + state.visitedViews = affixTags + }, + DEL_ALL_CACHED_VIEWS: state => { + state.cachedViews = [] + }, + + UPDATE_VISITED_VIEW: (state, view) => { + for (let v of state.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + } +} + +const actions = { + addView({ dispatch }, view) { + dispatch('addVisitedView', view) + dispatch('addCachedView', view) + }, + addVisitedView({ commit }, view) { + commit('ADD_VISITED_VIEW', view) + }, + addCachedView({ commit }, view) { + commit('ADD_CACHED_VIEW', view) + }, + + delView({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delVisitedView', view) + dispatch('delCachedView', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delVisitedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_VISITED_VIEW', view) + resolve([...state.visitedViews]) + }) + }, + delCachedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_CACHED_VIEW', view) + resolve([...state.cachedViews]) + }) + }, + + delOthersViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delOthersVisitedViews', view) + dispatch('delOthersCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delOthersVisitedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_VISITED_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delOthersCachedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_CACHED_VIEWS', view) + resolve([...state.cachedViews]) + }) + }, + + delAllViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delAllVisitedViews', view) + dispatch('delAllCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delAllVisitedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_VISITED_VIEWS') + resolve([...state.visitedViews]) + }) + }, + delAllCachedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_CACHED_VIEWS') + resolve([...state.cachedViews]) + }) + }, + + updateVisitedView({ commit }, view) { + commit('UPDATE_VISITED_VIEW', view) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-reportcenter-ui/src/store/modules/user.js b/anrui-reportcenter-ui/src/store/modules/user.js new file mode 100644 index 0000000000..fa4dae6c85 --- /dev/null +++ b/anrui-reportcenter-ui/src/store/modules/user.js @@ -0,0 +1,122 @@ +import { login, logout, getInfo } from '@/api/user' +import { getStorage, setStorage, removeStorage } from '@/utils/auth' + +import router, { resetRouter } from '@/router' + +const state = { + token: getStorage(), + userInfo: '', + menus: '', +} + +const mutations = { + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_UESRINFO: (state, userInfo) => { + state.userInfo = userInfo + }, + SET_MENUS: (state, menus) => { + state.menus = menus + } +} + +const actions = { + // user login + login({ commit }, userInfo) { + return new Promise((resolve, reject) => { + login(userInfo).then(response => { + const { data } = response + commit('SET_TOKEN', data.token) + setStorage(data.token) + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + departmentName: data.departmentName, + isAdmin: data.isAdmin, + staffSid: data.staffSid, + userSid: data.sid, + orgSid: data.organizationSid, + Orgname: data.organizationName, + dwjb: data.dwjb, + pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName + } + commit('SET_UESRINFO', user) + window.sessionStorage.setItem('userSid', user.userSid); + window.sessionStorage.setItem('Orgname', user.Orgname); + window.sessionStorage.setItem('departmentName', user.departmentName); + window.sessionStorage.setItem('name', user.name); + window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + + // get user info + getInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(response => { + const { data } = response + if (!data) { + removeStorage() + reject('Verification failed, please Login again.') + } + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + orgRoleName: data.orgRoleName, + isAdmin: data.isAdmin, + staffSid: data.staffSid, + userSid: data.sid, + orgSid: data.organizationSid, + Orgname: data.organizationName, + dwjb: data.dwjb + } + commit('SET_UESRINFO', user) + resolve(data) + }).catch(error => { + removeStorage() + router.push({path: '/'}) + // reject(error) + }) + }) + }, + + getMenus({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(response => { + const { data } = response + commit('SET_UESRINFO', user) + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + + // user logout + logout({ commit, state, dispatch }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_UESRINFO', '') + removeStorage() + resetRouter() + resolve() + }).catch(error => { + reject(error) + }) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-reportcenter-ui/src/styles/e-table.scss b/anrui-reportcenter-ui/src/styles/e-table.scss new file mode 100644 index 0000000000..95b9f9c03d --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/e-table.scss @@ -0,0 +1,30 @@ +.e-table { + width: 100%; + padding: 0 30px; + tr:first-child th{ + background-color: #c1f4cd; + } + tr { + td { + border: 1px solid #e6e9f0; + border-right: 0px; + border-bottom: 0px; + padding: 10px 20px; + } + td:last-child { + border-right: 1px solid #e6e9f0; + } + } + tr:last-child { + td { + border-bottom: 1px solid #e6e9f0; + } + } + + td:nth-child(2n-1) { + text-align: right; + } + td:nth-child(2n) { + text-align: left; + } + } diff --git a/anrui-reportcenter-ui/src/styles/element-table.scss b/anrui-reportcenter-ui/src/styles/element-table.scss new file mode 100644 index 0000000000..727938ca3b --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/element-table.scss @@ -0,0 +1,19 @@ +.el-table { + .el-table__header{ + tr th{ + background: #edf1f7; + color: #333333; + } + } +} + +.table-describe{ + border: 1px solid #dfe4ed; + border-bottom: 0px solid #dfe4ed; + h4{ + float: left; + margin: 0; + line-height: 34px; + padding:0 15px; + } +} diff --git a/anrui-reportcenter-ui/src/styles/element-tabs.scss b/anrui-reportcenter-ui/src/styles/element-tabs.scss new file mode 100644 index 0000000000..26321fb16c --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/element-tabs.scss @@ -0,0 +1,25 @@ +.el-tabs--card{ + .el-tabs__header{ + .el-tabs__nav-scroll{ + padding-left: 3px; + padding-bottom: 10px; + border-bottom: 1px solid #018ad2; + .el-tabs__nav { + border: none; + } + .el-tabs__item { + border: 1px solid #dfe4ed; + margin-right: 12px; + margin-left: 2px; + } + .el-tabs__item:first-child { + border-left: 1px solid #dfe4ed; + } + .el-tabs__item.is-active{ + border-bottom-color: #018ad2; + background-color: #018ad2; + color: #fff; + } + } + } +} diff --git a/anrui-reportcenter-ui/src/styles/element-ui.scss b/anrui-reportcenter-ui/src/styles/element-ui.scss new file mode 100644 index 0000000000..50c4dc361c --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/element-ui.scss @@ -0,0 +1,62 @@ +.el-image .el-image__inner--center{ + top: 0; + left: 0; + transform: none; +} + +.tablerow-click{ + color: #007FFF; + cursor: pointer; +} +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} + + + diff --git a/anrui-reportcenter-ui/src/styles/element-variables.scss b/anrui-reportcenter-ui/src/styles/element-variables.scss new file mode 100644 index 0000000000..ecd0728841 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/element-variables.scss @@ -0,0 +1,35 @@ +/** +* I think element-ui's default theme color is too light for long-term use. +* So I modified the default color and you can modify it to your liking. +**/ + +/* theme color */ +// $--color-primary: #018ad2; +// $--color-success: #13ce66; +// $--color-warning: #ffba00; +// $--color-danger: #ff4949; +// $--color-info: #1E1E1E; +$--color-primary: #018ad2; +$--color-success: #2cab69; +$--color-warning: #ffba00; +$--color-danger: #e84026; +$--color-info: #cccccc; +$--button-font-weight: 400; + +// $--color-text-regular: #1f2d3d; + +$--border-color-light: #dfe4ed; +$--border-color-lighter: #e6ebf5; + +$--table-border: 1px solid #dfe6ec; + +/* icon font path, required */ +$--font-path: "~element-ui/lib/theme-chalk/fonts"; + +@import "~element-ui/packages/theme-chalk/src/index"; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + theme: $--color-primary; +} diff --git a/anrui-reportcenter-ui/src/styles/index.scss b/anrui-reportcenter-ui/src/styles/index.scss new file mode 100644 index 0000000000..fb94599d69 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/index.scss @@ -0,0 +1,444 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './table.scss'; +@import './e-table.scss'; +@import './element-table.scss'; +@import './element-tabs.scss'; +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} +.bg-primary{ + background-color: $color-primary !important; +} +// main-container global css +.container{ + min-height: 100%; + height: 100%; + background-color: #FFFFFF; + box-sizing: border-box; + padding: 10px 0; +} + +.fl{ + float: left; +} +.fr{ + float: right; +} +.text-center{ + text-align: center; +} +.color-red{ + color: red !important; +} + +.pd-b10{ + padding-bottom: 10px; +} + +.pd-y40 { + padding: 40px 0; +} + +.pd-y20 { + padding: 20px 0; +} + +.fs20 { + font-size: 20px; +} + +// 页面上的button按钮 +.app-container { + .el-button--medium { + padding: 10px 14px; + font-size: 16px; + } + + .el-button--small { + padding: 8px 12px; + font-size: 14px; + } + + .el-button--mini { + padding: 7px 10px; + font-size: 12px; + } +} +// 添加样式 +.app-container { + margin: 5px 0 5px 0; + background-color: #fff; +} +// 设置了滚动区域 +.main-content{ overflow-x: hidden;overflow-y: auto;height: calc(100vh - 200px);padding: 0 20px;} +.listcon{height: calc(100vh - 425px);overflow-y: auto;overflow-x: hidden;} +.listconadd{height: calc(100vh - 200px);overflow-y: auto;overflow-x: hidden;} +.listconadd{ + .titwu { + font-size: 28px; + text-align: center; + padding: 30px 0 20px 0; + } +} +.listconsub { + height: calc(100vh - 310px); + overflow-y: auto; + overflow-x: hidden; +} + +.listconsubjxs { + height: calc(100vh - 300px); + overflow-y: auto; + overflow-x: hidden; +} + +// 搜索的 +.webtop { + // position: fixed;top: 110px;width: calc(100% - 240px);z-index: 6000; + background-color: #fff; + display: flex !important; + flex-direction: row; + justify-content: space-between !important; + align-items: center; + margin-bottom: 0px !important; + font-size: 20px; +} + +// 设置了页面头部的内边距和背景色 +.tab-header { + font-size: 20px; + font-weight: bold; +} +// 设置了搜索条件里的样式 +.search { + .tab-header { + .el-form-item { + margin-right: 16px; + .el-form-item__label { + font-size: 16px; + font-weight: 500; + } + } + } +} +.filter-item { + padding: 0 10px; + width: 220px; + display: inline-block; +} + +// 设置列表页面内容布局 +.listtop { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0 0 0 15px; + margin-top: 0; + border: 1px solid #dfe4ed; + height: 42px; + line-height: 42px; +} + +.listtop .tit { + font-weight: bold; + font-size: 16px +} + +.listtop .pagination { + margin: 0; + padding: 0; +} + +.pages { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-end; + padding: 0 0 15px 15px; +} +.pages .tit{font-weight: bold;} +.pages .pagination{margin: 0;} +// .formadd{padding: 20px ;} +// .listeltable{overflow-y: auto;height: calc(100vh - 420px);} + +.formadd { + padding: 10px 40px 0 40px; + font-size: 16px; + // height: calc(100vh - 200px);overflow-y: auto; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: $header-bg; + text-align: left; + color: #ffffff; + } + .first_row{ + border-top: 1px solid $table-border-color; + } + .el-row { + display: flex; + flex-wrap: wrap; + border-left: 1px solid $table-border-color; + .el-col { + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + padding: 0 15px; + min-height: 42px; + line-height: 1; + + .el-form-item { + margin-bottom: 0; + line-height: 42px; + // .addinputw{width: 400px;} + .addinputw { + width: 80%; + line-height: 42px; + } + .el-input__inner { + height: 36px; + } + } + } + } + .footer{margin: 20px;} +} + + +.formaddcopy02 { + padding: 10px 40px 0 40px; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: #0294d7; + color: #ffffff; + text-align: left; + } + + .el-row { + display: flex; + flex-wrap: wrap; + border-left: 1px solid $table-border-color; + + .el-col { + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + min-height: 42px; + padding: 0 15px; + line-height: 42px; + position: relative; + .span-sty { + position: absolute; + top: 0; + bottom: 0; + left: 0; + line-height: 42px; + text-align: right; + font-size: 14px; + color: #606266; + font-weight: 600; + width: 70px; + padding-right: 5px; + border-right: 1px solid #e0e3eb; + } + + .el-form-item { + margin-bottom: 0; + line-height: 42px; + .addinputw { + //padding: 5px 0; + width: 65%; + margin-left: 80px; + line-height: 42px; + } + + .addinputInfo { + margin-left: 80px; + line-height: 42px; + } + + .el-input__inner { + height: 36px; + } + } + } + + } + + .footer { + margin: 20px; + } +} + +.forminfo { + padding: 10px 40px 0 40px; + font-size: 16px; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: $header-bg; + text-align: left; + color: #ffffff; + } + .el-row { + display:flex; + flex-wrap: wrap; + border-left: 1px solid $table-border-color; + .trightb{ text-align: right;font-weight: bold;color: #606266; } + .tleft{ text-align: left; } + .el-col{ + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + padding: 0 15px 0 15px !important; + min-height: 50px; + line-height: 50px; + font-size: 14px; + } + + } + .footer{margin: 20px;} +} + +.el-form-item__error { + z-index: 100; +} +.bluezi{color: $header-bg; cursor: pointer} +// 经销商添加样式 +.titcon{ + display: flex; + flex-direction: row; + justify-content: space-around; + background-color: #0294d7; + flex: 3; +} + +.titcon .title { + padding: 10px; + font-weight: bold; + font-size: 20px; + text-align: center; + color: #ffffff; +} + +.titcon .baocun { + text-align: right; + flex: 2; + padding: 5px 20px; +} + +.addinputwda { + width: 600px; +} + +//.searchcon{margin: 0px 0 10px 0;} +//.searchcon .searchbtn{margin: 10px 0;border: #2cab69 1px solid;color: #2cab69;} +// 隐藏显示按钮 +.main-content { + .searchcon { + .searchbtn { + margin: 5px 0; + border: #2cab69 1px solid; + color: #2cab69; + } + } +} + + +.search .btn { + padding: 5px 0; + border: 1px solid #e0e3eb; + text-align: center; + margin-bottom: 5px; +} + + +// 弹出窗口按钮 +.btnCancel{ + background: #e84026 !important;outline: none;border: none;color: #fff !important; +} +.btnCancel:hover{ + background: #ed6651 !important; +} +.btnFalses{ + background: #2cab69 !important;outline: none;border: none; +} +.btnFalses:hover{ + background: #3dc47e !important; +} +.btntopblueline{background-color: #066bc9 !important;} +.btntopblueline:hover{background-color: #34a1db !important;} +.btntophui{background-color: #cccccc !important;} +.btntophui:hover{background-color: #d6d6d6 !important;} +.bordertopline{ border-top: 1px solid $table-border-color;} +.lookimg img{width: 250px;margin: 10px;} +.listimg{width: 80px;} +.tleftb { + text-align: right; + font-size: 14px; + color: #606266; + line-height: 40px !important; + font-weight: 600; +} + +.icon { + color: #e84026; + margin-right: 4px; +} diff --git a/anrui-reportcenter-ui/src/styles/mixin.scss b/anrui-reportcenter-ui/src/styles/mixin.scss new file mode 100644 index 0000000000..36b74bbd99 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/mixin.scss @@ -0,0 +1,28 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} diff --git a/anrui-reportcenter-ui/src/styles/sidebar.scss b/anrui-reportcenter-ui/src/styles/sidebar.scss new file mode 100644 index 0000000000..ef66650a63 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/sidebar.scss @@ -0,0 +1,261 @@ +#app { + background-color: #f7f9fc; + + .main-container { + height: 100vh; + transition: margin-left .28s; + padding-left: $sideBarWidth; + padding-top: 60px; + position: relative; + overflow: hidden; + } + .TagsView{ + height: 50px; + } + .home-box{ + position: fixed; + top: 60px; + left: 0; + background-color: $menuBg; + border: 1px solid $menuHover; + line-height: 40px; + width: 210px; + z-index: 1000; + a{ + display: inline-block; + line-height: 40px; + box-sizing: border-box; + width: 50%; + text-align: center; + font-size: 16px; + font-weight: 500; + color: #FFFFFF; + } + a:last-child{ + border:0; + background-color: $menuHover; + } + } + .sidebar-container { + transition: width 0.28s; + width: $sideBarWidth !important; + background-color: $menuBg; + height: calc(100% - 60px) ; + position: absolute; + font-size: 0px; + top: 60px; + bottom: 0; + left: 0; + z-index: 8; + overflow: hidden; + padding-top: 40px; + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: $menuHover !important; + } + } + .el-submenu__title i{ + color: #FFFFFF; + } + .is-active>.el-submenu__title { + color: $subMenuActiveText !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $sideBarWidth !important; + background-color: $subMenuBg !important; + + &:hover { + background-color: $subMenuHover !important; + } + } + & .el-menu-item.is-active { + background-color: $subMenuHover !important; + } + } + + // .hideSidebar { + // .sidebar-container { + // width: 54px !important; + // } + + // .main-container { + // margin-left: 54px; + // } + + // .submenu-title-noDropdown { + // padding: 0 !important; + // position: relative; + + // .el-tooltip { + // padding: 0 !important; + + // .svg-icon { + // margin-left: 20px; + // } + + // .sub-el-icon { + // margin-left: 19px; + // } + // } + // } + + // .el-submenu { + // overflow: hidden; + + // &>.el-submenu__title { + // padding: 0 !important; + + // .svg-icon { + // margin-left: 20px; + // } + + // .sub-el-icon { + // margin-left: 19px; + // } + + // .el-submenu__icon-arrow { + // display: none; + // } + // } + // } + + // .el-menu--collapse { + // .el-submenu { + // &>.el-submenu__title { + // &>span { + // height: 0; + // width: 0; + // overflow: hidden; + // visibility: hidden; + // display: inline-block; + // } + // } + // } + // } + // } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $sideBarWidth !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $sideBarWidth !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$sideBarWidth, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: $menuHover !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} diff --git a/anrui-reportcenter-ui/src/styles/table.scss b/anrui-reportcenter-ui/src/styles/table.scss new file mode 100644 index 0000000000..08e9142ddc --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/table.scss @@ -0,0 +1,48 @@ +.container{ + /* 头 */ + .el-table thead{ + color: $text-color; + } + .el-table .cell{ + a{ + display: block; + color: $table-a-color; + } + .el-button--text{ + color: $table-a-color; + } + } + .el-table td, .el-table th{ + padding: 8px 0; + } + .el-table.is-group th{ + background-color: $table-bg-color; + } + .el-table--enable-row-hover .el-table__body tr:hover>td { + background-color: $table-bg-color !important; + } + .el-table--border td, .el-table--border th, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed { + border-right: 1px solid $table-border-color; + } + .el-table td, .el-table th.is-leaf{ + border-bottom: 1px solid $table-border-color; + } + .table-fixed { + .el-table__fixed-right { + height: 100% !important; //设置高优先,以覆盖内联样式 + } + } +} + +.children-box { + padding: 10px; + .table-header { + padding: 0 20px 5px 20px; + border-bottom: 2px solid $border-color; + .el-page-header { + line-height: 40px; + font-weight: 500; + + } + } +} diff --git a/anrui-reportcenter-ui/src/styles/transition.scss b/anrui-reportcenter-ui/src/styles/transition.scss new file mode 100644 index 0000000000..4cb27cc811 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/transition.scss @@ -0,0 +1,48 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/anrui-reportcenter-ui/src/styles/variables.scss b/anrui-reportcenter-ui/src/styles/variables.scss new file mode 100644 index 0000000000..9ff78c5273 --- /dev/null +++ b/anrui-reportcenter-ui/src/styles/variables.scss @@ -0,0 +1,52 @@ +// 行为色 +$color-primary: #018ad2; +$color-success: #4cd964; +$color-warning: #f0ad4e; +$color-error: #dd524d; +// header +$header-bg:#0294d7; +// sidebar +$menuText: rgba($color: #FFFFFF, $alpha: 0.9); +$menuActiveText:#ffffff; +$subMenuActiveText:#ffffff; //https://github.com/ElemeFE/element/issues/12951 + +$menuBg:#0294d7; +$menuHover:#087dba; + +$subMenuBg:#0294d7; +$subMenuHover:#087dba; + +$sideBarWidth: 210px; + +/* 表格的相关样式 */ +$search-bg:#edf1f7; // 表格搜索景色 +$table-bg-color:#edf1f7; // 表格背景 +$table-border-color:#e0e3eb; // 表格边框色 +// 文字 +$table-a-color:#018ad2; +/* 表格的相关样式 */ + +/* 边框颜色 */ +$border-color:#018ad2; +/* 文字基本颜色 */ +$text-color:#333;//基本色 +$text-color-inverse:#fff;//反色 +$text-color-grey:#999;//辅助灰色,如加载更多的提示信息 +$text-color-placeholder: #808080; +$text-color-disable:#c0c0c0; +$text-red: #d00000; + +$a-color:#018ad2; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuText: $menuText; + menuActiveText: $menuActiveText; + subMenuActiveText: $subMenuActiveText; + menuBg: $menuBg; + menuHover: $menuHover; + subMenuBg: $subMenuBg; + subMenuHover: $subMenuHover; + sideBarWidth: $sideBarWidth; +} diff --git a/anrui-reportcenter-ui/src/utils/auth.js b/anrui-reportcenter-ui/src/utils/auth.js new file mode 100644 index 0000000000..5c6d8f6629 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/auth.js @@ -0,0 +1,37 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'token' +const sessionKey = 'token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token, { expires: 7, path: '/' }) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} + +export function getStorage() { + return sessionStorage.getItem('token') + // return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI0MjdhMmZiMC02MGM1LTQwOWYtYmVhNC00ZWI0NDEwNDFhZTYiLCJpc3MiOiJXQksiLCJleHAiOjE2MzcxOTk1Mjl9.VkUkYAaHBjEaElFMPlUHAhUYO5zYf1aUQpX_3-w43UQ' +} + +export function setStorage(session) { + return sessionStorage.setItem('token', session) +} + +export function setDefaultOrgPathName(data) { + return sessionStorage.setItem('defaultOrgPathName', data) +} + +export function setDefaultOrgPath(data) { + return sessionStorage.setItem('defaultOrgPath', data) +} + +export function removeStorage() { + return sessionStorage.removeItem('token') +} diff --git a/anrui-reportcenter-ui/src/utils/axios.js b/anrui-reportcenter-ui/src/utils/axios.js new file mode 100644 index 0000000000..56ca72360e --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/axios.js @@ -0,0 +1,248 @@ +import axios from 'axios' +import router from '@/router' +import { Message } from 'element-ui' +import { removeToken, getToken } from '@/utils/auth' +// 统一请求路径前缀 +const base = process.env.VUE_APP_BASE_API +// 超时设定 +axios.defaults.timeout = 120000 + +axios.interceptors.request.use( + config => { + // console.log('请求拦截器数据', config) + return config + }, + err => { + Message.error('请求超时') + return Promise.resolve(err) + } +) + +// http response 拦截器 +axios.interceptors.response.use( + response => { + const data = response.data + // console.log('响应拦截器数据', response) + // console.log('data.code:' + data.code) + // 根据返回的code值来做不同的处理(和后端约定) + switch (data.code) { + case 401: + // Message.error('登录失效,请重新登录!') + console.log('登录失效,请重新登录!') + // 未登录 + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + // if (router.history.current.name !== 'login') { + // console.log(router.history.current.name) + // if (data.msg !== null) { + // Message.error(data.msg) + // } else { + // Message.error('未知错误,请重新登录') + // } + // } + break + case 403: + // 没有权限 + if (data.msg !== null) { + Message.error(data.msg) + } else { + Message.error('未知错误') + } + break + case 500: + // 错误 + if (data.msg !== null) { + Message.error(data.msg) + } else { + Message.error('未知错误') + } + break + case 99: + if (data.msg !== null) { + if (data.msg == '登录状态已过期') { + // 未登录 + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + } else { + // Message.error(data.msg) + return data + } + } else { + Message.error('未知错误') + } + break + default: + return data + } + return Promise.reject(new Error(response.msg || 'Error')) + }, + error => { + // 返回状态码不为200时候的错误处理 + Message.error(error.toString()) + if (error.request.responseURL.indexOf('/sys/security/needLogin')) { + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + } + // return err + return Promise.reject(error) + } +) + +export const getRequest = (url, params) => { + const accessToken = getToken() + console.log(`-------------------${base}${url}`) + return axios({ + method: 'get', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const postRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + transformRequest: [ + function(data) { + let ret = '' + for (const it in data) { + ret += + encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + } + ], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + accessToken: accessToken + } + }) +} + +export const post = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + 'Content-Type': 'application/json;charset=utf-8', + // 'Content-Type': 'multipart/form-data', + accessToken: accessToken + } + }) +} + +// export const postExport = (url, params) => { +// const accessToken = getToken() +// return axios({ +// method: 'post', +// url: `${base}${url}`, +// data: params, +// headers: { +// 'Content-Type': 'application/json;charset=utf-8', +// // 'Content-Type': 'multipart/form-data', +// accessToken: accessToken +// }, +// responseType: 'blob' // 表明返回服务器返回的数据类型 +// }) +// } + +export const putRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'put', + url: `${base}${url}`, + data: params, + transformRequest: [ + function(data) { + let ret = '' + for (const it in data) { + ret += + encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + } + ], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + accessToken: accessToken + } + }) +} + +export const deleteRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'delete', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const importRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + accessToken: accessToken + } + }) +} + +export const uploadFileRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const getDownLoadUrl = (url) => { + const accessToken = getToken() + return base + url + '?token=' + accessToken +} + +export const uploadFileRequestJianCai = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + 'Content-Type': 'multipart/form-data', + contentType: false, + processData: false, + accessToken: accessToken + } + }) +} + +export const postBodyRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + accessToken: accessToken + } + }) +} diff --git a/anrui-reportcenter-ui/src/utils/baocun.js b/anrui-reportcenter-ui/src/utils/baocun.js new file mode 100644 index 0000000000..b80fb74fd2 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/baocun.js @@ -0,0 +1,52 @@ +const TokenKey = 'AdminWuJingToken' +const userInfo = 'wj_user' +// 保存基础信息 +export function getuser() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setuser(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} + +// 保存修改基础信息 +export function getXiu() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setXiu(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 保存查看基础信息 +export function getLook() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setLook(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 信息 +export function getChe() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setChe(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 经销商保存 +export function getJing() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setJing(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 车型名称保存 +export function getCHeap() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setCHeap(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 车型sid保存 +export function getMIng() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setMIng(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} diff --git a/anrui-reportcenter-ui/src/utils/get-page-title.js b/anrui-reportcenter-ui/src/utils/get-page-title.js new file mode 100644 index 0000000000..a6de99dde3 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/get-page-title.js @@ -0,0 +1,10 @@ +import defaultSettings from '@/settings' + +const title = defaultSettings.title || 'Vue Admin Template' + +export default function getPageTitle(pageTitle) { + if (pageTitle) { + return `${pageTitle} - ${title}` + } + return `${title}` +} diff --git a/anrui-reportcenter-ui/src/utils/index.js b/anrui-reportcenter-ui/src/utils/index.js new file mode 100644 index 0000000000..4830c04890 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/index.js @@ -0,0 +1,117 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string | null} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} diff --git a/anrui-reportcenter-ui/src/utils/print.js b/anrui-reportcenter-ui/src/utils/print.js new file mode 100644 index 0000000000..799a333764 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/print.js @@ -0,0 +1,123 @@ +// 打印类属性、方法定义 +/* eslint-disable */ +const Print =function(dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); + + this.options = this.extend({ + 'noPrint': '.no-print' + }, options); + + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.dom = dom; + } + + this.init(); +}; +Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, + + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; + + return str; + }, + + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); + + for (var k in inputs) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } + } + + for (var k2 in textareas) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } + + for (var k3 in selects) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } + } + + return this.dom.outerHTML; + }, + + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + this.toPrint(w); + + setTimeout(function () { + document.body.removeChild(iframe) + }, 100) + }, + + toPrint: function (frameWindow) { + try { + setTimeout(function () { + frameWindow.focus(); + try { + if (!frameWindow.document.execCommand('print', false, null)) { + frameWindow.print(); + } + } catch (e) { + frameWindow.print(); + } + frameWindow.close(); + }, 10); + } catch (err) { + console.log('err', err); + } + } +}; +const MyPlugin = {} +MyPlugin.install = function (Vue, options) { + // 4. 添加实例方法 + Vue.prototype.$print = Print +} +export default MyPlugin \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/utils/request.js b/anrui-reportcenter-ui/src/utils/request.js new file mode 100644 index 0000000000..c9d3f4eec7 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/request.js @@ -0,0 +1,69 @@ +import axios from 'axios' +import { MessageBox, Message } from 'element-ui' +import store from '@/store' +import { getToken, getStorage } from '@/utils/auth' + +// create an axios instance +console.log(process.env.VUE_APP_URL) +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + // timeout: 5000 // request timeout + headers:{'Content-Type':'application/x-www-form-urlencoded;'} +}) + +// request interceptor +service.interceptors.request.use( + config => { + config.params = { + ...config.params, + _t: Date.parse(new Date()) / 1000 + } + if (getStorage()) { + + config.headers['token'] = getStorage() + } + return config + }, + error => { + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + + response => { + const res = response.data + + if(res.type !=undefined){ + return res + } + // if the custom code is not 20000, it is judged as an error. + if (res.code != 200) { + if (res.msg == "请重新登录") { + // window.location.href = 'http://39.104.100.138:8082/' + } else { + Message({ + message: res.msg || 'Error', + type: 'error', + duration: 5 * 1000 + }) + } + return Promise.reject(new Error(res.message || 'Error')) + } else { + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.message, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/anrui-reportcenter-ui/src/utils/roles.js b/anrui-reportcenter-ui/src/utils/roles.js new file mode 100644 index 0000000000..07a6557422 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/roles.js @@ -0,0 +1,98 @@ +/** + * 表单校验规则 + * 不符合规则时,返回错误文案 + * 符合规则时,返回false + */ + +var rules = {} + +// 是否必填 +rules.required = function (value) { + return (!!value || value === 0) ? false : "请输入内容" +}; + +// 最大字符长度 +rules.maxLength = function (value, size) { + var size = size || 256; + return String(value).length <= size ? false : ("最大不超过" + size + "个字符") +} + +// 只允许字母和数字 +rules.onlyAlphabetic = function (value) { + var reg = /^[0-9a-zA-Z]+$/; + return reg.test(value) ? false : "只能输入字母和数字" +} + +// 只允许字母数字和下划线 +rules.onlyAlphabeticUnderline = function (value) { + var reg = /^[0-9a-zA-Z_]+$/; + return reg.test(value) ? false : "只能输入字母、数字或下划线" +} + +// 只允许数字 +rules.onlyNumber = function (value) { + var reg = /^[0-9]+$/; + return reg.test(value) ? false : "只能输入数字" +} + +// 只允许字母 +rules.onlyLetter = function (value) { + var reg = /^[a-zA-Z]+$/; + return reg.test(value) ? false : "只能输入字母" +} + +// 特殊字符 +rules.noSpecial = function (value) { + var regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im, + regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im; + return regEn.test(value) || regCn.test(value) ? false : "不能输入特殊字符" +} + +// 邮箱 +rules.email = function (value) { + var reg = /^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/; + return reg.test(value) ? false : "邮箱格式错误" +} + +// 手机号(以1开头的11位数字) +rules.phone = function (value) { + var reg = /^[1][3,4,5,7,8][0-9]{9}$/; + return reg.test(value) ? false : "手机格式错误" +} + +// 只允许汉字 +rules.chinese = function (value) { + var reg = /^[\u4e00-\u9fa5]+$/; + return reg.test(value) ? false : "只能输入汉字" +} + +// 密码格式校验 +rules.password = function (value) { + if (String(value).length < 6) { + return "密码长度不小于6位" + } + if (String(value).length > 18) { + return "密码长度不超过18位" + } + var level = 0; + if (value.search(/[a-z]/) > -1) { + level++; //密码中包含小写字母 + } + if (value.search(/[A-Z]/) > -1) { + level++; //密码中包含大写字母 + } + if (value.search(/[0-9]/) > -1) { + level++; //密码中包含数组 + } + if (value.search(/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im) > -1) { + level++; //密码中包含特殊符号 + } + if(level<2){ + return "密码至少包含大写字母、小写字母、数字、标点符号中的两种" + }else{ + return level; // 当前密码强度为level(2/3/4) + } +} + + +export default rules; \ No newline at end of file diff --git a/anrui-reportcenter-ui/src/utils/validate.js b/anrui-reportcenter-ui/src/utils/validate.js new file mode 100644 index 0000000000..8d962ad4a2 --- /dev/null +++ b/anrui-reportcenter-ui/src/utils/validate.js @@ -0,0 +1,20 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} diff --git a/anrui-reportcenter-ui/src/views/404.vue b/anrui-reportcenter-ui/src/views/404.vue new file mode 100644 index 0000000000..1791f55a34 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/404.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/index.vue b/anrui-reportcenter-ui/src/views/index.vue new file mode 100644 index 0000000000..289c8a9fbf --- /dev/null +++ b/anrui-reportcenter-ui/src/views/index.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/redirect/index.vue b/anrui-reportcenter-ui/src/views/redirect/index.vue new file mode 100644 index 0000000000..db4c1d66d1 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/redirect/index.vue @@ -0,0 +1,12 @@ + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsDaiBan.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsDaiBan.vue new file mode 100644 index 0000000000..86288c5573 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsDaiBan.vue @@ -0,0 +1,552 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsEdit.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsEdit.vue new file mode 100644 index 0000000000..2986adab9e --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsEdit.vue @@ -0,0 +1,582 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsYiban.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsYiban.vue new file mode 100644 index 0000000000..301fe59cce --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/customizedfinancialsolutionsYiban.vue @@ -0,0 +1,426 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/guacheselect.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/guacheselect.vue new file mode 100644 index 0000000000..ad22d945e2 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/guacheselect.vue @@ -0,0 +1,202 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/modelSelect.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/modelSelect.vue new file mode 100644 index 0000000000..362195a688 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/modelSelect.vue @@ -0,0 +1,213 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/shangzhuangselect.vue b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/shangzhuangselect.vue new file mode 100644 index 0000000000..b2f8f7fe40 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/dingzhijinrongFlow/relation/shangzhuangselect.vue @@ -0,0 +1,262 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingByDivisionOperateInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingByDivisionOperateInfo.vue new file mode 100644 index 0000000000..470b14b72f --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingByDivisionOperateInfo.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingDaiBanInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingDaiBanInfo.vue new file mode 100644 index 0000000000..059496f86f --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingDaiBanInfo.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingEdit.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingEdit.vue new file mode 100644 index 0000000000..f2e4857ed9 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingEdit.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingYiBanInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingYiBanInfo.vue new file mode 100644 index 0000000000..170235c71b --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/financialpolicyreportingYiBanInfo.vue @@ -0,0 +1,257 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/jinrongzhengceInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/jinrongzhengceInfo.vue new file mode 100644 index 0000000000..e775f4ef90 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/jinrongzhengceInfo.vue @@ -0,0 +1,282 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/otherInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/otherInfo.vue new file mode 100644 index 0000000000..b8dc7f20e7 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/jinrongzhengceFlow/relation/otherInfo.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialscheme.vue b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialscheme.vue new file mode 100644 index 0000000000..06977b02eb --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialscheme.vue @@ -0,0 +1,854 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeEdit.vue b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeEdit.vue new file mode 100644 index 0000000000..55c605af6a --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeEdit.vue @@ -0,0 +1,486 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeInfo.vue b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeInfo.vue new file mode 100644 index 0000000000..06c6d6add2 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/publicPage/financialschemeInfo.vue @@ -0,0 +1,323 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/publicPage/salesOrder.vue b/anrui-reportcenter-ui/src/views/workFlow/publicPage/salesOrder.vue new file mode 100644 index 0000000000..de4a7980e5 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/publicPage/salesOrder.vue @@ -0,0 +1,482 @@ + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportByDivisionOperate.vue b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportByDivisionOperate.vue new file mode 100644 index 0000000000..3814a9ef13 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportByDivisionOperate.vue @@ -0,0 +1,339 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportDaiBan.vue b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportDaiBan.vue new file mode 100644 index 0000000000..07506ef79e --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportDaiBan.vue @@ -0,0 +1,339 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportEdit.vue b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportEdit.vue new file mode 100644 index 0000000000..75be1e4e8d --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportEdit.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportYiBan.vue b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportYiBan.vue new file mode 100644 index 0000000000..e31e1ff419 --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/qitarongchanpinFlow/otherfinancialproductsreportYiBan.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealDaiBan.vue b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealDaiBan.vue new file mode 100644 index 0000000000..a0bd4e899c --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealDaiBan.vue @@ -0,0 +1,553 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealEdit.vue b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealEdit.vue new file mode 100644 index 0000000000..df85a4d8df --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealEdit.vue @@ -0,0 +1,464 @@ + + + + + diff --git a/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealYiBan.vue b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealYiBan.vue new file mode 100644 index 0000000000..8437bbf5cf --- /dev/null +++ b/anrui-reportcenter-ui/src/views/workFlow/xinyongshensuFlow/creditauditappealYiBan.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/anrui-reportcenter-ui/tests/unit/.eslintrc.js b/anrui-reportcenter-ui/tests/unit/.eslintrc.js new file mode 100644 index 0000000000..958d51ba27 --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + jest: true + } +} diff --git a/anrui-reportcenter-ui/tests/unit/components/Breadcrumb.spec.js b/anrui-reportcenter-ui/tests/unit/components/Breadcrumb.spec.js new file mode 100644 index 0000000000..1d94c8fc71 --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/components/Breadcrumb.spec.js @@ -0,0 +1,98 @@ +import { mount, createLocalVue } from '@vue/test-utils' +import VueRouter from 'vue-router' +import ElementUI from 'element-ui' +import Breadcrumb from '@/components/Breadcrumb/index.vue' + +const localVue = createLocalVue() +localVue.use(VueRouter) +localVue.use(ElementUI) + +const routes = [ + { + path: '/', + name: 'home', + children: [{ + path: 'dashboard', + name: 'dashboard' + }] + }, + { + path: '/menu', + name: 'menu', + children: [{ + path: 'menu1', + name: 'menu1', + meta: { title: 'menu1' }, + children: [{ + path: 'menu1-1', + name: 'menu1-1', + meta: { title: 'menu1-1' } + }, + { + path: 'menu1-2', + name: 'menu1-2', + redirect: 'noredirect', + meta: { title: 'menu1-2' }, + children: [{ + path: 'menu1-2-1', + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } + }, + { + path: 'menu1-2-2', + name: 'menu1-2-2' + }] + }] + }] + }] + +const router = new VueRouter({ + routes +}) + +describe('Breadcrumb.vue', () => { + const wrapper = mount(Breadcrumb, { + localVue, + router + }) + it('dashboard', () => { + router.push('/dashboard') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(1) + }) + it('normal route', () => { + router.push('/menu/menu1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(2) + }) + it('nested route', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(4) + }) + it('no meta.title', () => { + router.push('/menu/menu1/menu1-2/menu1-2-2') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(3) + }) + // it('click link', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-2') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const second = breadcrumbArray.at(1) + // console.log(breadcrumbArray) + // const href = second.find('a').attributes().href + // expect(href).toBe('#/menu/menu1') + // }) + // it('noRedirect', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-1') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const redirectBreadcrumb = breadcrumbArray.at(2) + // expect(redirectBreadcrumb.contains('a')).toBe(false) + // }) + it('last breadcrumb', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + const redirectBreadcrumb = breadcrumbArray.at(3) + expect(redirectBreadcrumb.contains('a')).toBe(false) + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/components/Hamburger.spec.js b/anrui-reportcenter-ui/tests/unit/components/Hamburger.spec.js new file mode 100644 index 0000000000..01ea303a5e --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/components/Hamburger.spec.js @@ -0,0 +1,18 @@ +import { shallowMount } from '@vue/test-utils' +import Hamburger from '@/components/Hamburger/index.vue' +describe('Hamburger.vue', () => { + it('toggle click', () => { + const wrapper = shallowMount(Hamburger) + const mockFn = jest.fn() + wrapper.vm.$on('toggleClick', mockFn) + wrapper.find('.hamburger').trigger('click') + expect(mockFn).toBeCalled() + }) + it('prop isActive', () => { + const wrapper = shallowMount(Hamburger) + wrapper.setProps({ isActive: true }) + expect(wrapper.contains('.is-active')).toBe(true) + wrapper.setProps({ isActive: false }) + expect(wrapper.contains('.is-active')).toBe(false) + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/components/SvgIcon.spec.js b/anrui-reportcenter-ui/tests/unit/components/SvgIcon.spec.js new file mode 100644 index 0000000000..31467a9f6f --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/components/SvgIcon.spec.js @@ -0,0 +1,22 @@ +import { shallowMount } from '@vue/test-utils' +import SvgIcon from '@/components/SvgIcon/index.vue' +describe('SvgIcon.vue', () => { + it('iconClass', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.find('use').attributes().href).toBe('#icon-test') + }) + it('className', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.classes().length).toBe(1) + wrapper.setProps({ className: 'test' }) + expect(wrapper.classes().includes('test')).toBe(true) + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/utils/formatTime.spec.js b/anrui-reportcenter-ui/tests/unit/utils/formatTime.spec.js new file mode 100644 index 0000000000..24e165b42d --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/utils/formatTime.spec.js @@ -0,0 +1,30 @@ +import { formatTime } from '@/utils/index.js' + +describe('Utils:formatTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + const retrofit = 5 * 1000 + + it('ten digits timestamp', () => { + expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分') + }) + it('test now', () => { + expect(formatTime(+new Date() - 1)).toBe('刚刚') + }) + it('less two minute', () => { + expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前') + }) + it('less two hour', () => { + expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前') + }) + it('less one day', () => { + expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前') + }) + it('more than one day', () => { + expect(formatTime(d)).toBe('7月13日17时54分') + }) + it('format', () => { + expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/utils/param2Obj.spec.js b/anrui-reportcenter-ui/tests/unit/utils/param2Obj.spec.js new file mode 100644 index 0000000000..e106ed88b5 --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/utils/param2Obj.spec.js @@ -0,0 +1,14 @@ +import { param2Obj } from '@/utils/index.js' +describe('Utils:param2Obj', () => { + const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95' + + it('param2Obj test', () => { + expect(param2Obj(url)).toEqual({ + name: 'bill', + age: '29', + sex: '1', + field: window.btoa('test'), + key: '测试' + }) + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/utils/parseTime.spec.js b/anrui-reportcenter-ui/tests/unit/utils/parseTime.spec.js new file mode 100644 index 0000000000..56045af4a8 --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/utils/parseTime.spec.js @@ -0,0 +1,35 @@ +import { parseTime } from '@/utils/index.js' + +describe('Utils:parseTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + it('timestamp', () => { + expect(parseTime(d)).toBe('2018-07-13 17:54:01') + }) + it('timestamp string', () => { + expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01') + }) + it('ten digits timestamp', () => { + expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01') + }) + it('new Date', () => { + expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01') + }) + it('format', () => { + expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) + it('get the day of the week', () => { + expect(parseTime(d, '{a}')).toBe('五') // 星期五 + }) + it('get the day of the week', () => { + expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日 + }) + it('empty argument', () => { + expect(parseTime()).toBeNull() + }) + + it('null', () => { + expect(parseTime(null)).toBeNull() + }) +}) diff --git a/anrui-reportcenter-ui/tests/unit/utils/validate.spec.js b/anrui-reportcenter-ui/tests/unit/utils/validate.spec.js new file mode 100644 index 0000000000..f774905b00 --- /dev/null +++ b/anrui-reportcenter-ui/tests/unit/utils/validate.spec.js @@ -0,0 +1,17 @@ +import { validUsername, isExternal } from '@/utils/validate.js' + +describe('Utils:validate', () => { + it('validUsername', () => { + expect(validUsername('admin')).toBe(true) + expect(validUsername('editor')).toBe(true) + expect(validUsername('xxxx')).toBe(false) + }) + it('isExternal', () => { + expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false) + expect(isExternal('/dashboard')).toBe(false) + expect(isExternal('./dashboard')).toBe(false) + expect(isExternal('dashboard')).toBe(false) + }) +}) diff --git a/anrui-reportcenter-ui/vue.config.js b/anrui-reportcenter-ui/vue.config.js new file mode 100644 index 0000000000..9cb6faeadf --- /dev/null +++ b/anrui-reportcenter-ui/vue.config.js @@ -0,0 +1,142 @@ +'use strict' +const path = require('path') +const defaultSettings = require('./src/settings.js') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const name = defaultSettings.title || '安瑞集团信息化平台' // page title + +// 如果端口设置为80, +// 使用管理员权限执行命令行。 +// 例如,Mac:sudo npm run +// 可以通过以下方法更改端口: +// port=9528 npm run dev或npm run dev--port=9528 +const port = process.env.port || process.env.npm_config_port || 9531 // dev port + +// 所有配置项说明都可以在中找到https://cli.vuejs.org/config/ +module.exports = { + /** + *如果计划在子路径下部署站点,则需要设置publicPath, + *例如GitHub页面。如果您计划将站点部署到https://foo.github.io/bar/, + *然后publicPath应设置为“/bar/”。 + *在大多数情况下,请使用“/”!!! + *详细信息:https://cli.vuejs.org/config/#publicpath + */ + publicPath: process.env.NODE_ENV === 'production' ? '/riskcenter/' : '/', + outputDir: 'System', + assetsDir: 'static', + lintOnSave: process.env.NODE_ENV === 'development', + productionSourceMap: false, + devServer: { + hot: true, // 自动保存 + host: '0.0.0.0', + port: port, + open: true, + overlay: { + warnings: false, + errors: true + }, + proxy: { + '/api': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://127.0.0.1:8111/', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/api': '' + } + }, + '/upload': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://4424790b0u.qicp.vip/', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/upload': '' + } + } + }, + disableHostCheck: true + }, + configureWebpack: { + // 在webpack的name字段中提供应用程序的标题,以便 + // 它可以在索引.html插入正确的标题。 + name: name, + resolve: { + alias: { + '@': resolve('src'), + '@C': resolve('src/components') + } + } + }, + chainWebpack(config) { + // 它可以提高第一屏的速度,建议打开预加载 + config.plugin('preload').tap(() => [{ + rel: 'preload', + // 忽略 runtime.js + // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 + fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], + include: 'initial' + }]) + + // 当有很多页面时,会导致太多无意义的请求 + config.plugins.delete('prefetch') + + // set svg-sprite-loader 设置 svg精灵加载程序 + config.module + .rule('svg') + .exclude.add(resolve('src/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk + config.optimization.runtimeChunk('single') + } + ) + } +}