!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; return;
} }
if (SLASH.equals(uri) || SLASH.concat(BusinessConstant.SLASH).equals(uri)) { 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"); response.sendRedirect(SLASH + "/index.html");
return; return;
} }

@ -43,11 +43,11 @@ public class ReportController extends GaeaBaseController<ReportParam, Report, Re
return new ReportDto(); return new ReportDto();
} }
@GetMapping("/copy") @PostMapping("/copy")
@Permission(code = "copy", name = "复制") @Permission(code = "copy", name = "复制")
@GaeaAuditLog(pageTitle = "复制") @GaeaAuditLog(pageTitle = "复制")
public ResponseBean copy(@RequestParam("reportId") Long reportId) { public ResponseBean copy(@RequestBody ReportDto dto) {
reportService.copy(reportId); reportService.copy(dto);
return ResponseBean.builder().build(); 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.constant.BaseOperationEnum;
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper; import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
import com.anji.plus.gaea.exception.BusinessException; import com.anji.plus.gaea.exception.BusinessException;
import com.anji.plus.gaea.exception.BusinessExceptionBuilder;
import com.anji.plus.gaea.utils.GaeaBeanUtils; 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.enums.ReportTypeEnum;
import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDashboard; import com.anjiplus.template.gaea.business.modules.dashboard.dao.entity.ReportDashboard;
import com.anjiplus.template.gaea.business.modules.dashboard.service.ReportDashboardService; 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.dao.entity.ReportExcel;
import com.anjiplus.template.gaea.business.modules.reportexcel.service.ReportExcelService; import com.anjiplus.template.gaea.business.modules.reportexcel.service.ReportExcelService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -107,10 +110,16 @@ public class ReportServiceImpl implements ReportService {
} }
@Override @Override
public void copy(Long reportId) { public void copy(ReportDto dto) {
Report report = selectOne(reportId); 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(); String reportCode = report.getReportCode();
Report copyReport = copyReport(report); Report copyReport = copyReport(report, dto);
//复制主表数据 //复制主表数据
insert(copyReport); insert(copyReport);
String copyReportCode = copyReport.getReportCode(); 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(); Report copyReport = new Report();
GaeaBeanUtils.copyAndFormatter(report, copyReport); GaeaBeanUtils.copyAndFormatter(report, copyReport);
copyReport.setId(null); copyReport.setReportCode(dto.getReportCode());
String copyReportCode = copyReport.getReportCode().concat("_").concat(String.valueOf(System.currentTimeMillis())); copyReport.setReportName(dto.getReportName());
if (copyReportCode.length() >= 100) {
copyReportCode = copyReportCode.substring(0, 100);
}
copyReport.setReportCode(copyReportCode);
copyReport.setReportName(copyReport.getReportName().concat("_copy"));
return copyReport; return copyReport;
} }

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

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

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

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

@ -3,7 +3,7 @@
<div class="admin-title" @click="goBigScreen"> <div class="admin-title" @click="goBigScreen">
<div class="con"> <div class="con">
<img src="../../../../../static/logo-dp.png" width="50" /> <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>
</div> </div>
<el-menu <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 * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2022-05-15 10:44:58 * @LastEditTime: 2022-05-17 17:38:44
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
@ -15,6 +15,7 @@
:reportName="reportNameForShareDialog" :reportName="reportNameForShareDialog"
@handleClose="visibleForShareDialog = false" @handleClose="visibleForShareDialog = false"
/> />
<copyDialog :visib.sync="copyVisible" :rowData="rowData" @close="close" />
</template> </template>
</anji-crud> </anji-crud>
</template> </template>
@ -28,13 +29,15 @@ import {
reportCopy reportCopy
} from "@/api/reportmanage"; } from "@/api/reportmanage";
import Share from "./components/share"; import Share from "./components/share";
import copyDialog from "./components/copyDialog.vue";
import { validateEngOrNum } from "@/utils/validate"; import { validateEngOrNum } from "@/utils/validate";
import { verificationSet } from "@/api/report"; import { verificationSet } from "@/api/report";
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 Share,
copyDialog
}, },
data() { data() {
return { return {
@ -306,7 +309,11 @@ export default {
} }
} }
} }
} },
//
copyVisible: false,
rowData: {}
}; };
}, },
@ -358,11 +365,17 @@ export default {
}, },
// //
async copyReport(val) { async copyReport(val) {
const { code } = await reportCopy(val); this.copyVisible = true;
if (code != "200") { this.rowData = val;
return; // const { code } = await reportCopy(val);
} // if (code != "200") {
this.$message.success("复制成功"); // return;
// }
// this.$message.success("");
// this.$refs.listPage.handleQueryForm("query");
},
close() {
this.copyVisible = false;
this.$refs.listPage.handleQueryForm("query"); this.$refs.listPage.handleQueryForm("query");
} }
} }

Loading…
Cancel
Save