home.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464
  1. <template>
  2. <div class="content-box">
  3. <div class="middle">
  4. <div class="cartogram">
  5. <div class="apply">
  6. <div class="addApply">
  7. <span class="title">应用入口</span>
  8. <img src="@/assets/items/addApply.png" alt="" />
  9. </div>
  10. </div>
  11. </div>
  12. <div class="cartogram">
  13. <!-- 用户类别占比 -->
  14. <div class="annulus" ref="annulus">
  15. <div class="title">用户类别占比</div>
  16. <div id="annulus"></div>
  17. <div class="headcount">
  18. <div class="num">
  19. <span>总人数</span>
  20. <span>{{ personNum }}</span>
  21. </div>
  22. </div>
  23. </div>
  24. <!-- 能耗趋势图 -->
  25. <div class="annulus">
  26. <div class="title">能耗趋势图</div>
  27. <div id="broken"></div>
  28. </div>
  29. <!-- 表格3 视频监控管理-->
  30. <div class="annulus">
  31. <div class="title">视频监控管理</div>
  32. <div class="video">
  33. <ul>
  34. <li>
  35. <span>100</span>
  36. <span>摄像头总数</span>
  37. </li>
  38. <li>
  39. <span>16</span>
  40. <span>水表总数</span>
  41. </li>
  42. <li>
  43. <span>100</span>
  44. <span>电表总数</span>
  45. </li>
  46. </ul>
  47. <ul>
  48. <li>
  49. <span>100</span>
  50. <span>电子班牌总数</span>
  51. </li>
  52. <li>
  53. <span>100</span>
  54. <span>一体机总数</span>
  55. </li>
  56. <li></li>
  57. </ul>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="cartogram">
  62. <!--4 待办事项 -->
  63. <div class="annulus">
  64. <div class="title">
  65. <span>待办事项</span>
  66. <span>20/30</span>
  67. </div>
  68. <div class="backlog">
  69. <ul>
  70. <li>
  71. <span>上传人脸采集</span>
  72. <span>5/7</span>
  73. </li>
  74. <li>
  75. <span>上传人脸采集</span>
  76. <span>5/7</span>
  77. </li>
  78. <li>
  79. <span>上传人脸采集</span>
  80. <span>5/7</span>
  81. </li>
  82. <li>
  83. <span>上传人脸采集</span>
  84. <span>5/7</span>
  85. </li>
  86. <li>
  87. <span>上传人脸采集</span>
  88. <span>5/7</span>
  89. </li>
  90. <li>
  91. <span>上传人脸采集</span>
  92. <span>5/7</span>
  93. </li>
  94. </ul>
  95. </div>
  96. </div>
  97. <!--5 门禁管理 -->
  98. <div class="annulus">
  99. <div class="title">门禁管理</div>
  100. <div id="doorForbid"></div>
  101. </div>
  102. <!-- 6 行为统计-->
  103. <div class="annulus">
  104. <div class="title">行为统计</div>
  105. <div id="behavior6"></div>
  106. </div>
  107. </div>
  108. <div class="cartogram">
  109. <!--7 班级考勤 -->
  110. <div class="annulus" ref="annulus">
  111. <div class="title">班级考勤</div>
  112. <div id="class"></div>
  113. </div>
  114. <!--8 最受欢迎老师TOP6 -->
  115. <div class="annulus">
  116. <div class="title">最受欢迎老师TOP6</div>
  117. <div class="teacher">
  118. <ul>
  119. <li v-for="(i, index) in greetTeaData">
  120. <span>{{ index + 1 }}</span>
  121. <span>{{ i.name }}</span>
  122. </li>
  123. </ul>
  124. </div>
  125. </div>
  126. <!--9 资源大数据-->
  127. <div class="annulus">
  128. <div class="title">资源大数据</div>
  129. <!-- <div class="table">
  130. <el-table
  131. :data="tableData3.list"
  132. height="200"
  133. :header-cell-style="{
  134. background: 'rgba(240, 243, 247, 1)',
  135. textAlign: 'center',
  136. }"
  137. >
  138. <el-table-column type="index" align="center" label="序号" />
  139. <el-table-column prop="schoolName" align="center" label="校区" />
  140. <el-table-column
  141. prop="ordersTotal"
  142. align="center"
  143. label="工单总数"
  144. />
  145. <el-table-column
  146. prop="ordersCompensation"
  147. align="center"
  148. label="有偿"
  149. />
  150. <el-table-column
  151. prop="ordersGratis"
  152. align="center"
  153. label="无偿"
  154. />
  155. <el-table-column
  156. prop="totalPrice"
  157. align="center"
  158. label="耗材总费用"
  159. />
  160. </el-table>
  161. </div> -->
  162. <div id="resource"></div>
  163. </div>
  164. </div>
  165. </div>
  166. <el-dialog
  167. class="reply"
  168. v-model="nameVisible6"
  169. :close-on-click-modal="false"
  170. :close-on-press-escape="false"
  171. title="师傅详情"
  172. align-center
  173. width="820"
  174. :before-close="cancelName6"
  175. >
  176. <div class="reply">
  177. <div class="content">
  178. <table border>
  179. <tr>
  180. <td>姓名</td>
  181. <td>工单总数</td>
  182. <td>好评数</td>
  183. <td>超时率</td>
  184. <td>平时响应时长(分)</td>
  185. <td>平时维修时长(分)</td>
  186. <td>耗材总费用(元)</td>
  187. </tr>
  188. <tr>
  189. <td>{{ nameList6.name }}</td>
  190. <td>{{ nameList6.workOrderTotal }}</td>
  191. <td>{{ nameList6.degreePraise }}</td>
  192. <td>{{ nameList6.timeOut }}</td>
  193. <td>{{ nameList6.answer }}</td>
  194. <td>{{ nameList6.maintain }}</td>
  195. <td>{{ nameList6.totalPrice }}</td>
  196. </tr>
  197. </table>
  198. <!-- <div class="nameInfo">姓名: <span>{{ nameList.name }}</span></div>
  199. <div class="nameInfo">校区: <span>{{ nameList.schoolName }}</span></div>
  200. <div class="nameInfo">工单总数: <span> {{ nameList.workOrderTotal }}</span></div>
  201. <div class="nameInfo">好评率: <span>{{ nameList.degreePraise }}</span></div> -->
  202. </div>
  203. <!-- <div class="options">
  204. <el-button color="rgba(111, 182, 184, 1)" class="queding" type="primary" @click="replycontentYes()">
  205. 确定
  206. </el-button>
  207. <el-button @click="cancelName">取消</el-button>
  208. </div> -->
  209. </div>
  210. </el-dialog>
  211. <el-dialog
  212. class="reply"
  213. v-model="nameVisible8"
  214. :close-on-click-modal="false"
  215. :close-on-press-escape="false"
  216. title="师傅详情"
  217. align-center
  218. width="820"
  219. :before-close="cancelName8"
  220. >
  221. <div class="reply">
  222. <div class="content">
  223. <table border>
  224. <tr>
  225. <td>姓名</td>
  226. <td>工单总数</td>
  227. <td>好评数</td>
  228. <td>超时率</td>
  229. <td>平时响应时长(分)</td>
  230. <td>平时维修时长(分)</td>
  231. <td>耗材总费用(元)</td>
  232. </tr>
  233. <tr>
  234. <td>{{ nameList8.name }}</td>
  235. <td>{{ nameList8.workOrderTotal }}</td>
  236. <td>{{ nameList8.degreePraise }}</td>
  237. <td>{{ nameList8.timeOut }}</td>
  238. <td>{{ nameList8.answer }}</td>
  239. <td>{{ nameList8.maintain }}</td>
  240. <td>{{ nameList8.totalPrice }}</td>
  241. </tr>
  242. </table>
  243. <!-- <div class="nameInfo">姓名: <span>{{ nameList.name }}</span></div>
  244. <div class="nameInfo">校区: <span>{{ nameList.schoolName }}</span></div>
  245. <div class="nameInfo">工单总数: <span> {{ nameList.workOrderTotal }}</span></div>
  246. <div class="nameInfo">好评率: <span>{{ nameList.degreePraise }}</span></div> -->
  247. </div>
  248. <!-- <div class="options">
  249. <el-button color="rgba(111, 182, 184, 1)" class="queding" type="primary" @click="replycontentYes()">
  250. 确定
  251. </el-button>
  252. <el-button @click="cancelName">取消</el-button>
  253. </div> -->
  254. </div>
  255. </el-dialog>
  256. </div>
  257. </template>
  258. <script setup>
  259. import * as echarts from "echarts";
  260. import { ref, watch, reactive, nextTick, onUnmounted, onMounted } from "vue";
  261. import { useRouter } from "vue-router";
  262. import { ElMessage, ElMessageBox } from "element-plus";
  263. import { dayjs } from "element-plus";
  264. import lodash from "lodash";
  265. import axios from "axios";
  266. import eds from "@/utils/eds.js";
  267. import { useStore } from "vuex";
  268. const store = useStore();
  269. const api = ref("");
  270. const router = useRouter();
  271. // 用户类别占比
  272. const echarts1 = ref();
  273. const personNum = ref(0);
  274. // 能耗趋势图
  275. const echarts2 = ref();
  276. // 门禁管理
  277. const echarts3 = ref();
  278. // 行为统计
  279. const echarts4 = ref();
  280. // 班级考勤
  281. const echarts5 = ref();
  282. // 最受欢迎老师TOP6
  283. const greetTeaData = ref();
  284. // 资源大数据
  285. const echarts6 = ref();
  286. const getList = async () => {
  287. cartogram();
  288. cartogram2();
  289. doorForbidClick();
  290. behaviorClick();
  291. classClick();
  292. greetTeaClick();
  293. resourceClick();
  294. let res = await axios({
  295. method: "get",
  296. url: api.value + "/wanzai/api/login/queryReduce",
  297. headers: {
  298. token: sessionStorage.getItem("token"),
  299. user_head: sessionStorage.getItem("userhead"),
  300. },
  301. // params: data,
  302. });
  303. console.log(res, "加密参数测试");
  304. console.log(JSON.parse(eds.decryptDes(res.data.data)), "EDS解密");
  305. // import eds from "@/utils/eds.js";
  306. };
  307. // 用户类别占比(------------------------------)
  308. const cartogram = async () => {
  309. // 基于准备好的dom,初始化echarts实例
  310. // 圆环统计图
  311. // let data = {
  312. // state: tabIndex1.value,
  313. // };
  314. let res = await axios({
  315. method: "post",
  316. url: api.value + "/wanzai/api/wechat/getUserIdTj",
  317. headers: {
  318. token: sessionStorage.getItem("token"),
  319. user_head: sessionStorage.getItem("userhead"),
  320. },
  321. // params: data,
  322. });
  323. console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "用户类别占比");
  324. let data = [];
  325. let color = [
  326. "rgba(67, 181, 244, 1)",
  327. "rgba(137, 207, 245, 1)",
  328. "rgba(180, 226, 251, 1)",
  329. "rgba(212, 237, 251, 1)",
  330. ];
  331. JSON.parse(eds.decryptDes(res.data.data)).forEach((item, index) => {
  332. let arr = {
  333. value: item.num,
  334. name: item.name,
  335. itemStyle: { color: color[index] },
  336. };
  337. data.push(arr);
  338. });
  339. // 用户总计
  340. let ress = await axios({
  341. method: "post",
  342. url: api.value + "/wanzai/api/wechat/getUserIdTjt",
  343. headers: {
  344. token: sessionStorage.getItem("token"),
  345. user_head: sessionStorage.getItem("userhead"),
  346. },
  347. // params: data,
  348. });
  349. console.log(ress, JSON.parse(eds.decryptDes(ress.data.data)), "用户总计");
  350. personNum.value = JSON.parse(eds.decryptDes(ress.data.data)).total;
  351. echarts1.value = echarts.init(document.getElementById("annulus"));
  352. echarts1.value.setOption({
  353. // title: {
  354. // text: "圆环图的例子",
  355. // left: "center",
  356. // top: "center",
  357. // },
  358. tooltip: {
  359. trigger: "item",
  360. },
  361. legend: {
  362. orient: "vertical",
  363. right: "11%",
  364. top: "30%",
  365. itemGap: 20,
  366. itemWidth: 15,
  367. itemHeight: 15,
  368. },
  369. series: [
  370. {
  371. type: "pie",
  372. data: data,
  373. center: ["32%", "50%"],
  374. radius: "65%",
  375. label: {
  376. show: true,
  377. // position: "center",
  378. formatter: "{b} ({d}%)",
  379. padding: 1,
  380. },
  381. labelLine: {
  382. show: true,
  383. },
  384. emphasis: {
  385. itemStyle: {
  386. shadowBlur: 10,
  387. shadowOffsetX: 0,
  388. shadowColor: "rgba(0, 0, 0, 0.5)",
  389. },
  390. },
  391. },
  392. ],
  393. });
  394. };
  395. // 能耗趋势图(----------------------------)
  396. const cartogram2 = async () => {
  397. // let data = {
  398. // state: tabIndex2.value,
  399. // };
  400. // let res = await axios({
  401. // method: "get",
  402. // url: api.value + "/repairRecord/repairTrend",
  403. // headers: {
  404. // token: sessionStorage.getItem("token"),
  405. // user_head: sessionStorage.getItem("userhead"),
  406. // },
  407. // params: data,
  408. // });
  409. // console.log(res, "折现 报修趋势分析");
  410. // let dayData = []; // 年份
  411. // let newTitle = ""; // 年比(今年标题)
  412. // let oldTitle = ""; // 年比(去年标题)
  413. // // 月份
  414. // let monthData = [];
  415. // for (let j = 1; j <= 31; j++) {
  416. // monthData.push(j);
  417. // }
  418. // let oldData = []; // 上-级数据
  419. // let newData = []; // 当前数据
  420. // let xname = "";
  421. // if (res.data.code == 200) {
  422. // } else {
  423. // ElMessage({
  424. // type: "error",
  425. // showClose: true,
  426. // message: res.data.message,
  427. // center: true,
  428. // });
  429. // }
  430. // 折现统计图
  431. echarts2.value = echarts.init(document.getElementById("broken"));
  432. echarts2.value.setOption({
  433. // title: {
  434. // text: "运动量对比",
  435. // textStyle: {
  436. // color: "#000",
  437. // fontSize: 14,
  438. // },
  439. // },
  440. tooltip: {
  441. trigger: "axis",
  442. },
  443. legend: {
  444. textStyle: {
  445. color: "#000",
  446. },
  447. itemWidth: 8,
  448. itemHeight: 8, // 修改icon图形大小
  449. itemGap: 30, // 修改间距
  450. // top: "bottom",
  451. bottom: "5%",
  452. data: [
  453. { name: "水", icon: "circle" },
  454. { name: "电", icon: "circle" },
  455. ],
  456. },
  457. grid: {
  458. left: "8%",
  459. top: "15%",
  460. bottom: "20%",
  461. right: "8%",
  462. containLabel: true,
  463. },
  464. xAxis: {
  465. type: "category",
  466. boundaryGap: false,
  467. axisTick: { show: false },
  468. axisLabel: {
  469. textStyle: {
  470. color: "#000", //刻度颜色
  471. fontSize: 10, //刻度大小
  472. },
  473. },
  474. axisLine: {
  475. show: true,
  476. lineStyle: {
  477. color: "#DDDDDD",
  478. width: 1,
  479. type: "solid",
  480. },
  481. },
  482. data: [
  483. "11.20",
  484. "11.21",
  485. "11.22",
  486. "11.23",
  487. "11.24",
  488. "11.25",
  489. "11.26",
  490. "11.27",
  491. "11.28",
  492. "11.29",
  493. "11.30",
  494. ],
  495. },
  496. yAxis: [
  497. {
  498. name: "吨",
  499. type: "value",
  500. axisTick: { show: false },
  501. axisLabel: {
  502. textStyle: {
  503. color: "#000", //刻度颜色
  504. fontSize: 10, //刻度大小
  505. },
  506. },
  507. axisLine: {
  508. show: false,
  509. lineStyle: {
  510. color: "#000",
  511. width: 1,
  512. type: "solid",
  513. },
  514. },
  515. splitLine: {
  516. show: false,
  517. },
  518. },
  519. {
  520. name: "度",
  521. type: "value",
  522. axisTick: { show: false },
  523. axisLabel: {
  524. textStyle: {
  525. color: "#000", //刻度颜色
  526. fontSize: 10, //刻度大小
  527. },
  528. // formatter: "{value}",
  529. },
  530. axisLine: {
  531. show: false,
  532. lineStyle: {
  533. color: "#000",
  534. width: 1,
  535. type: "solid",
  536. },
  537. },
  538. // axisLabel: { },
  539. // splitLine: {
  540. // show: false,
  541. // },
  542. },
  543. ],
  544. series: [
  545. {
  546. name: "水",
  547. type: "line",
  548. smooth: true, // 折线拐点平滑
  549. // symbol: "circle",
  550. symbolSize: 3,
  551. itemStyle: {
  552. color: "#6FB6B8",
  553. // borderColor: "#fff",
  554. // borderWidth: 10,
  555. },
  556. lineStyle: {
  557. normal: {
  558. color: "rgba(111, 182, 184, 1)",
  559. opacity: 1,
  560. },
  561. },
  562. areaStyle: {
  563. color: "rgba(111, 182, 184, 0.2)",
  564. },
  565. data: [10, 20, 70, 10, 23, 50, 6, 30, 20, 14, 22],
  566. },
  567. {
  568. name: "电",
  569. type: "line",
  570. smooth: true,
  571. symbolSize: 3,
  572. yAxisIndex: 1,
  573. itemStyle: {
  574. color: "rgba(30, 125, 251, 1)", // 拐点的颜色
  575. borderColor: "#fff", // 拐点边框颜色
  576. // borderWidth: 10, // 拐点边框大小
  577. },
  578. lineStyle: {
  579. normal: {
  580. color: "rgba(30, 125, 251, 1)", // 折线点的颜色
  581. },
  582. },
  583. areaStyle: {
  584. color: "rgba(30, 125, 251, 0.2)",
  585. },
  586. data: [15, 20, 19, 30, 11, 20, 11, 9, 12, 32, 10],
  587. },
  588. ],
  589. });
  590. };
  591. // 门禁管理
  592. const doorForbidClick = () => {
  593. echarts3.value = echarts.init(document.getElementById("doorForbid"));
  594. echarts3.value.setOption({
  595. tooltip: {
  596. trigger: "axis",
  597. axisPointer: {
  598. type: "cross",
  599. label: {
  600. backgroundColor: "#6a7985",
  601. },
  602. },
  603. },
  604. legend: {
  605. // data: dayTitle,
  606. bottom: "15",
  607. icon: "circle",
  608. itemHeight: 13, // 修改icon图形大小
  609. itemGap: 30, // 修改间距
  610. textStyle: {
  611. fontSize: 10,
  612. color: "#000",
  613. padding: [0, 0, 0, -5], // 修改文字和图标距离
  614. },
  615. },
  616. grid: {
  617. top: "12%",
  618. left: "5%",
  619. right: "8%",
  620. bottom: "20%",
  621. containLabel: true,
  622. },
  623. xAxis: [
  624. {
  625. type: "category",
  626. boundaryGap: false,
  627. axisLine: {
  628. show: false, // 不显示坐标轴线
  629. },
  630. axisTick: {
  631. show: false, // 不显示坐标轴刻度线
  632. },
  633. data: [
  634. "11.18",
  635. "11.19",
  636. "11.20",
  637. "11.21",
  638. "11.22",
  639. "11.23",
  640. "11.24",
  641. "11.25",
  642. "11.26",
  643. "11.27",
  644. "11.28",
  645. "11.29",
  646. "11.30",
  647. ],
  648. // axisLabel: {
  649. // // 每个数据后面都会带有单位
  650. // formatter: "{value}月",
  651. // },
  652. name: "",
  653. nameLocation: "end",
  654. nameTextStyle: {
  655. padding: [60, 0, 0, 0], // 四个数字分别为上右下左与原位置距离
  656. },
  657. },
  658. ],
  659. yAxis: [
  660. {
  661. type: "value",
  662. },
  663. ],
  664. series: [
  665. {
  666. name: "刷脸",
  667. type: "line",
  668. // stack: "Total",
  669. emphasis: {
  670. focus: "series",
  671. },
  672. data: [15, 20, 68, 20, 19, 30, 11, 20, 11, 9, 12, 32, 10],
  673. symbolSize: 4, // 点的大小
  674. symbol: "none", // 折线点设置为实心点
  675. // itemStyle: {
  676. // normal: {
  677. // color: "rgba(30, 125, 251, 1)", // 拐点的颜色
  678. // borderColor: "white", // 拐点边框颜色
  679. // borderWidth: 2, // 拐点边框大小
  680. // },
  681. // },
  682. lineStyle: {
  683. normal: {
  684. color: "rgba(102, 153, 255, 1)", // 折线点的颜色
  685. },
  686. },
  687. smooth: true, //平滑曲线图。值可为数字
  688. // areaStyle: {
  689. // //2.基础面积图。区域填充样式
  690. // color: "rgba(30, 125, 251, 0.3)", //支持RGB、ALPHA通道+RGBA、十六进制、渐变色、纹理填充
  691. // },
  692. },
  693. {
  694. name: "刷码",
  695. type: "line",
  696. // stack: "Total",
  697. emphasis: {
  698. focus: "series",
  699. },
  700. data: [10, 12, 21, 40, 70, 10, 23, 10, 6, 10, 20, 14, 22],
  701. symbolSize: 4, // 点的大小
  702. symbol: "none", // 折线点设置为实心点
  703. // itemStyle: {
  704. // normal: {
  705. // color: "rgba(111, 182, 184, 1)", // 拐点的颜色
  706. // borderColor: "white", // 拐点边框颜色
  707. // borderWidth: 2, // 拐点边框大小
  708. // },
  709. // },
  710. lineStyle: {
  711. normal: {
  712. color: "rgba(78, 206, 163, 1)", // 折线点的颜色
  713. },
  714. },
  715. smooth: true, //平滑曲线图。值可为数字
  716. // areaStyle: {
  717. // //2.基础面积图。区域填充样式
  718. // color: "rgba(111, 182, 184, 0.3)", //支持RGB、ALPHA通道+RGBA、十六进制、渐变色、纹理填充
  719. // },
  720. },
  721. {
  722. name: "车牌",
  723. type: "line",
  724. // stack: "Total",
  725. emphasis: {
  726. focus: "series",
  727. },
  728. data: [20, 15, 40, 19, 28, 30, 12, 40, 16, 18, 10, 24, 12],
  729. symbolSize: 4, // 点的大小
  730. symbol: "none", // 折线点设置为实心点
  731. // itemStyle: {
  732. // normal: {
  733. // color: "rgba(111, 182, 184, 1)", // 拐点的颜色
  734. // borderColor: "white", // 拐点边框颜色
  735. // borderWidth: 2, // 拐点边框大小
  736. // },
  737. // },
  738. lineStyle: {
  739. normal: {
  740. color: "rgba(67, 181, 244, 1)", // 折线点的颜色
  741. },
  742. },
  743. smooth: true, //平滑曲线图。值可为数字
  744. // areaStyle: {
  745. // //2.基础面积图。区域填充样式
  746. // color: "rgba(111, 182, 184, 0.3)", //支持RGB、ALPHA通道+RGBA、十六进制、渐变色、纹理填充
  747. // },
  748. },
  749. ],
  750. });
  751. };
  752. // 6 行为统计
  753. const behaviorClick = async () => {
  754. // 基于准备好的dom,初始化echarts实例
  755. let res = await axios({
  756. method: "get",
  757. url: api.value + "/wanzai/api/smartWarning/behaviour",
  758. headers: {
  759. // token: sessionStorage.getItem("token"),
  760. // user_head: sessionStorage.getItem("userhead"),
  761. },
  762. params: data,
  763. });
  764. console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "行为统计");
  765. let color = [
  766. "rgba(67, 181, 244, 1)",
  767. "rgba(137, 207, 245, 1)",
  768. "rgba(180, 226, 251, 1)",
  769. "rgba(212, 237, 251, 1)",
  770. "rgba(171, 249, 255, 1)",
  771. ];
  772. let typeData = [];
  773. JSON.parse(eds.decryptDes(res.data.data)).forEach((item, index) => {
  774. let arr = {
  775. value: item.typeCount,
  776. name: item.typeName,
  777. itemStyle: {
  778. color: color[index],
  779. },
  780. };
  781. typeData.push(arr);
  782. });
  783. echarts4.value = echarts.init(document.getElementById("behavior6"));
  784. echarts4.value.setOption({
  785. // title: {
  786. // text: "圆环图的例子",
  787. // left: "center",
  788. // top: "center",
  789. // },
  790. tooltip: {
  791. trigger: "item",
  792. },
  793. legend: {
  794. orient: "vertical",
  795. right: "6%",
  796. top: "15%",
  797. itemGap: 20,
  798. itemWidth: 15,
  799. itemHeight: 15,
  800. },
  801. series: [
  802. {
  803. type: "pie",
  804. // data: [
  805. // {
  806. // value: 224,
  807. // name: "区域入侵",
  808. // itemStyle: {
  809. // color: "rgba(67, 181, 244, 1)",
  810. // },
  811. // },
  812. // {
  813. // value: 304,
  814. // name: "防溺水",
  815. // itemStyle: {
  816. // color: "rgba(137, 207, 245, 1)",
  817. // },
  818. // },
  819. // {
  820. // value: 484,
  821. // name: "睡觉",
  822. // itemStyle: {
  823. // color: "rgba(180, 226, 251, 1)",
  824. // },
  825. // },
  826. // {
  827. // value: 300,
  828. // name: "抽烟",
  829. // itemStyle: {
  830. // color: "rgba(212, 237, 251, 1)",
  831. // },
  832. // },
  833. // {
  834. // value: 180,
  835. // name: "打架",
  836. // itemStyle: {
  837. // color: "rgba(171, 249, 255, 1)",
  838. // },
  839. // },
  840. // ],
  841. data: typeData,
  842. center: ["40%", "48%"],
  843. radius: ["48%", "65%"],
  844. label: {
  845. show: true,
  846. // position: "center",
  847. formatter: "{b} ({d}%)",
  848. padding: 1,
  849. },
  850. labelLine: {
  851. show: true,
  852. // length: -1,
  853. },
  854. // itemStyle: {
  855. // shadowBlur: 10,
  856. // shadowOffsetX: 0,
  857. // shadowColor: "rgba(0, 0, 0, 0.5)",
  858. // },
  859. },
  860. ],
  861. });
  862. };
  863. // 7 班级考勤
  864. const classClick = async () => {
  865. // 基于准备好的dom,初始化echarts实例
  866. // 圆环统计图
  867. let res = await axios({
  868. method: "get",
  869. url: api.value + "/wanzai/api/smartAttendance/queryAttendanceList",
  870. headers: {
  871. token: sessionStorage.getItem("token"),
  872. user_head: sessionStorage.getItem("userhead"),
  873. },
  874. });
  875. console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "圆环 班级考勤");
  876. let colorSel = [
  877. "rgba(67, 181, 244, 1)",
  878. "rgba(137, 207, 245, 1)",
  879. "rgba(180, 226, 251, 1)",
  880. "rgba(212, 237, 251, 1)",
  881. "rgba(171, 249, 255, 1)",
  882. ];
  883. let data = [];
  884. JSON.parse(eds.decryptDes(res.data.data)).forEach((item, index) => {
  885. let aug = {
  886. value: item.proportion,
  887. name: item.name,
  888. itemStyle: {
  889. color: colorSel[index],
  890. },
  891. };
  892. data.push(aug);
  893. });
  894. echarts5.value = echarts.init(document.getElementById("class"));
  895. echarts5.value.setOption({
  896. // title: {
  897. // text: "圆环图的例子",
  898. // left: "center",
  899. // top: "center",
  900. // },
  901. tooltip: {
  902. trigger: "item",
  903. },
  904. legend: {
  905. orient: "vertical",
  906. right: "6%",
  907. top: "15%",
  908. itemGap: 20,
  909. itemWidth: 15,
  910. itemHeight: 15,
  911. },
  912. series: [
  913. {
  914. type: "pie",
  915. data: data,
  916. center: ["40%", "48%"],
  917. radius: ["48%", "65%"],
  918. label: {
  919. show: true,
  920. // position: "center",
  921. formatter: "{b} ({d}%)",
  922. padding: 1,
  923. },
  924. labelLine: {
  925. show: true,
  926. // length: -1,
  927. },
  928. },
  929. ],
  930. });
  931. };
  932. // 8 最受欢迎老师TOP6
  933. const greetTeaClick = async () => {
  934. // 基于准备好的dom,初始化echarts实例
  935. let res = await axios({
  936. method: "get",
  937. url: api.value + "/wanzai/api/smartEvaluateTeacher/queryTopSixTeacher",
  938. headers: {
  939. // token: sessionStorage.getItem("token"),
  940. // user_head: sessionStorage.getItem("userhead"),
  941. },
  942. params: data,
  943. });
  944. console.log(
  945. res,
  946. JSON.parse(eds.decryptDes(res.data.data)),
  947. "最受欢迎老师TOP6"
  948. );
  949. greetTeaData.value = JSON.parse(eds.decryptDes(res.data.data));
  950. };
  951. // 9 资源大数据
  952. const resourceClick = async () => {
  953. // 基于准备好的dom,初始化echarts实例
  954. // 圆环统计图
  955. // let data = {
  956. // state: tabIndex1.value,
  957. // };
  958. // let res = await axios({
  959. // method: "get",
  960. // url: api.value + "/repairRecord/repairAnalysis",
  961. // headers: {
  962. // token: sessionStorage.getItem("token"),
  963. // user_head: sessionStorage.getItem("userhead"),
  964. // },
  965. // params: data,
  966. // });
  967. // console.log(res, "圆环 报修分析统计");
  968. // let echartsData1 = [];
  969. echarts6.value = echarts.init(document.getElementById("resource"));
  970. echarts6.value.setOption({
  971. // title: {
  972. // text: "圆环图的例子",
  973. // left: "center",
  974. // top: "center",
  975. // },
  976. tooltip: {
  977. trigger: "item",
  978. },
  979. legend: {
  980. orient: "vertical",
  981. right: "6%",
  982. top: "15%",
  983. itemGap: 20,
  984. itemWidth: 15,
  985. itemHeight: 15,
  986. },
  987. series: [
  988. {
  989. type: "pie",
  990. data: [
  991. {
  992. value: 224,
  993. name: "电子资源库",
  994. itemStyle: {
  995. color: "rgba(67, 181, 244, 1)",
  996. },
  997. },
  998. {
  999. value: 304,
  1000. name: "课程资源库",
  1001. itemStyle: {
  1002. color: "rgba(137, 207, 245, 1)",
  1003. },
  1004. },
  1005. {
  1006. value: 484,
  1007. name: "教学方案库",
  1008. itemStyle: {
  1009. color: "rgba(180, 226, 251, 1)",
  1010. },
  1011. },
  1012. {
  1013. value: 300,
  1014. name: "第三资源库",
  1015. itemStyle: {
  1016. color: "rgba(212, 237, 251, 1)",
  1017. },
  1018. },
  1019. ],
  1020. center: ["40%", "48%"],
  1021. radius: ["48%", "65%"],
  1022. label: {
  1023. show: true,
  1024. // position: "center",
  1025. formatter: "{b} ({d}%)",
  1026. padding: 1,
  1027. },
  1028. labelLine: {
  1029. show: true,
  1030. // length: -1,
  1031. },
  1032. },
  1033. ],
  1034. });
  1035. };
  1036. // 墨轩湖搜索关键字
  1037. const searchTable6 = async () => {
  1038. table6Load.value = true;
  1039. table6CurrentPage.value = 1;
  1040. table6pageCount.value = 10;
  1041. let data = {
  1042. state: tabIndex6.value,
  1043. currentPage: table6CurrentPage.value,
  1044. pageCount: table6pageCount.value,
  1045. schoolId: 2,
  1046. keyWord: searchInput6.value,
  1047. };
  1048. let res = await axios({
  1049. method: "get",
  1050. url: api.value + "/repairRecord/maintenanceWorker",
  1051. headers: {
  1052. token: sessionStorage.getItem("token"),
  1053. user_head: sessionStorage.getItem("userhead"),
  1054. },
  1055. params: data,
  1056. });
  1057. console.log(res, "黄家湖维修师傅效率统计数据");
  1058. if (res.data.code == 200) {
  1059. if (res.data.data.records) {
  1060. table6Total.value = res.data.data.records.length;
  1061. if (table6CurrentPage.value > 1) {
  1062. tableData6.list = tableData6.list.concat(res.data.data.records);
  1063. } else {
  1064. tableData6.list = res.data.data.records;
  1065. }
  1066. } else {
  1067. tableData6.list = [];
  1068. }
  1069. table6Load.value = false;
  1070. } else {
  1071. table6Load.value = false;
  1072. ElMessage({
  1073. type: "error",
  1074. showClose: true,
  1075. message: res.data.message,
  1076. center: true,
  1077. });
  1078. }
  1079. };
  1080. // 维修师傅效率统计导出
  1081. const importTable6 = async () => {
  1082. let datas = {
  1083. state: tabIndex6.value,
  1084. schoolId: 2,
  1085. keyWord: searchInput6.value,
  1086. };
  1087. let res = await axios({
  1088. method: "get",
  1089. url: api.value + "/repairRecord/maintenanceWorkerExport",
  1090. headers: {
  1091. token: sessionStorage.getItem("token"),
  1092. user_head: sessionStorage.getItem("userhead"),
  1093. },
  1094. params: datas,
  1095. responseType: "blob",
  1096. });
  1097. console.log(res, "墨轩湖维修师傅效率统计");
  1098. if (res.status == 200) {
  1099. let name = `墨轩湖维修师傅效率统计`;
  1100. var content = res.data;
  1101. var data = new Blob([content]);
  1102. var downloadUrl = window.URL.createObjectURL(data);
  1103. var anchor = document.createElement("a");
  1104. anchor.href = downloadUrl;
  1105. anchor.download = name + ".xlsx";
  1106. anchor.click();
  1107. window.URL.revokeObjectURL(data);
  1108. ElMessage({
  1109. type: "success",
  1110. showClose: true,
  1111. message: "导出成功",
  1112. center: true,
  1113. });
  1114. } else {
  1115. ElMessage({
  1116. type: "error",
  1117. showClose: true,
  1118. message: "导出失败",
  1119. center: true,
  1120. });
  1121. }
  1122. };
  1123. onMounted(() => {
  1124. api.value = store.state.user.api;
  1125. getList();
  1126. if (router.currentRoute.value.query.token) {
  1127. console.log(router.currentRoute.value.query.token);
  1128. sessionStorage.setItem(
  1129. "token",
  1130. JSON.stringify(router.currentRoute.value.query.token)
  1131. );
  1132. }
  1133. });
  1134. onUnmounted(() => {
  1135. echarts1.value.dispose();
  1136. echarts2.value.dispose();
  1137. echarts3.value.dispose();
  1138. echarts4.value.dispose();
  1139. echarts5.value.dispose();
  1140. echarts6.value.dispose();
  1141. });
  1142. </script>
  1143. <style scoped lang="scss">
  1144. .content-box {
  1145. min-width: 1000px;
  1146. width: calc(100vw - 260px);
  1147. height: calc(100vh - 105px);
  1148. margin: 20px auto;
  1149. // background-color: #fff;
  1150. // border: 1px solid #000;
  1151. color: #fff;
  1152. display: flex;
  1153. flex-direction: column;
  1154. .middle {
  1155. width: 100%;
  1156. // height: 100%;
  1157. margin: 0 auto;
  1158. overflow: auto;
  1159. .cartogram {
  1160. display: flex;
  1161. justify-content: space-between;
  1162. margin: 0 0 25px 0;
  1163. // 应用入口
  1164. .apply {
  1165. width: 100%;
  1166. min-width: 1240px;
  1167. height: 120px;
  1168. border-radius: 8px;
  1169. background-color: #fff;
  1170. box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  1171. .addApply {
  1172. color: #000;
  1173. height: 40px;
  1174. display: flex;
  1175. align-items: center;
  1176. .title {
  1177. margin: 0 10px;
  1178. }
  1179. img {
  1180. width: 25px;
  1181. height: 25px;
  1182. }
  1183. }
  1184. }
  1185. // 用户类别占比
  1186. .annulus {
  1187. // width: 520px;
  1188. flex: 1;
  1189. min-width: 400px;
  1190. height: 300px;
  1191. border-radius: 8px;
  1192. background-color: #fff;
  1193. box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  1194. .title {
  1195. margin: 10px 30px;
  1196. color: #000;
  1197. font-weight: 700;
  1198. font-size: 20px;
  1199. display: flex;
  1200. align-items: center;
  1201. justify-content: space-between;
  1202. span:nth-child(2) {
  1203. background-color: rgba(230, 239, 255, 1);
  1204. color: rgba(0, 97, 255, 1);
  1205. font-weight: 400;
  1206. font-size: 16px;
  1207. padding: 3px 5px;
  1208. border-radius: 3px;
  1209. }
  1210. }
  1211. // 总人数
  1212. .headcount {
  1213. position: relative;
  1214. top: -250px;
  1215. right: 0;
  1216. width: 100%;
  1217. .num {
  1218. display: flex;
  1219. flex-direction: column;
  1220. }
  1221. span:nth-child(1) {
  1222. font-size: 14px;
  1223. color: #000;
  1224. text-align: right;
  1225. margin-right: 30px;
  1226. }
  1227. span:nth-child(2) {
  1228. font-size: 26px;
  1229. font-weight: 600;
  1230. color: rgba(42, 42, 42, 1);
  1231. text-align: right;
  1232. margin-right: 30px;
  1233. }
  1234. }
  1235. .table {
  1236. width: 90%;
  1237. margin: 20px auto;
  1238. // 表头设置
  1239. :deep(.el-table__header) {
  1240. height: 40px;
  1241. tr {
  1242. color: #000;
  1243. }
  1244. }
  1245. // 表格body
  1246. :deep(.el-table__body) {
  1247. .el-table__row {
  1248. height: 50px;
  1249. color: #000;
  1250. }
  1251. }
  1252. }
  1253. // 用户类别占比
  1254. #annulus {
  1255. width: 100%;
  1256. height: 250px;
  1257. }
  1258. // 能耗趋势图
  1259. #broken {
  1260. width: 100%;
  1261. height: 250px;
  1262. }
  1263. // 视频监控管理
  1264. .video {
  1265. width: 100%;
  1266. height: 250px;
  1267. // margin: 20px auto;
  1268. color: #000;
  1269. ul {
  1270. // height: 100%;
  1271. margin: 12px 20px;
  1272. padding: 0;
  1273. display: flex;
  1274. // flex-wrap: wrap;
  1275. justify-content: space-around;
  1276. li {
  1277. width: 45%;
  1278. height: 100px;
  1279. // background-color: rgba(237, 245, 250, 1);
  1280. border-radius: 7px;
  1281. list-style: none;
  1282. display: flex;
  1283. flex-direction: column;
  1284. justify-content: center;
  1285. align-items: center;
  1286. span:nth-child(1) {
  1287. font-size: 30px;
  1288. color: #000;
  1289. font-weight: 600;
  1290. }
  1291. span:nth-child(2) {
  1292. font-size: 16px;
  1293. color: rgba(51, 51, 51, 1);
  1294. // font-weight: 600;
  1295. }
  1296. }
  1297. }
  1298. }
  1299. // 待办事项
  1300. .backlog {
  1301. margin: 0 30px;
  1302. ul {
  1303. height: 230px;
  1304. color: rgba(0, 97, 255, 1);
  1305. margin: 0;
  1306. padding: 0;
  1307. overflow: auto;
  1308. li {
  1309. list-style: none;
  1310. display: flex;
  1311. justify-content: space-between;
  1312. align-items: center;
  1313. padding: 10px 0;
  1314. border-bottom: 1px solid rgba(230, 230, 230, 1);
  1315. span:nth-child(2) {
  1316. padding: 0 8px;
  1317. }
  1318. }
  1319. }
  1320. ul::-webkit-scrollbar-track {
  1321. background-color: #daeeff;
  1322. }
  1323. ul::-webkit-scrollbar {
  1324. background-color: rgba(0, 97, 255, 1);
  1325. height: 3px;
  1326. width: 2px;
  1327. }
  1328. // ul::-webkit-scrollbar-thumb {
  1329. // background: #57b2ff;
  1330. // border-radius: 4px;
  1331. // height: 3px;
  1332. // width: 2px;
  1333. // }
  1334. }
  1335. // 待办事项
  1336. .teacher {
  1337. margin: 0 30px;
  1338. ul {
  1339. height: 230px;
  1340. color: rgba(0, 97, 255, 1);
  1341. margin: 0;
  1342. padding: 0;
  1343. overflow: auto;
  1344. li {
  1345. list-style: none;
  1346. display: flex;
  1347. justify-content: space-between;
  1348. align-items: center;
  1349. padding: 10px 0;
  1350. border-bottom: 1px solid rgba(230, 230, 230, 1);
  1351. span {
  1352. color: rgba(166, 166, 166, 1);
  1353. }
  1354. span:nth-child(2) {
  1355. padding: 0 8px;
  1356. color: rgba(0, 97, 255, 1);
  1357. }
  1358. }
  1359. li:nth-child(1) {
  1360. span:nth-child(1) {
  1361. color: rgba(212, 48, 48, 1);
  1362. }
  1363. }
  1364. li:nth-child(2) {
  1365. span:nth-child(1) {
  1366. color: rgba(255, 87, 51, 1);
  1367. }
  1368. }
  1369. li:nth-child(3) {
  1370. span:nth-child(1) {
  1371. color: rgba(0, 97, 255, 1);
  1372. }
  1373. }
  1374. }
  1375. ul::-webkit-scrollbar-track {
  1376. background-color: #daeeff;
  1377. }
  1378. ul::-webkit-scrollbar {
  1379. background-color: rgba(0, 97, 255, 1);
  1380. height: 3px;
  1381. width: 2px;
  1382. }
  1383. // ul::-webkit-scrollbar-thumb {
  1384. // background: #57b2ff;
  1385. // border-radius: 4px;
  1386. // height: 3px;
  1387. // width: 2px;
  1388. // }
  1389. }
  1390. // 门禁管理
  1391. #doorForbid {
  1392. width: 100%;
  1393. height: 250px;
  1394. }
  1395. // 班级考勤
  1396. #class {
  1397. width: 100%;
  1398. height: 250px;
  1399. }
  1400. // 资源大数据
  1401. #resource {
  1402. width: 100%;
  1403. height: 250px;
  1404. }
  1405. }
  1406. .annulus:nth-child(2) {
  1407. margin: 0 20px;
  1408. }
  1409. //3 视频监控管理
  1410. // 6 行为统计
  1411. #behavior6 {
  1412. width: 100%;
  1413. height: 250px;
  1414. }
  1415. }
  1416. .cartogram:nth-child(4) {
  1417. margin: 0;
  1418. }
  1419. }
  1420. }
  1421. .item::-webkit-scrollbar-track {
  1422. background-color: #fff;
  1423. }
  1424. .item::-webkit-scrollbar {
  1425. background-color: #57b2ff;
  1426. height: 5px;
  1427. width: 3px;
  1428. }
  1429. .item::-webkit-scrollbar-thumb {
  1430. background: #57b2ff;
  1431. border-radius: 4px;
  1432. height: 3px;
  1433. width: 3px;
  1434. }
  1435. </style>