|
@@ -5,14 +5,36 @@ import * as echarts from 'echarts'
|
|
|
|
|
|
import CpmdHeader from '@/components/CpmdHeader.vue';
|
|
|
import { onMounted, onUnmounted, reactive, ref } from 'vue'
|
|
|
-
|
|
|
+import { userInfoStore } from '@/stores'
|
|
|
+const userInfo = userInfoStore()
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
+import { queryReportApi } from '@/api/plan';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
|
|
|
//雷达图
|
|
|
const echarts_ld = ref<any>()
|
|
|
|
|
|
//设置
|
|
|
+const route = useRoute()
|
|
|
|
|
|
+//此处应该是唯一的报告ID
|
|
|
+const planId = ref<string>('')
|
|
|
+
|
|
|
+//定义一个参数判断测试报告需要跳转到哪
|
|
|
+const goFlag = ref('0')
|
|
|
+
|
|
|
+//获取到报告的总数据
|
|
|
+const reportData = ref<any>([])
|
|
|
+const echarts_des_list = ref<string[]>(['', '', '', '', '', ''])
|
|
|
+const echarts_data_list = ref<number[]>([10, 20, 30, 40, 0, 0])
|
|
|
+const echarts_name_list = ref<any>([
|
|
|
+ { name: '阳光指数', max: 100 },
|
|
|
+ { name: '情绪稳定指数', max: 100 },
|
|
|
+ { name: '社交能力', max: 100 },
|
|
|
+ { name: '自律能力', max: 100 },
|
|
|
+ { name: '爱情观', max: 100 },
|
|
|
+ { name: '人生观', max: 100 }
|
|
|
+])
|
|
|
|
|
|
const option = reactive({
|
|
|
title: {
|
|
@@ -25,14 +47,7 @@ const option = reactive({
|
|
|
shape: 'square', //设置雷达图形状,值有circle、square,默认为方形
|
|
|
splitNumber: 3, // 雷达图圈数设置
|
|
|
// shape: 'circle',
|
|
|
- indicator: [
|
|
|
- { name: '阳光指数', max: 100 },
|
|
|
- { name: '社交能力', max: 100 },
|
|
|
- { name: '爱情观', max: 100 },
|
|
|
- { name: '人生观', max: 100 },
|
|
|
- { name: '自律能力', max: 100 },
|
|
|
- { name: '应变能力', max: 100 }
|
|
|
- ],
|
|
|
+ indicator: echarts_name_list.value,
|
|
|
name: { //修改indicator文字的颜色
|
|
|
textStyle: {
|
|
|
color: "#999999"
|
|
@@ -92,7 +107,7 @@ const option = reactive({
|
|
|
symbolSize: 6,
|
|
|
data: [
|
|
|
{
|
|
|
- value: [90, 10, 30, 20, 10, 60],
|
|
|
+ value: echarts_data_list.value,
|
|
|
itemStyle: { //该数值区域样式设置
|
|
|
normal: {
|
|
|
color: 'red', //背景颜色,还需设置areaStyle //修改线条颜色
|
|
@@ -113,26 +128,87 @@ const option = reactive({
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-const route = useRoute()
|
|
|
|
|
|
-//此处应该是唯一的报告ID
|
|
|
-const id = ref<string>('')
|
|
|
//持久化设置 菜单状态
|
|
|
//刚进入页面就将高度设置为页面需要的
|
|
|
onMounted(() => {
|
|
|
console.log(route.params)
|
|
|
const params = route.params
|
|
|
+ //当等于0时则跳转到测试计划页面
|
|
|
+ //当等于1时则跳转到上一页
|
|
|
+ goFlag.value = params.goFlag as string
|
|
|
+ //获取用户编号
|
|
|
+ planId.value = params.planId as string
|
|
|
+ //获取用户编号
|
|
|
+
|
|
|
+ let pa = {
|
|
|
+ planId: planId.value,
|
|
|
+ userNo: userInfo.userInfo.userNo
|
|
|
+ }
|
|
|
+ queryReport(pa)
|
|
|
+ //调用方法
|
|
|
+ //进行量表信息查询
|
|
|
|
|
|
- id.value = params.id as string
|
|
|
//进到界面开始轮询
|
|
|
|
|
|
- const myChart = echarts.init(echarts_ld.value)
|
|
|
- myChart.setOption(option);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
})
|
|
|
+const queryReport = async (pa: any) => {
|
|
|
+ let res: any = await queryReportApi(pa)
|
|
|
+ console.log('返回的报告记录')
|
|
|
+ console.log(res)
|
|
|
+ //得到返回的数据
|
|
|
+ if (res.code == 200) {
|
|
|
+ reportData.value = res.data
|
|
|
+
|
|
|
+ // let a =[res.data[0].]
|
|
|
+ if (res.data.length == 7) {
|
|
|
+ let a = [
|
|
|
+ parseInt(res.data[1].dimensionScore),
|
|
|
+ parseInt(res.data[2].dimensionScore),
|
|
|
+ parseInt(res.data[3].dimensionScore),
|
|
|
+ parseInt(res.data[4].dimensionScore),
|
|
|
+ parseInt(res.data[5].dimensionScore),
|
|
|
+ parseInt(res.data[6].dimensionScore)
|
|
|
+ ]
|
|
|
+ let des = [
|
|
|
+ res.data[1].dimensionAnalysis,
|
|
|
+ res.data[2].dimensionAnalysis,
|
|
|
+ res.data[3].dimensionAnalysis,
|
|
|
+ res.data[4].dimensionAnalysis,
|
|
|
+ res.data[5].dimensionAnalysis,
|
|
|
+ res.data[6].dimensionAnalysis
|
|
|
+ ]
|
|
|
+ echarts_des_list.value = des
|
|
|
+ echarts_data_list.value = a
|
|
|
+ const myChart = echarts.init(echarts_ld.value)
|
|
|
+ option.series[0].data[0].value = a
|
|
|
+
|
|
|
+ myChart.setOption(option);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//界面销毁函数
|
|
|
const router = useRouter()
|
|
|
const backFun = () => {
|
|
|
- router.go(-1)
|
|
|
+ if (goFlag.value == '1') {
|
|
|
+ router.go(-1)
|
|
|
+ }
|
|
|
+ if (goFlag.value == '0') {
|
|
|
+ router.push({ name: 'plan' })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -163,48 +239,52 @@ onUnmounted(() => {
|
|
|
<div class="kply">
|
|
|
<div class="kply_inner">
|
|
|
<div style="padding: 20px 40px;">
|
|
|
- <div class="report_totol_score">
|
|
|
- <div class="report_bei">
|
|
|
- <img height="200xp" src="../assets/report/bei.png" />
|
|
|
- <div class="score">360</div>
|
|
|
- </div>
|
|
|
- <div class="totol_result_des">
|
|
|
- 结论:潜力无限,未来因挑战而更加精彩。你有着巨大的成长空间,只要勇于面对挑战,不断努力,你的人生必将绽放出璀璨的光芒。
|
|
|
+ <div>
|
|
|
+ <div class="report_totol_score">
|
|
|
+ <div class="report_bei">
|
|
|
+ <img height="200xp" src="../assets/report/bei.png" />
|
|
|
+ <div class="score" v-if="reportData.length > 0">{{ reportData[0].dimensionScore }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="totol_result_des" v-if="reportData.length > 0">
|
|
|
+ 结论:{{ reportData[0].dimensionConclusion }},{{ reportData[0].dimensionAnalysis }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="report_echarts_out">
|
|
|
- <div ref="echarts_ld" style="width:500px;height:600px">
|
|
|
+ <div class="report_echarts_out">
|
|
|
+ <div ref="echarts_ld" style="width:500px;height:600px">
|
|
|
|
|
|
- </div>
|
|
|
- <div
|
|
|
- style="display: flex;flex-direction: column;align-items: center;width: 50%; justify-content: space-around;padding-top: 40px;padding-bottom: 40px;">
|
|
|
- <div class="progress_out" v-for="item in 6">
|
|
|
- <span class="progress_out_name" style="width:150px">
|
|
|
- 阳光指数
|
|
|
- </span>
|
|
|
- <span class="progress_out_score">40</span>
|
|
|
- <el-progress :percentage="40" style="width:100%" :stroke-width="18" :show-text='false'
|
|
|
- color="linear-gradient(to right,#FF4E00 ,#ffffff)" />
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ style="display: flex;flex-direction: column;align-items: center;width: 50%; justify-content: space-around;padding-top: 40px;padding-bottom: 40px;">
|
|
|
+ <div class="progress_out" v-for="item, index in echarts_name_list">
|
|
|
+ <span class="progress_out_name" style="width:150px">
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
|
|
|
+ <el-progress :percentage="echarts_data_list[index]" style="width:100%"
|
|
|
+ :stroke-width="18" :show-text='false'
|
|
|
+ color="linear-gradient(to right,#FF4E00 ,#ffffff)" />
|
|
|
+ <span class="progress_out_score">{{ echarts_data_list[index] }}<span
|
|
|
+ style="color:#000000;font-size: 12px;opacity: 0.4;">/100</span></span>
|
|
|
+ </div>
|
|
|
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- <div v-for="item in 4" style="padding-top:60px">
|
|
|
- <div class="des_zhishu">阳光指数</div>
|
|
|
- <div class="report_des_out">
|
|
|
- <div class="score">分数:30.00</div>
|
|
|
- <div class="score">分析报告:</div>
|
|
|
- <div class="des">就像一颗刚破土的嫩芽,满载着成长的无限可能。每一次挑战都是阳光雨露,滋养着你向上生长。保持乐观,加把劲,未来的天空因你而更加绚烂!</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <div class="start_button_out">
|
|
|
- <div @click="backFun" class="start_button_self">返回</div>
|
|
|
- </div>
|
|
|
+ <div v-for="item, index in echarts_name_list" style="padding-top:60px">
|
|
|
+ <div class="des_zhishu">{{ item.name }}</div>
|
|
|
+ <div class="report_des_out">
|
|
|
+ <div class="score">分数:{{ echarts_data_list[index] }}</div>
|
|
|
+ <div class="score">分析报告:</div>
|
|
|
+ <div class="des">{{ echarts_des_list[index] }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
+ <div class="start_button_out">
|
|
|
+ <div @click="backFun" class="start_button_self">返回</div>
|
|
|
+ </div>
|
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -339,6 +419,7 @@ onUnmounted(() => {
|
|
|
color: #FF1E00;
|
|
|
font-weight: 600;
|
|
|
margin-right: 5px;
|
|
|
+ margin-left: 15px;
|
|
|
|
|
|
}
|
|
|
}
|