index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. <template>
  2. <div class="portrait">
  3. <backPage v-if="$route.query.gotype == 1" tit="教师画像"></backPage>
  4. <div class="p_top" v-if="timeSort.length >1">
  5. <el-select v-model="selectTime" placeholder="请选择" @change="changeTimeSort">
  6. <el-option
  7. v-for="item in timeSort"
  8. :key="item.id"
  9. :label="item.label"
  10. :value="item.id">
  11. </el-option>
  12. </el-select>
  13. </div>
  14. <div class="p_bottom">
  15. <div class="p_left">
  16. <div class="p_l_top">
  17. <div class="teachingActivity" v-loading="cardNumLoading">
  18. <img :src="require('../../../../../assets/icon/testPerson/bg1.png')" alt="">
  19. <div>
  20. <span>教学活动</span>
  21. <el-tooltip
  22. class="item"
  23. effect="light"
  24. content="教学活动"
  25. placement="top"
  26. >
  27. <svg
  28. width="16"
  29. height="16"
  30. viewBox="0 0 16 16"
  31. fill="none"
  32. xmlns="http://www.w3.org/2000/svg"
  33. >
  34. <path
  35. d="M7.50562 11.9998V6.5H8.50562V11.9998H7.50562Z"
  36. fill="black"
  37. fill-opacity="0.4"
  38. />
  39. <path
  40. d="M8.59985 4H7.3999V5.19995H8.59985V4Z"
  41. fill="black"
  42. fill-opacity="0.4"
  43. />
  44. <path
  45. d="M1 8C1 11.866 4.13403 15 8 15C11.866 15 15 11.866 15 8C15 4.13403 11.866 1 8 1C4.13403 1 1 4.13403 1 8ZM2 8C2 4.68628 4.68628 2 8 2C11.3137 2 14 4.68628 14 8C14 11.3137 11.3137 14 8 14C4.68628 14 2 11.3137 2 8Z"
  46. fill="black"
  47. fill-opacity="0.4"
  48. />
  49. </svg>
  50. </el-tooltip>
  51. </div>
  52. <span style="color: #3681FC;">{{ teachingActivityNum }}</span>
  53. </div>
  54. <div class="teachingAndResearchActivities" v-loading="cardNumLoading">
  55. <img :src="require('../../../../../assets/icon/testPerson/bg2.png')" alt="">
  56. <div>
  57. <span>教研活动</span>
  58. <el-tooltip
  59. class="item"
  60. effect="light"
  61. content="教研活动"
  62. placement="top"
  63. >
  64. <svg
  65. width="16"
  66. height="16"
  67. viewBox="0 0 16 16"
  68. fill="none"
  69. xmlns="http://www.w3.org/2000/svg"
  70. >
  71. <path
  72. d="M7.50562 11.9998V6.5H8.50562V11.9998H7.50562Z"
  73. fill="black"
  74. fill-opacity="0.4"
  75. />
  76. <path
  77. d="M8.59985 4H7.3999V5.19995H8.59985V4Z"
  78. fill="black"
  79. fill-opacity="0.4"
  80. />
  81. <path
  82. d="M1 8C1 11.866 4.13403 15 8 15C11.866 15 15 11.866 15 8C15 4.13403 11.866 1 8 1C4.13403 1 1 4.13403 1 8ZM2 8C2 4.68628 4.68628 2 8 2C11.3137 2 14 4.68628 14 8C14 11.3137 11.3137 14 8 14C4.68628 14 2 11.3137 2 8Z"
  83. fill="black"
  84. fill-opacity="0.4"
  85. />
  86. </svg>
  87. </el-tooltip>
  88. </div>
  89. <span style="color: #F2873B;">{{
  90. teachingAndResearchActivitiesNum
  91. }}</span>
  92. </div>
  93. <div
  94. class="trainingActivity"
  95. v-show="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'"
  96. v-loading="cardNumLoading"
  97. >
  98. <img :src="require('../../../../../assets/icon/testPerson/bg3.png')" alt="">
  99. <div>
  100. <span>培训活动</span>
  101. <el-tooltip
  102. class="item"
  103. effect="light"
  104. content="培训活动"
  105. placement="top"
  106. >
  107. <svg
  108. width="16"
  109. height="16"
  110. viewBox="0 0 16 16"
  111. fill="none"
  112. xmlns="http://www.w3.org/2000/svg"
  113. >
  114. <path
  115. d="M7.50562 11.9998V6.5H8.50562V11.9998H7.50562Z"
  116. fill="black"
  117. fill-opacity="0.4"
  118. />
  119. <path
  120. d="M8.59985 4H7.3999V5.19995H8.59985V4Z"
  121. fill="black"
  122. fill-opacity="0.4"
  123. />
  124. <path
  125. d="M1 8C1 11.866 4.13403 15 8 15C11.866 15 15 11.866 15 8C15 4.13403 11.866 1 8 1C4.13403 1 1 4.13403 1 8ZM2 8C2 4.68628 4.68628 2 8 2C11.3137 2 14 4.68628 14 8C14 11.3137 11.3137 14 8 14C4.68628 14 2 11.3137 2 8Z"
  126. fill="black"
  127. fill-opacity="0.4"
  128. />
  129. </svg>
  130. </el-tooltip>
  131. </div>
  132. <span style="color: #31B476;">{{ teachingActivityNum }}</span>
  133. </div>
  134. </div>
  135. <div class="p_l_bottom">
  136. <div class="p_title">
  137. <span>教研活动</span>
  138. </div>
  139. <div class="p_eCharts" v-loading="eChartsLoading">
  140. <eChartView
  141. :data="teachingAndResearchActivitiesECharts"
  142. v-if="!eChartsLoading"
  143. />
  144. </div>
  145. </div>
  146. </div>
  147. <div
  148. class="p_center"
  149. v-if="ExamineBase.length > 0 && annualAssessmentECharts.radar.indicator.length > 0"
  150. v-loading="annualAssessmentLoading"
  151. >
  152. <div class="p_title">
  153. <span>年度考核</span>
  154. <div>
  155. <el-button-group>
  156. <el-button
  157. v-if="bArray.length"
  158. @click="changeAnnualAssessmentStatus(2)"
  159. :type="annualAssessmentStatus === 2 ? 'primary' : ''"
  160. >专任教师</el-button
  161. >
  162. <el-button
  163. v-if="aArray.length"
  164. @click="changeAnnualAssessmentStatus(1)"
  165. :type="annualAssessmentStatus === 1 ? 'primary' : ''"
  166. >班主任</el-button
  167. >
  168. </el-button-group>
  169. </div>
  170. </div>
  171. <div class="p_eCharts" v-if="!annualAssessmentLoading">
  172. <eChartView
  173. ref="annualAssessmentEChartsRef"
  174. :data="annualAssessmentECharts"
  175. />
  176. </div>
  177. </div>
  178. <div class="p_center" v-else>
  179. <img :src="require('../../../../../assets/icon/testPerson/bg4.png')" alt="">
  180. </div>
  181. <div class="p_right">
  182. <div class="p_r_top">
  183. <div class="p_title">
  184. <span>教学活动</span>
  185. </div>
  186. <div class="p_eCharts" v-loading="eChartsLoading">
  187. <eChartView :data="teachingActivityECharts" v-if="!eChartsLoading" />
  188. </div>
  189. </div>
  190. <div class="p_r_bottom">
  191. <div class="p_title">
  192. <span>跨学科情况</span>
  193. </div>
  194. <div class="p_eCharts" v-loading="eChartsLoading">
  195. <chordDiagramView
  196. :data="interdisciplinarySituationECharts"
  197. v-if="!eChartsLoading"
  198. />
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </template>
  205. <script>
  206. import eChartView from "./eChartView.vue";
  207. import chordDiagramView from "./chordDiagramView.vue";
  208. import backPage from "../../components/backPage.vue";
  209. var OpenCC = require("opencc-js");
  210. let converter = OpenCC.Converter({
  211. from: "hk",
  212. to: "cn"
  213. });
  214. export default {
  215. components: {
  216. eChartView,
  217. chordDiagramView,
  218. backPage
  219. },
  220. props: {
  221. ExamineBase: {
  222. type: Array,
  223. default: () => []
  224. }
  225. },
  226. data() {
  227. return {
  228. teachingActivityNum: 0,
  229. teachingAndResearchActivitiesNum: 0,
  230. trainingActivityNum: 0,
  231. cardNumLoading: true,
  232. eChartsLoading: true,
  233. annualAssessmentStatus: 2, //2专任教师 1班主任
  234. teachingAndResearchActivitiesEChartsLoading: true,
  235. teachingAndResearchActivitiesECharts: {
  236. tooltip: {
  237. trigger: "axis",
  238. axisPointer: { type: "shadow" }
  239. },
  240. legend: {
  241. data: ["我发布的", "我收到的"],
  242. bottom: 0,
  243. orient: "horizontal",
  244. left: "center"
  245. },
  246. grid: {
  247. left: "3%",
  248. right: "4%",
  249. bottom: "10%",
  250. containLabel: true
  251. },
  252. xAxis: [
  253. {
  254. type: "category",
  255. data: ["评论次数", "评课次数", "字数", "语音数"]
  256. }
  257. ],
  258. yAxis: [
  259. {
  260. type: "value"
  261. }
  262. ],
  263. series: []
  264. },
  265. annualAssessmentLoading: true,
  266. annualAssessmentECharts: {
  267. legend: {
  268. data: ["自评得分率", "认定得分率", "全体教师平均得分率"],
  269. bottom: 0,
  270. textStyle: {
  271. color: "black"
  272. }
  273. },
  274. radar: {
  275. // shape: 'circle',
  276. indicator: [],
  277. name: {
  278. textStyle: {
  279. color: "black"
  280. }
  281. }
  282. },
  283. series: [
  284. {
  285. name: "",
  286. type: "radar",
  287. data: [],
  288. label: {
  289. color: "black"
  290. }
  291. }
  292. ]
  293. },
  294. teachingActivityECharts: {
  295. tooltip: {
  296. trigger: "item"
  297. },
  298. // legend: {
  299. // orient: "vertical",
  300. // right: "5%",
  301. // top: "center",
  302. // itemGap: 20
  303. // },
  304. series: [
  305. {
  306. name: "",
  307. type: "pie",
  308. radius: ["40%", "70%"],
  309. avoidLabelOverlap: false,
  310. label: {
  311. show: true,
  312. position: "outside",
  313. formatter: "{b}: {c}"
  314. },
  315. emphasis: {
  316. label: {
  317. show: true,
  318. fontSize: "20",
  319. fontWeight: "bold"
  320. }
  321. },
  322. labelLine: {
  323. show: true,
  324. length: 15,
  325. length2: 10
  326. },
  327. data: []
  328. }
  329. ]
  330. },
  331. interdisciplinarySituationECharts: {
  332. title: {
  333. text: null
  334. },
  335. chart: {
  336. backgroundColor: "rgba(0,0,0,0)"
  337. },
  338. credits: {
  339. enabled: false //不显示LOGO
  340. },
  341. tooltip: {
  342. formatter: function() {
  343. // 自定义弹窗内容的回调函数
  344. var point = this.point;
  345. if (point.from) {
  346. var tooltipText =
  347. "<b>" +
  348. point.from +
  349. "</b> - <b>" +
  350. point.to +
  351. "</b>: " +
  352. point.weight;
  353. return tooltipText;
  354. } else {
  355. var tooltipText = "<b>" + point.name + "</b>: " + point.sum;
  356. return tooltipText;
  357. }
  358. }
  359. },
  360. series: [
  361. {
  362. keys: ["from", "to", "weight"],
  363. data: [],
  364. type: "dependencywheel",
  365. name: "",
  366. dataLabels: {
  367. color: "#333",
  368. textPath: {
  369. enabled: true,
  370. attributes: {
  371. dy: 5
  372. }
  373. },
  374. distance: 10
  375. },
  376. size: "95%"
  377. }
  378. ]
  379. },
  380. userid: this.$route.query.userid,
  381. oid: this.$route.query.oid,
  382. org: this.$route.query.org,
  383. teacherName: "",
  384. aArray: [],
  385. bArray: [],
  386. timeSort:[],
  387. selectTime:"",
  388. };
  389. },
  390. methods: {
  391. // 获取页面基础ui信息
  392. getPageBase2(type) {
  393. let params = {
  394. typ: type,
  395. org: this.org,
  396. oid: this.oid
  397. };
  398. this.ajax
  399. .get(this.$store.state.api + "selectTestExamineBase", params)
  400. .then(res => {
  401. if(type == 1){
  402. this.aArray = res.data[0];
  403. }else {
  404. this.bArray = res.data[0];
  405. if(!this.bArray.length){
  406. this.changeAnnualAssessmentStatus(1)
  407. }
  408. }
  409. this.timeSort = res.data[0].map(item => {return {label:item.timeName,id:item.time,time:item.timeName.split('~')[0]}});
  410. if(this.timeSort.length>0){
  411. this.selectTime = this.timeSort[0].id;
  412. }
  413. })
  414. .catch(error => {
  415. console.log(error);
  416. });
  417. },
  418. changeAnnualAssessmentStatus(status) {
  419. if (this.annualAssessmentLoading) return;
  420. this.annualAssessmentStatus = status;
  421. this.getAnnualAssessmentEChartsData();
  422. },
  423. getAnnualAssessmentEChartsData() {
  424. this.annualAssessmentLoading = true;
  425. let params = [
  426. {
  427. oid: this.oid,
  428. org: this.org,
  429. type: this.annualAssessmentStatus,
  430. tname: this.teacherName
  431. }
  432. ];
  433. // console.log(params);
  434. this.ajax
  435. .post(this.$store.state.api + "selectTestExaminePersonData2", params)
  436. .then(res => {
  437. let data = res.data[0];
  438. if(this.selectTime && this.timeSort.length > 1 ){
  439. data = data.filter(item => item.time == this.selectTime);
  440. }
  441. console.log("👉xxx",data)
  442. data.forEach(e => {
  443. e.json = JSON.parse(e.json);
  444. });
  445. data.forEach(e => {
  446. e.evaSca = 0;
  447. e.cogSco = 0;
  448. e.step = 0;
  449. e.allStep = 0;
  450. e.json.forEach(i => {
  451. i.evaScore = 0; // 自评
  452. i.cogScore = 0; //考核
  453. i.score = 0; //考核
  454. i.children.forEach(k => {
  455. e.evaSca = e.evaSca + k.sco1 * 1;
  456. e.cogSco = e.cogSco + k.sco2 * 1;
  457. i.evaScore = i.evaScore + k.sco1 * 1;
  458. i.cogScore = i.cogScore + k.sco2 * 1;
  459. i.score = i.score + k.score * 1;
  460. e.allStep++;
  461. if (!!k.sco2 * 1) {
  462. e.step++;
  463. }
  464. });
  465. });
  466. });
  467. data.forEach(e => {
  468. if (e.step == e.allStep) {
  469. e.state = "已完成";
  470. } else {
  471. e.state = "未完成";
  472. }
  473. if (!e.tea) {
  474. e.tea = "";
  475. }
  476. e.evaSca = e.evaSca.toFixed(0);
  477. e.cogSco = e.cogSco.toFixed(0);
  478. });
  479. let _data = [];
  480. let zongJson = {};
  481. // zongJson.count = data.length
  482. data.forEach((e, index) => {
  483. _data[index] = {};
  484. _data[index].username = e.username;
  485. _data[index].evaSca = e.evaSca;
  486. _data[index].cogSco = e.cogSco;
  487. _data[index].json = [];
  488. e.json.forEach((i, iindex) => {
  489. if (
  490. converter(i.name) == converter("科组评价") ||
  491. converter(i.name) == converter("行政巡查")
  492. ) {
  493. return;
  494. }
  495. _data[index].json[iindex] = {};
  496. _data[index].json[iindex].name = i.name;
  497. console.log(i)
  498. let _evaScore = parseInt(
  499. (i.evaScore * (100 / i.score)).toFixed(0)
  500. );
  501. let _cogScore = parseInt(
  502. (i.cogScore * (100 / i.score)).toFixed(0)
  503. );
  504. // let _ideScore = parseInt(
  505. // (i.score * (100 / i.score)).toFixed(0)
  506. // );
  507. _data[index].json[iindex].evaScore = _evaScore; // 自评
  508. _data[index].json[iindex].cogScore = _cogScore; // 考核
  509. zongJson[i.name] ? "" : (zongJson[i.name] = {});
  510. zongJson[i.name].evaScore // 全体教师自评平均得分
  511. ? (zongJson[i.name].evaScore += _evaScore)
  512. : (zongJson[i.name].evaScore = _evaScore);
  513. zongJson[i.name].cogScore // 全体教师考核平均得分
  514. ? (zongJson[i.name].cogScore += _cogScore)
  515. : (zongJson[i.name].cogScore = _cogScore);
  516. if(e.userid == this.userid){
  517. zongJson[i.name].selfEvaScore = _evaScore;
  518. zongJson[i.name].selfCogScore = _cogScore;
  519. }
  520. });
  521. });
  522. let zongArray = Object.keys(zongJson);
  523. for (var i = 0; i < zongArray.length; i++) {
  524. zongJson[zongArray[i]].evaScore = (
  525. zongJson[zongArray[i]].evaScore / data.length
  526. ).toFixed(0);
  527. zongJson[zongArray[i]].cogScore = (
  528. zongJson[zongArray[i]].cogScore / data.length
  529. ).toFixed(0);
  530. }
  531. this.annualAssessmentECharts.radar.indicator = Object.keys(
  532. zongJson
  533. ).map(item => {
  534. return { name: item, max: 100 };
  535. });
  536. let _eChartsData = [
  537. {
  538. value: [],
  539. name: "自评得分率",
  540. label: {
  541. show: true,
  542. formatter: `{c}`,
  543. fontSize: 12,
  544. color: "#000000" // 设置字体颜色为黑色
  545. }
  546. },
  547. {
  548. value: [],
  549. name: "认定得分率",
  550. label: {
  551. show: true,
  552. formatter: `{c}`,
  553. fontSize: 12,
  554. color: "#000000" // 设置字体颜色为黑色
  555. }
  556. },
  557. {
  558. value: [],
  559. name: "全体教师平均得分率",
  560. label: {
  561. show: true,
  562. formatter: `{c}`,
  563. fontSize: 12,
  564. color: "#000000" // 设置字体颜色为黑色
  565. }
  566. }
  567. ];
  568. zongArray.forEach(i => {
  569. if(zongJson[i].selfEvaScore || zongJson[i].selfEvaScore === 0){
  570. _eChartsData[0].value.push(zongJson[i].selfEvaScore);
  571. }else{
  572. _eChartsData[0].value.push(0);
  573. }
  574. if(zongJson[i].selfCogScore || zongJson[i].selfCogScore === 0){
  575. _eChartsData[2].value.push(zongJson[i].selfCogScore);
  576. }else{
  577. _eChartsData[2].value.push(0);
  578. }
  579. if(zongJson[i].cogScore || zongJson[i].cogScore === 0){
  580. _eChartsData[1].value.push(zongJson[i].cogScore)
  581. }else{
  582. _eChartsData[1].value.push(0);
  583. }
  584. // _eChartsData[0].value.push(zongJson[i].selfScore);
  585. // _eChartsData[1].value.push(zongJson[i].evaScore);
  586. // _eChartsData[2].value.push(zongJson[i].cogScore);
  587. });
  588. console.log(data)
  589. console.log(zongJson)
  590. console.log(_eChartsData)
  591. this.annualAssessmentECharts.series[0].data = _eChartsData;
  592. // this.$refs.annualAssessmentEChartsRef.setChart();
  593. this.annualAssessmentLoading = false;
  594. })
  595. .catch(error => {
  596. this.annualAssessmentLoading = false;
  597. console.log(error);
  598. });
  599. },
  600. getCardData() {
  601. this.cardNumLoading = true;
  602. let params = {
  603. uid: this.userid,
  604. oid: this.oid,
  605. org: this.org
  606. };
  607. this.ajax
  608. .get(this.$store.state.api + "selectTestUserY", params)
  609. .then(res => {
  610. let _data1 = res.data[4];
  611. let _data2 = res.data[5];
  612. let _data3 = res.data[3];
  613. if(this.selectTime && this.timeSort.length>1){
  614. _data1 = _data1.filter(i=>{
  615. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  616. let _iTime = new Date(i.update_at).getFullYear();
  617. return _iTime == _time;
  618. })
  619. _data2 = _data2.filter(i=>{
  620. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  621. let _iTime = new Date(i.create_at).getFullYear();
  622. return _iTime == _time;
  623. })
  624. _data3 = _data3.filter(i=>{
  625. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  626. let _iTime = new Date(i.update_at).getFullYear();
  627. return _iTime == _time;
  628. })
  629. }
  630. this.teachingActivityNum = _data1.length;
  631. this.teachingAndResearchActivitiesNum = _data2.length;
  632. this.trainingActivityNum =_data3.length;
  633. this.cardNumLoading = false;
  634. })
  635. .catch(err => {
  636. this.cardNumLoading = false;
  637. console.error(err);
  638. });
  639. },
  640. getData() {
  641. this.eChartsLoading = true;
  642. let params = {
  643. uid: this.userid
  644. };
  645. this.ajax
  646. .get(this.$store.state.api + "selectPortraitData", params)
  647. .then(res => {
  648. let array1 = res.data[0];
  649. let array2 = res.data[1];
  650. let array3 = res.data[2];
  651. let typeList = res.data[3];
  652. if(this.selectTime && this.timeSort.length>1){
  653. array1 = array1.filter(i=>{
  654. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  655. let _iTime = new Date(i.create_at).getFullYear();
  656. return _iTime == _time;
  657. })
  658. array2 = array2.filter(i=>{
  659. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  660. let _iTime = new Date(i.create_at).getFullYear();
  661. return _iTime == _time;
  662. })
  663. array3 = array3.filter(i=>{
  664. let _time = this.timeSort.find(j=>j.id == this.selectTime).time;
  665. let _iTime = new Date(i.update_at).getFullYear();
  666. return _iTime == _time;
  667. })
  668. }
  669. let countCourse1 = [];
  670. let wordCount1 = 0;
  671. let audioCount1 = 0;
  672. let courseArray1 = {};
  673. let countCourse2 = [];
  674. let wordCount2 = 0;
  675. let audioCount2 = 0;
  676. let courseArray2 = {};
  677. // 我发布的
  678. array1.forEach(element => {
  679. if (!courseArray1[element.courseId]) {
  680. courseArray1[element.courseId] = {
  681. bool: false,
  682. title: element.title,
  683. type: element.type2,
  684. name: element.creator,
  685. array: []
  686. };
  687. }
  688. courseArray1[element.courseId].array.push(element);
  689. if (countCourse1.indexOf(element.courseId) == -1) {
  690. countCourse1.push(element.courseId);
  691. }
  692. if (element.type == 1) {
  693. wordCount1 += element.content.replace(/<[^>]+>/g, "").length;
  694. }
  695. if (element.type == 2) {
  696. audioCount1++;
  697. }
  698. });
  699. //我收到的
  700. array2.forEach(element => {
  701. if (!courseArray2[element.courseId]) {
  702. courseArray2[element.courseId] = {
  703. bool: false,
  704. title: element.title,
  705. type: element.type2,
  706. name: element.creator,
  707. array: []
  708. };
  709. }
  710. courseArray2[element.courseId].array.push(element);
  711. if (countCourse2.indexOf(element.courseId) == -1) {
  712. countCourse2.push(element.courseId);
  713. }
  714. if (element.type == 1) {
  715. wordCount2 += element.content.replace(/<[^>]+>/g, "").length;
  716. }
  717. if (element.type == 2) {
  718. audioCount2++;
  719. }
  720. });
  721. //2 1 3 4
  722. let _eChartsData = [
  723. {
  724. name: "我发布的",
  725. type: "bar",
  726. data: [
  727. array1.length,
  728. countCourse1.length,
  729. wordCount1,
  730. audioCount1
  731. ],
  732. itemStyle: {
  733. color: "#5470c6"
  734. }
  735. },
  736. {
  737. name: "我收到的",
  738. type: "bar",
  739. data: [
  740. array2.length,
  741. countCourse2.length,
  742. wordCount2,
  743. audioCount2
  744. ],
  745. itemStyle: {
  746. color: "#91cc75"
  747. }
  748. }
  749. ];
  750. let _eChartsData2 = [];
  751. let _eChartsData3 = [];
  752. typeList.forEach(item => {
  753. _eChartsData2.push({ value: 0, name: item.name, id: item.id });
  754. });
  755. array3.forEach(item => {
  756. let type = item.type.split(",");
  757. type.sort((a,b)=>a-b);
  758. type.forEach(i => {
  759. let _findIndex = _eChartsData2.findIndex(j => j.id == i);
  760. if (_findIndex != -1) {
  761. _eChartsData2[_findIndex].value += 1;
  762. }
  763. });
  764. });
  765. let resultSubject = [];
  766. for (let i = 0; i < typeList.length - 1; i++) {
  767. for (let j = i + 1; j < typeList.length; j++) {
  768. resultSubject.push({
  769. id: [typeList[i].id, typeList[j].id],
  770. name: [typeList[i].name, typeList[j].name],
  771. count: 0,
  772. });
  773. }
  774. }
  775. for (var i = 0; i < array3.length; i++) {
  776. let array = array3[i].type.split(",");
  777. for (var j = 0; j < resultSubject.length; j++) {
  778. if (this.checkArrayInclusion(resultSubject[j].id, array)) {
  779. resultSubject[j].count++;
  780. }
  781. }
  782. }
  783. let resultSubject2 = [];
  784. for (var i = 0; i < resultSubject.length; i++) {
  785. let el = resultSubject[i];
  786. if (el.count > 0) {
  787. resultSubject2.push([el.name[0], el.name[1], el.count]);
  788. }
  789. }
  790. _eChartsData3 = resultSubject.filter(i=>i.count!==0).map(i=>([i.name[0],i.name[1],i.count]));
  791. console.log(_eChartsData3)
  792. _eChartsData2 = _eChartsData2.filter(i => i.value != 0);
  793. this.teachingActivityECharts.series[0].data = _eChartsData2;
  794. this.teachingAndResearchActivitiesECharts.series = _eChartsData;
  795. this.interdisciplinarySituationECharts.series[0].data = _eChartsData3;
  796. this.eChartsLoading = false;
  797. })
  798. .catch(err => {
  799. this.eChartsLoading = false;
  800. console.error(err);
  801. });
  802. },
  803. checkArrayInclusion(arr1, arr2) {
  804. return arr1.every((item) => arr2.includes(item));
  805. },
  806. changeTimeSort(){
  807. console.log(this.selectTime)
  808. this.getAnnualAssessmentEChartsData();
  809. this.getCardData();
  810. this.getData();
  811. },
  812. },
  813. mounted() {
  814. this.getPageBase2(1)
  815. this.getPageBase2(2)
  816. this.getAnnualAssessmentEChartsData();
  817. this.getData();
  818. this.getCardData();
  819. }
  820. };
  821. </script>
  822. <style scoped>
  823. .portrait {
  824. width: 100%;
  825. height: calc(100% - 20px);
  826. /* margin: 10px 0; */
  827. display: flex;
  828. flex-direction: column;
  829. overflow: auto;
  830. }
  831. .p_top {
  832. width: 100%;
  833. height: 60px;
  834. padding: 0 90px;
  835. box-sizing: border-box;
  836. }
  837. .p_bottom{
  838. width: 100%;
  839. flex: 1;
  840. display: flex;
  841. padding: 0 80px;
  842. box-sizing: border-box;
  843. }
  844. .p_bottom > div {
  845. margin: 0 10px;
  846. /* background-color: #fff; */
  847. border-radius: 5px;
  848. box-sizing: border-box;
  849. display: flex;
  850. flex-direction: column;
  851. }
  852. .p_left {
  853. width: 28.5%;
  854. display: flex;
  855. flex-direction: column;
  856. background-color: none;
  857. }
  858. .p_l_top {
  859. flex: 1;
  860. display: flex;
  861. flex-direction: column;
  862. position: relative;
  863. }
  864. .p_l_top > div {
  865. flex: 1;
  866. border-radius: 5px;
  867. /* margin: 10px 0; */
  868. background-color: #fff;
  869. display: flex;
  870. flex-direction: column;
  871. justify-content: center;
  872. box-sizing: border-box;
  873. padding: 0 30px;
  874. position: relative;
  875. overflow: hidden;
  876. }
  877. .p_l_top >div> img{
  878. position: absolute;
  879. top: 0;
  880. left: 0;
  881. width: 100%;
  882. height: 100%;
  883. z-index: 1;
  884. object-fit: fill;
  885. }
  886. .p_l_top > div > div {
  887. display: flex;
  888. align-items: center;
  889. margin-bottom: 20px;
  890. z-index: 2;
  891. }
  892. .p_l_top > div > div > span {
  893. font-size: 22px;
  894. /* font-weight: bold; */
  895. }
  896. .p_l_top > div > div > svg {
  897. width: 20px;
  898. height: 20px;
  899. margin-left: 10px;
  900. cursor: pointer;
  901. }
  902. .p_l_top > div > span {
  903. font-size: 2.6em;
  904. font-weight: bold;
  905. z-index: 2;
  906. }
  907. .p_l_top > div:not(:first-child):not(:last-child) {
  908. margin: 20px 0;
  909. }
  910. .teachingActivity {
  911. background: linear-gradient(
  912. 290deg,
  913. rgba(231, 238, 254, 0.1) 0%,
  914. #e7eefe 100%
  915. );
  916. }
  917. .teachingAndResearchActivities {
  918. background: linear-gradient(
  919. 290deg,
  920. rgba(243, 254, 231, 0.1) 0%,
  921. #fef2e7 100%
  922. );
  923. }
  924. .trainingActivity {
  925. background: linear-gradient(
  926. 290deg,
  927. rgba(231, 254, 251, 0.1) 0%,
  928. #e7feef 100%
  929. );
  930. }
  931. .p_l_bottom {
  932. flex: 1;
  933. margin-top: 20px;
  934. border-radius: 5px;
  935. background-color: #fff;
  936. border: 1px solid rgba(255, 255, 255, 0.55);
  937. box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  938. padding: 20px;
  939. display: flex;
  940. flex-direction: column;
  941. }
  942. .p_center {
  943. width: calc(100% - 57%);
  944. background-color: #fff;
  945. border: 1px solid rgba(255, 255, 255, 0.55);
  946. box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  947. padding: 20px;
  948. }
  949. .p_center>img{
  950. width: 100%;
  951. height: auto;
  952. margin: auto;
  953. transform: scaleX(-1);
  954. }
  955. .p_right {
  956. width: 28.5%;
  957. display: flex;
  958. flex-direction: column;
  959. }
  960. .p_r_top {
  961. flex: 1;
  962. background-color: #fff;
  963. border: 1px solid rgba(255, 255, 255, 0.55);
  964. box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  965. padding: 20px;
  966. border-radius: 5px;
  967. display: flex;
  968. flex-direction: column;
  969. }
  970. .p_r_bottom {
  971. flex: 1;
  972. background-color: #fff;
  973. border: 1px solid rgba(255, 255, 255, 0.55);
  974. box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  975. padding: 20px;
  976. margin-top: 20px;
  977. border-radius: 5px;
  978. display: flex;
  979. flex-direction: column;
  980. }
  981. .p_title {
  982. display: flex;
  983. align-items: center;
  984. justify-content: space-between;
  985. }
  986. .p_title > span {
  987. font-size: 28px;
  988. }
  989. .p_eCharts {
  990. width: 100%;
  991. flex: 1;
  992. margin-top: 10px;
  993. }
  994. </style>