fix: eChart自适应更改,考试页面新增导出详情按钮

This commit is contained in:
mx00085@163.com
2023-03-31 10:03:59 +08:00
parent 4fb5105b03
commit 45b3de29f6
2 changed files with 60 additions and 3 deletions

View File

@@ -51,10 +51,18 @@
</div>
<!-- 以下为导出按钮 -->
<div class="btnzs">
<div class="btnz btnz3" @click="exportList">
<div><img src="../../assets/images/coursewareManage/export1.png" alt="" /></div>
<div class="btnz btnz3" @click="exportList">
<div>
<img src="../../assets/images/coursewareManage/export1.png" alt="" />
</div>
<div class="btnzText">导出</div>
</div>
<div class="btnz btnz3" style="margin-left: 20px" @click="exportDetils">
<div>
<img src="../../assets/images/coursewareManage/export1.png" alt="" />
</div>
<div class="btnzText">导出详细信息</div>
</div>
</div>
<!-- 以下为table表格 -->
<div class="tableBox">
@@ -163,7 +171,7 @@ export default {
axios({
method: "post",
url: "/report/boeu/exam/export/list/v2",
data: params ,
data: params,
responseType: "blob",
headers: {
token: Cookies.get("token"),
@@ -377,6 +385,50 @@ export default {
state.pageNo = page;
getTableData();
};
const exportDetils = async () => {
if (state.selectedRowKeys.length > 0) {
axios({
method: "post",
url: "/report/boeu/exam/export/detail/v2",
data: { ids: state.selectedRowKeys },
responseType: "blob",
headers: {
token: Cookies.get("token"),
},
}).then(
(res) => {
downLoad(res.data, "考试详情.xlsx");
},
(err) => {
message.error(err);
}
);
} else {
const params = {
testName: state.testName,
createName: state.createName,
pageNo: state.pageNo,
pageSize: state.pageSize,
orgId: state.orgId ? state.orgId[state.orgId.length - 1] : null,
};
axios({
method: "post",
url: "/report/boeu/exam/export/detail/v2",
data: params,
responseType: "blob",
headers: {
token: Cookies.get("token"),
},
}).then(
(res) => {
downLoad(res.data, "考试详情.xlsx");
},
(err) => {
message.error(err);
}
);
}
};
//请求组织接口
const getOrgList = async () => {
const res = await api.userGetUserOrg({});
@@ -397,6 +449,7 @@ export default {
return {
reset,
exportDetail,
exportDetils,
...toRefs(state),
tableData,
columns,

View File

@@ -608,6 +608,7 @@ export default {
options1.value.series[1].data = project;
options1.value.series[2].data = router;
createEcharts3();
}
}
};
@@ -1080,18 +1081,21 @@ export default {
// 图表2
const myChart1 = echarts.init(surface1Ref.value);
option.value && myChart1.setOption(option.value);
window.addEventListener('resize',()=>{myChart1.resize()})
};
// 生成echarts的方法
const createEcharts3 = () => {
// 图表3左侧图表
const myChart2 = echarts.init(surface2Ref.value);
options1.value && myChart2.setOption(options1.value);
window.addEventListener('resize',()=>{myChart2.resize()})
};
// 生成echarts的方法
const createEcharts4 = () => {
// 图表3 右侧图表
const myChart3 = echarts.init(surface3Ref.value);
options2.value && myChart3.setOption(options2.value);
window.addEventListener('resize',()=>{myChart3.resize()})
};
const initTime = () => {
const monthEnd = dayjs(new Date()).endOf("year").format("YYYY-MM");