From d235f9c329e1dafff63a7de9a9a668f31b3a973e Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Thu, 19 Aug 2021 14:53:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E7=AE=A1=E7=90=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/controller/ReportController.java | 27 +-- .../controller/ReportShareController.java | 155 ++++++++---------- report-ui/src/api/reportShare.js | 2 +- .../views/report/report/components/share.vue | 7 +- report-ui/src/views/report/report/index.vue | 29 +++- 5 files changed, 121 insertions(+), 99 deletions(-) diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java index ed667273..93745458 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/report/controller/ReportController.java @@ -9,12 +9,12 @@ import com.anjiplus.template.gaea.business.modules.report.controller.dto.ReportD import com.anjiplus.template.gaea.business.modules.report.controller.param.ReportParam; import com.anjiplus.template.gaea.business.modules.report.dao.entity.Report; import com.anjiplus.template.gaea.business.modules.report.service.ReportService; +import com.anjiplus.template.gaea.business.modules.reportshare.controller.dto.ReportShareDto; +import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; /** * TODO @@ -28,6 +28,9 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("/report") public class ReportController extends GaeaBaseController { + @Autowired + private ReportShareService reportShareService; + @Autowired private ReportService reportService; @@ -47,15 +50,17 @@ public class ReportController extends GaeaBaseController { - - @Autowired - private ReportShareService reportShareService; - - @Override - public GaeaBaseService getService() { - return reportShareService; - } - - @Override - public ReportShare getEntity() { - return new ReportShare(); - } - - @Override - public ReportShareDto getDTO() { - return new ReportShareDto(); - } - - - @GetMapping({"/{id}"}) - @AccessKey - @Override - @Permission(code = "detail", name = "明细") - public ResponseBean detail(@PathVariable("id") Long id) { - this.logger.info("{}根据ID查询服务开始,id为:{}", this.getClass().getSimpleName(), id); - ReportShare result = reportShareService.getDetail(id); - ReportShareDto dto = this.getDTO(); - GaeaBeanUtils.copyAndFormatter(result, dto); - ResponseBean responseBean = this.responseSuccessWithData(this.resultDtoHandle(dto)); - this.logger.info("{}根据ID查询结束,结果:{}", this.getClass().getSimpleName(), GaeaUtils.toJSONString(responseBean)); - return responseBean; - } - - @GetMapping({"/detailByCode"}) - @Permission(code = "detail", name = "明细") - public ResponseBean detailByCode(@RequestParam("shareCode") String shareCode) { - return ResponseBean.builder().data(reportShareService.detailByCode(shareCode)).build(); - } - - @PostMapping - @Permission( - code = "insert", - name = "新增" - ) - @GaeaAuditLog( - pageTitle = "新增" - ) - @Override - public ResponseBean insert(@Validated @RequestBody ReportShareDto dto) { - return ResponseBean.builder().data(reportShareService.insertShare(dto)).build(); - } - -} +// +//package com.anjiplus.template.gaea.business.modules.reportshare.controller; +// +//import com.anji.plus.gaea.annotation.AccessKey; +//import com.anji.plus.gaea.annotation.Permission; +//import com.anji.plus.gaea.annotation.log.GaeaAuditLog; +//import com.anji.plus.gaea.bean.ResponseBean; +//import com.anji.plus.gaea.curd.controller.GaeaBaseController; +//import com.anji.plus.gaea.curd.service.GaeaBaseService; +//import com.anji.plus.gaea.utils.GaeaBeanUtils; +//import com.anji.plus.gaea.utils.GaeaUtils; +//import com.anjiplus.template.gaea.business.modules.reportshare.controller.dto.ReportShareDto; +//import com.anjiplus.template.gaea.business.modules.reportshare.controller.param.ReportShareParam; +//import com.anjiplus.template.gaea.business.modules.reportshare.dao.entity.ReportShare; +//import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService; +//import io.swagger.annotations.Api; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.validation.annotation.Validated; +//import org.springframework.web.bind.annotation.*; +// +///** +// * @author Raod +// * @desc 报表分享 controller +// * @date 2021-08-18 13:37:26.663 +// **/ +//@RestController +//@Api(tags = "报表分享管理") +//@RequestMapping("/reportShare") +//@Permission(code = "reportShareManage", name = "报表分享管理") +//public class ReportShareController extends GaeaBaseController { +// +// @Autowired +// private ReportShareService reportShareService; +// +// @Override +// public GaeaBaseService getService() { +// return reportShareService; +// } +// +// @Override +// public ReportShare getEntity() { +// return new ReportShare(); +// } +// +// @Override +// public ReportShareDto getDTO() { +// return new ReportShareDto(); +// } +// +// +// @GetMapping({"/{id}"}) +// @AccessKey +// @Override +// @Permission(code = "detail", name = "明细") +// public ResponseBean detail(@PathVariable("id") Long id) { +// this.logger.info("{}根据ID查询服务开始,id为:{}", this.getClass().getSimpleName(), id); +// ReportShare result = reportShareService.getDetail(id); +// ReportShareDto dto = this.getDTO(); +// GaeaBeanUtils.copyAndFormatter(result, dto); +// ResponseBean responseBean = this.responseSuccessWithData(this.resultDtoHandle(dto)); +// this.logger.info("{}根据ID查询结束,结果:{}", this.getClass().getSimpleName(), GaeaUtils.toJSONString(responseBean)); +// return responseBean; +// } +// +// @GetMapping({"/detailByCode"}) +// @Permission(code = "detail", name = "明细") +// public ResponseBean detailByCode(@RequestParam("shareCode") String shareCode) { +// return ResponseBean.builder().data(reportShareService.detailByCode(shareCode)).build(); +// } +// +//} diff --git a/report-ui/src/api/reportShare.js b/report-ui/src/api/reportShare.js index 578b4215..68cb9d65 100644 --- a/report-ui/src/api/reportShare.js +++ b/report-ui/src/api/reportShare.js @@ -10,7 +10,7 @@ export function reportShareList(params) { export function reportShareAdd(data) { return request({ - url: 'reportShare', + url: 'report/share', method: 'post', data }) diff --git a/report-ui/src/views/report/report/components/share.vue b/report-ui/src/views/report/report/components/share.vue index 92c060ab..f6b52448 100644 --- a/report-ui/src/views/report/report/components/share.vue +++ b/report-ui/src/views/report/report/components/share.vue @@ -1,5 +1,5 @@ + + @@ -30,13 +45,19 @@ import { reportUpdate, reportDetail } from "@/api/reportmanage"; +import Share from "@/views/report/report/components/share"; export default { name: "Report", components: { - anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default + anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default, + Share }, data() { return { + // 分享 + visibleForShareDialog: false, + reportCodeForShareDialog: "", + reportNameForShareDialog: "", crudOption: { // 使用菜单做为页面标题 title: "报表管理", @@ -233,6 +254,12 @@ export default { } }); window.open(routeUrl.href, "_blank"); + }, + //分享 + shareReport(val){ + this.reportCodeForShareDialog = val.reportCode; + this.reportNameForShareDialog = val.reportName; + this.visibleForShareDialog = true; } } };