123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694 |
- <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" @change="groupChangeFun">
- <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" @change="gradeChangeFun">
- <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 :style="{ color: item.color }">{{ item.score }}%</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <div class="yiyu_class">
- <div class="yiyu_left">
- <ZhuChart :options="optionJL" name="焦虑" refCurrent="refJL" />
- </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 jlList10" :key="item.name">
- <td class="first">{{ index + 1 }}</td>
- <td>{{ item.name }}</td>
- <td :style="{ color: item.color }">{{ item.score }}%</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <div class="yiyu_class">
- <div class="yiyu_left">
- <ZhuChart :options="optionQTH" name="压力" refCurrent="refQTH" />
- </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 qthList10" :key="item.name">
- <td class="first">{{ index + 1 }}</td>
- <td>{{ item.name }}</td>
- <td :style='{color:item.color}'>{{ item.score }}%</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <div class="yiyu_class">
- <div class="yiyu_left">
- <ZhuChart :options="optionSJ" name="视觉整合能力" refCurrent="refSJ" />
- </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 sjList10" :key="item.name">
- <td class="first">{{ index + 1 }}</td>
- <td>{{ item.name }}</td>
- <td :style='{color:item.color}'>{{ 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: [] },
- //焦虑全部的数据
- optionJL: { name: [], score: [] },
- //躯体化全部的数据
- optionQTH: { name: [], score: [] },
- //视觉整合能力
- optionSJ: { name: [], score: [] },
- //抑郁前10
- yiyuList10: [],
- //焦虑前10
- jlList10: [],
- //躯体化前10
- qthList10: [],
- //视觉整合能力前10
- sjList10: [],
- colorList: [
- "#7B0000",
- "#AE0000",
- "#E30000",
- "#FF3C15",
- "#FF5D15",
- "#FF7815",
- "#FF9600",
- "#FFBD1F",
- "#EBC42A",
- "#E0D062",
- ],
- };
- },
- methods: {
- open(val) {
- //将年级清空
- //将首选项改为第一个
- this.groupType = "1";
- this.groupGrade = "";
- this.planInfo = val;
- //获取到当前计划信息
- this.centerDialogVisible = true;
- //调用接口查询院或者年级的信息
- this.queryGrade(val.id);
- //各个维度显示的组件
- //开始渲染组件
- //先查询出来抑郁的全院或全年级所有的统计
- //调用接口
- //抑郁
- this.queryGradeOrYuanYiYu();
- //焦虑
- this.queryGradeOrYuanJL();
- //躯体化
- this.queryGradeOrYuanQTH();
- //视觉整合能力
- this.queryGradeOrYuanSJ();
- //查询抑郁前10
- this.queryGradeOrYuan10();
- //查询焦虑前10
- this.queryGradeOrYuanjl10();
- //查询躯体化前10
- this.queryGradeOrYuanqth10();
- //查询视觉整合能力前10
- this.queryGradeOrYuansj10();
- // this.initEcharts();
- },
- gradeChangeFun(val) {
- //抑郁
- this.queryGradeOrYuanYiYu();
- //焦虑
- this.queryGradeOrYuanJL();
- //躯体化
- this.queryGradeOrYuanQTH();
- //视觉整合能力
- this.queryGradeOrYuanSJ();
- //查询抑郁前10
- this.queryGradeOrYuan10();
- //查询焦虑前10
- this.queryGradeOrYuanjl10();
- //查询躯体化前10
- this.queryGradeOrYuanqth10();
- //查询视觉整合能力前10
- this.queryGradeOrYuansj10();
- //年纪发生变化时
- },
- //当用户的首选项发生变化
- groupChangeFun(val) {
- if (val == "2") {
- this.groupGrade = "";
- } else {
- //开始调用查询的方法
- //抑郁
- this.queryGradeOrYuanYiYu();
- //焦虑
- this.queryGradeOrYuanJL();
- //躯体化
- this.queryGradeOrYuanQTH();
- //视觉整合能力
- this.queryGradeOrYuanSJ();
- //查询抑郁前10
- this.queryGradeOrYuan10();
- //查询焦虑前10
- this.queryGradeOrYuanjl10();
- //查询躯体化前10
- this.queryGradeOrYuanqth10();
- //查询视觉整合能力前10
- this.queryGradeOrYuansj10();
- }
- //
- },
- //当用户类型发生变化
- //查询全年级和全院及全年级的所有统计抑郁的
- queryGradeOrYuanYiYu() {
- //res 返回数据结构
- //groupType
- //groupGrade
- //当前首选项选中院的话
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&isLimit=false&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&grade=${this.groupGrade}&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 };
- }
- });
- },
- //查询全年级和全院的所有统计焦虑的
- queryGradeOrYuanJL() {
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=焦虑&isLimit=false&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=焦虑&grade=${this.groupGrade}&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.optionJL = { name: nameList, score: scoreList };
- }
- });
- },
- //查询全年级和全院的所有统计---躯体化的
- queryGradeOrYuanQTH() {
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&isLimit=false&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&grade=${this.groupGrade}&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.optionQTH = { name: nameList, score: scoreList };
- }
- });
- },
- //查询全年级和全院的所有统计---视觉整合能力
- queryGradeOrYuanSJ() {
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=视觉整合能力&isLimit=false&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=视觉整合能力&grade=${this.groupGrade}&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.optionSJ = { name: nameList, score: scoreList };
- }
- });
- },
- //查询抑郁前10数据
- queryGradeOrYuan10() {
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&isLimit=true&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=抑郁&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
- }
- //res 返回数据结构
- this.$http.get(url, {}, (res) => {
- if (res.code == 200) {
- //获取第二个参数
- // let nameList = [];
- // let scoreList = [];
- //先把分数记录下来
- //然后去掉数据为0的
- //然后去重
- //例如 list 20.00 10.00
- let list = [];
- 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),
- color: "#2C3E50",
- };
- list.push(obj);
- }
- let listTmp1 = list.filter((item) => {
- return item.score != "0.00";
- });
- let scoreListTmp = [];
- for (let i = 0; i < listTmp1.length; i++) {
- //
- if (scoreListTmp.indexOf(listTmp1[i].score) == -1) {
- scoreListTmp.push(listTmp1[i].score);
- }
- }
- for (let i = 0; i < list.length; i++) {
- //
- for (let j = 0; j < scoreListTmp.length; j++) {
- if (scoreListTmp[j] == list[i].score) {
- list[i].color = this.colorList[j];
- }
- }
- }
- this.yiyuList10 = list;
- //依次给个颜色
- //将0.00过滤出来
- //将去重的过滤出来
- }
- });
- },
- //查询焦虑前10数据
- queryGradeOrYuanjl10() {
- //res 返回数据结构
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=焦虑&isLimit=true&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=焦虑&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
- }
- this.$http.get(url, {}, (res) => {
- if (res.code == 200) {
- //获取第二个参数
- // let nameList = [];
- // let scoreList = [];
- let list = [];
- 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),
- color: "#2C3E50",
- };
- list.push(obj);
- }
- let listTmp1 = list.filter((item) => {
- return item.score != "0.00";
- });
- let scoreListTmp = [];
- for (let i = 0; i < listTmp1.length; i++) {
- //
- if (scoreListTmp.indexOf(listTmp1[i].score) == -1) {
- scoreListTmp.push(listTmp1[i].score);
- }
- }
- for (let i = 0; i < list.length; i++) {
- //
- for (let j = 0; j < scoreListTmp.length; j++) {
- if (scoreListTmp[j] == list[i].score) {
- list[i].color = this.colorList[j];
- }
- }
- }
- this.jlList10 = list;
- // this.jlList10 = [];
- // 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.jlList10.push(obj);
- // }
- // this.optionYiYu = { name: nameList, score: scoreList };
- }
- });
- },
- //查询躯体化前10数据
- queryGradeOrYuanqth10() {
- //res 返回数据结构
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&isLimit=true&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=躯体化&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
- }
- this.$http.get(url, {}, (res) => {
- if (res.code == 200) {
- //获取第二个参数
- let list = [];
- 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),
- color: "#2C3E50",
- };
- list.push(obj);
- }
- let listTmp1 = list.filter((item) => {
- return item.score != "0.00";
- });
- let scoreListTmp = [];
- for (let i = 0; i < listTmp1.length; i++) {
- //
- if (scoreListTmp.indexOf(listTmp1[i].score) == -1) {
- scoreListTmp.push(listTmp1[i].score);
- }
- }
- console.log("scoreListTmp")
- console.log(scoreListTmp)
- for (let i = 0; i < list.length; i++) {
- //
- for (let j = 0; j < scoreListTmp.length; j++) {
- if (scoreListTmp[j] == list[i].score) {
- list[i].color = this.colorList[j];
- }
- }
- }
- this.qthList10 = list;
- }
- });
- },
- //视觉整合能力
- queryGradeOrYuansj10() {
- let url = "";
- if (this.groupType == "1") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=视觉整合能力&isLimit=true&planId=${this.planInfo.id}`;
- } else if (this.groupType == "2" && this.groupGrade != "") {
- url = `/userRecordScore/countPlanOrgHighRiskNum?dimName=视觉整合能力&grade=${this.groupGrade}&isLimit=true&planId=${this.planInfo.id}`;
- }
- this.$http.get(url, {}, (res) => {
- if (res.code == 200) {
- let list = [];
- 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),
- color: "#2C3E50",
- };
- list.push(obj);
- }
- let listTmp1 = list.filter((item) => {
- return item.score != "0.00";
- });
- let scoreListTmp = [];
- for (let i = 0; i < listTmp1.length; i++) {
- //
- if (scoreListTmp.indexOf(listTmp1[i].score) == -1) {
- scoreListTmp.push(listTmp1[i].score);
- }
- }
- for (let i = 0; i < list.length; i++) {
- //
- for (let j = 0; j < scoreListTmp.length; j++) {
- if (scoreListTmp[j] == list[i].score) {
- list[i].color = this.colorList[j];
- }
- }
- }
- this.sjList10 = list;
-
-
- }
- });
- },
- //查询计划下组织列表
- queryGrade(planId) {
- //根据计划ID查询其下边的年级
- let url = `/planOrg/findPlanGrade?planId=${planId}`;
- this.$http.get(url, {}, (res) => {
- this.gradeOption = [];
- //回调函数
- if (res.code == 200) {
- //先排序
- let list = JSON.parse(JSON.stringify(res.data));
- list.sort();
- if (list.length > 0) {
- for (let i = 0; i < list.length; i++) {
- let obj = {
- label: list[i] == -1 ? "教师组" : `${list[i]}级`,
- value: list[i],
- };
- this.gradeOption.push(obj);
- }
- }
- }
- });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .yiyu_class {
- display: flex;
- flex-direction: row;
- .yiyu_left {
- display: flex;
- flex: 8;
- padding-right:40px
- }
- .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: 3px 4px;
- border: none;
- border: 1px solid #dddddd;
- margin: 0;
- text-align: center;
- }
- td.warn {
- // background: red;
- color: red;
- }
- }
- </style>
|