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

后台功能添加

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