大屏复制功能

qianlishi 3 years ago
parent 77e24f19fb
commit 7fc0bbbf20

@ -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
}) })
} }

@ -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