update 报表设计 报表管理

qianlishi 3 years ago
parent 77598aae82
commit 6f668db07e

@ -143,7 +143,7 @@ export const constantRouterMap = [
{ {
path: 'report', path: 'report',
name: 'reportIndex', name: 'reportIndex',
component: () => import('@/views/report/report/index'), component: () => import('@/views/reportManage/index'),
meta: { meta: {
title: '报表管理', title: '报表管理',
icon: 'iconnavicon-ywcs', icon: 'iconnavicon-ywcs',

@ -106,7 +106,7 @@
</template> </template>
<script> <script>
import Share from "@/views/report/report/components/share"; import Share from "./components/share";
import { reportPageList } from "@/api/report"; import { reportPageList } from "@/api/report";
export default { export default {
name: "Login", name: "Login",

@ -0,0 +1,217 @@
<template>
<el-dialog
class="tree_dialog"
:title="titleBuild()"
width="30%"
:close-on-click-modal="false"
center
:visible.sync="visib"
:before-close="closeDialog"
>
<div v-if="shareLinkFlag1">
<el-form
ref="userForm"
:model="dialogForm"
:rules="rules"
size="small"
label-width="100px"
>
<el-form-item label="有效期" prop="shareValidType">
<el-select
v-model.trim="dialogForm.shareValidType"
placeholder="请选择"
clearable
@change="selectChange"
>
<el-option
v-for="item in shareValidTypeOptions"
:key="item.id"
:label="item.text"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="分享码" prop="sharePasswordFlag">
<el-switch v-model="dialogForm.sharePasswordFlag"> </el-switch>
</el-form-item>
</el-form>
<el-button
type="primary"
plain
@click="createShare"
style="margin-left:45px"
>创建链接</el-button
>
</div>
<div v-else>
<el-form
ref="userForm"
:model="dialogForm"
:rules="rules"
size="small"
label-width="100px"
>
<el-form-item label="链接" prop="reportShareUrl">
<el-input v-model="reportShareUrl" :disabled="true" />
</el-form-item>
<el-form-item label="分享码" prop="sharePassword">
<el-input v-model="dialogForm.sharePassword" :disabled="true" />
</el-form-item>
<el-row :gutter="10">
<el-button
v-if="dialogForm.sharePassword == ''"
type="primary"
plain
@click="copyShare"
style="margin-left:45px"
>复制链接</el-button
>
<el-button
v-if="dialogForm.sharePassword != ''"
type="primary"
plain
@click="copyShare"
style="margin-left:45px"
>复制链接和分享码</el-button
>
</el-row>
</el-form>
</div>
<div slot="footer" style="text-align: center">
<!-- <el-button type="primary" plain @click="saveReportShare"></el-button>-->
<el-button type="danger" plain @click="closeDialog"></el-button>
</div>
</el-dialog>
</template>
<script>
import { reportShareAdd } from "@/api/reportShare";
import { getDictList } from "@/api/dict-data"; //
import Dictionary from "@/components/Dictionary/index";
export default {
components: { Dictionary },
props: {
visib: {
required: true,
type: Boolean,
default: false
},
reportCode: {
required: true,
type: String,
default: () => {
return "";
}
},
reportName: {
required: true,
type: String,
default: () => {
return "";
}
}
},
data() {
return {
title: "报表分享",
reportShareUrl: "",
shareValidTypeOptions: [], //
dialogForm: {
shareValidType: 0,
reportCode: "",
shareUrl: "",
shareCode: "",
sharePassword: "",
sharePasswordFlag: false
},
shareLinkFlag1: true,
rules: {
shareValidType: [
{ required: true, message: "有效期必选", trigger: "change" }
]
}
};
},
watch: {
visib(val) {
if (val) {
//
this.getSystem();
}
}
},
created() {},
methods: {
titleBuild() {
return "【" + this.reportName + "】" + "报表分享";
},
selectChange(val) {
this.dialogForm.shareValidType = val;
},
//
async getSystem() {
this.shareLinkFlag1 = true;
const { code, data } = await getDictList("SHARE_VAILD");
if (code != "200") return;
this.shareValidTypeOptions = data;
this.dialogForm.shareValidType = this.shareValidTypeOptions[0].id;
this.dialogForm.sharePasswordFlag = false;
this.dialogForm.sharePassword = "";
},
async createShare() {
this.dialogForm.reportCode = this.reportCode;
this.dialogForm.shareUrl = window.location.href;
// console.log(this.dialogForm)
const { code, data } = await reportShareAdd(this.dialogForm);
if (code != "200") return;
// console.log(data)
this.shareLinkFlag1 = false;
this.$message({
message: "创建链接成功!",
type: "success"
});
this.reportShareUrl = data.shareUrl;
this.dialogForm.sharePassword = data.sharePassword;
},
copyShare() {
let content = "";
if (this.dialogForm.sharePassword == "") {
content = "AJ-Report分享链接" + this.reportShareUrl;
} else {
content =
"AJ-Report分享链接" +
this.reportShareUrl +
" 分享码:" +
this.dialogForm.sharePassword;
}
this.copyToClip(content);
this.$message({
message: "复制链接成功!",
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);
},
async saveReportShare() {
let params = {};
//const { code } = await saveAuthorityTree(params)
//if (code != '200') return
this.closeDialog();
},
//
closeDialog() {
this.$emit("handleClose");
}
}
};
</script>

@ -107,7 +107,7 @@
</template> </template>
<script> <script>
import Share from "@/views/report/report/components/share"; import Share from "./components/share";
import { reportPageList } from "@/api/report"; import { reportPageList } from "@/api/report";
export default { export default {
name: "Login", name: "Login",

@ -0,0 +1,221 @@
<template>
<el-dialog
class="tree_dialog"
:title="titleBuild()"
width="30%"
:close-on-click-modal="false"
center
:visible.sync="visib"
:before-close="closeDialog"
>
<div v-if="shareLinkFlag1">
<el-form
ref="userForm"
:model="dialogForm"
:rules="rules"
size="small"
label-width="100px"
>
<el-form-item label="有效期" prop="shareValidType">
<el-select
v-model.trim="dialogForm.shareValidType"
placeholder="请选择"
clearable
@change="selectChange"
>
<el-option
v-for="item in shareValidTypeOptions"
:key="item.id"
:label="item.text"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="分享码" prop="sharePasswordFlag">
<el-switch v-model="dialogForm.sharePasswordFlag"> </el-switch>
</el-form-item>
</el-form>
<el-button
type="primary"
plain
@click="createShare"
style="margin-left:45px"
>创建链接</el-button
>
</div>
<div v-else>
<el-form
ref="userForm"
:model="dialogForm"
:rules="rules"
size="small"
label-width="100px"
>
<el-form-item label="链接" prop="reportShareUrl">
<el-input v-model="reportShareUrl" :disabled="true" />
</el-form-item>
<el-form-item
v-if="dialogForm.sharePasswordFlag"
label="分享码"
prop="sharePassword"
>
<el-input v-model="dialogForm.sharePassword" :disabled="true" />
</el-form-item>
<el-row :gutter="10">
<el-button
v-if="dialogForm.sharePassword == ''"
type="primary"
plain
@click="copyShare"
style="margin-left:45px"
>复制链接</el-button
>
<el-button
v-if="dialogForm.sharePassword != ''"
type="primary"
plain
@click="copyShare"
style="margin-left:45px"
>复制链接和分享码</el-button
>
</el-row>
</el-form>
</div>
<div slot="footer" style="text-align: center">
<!-- <el-button type="primary" plain @click="saveReportShare"></el-button>-->
<el-button type="danger" plain @click="closeDialog"></el-button>
</div>
</el-dialog>
</template>
<script>
import { reportShareAdd } from "@/api/reportShare";
import { getDictList } from "@/api/dict-data"; //
import Dictionary from "@/components/Dictionary/index";
export default {
components: { Dictionary },
props: {
visib: {
required: true,
type: Boolean,
default: false
},
reportCode: {
required: true,
type: String,
default: () => {
return "";
}
},
reportName: {
required: true,
type: String,
default: () => {
return "";
}
}
},
data() {
return {
title: "报表分享",
reportShareUrl: "",
shareValidTypeOptions: [], //
dialogForm: {
shareValidType: 0,
reportCode: "",
shareUrl: "",
shareCode: "",
sharePassword: "",
sharePasswordFlag: false
},
shareLinkFlag1: true,
rules: {
shareValidType: [
{ required: true, message: "有效期必选", trigger: "change" }
]
}
};
},
watch: {
visib(val) {
if (val) {
//
this.getSystem();
}
}
},
created() {},
methods: {
titleBuild() {
return "【" + this.reportName + "】" + "报表分享";
},
selectChange(val) {
this.dialogForm.shareValidType = val;
},
//
async getSystem() {
this.shareLinkFlag1 = true;
const { code, data } = await getDictList("SHARE_VAILD");
if (code != "200") return;
this.shareValidTypeOptions = data;
this.dialogForm.shareValidType = this.shareValidTypeOptions[0].id;
this.dialogForm.sharePasswordFlag = false;
this.dialogForm.sharePassword = "";
},
async createShare() {
this.dialogForm.reportCode = this.reportCode;
this.dialogForm.shareUrl = window.location.href;
// console.log(this.dialogForm)
const { code, data } = await reportShareAdd(this.dialogForm);
if (code != "200") return;
// console.log(data)
this.shareLinkFlag1 = false;
this.$message({
message: "创建链接成功!",
type: "success"
});
this.reportShareUrl = data.shareUrl;
this.dialogForm.sharePassword = data.sharePassword;
},
copyShare() {
let content = "";
if (this.dialogForm.sharePassword == "") {
content = "AJ-Report分享链接" + this.reportShareUrl;
} else {
content =
"AJ-Report分享链接" +
this.reportShareUrl +
" 分享码:" +
this.dialogForm.sharePassword;
}
this.copyToClip(content);
this.$message({
message: "复制链接成功!",
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);
},
async saveReportShare() {
let params = {};
//const { code } = await saveAuthorityTree(params)
//if (code != '200') return
this.closeDialog();
},
//
closeDialog() {
this.$emit("handleClose");
}
}
};
</script>

@ -1,12 +1,14 @@
<!-- <!--
* @Author: lide1202@hotmail.com * @Descripttion: 报表设计--报表管理
* @Date: 2021-3-13 11:04:24 * @version:
* @Last Modified by: lide1202@hotmail.com * @Author: qianlishi
* @Last Modified time: 2021-3-13 11:04:24 * @Date: 2021-12-11 14:48:27
!--> * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 12:20:46
-->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template slot="rowButton" slot-scope="props"> <template slot="rowButtonInMore" slot-scope="props">
<el-button <el-button
type="text" type="text"
@click="preview(props.msg)" @click="preview(props.msg)"
@ -45,7 +47,7 @@ import {
reportUpdate, reportUpdate,
reportDetail reportDetail
} from "@/api/reportmanage"; } from "@/api/reportmanage";
import Share from "@/views/report/report/components/share"; import Share from "./components/share";
import { validateEngOrNum } from "@/utils/validate"; import { validateEngOrNum } from "@/utils/validate";
export default { export default {
name: "Report", name: "Report",
Loading…
Cancel
Save