excel分享暂不支持

Raod 3 years ago
parent 802edf8723
commit a8aac3591b

@ -120,7 +120,7 @@ export default {
params: { params: {
reportCode: "", reportCode: "",
reportName: "", reportName: "",
// reportType: '', reportType: 'report_screen',
pageNumber: 1, pageNumber: 1,
pageSize: 8, pageSize: 8,
order: "DESC", order: "DESC",

@ -6,101 +6,251 @@
!--> !-->
<template> <template>
<div class="main-layout"> <div class="main-layout">
<el-form ref="form" :model="params" :rules="rules" label-width="120px">
<!-- 搜索 -->
<el-row :gutter="10">
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
<el-form-item label="名称">
<el-input
v-model="params.reportName"
size="mini"
clearable
placeholder="名称"
class="filter-item"
/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="20" :md="12" :lg="6" :xl="4">
<el-form-item label="报表编码">
<el-input
v-model="params.reportCode"
size="mini"
clearable
placeholder="报表编码"
class="filter-item"
/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="20" :md="4" :lg="4" :xl="4">
<el-button type="primary" size="mini" @click="search('form')"
>查询</el-button
>
<el-button type="danger" size="mini" @click="reset('form')"
>重置</el-button
>
</el-col>
</el-row>
</el-form>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col v-for="groupItem in reportGroups" :key="groupItem.groupId" :span="6"> <el-col v-for="item in list" :key="item.id" :span="6">
<div class="list"> <div class="bg">
<header>{{ groupItem.groupName }}</header> <img
<div v-for="report in groupItem.reportList" :key="report.reportId"> class="bg-img"
<p @click="openDesign(report.reportId)">{{ report.reportName }}</p> :src="
<!-- <el-button type="success" size="mini" icon="el-icon-setting" circle plain @click="openDesign(report.reportId)" /> item.reportImage == null || item.reportImage == ''
<el-button type="primary" size="mini" icon="el-icon-view" circle plain /> --> ? require('../../../assets/images/charts.jpg')
: item.reportImage
"
alt=""
/>
<div class="content">
<header>{{ item.reportName }}</header>
<footer>
{{ item.updateTime }}
<div class="operation">
<el-button
icon="el-icon-share"
class="view"
type="text"
@click="share(item)"
v-permission="'bigScreenManage:share'"
/>
<el-button
icon="el-icon-view"
class="view"
type="text"
@click="viewDesign(item)"
v-permission="'bigScreenManage:view'"
/>
<el-button
icon="el-icon-edit"
class="edit"
type="text"
@click="openDesign(item)"
v-permission="'bigScreenManage:design'"
/>
</div>
</footer>
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="block">
<el-pagination
:total="totalCount"
:page-sizes="[8, 20, 50, 100]"
:page-size="params.pageSize"
:current-page="params.pageNumber"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
<Share
:visib="visibleForShareDialog"
:reportCode="reportCodeForShareDialog"
:reportName="reportNameForShareDialog"
@handleClose="visibleForShareDialog = false"
/>
</div> </div>
</template> </template>
<script> <script>
import Share from "@/views/report/report/components/share";
import { reportPageList } from "@/api/report";
export default { export default {
name: 'Login', name: "Login",
components: {}, components: { Share },
data() { data() {
return { return {
reportGroups: [ list: [],
{ rules: {},
groupId: 1, totalCount: 0,
groupName: '时效类', totalPage: 0,
reportList: [ params: {
{ reportCode: "",
reportId: 1, reportName: "",
reportName: 'excel报表1', reportType: 'report_excel',
pageNumber: 1,
pageSize: 8,
order: "DESC",
sort: "update_time"
}, },
{ //
reportId: 2, visibleForShareDialog: false,
reportName: 'excel报表2', reportCodeForShareDialog: "",
reportNameForShareDialog: ""
};
}, },
{ mounted() {},
reportId: 3, created() {
reportName: 'excel报表3', this.queryByPage();
},
],
}, },
{ methods: {
groupId: 2, //
groupName: '货物量', search() {
reportList: [ this.params.pageNumber = 1;
{ this.queryByPage();
reportId: 1,
reportName: 'excel报表1',
}, },
{ //
reportId: 2, reset(formName) {
reportName: 'excel报表2', this.$refs[formName].resetFields();
this.params.reportName = "";
this.params.reportCode = "";
this.params.pageNumber = 1;
this.queryByPage();
}, },
{ async queryByPage() {
reportId: 3, const res = await reportPageList(this.params);
reportName: 'excel报表3', if (res.code != "200") return;
this.listLoading = true;
this.list = res.data.records;
this.list.forEach(value => {
value["reportNameCode"] =
value.reportName + "[" + value.reportCode + "]";
});
this.totalCount = res.data.total;
this.totalPage = res.data.pages;
this.listLoading = false;
}, },
], handleSizeChange(val) {
this.params.pageSize = val;
this.queryByPage();
}, },
], handleCurrentChange(val) {
} this.params.pageNumber = val;
this.queryByPage();
}, },
mounted() {}, //
methods: { share(val) {
openDesign(reportId) { //excel
var routeUrl = this.$router.resolve({ path: '/excelreport/designer', query: { reportCode: reportId }}) this.$message.warning("暂不支持excel报表分享");
window.open(routeUrl.href, '_blank') return;
this.reportCodeForShareDialog = val.reportCode;
this.reportNameForShareDialog = val.reportName;
this.visibleForShareDialog = true;
}, },
openDesign(val) {
var routeUrl = this.$router.resolve({
path: "/excelreport/designer",
query: {
reportCode: val.reportCode,
}
});
window.open(routeUrl.href, "_blank");
}, },
viewDesign(val) {
var routeUrl = this.$router.resolve({
path: "/excelreport/viewer",
query: { reportCode: val.reportCode }
});
window.open(routeUrl.href, "_blank");
}
} }
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.main-layout { .main-layout {
padding: 20px;
position: relative; position: relative;
height: auto; height: auto;
padding: 0;
margin: 0;
.list {
background: #fff; background: #fff;
padding: 10px;
margin: 10px 0;
header { header {
font-size: 24px;
text-align: center; text-align: center;
line-height: 40px; line-height: 80px;
border-bottom: 1px solid #eee; }
.bg {
width: 100%;
height: 200px;
position: relative;
overflow: hidden;
margin: 10px 0;
border: 12px solid white;
}
.bg .bg-img {
position: absolute;
width: 100%;
height: 100%;
filter: blur(6px);
z-index: 2;
} }
p { .content {
width: 100%;
height: 100%;
position: absolute;
color: #fff;
left: 0;
top: 0;
z-index: 3;
}
footer {
width: 100%;
font-size: 14px;
padding: 16px;
line-height: 30px; line-height: 30px;
text-align: center; position: absolute;
color: #666; z-index: 3;
bottom: 0;
.operation {
float: right;
.view,
.edit {
color: #fff;
font-size: 14px; font-size: 14px;
cursor: pointer;
margin: 5px 0;
&:hover {
background: rgb(234, 237, 252);
} }
} }
} }

@ -66,6 +66,14 @@ export default {
labelWidth: "120px", labelWidth: "120px",
// //
queryFormFields: [ queryFormFields: [
{
inputType: 'anji-select', //form input|input-number|anji-select(urldictCode)|anji-tree()|date|datetime|datetimerange
anjiSelectOption: {
dictCode: "REPORT_TYPE"
},
label: '报表类型',
field: 'reportType'
},
{ {
inputType: "input", inputType: "input",
label: "报表名称", label: "报表名称",
@ -76,14 +84,6 @@ export default {
label: "报表编码", label: "报表编码",
field: "reportCode" field: "reportCode"
}, },
{
inputType: 'anji-select', //form input|input-number|anji-select(urldictCode)|anji-tree()|date|datetime|datetimerange
anjiSelectOption: {
dictCode: "REPORT_TYPE"
},
label: '报表类型',
field: 'reportType'
},
], ],
// //
buttons: { buttons: {
@ -282,6 +282,11 @@ export default {
}, },
// //
shareReport(val){ shareReport(val){
if (val.reportType == 'report_excel') {
//excel
this.$message.warning("暂不支持excel报表分享");
return;
}
this.reportCodeForShareDialog = val.reportCode; this.reportCodeForShareDialog = val.reportCode;
this.reportNameForShareDialog = val.reportName; this.reportNameForShareDialog = val.reportName;
this.visibleForShareDialog = true; this.visibleForShareDialog = true;

Loading…
Cancel
Save