|
@@ -0,0 +1,239 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ title=""
|
|
|
+ :visible.sync="centerDialogVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="80%"
|
|
|
+ top="5vh"
|
|
|
+ style="border-radius: 40px"
|
|
|
+ >
|
|
|
+ <div slot="title">
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ text-align: center;
|
|
|
+ font-size: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ font-weight: 700;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ planInfo.planName }}群体报告统计
|
|
|
+ </p>
|
|
|
+ <div>
|
|
|
+ <el-form :inline="true">
|
|
|
+ <el-form-item label="首选项" class="plan_lang">
|
|
|
+ <el-select v-model="groupType">
|
|
|
+ <el-option label="全院" value="1"> </el-option>
|
|
|
+ <el-option label="年级" value="2"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="年级" class="plan_lang" v-show="groupType != '1'">
|
|
|
+ <el-select v-model="groupGrade">
|
|
|
+ <el-option
|
|
|
+ v-for="item in gradeOption"
|
|
|
+ :key="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="yiyu_class">
|
|
|
+ <div class="yiyu_left">
|
|
|
+ <ZhuChart :options="optionYiYu" name="抑郁" refCurrent="refYiYU" />
|
|
|
+ </div>
|
|
|
+ <div class="yiyu_right">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ text-align: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 抑郁占比TOP10
|
|
|
+ </div>
|
|
|
+ <div class="table_out">
|
|
|
+ <table>
|
|
|
+ <tr>
|
|
|
+ <th class="first">序号</th>
|
|
|
+ <th>班级名称</th>
|
|
|
+ <th>抑郁占比</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(item,index) in yiyuList10" :key="item.name">
|
|
|
+ <td class="first">{{ index +1}}</td>
|
|
|
+ <td>{{item.name}}</td>
|
|
|
+ <td>{{item.score}}%</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import * as echarts from "echarts";
|
|
|
+import zhuChart from "../components/ZhuChart";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ ZhuChart: zhuChart,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ centerDialogVisible: false,
|
|
|
+ planInfo: {},
|
|
|
+ //首选项--类型
|
|
|
+ groupType: "1",
|
|
|
+
|
|
|
+ //绑定年级选项
|
|
|
+ groupGrade: "",
|
|
|
+ gradeOption: [],
|
|
|
+ option: {},
|
|
|
+ echarts_depressed: "",
|
|
|
+ optionYiYu: { name: [], score: [] },
|
|
|
+ yiyuList10: [],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ open(val) {
|
|
|
+ this.planInfo = val;
|
|
|
+ //获取到当前计划信息
|
|
|
+ this.centerDialogVisible = true;
|
|
|
+ //调用接口查询院或者年级的信息
|
|
|
+ this.queryGrade(val.id);
|
|
|
+ //各个维度显示的组件
|
|
|
+ //开始渲染组件
|
|
|
+ //先查询出来抑郁的全院或全年级所有的统计
|
|
|
+ //调用接口
|
|
|
+ this.queryGradeOrYuan();
|
|
|
+
|
|
|
+ this.queryGradeOrYuan10();
|
|
|
+ // this.initEcharts();
|
|
|
+ // this.optionYiYu = [10, 5, 20, 34, 0, 3, 22];
|
|
|
+ },
|
|
|
+ //查询全年级和全院及全年级的所有统计
|
|
|
+ queryGradeOrYuan() {
|
|
|
+ //res 返回数据结构
|
|
|
+ let url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&isLimit=false&planId=${this.planInfo.id}`;
|
|
|
+ this.$http.get(url, {}, (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ //
|
|
|
+ //获取第二个参数
|
|
|
+ let nameList = [];
|
|
|
+ let scoreList = [];
|
|
|
+ let scoreListTmp = [];
|
|
|
+
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ nameList.push(res.data[i].name);
|
|
|
+ scoreList.push((parseFloat(res.data[i].num) * 100).toFixed(2));
|
|
|
+ scoreListTmp.push(res.data[i].num);
|
|
|
+ }
|
|
|
+ this.optionYiYu = { name: nameList, score: scoreList };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ queryGradeOrYuan10() {
|
|
|
+ //res 返回数据结构
|
|
|
+ let url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&isLimit=true&planId=${this.planInfo.id}`;
|
|
|
+ this.$http.get(url, {}, (res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ //获取第二个参数
|
|
|
+ // let nameList = [];
|
|
|
+ // let scoreList = [];
|
|
|
+ this.yiyuList10 = [];
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ name: res.data[i].name,
|
|
|
+ score: (parseFloat(res.data[i].num) * 100).toFixed(2),
|
|
|
+ };
|
|
|
+ this.yiyuList10.push(obj);
|
|
|
+ }
|
|
|
+ // this.optionYiYu = { name: nameList, score: scoreList };
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //查询计划下组织列表
|
|
|
+ queryGrade(planId) {
|
|
|
+ //根据计划ID查询其下边的年级
|
|
|
+ let url = `/planOrg/findPlanGrade?planId=${planId}`;
|
|
|
+ this.$http.get(url, {}, (res) => {
|
|
|
+ this.gradeOption = [];
|
|
|
+ //回调函数
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ label: res.data[i] + "级",
|
|
|
+ value: res.data[i],
|
|
|
+ };
|
|
|
+ this.gradeOption.push(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.yiyu_class {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ .yiyu_left {
|
|
|
+ display: flex;
|
|
|
+ flex: 8;
|
|
|
+ }
|
|
|
+ .yiyu_right {
|
|
|
+ flex: 4;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ // justify-content: center;
|
|
|
+ .table_out {
|
|
|
+ width: 100%;
|
|
|
+ height: 700px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+table {
|
|
|
+ border-collapse: collapse;
|
|
|
+ border-spacing: 0;
|
|
|
+ // border: 1px solid #dddddd;
|
|
|
+ width: 100%;
|
|
|
+ tr {
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+ line-height: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ th.first {
|
|
|
+ text-align: center;
|
|
|
+ background: #75bd42;
|
|
|
+ }
|
|
|
+
|
|
|
+ td.first {
|
|
|
+ text-align: center;
|
|
|
+ background: #e3f2d9;
|
|
|
+ }
|
|
|
+
|
|
|
+ th,
|
|
|
+ td {
|
|
|
+ padding: 2px 4px;
|
|
|
+ border: none;
|
|
|
+ border: 1px solid #dddddd;
|
|
|
+ margin: 0;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ td.warn {
|
|
|
+ // background: red;
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|