报表管理添加分享按钮

Raod 3 years ago
parent 4eb6ab77d1
commit d235f9c329

@ -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.controller.param.ReportParam;
import com.anjiplus.template.gaea.business.modules.report.dao.entity.Report; 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.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 io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* TODO * TODO
@ -28,6 +28,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/report") @RequestMapping("/report")
public class ReportController extends GaeaBaseController<ReportParam, Report, ReportDto> { public class ReportController extends GaeaBaseController<ReportParam, Report, ReportDto> {
@Autowired
private ReportShareService reportShareService;
@Autowired @Autowired
private ReportService reportService; private ReportService reportService;
@ -47,15 +50,17 @@ public class ReportController extends GaeaBaseController<ReportParam, Report, Re
} }
@DeleteMapping("/delReport") @DeleteMapping("/delReport")
@Permission( @Permission(code = "delete", name = "删除")
code = "delete", @GaeaAuditLog(pageTitle = "删除")
name = "删除"
)
@GaeaAuditLog(
pageTitle = "删除"
)
public ResponseBean delReport(@RequestBody ReportDto reportDto) { public ResponseBean delReport(@RequestBody ReportDto reportDto) {
reportService.delReport(reportDto); reportService.delReport(reportDto);
return ResponseBean.builder().build(); return ResponseBean.builder().build();
} }
@PostMapping("/share")
@Permission(code = "share", name = "分享")
@GaeaAuditLog(pageTitle = "分享")
public ResponseBean share(@Validated @RequestBody ReportShareDto dto) {
return ResponseBean.builder().data(reportShareService.insertShare(dto)).build();
}
} }

@ -1,84 +1,71 @@
//
package com.anjiplus.template.gaea.business.modules.reportshare.controller; //package com.anjiplus.template.gaea.business.modules.reportshare.controller;
//
import com.anji.plus.gaea.annotation.AccessKey; //import com.anji.plus.gaea.annotation.AccessKey;
import com.anji.plus.gaea.annotation.Permission; //import com.anji.plus.gaea.annotation.Permission;
import com.anji.plus.gaea.annotation.log.GaeaAuditLog; //import com.anji.plus.gaea.annotation.log.GaeaAuditLog;
import com.anji.plus.gaea.bean.ResponseBean; //import com.anji.plus.gaea.bean.ResponseBean;
import com.anji.plus.gaea.curd.controller.GaeaBaseController; //import com.anji.plus.gaea.curd.controller.GaeaBaseController;
import com.anji.plus.gaea.curd.service.GaeaBaseService; //import com.anji.plus.gaea.curd.service.GaeaBaseService;
import com.anji.plus.gaea.utils.GaeaBeanUtils; //import com.anji.plus.gaea.utils.GaeaBeanUtils;
import com.anji.plus.gaea.utils.GaeaUtils; //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.dto.ReportShareDto;
import com.anjiplus.template.gaea.business.modules.reportshare.controller.param.ReportShareParam; //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.dao.entity.ReportShare;
import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService; //import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService;
import io.swagger.annotations.Api; //import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; //import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; //import org.springframework.web.bind.annotation.*;
//
/** ///**
* @author Raod // * @author Raod
* @desc controller // * @desc 报表分享 controller
* @date 2021-08-18 13:37:26.663 // * @date 2021-08-18 13:37:26.663
**/ // **/
@RestController //@RestController
@Api(tags = "报表分享管理") //@Api(tags = "报表分享管理")
@RequestMapping("/reportShare") //@RequestMapping("/reportShare")
@Permission(code = "ReportShare", name = "报表分享管理") //@Permission(code = "reportShareManage", name = "报表分享管理")
public class ReportShareController extends GaeaBaseController<ReportShareParam, ReportShare, ReportShareDto> { //public class ReportShareController extends GaeaBaseController<ReportShareParam, ReportShare, ReportShareDto> {
//
@Autowired // @Autowired
private ReportShareService reportShareService; // private ReportShareService reportShareService;
//
@Override // @Override
public GaeaBaseService<ReportShareParam, ReportShare> getService() { // public GaeaBaseService<ReportShareParam, ReportShare> getService() {
return reportShareService; // return reportShareService;
} // }
//
@Override // @Override
public ReportShare getEntity() { // public ReportShare getEntity() {
return new ReportShare(); // return new ReportShare();
} // }
//
@Override // @Override
public ReportShareDto getDTO() { // public ReportShareDto getDTO() {
return new ReportShareDto(); // return new ReportShareDto();
} // }
//
//
@GetMapping({"/{id}"}) // @GetMapping({"/{id}"})
@AccessKey // @AccessKey
@Override // @Override
@Permission(code = "detail", name = "明细") // @Permission(code = "detail", name = "明细")
public ResponseBean detail(@PathVariable("id") Long id) { // public ResponseBean detail(@PathVariable("id") Long id) {
this.logger.info("{}根据ID查询服务开始id为{}", this.getClass().getSimpleName(), id); // this.logger.info("{}根据ID查询服务开始id为{}", this.getClass().getSimpleName(), id);
ReportShare result = reportShareService.getDetail(id); // ReportShare result = reportShareService.getDetail(id);
ReportShareDto dto = this.getDTO(); // ReportShareDto dto = this.getDTO();
GaeaBeanUtils.copyAndFormatter(result, dto); // GaeaBeanUtils.copyAndFormatter(result, dto);
ResponseBean responseBean = this.responseSuccessWithData(this.resultDtoHandle(dto)); // ResponseBean responseBean = this.responseSuccessWithData(this.resultDtoHandle(dto));
this.logger.info("{}根据ID查询结束结果{}", this.getClass().getSimpleName(), GaeaUtils.toJSONString(responseBean)); // this.logger.info("{}根据ID查询结束结果{}", this.getClass().getSimpleName(), GaeaUtils.toJSONString(responseBean));
return responseBean; // return responseBean;
} // }
//
@GetMapping({"/detailByCode"}) // @GetMapping({"/detailByCode"})
@Permission(code = "detail", name = "明细") // @Permission(code = "detail", name = "明细")
public ResponseBean detailByCode(@RequestParam("shareCode") String shareCode) { // public ResponseBean detailByCode(@RequestParam("shareCode") String shareCode) {
return ResponseBean.builder().data(reportShareService.detailByCode(shareCode)).build(); // 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();
}
}

@ -10,7 +10,7 @@ export function reportShareList(params) {
export function reportShareAdd(data) { export function reportShareAdd(data) {
return request({ return request({
url: 'reportShare', url: 'report/share',
method: 'post', method: 'post',
data data
}) })

@ -1,5 +1,5 @@
<template> <template>
<el-dialog class="tree_dialog" :title="title" width="60%" :close-on-click-modal="false" center :visible.sync="visib" :before-close="closeDialog"> <el-dialog class="tree_dialog" :title="titleBuild()" width="60%" :close-on-click-modal="false" center :visible.sync="visib" :before-close="closeDialog">
<el-form ref="userForm" :model="dialogForm" :rules="rules" size="small" label-width="100px"> <el-form ref="userForm" :model="dialogForm" :rules="rules" size="small" label-width="100px">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="20" :md="6" :lg="6" :xl="6"> <el-col :xs="24" :sm="20" :md="6" :lg="6" :xl="6">
@ -50,7 +50,7 @@ export default {
}, },
data() { data() {
return { return {
title: '报表分享-' + this.reportName + '【' +this.reportCode + '】', title: '报表分享',
reportShareUrl:'', reportShareUrl:'',
shareValidTypeOptions: [], // shareValidTypeOptions: [], //
dialogForm: { dialogForm: {
@ -76,6 +76,9 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
titleBuild(){
return '【' +this.reportName + '】' + '报表分享-' + this.reportCode
},
selectChange(val) { selectChange(val) {
this.dialogForm.shareValidType = val this.dialogForm.shareValidType = val
}, },

@ -19,6 +19,21 @@
v-permission="'bigScreenManage:design'" v-permission="'bigScreenManage:design'"
>设计</el-button >设计</el-button
> >
<el-button
type="text"
@click="shareReport(props.msg)"
v-permission="'bigScreenManage:share'"
>分享</el-button
>
</template>
<template v-slot:pageSection>
<Share
:visib="visibleForShareDialog"
:reportCode="reportCodeForShareDialog"
:reportName="reportNameForShareDialog"
@handleClose="visibleForShareDialog = false"
/>
</template> </template>
</anji-crud> </anji-crud>
</template> </template>
@ -30,13 +45,19 @@ import {
reportUpdate, reportUpdate,
reportDetail reportDetail
} from "@/api/reportmanage"; } from "@/api/reportmanage";
import Share from "@/views/report/report/components/share";
export default { export default {
name: "Report", name: "Report",
components: { components: {
anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default,
Share
}, },
data() { data() {
return { return {
//
visibleForShareDialog: false,
reportCodeForShareDialog: "",
reportNameForShareDialog: "",
crudOption: { crudOption: {
// 使 // 使
title: "报表管理", title: "报表管理",
@ -233,6 +254,12 @@ export default {
} }
}); });
window.open(routeUrl.href, "_blank"); window.open(routeUrl.href, "_blank");
},
//
shareReport(val){
this.reportCodeForShareDialog = val.reportCode;
this.reportNameForShareDialog = val.reportName;
this.visibleForShareDialog = true;
} }
} }
}; };

Loading…
Cancel
Save