提交 ed9820d2 authored 作者: Yroc's avatar Yroc

后端优化

上级 7421b204
<!-- --> <script>
/**
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-15 18:02:16
*/
</script><!-- -->
<template> <template>
<div class="chart_container" :id="chart_id"></div> <div class="chart_container" :id="chart_id"></div>
</template> </template>
<script> <script>
export default { export default {
props: ['chart_data', 'chart_id'], props: ['chart_data', 'chart_id'],
data() { data() {
return { return {};
};
}, },
components: {}, components: {},
computed: {}, computed: {},
created() { created() {},
},
mounted() { mounted() {
this.initChart(); this.initChart();
// console.log('@@@@@@@@@@@');
// console.log(this.chart_data);
}, },
methods: { methods: {
initChart() { initChart() {
let colors = ['#bcdfdc', '#47afa0', '#cd9f50'];
let series = this.changData(this.chart_data); let series = this.changData(this.chart_data);
let legend_data = this.chart_data.labers.map(item => { // console.log(series);
return item.key let legend_data = this.chart_data.labers.map((item) => {
}) return item.key;
});
let _that = this;
let dom = document.getElementById(`${this.chart_id}`); let dom = document.getElementById(`${this.chart_id}`);
let myChart = this.$echarts.init(dom, null, { let myChart = this.$echarts.init(dom, null, {
renderer: 'canvas', renderer: 'canvas',
useDirtyRect: false useDirtyRect: false,
});
let labers = this.chart_data.labers.map((item) => {
return item.label;
}); });
let option; let option;
option = { option = {
color: ['#cd9f50', '#47afa0', '#bcdfdc'], color: colors,
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow',
} },
}, },
legend: { legend: {
// data: ['Forest', 'Steppe', 'Desert', 'Wetland'] /* formatter: (name) => {
// data: legend_data, let objs = this.chart_data.labers.filter((itme) => {
formatter: (name) => {
let objs = this.chart_data.labers.filter(itme => {
return itme.key == name; return itme.key == name;
}) });
return objs[0].label return objs[0].label;
} }, */
data: labers,
}, },
toolbox: { toolbox: {
show: false, show: false,
...@@ -62,64 +73,30 @@ export default { ...@@ -62,64 +73,30 @@ export default {
dataView: { show: true, readOnly: false }, dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar', 'stack'] }, magicType: { show: true, type: ['line', 'bar', 'stack'] },
restore: { show: true }, restore: { show: true },
saveAsImage: { show: true } saveAsImage: { show: true },
} },
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
axisTick: { show: false }, axisTick: { show: false },
// data: ['2012', '2013', '2014', '2015', '2016'] // data: ['2012', '2013', '2014', '2015', '2016']
data: this.chart_data.keys data: this.chart_data.keys,
} interval: 0,
axisLabel: {
show: true,
rotate: -90,
},
},
], ],
yAxis: [ yAxis: [
{ {
type: 'value' type: 'value',
} },
], ],
// series: [
// {
// name: 'Forest',
// type: 'bar',
// barGap: 0,
// // label: labelOption,
// emphasis: {
// focus: 'series'
// },
// data: [320, 332, 301, 334, 390]
// },
// {
// name: 'Steppe',
// type: 'bar',
// // label: labelOption,
// emphasis: {
// focus: 'series'
// },
// data: [220, 182, 191, 234, 290]
// },
// {
// name: 'Desert',
// type: 'bar',
// // label: labelOption,
// emphasis: {
// focus: 'series'
// },
// data: [150, 232, 201, 154, 190]
// },
// {
// name: 'Wetland',
// type: 'bar',
// // label: labelOption,
// emphasis: {
// focus: 'series'
// },
// data: [98, 77, 101, 99, 40]
// }
// ]
series: series
};
series: series,
};
if (option && typeof option === 'object') { if (option && typeof option === 'object') {
myChart.setOption(option); myChart.setOption(option);
...@@ -132,24 +109,26 @@ export default { ...@@ -132,24 +109,26 @@ export default {
let list = []; let list = [];
data.labers.forEach((item, index) => { data.labers.forEach((item, index) => {
let obj = { let obj = {
name: item.key, itemStyle: {
normal: { label: { show: true, position: 'top' } },
},
name: item.label,
type: 'bar', type: 'bar',
barGap: 0, barGap: 0,
emphasis: { emphasis: {
focus: 'series' focus: 'series',
}, },
data: [] data: [],
} };
data.keys.forEach(element => { data.keys.forEach((element) => {
obj.data.push(data.raw_data[element][item.key]); obj.data.push(data.raw_data[element][item.key]);
}); });
list.push(obj) list.push(obj);
}); });
return list return list;
}, },
} },
} };
</script> </script>
<style scoped> <style scoped>
.chart_container { .chart_container {
......
...@@ -9,38 +9,132 @@ ...@@ -9,38 +9,132 @@
<div class="container_box"> <div class="container_box">
<table class="table_box"> <table class="table_box">
<tr> <tr>
<th v-for="(e, i) in labers" :key="i">{{ e.label }}</th> <th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
}}<i
class="el-icon-caret-bottom"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'desc' ? '#038d6e' : '')
"
@click="sort(e.key, 'desc')"
></i
><i
class="el-icon-caret-top"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'asc' ? '#038d6e' : '')
"
@click="sort(e.key, 'asc')"
></i>
</th>
</tr> </tr>
<tr v-for="(item, index) in table_data" :key="index"> <tr v-for="(item, index) in table_data" :key="index">
<td v-for="(e, i) in labers" :key="i"> <td v-for="(e, i) in labers" :key="i">
<div v-if="typeof item[e.key] === 'object'"> <div v-if="typeof item[e.key] === 'object'">
<el-popover placement="top-start" width="200" trigger="hover"> <!-- <el-popover placement="top-start" width="200" trigger="hover">
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<!-- <el-form-item label="正确数据: ">
<span v-for="(o, b) in item[e.key].exactness.value">{{ o
}},</span>
</el-form-item> -->
<el-form-item label="错误数据: "> <el-form-item label="错误数据: ">
<span v-for="(o, b) in item[e.key].wrong.value">{{ o }},</span> <span v-for="(o, b) in item[e.key].wrong.value" :key="b"
>{{ o }},</span
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-button slot="reference" type="text" size="mini">{{ item[e.key].accuracy.value }}</el-button> <el-button slot="reference" type="text" size="mini">{{
</el-popover> item[e.key].accuracy.value
}}</el-button>
</el-popover> -->
<span slot="reference" type="text" size="mini">
{{ item[e.key] }}
</span>
</div>
<el-popover
v-else-if="e.key === 'stability'"
placement="top-start"
width="100%"
trigger="hover"
>
<div
v-if="
Object.prototype.toString.call(item.conclusion_data) ===
'[object Array]'
"
>
学员答案:{{ item.conclusion_data.join(',') }}
</div> </div>
<div v-else>
<el-table
:data="table_data[index].conclusion_table"
height="250"
border
style="width: 100%"
>
<el-table-column
prop="student_id"
sortable
label="学员信息"
width="180"
>
<template slot-scope="scope">
{{ scope.row.name }}({{ scope.row.student_id }})
</template>
</el-table-column>
<el-table-column
prop="conclusion"
sortable
label="稳定性"
width="180"
>
</el-table-column>
<el-table-column
label="学员答案"
sortable
prop="conclusion_data"
width="180"
>
<template slot-scope="scope">
{{ scope.row.conclusion_data.join(',') }}
</template>
</el-table-column>
</el-table>
</div>
<span slot="reference">{{ item[e.key] }}</span>
</el-popover>
<div v-else>{{ item[e.key] }}</div> <div v-else>{{ item[e.key] }}</div>
</td> </td>
</tr> </tr>
</table> </table>
<!-- <el-table :data="table_data" border style="width: 100%">
<el-table-column
v-for="(item, index) in labers"
:key="index"
:label="item.label"
:width="item.width"
>
<template slot="header">
<div>{{ item.label }}</div>
</template>
<template slot-scope="scope">
<div>{{ scope.row[item.key] }}</div>
</template>
</el-table-column>
</el-table> -->
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ['table_data', 'labers'], props: ['table_data', 'labers', 'is_pover'],
data() { data() {
return { return {
sort_field: null,
sort_type: null,
}; };
}, },
...@@ -48,25 +142,66 @@ export default { ...@@ -48,25 +142,66 @@ export default {
computed: {}, computed: {},
created() { created() {
// console.log(this.table_data);
// console.log(this.labers);
}, },
mounted() { }, mounted() {},
methods: { methods: {
sort(col, type = 'desc') {
test(item) { this.sort_field = col;
console.log('判断对象'); this.sort_type = type;
console.log(item); if (type == 'asc') {
console.log(typeof item == 'object'); this.table_data.sort((a, b) => {
}, let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return a_n - b_n;
} else if (a_n < b_n) {
return -1;
} else if (a_n > b_n) {
return 1;
} else {
return 0;
} }
} }); //升序
} else {
this.table_data.sort((a, b) => {
let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return b_n - a_n;
} else if (b_n < a_n) {
return -1;
} else if (b_n > a_n) {
return 1;
} else {
return 0;
}
}); //降序
}
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container_box { .container_box {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative;
}
.el-icon-caret-bottom {
position: absolute;
top: 20px;
}
.el-icon-caret-top {
position: absolute;
top: 13px;
} }
.table_box { .table_box {
...@@ -74,8 +209,8 @@ export default { ...@@ -74,8 +209,8 @@ export default {
// min-height: 100%; // min-height: 100%;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
border-top: 1px solid #E4E7ED; border-top: 1px solid #e4e7ed;
border-left: 1px solid #E4E7ED; border-left: 1px solid #e4e7ed;
border-collapse: collapse; border-collapse: collapse;
th, th,
...@@ -83,8 +218,8 @@ export default { ...@@ -83,8 +218,8 @@ export default {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 14px;
border-bottom: 1px solid #E4E7ED; border-bottom: 1px solid #e4e7ed;
border-right: 1px solid #E4E7ED; border-right: 1px solid #e4e7ed;
} }
th { th {
......
<!--
* @Author: czj
* @Date: 2023-03-21 10:14:46
* @Description:
* @FilePath: \AdministrationHome\src\components\AnalyseModule\components\table.vue
-->
<!-- -->
<template>
<div class="container_box">
<div>
<el-select
v-model="select_value"
style="width: 100%"
@change="selectChange"
>
<el-option v-for="(e, i) in select_list" :label="e" :value="e" :key="i">
</el-option>
</el-select>
</div>
<table class="table_box">
<tr>
<!-- #038d6e -->
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
}}<span
><i
class="el-icon-caret-bottom"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'desc' ? '#038d6e' : '')
"
@click="sort(e.key, 'desc')"
></i
><i
class="el-icon-caret-top"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'asc' ? '#038d6e' : '')
"
@click="sort(e.key, 'asc')"
></i
></span>
</th>
</tr>
<tr v-for="(item, index) in table_list" :key="index">
<td v-for="(e, i) in labers" :key="i">
<div>{{ item[e.key] }}</div>
</td>
</tr>
</table>
</div>
</template>
<script>
export default {
props: ['table_data', 'labers'],
data() {
return {
sort_field: null,
sort_type: null,
table_list: null,
select_list: [],
select_value: '',
};
},
components: {},
computed: {},
created() {
// console.log('是否加载');
// console.log(this.table_data);
// console.log(this.labers);
this.select_value = this.table_data.select_value;
this.select_list = [...this.table_data.topic];
this.table_list = this.table_data.list[this.table_data.topic[0]];
},
mounted() {},
methods: {
sort(col, type = 'desc') {
this.sort_field = col;
this.sort_type = type;
if (type == 'asc') {
this.table_list.sort((a, b) => {
let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return a_n - b_n;
} else if (a_n < b_n) {
return -1;
} else if (a_n > b_n) {
return 1;
} else {
return 0;
}
}); //升序
} else {
this.table_list.sort((a, b) => {
let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return b_n - a_n;
} else if (b_n < a_n) {
return -1;
} else if (b_n > a_n) {
return 1;
} else {
return 0;
}
}); //降序
}
},
//选择监听
selectChange(val) {
console.log('val');
console.log(val);
this.table_list = [...this.table_data.list[val]];
},
},
};
</script>
<style lang="scss" scoped>
.container_box {
width: 100%;
height: 100%;
position: relative;
}
.el-icon-caret-bottom {
position: absolute;
top: 56px;
}
.el-icon-caret-top {
position: absolute;
top: 49px;
}
.table_box {
width: 100%;
// min-height: 100%;
text-align: center;
font-size: 14px;
border-top: 1px solid #e4e7ed;
border-left: 1px solid #e4e7ed;
border-collapse: collapse;
th,
td {
margin: 0;
padding: 0;
font-size: 14px;
border-bottom: 1px solid #e4e7ed;
border-right: 1px solid #e4e7ed;
}
th {
padding: 15px 0;
color: #909399;
}
td {
padding: 5px 0;
color: #303133;
}
}
</style>
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<!-- --> <!-- -->
<template> <template>
<div class="container_box"> <div class="container_box">
<!-- <el-select v-model="">
<el-option></el-option>
</el-select> -->
<table class="table_box"> <table class="table_box">
<!-- <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>
...@@ -22,22 +25,27 @@ ...@@ -22,22 +25,27 @@
<script> <script>
export default { export default {
props: ['table_data',], props: ['table_data'],
data() { data() {
return { return {
sel: '',
}; };
}, },
components: {}, components: {},
computed: {}, computed: {},
created() { created() {},
mounted() {
// console.log(this.table_data);
}, },
mounted() { },
methods: { methods: {
//保留两位,四舍五入 //保留两位,四舍五入
keepTwoDecimal(num) { keepTwoDecimal(num) {
if (num.includes(',')) {
return num;
} else {
var result = parseFloat(num); var result = parseFloat(num);
if (isNaN(result)) { if (isNaN(result)) {
return false; return false;
...@@ -46,8 +54,9 @@ export default { ...@@ -46,8 +54,9 @@ export default {
return result; return result;
} }
} }
} },
} },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container_box { .container_box {
...@@ -60,8 +69,8 @@ export default { ...@@ -60,8 +69,8 @@ export default {
min-height: 100%; min-height: 100%;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
border-top: 1px solid #E4E7ED; border-top: 1px solid #e4e7ed;
border-left: 1px solid #E4E7ED; border-left: 1px solid #e4e7ed;
border-collapse: collapse; border-collapse: collapse;
th, th,
...@@ -69,8 +78,8 @@ export default { ...@@ -69,8 +78,8 @@ export default {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 14px;
border-bottom: 1px solid #E4E7ED; border-bottom: 1px solid #e4e7ed;
border-right: 1px solid #E4E7ED; border-right: 1px solid #e4e7ed;
} }
th { th {
......
...@@ -9,31 +9,75 @@ ...@@ -9,31 +9,75 @@
<div class="container_box"> <div class="container_box">
<table class="table_box"> <table class="table_box">
<tr> <tr>
<th v-for="(e, i) in labers" :key="i">{{ e.label }}</th> <th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
}}<span
><i
class="el-icon-caret-bottom"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'desc' ? '#038d6e' : '')
"
@click="sort(e.key, 'desc')"
></i
><i
class="el-icon-caret-top"
:style="
'color: ' +
(e.key == sort_field && sort_type == 'asc' ? '#038d6e' : '')
"
@click="sort(e.key, 'asc')"
></i
></span>
</th>
</tr> </tr>
<tr v-for="(item, index) in table_data" :key="index"> <tr v-for="(item, index) in table_data" :key="index">
<td v-for="(e, i) in labers" :key="i"> <td v-for="(e, i) in labers" :key="i">
<div v-if="e.key == 'distribute'"> <div v-if="e.key == 'distribute'">
<div v-if="item['distribute'].length > 3"> <div
<el-popover placement="right" title="标题" width="200" trigger="click"> v-if="
typeof item['distribute'] == 'object' &&
item['distribute'].length > 3
"
>
<el-popover
placement="right"
title="标题"
width="200"
trigger="click"
>
<div v-for="(h, key, j) in item['distribute']" :key="j"> <div v-for="(h, key, j) in item['distribute']" :key="j">
{{ key }}({{ item['distribute'][key] }}题) {{ key }}({{ item['distribute'][key] }}题)
</div> </div>
<el-button slot="reference" type="text" size="mini">...</el-button> <el-button slot="reference" type="text" size="mini"
>...</el-button
>
</el-popover> </el-popover>
</div> </div>
<div v-else> <div v-else-if="typeof item['distribute'] == 'object'">
<div v-for="(h, key, j) in item['distribute']" :key="j"> <div v-for="(h, key, j) in item['distribute']" :key="j">
{{ key }}({{ item['distribute'][key] }}题), {{ key }}({{ item['distribute'][key] }}题)
</div>
</div>
<div v-else>
<div>
{{ item['distribute'] }}
</div> </div>
</div> </div>
</div> </div>
<div v-else-if="Array.isArray(item[e.key])"> <div v-else-if="Array.isArray(item[e.key])">
<el-popover placement="right" width="200" trigger="click" v-if="item[e.key].length > 0"> <el-popover
placement="right"
width="200"
trigger="click"
v-if="item[e.key].length > 0"
>
<div v-for="(h, j) in item[e.key]" :key="j"> <div v-for="(h, j) in item[e.key]" :key="j">
{{ h }} {{ h }}
</div> </div>
<el-button slot="reference" type="text" size="mini">...</el-button> <el-button slot="reference" type="text" size="mini"
>...</el-button
>
</el-popover> </el-popover>
</div> </div>
<div v-else>{{ item[e.key] }}</div> <div v-else>{{ item[e.key] }}</div>
...@@ -48,23 +92,72 @@ export default { ...@@ -48,23 +92,72 @@ export default {
props: ['table_data', 'labers'], props: ['table_data', 'labers'],
data() { data() {
return { return {
sort_field: null,
sort_type: null,
}; };
}, },
components: {}, components: {},
computed: {}, computed: {},
created() {},
mounted() {},
mounted() { }, methods: {
sort(col, type = 'desc') {
methods: {} this.sort_field = col;
} this.sort_type = type;
if (type == 'asc') {
this.table_data.sort((a, b) => {
let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return a_n - b_n;
} else if (a_n < b_n) {
return -1;
} else if (a_n > b_n) {
return 1;
} else {
return 0;
}
}); //升序
} else {
this.table_data.sort((a, b) => {
let a_n =
parseFloat(a[col]) != a[col] ? a[col].split('~')[0] : a[col];
let b_n =
parseFloat(b[col]) != b[col] ? b[col].split('~')[0] : b[col];
if (parseFloat(a_n) == a_n && parseFloat(b_n) == b_n) {
return b_n - a_n;
} else if (b_n < a_n) {
return -1;
} else if (b_n > a_n) {
return 1;
} else {
return 0;
}
}); //降序
}
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container_box { .container_box {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative;
}
.el-icon-caret-bottom {
position: absolute;
top: 20px;
}
.el-icon-caret-top {
position: absolute;
top: 13px;
} }
.table_box { .table_box {
...@@ -72,8 +165,8 @@ export default { ...@@ -72,8 +165,8 @@ export default {
// min-height: 100%; // min-height: 100%;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
border-top: 1px solid #E4E7ED; border-top: 1px solid #e4e7ed;
border-left: 1px solid #E4E7ED; border-left: 1px solid #e4e7ed;
border-collapse: collapse; border-collapse: collapse;
th, th,
...@@ -81,8 +174,8 @@ export default { ...@@ -81,8 +174,8 @@ export default {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 14px;
border-bottom: 1px solid #E4E7ED; border-bottom: 1px solid #e4e7ed;
border-right: 1px solid #E4E7ED; border-right: 1px solid #e4e7ed;
} }
th { th {
......
...@@ -16,33 +16,64 @@ ...@@ -16,33 +16,64 @@
<div class="header_box"> <div class="header_box">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div class="title_box" :title="original_data.title"> {{ original_data.title }}</div> <div class="title_box" :title="original_data.title">
{{ original_data.title }}
</div>
</el-col> </el-col>
<el-col :span="12" style="text-align: right;"> <el-col :span="12" style="text-align: right">
<el-checkbox v-if="original_data.is_show" v-model="original_data.is_show.value" @change="changeSelect">{{ <el-checkbox
original_data.is_show.value ? '显示' : '隐藏' v-if="original_data.is_show"
}}</el-checkbox> v-model="original_data.is_show.value"
@change="changeSelect"
>{{ original_data.is_show.value ? '显示' : '隐藏' }}</el-checkbox
>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="content_container" v-if="original_data.type == 'table'"> <div class="content_container" v-if="original_data.type == 'table'">
<Table :table_data="original_data.list" :labers="original_data.labers"></Table> <Table
v-if="original_data"
:table_data="original_data.list"
:labers="original_data.labers"
></Table>
</div>
<div class="content_container" v-if="original_data.type == 'select_table'">
<SelectTabe
v-if="original_data"
:table_data="original_data"
:labers="original_data.labers"
>
</SelectTabe>
</div> </div>
<div class="content_container" v-if="false"> <div class="content_container" v-if="false">
<line-chart :chart_data="original_data.data" :chart_id="original_data.chart_id"></line-chart> <line-chart
:chart_data="original_data.data"
:chart_id="original_data.chart_id"
></line-chart>
</div> </div>
<div class="content_container" v-if="original_data.type == 'bar'"> <div class="content_container" v-if="original_data.type == 'bar'">
<bar-chart <bar-chart
:chart_data="{ raw_data: original_data.raw_data, keys: original_data.keys, labers: original_data.labers }" :chart_data="{
:chart_id="original_data.chart_id"></bar-chart> raw_data: original_data.raw_data,
keys: original_data.keys,
labers: original_data.labers,
}"
:chart_id="original_data.chart_id"
></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"></simple-table>
</div> </div>
<!-- 眼光稳定性 --> <!-- 眼光稳定性 -->
<div class="content_container" v-if="original_data.type == 'eye_stability_table'"> <div
<eye-stability-table :table_data="original_data.list" :labers="original_data.labers"></eye-stability-table> class="content_container"
v-if="original_data.type == 'eye_stability_table'"
>
<eye-stability-table
:table_data="original_data.list"
:labers="original_data.labers"
></eye-stability-table>
</div> </div>
</div> </div>
</template> </template>
...@@ -53,31 +84,38 @@ import LineChart from './components/LineChart.vue'; ...@@ -53,31 +84,38 @@ import LineChart from './components/LineChart.vue';
import BarChart from './components/BarChart.vue'; 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';
export default { export default {
props: ['module_data'], props: ['module_data'],
data() { data() {
return { return {
original_data: {}, original_data: null,
}; };
}, },
components: { Table, LineChart, BarChart, SimpleTable, EyeStabilityTable }, components: {
Table,
LineChart,
BarChart,
SimpleTable,
EyeStabilityTable,
SelectTabe,
},
computed: {}, computed: {},
created() { created() {
this.original_data = { ...this.module_data }; this.original_data = { ...this.module_data };
console.log(this.original_data);
}, },
mounted() { mounted() {},
},
methods: { methods: {
//选择框监听 //选择框监听
changeSelect() { changeSelect() {
this.$emit('changeSelect', this.original_data.is_show); this.$emit('changeSelect', this.original_data.is_show);
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.analyse_container { .analyse_container {
......
...@@ -10,16 +10,33 @@ ...@@ -10,16 +10,33 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div> <div>
<el-button type="text" icon="el-icon-arrow-left" size="mini" class="back_btn" @click="back">返回</el-button> <el-button
type="text"
icon="el-icon-arrow-left"
size="mini"
class="back_btn"
@click="back"
>返回</el-button
>
<h2 class="title_box"> <h2 class="title_box">
<div v-if="Array.isArray(info_data.title)"> <div v-if="Array.isArray(info_data.title)">
<span>{{ info_data.title[0] }}</span> <!-- <span>{{ info_data.title[0] }}</span> -->
<el-popover placement="bottom" title="多个标题" width="200" trigger="hover"> <el-popover placement="bottom" width="480" trigger="hover">
<div> <div>
<el-tag type="info" v-for="(item, index) in info_data.title" :key="index" <el-tag
style="margin-bottom: 10px;">{{ item }}</el-tag> type="info"
v-for="(item, index) in info_data.title"
:key="index"
style="margin-bottom: 10px"
>{{ item }}</el-tag
>
</div> </div>
<el-button slot="reference" type="text">...</el-button> <el-button
style="color: #000; font-size: 20px"
slot="reference"
type="text"
>{{ info_data.title[0] }}</el-button
>
</el-popover> </el-popover>
</div> </div>
<div v-else> <div v-else>
...@@ -28,15 +45,18 @@ ...@@ -28,15 +45,18 @@
</h2> </h2>
</div> </div>
</el-col> </el-col>
<el-col :span="12" style="text-align: right;"> <el-col :span="12" style="text-align: right">
<el-button type="primary" v-for="(item, index) in info_data.right_buttons" :key="index" :icon="item.icon" <el-button
@click="btnClick(item.event)"> type="primary"
v-for="(item, index) in info_data.right_buttons"
:key="index"
:icon="item.icon"
@click="btnClick(item.event)"
>
{{ item.text }} {{ item.text }}
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
...@@ -56,10 +76,10 @@ export default { ...@@ -56,10 +76,10 @@ export default {
computed: {}, computed: {},
created() { created() {
this.info_data = { ...this.examination_questions }; this.info_data = { ...this.examination_questions };
console.log('头部接受到的数据'); // console.log('头部接受到的数据');
console.log(this.examination_questions); // console.log(this.examination_questions);
}, },
mounted() { }, mounted() {},
methods: { methods: {
back() { back() {
...@@ -67,24 +87,23 @@ export default { ...@@ -67,24 +87,23 @@ export default {
}, },
seconds_to_minutes(str) { seconds_to_minutes(str) {
if (str) { if (str) {
return secondsToMinutes(str) return secondsToMinutes(str);
} else { } else {
return '暂无' return '暂无';
} }
}, },
btnClick(val) { btnClick(val) {
this.$emit('btnClick', val); this.$emit('btnClick', val);
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.back_btn { .back_btn {
/* font-size: 16px; */ /* font-size: 16px; */
color: #303133; color: #303133;
border-right: 1px solid #DCDFE6; border-right: 1px solid #dcdfe6;
padding: 3px 10px 3px 0; padding: 3px 10px 3px 0;
border-radius: none; border-radius: none;
} }
......
<!--
* @Author: czj
* @Date: 2023-03-03 10:41:57
* @Description:
* @FilePath: \AdministrationHome\src\components\TableHead\index.vue
-->
<!-- -->
<template>
<div>
<el-row :gutter="20">
<el-col :span="9">
<div v-if="head_data.is_search_show">
<span>搜索:</span>
<el-input
placeholder="输入名称"
class="search_box"
v-model="search_val"
:placeholder="
!head_data.search_placeholder
? '搜索'
: head_data.search_placeholder
"
@change="searchChange"
></el-input>
<el-button type="warning" size="small" @click="search"
>搜索</el-button
>
<el-button size="small" @click="resetting">重置</el-button>
</div>
<div v-else style="opacity: 0; pointer-events: none">暂无</div>
</el-col>
<el-col :span="13" style="text-align: right; padding-right: 0">
<span
v-for="(item, index) in head_data.right_buttons"
:key="index"
style="margin: 0 8px"
>
<el-button
v-if="upload_btns.indexOf(item.event) == -1"
type="primary"
:icon="item.icon"
@click="btnClick(item.event)"
>{{ item.text }}</el-button
>
<el-upload
v-else
id="upload_moudel"
class="avatar-uploader"
action="#"
:show-file-list="false"
accept=""
:http-request="sliderRequest"
>
<el-button
type="primary"
:icon="item.icon"
@click="uploadCode(item.event)"
>{{ item.text }}</el-button
>
</el-upload>
</span>
</el-col>
<el-col :span="2"
><span v-if="head_data.ensembel_btn"
><el-badge :value="head_data.number_value">
<el-popover
placement="bottom"
width="400"
style="overflow-y: hidden"
trigger="hover"
v-model="visible"
>
<el-table
:data="head_data.select_data"
height="600"
style="width: 100%"
>
<el-table-column prop="id" label="编号"> </el-table-column>
<el-table-column prop="title" label="考试标题" width="180">
</el-table-column>
<el-table-column prop="address" label="操作">
<template slot-scope="scope">
<el-button
type="danger"
icon="el-icon-delete"
@click="deleteSelectData(scope)"
circle
></el-button>
</template>
</el-table-column>
</el-table>
<el-button
style="float: right; margin-top: 10px"
@click="
btnClick(head_data.ensembel_btn.event), (visible = !visible)
"
type="primary"
>{{ head_data.ensembel_btn.text }}</el-button
>
<el-button
slot="reference"
:icon="head_data.ensembel_btn.icon"
type="primary"
>{{ head_data.ensembel_btn.text }}</el-button
>
</el-popover>
</el-badge></span
></el-col
>
</el-row>
</div>
</template>
<script>
export default {
props: ['head_data'],
data() {
return {
search_val: '',
select_ids: [],
upload_btns: [
'upload',
'examination_questions_upload',
'batch_reservation',
],
btn_code: '',
visible: false,
};
},
components: {},
watch: {
head_data: {
handler(newValue, oldVlue) {
this.head_data = newValue;
},
deep: true,
},
},
computed: {},
mounted() {
// console.log(this.head_data);
},
methods: {
search() {
this.$emit('search', this.search_val);
},
searchChange() {
this.$emit('change', this.search_val);
},
resetting() {
this.search_val = null;
this.$emit('resetting', null);
},
addEvent() {
this.$emit('add');
},
//右侧按钮事件
btnClick(val) {
this.$emit('btnClick', val);
},
uploadCode(val) {
this.btn_code = val;
},
// 上传代理
sliderRequest(upload) {
let uploads = { ...upload };
uploads['btn_code'] = this.btn_code;
this.$emit('upload', uploads);
},
//删除购物车内容
deleteSelectData(scope) {
this.$emit('deleteSelectData', scope.$index, scope.row.id);
// this.head_data.select_data.splice(scope.$index, 1);
},
},
};
</script>
<style scoped>
.search_box {
width: 200px;
margin-right: 15px;
}
.avatar-uploader {
display: inline-block;
}
</style>
...@@ -11,25 +11,67 @@ ...@@ -11,25 +11,67 @@
<el-col :span="9"> <el-col :span="9">
<div v-if="head_data.is_search_show"> <div v-if="head_data.is_search_show">
<span>搜索:</span> <span>搜索:</span>
<el-input placeholder="输入名称" class="search_box" v-model="search_val" <el-input
:placeholder="!head_data.search_placeholder ? '搜索' : head_data.search_placeholder" placeholder="输入名称"
@change="searchChange"></el-input> class="search_box"
<el-button type="warning" size="small" @click="search">搜索</el-button> v-model="search_val"
:placeholder="
!head_data.search_placeholder
? '搜索'
: head_data.search_placeholder
"
@change="searchChange"
></el-input>
<el-button type="warning" size="small" @click="search"
>搜索</el-button
>
<el-button size="small" @click="resetting">重置</el-button> <el-button size="small" @click="resetting">重置</el-button>
</div> </div>
<div v-else style="opacity: 0;pointer-events: none;">暂无</div> <div v-else style="opacity: 0; pointer-events: none">暂无</div>
</el-col> </el-col>
<el-col :span="15" style="text-align: right;"> <el-col :span="15" style="text-align: right; padding-right: 0">
<span v-for="(item, index) in head_data.right_buttons" :key="index" style="margin: 0 8px;"> <span
<el-button v-if="upload_btns.indexOf(item.event) == -1" type="primary" :icon="item.icon" v-for="(item, index) in head_data.right_buttons"
@click="btnClick(item.event)">{{ :key="index"
item.text }}</el-button> style="margin: 0 8px"
<el-upload v-else id="upload_moudel" class="avatar-uploader" action="#" :show-file-list="false" accept="" >
:http-request="sliderRequest"> <el-button
<el-button type="primary" :icon="item.icon" @click="uploadCode(item.event)">{{ item.text }}</el-button> v-if="upload_btns.indexOf(item.event) == -1"
type="primary"
:icon="item.icon"
@click="btnClick(item.event)"
>{{ item.text }}</el-button
>
<el-upload
v-else
id="upload_moudel"
class="avatar-uploader"
action="#"
:show-file-list="false"
accept=""
:http-request="sliderRequest"
>
<el-button
type="primary"
:icon="item.icon"
@click="uploadCode(item.event)"
>{{ item.text }}</el-button
>
</el-upload> </el-upload>
</span> </span>
</el-col> </el-col>
<!-- <el-col :span="2"
><span v-if="head_data.ensembel_btn"
><el-badge :value="head_data.number_value">
<el-button
:icon="head_data.ensembel_btn.icon"
@click="btnClick(head_data.ensembel_btn.event)"
type="primary"
>{{ head_data.ensembel_btn.text }}</el-button
>
</el-badge></span
></el-col
> -->
</el-row> </el-row>
</div> </div>
</template> </template>
...@@ -40,16 +82,29 @@ export default { ...@@ -40,16 +82,29 @@ export default {
data() { data() {
return { return {
search_val: '', search_val: '',
upload_btns: ['upload', 'examination_questions_upload', 'batch_reservation'], upload_btns: [
'upload',
'examination_questions_upload',
'batch_reservation',
],
btn_code: '', btn_code: '',
}; };
}, },
components: {}, components: {},
watch: {
head_data: {
handler(newValue, oldVlue) {
this.head_data = newValue;
},
deep: true,
},
},
computed: {}, computed: {},
mounted() { }, mounted() {
console.log(this.head_data);
},
methods: { methods: {
search() { search() {
...@@ -59,7 +114,7 @@ export default { ...@@ -59,7 +114,7 @@ export default {
this.$emit('change', this.search_val); this.$emit('change', this.search_val);
}, },
resetting() { resetting() {
this.search_val = null this.search_val = null;
this.$emit('resetting', null); this.$emit('resetting', null);
}, },
addEvent() { addEvent() {
...@@ -75,13 +130,12 @@ export default { ...@@ -75,13 +130,12 @@ export default {
}, },
// 上传代理 // 上传代理
sliderRequest(upload) { sliderRequest(upload) {
let uploads = { ...upload } let uploads = { ...upload };
uploads['btn_code'] = this.btn_code uploads['btn_code'] = this.btn_code;
this.$emit('upload', uploads) this.$emit('upload', uploads);
}, },
} },
} };
</script> </script>
<style scoped> <style scoped>
.search_box { .search_box {
......
/**
* @Author: AnthonyD
* @Date: 2023-03-23 15:22:21
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-03-30 15:05:46
*/
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token' const TokenKey = 'Admin-Token_min'
export function getToken() { export function getToken() {
return Cookies.get(TokenKey) return Cookies.get(TokenKey)
......
...@@ -55,10 +55,24 @@ export function secondsToMinutes(s) { ...@@ -55,10 +55,24 @@ export function secondsToMinutes(s) {
//两个数,求百分比 //两个数,求百分比
export function toPercent(num, total) { export function toPercent(num, total) {
if (num == 0) {
return '0%'
} else {
return (Math.round(num / total * 10000) / 100.00 + "%");// 小数点后两位百分比 return (Math.round(num / total * 10000) / 100.00 + "%");// 小数点后两位百分比
} }
}
//取至小数点后两位,四舍五入
export function keepTwoDecimal(num) {
var result = parseFloat(num);
if (isNaN(result)) {
return false;
} else {
result = Math.round(num * 100) / 100;
return result;
}
}
......
...@@ -8,30 +8,57 @@ ...@@ -8,30 +8,57 @@
<template> <template>
<div class="module_container"> <div class="module_container">
<el-card class="module_container_left"> <el-card class="module_container_left">
<el-tree :data="left_terr_data" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" <el-tree
ref="tree" :default-expand-all="false" @node-click="handleNodeClick" /> :data="left_terr_data"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
:default-expand-all="false"
@node-click="handleNodeClick"
/>
</el-card> </el-card>
<div class="right_container"> <div class="right_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
<table-head :head_data="head_data" @search="searchEvent" @change="searchChange" @resetting="resetting" <table-head
@btnClick="btnClick"></table-head> :head_data="head_data"
@search="searchEvent"
@change="searchChange"
@resetting="resetting"
@btnClick="btnClick"
></table-head>
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="600"> <el-table
v-loading="is_loading"
:data="tableData"
style="width: 100%; margin-bottom: 20px"
height="600"
>
<el-table-column prop="id" label="编号" width="80"> <el-table-column prop="id" label="编号" width="80">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="烟草产地"> <el-table-column prop="name" label="烟草产地">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(item, index) in scope.row.tobacco_breed_place" :key="index">{{ item.area }}. <div
{{ item.place_of_production }}; v-for="(item, index) in scope.row.tobacco_breed_place"
:key="index"
>
{{ item.area }}. {{ item.place_of_production }};
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="品种名称" width="150"> <el-table-column prop="name" label="品种名称" width="150">
</el-table-column> </el-table-column>
<el-table-column prop="appearance_characteristics" label="外观特征" width="120"> <el-table-column
prop="appearance_characteristics"
label="外观特征"
width="120"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(e, key, i) in scope.row.appearance_characteristics" :key="i"> <div
v-for="(e, key, i) in scope.row.appearance_characteristics"
:key="i"
>
<span>{{ key }}</span> <span>{{ key }}</span>
<span>{{ scope.row.appearance_characteristics[key] }}</span> <span>{{ scope.row.appearance_characteristics[key] }}</span>
</div> </div>
...@@ -41,39 +68,69 @@ ...@@ -41,39 +68,69 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<div class="amplify_img_box"> <div class="amplify_img_box">
<img :src="IP + scope.row.image" alt=""> <img :src="IP + scope.row.image" alt="" />
</div> </div>
<img class="small_picture" slot="reference" :src="IP + scope.row.image" alt=""> <img
class="small_picture"
slot="reference"
:src="IP + scope.row.image"
alt=""
/>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="remark" label="备注"> </el-table-column>
</el-table-column>
<el-table-column prop="created_at" label="创建时间"> <el-table-column prop="created_at" label="创建时间">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" style="color: #000;" <el-button
@click="updataTobaccoInfo(scope.row)">编辑</el-button> size="mini"
<el-button size="mini" type="text" style="color: #F56C6C;" type="text"
@click="deleteTobacco(scope.row)">删除</el-button> style="color: #000"
@click="updataTobaccoInfo(scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
style="color: #f56c6c"
@click="deleteTobacco(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="text-align: right;"> <div style="text-align: right">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page" <el-pagination
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total"> @current-change="handleCurrentChange"
:current-page.sync="request_params.page"
:page-size="request_params.limit"
layout="total, prev, pager, next"
:total="request_params.total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
<el-dialog :title="is_updata_type == 'add' ? '新增品种信息' : '修改品种信息'" :visible.sync="is_dialogVisible" width="60%" <el-dialog
top="50px" :before-close="handleClose"> :title="is_updata_type == 'add' ? '新增品种信息' : '修改品种信息'"
<Dialog :left_terr_data="left_terr_data" :ProvinceData="ProvinceData" :tobacco_infos="tobacco_info" :visible.sync="is_dialogVisible"
@handleClose="handleClose" @submitData="submitData" :key="new Date().getTime()"></Dialog> width="60%"
top="50px"
:before-close="handleClose"
>
<Dialog
:left_terr_data="left_terr_data"
:ProvinceData="ProvinceData"
:tobacco_infos="tobacco_info"
@handleClose="handleClose"
@submitData="submitData"
:key="new Date().getTime()"
></Dialog>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -81,7 +138,16 @@ ...@@ -81,7 +138,16 @@
<script> <script>
import TableHead from '@/components/TableHead/index'; import TableHead from '@/components/TableHead/index';
import Dialog from './components/dialog.vue'; import Dialog from './components/dialog.vue';
import { get_province_list, get_tobacco_province, get_tobacco_all_info, add_tobacco_breed, delete_tobacco_breed, updata_tobacco_breed, get_tobacco_detail, get_tobacco_breed_list } from '@/api/student'; import {
get_province_list,
get_tobacco_province,
get_tobacco_all_info,
add_tobacco_breed,
delete_tobacco_breed,
updata_tobacco_breed,
get_tobacco_detail,
get_tobacco_breed_list,
} from '@/api/student';
const standard_template = { const standard_template = {
name: '', name: '',
tobacco_breed_place: [ tobacco_breed_place: [
...@@ -91,15 +157,13 @@ const standard_template = { ...@@ -91,15 +157,13 @@ const standard_template = {
}, },
], ],
appearance_characteristics: { appearance_characteristics: {
"颜色": "绿色", 颜色: '绿色',
"大小": "50CM" 大小: '50CM',
}, },
appearance_characteristics_vals: [ appearance_characteristics_vals: [{ label: '颜色', value: '绿色' }],
{ label: "颜色", value: '绿色' }, image: '',
], remark: '',
image: "", };
remark: ""
}
export default { export default {
data() { data() {
return { return {
...@@ -114,7 +178,7 @@ export default { ...@@ -114,7 +178,7 @@ export default {
text: '新增', text: '新增',
icon: 'el-icon-document-add', icon: 'el-icon-document-add',
event: 'add', event: 'add',
} },
], ],
}, },
//初始化请求参数 //初始化请求参数
...@@ -134,8 +198,8 @@ export default { ...@@ -134,8 +198,8 @@ export default {
left_terr_data: [], left_terr_data: [],
//树字段对应 //树字段对应
defaultProps: { defaultProps: {
children: "children", children: 'children',
label: "name" label: 'name',
}, },
//烟草信息 //烟草信息
tobacco_info: {}, tobacco_info: {},
...@@ -153,7 +217,7 @@ export default { ...@@ -153,7 +217,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.init() this.init();
}, },
methods: { methods: {
...@@ -196,7 +260,7 @@ export default { ...@@ -196,7 +260,7 @@ export default {
let params = this.$handleParams(val); let params = this.$handleParams(val);
console.log(params); console.log(params);
if (this.is_updata_type == 'add') { if (this.is_updata_type == 'add') {
add_tobacco_breed(params).then(res => { add_tobacco_breed(params).then((res) => {
console.log('新增回调'); console.log('新增回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -205,10 +269,10 @@ export default { ...@@ -205,10 +269,10 @@ export default {
// this.getTobaccoAllInfo(); // this.getTobaccoAllInfo();
this.getTobaccoBreedList(); this.getTobaccoBreedList();
} }
}) });
} else { } else {
let id = val.id; let id = val.id;
updata_tobacco_breed(id, params).then(res => { updata_tobacco_breed(id, params).then((res) => {
console.log('修改回调'); console.log('修改回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -217,41 +281,41 @@ export default { ...@@ -217,41 +281,41 @@ export default {
// this.getTobaccoAllInfo(); // this.getTobaccoAllInfo();
this.getTobaccoBreedList(); this.getTobaccoBreedList();
} }
}) });
} }
}, },
//获取烟草区域信息 //获取烟草区域信息
getTobaccoProvince() { getTobaccoProvince() {
get_tobacco_province().then(res => { get_tobacco_province().then((res) => {
console.log('烟草区域信息'); console.log('烟草区域信息');
console.log(res); console.log(res);
this.left_terr_data = res || []; this.left_terr_data = res || [];
for (let i in this.left_terr_data) { for (let i in this.left_terr_data) {
this.selectProvince(this.left_terr_data[i].name) this.selectProvince(this.left_terr_data[i].name);
} }
}) });
}, },
//获取烟草列表 //获取烟草列表
getTobaccoBreedList() { getTobaccoBreedList() {
this.is_loading = true; this.is_loading = true;
let params = this.$removeProperty(this.request_params); let params = this.$removeProperty(this.request_params);
get_tobacco_breed_list(params).then(res => { get_tobacco_breed_list(params).then((res) => {
this.tableData = res.data || []; this.tableData = res.data || [];
this.request_params.total = res.total; this.request_params.total = res.total;
this.is_loading = false; this.is_loading = false;
}) });
}, },
//获取烟草全部信息 //获取烟草全部信息
getTobaccoAllInfo() { getTobaccoAllInfo() {
this.is_loading = true; this.is_loading = true;
get_tobacco_all_info().then(res => { get_tobacco_all_info().then((res) => {
console.log('全部烟草信息'); console.log('全部烟草信息');
console.log(res); console.log(res);
this.tableData = res || []; this.tableData = res || [];
this.is_loading = false; this.is_loading = false;
}) });
}, },
//获取获取省市区信息 //获取获取省市区信息
selectProvince(val, index) { selectProvince(val, index) {
...@@ -262,14 +326,14 @@ export default { ...@@ -262,14 +326,14 @@ export default {
if (list[i].children.length == 0) { if (list[i].children.length == 0) {
delete list[i].children; delete list[i].children;
} else { } else {
removeNodeInTree(list[i].children) removeNodeInTree(list[i].children);
} }
} }
return list return list;
} };
get_province_list({ area: val }).then(res => { get_province_list({ area: val }).then((res) => {
this.ProvinceData[val] = removeNodeInTree(res); this.ProvinceData[val] = removeNodeInTree(res);
}) });
}, },
// 左侧树节点单击事件 // 左侧树节点单击事件
handleNodeClick(data) { handleNodeClick(data) {
...@@ -299,23 +363,27 @@ export default { ...@@ -299,23 +363,27 @@ export default {
let id = items.id; let id = items.id;
this.tobacco_info.id = items.id; this.tobacco_info.id = items.id;
this.tobacco_info.name = items.name; this.tobacco_info.name = items.name;
this.tobacco_info.appearance_characteristics = items.appearance_characteristics; this.tobacco_info.appearance_characteristics =
items.appearance_characteristics;
this.tobacco_info.appearance_characteristics_vals = []; this.tobacco_info.appearance_characteristics_vals = [];
for (const key in items.appearance_characteristics) { for (const key in items.appearance_characteristics) {
this.tobacco_info.appearance_characteristics_vals.push({ this.tobacco_info.appearance_characteristics_vals.push({
label: key, label: key,
value: items.appearance_characteristics[key] value: items.appearance_characteristics[key],
}); });
} }
this.tobacco_info['remark'] = items.remark; this.tobacco_info['remark'] = items.remark;
this.tobacco_info['image'] = items.image; this.tobacco_info['image'] = items.image;
this.tobacco_info.tobacco_breed_place = []; this.tobacco_info.tobacco_breed_place = [];
get_tobacco_detail(id).then(res => { get_tobacco_detail(id).then((res) => {
res.tobacco_breed_place.forEach((element, index) => { res.tobacco_breed_place.forEach((element, index) => {
this.tobacco_info.tobacco_breed_place.push({ area: element.area, province_id: element.province_id }) this.tobacco_info.tobacco_breed_place.push({
area: element.area,
province_id: element.province_id,
});
}); });
this.is_dialogVisible = true; this.is_dialogVisible = true;
}) });
}, },
//删除烟草信息 //删除烟草信息
deleteTobacco(item) { deleteTobacco(item) {
...@@ -323,18 +391,20 @@ export default { ...@@ -323,18 +391,20 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
delete_tobacco_breed(id).then(res => { .then(() => {
delete_tobacco_breed(id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.init(); this.init();
} }
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除',
}); });
}); });
}, },
...@@ -344,10 +414,8 @@ export default { ...@@ -344,10 +414,8 @@ export default {
this.request_params.page = val; this.request_params.page = val;
this.getTobaccoBreedList(); this.getTobaccoBreedList();
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.small_picture { .small_picture {
......
...@@ -12,44 +12,84 @@ ...@@ -12,44 +12,84 @@
<Header v-if="!is_loading" :examination_questions="head_data"></Header> <Header v-if="!is_loading" :examination_questions="head_data"></Header>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<div> <div>
<div class="module_header">得分情况</div> <div class="module_header">得分情况</div>
<div> <div>
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="8" v-if="review_conditions && review_conditions.is_ScoreScore" class="unit_container"> <el-col
:span="8"
v-if="review_conditions && review_conditions.is_ScoreScore"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="result_section" v-if="result_section"> <AnalyseModule
:module_data="result_section"
v-if="result_section"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8" v-if="review_conditions && review_conditions.is_AreaScore" class="unit_container"> <el-col
:span="8"
v-if="review_conditions && review_conditions.is_AreaScore"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="area_score" v-if="area_score"> <AnalyseModule :module_data="area_score" v-if="area_score">
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8" v-if="review_conditions && review_conditions.is_ProvinceScore" class="unit_container"> <el-col
:span="8"
v-if="review_conditions && review_conditions.is_ProvinceScore"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="province_score" v-if="province_score"> <AnalyseModule
:module_data="province_score"
v-if="province_score"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8" v-if="review_conditions && review_conditions.is_breedScore" class="unit_container"> <el-col
:span="8"
v-if="review_conditions && review_conditions.is_breedScore"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="breed_score" v-if="breed_score"> <AnalyseModule :module_data="breed_score" v-if="breed_score">
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8" v-if="review_conditions && review_conditions.is_getHighesLowesttScore" <el-col
class="unit_container"> :span="8"
v-if="
review_conditions &&
review_conditions.is_getHighesLowesttScore
"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="get_highes_lowestt_score_data" v-if="get_highes_lowestt_score_data"> <AnalyseModule
:module_data="get_highes_lowestt_score_data"
v-if="get_highes_lowestt_score_data"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 学员得分 -->
<el-col :span="8">
<div class="centenr_container">
<AnalyseModule
:module_data="transcript_data"
v-if="transcript_data"
>
</AnalyseModule>
</div>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
...@@ -60,67 +100,113 @@ ...@@ -60,67 +100,113 @@
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="12"> <el-col :span="12">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_question_data" v-if="wrong_question_data"></AnalyseModule> <AnalyseModule
:module_data="wrong_question_data"
v-if="wrong_question_data"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="exactness_question_data" v-if="exactness_question_data"></AnalyseModule> <AnalyseModule
:module_data="exactness_question_data"
v-if="exactness_question_data"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div> <div>
<div class="module_header">错误方向分析</div> <div class="module_header">错误方向分析</div>
<div> <div>
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="12" v-if="review_conditions && review_conditions.is_WrongPosition" class="unit_container"> <el-col
:span="12"
v-if="review_conditions && review_conditions.is_WrongPosition"
class="unit_container"
style="margin-top: 15px"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_position_data" v-if="wrong_position_data"></AnalyseModule> <AnalyseModule
:module_data="wrong_position_data"
v-if="wrong_position_data"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" v-if="review_conditions && review_conditions.is_ErrorLevel" class="unit_container"> <el-col
:span="12"
v-if="review_conditions && review_conditions.is_ErrorLevel"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="error_level_data" v-if="error_level_data"> <AnalyseModule
:module_data="error_level_data"
v-if="error_level_data"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" v-if="review_conditions && review_conditions.is_WrongColor" class="unit_container"> <el-col
:span="12"
v-if="review_conditions && review_conditions.is_WrongColor"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_color_data" v-if="wrong_color_data"> <AnalyseModule
:module_data="wrong_color_data"
v-if="wrong_color_data"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" v-if="review_conditions && review_conditions.is_WrongGroup" class="unit_container"> <el-col
:span="12"
v-if="review_conditions && review_conditions.is_WrongGroup"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrongG_group_data" v-if="wrongG_group_data"> <AnalyseModule
:module_data="wrongG_group_data"
v-if="wrongG_group_data"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" v-if="review_conditions && review_conditions.is_getHighesLowesttScore" <el-col
class="unit_container"> :span="12"
v-if="
review_conditions &&
review_conditions.is_getHighesLowesttScore
"
class="unit_container"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="eye_stability_data" v-if="eye_stability_data"> <AnalyseModule
:module_data="eye_stability_data"
v-if="eye_stability_data"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div> <div>
<div class="module_header">老师点评</div> <div class="module_header">老师点评</div>
<div style="padding: 0 10px;box-sizing: border-box;"> <div style="padding: 0 10px; box-sizing: border-box">
<el-input v-model="found_remark" type="textarea" :rows="6" placeholder="暂无内容" disabled> <el-input
v-model="found_remark"
type="textarea"
:rows="6"
placeholder="暂无内容"
disabled
>
</el-input> </el-input>
</div> </div>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</template> </template>
...@@ -179,7 +265,8 @@ export default { ...@@ -179,7 +265,8 @@ export default {
wrong_color_data: null, wrong_color_data: null,
//错误组别 //错误组别
wrongG_group_data: null, wrongG_group_data: null,
//学员得分情况
transcript_data: null,
//老师点评 //老师点评
found_remark: null, found_remark: null,
}; };
...@@ -199,33 +286,59 @@ export default { ...@@ -199,33 +286,59 @@ export default {
//获取批阅试题列表-详情 //获取批阅试题列表-详情
getReadOverDetail() { getReadOverDetail() {
this.is_loading = true; this.is_loading = true;
get_read_over_detail(this.examination_questions_id).then(res => { get_read_over_detail(this.examination_questions_id).then((res) => {
console.log('获取试题详情'); console.log('获取试题详情');
console.log(res); console.log(res);
this.found_remark = res.found_remark || ''; this.found_remark = res.found_remark || '';
this.head_data.title = res.review_content.title_list;//标题 this.head_data.title = res.review_content.title_list; //标题
this.is_loading = false; this.is_loading = false;
this.review_conditions = res.review_conditions;//审阅条件 this.review_conditions = res.review_conditions; //审阅条件
if (res.review_content) { if (res.review_content) {
this.result_section = this.changeScore(res.review_content.ScoreScore);//成绩分段 this.result_section = this.changeScore(res.review_content.ScoreScore); //成绩分段
this.area_score = this.changeAreaScore(res.review_content.AreaScore);//南北方得分 this.area_score = this.changeAreaScore(res.review_content.AreaScore); //南北方得分
this.province_score = this.changeProvinceScore(res.review_content.ProvinceScore);//省区得分 this.province_score = this.changeProvinceScore(
this.breed_score = this.changeBreedScore(res.review_content.breedScore);//品种得分 res.review_content.ProvinceScore
); //省区得分
this.breed_score = this.changeBreedScore(
res.review_content.breedScore
); //品种得分
//最高分、最低分、平均分,中位数、众数、离散(变异系数) //最高分、最低分、平均分,中位数、众数、离散(变异系数)
this.get_highes_lowestt_score_data = this.getHighesLowesttScore(res.review_content.getHighesLowesttScore); this.get_highes_lowestt_score_data = this.getHighesLowesttScore(
this.eye_stability_data = this.changeEyeStability(res.review_content.EyeStability); res.review_content.getHighesLowesttScore
);
this.eye_stability_data = this.changeEyeStability(
res.review_content.EyeStability
);
//学员得分
this.transcript_data = this.changeTranscript(
res.review_content.Transcript
);
//对错题分析 //对错题分析
if (res.review_content.top_data) this.wrong_question_data = this.changeWrong(res.review_content.top_data.datadesc);//错题分析 if (res.review_content.top_data)
if (res.review_content.top_data) this.exactness_question_data = this.changeRight(res.review_content.top_data.dataasc);//对题分析 this.wrong_question_data = this.changeWrong(
this.wrong_position_data = this.changeWrongPosition(res.review_content.WrongPosition);//错误部位 res.review_content.top_data.datadesc
this.error_level_data = this.changeErrorLevel(res.review_content.ErrorLevel);//错误等级 ); //错题分析
this.wrong_color_data = this.changeWrongColor(res.review_content.WrongColor);//错误颜色 if (res.review_content.top_data)
this.wrongG_group_data = this.changeWrongGroup(res.review_content.WrongGroup);//错误组别 this.exactness_question_data = this.changeRight(
res.review_content.top_data.dataasc
); //对题分析
this.wrong_position_data = this.changeWrongPosition(
res.review_content.WrongPosition
); //错误部位
this.error_level_data = this.changeErrorLevel(
res.review_content.ErrorLevel
); //错误等级
this.wrong_color_data = this.changeWrongColor(
res.review_content.WrongColor
); //错误颜色
this.wrongG_group_data = this.changeWrongGroup(
res.review_content.WrongGroup
); //错误组别
console.log('处理好的数据'); console.log('处理好的数据');
console.log(this.wrong_position_data); console.log(this.wrong_position_data);
} }
}) });
}, },
//计算百分比 //计算百分比
toPercent, toPercent,
...@@ -242,18 +355,18 @@ export default { ...@@ -242,18 +355,18 @@ export default {
let labers = [ let labers = [
{ label: '分类', key: 'classify' }, { label: '分类', key: 'classify' },
{ label: '分数段', key: 'score' }, { label: '分数段', key: 'score' },
{ label: '人数', key: 'people' }, { label: '人次', key: 'people' },
{ label: '占比', key: 'proportion' }, { label: '占比', key: 'proportion' },
]; ];
keys.forEach(element => { keys.forEach((element) => {
let scores = element.split('~'); let scores = element.split('~');
data.push(datas[element]); data.push(datas[element]);
let obj = { let obj = {
classify: element, classify: element,
score: scores[0], score: scores[0],
people: datas[element], people: datas[element],
proportion: this.toPercent(datas[element], num) proportion: this.toPercent(datas[element], num),
} };
list.push(obj); list.push(obj);
}); });
return { return {
...@@ -264,7 +377,6 @@ export default { ...@@ -264,7 +377,6 @@ export default {
labers, labers,
list, list,
data, data,
}; };
}, },
//南方烟北方烟得分情况 //南方烟北方烟得分情况
...@@ -272,19 +384,18 @@ export default { ...@@ -272,19 +384,18 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'bar_chart', chart_id: 'bar_chart',
color: '#E6A23C', color: '#E6A23C',
title: '南方北方烟得分情况', title: '南方北方烟得分情况',
labers, labers,
keys, keys,
raw_data: datas, raw_data: datas,
}; };
}, },
//省区得分数据处理 //省区得分数据处理
...@@ -292,19 +403,18 @@ export default { ...@@ -292,19 +403,18 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
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,
}; };
}, },
//品种得分情况 //品种得分情况
...@@ -312,19 +422,18 @@ export default { ...@@ -312,19 +422,18 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'breed_bar_chart', chart_id: 'breed_bar_chart',
color: '#39c183f0', color: '#39c183f0',
title: '品种得分情况', title: '品种得分情况',
labers, labers,
keys, keys,
raw_data: datas, raw_data: datas,
}; };
}, },
//最高分、最低分、平均分,中位数、众数、离散(变异系数) //最高分、最低分、平均分,中位数、众数、离散(变异系数)
...@@ -346,10 +455,30 @@ export default { ...@@ -346,10 +455,30 @@ export default {
title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)', title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
labers, labers,
data: datas, data: datas,
};
},
//学员得分情况
changeTranscript(datas) {
if (!datas) return false;
let labers = [
{ label: '姓名', key: 'name' },
{ label: '分数', key: 'score' },
];
let select_list = Object.keys(datas);
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
} labers,
topic: select_list,
select_value: select_list[0],
// data: datas,
list: datas,
};
}, },
//眼光稳定性 //眼光稳定性
changeEyeStability(datas) { changeEyeStability(datas) {
if (!datas) return false; if (!datas) return false;
...@@ -357,23 +486,32 @@ export default { ...@@ -357,23 +486,32 @@ export default {
let labers = [ let labers = [
{ label: '题目', key: 'title' }, { label: '题目', key: 'title' },
{ label: '答案', key: 'answer' }, { label: '答案', key: 'answer' },
{ label: '稳定性', key: 'stability' } { label: '稳定性', key: 'stability' },
]; ];
//处理稳定性数据 // //处理稳定性数据
const changeStability = (items) => { // const changeStability = (items) => {
let all_num = items.exactness.length + items.wrong.length; // let all_num = items.exactness.length + items.wrong.length;
let Accuracy = toPercent(items.exactness.length, all_num);//准确率 // let Accuracy = toPercent(items.exactness.length, all_num); //准确率
return { // return {
accuracy: { label: '正确率', value: Accuracy }, // accuracy: { label: '正确率', value: Accuracy },
// exactness: { label: '正确数据', value: items.exactness }, // // exactness: { label: '正确数据', value: items.exactness },
wrong: { label: '错误数据', value: items.wrong }, // wrong: { label: '错误数据', value: items.wrong },
} // };
}; // };
// datas.data.forEach((element, index) => {
// list.push({
// title: datas.title[index],
// answer: element.answer,
// stability: changeStability(element),
// });
// });
datas.data.forEach((element, index) => { datas.data.forEach((element, index) => {
list.push({ list.push({
title: datas.title[index], title: datas.title[index],
answer: element.answer, answer: element.answer,
stability: changeStability(element) area: element.area,
stability: element.conclusion,
conclusion_table: element.conclusion_table,
}); });
}); });
return { return {
...@@ -402,7 +540,7 @@ export default { ...@@ -402,7 +540,7 @@ export default {
title: element.title, title: element.title,
result: element.result, result: element.result,
errorRate: `${element.errorRate}%`, errorRate: `${element.errorRate}%`,
distribute: element.distribute distribute: element.distribute,
}); });
}); });
return { return {
...@@ -412,7 +550,6 @@ export default { ...@@ -412,7 +550,6 @@ export default {
title: '易错题分析', title: '易错题分析',
labers, labers,
list, list,
}; };
}, },
//易对题分析 //易对题分析
...@@ -439,7 +576,7 @@ export default { ...@@ -439,7 +576,7 @@ export default {
color: '#529B2E', color: '#529B2E',
title: '易对题分析', title: '易对题分析',
labers, labers,
list list,
}; };
}, },
//错误部位 //错误部位
...@@ -461,7 +598,7 @@ export default { ...@@ -461,7 +598,7 @@ export default {
answer: datas[element].answer, answer: datas[element].answer,
wrong_num: datas[element].wrong_num, wrong_num: datas[element].wrong_num,
// distribute: datas[element].distribute, // distribute: datas[element].distribute,
distribute: countOccurrences(datas[element].distribute) distribute: countOccurrences(datas[element].distribute),
}); });
}); });
return { return {
...@@ -471,7 +608,6 @@ export default { ...@@ -471,7 +608,6 @@ export default {
title: '错误部位', title: '错误部位',
labers, labers,
list, list,
}; };
}, },
//错误等级 //错误等级
...@@ -503,7 +639,6 @@ export default { ...@@ -503,7 +639,6 @@ export default {
title: '错误等级', title: '错误等级',
labers, labers,
list, list,
}; };
}, },
//错误颜色 //错误颜色
...@@ -535,7 +670,6 @@ export default { ...@@ -535,7 +670,6 @@ export default {
title: '错误颜色', title: '错误颜色',
labers, labers,
list, list,
}; };
}, },
//错误组别 //错误组别
...@@ -566,12 +700,10 @@ export default { ...@@ -566,12 +700,10 @@ export default {
title: '错误组别', title: '错误组别',
labers, labers,
list, list,
}; };
}, },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box-card { .box-card {
......
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
<Header v-if="!is_loading" :examination_questions="head_data" @btnClick="btnClick"></Header> <Header
v-if="!is_loading"
:examination_questions="head_data"
@btnClick="btnClick"
></Header>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<div> <div>
...@@ -18,19 +22,31 @@ ...@@ -18,19 +22,31 @@
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="8"> <el-col :span="8">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="result_section" v-if="result_section" @changeSelect="changeSelects"> <AnalyseModule
:module_data="result_section"
v-if="result_section"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="area_score" v-if="area_score" @changeSelect="changeSelects"> <AnalyseModule
:module_data="area_score"
v-if="area_score"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="province_score" v-if="province_score" @changeSelect="changeSelects"> <AnalyseModule
:module_data="province_score"
v-if="province_score"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
...@@ -38,14 +54,33 @@ ...@@ -38,14 +54,33 @@
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="8"> <el-col :span="8">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="breed_score" v-if="breed_score" @changeSelect="changeSelects"> <AnalyseModule
:module_data="breed_score"
v-if="breed_score"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="get_highes_lowestt_score_data" v-if="get_highes_lowestt_score_data" <AnalyseModule
@changeSelect="changeSelects"> :module_data="get_highes_lowestt_score_data"
v-if="get_highes_lowestt_score_data"
@changeSelect="changeSelects"
>
</AnalyseModule>
</div>
</el-col>
<!-- 学员得分 -->
<el-col :span="8">
<div class="centenr_container">
<AnalyseModule
:module_data="transcript_data"
v-if="transcript_data"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
...@@ -56,11 +91,9 @@ ...@@ -56,11 +91,9 @@
<div class="module_header"> <div class="module_header">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div> <div>易错、对等级分析</div>
易错、对等级分析
</div>
</el-col> </el-col>
<el-col :span="12" style="text-align: right;"> <el-col :span="12" style="text-align: right">
<el-checkbox v-model="request_params.is_top_data">{{ <el-checkbox v-model="request_params.is_top_data">{{
request_params.is_top_data ? '显示' : '隐藏' request_params.is_top_data ? '显示' : '隐藏'
}}</el-checkbox> }}</el-checkbox>
...@@ -71,22 +104,46 @@ ...@@ -71,22 +104,46 @@
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="12"> <el-col :span="12">
<div class="top_input_box" @keyup.enter="enterSearch"> <div class="top_input_box" @keyup.enter="enterSearch">
<el-input class="input_box" v-model="request_params.top.error_top"></el-input> <el-input
<el-input class="input_box" v-model="request_params.top.error_region_max"></el-input> class="input_box"
<el-input class="input_box" v-model="request_params.top.error_region_min"></el-input> v-model="request_params.top.error_top"
></el-input>
<el-input
class="input_box"
v-model="request_params.top.error_region_max"
></el-input>
<el-input
class="input_box"
v-model="request_params.top.error_region_min"
></el-input>
</div> </div>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_question_data" v-if="wrong_question_data"></AnalyseModule> <AnalyseModule
:module_data="wrong_question_data"
v-if="wrong_question_data"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="top_input_box" @keyup.enter="enterSearch"> <div class="top_input_box" @keyup.enter="enterSearch">
<el-input class="input_box" v-model="request_params.top.success_top"></el-input> <el-input
<el-input class="input_box" v-model="request_params.top.success_region_max"></el-input> class="input_box"
<el-input class="input_box" v-model="request_params.top.success_region_min"></el-input> v-model="request_params.top.success_top"
></el-input>
<el-input
class="input_box"
v-model="request_params.top.success_region_max"
></el-input>
<el-input
class="input_box"
v-model="request_params.top.success_region_min"
></el-input>
</div> </div>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="exactness_question_data" v-if="exactness_question_data"></AnalyseModule> <AnalyseModule
:module_data="exactness_question_data"
v-if="exactness_question_data"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -96,33 +153,56 @@ ...@@ -96,33 +153,56 @@
<div class="module_header">错误方向分析</div> <div class="module_header">错误方向分析</div>
<div> <div>
<el-row class="row_container"> <el-row class="row_container">
<el-col :span="12" class="unit_container"> <el-col
:span="12"
class="unit_container"
style="margin-top: 15px"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_position_data" v-if="wrong_position_data" <AnalyseModule
@changeSelect="changeSelects"></AnalyseModule> :module_data="wrong_position_data"
v-if="wrong_position_data"
@changeSelect="changeSelects"
></AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" class="unit_container"> <el-col :span="12" class="unit_container">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="error_level_data" v-if="error_level_data" @changeSelect="changeSelects"> <AnalyseModule
:module_data="error_level_data"
v-if="error_level_data"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" class="unit_container"> <el-col :span="12" class="unit_container">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_color_data" v-if="wrong_color_data" @changeSelect="changeSelects"> <AnalyseModule
:module_data="wrong_color_data"
v-if="wrong_color_data"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" class="unit_container"> <el-col :span="12" class="unit_container">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrongG_group_data" v-if="wrongG_group_data" @changeSelect="changeSelects"> <AnalyseModule
:module_data="wrongG_group_data"
v-if="wrongG_group_data"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<el-col :span="12" class="unit_container"> <el-col :span="12" class="unit_container">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="eye_stability_data" v-if="eye_stability_data"> <AnalyseModule
:module_data="eye_stability_data"
v-if="eye_stability_data"
@changeSelect="changeSelects"
>
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
...@@ -131,15 +211,18 @@ ...@@ -131,15 +211,18 @@
</div> </div>
<div> <div>
<div class="module_header">老师点评</div> <div class="module_header">老师点评</div>
<div style="padding: 0 10px;box-sizing: border-box;"> <div style="padding: 0 10px; box-sizing: border-box">
<el-input type="textarea" :rows="6" placeholder="请输入内容" v-model="request_params.found_remark"> <el-input
type="textarea"
:rows="6"
placeholder="请输入内容"
v-model="request_params.found_remark"
>
</el-input> </el-input>
</div> </div>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</template> </template>
...@@ -147,11 +230,9 @@ ...@@ -147,11 +230,9 @@
import Header from '@/components/ExaminationHeader/succinct.vue'; import Header from '@/components/ExaminationHeader/succinct.vue';
import AnalyseModule from '@/components/AnalyseModule/index.vue'; import AnalyseModule from '@/components/AnalyseModule/index.vue';
import { get_test_results_count, save_read_over_data } from '@/api/student'; import { get_test_results_count, save_read_over_data } from '@/api/student';
import { toPercent, countOccurrences } from '@/utils/tool'; import { toPercent, countOccurrences, keepTwoDecimal } from '@/utils/tool';
import { Level } from 'chalk'; import { Level } from 'chalk';
const standard_template = { const standard_template = {};
}
export default { export default {
data() { data() {
return { return {
...@@ -171,9 +252,10 @@ export default { ...@@ -171,9 +252,10 @@ export default {
text: '保存', text: '保存',
icon: 'el-icon-plus', icon: 'el-icon-plus',
event: 'save', event: 'save',
} },
], ],
}, },
//初始化请求参数 //初始化请求参数
request_params: { request_params: {
is_StudentStatistics: true, is_StudentStatistics: true,
...@@ -188,13 +270,9 @@ export default { ...@@ -188,13 +270,9 @@ export default {
is_WrongColor: true, is_WrongColor: true,
is_WrongGroup: true, is_WrongGroup: true,
is_EyeStability: true, is_EyeStability: true,
is_Transcript: true,
id: [14, 16], id: [14, 16],
ScoreScore: [ ScoreScore: ['100', '80', '70', '60'],
"100",
"80",
"70",
"60"
],
is_top: true, is_top: true,
top: { top: {
error_top: 10, error_top: 10,
...@@ -202,9 +280,9 @@ export default { ...@@ -202,9 +280,9 @@ export default {
error_region_min: 0, error_region_min: 0,
success_top: 10, success_top: 10,
success_region_max: 100, success_region_max: 100,
success_region_min: 10 success_region_min: 10,
}, },
found_remark: '' found_remark: '',
}, },
is_loading: false, is_loading: false,
...@@ -238,6 +316,8 @@ export default { ...@@ -238,6 +316,8 @@ export default {
wrong_color_data: null, wrong_color_data: null,
//错误组别 //错误组别
wrongG_group_data: null, wrongG_group_data: null,
//学员得分情况
transcript_data: null,
}; };
}, },
...@@ -247,10 +327,10 @@ export default { ...@@ -247,10 +327,10 @@ export default {
created() { created() {
let ids = localStorage.getItem('examination_questions_ids'); let ids = localStorage.getItem('examination_questions_ids');
console.log(ids); console.log(ids);
this.request_params.id = ids.split(","); this.request_params.id = ids.split(',');
}, },
mounted() { mounted() {
this.init() this.init();
}, },
destroyed() { destroyed() {
// localStorage.removeItem("examination_questions_ids"); // localStorage.removeItem("examination_questions_ids");
...@@ -264,43 +344,60 @@ export default { ...@@ -264,43 +344,60 @@ export default {
console.log(val); console.log(val);
//saveExaminationQuestions //saveExaminationQuestions
if (val == 'save') this.saveExaminationQuestions(); if (val == 'save') this.saveExaminationQuestions();
}, },
getListData() { getListData() {
let keys = ['result_section', 'area_score', 'province_score', 'breed_score', 'get_highes_lowestt_score_data', 'wrong_question_data', 'exactness_question_data', 'wrong_position_data', 'error_level_data', 'wrong_color_data', 'wrongG_group_data']; let keys = [
keys.forEach(element => { 'result_section',
'area_score',
'province_score',
'breed_score',
'get_highes_lowestt_score_data',
'wrong_question_data',
'exactness_question_data',
'wrong_position_data',
'error_level_data',
'wrong_color_data',
'wrongG_group_data',
'transcript_data',
];
keys.forEach((element) => {
this[element] = null; this[element] = null;
}); });
this.is_loading = true; this.is_loading = true;
get_test_results_count(this.request_params).then(res => { get_test_results_count(this.request_params).then((res) => {
console.log('统计数据'); console.log('统计数据');
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.result_section = this.changeScore(res.ScoreScore); //成绩分段
this.area_score = this.changeAreaScore(res.AreaScore);//南北方得分 this.area_score = this.changeAreaScore(res.AreaScore); //南北方得分
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.get_highes_lowestt_score_data = this.getHighesLowesttScore(res.getHighesLowesttScore); this.get_highes_lowestt_score_data = this.getHighesLowesttScore(
res.getHighesLowesttScore
);
// console.log('高低中位');
// console.log(res.getHighesLowesttScore);
//眼光稳定性 //眼光稳定性
this.eye_stability_data = this.changeEyeStability(res.EyeStability); this.eye_stability_data = this.changeEyeStability(res.EyeStability);
//对错题分析 //对错题分析
if (res.top_data) this.wrong_question_data = this.changeWrong(res.top_data.datadesc);//错题分析 if (res.top_data)
if (res.top_data) this.exactness_question_data = this.changeRight(res.top_data.dataasc);//对题分析 this.wrong_question_data = this.changeWrong(res.top_data.datadesc); //错题分析
this.wrong_position_data = this.changeWrongPosition(res.WrongPosition);//错误部位 if (res.top_data)
this.error_level_data = this.changeErrorLevel(res.ErrorLevel);//错误等级 this.exactness_question_data = this.changeRight(res.top_data.dataasc); //对题分析
this.wrong_color_data = this.changeWrongColor(res.WrongColor);//错误颜色 this.wrong_position_data = this.changeWrongPosition(res.WrongPosition); //错误部位
this.wrongG_group_data = this.changeWrongGroup(res.WrongGroup);//错误组别 this.error_level_data = this.changeErrorLevel(res.ErrorLevel); //错误等级
}) this.wrong_color_data = this.changeWrongColor(res.WrongColor); //错误颜色
this.wrongG_group_data = this.changeWrongGroup(res.WrongGroup); //错误组别
});
}, },
//百分比 //百分比
toPercent, toPercent,
//处理分段值 //处理分段值
changeScore(datas) { changeScore(datas) {
if (!datas) return false; if (!datas) return false;
...@@ -314,18 +411,19 @@ export default { ...@@ -314,18 +411,19 @@ export default {
let labers = [ let labers = [
{ label: '分类', key: 'classify' }, { label: '分类', key: 'classify' },
{ label: '分数段', key: 'score' }, { label: '分数段', key: 'score' },
{ label: '人数', key: 'people' }, { label: '人次', key: 'people' },
{ label: '占比', key: 'proportion' }, { label: '占比', key: 'proportion' },
]; ];
keys.forEach(element => { keys.forEach((element) => {
let scores = element.split('~'); let scores = element.split('~');
data.push(datas[element]); data.push(datas[element]);
let obj = { let obj = {
classify: element, classify: element,
score: scores[0], score: scores[0],
people: datas[element], people: datas[element],
proportion: this.toPercent(datas[element], num) proportion: this.toPercent(datas[element], num),
} sort_color: '#038d6e',
};
list.push(obj); list.push(obj);
}); });
return { return {
...@@ -338,8 +436,8 @@ export default { ...@@ -338,8 +436,8 @@ export default {
data, data,
is_show: { is_show: {
key: 'is_ScoreScore', key: 'is_ScoreScore',
value: this.request_params.is_ScoreScore value: this.request_params.is_ScoreScore,
} },
}; };
}, },
//南方烟北方烟得分情况 //南方烟北方烟得分情况
...@@ -347,12 +445,12 @@ export default { ...@@ -347,12 +445,12 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'bar_chart', chart_id: 'bar_chart',
color: '#E6A23C', color: '#E6A23C',
title: '南方北方烟得分情况', title: '南方北方烟得分情况',
...@@ -361,8 +459,8 @@ export default { ...@@ -361,8 +459,8 @@ export default {
raw_data: datas, raw_data: datas,
is_show: { is_show: {
key: 'is_AreaScore', key: 'is_AreaScore',
value: this.request_params.is_AreaScore value: this.request_params.is_AreaScore,
} },
// keys: ['南方', '北方', '西部'], // keys: ['南方', '北方', '西部'],
// raw_data: { // raw_data: {
// '南方': { // '南方': {
...@@ -388,12 +486,12 @@ export default { ...@@ -388,12 +486,12 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'province_bar_chart', chart_id: 'province_bar_chart',
color: '#505F79', color: '#505F79',
title: '省级产区得分情况', title: '省级产区得分情况',
...@@ -402,8 +500,8 @@ export default { ...@@ -402,8 +500,8 @@ export default {
raw_data: datas, raw_data: datas,
is_show: { is_show: {
key: 'is_ProvinceScore', key: 'is_ProvinceScore',
value: this.request_params.is_ProvinceScore value: this.request_params.is_ProvinceScore,
} },
}; };
}, },
//品种得分情况 //品种得分情况
...@@ -411,26 +509,53 @@ export default { ...@@ -411,26 +509,53 @@ export default {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let labers = [ let labers = [
{ label: '分数', key: 'ScoreScore' }, { label: '总题数', key: 'assemble' },
{ label: '总分', key: 'assemble' }, { label: '正确人次', key: 'success_man_time' },
{ label: '人数', key: 'student_num' }, { label: '错误人次', key: 'error_man_time' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'breed_bar_chart', chart_id: 'breed_bar_chart',
color: '#39c183f0', color: '#39c183f0',
title: '品种得分情况', title: '品种得分情况',
labers, labers,
keys, keys,
raw_data: datas, raw_data: datas,
is_show: { is_show: {
key: 'is_breedScore', key: 'is_breedScore',
value: this.request_params.is_breedScore value: this.request_params.is_breedScore,
} },
};
},
//学员得分情况
changeTranscript(datas) {
if (!datas) return false;
let labers = [
{ label: '姓名', key: 'name' },
{ label: '分数', key: 'score' },
];
let select_list = Object.keys(datas);
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
labers,
topic: select_list,
select_value: select_list[0],
// data: datas,
list: datas,
is_show: {
key: 'is_Transcript',
value: this.request_params.is_Transcript,
},
}; };
}, },
//最高分、最低分、平均分,中位数、众数、离散(变异系数) //最高分、最低分、平均分,中位数、众数、离散(变异系数)
getHighesLowesttScore(datas) { getHighesLowesttScore(datas) {
// console.log(datas);
if (!datas) return false; if (!datas) return false;
let labers = [ let labers = [
{ label: '最高成绩', key: 'max' }, { label: '最高成绩', key: 'max' },
...@@ -450,48 +575,42 @@ export default { ...@@ -450,48 +575,42 @@ export default {
data: datas, data: datas,
is_show: { is_show: {
key: 'is_getHighesLowesttScore', key: 'is_getHighesLowesttScore',
value: this.request_params.is_getHighesLowesttScore value: this.request_params.is_getHighesLowesttScore,
} },
} };
}, },
//眼光稳定性 //眼光稳定性
changeEyeStability(datas) { changeEyeStability(datas) {
// console.log(datas);
if (!datas) return false; if (!datas) return false;
let list = []; let list = [];
let labers = [ let labers = [
{ label: '题目', key: 'title' }, { label: '题目', key: 'title', width: '300' },
{ label: '区域', key: 'area' },
{ label: '答案', key: 'answer' }, { label: '答案', key: 'answer' },
{ label: '稳定性', key: 'stability' } { label: '稳定性', key: 'stability' },
]; ];
//处理稳定性数据 //处理稳定性数据
const changeStability = (items) => {
let all_num = items.exactness.length + items.wrong.length;
let Accuracy = toPercent(items.exactness.length, all_num);//准确率
return {
accuracy: { label: '正确率', value: Accuracy },
// exactness: { label: '正确数据', value: items.exactness },
wrong: { label: '错误数据', value: items.wrong },
}
};
datas.data.forEach((element, index) => { datas.data.forEach((element, index) => {
list.push({ list.push({
title: datas.title[index], title: datas.title[index],
answer: element.answer, answer: element.answer,
stability: changeStability(element) area: element.area,
stability: element.conclusion,
conclusion_table: element.conclusion_table,
}); });
}); });
return { return {
type: 'eye_stability_table', type: 'eye_stability_table',
chart_id: 'wrong_group', chart_id: 'wrong_group',
color: '#529B2E', color: '#E6A23C',
title: '眼光稳定性', title: '眼光稳定性',
labers, labers,
list, list,
is_show: { is_show: {
key: 'is_EyeStability', key: 'is_EyeStability',
value: this.request_params.is_EyeStability value: this.request_params.is_EyeStability,
} },
}; };
}, },
//易错/易对 等级分析 //易错/易对 等级分析
...@@ -503,15 +622,18 @@ export default { ...@@ -503,15 +622,18 @@ export default {
{ label: '题目', key: 'title' }, { label: '题目', key: 'title' },
{ label: '结果', key: 'result' }, { label: '结果', key: 'result' },
{ label: '错误率', key: 'errorRate' }, { label: '错误率', key: 'errorRate' },
{ label: '比率', key: 'ratio' },
{ label: '错误结果', key: 'distribute' }, { label: '错误结果', key: 'distribute' },
]; ];
// ratio: `${keepTwoDecimal(element.total - wrong_num / element.total)}`,
datas.forEach((element, index) => { datas.forEach((element, index) => {
list.push({ list.push({
index: index + 1, index: index + 1,
title: element.title, title: element.title,
result: element.result, result: element.result,
errorRate: `${element.errorRate}%`, errorRate: `${keepTwoDecimal(element.errorRate)}%`,
distribute: element.distribute ratio: `${element.wrong_num + '/' + element.total}`,
distribute: element.distribute,
}); });
}); });
return { return {
...@@ -523,12 +645,13 @@ export default { ...@@ -523,12 +645,13 @@ export default {
list, list,
// is_show: { // is_show: {
// key: 'is_top_data', // key: 'is_top_data',
// value: this.request_params.is_top_data // value: this.request_params.is_top_data,
// } // },
}; };
}, },
//易对题分析 //易对题分析
changeRight(datas) { changeRight(datas) {
// console.log(datas);
if (!datas) return false; if (!datas) return false;
let list = []; let list = [];
let labers = [ let labers = [
...@@ -536,13 +659,15 @@ export default { ...@@ -536,13 +659,15 @@ export default {
{ label: '题目', key: 'title' }, { label: '题目', key: 'title' },
{ label: '结果', key: 'result' }, { label: '结果', key: 'result' },
{ label: '正确率', key: 'errorRate' }, { label: '正确率', key: 'errorRate' },
{ label: '比率', key: 'ratio' },
]; ];
datas.forEach((element, index) => { datas.forEach((element, index) => {
list.push({ list.push({
index: index + 1, index: index + 1,
title: element.title, title: element.title,
result: element.result, result: element.result,
errorRate: `${100 - element.errorRate}%`, ratio: `${element.total - element.wrong_num + '/' + element.total}`,
errorRate: `${keepTwoDecimal(100 - element.errorRate)}%`,
}); });
}); });
return { return {
...@@ -551,7 +676,7 @@ export default { ...@@ -551,7 +676,7 @@ export default {
color: '#529B2E', color: '#529B2E',
title: '易对题分析', title: '易对题分析',
labers, labers,
list list,
}; };
}, },
//错误部位 //错误部位
...@@ -560,7 +685,7 @@ export default { ...@@ -560,7 +685,7 @@ export default {
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '部位', key: 'position' }, { label: '题目', key: 'position' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错题数量', key: 'wrong_num' },
{ label: '错误答案内容', key: 'distribute' }, { label: '错误答案内容', key: 'distribute' },
...@@ -582,8 +707,8 @@ export default { ...@@ -582,8 +707,8 @@ export default {
list, list,
is_show: { is_show: {
key: 'is_WrongPosition', key: 'is_WrongPosition',
value: this.request_params.is_WrongPosition value: this.request_params.is_WrongPosition,
} },
}; };
}, },
//错误等级 //错误等级
...@@ -592,7 +717,7 @@ export default { ...@@ -592,7 +717,7 @@ export default {
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '等级', key: 'level' }, { label: '题目', key: 'level' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错题数量', key: 'wrong_num' },
{ label: '错误答案内容', key: 'distribute' }, { label: '错误答案内容', key: 'distribute' },
...@@ -614,8 +739,8 @@ export default { ...@@ -614,8 +739,8 @@ export default {
list, list,
is_show: { is_show: {
key: 'is_ErrorLevel', key: 'is_ErrorLevel',
value: this.request_params.is_ErrorLevel value: this.request_params.is_ErrorLevel,
} },
}; };
}, },
//错误颜色 //错误颜色
...@@ -624,7 +749,7 @@ export default { ...@@ -624,7 +749,7 @@ export default {
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '颜色', key: 'color' }, { label: '题目', key: 'color' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错题数量', key: 'wrong_num' },
{ label: '错误答案内容', key: 'distribute' }, { label: '错误答案内容', key: 'distribute' },
...@@ -646,8 +771,8 @@ export default { ...@@ -646,8 +771,8 @@ export default {
list, list,
is_show: { is_show: {
key: 'is_WrongColor', key: 'is_WrongColor',
value: this.request_params.is_WrongColor value: this.request_params.is_WrongColor,
} },
}; };
}, },
//错误组别 //错误组别
...@@ -656,7 +781,7 @@ export default { ...@@ -656,7 +781,7 @@ export default {
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '组别', key: 'group' }, { label: '题目', key: 'group' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错题数量', key: 'wrong_num' },
{ label: '错误答案内容', key: 'distribute' }, { label: '错误答案内容', key: 'distribute' },
...@@ -678,12 +803,11 @@ export default { ...@@ -678,12 +803,11 @@ export default {
list, list,
is_show: { is_show: {
key: 'is_WrongGroup', key: 'is_WrongGroup',
value: this.request_params.is_WrongGroup value: this.request_params.is_WrongGroup,
} },
}; };
}, },
//过滤 //过滤
enterSearch(event) { enterSearch(event) {
console.log('触发回车'); console.log('触发回车');
...@@ -694,13 +818,13 @@ export default { ...@@ -694,13 +818,13 @@ export default {
//保存 //保存
saveExaminationQuestions() { saveExaminationQuestions() {
let params = this.$removeProperty(this.request_params); let params = this.$removeProperty(this.request_params);
save_read_over_data(params).then(res => { save_read_over_data(params).then((res) => {
console.log('保存回调'); console.log('保存回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
} }
}) });
}, },
//是否显示模块 //是否显示模块
...@@ -708,8 +832,7 @@ export default { ...@@ -708,8 +832,7 @@ export default {
this.request_params[val.key] = val.value; this.request_params[val.key] = val.value;
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.centenr_container { .centenr_container {
......
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-11 19:40:37
*/
</script>
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card" style="margin-bottom: 10px;"> <el-card class="box-card" style="margin-bottom: 10px">
<examination-header :examination_questions="student_brief_introduction" <examination-header
:key="new Date().getTime()"></examination-header> :examination_questions="student_brief_introduction"
:key="new Date().getTime()"
></examination-header>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick" <table-head
@upload="uploadTestQuestions"></table-head> :head_data="head_data"
@search="searchEvent"
@resetting="resetting"
@btnClick="btnClick"
@upload="uploadTestQuestions"
></table-head>
<!-- <div> <!-- <div>
<el-button v-for="(item, index) in head_data.right_buttons" :key="index" type="primary" :icon="item.icon" <el-button v-for="(item, index) in head_data.right_buttons" :key="index" type="primary" :icon="item.icon"
@click="resetting(item.event)"> @click="resetting(item.event)">
...@@ -16,7 +30,12 @@ ...@@ -16,7 +30,12 @@
</el-button> </el-button>
</div> --> </div> -->
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="table_list" style="width: 100%;margin-bottom: 20px;" height="500"> <el-table
v-loading="is_loading"
:data="table_list"
style="width: 100%; margin-bottom: 20px"
height="500"
>
<el-table-column prop="id" label="编号" width="50"> <el-table-column prop="id" label="编号" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
...@@ -28,28 +47,54 @@ ...@@ -28,28 +47,54 @@
</el-table-column> </el-table-column>
<el-table-column prop="place_of_production" label="生产地点"> <el-table-column prop="place_of_production" label="生产地点">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.area }}.{{ scope.row.place_of_production }}</div> <div>
{{ scope.row.area }}.{{ scope.row.place_of_production }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="path" label="烟叶实物"> <el-table-column prop="path" label="烟叶实物">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<div class="amplify_img_box"> <div class="amplify_img_box">
<img :src="IP + scope.row.image + '?key=' + new Date().getTime()" alt=""> <img
:src="
IP + scope.row.image + '?key=' + new Date().getTime()
"
alt=""
/>
</div> </div>
<img class="small_picture" slot="reference" :src="IP + scope.row.image + '?key=' + new Date().getTime()" <img
alt=""> class="small_picture"
slot="reference"
:src="IP + scope.row.image + '?key=' + new Date().getTime()"
alt=""
/>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="quote" label="是否引用" align="center">
<template slot-scope="scope">
{{ scope.row.examination_question_detail_id ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="created_at" label="创建时间"> <el-table-column prop="created_at" label="创建时间">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" style="color: #000;" <el-button
@click="updateInformation(scope.$index, scope.row)">编辑</el-button> size="mini"
<el-button size="mini" type="text" style="color: #F56C6C;" type="text"
@click="deleteInformation(scope.row)">删除</el-button> style="color: #000"
@click="updateInformation(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
style="color: #f56c6c"
@click="deleteInformation(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -57,14 +102,26 @@ ...@@ -57,14 +102,26 @@
</el-card> </el-card>
</div> </div>
<el-dialog :title="is_updata_type == 'add' ? '新增' : '修改'" :visible.sync="is_dialogVisible" width="60%" <el-dialog
:before-close="handleClose"> :title="is_updata_type == 'add' ? '新增' : '修改'"
:visible.sync="is_dialogVisible"
width="60%"
:before-close="handleClose"
>
<div> <div>
<table-moudel v-if="is_dialogVisible && province_data != {}" ref="detail_info" :table_data="detailed_information" <table-moudel
:position_datas="position_data" :province_datas="province_data" :tobacco_all_lists="tobacco_all_lists" v-if="is_dialogVisible && province_data != {}"
:tobacco_grades_all_lists="tobacco_grades_all_lists" :is_updata_type="is_updata_type" ref="detail_info"
:examination_questions_all_lists="examination_questions_all_list" :key="new Date().getTime()"></table-moudel> :table_data="detailed_information"
<div v-else style="text-align: center;"> :position_datas="position_data"
:province_datas="province_data"
:tobacco_all_lists="tobacco_all_lists"
:tobacco_grades_all_lists="tobacco_grades_all_lists"
:is_updata_type="is_updata_type"
:examination_questions_all_lists="examination_questions_all_list"
:key="new Date().getTime()"
></table-moudel>
<div v-else style="text-align: center">
<p><i class="el-icon-loading"></i></p> <p><i class="el-icon-loading"></i></p>
<p>加载中...,请关闭弹框重新打开</p> <p>加载中...,请关闭弹框重新打开</p>
</div> </div>
...@@ -74,12 +131,24 @@ ...@@ -74,12 +131,24 @@
<el-button type="primary" @click="submitData">确 定</el-button> <el-button type="primary" @click="submitData">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="图片批量上传" :visible.sync="is_picture_upload" width="60%" :before-close="handleClosePicture"> <el-dialog
title="图片批量上传"
:visible.sync="is_picture_upload"
width="60%"
:before-close="handleClosePicture"
>
<div class="upload_picture_container"> <div class="upload_picture_container">
<el-upload action="#" multiple accept="image/png,image/jpeg,image/jpg" :auto-upload="false" <el-upload
:on-change="seletePicture"> action="#"
multiple
accept="image/png,image/jpeg,image/jpg"
:auto-upload="false"
:on-change="seletePicture"
>
<el-button size="small" type="primary">点击选择</el-button> <el-button size="small" type="primary">点击选择</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> <div slot="tip" class="el-upload__tip">
只能上传jpg/png文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -94,29 +163,43 @@ ...@@ -94,29 +163,43 @@
import ExaminationHeader from '@/components/ExaminationHeader/index'; import ExaminationHeader from '@/components/ExaminationHeader/index';
import TableHead from '@/components/TableHead/index'; import TableHead from '@/components/TableHead/index';
import TableMoudel from '../components/TableMoudel.vue'; import TableMoudel from '../components/TableMoudel.vue';
import { get_examination_questions_detail, get_province_list, get_tobacco_all_info, upload_examination_question_image, get_tobacco_grades_all, add_examination_question_detail, delete_examination_question_detail, updata_examination_question_detail, examination_question_detail_upload, get_tobacco_province, batch_upload_of_pictures, get_image_path, get_examination_questions_all } from '@/api/student'; import {
get_examination_questions_detail,
get_province_list,
get_tobacco_all_info,
upload_examination_question_image,
get_tobacco_grades_all,
add_examination_question_detail,
delete_examination_question_detail,
updata_examination_question_detail,
examination_question_detail_upload,
get_tobacco_province,
batch_upload_of_pictures,
get_image_path,
get_examination_questions_all,
create_answer_card,
} from '@/api/student';
import { exportText } from '@/utils/tool'; import { exportText } from '@/utils/tool';
const standard_template = { const standard_template = {
area: "南方", area: '南方',
fraction: 1, fraction: 1,
province_id: "70000", province_id: '70000',
breed_name: "中烟100", breed_name: '中烟100',
grades_code: "C2F", grades_code: 'C2F',
explain_in_detail: "", explain_in_detail: '',
image: "", image: '',
examination_questions_id: null, examination_questions_id: null,
examination_question_detail_id: null,//关联试题id examination_question_detail_id: null, //关联试题id
} };
export default { export default {
data() { data() {
return { return {
IP: process.env.VUE_APP_BASE_API, IP: process.env.VUE_APP_BASE_API,
examination_questions_id: null,//试题id examination_questions_id: null, //试题id
//头部按钮 //头部按钮
head_data: { head_data: {
is_search_show: false, is_search_show: false,
search_placeholder: "学员姓名/手机号", search_placeholder: '学员姓名/手机号',
right_buttons: [ right_buttons: [
{ {
text: '模板下载', text: '模板下载',
...@@ -128,6 +211,11 @@ export default { ...@@ -128,6 +211,11 @@ export default {
icon: 'el-icon-upload2', icon: 'el-icon-upload2',
event: 'examination_questions_upload', event: 'examination_questions_upload',
}, },
{
text: '试题下载',
icon: 'el-icon-download',
event: 'examination_download',
},
{ {
text: '图片批量上传', text: '图片批量上传',
icon: 'el-icon-upload2', icon: 'el-icon-upload2',
...@@ -137,7 +225,7 @@ export default { ...@@ -137,7 +225,7 @@ export default {
text: '新增', text: '新增',
icon: 'el-icon-document-add', icon: 'el-icon-document-add',
event: 'add', event: 'add',
} },
], ],
}, },
//初始化请求参数 //初始化请求参数
...@@ -148,6 +236,7 @@ export default { ...@@ -148,6 +236,7 @@ export default {
total: null, total: null,
}, },
is_loading: false, is_loading: false,
is_upload_loading: false,
tableData: [], tableData: [],
is_dialogVisible: false, is_dialogVisible: false,
is_picture_upload: false, is_picture_upload: false,
...@@ -184,7 +273,7 @@ export default { ...@@ -184,7 +273,7 @@ export default {
this.examination_questions_id = this.$route.query.id; this.examination_questions_id = this.$route.query.id;
}, },
mounted() { mounted() {
this.init() this.init();
}, },
methods: { methods: {
...@@ -193,7 +282,6 @@ export default { ...@@ -193,7 +282,6 @@ export default {
return `${this.IP}/api/examination_question_detail/uploadimage/${this.examination_questions_id}`; return `${this.IP}/api/examination_question_detail/uploadimage/${this.examination_questions_id}`;
}, },
searchEvent(val) { searchEvent(val) {
console.log('搜索'); console.log('搜索');
console.log(val); console.log(val);
...@@ -213,6 +301,7 @@ export default { ...@@ -213,6 +301,7 @@ export default {
if (val == 'template_download') this.templateDownload(); if (val == 'template_download') this.templateDownload();
/* pictureBatchUpload */ /* pictureBatchUpload */
if (val == 'batch_upload') this.pictureBatchUpload(); if (val == 'batch_upload') this.pictureBatchUpload();
if (val == 'examination_download') this.createAnswerCard();
}, },
init() { init() {
...@@ -229,7 +318,7 @@ export default { ...@@ -229,7 +318,7 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
}, },
handleClosePicture() { handleClosePicture() {
this.is_picture_upload = false this.is_picture_upload = false;
}, },
//提交 //提交
submitData() { submitData() {
...@@ -237,7 +326,7 @@ export default { ...@@ -237,7 +326,7 @@ export default {
data['examination_questions_id'] = this.examination_questions_id; data['examination_questions_id'] = this.examination_questions_id;
let params = this.$handleParams(data); let params = this.$handleParams(data);
if (this.is_updata_type == 'add') { if (this.is_updata_type == 'add') {
add_examination_question_detail(params).then(res => { add_examination_question_detail(params).then((res) => {
console.log('新增试题详情'); console.log('新增试题详情');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -245,10 +334,10 @@ export default { ...@@ -245,10 +334,10 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getExaminationQuestionsDetail(); this.getExaminationQuestionsDetail();
} }
}) });
} else { } else {
let id = this.detailed_information.id; let id = this.detailed_information.id;
updata_examination_question_detail(id, params).then(res => { updata_examination_question_detail(id, params).then((res) => {
console.log('修改试题详情'); console.log('修改试题详情');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -256,26 +345,32 @@ export default { ...@@ -256,26 +345,32 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getExaminationQuestionsDetail(); this.getExaminationQuestionsDetail();
} }
}) });
} }
}, },
//获取全套试题 //获取全套试题
getExaminationQuestionsAll() { getExaminationQuestionsAll() {
this.examination_questions_all_list = []; this.examination_questions_all_list = [];
get_examination_questions_all().then(res => { get_examination_questions_all().then((res) => {
// console.log('获取全套试题'); // console.log('获取全套试题');
// console.log(res); // console.log(res);
if (res.length) { if (res.length) {
res.forEach(element => { res.forEach((element) => {
this.examination_questions_all_list.push({ value: element.id, label: element.title, children: [], }) this.examination_questions_all_list.push({
value: element.id,
label: element.title,
children: [],
});
}); });
} }
}) });
}, },
//获取详情 //获取详情
getExaminationQuestionsDetail() { getExaminationQuestionsDetail() {
this.is_loading = true; this.is_loading = true;
get_examination_questions_detail(this.examination_questions_id, { val: this.request_params.val }).then(res => { get_examination_questions_detail(this.examination_questions_id, {
val: this.request_params.val,
}).then((res) => {
console.log('详情'); console.log('详情');
console.log(res); console.log(res);
this.table_list = [...res.examination_question_detail]; this.table_list = [...res.examination_question_detail];
...@@ -284,18 +379,19 @@ export default { ...@@ -284,18 +379,19 @@ export default {
this.student_brief_introduction.creat_user_name = res.user.name; this.student_brief_introduction.creat_user_name = res.user.name;
this.student_brief_introduction.duration = res.duration; this.student_brief_introduction.duration = res.duration;
this.student_brief_introduction.begin_date = res.begin_date; this.student_brief_introduction.begin_date = res.begin_date;
this.student_brief_introduction.test_number = res.examination_question_detail.length; this.student_brief_introduction.test_number =
res.examination_question_detail.length;
this.is_loading = false; this.is_loading = false;
}) });
}, },
//获取方位 //获取方位
getTobaccoProvince() { getTobaccoProvince() {
get_tobacco_province().then(res => { get_tobacco_province().then((res) => {
this.position_data = res || []; this.position_data = res || [];
for (let i in res) { for (let i in res) {
this.getProvinceList(res[i].name) this.getProvinceList(res[i].name);
} }
}) });
}, },
//获取省市区列表 //获取省市区列表
getProvinceList(val) { getProvinceList(val) {
...@@ -306,13 +402,13 @@ export default { ...@@ -306,13 +402,13 @@ export default {
if (list[i].children.length == 0) { if (list[i].children.length == 0) {
delete list[i].children; delete list[i].children;
} else { } else {
removeNodeInTree(list[i].children) removeNodeInTree(list[i].children);
} }
} }
return list return list;
} };
/* { name_is_value: true } 获取汉字值的列表 */ /* { name_is_value: true } 获取汉字值的列表 */
get_province_list({ area: val }).then(res => { get_province_list({ area: val }).then((res) => {
this.province_data[val] = removeNodeInTree(res); this.province_data[val] = removeNodeInTree(res);
// if (res.length) { // if (res.length) {
// // this.province_list = removeNodeInTree(res); // // this.province_list = removeNodeInTree(res);
...@@ -321,20 +417,19 @@ export default { ...@@ -321,20 +417,19 @@ export default {
// // this.province_list = []; // // this.province_list = [];
// this.province_data[val] = []; // this.province_data[val] = [];
// } // }
}) });
}, },
//获取全部烟草等级 //获取全部烟草等级
getTobaccoAll() { getTobaccoAll() {
get_tobacco_all_info().then(res => { get_tobacco_all_info().then((res) => {
this.tobacco_all_lists = res || []; this.tobacco_all_lists = res || [];
}) });
}, },
//获取全部烟草等级 //获取全部烟草等级
getTobaccoGradesAll() { getTobaccoGradesAll() {
get_tobacco_grades_all().then(res => { get_tobacco_grades_all().then((res) => {
this.tobacco_grades_all_lists = res || []; this.tobacco_grades_all_lists = res || [];
}) });
}, },
//新增信息 //新增信息
...@@ -346,12 +441,12 @@ export default { ...@@ -346,12 +441,12 @@ export default {
this.detailed_information = { ...standard_template }; this.detailed_information = { ...standard_template };
this.detailed_information['question_no'] = this.table_list.length + 1; this.detailed_information['question_no'] = this.table_list.length + 1;
//获取当前试题配置图片 //获取当前试题配置图片
get_image_path(this.examination_questions_id).then(res => { get_image_path(this.examination_questions_id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.detailed_information['image'] = res.message || '/'; this.detailed_information['image'] = res.message || '/';
this.is_dialogVisible = true; this.is_dialogVisible = true;
} }
}) });
} else { } else {
const h = this.$createElement; const h = this.$createElement;
this.$notify({ this.$notify({
...@@ -361,7 +456,6 @@ export default { ...@@ -361,7 +456,6 @@ export default {
duration: 1000, duration: 1000,
}); });
} }
}, },
//修改信息 //修改信息
updateInformation(index, item) { updateInformation(index, item) {
...@@ -371,11 +465,33 @@ export default { ...@@ -371,11 +465,33 @@ export default {
console.log(item); console.log(item);
//获取详情 //获取详情
if (Object.keys(this.province_data).length == 3) { if (Object.keys(this.province_data).length == 3) {
let { id, area, fraction, province_id, breed_name, grades_code, explain_in_detail, image, examination_questions_id, examination_question_detail_id } = { ...item }; let {
this.detailed_information = { id, area, fraction, province_id, breed_name, grades_code, explain_in_detail, image }; id,
area,
fraction,
province_id,
breed_name,
grades_code,
explain_in_detail,
image,
examination_questions_id,
examination_question_detail_id,
} = { ...item };
this.detailed_information = {
id,
area,
fraction,
province_id,
breed_name,
grades_code,
explain_in_detail,
image,
};
if (item.quote) { if (item.quote) {
this.detailed_information['examination_questions_id'] = item.quote.examination_questions_id; this.detailed_information['examination_questions_id'] =
this.detailed_information['examination_question_detail_id'] = item.quote.id; item.quote.examination_questions_id;
this.detailed_information['examination_question_detail_id'] =
item.quote.id;
} else { } else {
this.detailed_information['examination_questions_id'] = null; this.detailed_information['examination_questions_id'] = null;
this.detailed_information['examination_question_detail_id'] = null; this.detailed_information['examination_question_detail_id'] = null;
...@@ -398,18 +514,20 @@ export default { ...@@ -398,18 +514,20 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
delete_examination_question_detail(id).then(res => { .then(() => {
delete_examination_question_detail(id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.init(); this.init();
} }
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除',
}); });
}); });
}, },
...@@ -418,22 +536,42 @@ export default { ...@@ -418,22 +536,42 @@ export default {
let url = `${this.IP}/php_sours/tmpDoc/setThemeCard.docx`; let url = `${this.IP}/php_sours/tmpDoc/setThemeCard.docx`;
exportText(url, '模板.docx'); exportText(url, '模板.docx');
}, },
//试题下载
createAnswerCard() {
let id = this.examination_questions_id;
create_answer_card(id).then((res) => {
console.log('下载答题卡回调');
console.log(res);
if (res.code == 200) {
let s = res.message.split('=');
let name = s[s.length - 1];
let url = `${this.IP}${res.message}`;
exportText(url, name);
}
});
},
//试题上传 //试题上传
uploadTestQuestions(val) { uploadTestQuestions(val) {
this.is_loading = true;
console.log('试题上传'); console.log('试题上传');
console.log(val); console.log(val);
const formData = new FormData(); const formData = new FormData();
formData.append('file', val.file) formData.append('file', val.file);
let id = this.examination_questions_id; let id = this.examination_questions_id;
examination_question_detail_upload(id, formData).then(res => { examination_question_detail_upload(id, formData)
.then((res) => {
console.log('试题上传'); console.log('试题上传');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.is_loading = false;
this.$message.success(res.message); this.$message.success(res.message);
this.getExaminationQuestionsDetail(); this.getExaminationQuestionsDetail();
} }
}) })
.catch((err) => {
this.is_loading = false;
});
}, },
//图片批量上传 //图片批量上传
...@@ -442,29 +580,32 @@ export default { ...@@ -442,29 +580,32 @@ export default {
}, },
//选择文件监听 //选择文件监听
seletePicture(file, fileList) { seletePicture(file, fileList) {
this.picture_file_list = fileList this.picture_file_list = fileList;
}, },
//图片提交 //图片提交
subMitPictureList() { subMitPictureList() {
console.log('当前文件列表'); console.log('当前文件列表');
console.log(this.picture_file_list); console.log(this.picture_file_list);
let formData = new FormData(); let formData = new FormData();
this.picture_file_list.forEach(element => { this.picture_file_list.forEach((element) => {
formData.append('image[]', element.raw); formData.append('image[]', element.raw);
}); });
setTimeout(() => { setTimeout(() => {
batch_upload_of_pictures(this.examination_questions_id, '', formData).then(res => { batch_upload_of_pictures(
this.examination_questions_id,
'',
formData
).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.is_picture_upload = false; this.is_picture_upload = false;
this.getExaminationQuestionsDetail(); this.getExaminationQuestionsDetail();
} }
}) });
}, 300); }, 300);
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.small_picture { .small_picture {
......
<script>
/**
* @Author: AnthonyD
* @Date: 2023-04-10 18:06:52
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-15 15:59:31
*/
</script>
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
<table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick"></table-head> <add-features
:head_data="head_data"
@search="searchEvent"
@resetting="resetting"
@btnClick="btnClick"
@deleteSelectData="deleteSelectData"
></add-features>
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="650" <el-table
@selection-change="handleSelectionChange"> ref="multipleTable"
<el-table-column type="selection" width="55"></el-table-column> v-loading="is_loading"
:data="tableData"
style="width: 100%; margin-bottom: 20px"
height="650"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<!-- <el-table-column prop="id" label="编号" width="50">
<template slot="header">
<el-checkbox
:indeterminate="isIndeterminate"
v-model="is_select_all"
@change="select_all_fun" ></el-checkbox>
</template>
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.is_select"
@change="handleSelectionChange"
></el-checkbox>
</template>
</el-table-column> -->
<el-table-column prop="id" label="编号" width="50"> <el-table-column prop="id" label="编号" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="title" label="考试标题"> <el-table-column prop="title" label="考试标题">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-document" style="color: #005FC2;" <el-popover trigger="hover" placement="top">
@click="commentJump(scope.row)">{{ scope.row.title <p>{{ scope.row.title }}</p>
}}</el-button> <div slot="reference" class="title_wrapper">
<el-button
size="mini"
type="text"
icon="el-icon-document"
style="color: #005fc2"
@click="commentJump(scope.row)"
>{{ scope.row.title }}</el-button
>
</div>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remarks" label="考试提示"> <el-table-column prop="remarks" label="考试提示">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="remark_box" :title="scope.row.opening_tip">{{ scope.row.opening_tip }}</div> <div class="remark_box" :title="scope.row.opening_tip">
{{ scope.row.opening_tip }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="begin_date" label="考试时间"> <el-table-column prop="type" label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.begin_date }}</div> <div>{{ scope.row.type }}</div>
</template>
</el-table-column>
<el-table-column
prop="begin_date"
label="开始时间~结束时间"
width="150"
>
<template slot-scope="scope">
<div>{{ scope.row.begin_date }}{{ scope.row.end_date }}</div>
</template>
</el-table-column>
<el-table-column v-if="false" prop="end_date" label="结束时间">
<template slot-scope="scope">
<div>{{ scope.row.end_date }}</div>
</template>
</el-table-column>
<el-table-column prop="place" label="区域">
<template slot-scope="scope">
<div>{{ scope.row.place }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="duration" label="考试时长" width="100"> <el-table-column prop="duration" label="考试时长" width="100">
...@@ -37,67 +102,144 @@ ...@@ -37,67 +102,144 @@
<el-table-column prop="status" label="状态" width="100"> <el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-tag v-if="scope.row.status == 1" type="info">未发布</el-tag> <el-tag v-if="scope.row.status == 1" type="info"
<el-tag v-if="scope.row.status == 2" type="success">已发布</el-tag> >未发布</el-tag
<el-tag v-if="scope.row.status == 3" type="success">开始考试</el-tag> >
<el-tag v-if="scope.row.status == 4" type="success">考试完成</el-tag> <el-tag v-if="scope.row.status == 2" type="success"
<el-tag v-if="scope.row.status == 5" type="success">已点评</el-tag> >已发布</el-tag
<el-tag v-if="scope.row.status == 6" type="danger">停止使用</el-tag> >
<el-tag v-if="scope.row.status == 3" type="success"
>开始考试</el-tag
>
<el-tag v-if="scope.row.status == 4" type="success"
>考试完成</el-tag
>
<el-tag v-if="scope.row.status == 5" type="success"
>已点评</el-tag
>
<el-tag v-if="scope.row.status == 6" type="danger"
>停止使用</el-tag
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260"> <el-table-column label="操作" width="260">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" style="color: #000;" v-if="scope.row.status != '6'" <el-button
@click="updateInformation(scope.row)">修改</el-button> size="mini"
<el-button size="mini" type="text" style="color: #000;" title="试题复制" type="text"
@click="examinationQuestionsCopy(scope.row)">复制</el-button> style="color: #000"
<el-button v-if="scope.row.status != '6'" size="mini" type="text" style="color: #000;margin-right: 15px;" v-if="scope.row.status != '6'"
@click="createAnswerCard(scope.row)" title="生成答题卡">下载</el-button> @click="updateInformation(scope.row)"
>修改</el-button
>
<el-button
size="mini"
type="text"
style="color: #000"
title="试题复制"
@click="examinationQuestionsCopy(scope.row)"
>复制</el-button
>
<div v-if="false">
<el-button
v-if="scope.row.status != '6'"
size="mini"
type="text"
style="color: #000; margin-right: 15px"
@click="createAnswerCard(scope.row)"
title="生成答题卡"
>下载</el-button
>
</div>
<el-popover placement="right" width="160"> <el-popover placement="right" width="160">
<div> <div>
<el-radio-group v-model="status_params.status"> <el-radio-group v-model="status_params.status">
<el-radio label="1" style="margin: 5px 0;">试题配置中</el-radio> <el-radio label="1" style="margin: 5px 0"
<el-radio label="2" style="margin: 5px 0;">试题配置完成</el-radio> >试题配置中</el-radio
<el-radio label="3" style="margin: 5px 0;">开始考试</el-radio> >
<el-radio label="4" style="margin: 5px 0;">考试完成</el-radio> <el-radio label="2" style="margin: 5px 0"
<el-radio label="5" style="margin: 5px 0;">已点评</el-radio> >试题配置完成</el-radio
<el-radio label="6" style="margin: 5px 0;">停止使用</el-radio> >
<el-radio label="3" style="margin: 5px 0"
>开始考试</el-radio
>
<el-radio label="4" style="margin: 5px 0"
>考试完成</el-radio
>
<el-radio label="5" style="margin: 5px 0"
>已点评</el-radio
>
<el-radio label="6" style="margin: 5px 0"
>停止使用</el-radio
>
</el-radio-group> </el-radio-group>
</div> </div>
<div style="text-align: right; margin: 0"> <div style="text-align: right; margin: 0">
<el-button type="primary" size="mini" @click="updataExaminationQuestionsStatus">确定</el-button> <el-button
type="primary"
size="mini"
@click="updataExaminationQuestionsStatus"
>确定</el-button
>
</div> </div>
<el-button slot="reference" type="text" size="mini" @click="setStatusParams(scope.row)">设置状态</el-button> <el-button
slot="reference"
type="text"
size="mini"
style="margin-left: 15px"
@click="setStatusParams(scope.row)"
>设置状态</el-button
>
</el-popover> </el-popover>
<el-button type="text" size="mini" style="color: #000;margin-left: 15px;" <el-button
@click="comment(scope.row)">批阅</el-button> type="text"
size="mini"
style="color: #000; margin-left: 15px"
@click="comment(scope.row)"
>批阅</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="text-align: right;"> <div style="text-align: right">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page" <el-pagination
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total"> @current-change="handleCurrentChange"
:current-page.sync="request_params.page"
:page-size="request_params.limit"
layout="total, prev, pager, next"
:total="request_params.total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</div> </div>
<el-dialog :title="is_updata_type == 'add' ? '新增考试' : '修改考试'" :visible.sync="is_dialogVisible" width="900px" <el-dialog
:before-close="handleClose"> :title="is_updata_type == 'add' ? '新增考试' : '修改考试'"
:visible.sync="is_dialogVisible"
width="900px"
:before-close="handleClose"
>
<div> <div>
<el-form label-width="100px"> <el-form label-width="100px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考试标题"> <el-form-item label="考试标题">
<el-input v-model="detailed_information.title" placeholder="考试标题"></el-input> <el-input
v-model="detailed_information.title"
placeholder="考试标题"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="烟叶类型"> <el-form-item label="烟叶类型">
<el-select v-model="detailed_information.type" placeholder="请选择"> <el-select
v-model="detailed_information.type"
placeholder="请选择"
>
<el-option :label="'把烟'" :value="'把烟'"></el-option> <el-option :label="'把烟'" :value="'把烟'"></el-option>
<el-option :label="'片烟'" :value="'片烟'"></el-option> <el-option :label="'片烟'" :value="'片烟'"></el-option>
<el-option :label="'甩把'" :value="'甩把'"></el-option> <el-option :label="'甩把'" :value="'甩把'"></el-option>
...@@ -108,46 +250,79 @@ ...@@ -108,46 +250,79 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="开始时间"> <el-form-item label="开始时间">
<el-date-picker v-model="detailed_information.begin_date" type="datetime" placeholder="选择日期时间"> <el-date-picker
v-model="detailed_information.begin_date"
type="datetime"
placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="结束时间"> <el-form-item label="结束时间">
<el-date-picker v-model="detailed_information.end_date" type="datetime" placeholder="选择日期时间"> <el-date-picker
v-model="detailed_information.end_date"
type="datetime"
placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="区域信息">
<el-input
v-model="detailed_information.place"
placeholder="区域信息"
></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考试时长"> <el-form-item label="考试时长">
<el-input v-model="detailed_information.duration" placeholder="考试时长" type="number" :min="30"> <el-input
v-model="detailed_information.duration"
placeholder="考试时长"
type="number"
:min="30"
>
<template slot="append">分钟</template> <template slot="append">分钟</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考试人数上限"> <el-form-item label="考试人数上限">
<el-input v-model="detailed_information.examiners_max" placeholder="考试人数上限" type="number" <el-input
:min="1"></el-input> v-model="detailed_information.examiners_max"
placeholder="考试人数上限"
type="number"
:min="1"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="考试提示"> <el-form-item label="考试提示">
<el-input v-model="detailed_information.opening_tip" placeholder="考试提示" type="textarea" <el-input
:rows="2"></el-input> v-model="detailed_information.opening_tip"
placeholder="考试提示"
type="textarea"
:rows="2"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="试题备注"> <el-form-item label="试题备注">
<el-input v-model="detailed_information.remarks" placeholder="试题备注" type="textarea" :rows="2"></el-input> <el-input
v-model="detailed_information.remarks"
placeholder="试题备注"
type="textarea"
:rows="2"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -156,28 +331,56 @@ ...@@ -156,28 +331,56 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="预约" :visible.sync="is_reservation" width="60%" :before-close="reservationClose"> <el-dialog
title="预约"
:visible.sync="is_reservation"
width="60%"
:before-close="reservationClose"
>
<div> <div>
<el-form label-width="100px" v-if="is_reservation"> <el-form label-width="100px" v-if="is_reservation">
<el-form-item label="选择试题"> <el-form-item label="选择试题">
<el-select v-model="reservation_info.examination_questions_id" placeholder="请选择" style="width: 300px;"> <el-select
<el-option v-for="item in examination_questions_all_list" :key="item.id" :label="item.title" v-model="reservation_info.examination_questions_id"
:value="item.id" :disabled="item.status != '2'"> placeholder="请选择"
style="width: 300px"
>
<el-option
v-for="item in examination_questions_all_list"
:key="item.id"
:label="item.title"
:value="item.id"
:disabled="item.status != '2'"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-tabs v-model="activeName" v-if="reservation_info.examination_questions_id"> <el-tabs
v-model="activeName"
v-if="reservation_info.examination_questions_id"
>
<el-tab-pane label="单独预约" name="single"> <el-tab-pane label="单独预约" name="single">
<el-select v-model="reservation_info.student_id" placeholder="请选择" style="width: 300px;"> <el-select
<el-option v-for="item in student_all_list" :key="item.value" :label="item.name + '(' + item.idcard + ')'" v-model="reservation_info.student_id"
:value="item.student_id"> placeholder="请选择"
style="width: 300px"
>
<el-option
v-for="item in student_all_list"
:key="item.value"
:label="item.name + '(' + item.idcard + ')'"
:value="item.student_id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="批量预约" name="batch"> <el-tab-pane label="批量预约" name="batch">
<el-upload action="#" :auto-upload="false" :on-change="seletePicture"> <el-upload
action="#"
:auto-upload="false"
:on-change="seletePicture"
>
<el-button size="small" type="primary">点击选择</el-button> <el-button size="small" type="primary">点击选择</el-button>
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> --> <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
</el-upload> </el-upload>
...@@ -193,27 +396,46 @@ ...@@ -193,27 +396,46 @@
</template> </template>
<script> <script>
import TableHead from '@/components/TableHead/index'; import AddFeatures from '@/components/TableHead/AddFeatures.vue';
import { get_examination_questions_list, add_examination_questions, updata_examination_questions, create_answer_card, examination_questions_copy, examination_questions_publish, delete_examination_questions, get_examination_questions_all, get_student_all, examination_reservation, examination_batch_reservation, updata_examination_questions_status } from '@/api/student'; import {
get_examination_questions_list,
add_examination_questions,
updata_examination_questions,
create_answer_card,
examination_questions_copy,
examination_questions_publish,
delete_examination_questions,
get_examination_questions_all,
get_student_all,
examination_reservation,
examination_batch_reservation,
updata_examination_questions_status,
} from '@/api/student';
import { exportText } from '@/utils/tool'; import { exportText } from '@/utils/tool';
const standard_template = { const standard_template = {
title: "", title: '',
type: "把烟", type: '把烟',
opening_tip: " ", opening_tip: ' ',
begin_date: "", begin_date: '',
end_date: "", end_date: '',
duration: "60", duration: '60',
examiners_max: 100, examiners_max: 100,
remarks: "" remarks: '',
} place: null,
};
export default { export default {
data() { data() {
return { return {
activeName: "single", is_change: true,
is_select_all: false,
isIndeterminate: false,
activeName: 'single',
IP: process.env.VUE_APP_BASE_API, IP: process.env.VUE_APP_BASE_API,
//头部按钮 //头部按钮
head_data: { head_data: {
is_search_show: true, is_search_show: true,
number_value: 0,
select_data: [],
// search_placeholder: "学员姓名/手机号", // search_placeholder: "学员姓名/手机号",
right_buttons: [ right_buttons: [
{ {
...@@ -221,17 +443,17 @@ export default { ...@@ -221,17 +443,17 @@ export default {
icon: 'el-icon-document-add', icon: 'el-icon-document-add',
event: 'add', event: 'add',
}, },
{
text: '批阅',
icon: 'el-icon-data-analysis',
event: 'analysis',
},
{ {
text: '预约', text: '预约',
event: 'reservation', event: 'reservation',
}, },
], ],
ensembel_btn: {
text: '批阅',
icon: 'el-icon-data-analysis',
event: 'analysis',
},
}, },
//初始化请求参数 //初始化请求参数
request_params: { request_params: {
...@@ -272,14 +494,14 @@ export default { ...@@ -272,14 +494,14 @@ export default {
}; };
}, },
components: { TableHead }, components: { AddFeatures },
computed: {}, computed: {},
created() { created() {
localStorage.removeItem("examination_questions_ids"); localStorage.removeItem('examination_questions_ids');
}, },
mounted() { mounted() {
this.init() this.init();
}, },
methods: { methods: {
...@@ -315,7 +537,7 @@ export default { ...@@ -315,7 +537,7 @@ export default {
submitData() { submitData() {
let params = this.$handleParams(this.detailed_information); let params = this.$handleParams(this.detailed_information);
if (this.is_updata_type == 'add') { if (this.is_updata_type == 'add') {
add_examination_questions(params).then(res => { add_examination_questions(params).then((res) => {
console.log('新增回调'); console.log('新增回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -323,11 +545,11 @@ export default { ...@@ -323,11 +545,11 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getListData(); this.getListData();
} }
}) });
} else { } else {
let id = this.detailed_information.id; let id = this.detailed_information.id;
console.log(id); console.log(id);
updata_examination_questions(id, params).then(res => { updata_examination_questions(id, params).then((res) => {
console.log('修改回调'); console.log('修改回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -335,20 +557,25 @@ export default { ...@@ -335,20 +557,25 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getListData(); this.getListData();
} }
}) });
} }
}, },
//获取列表数据 //获取列表数据
getListData() { getListData() {
this.is_loading = true; this.is_loading = true;
let params = this.$removeProperty(this.request_params); let params = this.$removeProperty(this.request_params);
get_examination_questions_list(params).then(res => { get_examination_questions_list(params).then((res) => {
console.log('列表数据'); // console.log('列表数据');
console.log(res); // console.log(res);
// for (let i in res.data) {
// res.data[i].is_select =
// this.select_ids.indexOf(res.data[i].id) > -1 ? true : false;
// }
// this.update_data_select();
this.tableData = res.data || []; this.tableData = res.data || [];
this.request_params.total = res.total; this.request_params.total = res.total;
this.is_loading = false; this.is_loading = false;
}) });
}, },
//分页 //分页
handleCurrentChange(val) { handleCurrentChange(val) {
...@@ -375,18 +602,20 @@ export default { ...@@ -375,18 +602,20 @@ export default {
this.$confirm('此试题将停止使用, 是否继续?', '提示', { this.$confirm('此试题将停止使用, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
delete_examination_questions(id).then(res => { .then(() => {
delete_examination_questions(id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.init(); this.init();
} }
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除',
}); });
}); });
}, },
...@@ -394,48 +623,48 @@ export default { ...@@ -394,48 +623,48 @@ export default {
commentJump(item) { commentJump(item) {
let id = item.id; let id = item.id;
this.$router.push({ this.$router.push({
path: "/student/examination_questions_detail", path: '/student/examination_questions_detail',
query: { id: id }, query: { id: id },
}); });
}, },
//生成答题卡 //生成答题卡
createAnswerCard(item) { createAnswerCard(item) {
let id = item.id; let id = item.id;
create_answer_card(id).then(res => { create_answer_card(id).then((res) => {
console.log('下载答题卡回调'); console.log('下载答题卡回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
let s = res.message.split('='); let s = res.message.split('=');
let name = s[s.length - 1]; let name = s[s.length - 1];
let url = `${this.IP}${res.message}`; let url = `${this.IP}${res.message}`;
exportText(url, name) exportText(url, name);
} }
}) });
}, },
//发布 //发布
examinationQuestionsPublish(item) { examinationQuestionsPublish(item) {
let id = item.id; let id = item.id;
examination_questions_publish(id).then(res => { examination_questions_publish(id).then((res) => {
console.log('试题发布回调'); console.log('试题发布回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.getListData(); this.getListData();
} }
}) });
}, },
//试题复制 //试题复制
examinationQuestionsCopy(item) { examinationQuestionsCopy(item) {
console.log('点击触发'); console.log('点击触发');
let id = item.id; let id = item.id;
examination_questions_copy(id).then(res => { examination_questions_copy(id).then((res) => {
console.log('试题复制回调'); console.log('试题复制回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.getListData(); this.getListData();
} }
}) });
}, },
//点击修改状态 //点击修改状态
setStatusParams(item) { setStatusParams(item) {
...@@ -449,31 +678,31 @@ export default { ...@@ -449,31 +678,31 @@ export default {
updataExaminationQuestionsStatus() { updataExaminationQuestionsStatus() {
let id = this.status_params.id; let id = this.status_params.id;
let params = { let params = {
status: this.status_params.status status: this.status_params.status,
} };
updata_examination_questions_status(id, params).then(res => { updata_examination_questions_status(id, params).then((res) => {
console.log('修改状态'); console.log('修改状态');
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
document.body.click(); document.body.click();
this.getListData(); this.getListData();
} }
}) });
}, },
//预约点击 //预约点击
reservationFun() { reservationFun() {
//获取全部试题 //获取全部试题
get_examination_questions_all().then(res => { get_examination_questions_all().then((res) => {
console.log('全部试题'); console.log('全部试题');
console.log(res); console.log(res);
if (res.length) this.examination_questions_all_list = res || []; if (res.length) this.examination_questions_all_list = res || [];
get_student_all().then(result => { get_student_all().then((result) => {
console.log('全部学生列表'); console.log('全部学生列表');
console.log(result); console.log(result);
if (result.length) this.student_all_list = result || []; if (result.length) this.student_all_list = result || [];
this.is_reservation = true; this.is_reservation = true;
}) });
}) });
}, },
//取消预约 //取消预约
reservationClose() { reservationClose() {
...@@ -486,23 +715,27 @@ export default { ...@@ -486,23 +715,27 @@ export default {
//预约提交 //预约提交
reservationSubMit() { reservationSubMit() {
if (this.reservation_info.examination_questions_id) { if (this.reservation_info.examination_questions_id) {
if (this.activeName == 'single') {//单个 if (this.activeName == 'single') {
//单个
let params = this.$handleParams(this.reservation_info); let params = this.$handleParams(this.reservation_info);
examination_reservation(params).then(res => { examination_reservation(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.is_reservation = false; this.is_reservation = false;
} }
}) });
} else { } else {
let formData = new FormData(); let formData = new FormData();
formData.append('file', this.batch_reservation_file.raw); formData.append('file', this.batch_reservation_file.raw);
examination_batch_reservation(this.reservation_info.examination_questions_id, formData).then(res => { examination_batch_reservation(
this.reservation_info.examination_questions_id,
formData
).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.is_reservation = false; this.is_reservation = false;
} }
}) });
} }
} else { } else {
this.$message.warning('请选择试题!'); this.$message.warning('请选择试题!');
...@@ -510,32 +743,88 @@ export default { ...@@ -510,32 +743,88 @@ export default {
}, },
//表格多选监听 //表格多选监听
handleSelectionChange(val) { handleSelectionChange(val) {
console.log('val'); if (!this.is_change) return;
console.log(val); console.log('ssss');
this.select_ids = val.map(e => { this.select_ids = this.head_data.select_data.map((e) => {
return e.id; return e.id;
}) });
}, let val_ids = val.map((e) => {
return e.id;
});
for (let i of val) {
if (this.select_ids.indexOf(i.id) < 0) {
this.head_data.select_data.push(i);
this.select_ids.push(i.id);
}
}
for (let i of this.tableData) {
if (val_ids.indexOf(i.id) < 0 && this.select_ids.indexOf(i.id) > -1) {
this.head_data.select_data.splice(this.select_ids.indexOf(i.id), 1);
this.select_ids = this.head_data.select_data.map((e) => {
return e.id;
});
}
}
// this.select_ids = this.head_data.select_data.map((e) => {
// return e.id;
// });
// for (let i of this.tableData) {
// if (i.is_select && this.select_ids.indexOf(i.id) < 0) {
// this.head_data.select_data.push(i);
// this.select_ids.push(i.id);
// } else if (!i.is_select && this.select_ids.indexOf(i.id) > -1) {
// this.head_data.select_data.splice(this.select_ids.indexOf(i.id), 1);
// this.select_ids = this.head_data.select_data.map((e) => {
// return e.id;
// });
// }
// }
this.head_data.number_value = this.head_data.select_data.length;
},
deleteSelectData(index, id) {
this.head_data.select_data.splice(index, 1);
for (let i of this.tableData) {
if (i.id == id) {
i.is_select = false;
}
}
// this.update_data_select();
this.head_data.number_value = this.head_data.select_data.length;
},
// select_all_fun(val) {
// let is_select = false;
// if (val) {
// is_select = true;
// }
// this.isIndeterminate = false;
// for (let i of this.tableData) {
// i.is_select = is_select;
// }
// },
// update_data_select() {
// this.is_change = false;
// for (let i of this.head_data.select_data) {
// this.$refs.multipleTable.toggleRowSelection(i);
// }
// this.is_change = true;
// },
//行 点评 点击 //行 点评 点击
comment(item) { comment(item) {
if (item) { if (item) {
let ids = [item.id]; let ids = [item.id];
localStorage.setItem('examination_questions_ids', ids); localStorage.setItem('examination_questions_ids', ids);
this.$router.push({ path: '/student/examination_questions_comment', }) this.$router.push({ path: '/student/examination_questions_comment' });
} else { } else {
if (this.select_ids.length > 0) { if (this.select_ids.length > 0) {
localStorage.setItem('examination_questions_ids', this.select_ids); localStorage.setItem('examination_questions_ids', this.select_ids);
this.$router.push({ path: '/student/examination_questions_comment', }) this.$router.push({ path: '/student/examination_questions_comment' });
} else { } else {
this.$message.warning('请选择数据!'); this.$message.warning('请选择数据!');
} }
} }
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.remark_box { .remark_box {
......
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-29 17:06:03
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-17 10:39:36
*/
</script>
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
<examination-header v-if="student_brief_introduction" :examination_questions="student_brief_introduction" <examination-header
:key="new Date().getTime()"></examination-header> v-if="student_brief_introduction"
:examination_questions="student_brief_introduction"
:key="new Date().getTime()"
></examination-header>
</el-card> </el-card>
<el-card class="box-card" v-if="questions_list.length > 0"> <el-card class="box-card" v-if="questions_list.length > 0">
<answer-card :questions_lists="questions_list" :test_results_lists="test_results_list"></answer-card> <answer-card
:questions_lists="questions_list"
:test_results_lists="test_results_list"
></answer-card>
</el-card> </el-card>
<el-card class="box-card"> <el-card class="box-card">
<el-row> <el-row>
<!-- 错误方位/区域 --> <!-- 错误方位/区域 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="area_score_list"> <el-col :span="8" style="margin-bottom: 15px" v-if="area_score_list">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="area_score_list"> <AnalyseModule :module_data="area_score_list"> </AnalyseModule>
</AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误部位 --> <!-- 错误上下一级 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="wrong_position_list"> <el-col :span="8" style="margin-bottom: 15px" v-if="error_level_list">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_position_list"></AnalyseModule> <AnalyseModule :module_data="error_level_list"> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误颜色 --> <!-- 错误组别 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="wrong_color_list"> <el-col :span="8" style="margin-bottom: 15px" v-if="wrong_group_list">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_color_list"> <AnalyseModule :module_data="wrong_group_list"> </AnalyseModule>
</AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误等级 --> <!-- 错误等组 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="error_level_list"> <el-col
:span="8"
style="margin-bottom: 15px"
v-if="wrong_iso_groups_list"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="error_level_list"> <AnalyseModule :module_data="wrong_iso_groups_list">
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误组别 --> <!-- 错误颜色 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="wrong_group_list"> <el-col :span="8" style="margin-bottom: 15px" v-if="wrong_color_list">
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="wrong_group_list"> <AnalyseModule :module_data="wrong_color_list"> </AnalyseModule>
</AnalyseModule>
</div> </div>
</el-col> </el-col>
<!-- 错误部位 -->
<el-col
:span="8"
style="margin-bottom: 15px"
v-if="wrong_position_list"
>
<div class="centenr_container">
<AnalyseModule :module_data="wrong_position_list"></AnalyseModule>
</div>
</el-col>
<!-- 眼观稳定性 --> <!-- 眼观稳定性 -->
<el-col :span="8" style="margin-bottom: 15px;" v-if="eye_stability_list"> <el-col
:span="8"
style="margin-bottom: 15px"
v-if="eye_stability_list"
>
<div class="centenr_container"> <div class="centenr_container">
<AnalyseModule :module_data="eye_stability_list"> <AnalyseModule :module_data="eye_stability_list" :is_pover="true">
</AnalyseModule> </AnalyseModule>
</div> </div>
</el-col> </el-col>
...@@ -59,7 +88,6 @@ ...@@ -59,7 +88,6 @@
<el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%"> <el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%">
<div class="table_box"> <div class="table_box">
<!-- --> <!-- -->
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button>取 消</el-button> <el-button>取 消</el-button>
...@@ -75,20 +103,20 @@ import AnswerCard from '../components/AnswerCard.vue'; ...@@ -75,20 +103,20 @@ import AnswerCard from '../components/AnswerCard.vue';
import AnalyseModule from '@/components/AnalyseModule/index.vue'; import AnalyseModule from '@/components/AnalyseModule/index.vue';
import { get_test_results_detail } from '@/api/student'; import { get_test_results_detail } from '@/api/student';
import { array_conversion } from '@/utils/tool'; import { array_conversion } from '@/utils/tool';
import { toPercent,countOccurrences } from '@/utils/tool'; import { toPercent, countOccurrences } from '@/utils/tool';
const standard_template = { const standard_template = {
id: null, id: null,
father_id: -1,//父级id father_id: -1, //父级id
is_show: false,//是否展示为菜单 is_show: false, //是否展示为菜单
name: null,//英文名称 name: null, //英文名称
name_zh: null,//中文名称 name_zh: null, //中文名称
path: null,//路由路径 path: null, //路由路径
sort: null,//排序 sort: null, //排序
status: 1,//状态 status: 1, //状态
type: 1,//类型:菜单/按钮 type: 1, //类型:菜单/按钮
view_path: null,//视图路径 view_path: null, //视图路径
icon: null,//图标 icon: null, //图标
} };
export default { export default {
data() { data() {
return { return {
...@@ -112,13 +140,12 @@ export default { ...@@ -112,13 +140,12 @@ export default {
//考试结果id //考试结果id
test_results_id: null, test_results_id: null,
//试题结果 //试题结果
questions_list: [],//试题列表 questions_list: [], //试题列表
test_results_list: [],//答题列表 test_results_list: [], //答题列表
test_text: '针对你在本次烟草知识考试中的表现,我认为你已经做得非常出色。你的答案准确地回答了考试中的问题,而且展现出了对烟草知识的全面了解。',
test_text:
'针对你在本次烟草知识考试中的表现,我认为你已经做得非常出色。你的答案准确地回答了考试中的问题,而且展现出了对烟草知识的全面了解。',
//区域区域数据 //区域区域数据
area_score_list: null, area_score_list: null,
...@@ -130,9 +157,10 @@ export default { ...@@ -130,9 +157,10 @@ export default {
error_level_list: null, error_level_list: null,
//错误组别 //错误组别
wrong_group_list: null, wrong_group_list: null,
//错误等组
wrong_iso_groups_list: null,
///眼光稳定性 ///眼光稳定性
eye_stability_list: null, eye_stability_list: null,
}; };
}, },
...@@ -144,7 +172,7 @@ export default { ...@@ -144,7 +172,7 @@ export default {
if (id) this.test_results_id = id; if (id) this.test_results_id = id;
}, },
mounted() { mounted() {
this.init() this.init();
}, },
methods: { methods: {
...@@ -153,7 +181,7 @@ export default { ...@@ -153,7 +181,7 @@ export default {
}, },
//考试结果详情 //考试结果详情
getTestResultsDetail() { getTestResultsDetail() {
get_test_results_detail(this.test_results_id).then(res => { get_test_results_detail(this.test_results_id).then((res) => {
console.log('考试结果详情'); console.log('考试结果详情');
console.log(res); console.log(res);
//头部组件 //头部组件
...@@ -172,32 +200,52 @@ export default { ...@@ -172,32 +200,52 @@ export default {
], ],
}; };
this.questions_list = []; this.questions_list = [];
res.examination_questions.examination_question_detail.forEach((element, index) => { res.examination_questions.examination_question_detail.forEach(
let obj = JSON.parse(JSON.stringify(element)) (element, index) => {
element['index_number'] = index;//用来记录在原始数据中的索引 let obj = JSON.parse(JSON.stringify(element));
}); element['index_number'] = index; //用来记录在原始数据中的索引
let new_arr = array_conversion(res.examination_questions.examination_question_detail, 5); }
);
let new_arr = array_conversion(
res.examination_questions.examination_question_detail,
5
);
this.test_results_list = res.test_results; this.test_results_list = res.test_results;
//表格列表 //表格列表
this.questions_list = new_arr; this.questions_list = new_arr;
//烟草区域 //烟草区域
this.area_score_list = this.changeAreaScore(res.statistical_results.AreaScore); this.area_score_list = this.changeAreaScore(
res.statistical_results.AreaScore
);
//错误部位 //错误部位
this.wrong_position_list = this.changeWrongPosition(res.statistical_results.WrongPosition); this.wrong_position_list = this.changeWrongPosition(
res.statistical_results.WrongPosition
);
//错误颜色 //错误颜色
this.wrong_color_list = this.changeWrongColor(res.statistical_results.WrongColor); this.wrong_color_list = this.changeWrongColor(
res.statistical_results.WrongColor
);
//错误等级 //错误等级
this.error_level_list = this.changeErrorLevel(res.statistical_results.ErrorLevel); this.error_level_list = this.changeWrongLevel(
res.statistical_results.WrongLevel
);
//错误组别 //错误组别
this.wrong_group_list = this.changeWrongGroup(res.statistical_results.WrongGroup); this.wrong_group_list = this.changeWrongGroup(
res.statistical_results.WrongGroup
);
//错误等组
this.wrong_iso_groups_list = this.changeWrongIsoGroup(
res.statistical_results.WrongIsogroup
);
//眼光稳定性 //眼光稳定性
this.eye_stability_list = this.changeEyeStability(res.statistical_results.EyeStability) this.eye_stability_list = this.changeEyeStability(
res.statistical_results.EyeStability
);
console.log('处理好的数据'); console.log('处理好的数据');
console.log(this.area_score_list); console.log(this.eye_stability_list);
});
})
}, },
//区域得分 //区域得分
changeAreaScore(datas) { changeAreaScore(datas) {
...@@ -209,7 +257,7 @@ export default { ...@@ -209,7 +257,7 @@ export default {
{ label: '错误题目数量', key: 'subject_num_error' }, { label: '错误题目数量', key: 'subject_num_error' },
]; ];
return { return {
type: "bar", type: 'bar',
chart_id: 'bar_chart1', chart_id: 'bar_chart1',
color: '#E6A23C', color: '#E6A23C',
title: '突出区域的烟草识别', title: '突出区域的烟草识别',
...@@ -218,23 +266,24 @@ export default { ...@@ -218,23 +266,24 @@ export default {
raw_data: datas, raw_data: datas,
}; };
}, },
//错误部位 //错误部位
changeWrongPosition(datas) { changeWrongPosition(datas) {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '部位', key: 'position' }, { label: '题号', key: 'position' },
{ label: '区域', key: 'area' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错误答案', key: 'distribute' },
{ label: '错误答案内容', key: 'distribute' },
]; ];
keys.forEach((element, index) => { keys.forEach((element, index) => {
list.push({ list.push({
position: element, position: element,
answer: datas[element].answer, answer: datas[element].answer,
wrong_num: datas[element].wrong_num, area: datas[element].area,
distribute: countOccurrences(datas[element].distribute), distribute: datas[element].distribute,
}); });
}); });
return { return {
...@@ -244,26 +293,26 @@ export default { ...@@ -244,26 +293,26 @@ export default {
title: '错误部位', title: '错误部位',
labers, labers,
list, list,
}; };
}, },
//错误颜色 //错误颜色
changeWrongColor(datas) { changeWrongColor(datas) {
console.log(datas);
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '颜色', key: 'color' }, { label: '题号', key: 'color' },
{ label: '区域', key: 'area' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错误答案', key: 'distribute' },
{ label: '错误答案内容', key: 'distribute' },
]; ];
keys.forEach((element, index) => { keys.forEach((element, index) => {
list.push({ list.push({
color: element, color: element,
answer: datas[element].answer, answer: datas[element].answer,
wrong_num: datas[element].wrong_num, area: datas[element].area,
distribute: countOccurrences(datas[element].distribute), distribute: datas[element].distribute,
}); });
}); });
return { return {
...@@ -276,32 +325,31 @@ export default { ...@@ -276,32 +325,31 @@ export default {
}; };
}, },
//错误等级 //错误等级
changeErrorLevel(datas) { changeWrongLevel(datas) {
if (!datas) return false; if (!datas) return false;
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '等级', key: 'level' }, { label: '题号', key: 'level' },
{ label: '区域', key: 'area' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错误答案', key: 'distribute' },
{ label: '错误答案内容', key: 'distribute' },
]; ];
keys.forEach((element, index) => { keys.forEach((element, index) => {
list.push({ list.push({
level: element, level: element,
answer: datas[element].answer, answer: datas[element].answer,
wrong_num: datas[element].wrong_num, area: datas[element].area,
distribute: countOccurrences(datas[element].distribute), distribute: datas[element].distribute,
}); });
}); });
return { return {
type: 'table', type: 'table',
chart_id: 'wrong_position', chart_id: 'wrong_position',
color: '#505F79', color: '#505F79',
title: '错误等级', title: '错误上下一级',
labers, labers,
list, list,
}; };
}, },
//错误组别 //错误组别
...@@ -310,17 +358,17 @@ export default { ...@@ -310,17 +358,17 @@ export default {
let keys = Object.keys(datas); let keys = Object.keys(datas);
let list = []; let list = [];
let labers = [ let labers = [
{ label: '组别', key: 'group' }, { label: '题号', key: 'group' },
{ label: '区域', key: 'area' },
{ label: '正确答案', key: 'answer' }, { label: '正确答案', key: 'answer' },
{ label: '错题数量', key: 'wrong_num' }, { label: '错误答案', key: 'distribute' },
{ label: '错误答案内容', key: 'distribute' },
]; ];
keys.forEach((element, index) => { keys.forEach((element, index) => {
list.push({ list.push({
group: element, group: element,
answer: datas[element].answer, answer: datas[element].answer,
wrong_num: datas[element].wrong_num, area: datas[element].area,
distribute: countOccurrences(datas[element].distribute), distribute: datas[element].distribute,
}); });
}); });
return { return {
...@@ -332,44 +380,95 @@ export default { ...@@ -332,44 +380,95 @@ export default {
list, list,
}; };
}, },
//错误等组
changeWrongIsoGroup(datas) {
if (!datas) return false;
let keys = Object.keys(datas);
let list = [];
let labers = [
{ label: '题号', key: 'iso_group' },
{ label: '区域', key: 'area' },
{ label: '正确答案', key: 'answer' },
{ label: '错误答案', key: 'distribute' },
];
keys.forEach((element, index) => {
list.push({
iso_group: element,
answer: datas[element].answer,
area: datas[element].area,
distribute: datas[element].distribute,
});
});
return {
type: 'table',
chart_id: 'wrong_group',
color: '#529B2E',
title: '错误等组',
labers,
list,
};
},
//眼光稳定性 //眼光稳定性
changeEyeStability(datas) { changeEyeStability(datas) {
console.log(datas);
if (!datas) return false; if (!datas) return false;
let list = []; let list = [];
let labers = [ let labers = [
{ label: '题目', key: 'title' }, { label: '题号', key: 'title' },
{ label: '区域', key: 'area' },
{ label: '答案', key: 'answer' }, { label: '答案', key: 'answer' },
{ label: '稳定性', key: 'stability' } { label: '稳定性', key: 'stability' },
]; ];
//处理稳定性数据 //处理稳定性数据
const changeStability = (items) => { // const changeStability = (items) => {
let all_num = items.exactness.length + items.wrong.length; // let all_num = items.exactness.length + items.wrong.length;
let Accuracy = toPercent(items.exactness.length, all_num);//准确率 // let Accuracy = toPercent(items.exactness.length, all_num); //准确率
return { // return {
accuracy: { label: '正确率', value: Accuracy }, // accuracy: { label: '正确率', value: Accuracy },
// exactness: { label: '正确数据', value: items.exactness }, // // exactness: { label: '正确数据', value: items.exactness },
wrong: { label: '错误数据', value: items.wrong }, // wrong: { label: '错误数据', value: items.wrong },
} // };
}; // };
// datas.data.forEach((element, index) => {
// list.push({
// title: datas.title[index],
// answer: element.answer,
// stability: changeStability(element),
// });
// });
//处理稳定性数据
datas.data.forEach((element, index) => { datas.data.forEach((element, index) => {
// console.log(element);
let answer_data = element.conclusion_data;
let is_t = '';
let res = answer_data.length < 2 ? '' : '稳定';
for (let i = 0; i < answer_data.length; i++) {
if (is_t == '') {
is_t = answer_data[i];
} else if (is_t != answer_data[i]) {
res = '不稳定';
}
}
// console.log(datas.data);
list.push({ list.push({
title: datas.title[index], title: datas.title[index],
answer: element.answer, answer: element.answer,
stability: changeStability(element) stability: res,
area: element.area,
conclusion_data: answer_data,
}); });
}); });
return { return {
type: 'eye_stability_table', type: 'eye_stability_table',
chart_id: 'wrong_group', chart_id: 'wrong_group',
color: '#529B2E', color: '#E6A23C',
title: '眼光稳定性', title: '眼光稳定性',
labers, labers,
list, list,
}; };
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
......
...@@ -11,58 +11,115 @@ ...@@ -11,58 +11,115 @@
<el-card class="box-card"> <el-card class="box-card">
<!-- <table-head :add_text="'管理员'" :add_icon="'el-icon-s-custom'" @search="searchEvent" @resetting="resetting" <!-- <table-head :add_text="'管理员'" :add_icon="'el-icon-s-custom'" @search="searchEvent" @resetting="resetting"
@add="infoUpdata(null)"></table-head> --> @add="infoUpdata(null)"></table-head> -->
<table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick"></table-head> <table-head
:head_data="head_data"
@search="searchEvent"
@resetting="resetting"
@btnClick="btnClick"
></table-head>
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="administrators_list" style="width: 100%" height="650"> <el-table
v-loading="is_loading"
:data="administrators_list"
style="width: 100%"
height="650"
>
<el-table-column prop="id" label="编号"></el-table-column> <el-table-column prop="id" label="编号"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column> <el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="email" label="邮箱"></el-table-column> <el-table-column prop="email" label="邮箱"></el-table-column>
<el-table-column prop="phone" label="手机号"></el-table-column> <el-table-column prop="phone" label="手机号"></el-table-column>
<el-table-column prop="created_at" label="创建时间"></el-table-column> <el-table-column
prop="created_at"
label="创建时间"
></el-table-column>
<el-table-column prop="status" label="状态"> <el-table-column prop="status" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-tag v-if="scope.row.status == 1" type="success">正常</el-tag> <el-tag v-if="scope.row.status == 1" type="success"
<el-tag v-if="scope.row.status == 2" type="danger">禁止</el-tag> >正常</el-tag
<el-tag v-if="scope.row.status == 3" type="info" color="#f4f4f5">失效</el-tag> >
<el-tag v-if="scope.row.status == 2" type="danger"
>禁止</el-tag
>
<el-tag
v-if="scope.row.status == 3"
type="info"
color="#f4f4f5"
>失效</el-tag
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="操作"> <el-table-column prop="address" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-button size="mini" type="text" style="color: #000;" @click="infoUpdata(scope.row)">编辑</el-button> <el-button
<el-button size="mini" type="text" style="color: #F56C6C;" size="mini"
@click="deleteAdmin(scope.row)">删除</el-button> type="text"
style="color: #000"
@click="infoUpdata(scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
style="color: #f56c6c"
@click="deleteAdmin(scope.row)"
>删除</el-button
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="text-align: right;"> <div style="text-align: right">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="params.page" <el-pagination
:page-size="params.limit" layout="total, prev, pager, next" :total="params.total"> @current-change="handleCurrentChange"
:current-page.sync="params.page"
:page-size="params.limit"
layout="total, prev, pager, next"
:total="params.total"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</el-card> </el-card>
</div> </div>
<el-dialog :title="is_type == 'add' ? '新增管理员' : '编辑管理员'" :visible.sync="is_dialogVisible" width="1024px" <el-dialog
:before-close="handleClose" :class="is_type == 'add' ? 'add_dialog' : 'edit_dialog'"> :title="is_type == 'add' ? '新增管理员' : '编辑管理员'"
:visible.sync="is_dialogVisible"
width="1024px"
:before-close="handleClose"
:class="is_type == 'add' ? 'add_dialog' : 'edit_dialog'"
>
<div> <div>
<el-row> <el-row>
<el-col :span="10" v-if="user_type == 1"> <el-col :span="10" v-if="user_type == 1">
<div class="head_container"> <div class="head_container">
<el-upload class="avatar-uploader" :action="upload_action" :show-file-list="false" <el-upload
accept="image/png,image/jpeg,image/jpg" :http-request="sliderRequest"> class="avatar-uploader"
<img v-if="administrators_info.image" :src="upload_action + administrators_info.image" class="avatar"> :action="upload_action"
:show-file-list="false"
accept="image/png,image/jpeg,image/jpg"
:http-request="sliderRequest"
>
<img
v-if="administrators_info.image"
:src="upload_action + administrators_info.image"
class="avatar"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
<div class="prompt_text">只能上传jpg/png文件,且不超过500kb</div> <div class="prompt_text">只能上传jpg/png文件,且不超过500kb</div>
</div> </div>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-form :model="administrators_info" :rules="info_rules" ref="ruleForm" label-width="100px" <el-form
class="demo-ruleForm"> :model="administrators_info"
:rules="info_rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="用户类型" v-if="is_type == 'add'"> <el-form-item label="用户类型" v-if="is_type == 'add'">
<el-radio-group v-model="user_type"> <el-radio-group v-model="user_type">
<el-radio :label="1">普通用户</el-radio> <el-radio :label="1">普通用户</el-radio>
...@@ -70,18 +127,44 @@ ...@@ -70,18 +127,44 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="administrators_info.name" placeholder="请输入名称" <el-input
:disabled="is_type == 'add' ? false : true"></el-input> v-model="administrators_info.name"
placeholder="请输入名称"
:disabled="is_type == 'add' ? false : true"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="phone" v-if="user_type == 1"> <el-form-item label="手机号" prop="phone" v-if="user_type == 1">
<el-input v-model="administrators_info.phone" placeholder="请输入手机号"></el-input> <el-input
v-model="administrators_info.phone"
placeholder="请输入手机号"
></el-input>
</el-form-item>
<el-form-item label="区域信息">
<treeselect
v-model="administrators_info.department_id"
:options="tree_select_list"
:normalizer="normalizer"
:show-count="true"
placeholder="选择上级菜单"
/>
</el-form-item> </el-form-item>
<el-form-item label="邮箱" prop="email" v-if="user_type == 1"> <el-form-item label="邮箱" prop="email" v-if="user_type == 1">
<el-input v-model="administrators_info.email" placeholder="请输入邮箱"></el-input> <el-input
v-model="administrators_info.email"
placeholder="请输入邮箱"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="administrators_info.password" placeholder="请输入密码" :type="passwordType"> <el-input
<i slot="suffix" class="el-input__icon el-icon-view" @click="showPwd"></i> v-model="administrators_info.password"
placeholder="请输入密码"
:type="passwordType"
>
<i
slot="suffix"
class="el-input__icon el-icon-view"
@click="showPwd"
></i>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="password" v-if="user_type == 1"> <el-form-item label="状态" prop="password" v-if="user_type == 1">
...@@ -92,8 +175,16 @@ ...@@ -92,8 +175,16 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="角色" prop="password"> <el-form-item label="角色" prop="password">
<el-select v-model="administrators_info.role_id" placeholder="请选择"> <el-select
<el-option v-for="item in roles_list" :key="item.id" :label="item.name" :value="item.id"> v-model="administrators_info.role_id"
placeholder="请选择"
>
<el-option
v-for="item in roles_list"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -110,9 +201,21 @@ ...@@ -110,9 +201,21 @@
</template> </template>
<script> <script>
import { get_administrators_list, add_administrators, delete_administrators, edit_administrators, get_administrators_detail, upload_head, create_temporary } from '@/api/system.js'; import {
get_administrators_list,
add_administrators,
delete_administrators,
edit_administrators,
get_administrators_detail,
upload_head,
create_temporary,
} from '@/api/system.js';
import { get_roles_all } from '@/api/role'; import { get_roles_all } from '@/api/role';
import TableHead from '@/components/TableHead/index'; import TableHead from '@/components/TableHead/index';
import { get_department_list } from '@/api/system';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
const admin_info = { const admin_info = {
id: null, id: null,
name: null, name: null,
...@@ -122,7 +225,8 @@ const admin_info = { ...@@ -122,7 +225,8 @@ const admin_info = {
role_id: 1, role_id: 1,
image: '/php_sours/userimg/2023_03_02/16777479118474.jpg', image: '/php_sours/userimg/2023_03_02/16777479118474.jpg',
status: 1, status: 1,
} department_id: null,
};
export default { export default {
data() { data() {
return { return {
...@@ -135,7 +239,7 @@ export default { ...@@ -135,7 +239,7 @@ export default {
text: '新增', text: '新增',
icon: 'el-icon-s-custom', icon: 'el-icon-s-custom',
event: 'add', event: 'add',
} },
], ],
}, },
is_loading: false, is_loading: false,
...@@ -150,68 +254,65 @@ export default { ...@@ -150,68 +254,65 @@ export default {
is_type: 'add', is_type: 'add',
administrators_info: {}, administrators_info: {},
info_rules: { info_rules: {
name: [ name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
{ required: true, message: '请输入名称', trigger: 'blur' }, // phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
], // email: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
],
email: [
{ required: true, message: '请输入邮箱', trigger: 'blur' },
],
// password: [ // password: [
// { required: true, message: '请输入密码', trigger: 'blur' }, // { required: true, message: '请输入密码', trigger: 'blur' },
// ], // ],
}, },
upload_action: `${process.env.VUE_APP_BASE_API}`, upload_action: `${process.env.VUE_APP_BASE_API}`,
passwordType: 'password',//输入框的类型,密码框 passwordType: 'password', //输入框的类型,密码框
user_type: 1,//创建用户类型 老师,普通用户 user_type: 1, //创建用户类型 老师,普通用户
roles_list: [], roles_list: [],
//树菜单选择
tree_select_list: [],
}; };
}, },
components: { TableHead }, components: { TableHead, Treeselect },
computed: {}, computed: {},
mounted() { mounted() {
this.getAdministratorsList(); this.getAdministratorsList();
this.getRolesAll(); this.getRolesAll();
this.getProvinceList();
}, },
methods: { methods: {
//获取全部角色 //获取全部角色
getRolesAll() { getRolesAll() {
get_roles_all().then(res => { get_roles_all().then((res) => {
console.log('获取全部角色'); console.log('获取全部角色');
console.log(res); console.log(res);
this.roles_list = res || []; this.roles_list = res || [];
}) });
}, },
//获取管理员列表 //获取管理员列表
getAdministratorsList() { getAdministratorsList() {
let params = { let params = {
val: this.params.val, val: this.params.val,
page: this.params.page, page: this.params.page,
limit: this.params.limit limit: this.params.limit,
} };
this.is_loading = true; this.is_loading = true;
get_administrators_list(params).then(res => { get_administrators_list(params).then((res) => {
console.log('获取管理员列表'); console.log('获取管理员列表');
console.log(res); console.log(res);
if (res.data.length > 0) { if (res.data.length > 0) {
res.data.forEach(element => { res.data.forEach((element) => {
if (element.role.length > 0) { if (element.role.length > 0) {
element['role_id'] = element.role[0].id element['role_id'] = element.role[0].id;
} else { } else {
element['role_id'] = null element['role_id'] = null;
} }
}); });
} }
this.administrators_list = res.data; this.administrators_list = res.data;
this.params.total = res.total; this.params.total = res.total;
this.is_loading = false; this.is_loading = false;
}) });
}, },
//分页 //分页
handleCurrentChange(val) { handleCurrentChange(val) {
...@@ -237,11 +338,13 @@ export default { ...@@ -237,11 +338,13 @@ export default {
//新增修改 //新增修改
infoUpdata(item) { infoUpdata(item) {
console.log(item); console.log(item);
if (item) {//修改 if (item) {
//修改
this.is_type = 'edit'; this.is_type = 'edit';
this.user_type = 1;//控制用户类型 this.user_type = 1; //控制用户类型
this.administrators_info = { ...item }; this.administrators_info = { ...item };
} else {//新增 } else {
//新增
this.is_type = 'add'; this.is_type = 'add';
this.administrators_info = { ...admin_info }; this.administrators_info = { ...admin_info };
} }
...@@ -257,30 +360,31 @@ export default { ...@@ -257,30 +360,31 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
delete_administrators(id).then(res => { .then(() => {
delete_administrators(id).then((res) => {
console.log('删除回调'); console.log('删除回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
this.$message.success('删除成功!'); this.$message.success('删除成功!');
this.getAdministratorsList(); this.getAdministratorsList();
} }
});
}) })
.catch(() => {
}).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除',
}); });
}); });
}, },
//密码框和输入框切换 //密码框和输入框切换
showPwd() { showPwd() {
if (this.passwordType === 'password') { if (this.passwordType === 'password') {
this.passwordType = '' this.passwordType = '';
} else { } else {
this.passwordType = 'password' this.passwordType = 'password';
} }
}, },
//上传 //上传
...@@ -288,19 +392,21 @@ export default { ...@@ -288,19 +392,21 @@ export default {
console.log('上传'); console.log('上传');
console.log(upload); console.log(upload);
const formData = new FormData(); const formData = new FormData();
formData.append('image', upload.file) formData.append('image', upload.file);
upload_head(formData).then(res => { upload_head(formData).then((res) => {
console.log('上传回调'); console.log('上传回调');
console.log(res); console.log(res);
if (res.err_code == 200) { if (res.err_code == 200) {
this.administrators_info.image = res.message; this.administrators_info.image = res.message;
this.$message.success('上传成功'); this.$message.success('上传成功');
} }
}) });
}, },
//提交 //提交
submitInfo() { submitInfo() {
console.log('提交的数据');
console.log(this.administrators_info);
this.$refs['ruleForm'].validate((valid) => { this.$refs['ruleForm'].validate((valid) => {
if (valid) { if (valid) {
let data = { let data = {
...@@ -312,12 +418,14 @@ export default { ...@@ -312,12 +418,14 @@ export default {
roles: this.administrators_info.role_id, roles: this.administrators_info.role_id,
image: this.administrators_info.image, image: this.administrators_info.image,
status: this.administrators_info.status, status: this.administrators_info.status,
} department_id: this.administrators_info.department_id,
};
let params = this.$handleParams(data); let params = this.$handleParams(data);
if (this.is_type == 'add') { if (this.is_type == 'add') {
console.log(params); console.log(params);
if (this.user_type == 1) {//创建普通用户 if (this.user_type == 1) {
add_administrators(params).then(res => { //创建普通用户
add_administrators(params).then((res) => {
console.log('新增用户回调'); console.log('新增用户回调');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -325,25 +433,27 @@ export default { ...@@ -325,25 +433,27 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getAdministratorsList(); this.getAdministratorsList();
} }
}) });
} else {//创建老师用户 } else {
//创建老师用户
let temporary = { let temporary = {
name: this.administrators_info.name, name: this.administrators_info.name,
password: this.administrators_info.password, password: this.administrators_info.password,
roles: this.administrators_info.role_id, roles: this.administrators_info.role_id,
} department_id: this.administrators_info.department_id,
};
let temporary_data = this.$handleParams(temporary); let temporary_data = this.$handleParams(temporary);
create_temporary(temporary_data).then(res => { create_temporary(temporary_data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success(res.message); this.$message.success(res.message);
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getAdministratorsList(); this.getAdministratorsList();
} }
}) });
} }
} else { } else {
let id = this.administrators_info.id; let id = this.administrators_info.id;
edit_administrators(id, params).then(res => { edit_administrators(id, params).then((res) => {
console.log('修改'); console.log('修改');
console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
...@@ -351,18 +461,35 @@ export default { ...@@ -351,18 +461,35 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
this.getAdministratorsList(); this.getAdministratorsList();
} }
}) });
} }
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
} }
}); });
}, },
} //获取区域信息
} getProvinceList() {
get_department_list().then((res) => {
console.log('@@@@');
console.log(res);
const menu = { id: -1, department_name: '', children: [] };
menu.children = res;
this.tree_select_list.push(menu);
});
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) delete node.children;
return {
id: node.id,
label: node.department_name,
children: node.children,
};
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search_box { .search_box {
...@@ -383,7 +510,7 @@ export default { ...@@ -383,7 +510,7 @@ export default {
} }
.el-upload:hover { .el-upload:hover {
border-color: #409EFF; border-color: #409eff;
} }
.avatar-uploader-icon { .avatar-uploader-icon {
...@@ -410,6 +537,7 @@ export default { ...@@ -410,6 +537,7 @@ export default {
font-size: 12px; font-size: 12px;
color: #606266; color: #606266;
margin-top: 15px; margin-top: 15px;
text-align: center;
} }
} }
</style> </style>
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论