!74 hotfix-0.9.7.2

Merge pull request !74 from Foming/dev
Foming 3 years ago committed by Gitee
commit adb14afc85
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -85,7 +85,12 @@ public class TokenFilter implements Filter {
return;
}
if (SLASH.equals(uri) || SLASH.concat(BusinessConstant.SLASH).equals(uri)) {
if (BusinessConstant.SLASH.equals(uri)) {
response.sendRedirect("/index.html");
return;
}
response.sendRedirect(SLASH + "/index.html");
return;
}

@ -43,11 +43,11 @@ public class ReportController extends GaeaBaseController<ReportParam, Report, Re
return new ReportDto();
}
@GetMapping("/copy")
@PostMapping("/copy")
@Permission(code = "copy", name = "复制")
@GaeaAuditLog(pageTitle = "复制")
public ResponseBean copy(@RequestParam("reportId") Long reportId) {
reportService.copy(reportId);
public ResponseBean copy(@RequestBody ReportDto dto) {
reportService.copy(dto);
return ResponseBean.builder().build();
}
}

@ -21,7 +21,7 @@ public interface ReportService extends GaeaBaseService<ReportParam, Report> {
/**
*
* @param reportId
* @param dto
*/
void copy(Long reportId);
void copy(ReportDto dto);
}

@ -3,7 +3,9 @@ package com.anjiplus.template.gaea.business.modules.report.service.impl;
import com.anji.plus.gaea.constant.BaseOperationEnum;
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
import com.anji.plus.gaea.exception.BusinessException;
import com.anji.plus.gaea.exception.BusinessExceptionBuilder;
import com.anji.plus.gaea.utils.GaeaBeanUtils;
import com.anjiplus.template.gaea.business.code.ResponseCode;
import com.anjiplus.template.gaea.business.enums.ReportTypeEnum;
import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDashboard;
import com.anjiplus.template.gaea.business.modules.dashboard.service.ReportDashboardService;
@ -16,6 +18,7 @@ import com.anjiplus.template.gaea.business.modules.report.service.ReportService;
import com.anjiplus.template.gaea.business.modules.reportexcel.dao.entity.ReportExcel;
import com.anjiplus.template.gaea.business.modules.reportexcel.service.ReportExcelService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -107,10 +110,16 @@ public class ReportServiceImpl implements ReportService {
}
@Override
public void copy(Long reportId) {
Report report = selectOne(reportId);
public void copy(ReportDto dto) {
if (null == dto.getId()) {
throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "id");
}
if (StringUtils.isBlank(dto.getReportCode())) {
throw BusinessExceptionBuilder.build(ResponseCode.NOT_NULL, "报表编码");
}
Report report = selectOne(dto.getId());
String reportCode = report.getReportCode();
Report copyReport = copyReport(report);
Report copyReport = copyReport(report, dto);
//复制主表数据
insert(copyReport);
String copyReportCode = copyReport.getReportCode();
@ -150,17 +159,12 @@ public class ReportServiceImpl implements ReportService {
}
}
private Report copyReport(Report report){
private Report copyReport(Report report, ReportDto dto){
//复制主表数据
Report copyReport = new Report();
GaeaBeanUtils.copyAndFormatter(report, copyReport);
copyReport.setId(null);
String copyReportCode = copyReport.getReportCode().concat("_").concat(String.valueOf(System.currentTimeMillis()));
if (copyReportCode.length() >= 100) {
copyReportCode = copyReportCode.substring(0, 100);
}
copyReport.setReportCode(copyReportCode);
copyReport.setReportName(copyReport.getReportName().concat("_copy"));
copyReport.setReportCode(dto.getReportCode());
copyReport.setReportName(dto.getReportName());
return copyReport;
}

@ -97,11 +97,13 @@ public class FileUtil {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
FileWriter fw = new FileWriter(filePath);
BufferedWriter bw = new BufferedWriter(fw);
FileOutputStream outputStream = new FileOutputStream(filePath);
OutputStreamWriter outputWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
BufferedWriter bw = new BufferedWriter(outputWriter);
bw.write(content);
bw.close();
fw.close();
outputWriter.close();
outputStream.close();
} catch (Exception e) {
log.error("写入文件失败", e);
throw BusinessExceptionBuilder.build(ResponseCode.FAIL_CODE, e.getMessage());
@ -178,7 +180,7 @@ public class FileUtil {
try {
out = new FileOutputStream(dstFile);
CheckedOutputStream cos = new CheckedOutputStream(out, new CRC32());
zipOut = new ZipOutputStream(cos);
zipOut = new ZipOutputStream(cos, StandardCharsets.UTF_8);
String baseDir = "";
compress(srcFile, zipOut, baseDir);
} catch (IOException e) {

@ -42,8 +42,8 @@ export function reportDetail(data) {
export function reportCopy(data) {
return request({
url: '/report/copy',
method: 'get',
params: { reportId: data.id }
method: 'post',
data
})
}

@ -344,6 +344,7 @@ export default {
} else {
this.$set(this.formData, key, val);
}
this.$emit("onChanged", this.formData);
// key
for (let i = 0; i < this.options.length; i++) {

@ -199,7 +199,9 @@
'background-origin': 'initial',
'background-clip': 'initial'
}"
@click.self="setOptionsOnClickScreen" @drop="widgetOnDragged($event)" @dragover="dragOver($event)"
@click.self="setOptionsOnClickScreen"
@drop="widgetOnDragged($event)"
@dragover="dragOver($event)"
>
<div v-if="grade" class="bg-grid"></div>
<widget
@ -332,7 +334,7 @@ export default {
},
//
screenCode: "",
dragWidgetCode:'', //code
dragWidgetCode: "", //code
//
widgets: [
{
@ -663,16 +665,16 @@ export default {
getPXUnderScale(px) {
return this.bigscreenScaleInWorkbench * px;
},
dragStart( widgetCode) {
this.dragWidgetCode =widgetCode;
dragStart(widgetCode) {
this.dragWidgetCode = widgetCode;
},
dragEnd() {
this.dragWidgetCode=''
this.dragWidgetCode = "";
},
dragOver(evt){
evt.preventDefault()
evt.stopPropagation()
evt.dataTransfer.dropEffect = 'copy'
dragOver(evt) {
evt.preventDefault();
evt.stopPropagation();
evt.dataTransfer.dropEffect = "copy";
},
//
widgetOnDragged(evt) {
@ -819,9 +821,14 @@ export default {
},
//
widgetValueChanged(key, val) {
console.log("key", key);
console.log("val", val);
console.log(this.widgetOptions);
if (this.screenCode == "screen") {
let newSetup = new Array();
this.dashboard = this.deepClone(val);
console.log("asd", this.dashboard);
console.log(this.widgetOptions);
if (this.bigscreenWidth != this.dashboard.width) {
this.bigscreenWidth = this.dashboard.width;
}
@ -833,9 +840,12 @@ export default {
el.value = this.bigscreenWidth;
} else if (el.name == "height") {
el.value = this.bigscreenHeight;
} else if (this.dashboard.hasOwn(el.name)) {
el["value"] = this.dashboard[el.name];
}
newSetup.push(el);
});
console.log(newSetup);
this.widgetOptions.setup = newSetup;
} else {
for (let i = 0; i < this.widgets.length; i++) {

@ -3,7 +3,7 @@
<div class="admin-title" @click="goBigScreen">
<div class="con">
<img src="../../../../../static/logo-dp.png" width="50" />
<span class="version">V0.9.7</span>
<span class="version">V0.9.7.2</span>
</div>
</div>
<el-menu

@ -0,0 +1,84 @@
<!--
* @Descripttion:
* @version:
* @Author: qianlishi
* @Date: 2022-05-17 16:55:05
* @LastEditors: qianlishi
* @LastEditTime: 2022-05-17 17:38:54
-->
<template>
<el-dialog
class="tree_dialog"
title="报表管理--复制"
width="30%"
:close-on-click-modal="false"
center
:visible.sync="visib"
:before-close="close"
>
<el-form
:model="form"
:rules="rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="报表名称" prop="reportName">
<el-input v-model="form.reportName" />
</el-form-item>
<el-form-item label="报表编码" prop="reportCode">
<el-input v-model="form.reportCode" />
</el-form-item>
</el-form>
<div slot="footer" style="text-align: center">
<el-button type="danger" plain @click="close"></el-button>
<el-button type="primary" plain @click="save"></el-button>
</div>
</el-dialog>
</template>
<script>
import { reportCopy } from "@/api/reportmanage";
export default {
props: {
visib: Boolean,
rowData: Object
},
data() {
return {
form: {},
rules: {
reportName: [
{ required: true, message: "请输入报表名称", trigger: "blur" }
],
reportCode: [
{ required: true, message: "请输入报表编码", trigger: "blur" }
]
}
};
},
watch: {
visib(val) {
this.form = this.deepClone(this.rowData);
this.form.reportCode = this.form.reportCode + "_" + Date.now();
}
},
methods: {
save() {
this.$refs.ruleForm.validate(async valid => {
if (valid) {
console.log(this.form);
const { code } = await reportCopy(this.form);
if (code != "200") {
return;
}
this.$message.success("复制成功");
this.close();
}
});
},
close() {
this.$emit("close");
}
}
};
</script>

@ -4,7 +4,7 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
* @LastEditTime: 2022-05-15 10:44:58
* @LastEditTime: 2022-05-17 17:38:44
-->
<template>
<anji-crud ref="listPage" :option="crudOption">
@ -15,6 +15,7 @@
:reportName="reportNameForShareDialog"
@handleClose="visibleForShareDialog = false"
/>
<copyDialog :visib.sync="copyVisible" :rowData="rowData" @close="close" />
</template>
</anji-crud>
</template>
@ -28,13 +29,15 @@ import {
reportCopy
} from "@/api/reportmanage";
import Share from "./components/share";
import copyDialog from "./components/copyDialog.vue";
import { validateEngOrNum } from "@/utils/validate";
import { verificationSet } from "@/api/report";
export default {
name: "Report",
components: {
anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default,
Share
Share,
copyDialog
},
data() {
return {
@ -306,7 +309,11 @@ export default {
}
}
}
}
},
//
copyVisible: false,
rowData: {}
};
},
@ -358,11 +365,17 @@ export default {
},
//
async copyReport(val) {
const { code } = await reportCopy(val);
if (code != "200") {
return;
}
this.$message.success("复制成功");
this.copyVisible = true;
this.rowData = val;
// const { code } = await reportCopy(val);
// if (code != "200") {
// return;
// }
// this.$message.success("");
// this.$refs.listPage.handleQueryForm("query");
},
close() {
this.copyVisible = false;
this.$refs.listPage.handleQueryForm("query");
}
}

Loading…
Cancel
Save