generalSituation.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. <template>
  2. <div class="pp">
  3. <!-- <div class="parent">
  4. <div class="sub1">
  5. 1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11111111111111111111111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
  6. <div class="sub2">2</div>
  7. </div>
  8. <div class="parent" style="display: flex; margin-top: 80px">
  9. <div class="sub3">
  10. <div style="flex:1;overflow:hidden">
  11. 1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11111111111111111111111111aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  12. </div>
  13. </div>
  14. <div class="sub2">2</div>
  15. </div> -->
  16. <!-- <img style="width:90%;" src="../../assets/report/home2.png" /> -->
  17. <div class="general_situation">
  18. <div class="number_people">
  19. <img
  20. style="width: 80px; position: absolute; right: 20px; top: 20px"
  21. src="../../assets/img/home/bg_p.png"
  22. alt=""
  23. />
  24. <div class="number_people_top">学院名称:</div>
  25. <div class="number_people_yuan">
  26. <div class="out">
  27. <span :title="userInfo.orgName" class="yuan_name">{{
  28. userInfo.orgName
  29. }}</span>
  30. <!-- <span :title="userInfo.orgName" class="yuan_name"
  31. >都开始了获得了大厦及伦敦峰会就是咯啊支持下自行车踩踩踩踩踩踩踩踩踩踩踩踩啊</span
  32. > -->
  33. <!-- <div style="display: flex;width:100%">
  34. <div :title="userInfo.orgName" class="yuan_name"
  35. >1211232312321321321321321111111111111111111111111111111111111111111111111111111111111111111111113</div
  36. >
  37. </div> -->
  38. <span class="yuan_people">
  39. <span class="people_t">小计:</span>
  40. <span class="people_n">{{ peopleData["总人数"] }}</span
  41. ><span class="people_r">人</span></span
  42. >
  43. </div>
  44. </div>
  45. </div>
  46. <div class="plan">
  47. <div class="plan_inner">
  48. <span class="plan_top">近期测评</span>
  49. <div class="table_header">
  50. <div class="detail">计划名称</div>
  51. <div class="detail">创建时间</div>
  52. <div class="detail">结束时间</div>
  53. <div class="detail">状态</div>
  54. <div class="detail">是否授权</div>
  55. </div>
  56. <div class="table_a">
  57. <div v-if="tableData.length == 0">
  58. <div style="text-align: center; margin-top: 10px">暂无数据</div>
  59. </div>
  60. <div v-else>
  61. <div
  62. class="table_body"
  63. v-for="(item, index) in tableData"
  64. :key="item.id"
  65. :style="{ backgroundColor: index % 2 == 0 ? '#ffffff' : '#F8F8F8' }"
  66. >
  67. <!-- <div :style="{backgroundColor:index ==0?'':'s'}">
  68. </div> -->
  69. <div class="detail" :title="item.planName">{{ item.planName }}</div>
  70. <div class="detail">{{ item.createTime }}</div>
  71. <div class="detail">{{ item.planEndTime }}</div>
  72. <!-- item.planStatus -->
  73. <div class="detail">
  74. <!-- {{ planStatusFun(item) }} -->
  75. <div
  76. style="display: flex; justify-content: center; align-items: center"
  77. v-if="item.planStatus == '3'"
  78. >
  79. <img
  80. style="width: 16px"
  81. src="../../assets/img/home/isCom.png"
  82. alt=""
  83. />&nbsp;&nbsp;
  84. <div style="color: #00955e">已完成</div>
  85. </div>
  86. <div
  87. style="display: flex; justify-content: center; align-items: center"
  88. v-if="item.planStatus == '2'"
  89. >
  90. <img
  91. style="width: 16px"
  92. src="../../assets/img/home/isRun.png"
  93. alt=""
  94. />&nbsp;&nbsp;
  95. <div style="color: #f6cb00">进行中</div>
  96. </div>
  97. <div
  98. style="display: flex; justify-content: center; align-items: center"
  99. v-if="item.planStatus == '1'"
  100. >
  101. <img
  102. style="width: 16px"
  103. src="../../assets/img/home/isNo.png"
  104. alt=""
  105. />&nbsp;&nbsp;
  106. <div style="color: #d52121">未开始</div>
  107. </div>
  108. </div>
  109. <div class="detail">
  110. <!-- {{ planStatusFun(item) }} -->
  111. <div
  112. style="
  113. display: flex;
  114. justify-content: center;
  115. align-items: center;
  116. height: 100%;
  117. "
  118. v-if="item.enable == '1'"
  119. >
  120. <!-- <img src="../../assets/img/home/isA.png" /> -->
  121. <div
  122. style="
  123. color: #00955e;
  124. border: 1px solid #577bff;
  125. line-height: 24px;
  126. padding: 0px 15px;
  127. border-radius: 20px;
  128. background: #f0f6fe;
  129. color: #3061ff;
  130. "
  131. >
  132. 已授权
  133. </div>
  134. </div>
  135. <div
  136. style="
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. height: 100%;
  141. "
  142. v-if="item.enable == '0'"
  143. >
  144. <div
  145. style="
  146. color: #00955e;
  147. border: 1px solid #fdb1b1;
  148. line-height: 24px;
  149. padding: 0px 15px;
  150. border-radius: 20px;
  151. background: #fef0f0;
  152. color: #e14545;
  153. "
  154. >
  155. 未授权
  156. </div>
  157. <!-- <img src="../../assets/img/home/isA.png" style="width: 80px;"/> -->
  158. <!-- <div style="color: #d52121">未授权</div> -->
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="recently">
  168. <!-- <div class="recently_bottom_font">
  169. 最近测试结果: {{ planData.planName }} &nbsp;&nbsp;&nbsp;&nbsp;<span
  170. style="cursor: pointer; color: #00bf78"
  171. @click="queryDetail"
  172. >查看详情</span
  173. >
  174. </div> -->
  175. <div class="block_left">
  176. <div class="block_ren">
  177. <div class="re">最近测评结果</div>
  178. <!-- 当没有测试计划是则不显示 -->
  179. <div class="detail" v-show="planData.hasOwnProperty('planName')">
  180. <img
  181. @click="queryDetail"
  182. style="width: 80px; cursor: pointer"
  183. src="../../assets//img/home/detail.png"
  184. alt=""
  185. />
  186. </div>
  187. </div>
  188. <div style="width: 100%">
  189. <div class="block_table">
  190. <div class="block_detail">计划名称</div>
  191. <div class="block_detail">测试人数</div>
  192. <div class="block_detail">测试时间</div>
  193. </div>
  194. <div class="block_body">
  195. <div
  196. v-if="planData.hasOwnProperty('planName')"
  197. style="display: flex; padding-left: 20px; padding-right: 20px; flex: 1"
  198. >
  199. <!-- <div style='width:20px'></div> -->
  200. <div class="block_detail">
  201. <!-- {{ planData.planName }} -->
  202. <span class="plan_dp" :title="planData.planName">
  203. {{ planData.planName }}</span
  204. >
  205. </div>
  206. <div class="block_detail">
  207. <span class="plan_dp" :title="planData.userNum">
  208. {{ planData.userNum }}</span
  209. >
  210. </div>
  211. <div class="block_detail">
  212. <span class="plan_dp" :title="planData.createTime">
  213. {{ planData.createTime }}</span
  214. >
  215. </div>
  216. </div>
  217. <div v-else style="width: 100%; text-align: center; margin-top: 10px">
  218. <div>暂无数据</div>
  219. </div>
  220. </div>
  221. </div>
  222. <div
  223. v-if="planData.hasOwnProperty('planName')"
  224. class="echarts_style"
  225. ref="echarts_zhu"
  226. ></div>
  227. <div
  228. v-else
  229. style="
  230. display: flex;
  231. align-items: center;
  232. justify-content: center;
  233. height: 100%;
  234. "
  235. >
  236. <span style="text-align: center">暂无数据</span>
  237. </div>
  238. </div>
  239. <div class="block_right">
  240. <div class="right_zu">
  241. <div class="cpqs">
  242. 测评趋势<span style="font-size: 16px; margin-left: 10px"
  243. >(近期10次测试趋势图)</span
  244. >
  245. </div>
  246. <div
  247. v-if="planData.hasOwnProperty('planName')"
  248. class="block_lei"
  249. ref="echarts_lei"
  250. ></div>
  251. <div
  252. v-else
  253. style="
  254. display: flex;
  255. justify-content: center;
  256. align-items: center;
  257. height: 100%;
  258. "
  259. >
  260. 暂无数据
  261. </div>
  262. </div>
  263. </div>
  264. </div>
  265. <PlanReport ref="register" />
  266. </div>
  267. </template>
  268. <script>
  269. import { oSessionStorage } from "../../utils/utils";
  270. import * as echarts from "echarts";
  271. import PieChart from "@/components/PieChart";
  272. import PlanReport from "@/components/PlanReport";
  273. export default {
  274. components: {
  275. PieChart,
  276. PlanReport,
  277. },
  278. data() {
  279. return {
  280. tableData: [],
  281. pageSize: 10,
  282. pageNum: 1,
  283. userInfo: {},
  284. echarts_zhu: "",
  285. option: {},
  286. echarts_lei: "",
  287. option_lei: {},
  288. //获取总人数字段
  289. //返回的总人数字段
  290. peopleData: {},
  291. //返回的最新的计划字段
  292. planData: {},
  293. planId: "",
  294. //组织下已选的专业
  295. profession: "",
  296. //组织下专业
  297. professionOptions: [],
  298. //各个维度平均分的数组
  299. avgData: [],
  300. options1: [],
  301. options2: [],
  302. options3: [],
  303. options4: [],
  304. options5: [],
  305. options6: [],
  306. abnormalNum: 0,
  307. };
  308. },
  309. mounted() {
  310. this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
  311. //查询最新人数统计
  312. this.queryAllPeople();
  313. //查询最新计划
  314. this.findNewPlan();
  315. //查询最近计划
  316. this.searchList();
  317. this.option = {
  318. title: {
  319. text: "",
  320. },
  321. tooltip: {
  322. trigger: "axis",
  323. axisPointer: {
  324. type: "shadow",
  325. // shadowStyle:{
  326. // color:'rgba(0,0,0,0.5)',
  327. // shadowBlur: 10,
  328. // shadowOffsetX:0,
  329. // shadowOffsetY:'0'
  330. // }
  331. },
  332. formatter: function (params) {
  333. var relVal = "";
  334. let na = params[0].name;
  335. for (var i = 0, l = params.length; i < l; i++) {
  336. relVal += params[i].marker + na + " : " + params[i].value + "%";
  337. }
  338. return relVal;
  339. },
  340. // formatter: "{b} : {c} % ",
  341. // formatter: function (params,trigger) {
  342. // return '{a} <br/>{b} : {c} <br/>百分比 : {d}%'
  343. // },
  344. },
  345. legend: {},
  346. grid: {
  347. left: "3%",
  348. right: "4%",
  349. bottom: "3%",
  350. containLabel: true,
  351. },
  352. xAxis: {
  353. type: "category",
  354. data: [],
  355. axisLabel: {
  356. interval: 0,
  357. },
  358. // axisLabel: {
  359. // width: 40, //设置内容宽度
  360. // // overflow:'break',
  361. // overflow: "truncate",
  362. // },
  363. // axisLabel: {
  364. // formatter: function (params) {
  365. // return "中等分值";
  366. // },
  367. // },
  368. },
  369. // dataZoom: {
  370. // type: "inside", //放大缩小x轴数值
  371. // },
  372. yAxis: {
  373. // max: 100,
  374. name: "占比(%)",
  375. type: "value",
  376. boundaryGap: [0, 0.01],
  377. minInterval: 1,
  378. },
  379. series: [
  380. {
  381. type: "bar",
  382. data: [],
  383. barWidth: "15", //修改柱状图的宽度
  384. itemStyle: {
  385. color: new echarts.graphic.LinearGradient(
  386. //前四个参数用于配置渐变色的起止位置,这四个参数依次对应 右下左上 四个方位。也就是从右边开始顺时针方向。
  387. //通过修改前4个参数,可以实现不同的渐变方向
  388. /*第五个参数则是一个数组,用于配置颜色的渐变过程。
  389. 每项为一个对象,包含offset和color两个参数
  390. */
  391. 0,
  392. 0,
  393. 0,
  394. 1,
  395. [
  396. {
  397. //代表渐变色从正上方开始
  398. offset: 0, //offset范围是0~1,用于表示位置,0是指0%处的颜色
  399. color: "#644BFD",
  400. }, //柱图渐变色
  401. {
  402. offset: 1, //指100%处的颜色
  403. color: "#00F6E3",
  404. },
  405. ]
  406. ),
  407. borderWidth: 2,
  408. // borderColor: "#2EE053",
  409. barBorderRadius: [10, 10, 10, 10], //修改柱状图圆角
  410. },
  411. label: {
  412. show: true,
  413. position: "top",
  414. color: "#006FFF",
  415. formatter: function (params) {
  416. return params.value + "%";
  417. },
  418. },
  419. },
  420. ],
  421. };
  422. // echarts.init(this.echarts_zhu).setOption(this.option);
  423. this.option_lei = {
  424. title: {
  425. text: "",
  426. },
  427. // tooltip: {
  428. // trigger: "axis",
  429. // },
  430. tooltip: {
  431. trigger: "axis",
  432. axisPointer: {
  433. type: "shadow",
  434. },
  435. // formatter: '{b} : {c} % '
  436. // formatter: function (params,trigger) {
  437. formatter: function (params) {
  438. var relVal = params[0].name;
  439. for (var i = 0, l = params.length; i < l; i++) {
  440. relVal +=
  441. "<br/>" +
  442. params[i].marker +
  443. params[i].seriesName +
  444. " : " +
  445. params[i].value +
  446. "%";
  447. }
  448. return relVal;
  449. },
  450. // return '{a} <br/>{b} : {c} <br/>百分比 : {d}%'
  451. // },
  452. },
  453. legend: {
  454. data: ["焦虑", "抑郁", "压力", "视觉整合能力", "心理健康"],
  455. },
  456. grid: {
  457. left: "3%",
  458. right: "4%",
  459. bottom: "3%",
  460. containLabel: true,
  461. },
  462. toolbox: {
  463. feature: {
  464. // saveAsImage: {},
  465. },
  466. },
  467. xAxis: {
  468. type: "category",
  469. boundaryGap: false,
  470. data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
  471. axisLabel: {
  472. interval: 0,
  473. // rotate:'-90',
  474. formatter: function (value) {
  475. // return ''
  476. // return value
  477. return value.substring(0, 4) + "...";
  478. },
  479. },
  480. },
  481. yAxis: {
  482. max: 100,
  483. type: "value",
  484. name: "占比(%)",
  485. },
  486. series: [
  487. {
  488. name: "焦虑",
  489. type: "line",
  490. data: [],
  491. },
  492. {
  493. name: "抑郁",
  494. type: "line",
  495. data: [],
  496. },
  497. {
  498. name: "压力",
  499. type: "line",
  500. data: [],
  501. },
  502. {
  503. name: "精神障碍",
  504. type: "line",
  505. data: [],
  506. },
  507. {
  508. name: "心理健康",
  509. type: "line",
  510. data: [],
  511. },
  512. ],
  513. };
  514. this.queryDetailScore();
  515. //当屏幕变化自适应大小
  516. window.addEventListener("resize", this.echartsAllSize);
  517. },
  518. destroyed() {
  519. window.removeEventListener("resize", this.echartsAllSize);
  520. },
  521. methods: {
  522. //设置图标自适应
  523. echartsAllSize() {
  524. let flag = false;
  525. setTimeout(() => {
  526. flag = true;
  527. if (flag) {
  528. //设置变化的大小
  529. console.log("大小变化了---------------------");
  530. let myChart = this.$echarts.init(this.$refs.echarts_zhu);
  531. myChart.resize();
  532. let myChart1 = this.$echarts.init(this.$refs.echarts_lei);
  533. myChart1.resize();
  534. }
  535. }, 1000);
  536. },
  537. queryDetail() {
  538. console.log(this.planData);
  539. debugger;
  540. this.$refs.register.open(this.planData);
  541. },
  542. //根据组织编号查询总人数
  543. queryAllPeople() {
  544. let url = `/user/countUserByOrgNo?orgNo=${this.userInfo.orgNo}`;
  545. this.$http.get(url, {}, (res) => {
  546. if (res && res.code == 200) {
  547. this.peopleData = res.data;
  548. // this.tableData = res.data.content;
  549. // this.total = res.data.totalElements;
  550. } else {
  551. // this.$toast.fail(res.msg);
  552. this.$message.error(res.msg);
  553. }
  554. });
  555. },
  556. searchList() {
  557. let url = `/plan/findListByPage?pageSize=${this.pageSize}&pageNum=${this.pageNum}&orgNo=${this.userInfo.orgNo}`;
  558. this.$http.get(url, {}, (res) => {
  559. if (res && res.code == 200) {
  560. this.tableData = res.data.content;
  561. // this.total = res.data.totalElements;
  562. } else {
  563. // this.$toast.fail(res.msg);
  564. this.$message.error(res.msg);
  565. }
  566. });
  567. },
  568. //查询最新结束的计划
  569. findNewPlan() {
  570. let url = `/plan/findNewCompletedPlan?orgNo=${this.userInfo.orgNo}`;
  571. this.$http.get(url, {}, (res) => {
  572. if (res && res.code == 200) {
  573. if (res.data != null) {
  574. this.planId = res.data.id;
  575. let list = Object.entries(res.data);
  576. //开始过滤
  577. let list1 = list.filter(([key, val]) => {
  578. return (
  579. key == "planName" ||
  580. key == "planOrgName" ||
  581. key == "createTime" ||
  582. key == "userNum" ||
  583. key == "id" ||
  584. key == "planType"
  585. );
  586. });
  587. let list2 = Object.fromEntries(list1);
  588. debugger;
  589. this.planData = list2;
  590. //调用各个专业不同总分人数
  591. // this.isScore();
  592. // this.getPlanDimNun();
  593. this.isFin();
  594. }
  595. } else {
  596. // this.$toast.fail(res.msg);
  597. this.$message.error(res.msg);
  598. }
  599. });
  600. },
  601. //查询统计端的--心理健康异常的人员
  602. isAbnormal() {
  603. //调用接口返回信息
  604. let url = `/planUser/countCompletedUserHighRisk?planId=${this.planId}`;
  605. this.$http.get(url, {}, (res) => {
  606. if (res.code == 200) {
  607. // this.unComplete = res.data[0];
  608. // this.completeNum = res.data[1];
  609. this.abnormalNum = res.data;
  610. this.getPlanDimNun();
  611. }
  612. });
  613. },
  614. //管理端统计完成情况
  615. isFin() {
  616. //调用接口返回信息
  617. let url = `/plan/countComplete?planId=${this.planId}`;
  618. this.$http.get(url, {}, (res) => {
  619. if (res.code == 200) {
  620. this.unComplete = res.data[0];
  621. this.completeNum = res.data[1];
  622. this.isAbnormal();
  623. }
  624. });
  625. },
  626. //查询各个维度占比
  627. getPlanDimNun() {
  628. this.$http.get(
  629. `userRecordScore/countNumByPlanDim?planId=${this.planId}`,
  630. {},
  631. (res) => {
  632. let dimensionList = res.data;
  633. let nameList = [];
  634. nameList.push("心理健康");
  635. nameList.push("抑郁");
  636. nameList.push("压力");
  637. nameList.push("焦虑");
  638. nameList.push("视觉整合能力");
  639. let scoreList = [];
  640. scoreList.push(
  641. this.completeNum == 0
  642. ? 0
  643. : (
  644. ((this.completeNum - this.abnormalNum) / this.completeNum) *
  645. 100
  646. ).toFixed(2)
  647. );
  648. scoreList.push(
  649. this.completeNum == 0
  650. ? 0
  651. : ((dimensionList[1]["抑郁"] / this.completeNum) * 100).toFixed(2)
  652. );
  653. scoreList.push(
  654. this.completeNum == 0
  655. ? 0
  656. : ((dimensionList[2]["压力"] / this.completeNum) * 100).toFixed(2)
  657. );
  658. scoreList.push(
  659. this.completeNum == 0
  660. ? 0
  661. : ((dimensionList[0]["焦虑"] / this.completeNum) * 100).toFixed(2)
  662. );
  663. scoreList.push(
  664. this.completeNum == 0
  665. ? 0
  666. : ((dimensionList[3]["视觉整合能力"] / this.completeNum) * 100).toFixed(2)
  667. );
  668. this.echarts_zhu = this.$refs.echarts_zhu;
  669. this.option.xAxis.data = nameList;
  670. this.option.series[0].data = scoreList;
  671. let myChart1 = echarts.init(this.echarts_zhu);
  672. myChart1.setOption(this.option);
  673. }
  674. );
  675. },
  676. //各个专业不同总分人数
  677. isScore() {
  678. let url = `/plan/countTotalNumber?planId=${this.planId}`;
  679. this.$http.get(url, {}, (res) => {
  680. if (res.code == 200) {
  681. let nameList = [];
  682. let scoreList = [];
  683. for (const item in res.data) {
  684. //
  685. nameList.push(item);
  686. scoreList.push(res.data[item]);
  687. }
  688. // nameList= ["中等", "高等", "低等", "多喝", "大"]
  689. // console.log(nameList)
  690. this.echarts_zhu = this.$refs.echarts_zhu;
  691. this.option.xAxis.data = nameList;
  692. this.option.series[0].data = scoreList;
  693. let myChart1 = echarts.init(this.echarts_zhu);
  694. myChart1.setOption(this.option);
  695. }
  696. });
  697. },
  698. //获取子组织
  699. // getOrg() {
  700. // let url = `/org/findChildOrg?orgNo=${this.userInfo.orgNo}`;
  701. // this.$http.get(url, {}, (res) => {
  702. // if (res && res.code == 200) {
  703. // if (res.data.length > 0) {
  704. // let list = [];
  705. // for (let i = 0; i < res.data.length; i++) {
  706. // let obj = { value: "", label: "" };
  707. // obj.value = res.data[i].orgNo;
  708. // obj.label = res.data[i].orgName;
  709. // list.push(obj);
  710. // }
  711. // this.professionOptions = list;
  712. // this.profession = list[0].value;
  713. // //然后根据选择的这个选项、、查询具体数据
  714. // this.queryDetailScore(list[0].value);
  715. // }
  716. // } else {
  717. // // this.$toast.fail(res.msg);
  718. // this.$message.error(res.msg);
  719. // }
  720. // });
  721. // },
  722. //查看各个组织下各个维度的平均得分
  723. queryDetailScore() {
  724. let url = `/plan/countRecentPlanDetails`;
  725. this.$http.get(url, {}, (res) => {
  726. if (res.code == 200) {
  727. this.avgData = res.data;
  728. let scoreList = [
  729. {
  730. name: "焦虑",
  731. type: "line",
  732. stack: "Total",
  733. data: [],
  734. symbolSize: 6,
  735. lineStyle: {
  736. // type: "dashed",
  737. width: 3,
  738. },
  739. },
  740. {
  741. name: "抑郁",
  742. type: "line",
  743. data: [],
  744. symbolSize: 6,
  745. lineStyle: {
  746. // type: "dashed",
  747. width: 3,
  748. },
  749. },
  750. {
  751. name: "压力",
  752. type: "line",
  753. data: [],
  754. symbolSize: 6,
  755. lineStyle: {
  756. // type: "dashed",
  757. width: 3,
  758. },
  759. },
  760. {
  761. name: "视觉整合能力",
  762. type: "line",
  763. data: [],
  764. symbolSize: 6,
  765. lineStyle: {
  766. type: "dashed",
  767. width: 3,
  768. },
  769. },
  770. {
  771. name: "心理健康",
  772. type: "line",
  773. data: [],
  774. symbolSize: 6,
  775. lineStyle: {
  776. type: "dashed",
  777. width: 3,
  778. },
  779. },
  780. ];
  781. let nameList = [];
  782. if (res.data.length > 0) {
  783. //
  784. for (let i = 0; i < res.data.length; i++) {
  785. let k = Object.keys(res.data[i])[0];
  786. nameList.push(k);
  787. let subList = res.data[i][k];
  788. for (let j = 0; j < subList.length; j++) {
  789. //当前对象 例如 //{"焦虑":"1"}
  790. let currentObj = subList[j];
  791. //修改焦虑
  792. if (currentObj.hasOwnProperty("焦虑")) {
  793. //
  794. scoreList[0].data.push(currentObj["焦虑"]);
  795. }
  796. //修改抑郁
  797. if (currentObj.hasOwnProperty("抑郁")) {
  798. //
  799. scoreList[1].data.push(currentObj["抑郁"]);
  800. }
  801. //压力
  802. if (currentObj.hasOwnProperty("压力")) {
  803. //
  804. scoreList[2].data.push(currentObj["压力"]);
  805. }
  806. //精神障碍
  807. if (currentObj.hasOwnProperty("视觉整合能力")) {
  808. //
  809. scoreList[3].data.push(currentObj["视觉整合能力"]);
  810. }
  811. //心理健康
  812. if (currentObj.hasOwnProperty("心理健康")) {
  813. //
  814. scoreList[4].data.push(currentObj["心理健康"]);
  815. }
  816. }
  817. }
  818. }
  819. //设置总共维度
  820. //测试计划---
  821. //修改option
  822. this.echarts_lei = this.$refs.echarts_lei;
  823. this.option_lei.xAxis.data = nameList;
  824. this.option_lei.series = scoreList;
  825. echarts.init(this.echarts_lei).setOption(this.option_lei);
  826. }
  827. });
  828. },
  829. //选择的专业改变后接着调用
  830. // professionChange(val) {
  831. // this.queryDetailScore(val);
  832. // },
  833. //状态---
  834. planStatusFun(val) {
  835. let planStatus = val.planStatus;
  836. if (planStatus == "1") {
  837. return "未开始";
  838. } else if (planStatus == "2") {
  839. return "进行中";
  840. } else if (planStatus == "3") {
  841. return "已完成";
  842. } else {
  843. return val.planStatus;
  844. }
  845. },
  846. },
  847. };
  848. </script>
  849. <style lang="less" scoped>
  850. @font-face {
  851. font-family: "Electronic";
  852. src: url("../../assets/font/sjxk.ttf") format("truetype");
  853. }
  854. .computer::-webkit-scrollbar {
  855. width: 6px;
  856. }
  857. .computer::-webkit-scrollbar-track {
  858. background: rgb(239, 239, 239);
  859. border-radius: 2px;
  860. }
  861. .computer::-webkit-scrollbar-thumb {
  862. background: #40a0ff49;
  863. border-radius: 10px;
  864. }
  865. .computer::-webkit-scrollbar-thumb:hover {
  866. background: #40a0ff;
  867. }
  868. .table_a::-webkit-scrollbar {
  869. width: 6px;
  870. }
  871. .table_a::-webkit-scrollbar-track {
  872. background: rgb(239, 239, 239);
  873. border-radius: 2px;
  874. }
  875. .table_a::-webkit-scrollbar-thumb {
  876. background: #afafaf49;
  877. border-radius: 10px;
  878. }
  879. .table_a::-webkit-scrollbar-thumb:hover {
  880. background: #b6b6b6;
  881. }
  882. .pp {
  883. display: flex;
  884. flex-direction: column;
  885. /* justify-content: center; */
  886. height: 100%;
  887. width: 100%;
  888. background-color: #f7f7f7;
  889. // background-color: aqua;
  890. .general_situation {
  891. height: 260px;
  892. width: 100%;
  893. display: flex;
  894. min-width: 980px;
  895. .number_people {
  896. position: relative;
  897. background: url(../../assets/img/home/bg.png) no-repeat;
  898. background-size: cover;
  899. border-radius: 20px;
  900. flex: 5;
  901. overflow: hidden;
  902. // background-color: #48d68e;
  903. display: flex;
  904. flex-direction: column;
  905. .number_people_top {
  906. margin-top: 20px;
  907. margin-left: 20px;
  908. color: #ffffff;
  909. font-size: 20px;
  910. letter-spacing: 3px;
  911. margin-bottom: 20px;
  912. // font-weight: 700;
  913. }
  914. .number_people_yuan {
  915. flex: 1;
  916. // display: flex;
  917. color: #113a27;
  918. .out {
  919. border-radius: 20px;
  920. margin-left: 20px;
  921. // background-color: #7fe2b0;
  922. display: flex;
  923. flex-direction: column;
  924. height: 100%;
  925. .yuan_name {
  926. // text-decoration: underline;
  927. // text-decoration-color: #113a27;
  928. // height: 80px;
  929. // flex: 1;
  930. margin-right: 100px;
  931. // flex: 1;
  932. // background-color: #0d3bb1;
  933. // margin-left: 20px;
  934. margin-top: 10px;
  935. color: #113a27;
  936. letter-spacing: 3px;
  937. font-size: 34px;
  938. font-family: Electronic;
  939. overflow: hidden;
  940. text-overflow: ellipsis;
  941. display: -webkit-box;
  942. /* autoprefixer: ignore next */
  943. -webkit-box-orient: vertical;
  944. -webkit-line-clamp: 2;
  945. // word-wrap: break-word;
  946. // text-overflow: ellipsis;
  947. // display: -webkit-box;
  948. // /* autoprefixer: off */
  949. // -webkit-box-orient: vertical;
  950. // /* autoprefixer: on */
  951. // -webkit-line-clamp: 2;
  952. }
  953. .yuan_people {
  954. text-align: right;
  955. margin-bottom: 16px;
  956. margin-right: 20px;
  957. flex: 1;
  958. display: flex;
  959. justify-content: flex-end;
  960. align-items: end;
  961. padding-bottom: 12px;
  962. // color: #ffffff;
  963. // font-size: 60px;
  964. // letter-spacing: 3px;
  965. // text-decoration:underline;
  966. .people_t {
  967. color: #ffffff;
  968. font-size: 20px;
  969. letter-spacing: 3px;
  970. }
  971. .people_n {
  972. background-image: linear-gradient(0deg, #0d3bb1 0%, #00c0ff 100%);
  973. background-clip: text;
  974. -webkit-background-clip: text;
  975. -webkit-text-fill-color: transparent;
  976. color: #ffffff;
  977. font-size: 36px;
  978. letter-spacing: 3px;
  979. text-decoration: underline;
  980. text-decoration-color: #ffffff;
  981. // text-decoration-style: dotted;
  982. text-decoration-thickness: from-font;
  983. // text-decoration-thickness: 0.5px;
  984. }
  985. .people_r {
  986. color: #ffffff;
  987. font-size: 20px;
  988. letter-spacing: 3px;
  989. }
  990. }
  991. }
  992. .computer {
  993. max-height: 140px;
  994. // height: 140px;
  995. overflow-y: auto;
  996. flex: 1;
  997. display: flex;
  998. width: 100%;
  999. flex-wrap: wrap;
  1000. justify-content: start;
  1001. .computer_detail {
  1002. width: 140px;
  1003. // height: 20px;
  1004. padding: 10px;
  1005. }
  1006. }
  1007. }
  1008. }
  1009. .plan {
  1010. display: flex;
  1011. // height:30%;
  1012. flex: 10;
  1013. .plan_inner {
  1014. padding: 20px;
  1015. border-radius: 20px;
  1016. margin-left: 20px;
  1017. background-color: #ffffff;
  1018. display: flex;
  1019. width: 100%;
  1020. flex-direction: column;
  1021. .plan_top {
  1022. font-size: 20px;
  1023. letter-spacing: 3px;
  1024. font-weight: 700;
  1025. color: #000000;
  1026. margin-bottom: 20px;
  1027. }
  1028. //表头
  1029. .table_header {
  1030. display: flex;
  1031. // justify-content: space-around;
  1032. background-color: #00bf78;
  1033. border-radius: 20px;
  1034. line-height: 40px;
  1035. font-weight: 700;
  1036. font-size: 18px;
  1037. letter-spacing: 3px;
  1038. color: #ffffff;
  1039. .detail {
  1040. flex: 1;
  1041. text-align: center;
  1042. }
  1043. }
  1044. .table_a {
  1045. overflow-y: auto;
  1046. .table_body {
  1047. display: flex;
  1048. // justify-content: space-around;
  1049. line-height: 42px;
  1050. .detail {
  1051. display: inline-block;
  1052. white-space: nowrap;
  1053. overflow: hidden;
  1054. text-overflow: ellipsis;
  1055. width: 100%;
  1056. flex: 1;
  1057. text-align: center;
  1058. }
  1059. }
  1060. }
  1061. }
  1062. }
  1063. }
  1064. .recently {
  1065. width: 100%;
  1066. background-color: #f7f7f7;
  1067. height: calc(100% - 260px);
  1068. display: flex;
  1069. flex-direction: row;
  1070. align-items: center;
  1071. margin-top: 20px;
  1072. .block_left {
  1073. // box-sizing: border-box;
  1074. // padding:10px;
  1075. border-radius: 20px;
  1076. display: flex;
  1077. // padding-left: 10px;
  1078. flex-direction: column;
  1079. // padding: 10px;
  1080. flex: 5;
  1081. background-color: #ffffff;
  1082. height: 100%;
  1083. width: 100%;
  1084. align-items: center;
  1085. // background-color: #ffffff;
  1086. .block_ren {
  1087. padding-top: 10px;
  1088. // padding-right: 20px;
  1089. width: 100%;
  1090. display: flex;
  1091. justify-content: space-between;
  1092. align-items: center;
  1093. .re {
  1094. letter-spacing: 3px;
  1095. padding: 0 20px;
  1096. color: #222222;
  1097. font-weight: 700;
  1098. font-size: 20px;
  1099. }
  1100. .detail {
  1101. padding: 0 20px;
  1102. }
  1103. }
  1104. .chart_wrap {
  1105. flex: 1;
  1106. // height: 450px;
  1107. }
  1108. .block_table {
  1109. margin-top: 10px;
  1110. margin-left: 20px;
  1111. margin-right: 20px;
  1112. background-color: #f8f8f8;
  1113. border-radius: 20px;
  1114. display: flex;
  1115. .block_detail {
  1116. font-weight: 700;
  1117. padding: 10px;
  1118. flex: 1;
  1119. display: flex;
  1120. justify-content: center;
  1121. }
  1122. }
  1123. .block_body {
  1124. width: 100%;
  1125. display: flex;
  1126. min-width: 0;
  1127. .block_detail {
  1128. background-color: #ffffff;
  1129. text-align: center;
  1130. line-height: 36px;
  1131. display: flex;
  1132. flex: 1;
  1133. min-width: 0;
  1134. overflow: hidden;
  1135. .plan_dp {
  1136. display: flex;
  1137. width: 100%;
  1138. // justify-content: center;
  1139. text-align: center;
  1140. // flex: 1;
  1141. -webkit-line-clamp: 1;
  1142. display: -webkit-box;
  1143. -webkit-box-orient: vertical;
  1144. }
  1145. }
  1146. }
  1147. .profession {
  1148. font-weight: 700;
  1149. }
  1150. .echarts_style {
  1151. width: 100%;
  1152. flex: 1;
  1153. // background-color: #000000;
  1154. }
  1155. }
  1156. .block_right {
  1157. // box-sizing: border-box;
  1158. // background-color: #00bf78;
  1159. flex: 10;
  1160. // background-color: #d32d2d;
  1161. height: 100%;
  1162. display: flex;
  1163. flex-direction: column;
  1164. // background-color: #f7f7f7;
  1165. .right_zu {
  1166. border-radius: 20px;
  1167. margin-left: 20px;
  1168. background-color: #ffffff;
  1169. flex: 10;
  1170. // background-color: #d32d2d;
  1171. height: 100%;
  1172. display: flex;
  1173. flex-direction: column;
  1174. .cpqs {
  1175. margin-top: 10px;
  1176. margin-left: 20px;
  1177. font-size: 20px;
  1178. letter-spacing: 3px;
  1179. font-weight: 700;
  1180. }
  1181. .block_lei {
  1182. flex: 1;
  1183. // background-color: #000000;
  1184. margin-left: 20px;
  1185. }
  1186. }
  1187. .block_avg {
  1188. margin-left: 20px;
  1189. font-weight: 700;
  1190. }
  1191. }
  1192. }
  1193. }
  1194. </style>