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

'趋势性分析'

上级 7da12731
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689235220885" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1566" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M124.928 660.48h104.96v238.08h-104.96zM347.136 535.552h104.96v363.52h-104.96zM548.864 644.608h104.96v254.464h-104.96zM766.976 422.4h104.96v476.672h-104.96z" fill="#038d6e" p-id="1567"></path><path d="M666.112 124.928l110.592 118.784L535.04 473.6 351.744 307.2v-0.512l-0.512-0.512-1.536 2.048L61.44 536.576l32.768 41.472 254.976-202.752 186.368 169.472 1.024-1.024 0.512 0.512 275.456-262.144 100.864 108.544 12.8-260.096z" fill="#038d6e" p-id="1568"></path></svg>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-22 11:31:31 * @Date: 2023-02-22 11:31:31
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-19 19:19:24 * @Last Modified time: 2023-07-13 16:44:55
*/ */
import request from '@/utils/request' import request from '@/utils/request'
...@@ -142,3 +142,11 @@ export function logout() { ...@@ -142,3 +142,11 @@ export function logout() {
method: 'post' method: 'post'
}) })
} }
//获取个人趋势性统计信息
export function getUserAnalysisTrend() {
return request({
url: '/student/test_results/userAnalysis',
method: 'get',
})
}
<template>
<div class="chart_container" :id="chart_id"></div>
</template>
<script>
export default {
props: ['chart_data', 'chart_id', 'labers', 'keys', 'position_data'],
data() {
return {
y_data: null,
fake_data: '全部',
position_info: null,
};
},
components: {},
computed: {},
watch: {
position_data: {
deep: true,
handler(newData, oldDate) {
this.position_info = newData;
this.y_data = this.chart_data[newData];
this.initChart();
},
},
},
created() {},
mounted() {
this.y_data = this.chart_data.all;
this.initChart();
},
methods: {
initChart() {
let colors = ['#47afa0'];
let x_data = this.chart_data.title;
this.labers.forEach((item, index) => {
if (this.position_info == item.key) {
this.fake_data = item.label;
}
});
let _that = this;
let dom = document.getElementById(`${this.chart_id}`);
let myChart = this.$echarts.init(dom, null, {
renderer: 'canvas',
useDirtyRect: false,
});
let option;
option = {
title: {
text: ' ',
subtext: this.fake_data,
},
tooltip: {
axisPointer: {
type: 'cross',
},
},
toolbox: {
show: true,
},
color: colors,
xAxis: [
{
type: 'category',
axisTick: { show: false },
data: x_data,
interval: 0,
axisLabel: {
show: true,
rotate: -15,
},
},
],
yAxis: [
{
type: 'value',
},
],
series: [
{
data: this.y_data,
type: 'line',
},
],
};
if (option && typeof option === 'object') {
myChart.setOption(option);
}
window.addEventListener('resize', myChart.resize);
},
},
};
</script>
<style scoped>
.chart_container {
width: 100%;
height: 90%;
}
</style>
<!--
* @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.label"
:value="e.key"
:key="i"
>
</el-option>
</el-select>
</div>
</div>
</template>
<script>
export default {
props: ['labers'],
data() {
return {
select_list: [],
select_value: null,
};
},
components: {},
computed: {},
created() {
this.select_list = [...this.labers];
this.select_value = this.labers[0].label;
},
mounted() {},
methods: {
//选择监听
selectChange(val) {
// this.table_list = [...this.table_data.list[val]];
this.$emit('selectChange', val);
},
},
};
</script>
<style lang="scss" scoped>
.container_box {
width: 100%;
height: 7%;
position: relative;
}
.el-icon-caret-bottom {
position: absolute;
top: 81px;
}
.el-icon-caret-top {
position: absolute;
top: 74px;
}
.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>
...@@ -75,6 +75,23 @@ ...@@ -75,6 +75,23 @@
:area_data="original_data.area_data" :area_data="original_data.area_data"
></eye-stability-table> ></eye-stability-table>
</div> </div>
<!-- 趋势性分析 -->
<div
class="content_container_trend"
v-if="original_data.type == 'trend_analysis'"
>
<SelectLineChartData
:labers="original_data.labers"
@selectChange="selectChange"
></SelectLineChartData>
<SelectLineChart
:chart_id="original_data.chart_id"
:labers="original_data.labers"
:keys="original_data.keys"
:chart_data="original_data.obj"
:position_data="position_data"
></SelectLineChart>
</div>
</div> </div>
</template> </template>
...@@ -85,11 +102,14 @@ import BarChart from './components/BarChart.vue'; ...@@ -85,11 +102,14 @@ import BarChart from './components/BarChart.vue';
import SimpleTable from './components/SimpleTable.vue'; import SimpleTable from './components/SimpleTable.vue';
import EyeStabilityTable from './components/EyeStabilityTable.vue'; import EyeStabilityTable from './components/EyeStabilityTable.vue';
import SelectTabe from './components/SelectTabe.vue'; import SelectTabe from './components/SelectTabe.vue';
import SelectLineChart from './components/SelectLineChart';
import SelectLineChartData from './components/SelectLineChartData.vue';
export default { export default {
props: ['module_data'], props: ['module_data'],
data() { data() {
return { return {
original_data: {}, original_data: {},
position_data: '全部',
}; };
}, },
...@@ -100,6 +120,8 @@ export default { ...@@ -100,6 +120,8 @@ export default {
SimpleTable, SimpleTable,
EyeStabilityTable, EyeStabilityTable,
SelectTabe, SelectTabe,
SelectLineChart,
SelectLineChartData,
}, },
computed: {}, computed: {},
...@@ -113,6 +135,9 @@ export default { ...@@ -113,6 +135,9 @@ export default {
changeSelect() { changeSelect() {
this.$emit('changeSelect', this.original_data.is_show); this.$emit('changeSelect', this.original_data.is_show);
}, },
selectChange(val) {
this.position_data = val;
},
}, },
}; };
</script> </script>
...@@ -137,6 +162,15 @@ export default { ...@@ -137,6 +162,15 @@ export default {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow-y: auto; overflow-y: auto;
overflow-x: auto;
white-space: nowrap; // 默认不换行;
}
.content_container_trend {
width: 100%;
height: 285px;
margin: 0;
padding: 0;
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-23 16:03:00 * @Date: 2023-02-23 16:03:00
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-20 16:51:20 * @Last Modified time: 2023-07-13 18:56:35
*/ */
</script><template> </script><template>
<div class="header_container"> <div class="header_container">
...@@ -22,6 +22,19 @@ ...@@ -22,6 +22,19 @@
> >
个人中心 个人中心
</button> </button>
<button
style="
background-color: #038d6e;
width: 100%;
color: #fff;
border: 1px solid #038d6e;
margin-bottom: 5px;
"
size="mini"
@click="getTrend()"
>
个人分析
</button>
<button <button
style=" style="
background-color: #038d6e; background-color: #038d6e;
...@@ -34,7 +47,6 @@ ...@@ -34,7 +47,6 @@
> >
退出登录 退出登录
</button> </button>
<el-button <el-button
slot="reference" slot="reference"
type="primary" type="primary"
...@@ -47,6 +59,7 @@ ...@@ -47,6 +59,7 @@
<div class="logo" @click="goPersonalCenter()" style="cursor: pointer"> <div class="logo" @click="goPersonalCenter()" style="cursor: pointer">
<img src="/image/logo.svg" alt="" /> <img src="/image/logo.svg" alt="" />
</div> </div>
<div class="header_box"> <div class="header_box">
<h3>国家烟草识别培训系统</h3> <h3>国家烟草识别培训系统</h3>
</div> </div>
...@@ -55,14 +68,75 @@ ...@@ -55,14 +68,75 @@
>退出登录</el-button >退出登录</el-button
> >
</div> </div>
<el-dialog
title="个人分析"
:visible.sync="dialogVisible1"
center
fullscreen
>
<div class="table_container">
<div>
<div>
<el-row class="row_container">
<el-col :span="24" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="holdTobacco_data"
v-if="holdTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col
:span="24"
class="unit_container"
style="margin-top: 10px"
>
<div class="centenr_container">
<AnalyseModule
:module_data="flakeTobacco_data"
v-if="flakeTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col
:span="24"
class="unit_container"
style="margin-top: 10px"
>
<div class="centenr_container">
<AnalyseModule
:module_data="swingHandle_data"
v-if="swingHandle_data"
>
</AnalyseModule>
</div>
</el-col>
</el-row>
</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import AnalyseModule from '@/components/AnalyseModule/index.vue';
import { getUserAnalysisTrend } from '@/api/user';
export default { export default {
name: '', name: '',
components: { AnalyseModule },
data() { data() {
return {}; return {
dialogVisible1: false,
//把烟统计数据
holdTobacco_data: null,
//片烟统计数据
flakeTobacco_data: null,
//甩把统计数据
swingHandle_data: null,
};
}, },
//退出页面 //退出页面
methods: { methods: {
...@@ -73,6 +147,147 @@ export default { ...@@ -73,6 +147,147 @@ export default {
goPersonalCenter() { goPersonalCenter() {
this.$router.push('/personal'); this.$router.push('/personal');
}, },
//获取个人趋势性分析
getTrend() {
this.dialogVisible1 = true;
getUserAnalysisTrend().then((res) => {
this.holdTobacco_data = this.changeHoldTobacco(
res.analysis.holdTobacco
); //把烟
this.flakeTobacco_data = this.changeFlakeTobacco(
res.analysis.flakeTobacco
); //片烟
this.swingHandle_data = this.changeSwingHandle(
res.analysis.swingHandle
); //甩把
});
},
//处理把烟
changeHoldTobacco(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'holdtobacco_bar_chart',
title: '把烟',
color: '#39c183f0',
// print_id: 'holdtobacco_bar_chart',
obj,
labers,
keys,
};
},
//处理片烟
changeFlakeTobacco(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'flakeTobacco_bar_chart',
title: '片烟',
color: '#E6A23C',
// print_id: 'flakeTobacco_bar_chart',
obj,
labers,
keys,
};
},
//处理甩把
changeSwingHandle(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'swingHandle_bar_chart',
title: '片烟',
color: '#E6A23C',
// print_id: 'flakeTobacco_bar_chart',
obj,
labers,
keys,
};
},
}, },
}; };
</script> </script>
......
...@@ -190,6 +190,41 @@ ...@@ -190,6 +190,41 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<!-- 趋势性分析 -->
<div>
<div class="module_header">趋势性分析</div>
<div>
<el-row class="row_container">
<el-col :span="12" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="holdTobacco_data"
v-if="holdTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col :span="12" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="flakeTobacco_data"
v-if="flakeTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col :span="12" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="swingHandle_data"
v-if="swingHandle_data"
>
</AnalyseModule>
</div>
</el-col>
</el-row>
</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">
...@@ -242,6 +277,12 @@ export default { ...@@ -242,6 +277,12 @@ export default {
transcript_data: null, transcript_data: null,
//老师点评 //老师点评
found_remark: null, found_remark: null,
//把烟统计数据
holdTobacco_data: null,
//片烟统计数据
flakeTobacco_data: null,
//甩把统计数据
swingHandle_data: null,
}; };
}, },
...@@ -307,12 +348,144 @@ export default { ...@@ -307,12 +348,144 @@ export default {
this.wrongG_group_data = this.changeWrongGroup( this.wrongG_group_data = this.changeWrongGroup(
this.appraisal_data.WrongGroup this.appraisal_data.WrongGroup
); //错误组别 ); //错误组别
this.holdTobacco_data = this.changeHoldTobacco(
console.log('处理好的数据'); this.appraisal_data.holdTobacco
console.log(this.error_level_data); ); //把烟
this.flakeTobacco_data = this.changeFlakeTobacco(
this.appraisal_data.flakeTobacco
); //片烟
this.swingHandle_data = this.changeSwingHandle(
this.appraisal_data.swingHandle
); //甩把
}, },
//计算百分比 //计算百分比
toPercent, toPercent,
//处理把烟
changeHoldTobacco(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'holdTobacco_data_bar_chart',
title: '把烟',
color: '#39c183f0',
obj,
labers,
keys,
};
},
//处理甩把
changeSwingHandle(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'swingHandle_data_bar_chart',
title: '甩把',
color: '#39c183f0',
obj,
labers,
keys,
};
},
//处理片烟
changeFlakeTobacco(datas) {
if (!datas) return false;
// if (!datas) {
// datas = [];
// }
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'flakeTobacco_bar_chart',
title: '片烟',
color: '#E6A23C',
obj,
labers,
keys,
};
},
//处理分段值 //处理分段值
changeScore(datas) { changeScore(datas) {
if (!datas) return false; if (!datas) return false;
...@@ -434,6 +607,14 @@ export default { ...@@ -434,6 +607,14 @@ export default {
let labers = [ let labers = [
{ label: '姓名', key: 'name' }, { label: '姓名', key: 'name' },
{ label: '分数', key: 'score' }, { label: '分数', key: 'score' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
]; ];
let select_list = Object.keys(datas); let select_list = Object.keys(datas);
return { return {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-02-23 15:52:52 * @Date: 2023-02-23 15:52:52
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-27 15:54:24 * @Last Modified time: 2023-07-13 17:58:38
*/ */
</script><template> </script><template>
<div class="person_container"> <div class="person_container">
...@@ -32,7 +32,15 @@ ...@@ -32,7 +32,15 @@
</el-upload> </el-upload>
</div> </div>
</div> </div>
<h3 style="text-align: center; font-weight: 900">学员信息</h3> <div class="title_box">
<span style="font-weight: 900; font-size: 20px">学员信息</span>
<img
class="head_icon_box"
@click="getTrend()"
src="image/trend.svg"
/>
</div>
<p class="pointer">姓名</p> <p class="pointer">姓名</p>
<el-input v-model="user_info.name" disabled></el-input> <el-input v-model="user_info.name" disabled></el-input>
<p class="pointer">学号</p> <p class="pointer">学号</p>
...@@ -48,6 +56,7 @@ ...@@ -48,6 +56,7 @@
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
<!-- 考试卡片 --> <!-- 考试卡片 -->
<el-col :span="18" class="right_box"> <el-col :span="18" class="right_box">
<el-card class="box-card"> <el-card class="box-card">
...@@ -252,23 +261,83 @@ ...@@ -252,23 +261,83 @@
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
<el-dialog
title="个人分析"
:visible.sync="dialogVisible"
width="60%"
center
>
<div class="table_container">
<div>
<div>
<el-row class="row_container" :gutter="10">
<el-col :span="12" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="holdTobacco_data"
v-if="holdTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col :span="12" class="unit_container">
<div class="centenr_container">
<AnalyseModule
:module_data="flakeTobacco_data"
v-if="flakeTobacco_data"
>
</AnalyseModule>
</div>
</el-col>
<el-col
:span="12"
class="unit_container"
style="margin-top: 10px"
>
<div class="centenr_container">
<AnalyseModule
:module_data="swingHandle_data"
v-if="swingHandle_data"
>
</AnalyseModule>
</div>
</el-col>
</el-row>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getResults } from '@/api/user'; import { getResults, getUserAnalysisTrend } from '@/api/user';
import TestView from './components/card-view'; import TestView from './components/card-view';
import AnalyseModule from '@/components/AnalyseModule/index.vue';
export default { export default {
name: '', name: '',
components: { TestView }, components: { TestView, AnalyseModule },
data() { data() {
return { return {
imageUrl: '', imageUrl: '',
upload_url: `${process.env.VUE_APP_BASE_API}`, upload_url: `${process.env.VUE_APP_BASE_API}`,
user_info: {}, user_info: {},
test_results: [], test_results: [],
dialogVisible: false,
reverse: true, reverse: true,
//把烟统计数据
holdTobacco_data: null,
//片烟统计数据
flakeTobacco_data: null,
//甩把统计数据
swingHandle_data: null,
}; };
}, },
mounted() { mounted() {
...@@ -291,7 +360,146 @@ export default { ...@@ -291,7 +360,146 @@ export default {
query: { id: row.id }, query: { id: row.id },
}); });
}, },
//获取个人趋势性分析
getTrend() {
this.dialogVisible = true;
getUserAnalysisTrend().then((res) => {
this.holdTobacco_data = this.changeHoldTobacco(
res.analysis.holdTobacco
); //把烟
this.flakeTobacco_data = this.changeFlakeTobacco(
res.analysis.flakeTobacco
); //片烟
this.swingHandle_data = this.changeSwingHandle(
res.analysis.swingHandle
); //甩把
});
},
//处理把烟
changeHoldTobacco(datas) {
// if (!datas) return false;
if (!datas) {
datas = [];
}
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'holdtobacco_bar_chart',
title: '把烟',
color: '#39c183f0',
// print_id: 'holdtobacco_bar_chart',
obj,
labers,
keys,
};
},
//处理片烟
changeFlakeTobacco(datas) {
// if (!datas) return false;
if (!datas) {
datas = [];
}
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'flakeTobacco_bar_chart',
title: '片烟',
color: '#E6A23C',
// print_id: 'flakeTobacco_bar_chart',
obj,
labers,
keys,
};
},
//处理甩把
changeSwingHandle(datas) {
// if (!datas) return false;
if (!datas) {
datas = [];
}
let keys = Object.keys(datas);
let labers = [
{ label: '全部', key: 'all' },
{ label: '南方', key: 'south' },
{ label: '北方', key: 'north' },
{ label: '正组', key: 'positive' },
{ label: '副组', key: 'deputy' },
{ label: '南方正组', key: 'south_positive' },
{ label: '南方副组', key: 'south_deputy' },
{ label: '北方正组', key: 'north_positive' },
{ label: '北方副组', key: 'north_deputy' },
];
let obj = {
all: datas.all,
south: datas.south,
north: datas.north,
positive: datas.positive,
deputy: datas.deputy,
south_positive: datas.south_positive,
south_deputy: datas.south_deputy,
north_positive: datas.north_positive,
north_deputy: datas.north_deputy,
title: datas.title,
};
return {
type: 'trend_analysis',
chart_id: 'swingHandle_bar_chart',
title: '甩把',
color: '#E6A23C',
obj,
labers,
keys,
};
},
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw); this.imageUrl = URL.createObjectURL(file.raw);
}, },
...@@ -551,4 +759,14 @@ export default { ...@@ -551,4 +759,14 @@ export default {
width: 100%; width: 100%;
} }
} }
.title_box {
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.head_icon_box {
width: 20px;
cursor: pointer;
}
</style> </style>
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论