提交 7d6f07d9 authored 作者: Yroc's avatar Yroc

后台功能添加

上级 e2247469
......@@ -17,7 +17,7 @@
</el-option>
</el-select>
</div>
<table class="table_box">
<table class="table_box" :id="chart_id">
<tr>
<!-- #038d6e -->
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
......@@ -53,7 +53,7 @@
<script>
export default {
props: ['table_data', 'labers'],
props: ['table_data', 'labers', 'chart_id'],
data() {
return {
sort_field: null,
......
......@@ -10,7 +10,7 @@
<!-- <el-select v-model="">
<el-option></el-option>
</el-select> -->
<table class="table_box">
<table class="table_box" :id="chart_id">
<!-- <tr>
<th v-for="(e, i) in labers" :key="i">{{ e.label }}</th>
</tr> -->
......@@ -25,7 +25,7 @@
<script>
export default {
props: ['table_data'],
props: ['table_data', 'chart_id'],
data() {
return {
sel: '',
......@@ -43,6 +43,7 @@ export default {
methods: {
//保留两位,四舍五入
keepTwoDecimal(num) {
if (num == 0 || !num) return num;
if (num.includes(',')) {
return num;
} else {
......
......@@ -7,7 +7,7 @@
<!-- -->
<template>
<div class="container_box">
<table class="table_box">
<table class="table_box" :id="chart_id">
<tr>
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
......@@ -89,7 +89,7 @@
<script>
export default {
props: ['table_data', 'labers'],
props: ['table_data', 'labers', 'chart_id'],
data() {
return {
sort_field: null,
......@@ -149,15 +149,15 @@ export default {
width: 100%;
height: 100%;
position: relative;
}
.el-icon-caret-bottom {
.el-icon-caret-bottom {
position: absolute;
top: 20px;
}
.el-icon-caret-top {
}
.el-icon-caret-top {
position: absolute;
top: 13px;
}
}
.table_box {
......
/**
* @Author: AnthonyD
* @Date: 2023-04-21 15:02:15
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 19:06:40
*/
const style_text = '<style>table {\
border-collapse: collapse;\
}.table_box{width:80%;margin:auto;text-align: center;border: 1px solid #000; }\
th,td{ border-bottom: 1px solid #000; border-right: 1px solid #000;}</style>'
export default style_text;
......@@ -21,6 +21,17 @@
</div>
</el-col>
<el-col :span="12" style="text-align: right">
<el-button
v-if="original_data.print_id"
style="backgrount-color: #000; margin-right: 10px"
icon="el-icon-printer"
size="mini"
circle
class="print_box"
@click="print_()"
>
</el-button>
<el-checkbox
v-if="original_data.is_show"
v-model="original_data.is_show.value"
......@@ -34,6 +45,7 @@
<Table
v-if="original_data"
:table_data="original_data.list"
:chart_id="original_data.chart_id"
:labers="original_data.labers"
></Table>
</div>
......@@ -42,6 +54,7 @@
v-if="original_data"
:table_data="original_data"
:labers="original_data.labers"
:chart_id="original_data.chart_id"
>
</SelectTabe>
</div>
......@@ -63,7 +76,10 @@
></bar-chart>
</div>
<div class="content_container" v-if="original_data.type == 'simple_table'">
<simple-table :table_data="original_data"></simple-table>
<simple-table
:table_data="original_data"
:chart_id="original_data.chart_id"
></simple-table>
</div>
<!-- 眼光稳定性 -->
<div
......@@ -85,6 +101,7 @@ import BarChart from './components/BarChart.vue';
import SimpleTable from './components/SimpleTable.vue';
import EyeStabilityTable from './components/EyeStabilityTable.vue';
import SelectTabe from './components/SelectTabe.vue';
import style_text from './components/table_style';
export default {
props: ['module_data'],
data() {
......@@ -105,7 +122,7 @@ export default {
computed: {},
created() {
this.original_data = { ...this.module_data };
// console.log(this.original_data);
console.log(this.original_data);
},
mounted() {},
......@@ -114,6 +131,32 @@ export default {
changeSelect() {
this.$emit('changeSelect', this.original_data.is_show);
},
print_() {
let domObj = document.getElementById(this.original_data.chart_id);
var newWin = window.open(''); //新打开一个空窗口
let title = this.original_data.topic
? `<div> <h4>${this.original_data.topic}</h4></div>`
: '';
let body = `<div style="text-align: center">
<h2>${this.original_data.title}</h2>
${title}
${domObj.outerHTML}
</div>`;
if (domObj) {
newWin.document.write(body);
// newWin.document.write(outerHTML);
// console.log(domObj.outerHTML);
newWin.document.head.innerHTML = style_text; //给打印的内容加上样式
newWin.document.close(); //在IE浏览器中使用必须添加这一句
newWin.focus(); //在IE浏览器中使用必须添加这一句
setTimeout(() => {
newWin.print(); //打印
newWin.close(); //关闭窗口
}, 500);
}
},
},
};
</script>
......
......@@ -191,7 +191,7 @@ export default {
// console.log(val);
// console.log(data);
this.examination_questions_select_data = '';
this.$emit('btnClick', { val, data });
this.$emit('btnClick', val, data);
},
uploadCode(val) {
this.btn_code = val;
......
......@@ -241,7 +241,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addTobaccoInfo();
if (val == 'add') this.addTobaccoInfo();
},
init() {
......
......@@ -371,6 +371,8 @@ export default {
return {
type: 'table',
chart_id: 'result_section',
print_id: 'result_section',
color: '#39c183f0',
title: '成绩分段值',
labers,
......@@ -392,6 +394,7 @@ export default {
chart_id: 'bar_chart',
color: '#E6A23C',
title: '南方北方烟得分情况',
labers,
keys,
raw_data: datas,
......@@ -450,6 +453,8 @@ export default {
return {
type: 'simple_table',
chart_id: 'HighesLowesttScore_table',
print_id: 'HighesLowesttScore_table',
color: '#99A9BF',
title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
labers,
......@@ -467,6 +472,8 @@ export default {
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
print_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
......@@ -516,7 +523,8 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
chart_id: 'eye_stability',
print_id: 'eye_stability',
color: '#529B2E',
title: '眼光稳定性',
labers,
......@@ -546,6 +554,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#F56C6C',
title: '易错题分析',
labers,
......@@ -573,6 +583,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#529B2E',
title: '易对题分析',
labers,
......@@ -604,6 +616,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_position',
print_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
labers,
......@@ -632,6 +646,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_level',
print_id: 'wrong_level',
color: '#505F79',
title: '错误上下一级',
labers,
......@@ -663,6 +679,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_color',
print_id: 'wrong_color',
color: '#99A9BF',
title: '错误颜色',
labers,
......@@ -693,6 +711,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_group',
print_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:59:01
* @Last Modified time: 2023-04-21 14:57:51
*/
</script>
<template>
......@@ -244,7 +244,7 @@ export default {
this.getListData();
},
btnClick(val) {
if (val.val == 'add') this.addInformation();
if (val == 'add') this.addInformation();
},
init() {
......
......@@ -366,8 +366,12 @@ export default {
console.log(res);
this.is_loading = false;
this.head_data.title = res.title_list; //标题
this.result_section = this.changeScore(res.ScoreScore); //成绩分段
this.area_score = this.changeAreaScore(res.AreaScore); //南北方得分
this.result_section = this.changeScore(res.ScoreScore); //成绩分段
this.province_score = this.changeProvinceScore(res.ProvinceScore); //省区得分
this.province_score = this.changeProvinceScore(res.ProvinceScore); //省区得分
this.breed_score = this.changeBreedScore(res.breedScore); //品种得分
this.transcript_data = this.changeTranscript(res.Transcript); //学员得分
......@@ -427,6 +431,7 @@ export default {
chart_id: 'result_section',
color: '#39c183f0',
title: '成绩分段值',
print_id: 'result_section',
labers,
list,
data,
......@@ -491,6 +496,7 @@ export default {
chart_id: 'province_bar_chart',
color: '#505F79',
title: '省级产区得分情况',
labers,
keys,
raw_data: datas,
......@@ -512,6 +518,7 @@ export default {
return {
type: 'bar',
chart_id: 'breed_bar_chart',
color: '#39c183f0',
title: '品种得分情况',
......@@ -535,9 +542,10 @@ export default {
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
print_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
labers,
topic: select_list,
select_value: select_list[0],
......@@ -565,6 +573,7 @@ export default {
return {
type: 'simple_table',
chart_id: 'HighesLowesttScore_table',
print_id: 'HighesLowesttScore_table',
color: '#99A9BF',
title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
labers,
......@@ -598,7 +607,8 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
print_id: 'eye_stability',
chart_id: 'eye_stability',
color: '#E6A23C',
title: '眼光稳定性',
labers,
......@@ -635,6 +645,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#F56C6C',
title: '易错题分析',
labers,
......@@ -669,6 +681,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#529B2E',
title: '易对题分析',
labers,
......@@ -697,6 +711,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_position',
print_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
labers,
......@@ -729,6 +745,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_level',
print_id: 'wrong_level',
color: '#505F79',
title: '错误上下一级',
labers,
......@@ -761,6 +779,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_color',
print_id: 'wrong_color',
color: '#99A9BF',
title: '错误颜色',
labers,
......@@ -793,6 +813,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_group',
print_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:49:45
* @Last Modified time: 2023-04-21 14:50:03
*/
</script>
<template>
......@@ -302,16 +302,17 @@ export default {
this.request_params.val = '';
this.getExaminationQuestionsDetail();
},
btnClick(val) {
btnClick(val, data = null) {
// console.log('右侧按钮');
// console.log(val);
console.log(val);
console.log(data);
if (val.val == 'add') this.addInformation();
if (val.val == 'template_download') this.templateDownload(val.data);
if (val == 'add') this.addInformation();
if (val == 'template_download') this.templateDownload(data);
/* pictureBatchUpload */
if (val.val == 'batch_upload') this.pictureBatchUpload();
if (val.val == 'examination_download') this.createAnswerCard();
if (val.val == 'select_score') this.selectScoreData(val.data);
if (val == 'batch_upload') this.pictureBatchUpload();
if (val == 'examination_download') this.createAnswerCard();
if (val == 'select_score') this.selectScoreData(data);
},
init() {
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-29 17:06:03
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-19 10:34:19
* @Last Modified time: 2023-04-21 17:13:47
*/
</script>
<template>
......@@ -261,6 +261,7 @@ export default {
chart_id: 'bar_chart1',
color: '#E6A23C',
title: '南北方正确/错误率',
labers,
keys,
raw_data: datas,
......@@ -375,6 +376,7 @@ export default {
type: 'table',
chart_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
list,
......@@ -401,7 +403,8 @@ export default {
});
return {
type: 'table',
chart_id: 'wrong_group',
chart_id: 'wrong_groups',
color: '#529B2E',
title: '错误正副组',
labers,
......@@ -460,7 +463,7 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
chart_id: 'eye_stability',
color: '#E6A23C',
title: '眼光稳定性',
labers,
......
......@@ -203,7 +203,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addInformation();
if (val == 'add') this.addInformation();
},
init() {
......
......@@ -236,7 +236,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') {
if (val == 'add') {
this.addDepartment(null);
}
},
......
......@@ -192,7 +192,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addRoles();
if (val == 'add') this.addRoles();
},
init() {
this.getPermissionBtnMenu();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论