需求----新增报表分享菜单

Raod 2 years ago
parent 50a3aa2e29
commit db091f00b7

@ -66,4 +66,11 @@ public class ReportShareController extends GaeaBaseController<ReportShareParam,
return ResponseBean.builder().data(reportShareService.detailByCode(shareCode)).build(); return ResponseBean.builder().data(reportShareService.detailByCode(shareCode)).build();
} }
@PostMapping({"/shareDelay"})
@Permission(code = "shareDelay", name = "分享延期")
public ResponseBean shareDelay(@RequestBody ReportShareDto dto) {
reportShareService.shareDelay(dto);
return ResponseBean.builder().build();
}
} }

@ -2,6 +2,8 @@
package com.anjiplus.template.gaea.business.modules.reportshare.controller.dto; package com.anjiplus.template.gaea.business.modules.reportshare.controller.dto;
import java.io.Serializable; import java.io.Serializable;
import com.anji.plus.gaea.annotation.Formatter;
import com.anji.plus.gaea.curd.dto.GaeaBaseDTO; import com.anji.plus.gaea.curd.dto.GaeaBaseDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

@ -1,16 +1,26 @@
/**/ /**/
package com.anjiplus.template.gaea.business.modules.reportshare.controller.param; package com.anjiplus.template.gaea.business.modules.reportshare.controller.param;
import com.anji.plus.gaea.annotation.Query;
import com.anji.plus.gaea.constant.QueryEnum;
import com.anji.plus.gaea.curd.params.PageParam; import com.anji.plus.gaea.curd.params.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @desc ReportShare * @author Raod
* @author Raod * @desc ReportShare
* @date 2021-08-18 13:37:26.663 * @date 2021-08-18 13:37:26.663
**/ **/
@Data @Data
public class ReportShareParam extends PageParam implements Serializable{ public class ReportShareParam extends PageParam implements Serializable {
/** 分享编码系统生成默认UUID */
@Query(value = QueryEnum.EQ)
private String shareCode;
/** 报表编码 */
@Query(value = QueryEnum.LIKE)
private String reportCode;
} }

@ -24,4 +24,10 @@ public interface ReportShareService extends GaeaBaseService<ReportShareParam, Re
ReportShareDto insertShare(ReportShareDto dto); ReportShareDto insertShare(ReportShareDto dto);
ReportShare detailByCode(String shareCode); ReportShare detailByCode(String shareCode);
/**
*
* @param dto
*/
void shareDelay(ReportShareDto dto);
} }

@ -86,6 +86,23 @@ public class ReportShareServiceImpl implements ReportShareService {
return reportShare; return reportShare;
} }
/**
*
*
* @param dto
*/
@Override
public void shareDelay(ReportShareDto dto) {
Integer shareValidType = dto.getShareValidType();
if (null == dto.getId() || null == shareValidType) {
throw BusinessExceptionBuilder.build("入参不完整");
}
ReportShare entity = selectOne(dto.getId());
entity.setShareValidTime(DateUtil.getFutureDateTmdHmsByTime(entity.getShareValidTime(), shareValidType));
entity.setShareToken(JwtUtil.createToken(entity.getReportCode(), entity.getShareCode(), entity.getSharePassword(), entity.getShareValidTime()));
update(entity);
}
@Override @Override
public void processBeforeOperation(ReportShare entity, BaseOperationEnum operationEnum) throws BusinessException { public void processBeforeOperation(ReportShare entity, BaseOperationEnum operationEnum) throws BusinessException {
switch (operationEnum) { switch (operationEnum) {

@ -62,6 +62,23 @@ public class DateUtil {
return calendar.getTime(); return calendar.getTime();
} }
/**
*
* @param time
* @param day
* @return
*/
public static Date getFutureDateTmdHmsByTime(Date time, int day) {
if (day <= 0) {
//默认2099年
return parse("2099-01-01", defaultDatePattern);
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(time);
calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + day);
return calendar.getTime();
}
public static void main(String[] args) { public static void main(String[] args) {
Date futureDateTmdHms = getFutureDateTmdHms(7); Date futureDateTmdHms = getFutureDateTmdHms(7);
System.out.println(futureDateTmdHms); System.out.println(futureDateTmdHms);

@ -0,0 +1,8 @@
INSERT INTO `aj_report`.`access_authority`(`parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('report', 'reportShareManage', '报表分享', 'query', '查询报表分享', 231, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `aj_report`.`access_authority`(`parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('report', 'reportShareManage', '报表分享', 'detail', '查询明细', 232, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `aj_report`.`access_authority`(`parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('report', 'reportShareManage', '报表分享', 'shareDelay', '分享延期', 233, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `aj_report`.`access_authority`(`parent_target`, `target`, `target_name`, `action`, `action_name`, `sort`, `enable_flag`, `delete_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `version`) VALUES ('report', 'reportShareManage', '报表分享', 'delete', '删除分享', 234, 1, 0, 'admin', '2019-07-23 15:59:40', 'admin', '2019-07-23 15:59:40', 1);
INSERT INTO `aj_report`.`access_role_authority`(`role_code`, `target`, `action`) VALUES ('root', 'reportShareManage', 'query');
INSERT INTO `aj_report`.`access_role_authority`(`role_code`, `target`, `action`) VALUES ('root', 'reportShareManage', 'detail');
INSERT INTO `aj_report`.`access_role_authority`(`role_code`, `target`, `action`) VALUES ('root', 'reportShareManage', 'shareDelay');
INSERT INTO `aj_report`.`access_role_authority`(`role_code`, `target`, `action`) VALUES ('root', 'reportShareManage', 'delete');

@ -16,12 +16,20 @@ export function reportShareAdd(data) {
}) })
} }
export function reportShareDelay(data) {
return request({
url: 'reportShare/shareDelay',
method: 'post',
data
})
}
export function reportShareDeleteBatch(data) { export function reportShareDeleteBatch(data) {
return request({ return request({
url: 'reportShare/delete/batch', url: 'reportShare/delete/batch',
method: 'post', method: 'post',
data data
}) })
} }
export function reportShareUpdate(data) { export function reportShareUpdate(data) {
@ -35,7 +43,7 @@ export function reportShareDetail(data) {
return request({ return request({
url: 'reportShare/' + data.id, url: 'reportShare/' + data.id,
method: 'get', method: 'get',
params: { accessKey: data.accessKey } params: {accessKey: data.accessKey}
}) })
} }
@ -43,8 +51,8 @@ export function reportShareDetailByCode(data) {
return request({ return request({
url: 'reportShare/detailByCode', url: 'reportShare/detailByCode',
method: 'get', method: 'get',
params: { shareCode: data } params: {shareCode: data}
}) })
} }
export default { reportShareList, reportShareAdd, reportShareDeleteBatch, reportShareUpdate, reportShareDetail } export default {reportShareList, reportShareAdd, reportShareDeleteBatch, reportShareUpdate, reportShareDetail}

@ -26,263 +26,275 @@ import Layout from '../views/layout/Layout'
* AuthKey: 'roleManage:find' 该页面进入的权限码 * AuthKey: 'roleManage:find' 该页面进入的权限码
**/ **/
export const constantRouterMap = [ export const constantRouterMap = [
{ {
path: '/login', path: '/login',
component: () => import('@/views/login'), hidden: true component: () => import('@/views/login'), hidden: true
}, },
{ {
path: '/aj/**', path: '/aj/**',
component: () => import('@/views/bigScreenReport/aj'), component: () => import('@/views/bigScreenReport/aj'),
hidden: true hidden: true
}, },
{ {
path: '/index', path: '/index',
component: Layout, component: Layout,
name: 'index', name: 'index',
meta: { meta: {
title: '首页', title: '首页',
icon: 'iconhome2' icon: 'iconhome2'
}, },
children: [ children: [
{ {
path: '', path: '',
component: () => import('@/views/home/index'), component: () => import('@/views/home/index'),
meta: { meta: {
title: '首页', title: '首页',
icon: 'iconhome2', icon: 'iconhome2',
keepAlive: true, keepAlive: true,
requireAuth: true requireAuth: true
} }
}, },
] ]
}, },
{ {
path: '/access', path: '/access',
name: 'access', name: 'access',
component: Layout, component: Layout,
meta: { meta: {
title: '用户权限', title: '用户权限',
icon: 'icondfzq-', icon: 'icondfzq-',
requireAuth: true, requireAuth: true,
permission: 'authorityManage|roleManage|userManage' permission: 'authorityManage|roleManage|userManage'
}, },
children: [ children: [
{ {
path: 'authority', path: 'authority',
name: 'authority', name: 'authority',
component: () => import('@/views/accessAuthority/index'), component: () => import('@/views/accessAuthority/index'),
meta: { meta: {
title: '权限管理', title: '权限管理',
icon: 'iconquanxian', icon: 'iconquanxian',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'authorityManage' permission: 'authorityManage'
} }
}, },
{ {
path: 'role', path: 'role',
name: 'role', name: 'role',
component: () => import('@/views/accessRole/index'), component: () => import('@/views/accessRole/index'),
meta: { meta: {
title: '角色管理', title: '角色管理',
icon: 'iconjiaose1', icon: 'iconjiaose1',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'roleManage' permission: 'roleManage'
} }
}, },
{ {
path: 'user', path: 'user',
name: 'user', name: 'user',
component: () => import('@/views/accessUser/index'), component: () => import('@/views/accessUser/index'),
meta: { meta: {
title: '用户管理', title: '用户管理',
icon: 'iconyonghu', icon: 'iconyonghu',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'userManage' permission: 'userManage'
} }
}, },
] ]
}, },
{ {
path: '/report', path: '/report',
name: 'report', name: 'report',
component: Layout, component: Layout,
meta: { meta: {
title: '报表设计', title: '报表设计',
icon: 'iconnavicon-ywcs', icon: 'iconnavicon-ywcs',
requireAuth: true, requireAuth: true,
permission: 'datasourceManage|resultsetManage|reportManage|bigScreenManage' permission: 'datasourceManage|resultsetManage|reportManage|bigScreenManage'
}, },
children: [ children: [
{ {
path: 'datasource', path: 'datasource',
name: 'datasource', name: 'datasource',
component: () => import('@/views/datasource/index'), component: () => import('@/views/datasource/index'),
meta: { meta: {
title: '数据源', title: '数据源',
icon: 'icondatabase', icon: 'icondatabase',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'datasourceManage' permission: 'datasourceManage'
} }
}, },
{ {
path: 'resultset', path: 'resultset',
name: 'resultset', name: 'resultset',
component: () => import('@/views/resultset/index'), component: () => import('@/views/resultset/index'),
meta: { meta: {
title: '数据集', title: '数据集',
icon: 'iconAPIwangguan', icon: 'iconAPIwangguan',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'resultsetManage' permission: 'resultsetManage'
} }
}, },
{ {
path: 'report', path: 'report',
name: 'reportIndex', name: 'reportIndex',
component: () => import('@/views/reportManage/index'), component: () => import('@/views/reportManage/index'),
meta: { meta: {
title: '报表管理', title: '报表管理',
icon: 'iconnavicon-ywcs', icon: 'iconnavicon-ywcs',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'reportManage' permission: 'reportManage'
} }
}, },
{ {
path: 'bigscreen', path: 'bigscreen',
name: 'bigscreen', name: 'bigscreen',
component: () => import('@/views/bigScreenReport/index'), component: () => import('@/views/bigScreenReport/index'),
meta: { meta: {
title: '大屏报表', title: '大屏报表',
icon: 'iconchufaqipeizhi-hui', icon: 'iconchufaqipeizhi-hui',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'bigScreenManage' permission: 'bigScreenManage'
}, },
}, },
{ {
path: 'excelreport', path: 'excelreport',
name: 'excelreport', name: 'excelreport',
component: () => import('@/views/excelreport/index'), component: () => import('@/views/excelreport/index'),
meta: { meta: {
title: '表格报表', title: '表格报表',
icon: 'iconliebiao', icon: 'iconliebiao',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'excelManage' permission: 'excelManage'
} }
},
{
path: 'reportshare',
name: 'reportshare',
component: () => import('@/views/reportShare/index'),
meta: {
title: '报表分享',
icon: 'iconliebiao',
keepAlive: true,
requireAuth: true,
permission: 'reportShareManage'
}
}, },
] ]
}, },
{ {
path: '/system', path: '/system',
name: 'system', name: 'system',
component: Layout, component: Layout,
meta: { meta: {
title: '系统设置', title: '系统设置',
icon: 'iconshezhi', icon: 'iconshezhi',
requireAuth: true, requireAuth: true,
permission: 'fileManage|dictManage|dictItemManage' permission: 'fileManage|dictManage|dictItemManage'
}, },
children: [ children: [
{ {
path: 'file', path: 'file',
name: 'file', name: 'file',
component: () => import('@/views/fileManagement/index'), component: () => import('@/views/fileManagement/index'),
meta: { meta: {
title: '文件管理', title: '文件管理',
icon: 'iconfill_folder', icon: 'iconfill_folder',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'fileManage' permission: 'fileManage'
} }
}, },
{ {
path: 'dict', path: 'dict',
name: 'dict', name: 'dict',
component: () => import('@/views/dict/index'), component: () => import('@/views/dict/index'),
meta: { meta: {
title: '数据字典', title: '数据字典',
icon: 'iconzidian', icon: 'iconzidian',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'dictManage' permission: 'dictManage'
} }
}, },
{ {
path: 'dictItem', path: 'dictItem',
name: 'dictItem', name: 'dictItem',
component: () => import('@/views/dict/dict-item'), component: () => import('@/views/dict/dict-item'),
hidden: true, hidden: true,
meta: { meta: {
title: '字典项', title: '字典项',
icon: 'iconzidianxiang', icon: 'iconzidianxiang',
keepAlive: true, keepAlive: true,
requireAuth: true, requireAuth: true,
permission: 'dictItemManage' permission: 'dictItemManage'
} }
}, },
] ]
}, },
{ {
path: '/bigscreen/viewer', path: '/bigscreen/viewer',
component: () => import('@/views/bigscreenDesigner/viewer'), component: () => import('@/views/bigscreenDesigner/viewer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
} }
}, },
{ {
path: '/bigscreen/designer', path: '/bigscreen/designer',
component: () => import('@/views/bigscreenDesigner/designer'), component: () => import('@/views/bigscreenDesigner/designer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
} }
}, },
{ {
path: '/excelreport/viewer', path: '/excelreport/viewer',
component: () => import('@/views/excelreport/viewer'), component: () => import('@/views/excelreport/viewer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
} }
}, },
{ {
path: '/excelreport/designer', path: '/excelreport/designer',
component: () => import('@/views/excelreport/designer'), component: () => import('@/views/excelreport/designer'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
} }
}, },
// 重写大屏 // 重写大屏
{ {
path: '/screenDesigner', path: '/screenDesigner',
component: () => import('@/views/screenDesigner/index'), component: () => import('@/views/screenDesigner/index'),
name: 'screenDesigner', name: 'screenDesigner',
}, },
{ {
path: '/screen/preview', path: '/screen/preview',
component: () => import('@/views/screenDesigner/preview'), component: () => import('@/views/screenDesigner/preview'),
hidden: true, hidden: true,
meta: { meta: {
requireAuth: true requireAuth: true
} }
}, },
{ {
path: '/404', path: '/404',
component: () => import('@/views/404'), component: () => import('@/views/404'),
hidden: true hidden: true
}, },
{ {
path: '*', path: '*',
redirect: '/login', redirect: '/login',
hidden: true hidden: true
}, },
] ]

@ -0,0 +1,238 @@
<template>
<anji-crud ref="listPage" :option="crudOption">
<template v-slot:pageSection>
</template>
</anji-crud>
</template>
<script>
import {
reportShareDeleteBatch,
reportShareDetail,
reportShareList,
reportShareDelay, reportShareAdd
} from "@/api/reportShare";
export default {
name: "Report",
components: {
anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default,
},
data() {
return {
crudOption: {
// 使
title: '报表分享',
//
labelWidth: '120px',
//
queryFormFields: [
{
inputType: "input",
label: "分享编码",
field: "shareCode"
},
{
inputType: "input",
label: "报表编码",
field: "reportCode"
},
],
//
tableButtons: [
{
label: "删除",
type: "danger",
permission: "reportShareManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "复制url",
click: this.copyUrlPath
},
{
label: "删除",
permission: "reportShareManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
},
{
label: "延期1天",
permission: "reportShareManage:shareDelay",
click: this.shareDelay_1
},
{
label: "延期1周",
permission: "reportShareManage:shareDelay",
click: this.shareDelay_7
},
{
label: "延期1月",
permission: "reportShareManage:shareDelay",
click: this.shareDelay_30
},
],
//
buttons: {
query: {
api: reportShareList,
permission: 'ReportShare:query'
},
queryByPrimarykey: {
api: reportShareDetail,
permission: 'ReportShare:detail'
},
delete: {
api: reportShareDeleteBatch,
permission: 'ReportShare:delete'
},
rowButtonsWidth: 150 // row
},
//
columns: [
{
label: '',
field: 'id',
primaryKey: true, // ,
tableHide: true, //
editHide: true, //
},
{
label: '报表编码',//
placeholder: '',
field: 'reportCode',
editField: 'reportCode',
inputType: 'input',
rules: [
{ min: 1, max: 50, message: '不超过50个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '分享编码',//UUID
placeholder: '',
field: 'shareCode',
editField: 'shareCode',
inputType: 'input',
rules: [
{ min: 1, max: 50, message: '不超过50个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '分享有效期类型',//DIC_NAME=SHARE_VAILD
placeholder: '',
field: 'shareValidType',
fieldTableRowRenderer: row => {
return this.getDictLabelByCode("SHARE_VAILD", row["shareValidType"]);
},
editField: 'shareValidType',
inputType: 'input',
rules: [
],
disabled: false,
},
{
label: '分享有效期',//
placeholder: '',
field: 'shareValidTime',
editField: 'shareValidTime',
inputType: 'input',
rules: [
],
disabled: false,
},
{
label: '分享token',//token
placeholder: '',
field: 'shareToken',
editField: 'shareToken',
inputType: 'input',
rules: [
{ min: 1, max: 255, message: '不超过255个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '分享url',//url
placeholder: '',
field: 'shareUrl',
editField: 'shareUrl',
inputType: 'input',
rules: [
{ min: 1, max: 100, message: '不超过100个字符', trigger: 'blur' }
],
disabled: false,
},
],
//
// formData fieldName, fieldVal, fieldExtend
// fieldName input name
// fieldVal input
// fieldExtend select
formChange: (formData, fieldName, fieldVal, fieldExtend) => {
}
},
//
copyVisible: false,
rowData: {}
};
},
created() {},
methods: {
handleOpenDialog1() {
alert("自定义按钮1点击事件");
},
shareDelay_1(val) {
this.shareDelay(val.id, 1)
},
shareDelay_7(val) {
this.shareDelay(val.id, 7)
},
shareDelay_30(val) {
this.shareDelay(val.id, 30)
},
async shareDelay(shareId, shareValidType) {
const param = {}
param['id'] = shareId
param['shareValidType'] = shareValidType
const {code} = await reportShareDelay(param);
if (code != "200") return;
this.$message({
message: "延期成功!",
type: "success"
});
this.$refs.listPage.handleQueryForm("query");
},
copyUrlPath(val) {
this.copyToClip(val.shareUrl);
this.$message({
message: "已将url路径复制至剪切板",
type: "success"
});
},
copyToClip(content, message) {
let aux = document.createElement("input");
aux.setAttribute("value", content);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
}
}
};
</script>
Loading…
Cancel
Save