left.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. <template>
  2. <el-aside class="left">
  3. <div class="left_top">
  4. <div class="title" :style="{ background: `url(${frame})` }">
  5. <div class="text">教室分类统计</div>
  6. </div>
  7. <div class="content">
  8. <div id="myChart"></div>
  9. <div class="list">
  10. <div
  11. class="item"
  12. v-for="(item, index) in classRoomCount"
  13. :key="index"
  14. :style="{
  15. borderRight:
  16. index == 0
  17. ? '2px solid #0BF'
  18. : index == 1
  19. ? '2px solid #00EB7D'
  20. : index == 2
  21. ? '2px solid #FB0'
  22. : '',
  23. }"
  24. >
  25. <!-- <i :style="{ backgroundColor: item.color }"></i> -->
  26. <svg
  27. xmlns="http://www.w3.org/2000/svg"
  28. width="14"
  29. height="14"
  30. viewBox="0 0 14 14"
  31. fill="none"
  32. v-if="index === 0"
  33. >
  34. <path
  35. d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
  36. fill="#00BBFF"
  37. />
  38. </svg>
  39. <svg
  40. v-if="index === 1"
  41. xmlns="http://www.w3.org/2000/svg"
  42. width="14"
  43. height="14"
  44. viewBox="0 0 14 14"
  45. fill="none"
  46. >
  47. <path
  48. d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
  49. fill="#00EB7D"
  50. />
  51. </svg>
  52. <svg
  53. v-if="index === 2"
  54. xmlns="http://www.w3.org/2000/svg"
  55. width="14"
  56. height="14"
  57. viewBox="0 0 14 14"
  58. fill="none"
  59. >
  60. <path
  61. d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
  62. fill="#FFBB00"
  63. />
  64. </svg>
  65. <div class="descr">
  66. <span>{{ item.name }}</span>
  67. <span>{{ item.value }}</span>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="left-center">
  74. <div class="title" :style="{ background: `url(${frame})` }">
  75. <div class="text">本周课程统计</div>
  76. </div>
  77. <div class="content">
  78. <div class="count" v-for="(item, index) in classCount" :key="index">
  79. <CircleProgress
  80. :target-value="item.number"
  81. :color="item.color"
  82. :text="item.text"
  83. :index="index"
  84. text-position="bottom"
  85. >
  86. <img :src="leftimg + item.imgnumber + '.png'" alt="" />
  87. </CircleProgress>
  88. <div class="text">{{ item.text }}</div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="left-bottom">
  93. <div class="title" :style="{ background: `url(${frame})` }">
  94. <div class="text">教室使用明细</div>
  95. </div>
  96. <div class="usering-free-container">
  97. <div class="usering-free">
  98. <div class="usering-box">
  99. <div class="text">
  100. 使用中{{ getPercentage || 0 }}%
  101. <span class="num">{{ occupiedClassroomsCount || 0 }}间</span>
  102. </div>
  103. </div>
  104. <div class="free-box">
  105. <div class="text">
  106. 空闲中:{{ (100 - getPercentage).toFixed(2) || 0 }}%
  107. <span class="num"
  108. >{{ classRoom.length - occupiedClassroomsCount || 0 }}间</span
  109. >
  110. </div>
  111. </div>
  112. </div>
  113. <el-progress
  114. :percentage="getPercentage"
  115. :show-text="false"
  116. color="#1BCEFF"
  117. />
  118. </div>
  119. <div class="search-container">
  120. <el-input
  121. v-model="searchData"
  122. clearable
  123. placeholder="请输入大楼名称、教室名称"
  124. />
  125. <el-button type="primary" :icon="Search" @click="searchHandel" />
  126. </div>
  127. <div class="content" style="height: 100%; overflow: hidden">
  128. <div class="table">
  129. <div class="dropdown-container">
  130. <el-dropdown trigger="click" @command="clickBuildingsropdown">
  131. <span class="dropdown-name">
  132. {{ cureetBuild }}
  133. <!-- <Edit style="width: 1em; height: 1em; margin-right: 8px" /> -->
  134. </span>
  135. <template #dropdown>
  136. <el-dropdown-menu>
  137. <el-dropdown-item
  138. :command="item.gis_building_code"
  139. v-for="(item, index) in buildings"
  140. :key="index"
  141. >{{ item.building_name }}</el-dropdown-item
  142. >
  143. </el-dropdown-menu>
  144. </template>
  145. </el-dropdown>
  146. <el-dropdown trigger="click" @command="clickCategoryTypedropdown">
  147. <span class="dropdown-name">
  148. {{ category || "全部类型" }}
  149. <el-icon>
  150. <arrow-down />
  151. </el-icon>
  152. </span>
  153. <template #dropdown>
  154. <el-dropdown-menu>
  155. <el-dropdown-item
  156. :command="item.category"
  157. v-for="(item, index) in categoryType"
  158. :key="index"
  159. >{{ item.category }}</el-dropdown-item
  160. >
  161. </el-dropdown-menu>
  162. </template>
  163. </el-dropdown>
  164. <el-dropdown trigger="click" @command="clickLeafsdropdown">
  165. <span class="dropdown-name">
  166. {{ cureetLeaf }}
  167. <el-icon>
  168. <arrow-down />
  169. </el-icon>
  170. </span>
  171. <template #dropdown>
  172. <el-dropdown-menu>
  173. <el-dropdown-item
  174. :command="item.leaf"
  175. v-for="(item, index) in leafs"
  176. :key="index"
  177. >{{ item.leaf_name }}</el-dropdown-item
  178. >
  179. </el-dropdown-menu>
  180. </template>
  181. </el-dropdown>
  182. <el-dropdown trigger="click" @command="clickStatusesdropdown">
  183. <span class="dropdown-name">
  184. {{ cureetStatus }}
  185. <el-icon>
  186. <arrow-down />
  187. </el-icon>
  188. </span>
  189. <template #dropdown>
  190. <el-dropdown-menu>
  191. <el-dropdown-item
  192. :command="item.status_code"
  193. v-for="(item, index) in statuses"
  194. :key="index"
  195. >{{ item.status_name }}</el-dropdown-item
  196. >
  197. </el-dropdown-menu>
  198. </template>
  199. </el-dropdown>
  200. </div>
  201. <!-- <div
  202. ref="testMain"
  203. style="height: 442px; overflow: scroll; padding-top: 6px"
  204. class="scroll"
  205. > -->
  206. <!-- <div v-if="classRoomList.length > 0" style="width: 100%; height: 100%"> -->
  207. <div
  208. style="height: 342px; overflow: hidden; padding-top: 10px"
  209. v-if="classRoomList.length > 0"
  210. >
  211. <scroll
  212. :content="classRoomList"
  213. class="vue3-seamless-scroll"
  214. :hover="true"
  215. :wheel="true"
  216. direction="top"
  217. ref="scrollRef"
  218. :mask="false"
  219. >
  220. <template #default="{item}" >
  221. <div class="list-item" >
  222. <div class="class-status-btn-container">
  223. <div class="left-class-status">
  224. <div style="margin-right: 16px">
  225. {{ item.classroom_name }}
  226. </div>
  227. <Tag :text="item.status_code"></Tag>
  228. </div>
  229. <div class="right-btn" @click.prevent="handleRoom(item)">
  230. 查看
  231. </div>
  232. </div>
  233. <div class="item-content">
  234. <div class="item-content-left">
  235. <div class="position">位置:{{ item.location }}</div>
  236. <div class="course" v-if="item.course_name">
  237. 课程:{{ item.course_name }}
  238. </div>
  239. </div>
  240. <div class="item-content-right">
  241. <div>类型:{{ item.category }}</div>
  242. <div class="person-rate-container">
  243. <div v-if="item.actual != null">
  244. 实到/应到:{{ item.actual }}/{{ item.expected }}
  245. </div>
  246. <div
  247. style="margin-left: 8px"
  248. v-if="item.actual != null"
  249. >
  250. 到课率:{{
  251. (item.actual / item.expected).toFixed(2) * 100 || 0
  252. }}%
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </template>
  259. </scroll>
  260. </div>
  261. </div>
  262. <!-- </div> -->
  263. </div>
  264. </div>
  265. </el-aside>
  266. <div
  267. ref="popoverRef"
  268. v-if="roomVisible"
  269. style="
  270. background-color: rgba(245, 246, 248, 0.9);
  271. border-radius: 10px;
  272. position: absolute;
  273. top: 10vh;
  274. left: 50%;
  275. width: 366px;
  276. z-index: 999;
  277. transform: translateX(-50%);
  278. "
  279. >
  280. <div class="model-detail">
  281. <span
  282. ><span class="title">教室状态: </span>
  283. <span :class="classInfo.online ? 'green' : 'red'">{{
  284. classInfo && classInfo.status
  285. }}</span>
  286. </span>
  287. <span
  288. ><span class="title">班级: </span>
  289. <span style="width: 105px; display: inline-flex">{{
  290. classInfo && classInfo.className
  291. }}</span>
  292. </span>
  293. <span
  294. ><span class="title">课程名称: </span>
  295. <span style="width: 94px; display: inline-flex">{{
  296. classInfo && classInfo.courseName
  297. }}</span>
  298. </span>
  299. <span
  300. ><span class="title">应到人数: </span
  301. >{{ classInfo && classInfo.expected }}</span
  302. >
  303. <span
  304. ><span class="title">教室: </span>
  305. <span style="width: 120px; display: inline-flex">
  306. {{ classInfo && classInfo.class }}
  307. </span>
  308. </span>
  309. <span
  310. ><span class="title">实到人数: </span
  311. >{{ classInfo && classInfo.actual }}</span
  312. >
  313. <span
  314. ><span class="title">老师: </span
  315. >{{ classInfo && classInfo.teacher }}</span
  316. >
  317. </div>
  318. </div>
  319. </template>
  320. <script >
  321. import * as echarts from "echarts";
  322. import {
  323. reactive,
  324. onMounted,
  325. ref,
  326. onBeforeUnmount,
  327. onUnmounted,
  328. nextTick,
  329. getCurrentInstance,
  330. computed,
  331. } from "vue";
  332. import {
  333. ElScrollbar,
  334. ElPagination,
  335. ElDialog,
  336. ElCarousel,
  337. ElCarouselItem,
  338. ElIcon,
  339. } from "element-plus";
  340. import { Search, ArrowDown } from "@element-plus/icons-vue";
  341. import { getClass, classSelections, queryClassroom } from "../request/api";
  342. import CircleProgress from "./CircleProgress.vue";
  343. import {
  344. Vue3SeamlessScroll,
  345. VerticalScroll,
  346. HorizontalScroll,
  347. } from "vue3-seamless-scroll";
  348. import Scroll from "./ScrollView.vue";
  349. // import { callUIInteraction } from "../webrtcVideo";
  350. import Tag from "./Tag.vue";
  351. export default {
  352. name: "Histogram",
  353. components: {
  354. ElScrollbar,
  355. ElPagination,
  356. ElDialog,
  357. ElCarousel,
  358. ElCarouselItem,
  359. CircleProgress,
  360. Tag,
  361. Vue3SeamlessScroll,
  362. VerticalScroll,
  363. Scroll
  364. },
  365. setup(_, { emit }) {
  366. // 教室分类统计
  367. const classRoomCount = ref([]);
  368. const generateData = (totalNum, bigvalue, smallvalue, color) => {
  369. let dataArr = [];
  370. for (var i = 0; i < totalNum; i++) {
  371. if (i % 2 === 0) {
  372. dataArr.push({
  373. name: (i + 1).toString(),
  374. value: bigvalue,
  375. itemStyle: {
  376. normal: {
  377. color: color,
  378. borderWidth: 0,
  379. },
  380. },
  381. });
  382. } else {
  383. dataArr.push({
  384. name: (i + 1).toString(),
  385. value: smallvalue,
  386. itemStyle: {
  387. normal: {
  388. color: "rgba(0,0,0,0)",
  389. borderWidth: 0,
  390. },
  391. },
  392. });
  393. }
  394. }
  395. return dataArr;
  396. };
  397. let dolitData = generateData(60, 25, 20, "rgb(126,190,255)");
  398. const fontSize = (res) => {
  399. let clientWidth =
  400. window.innerWidth ||
  401. document.documentElement.clientWidth ||
  402. document.body.clientWidth;
  403. if (!clientWidth) return;
  404. // 此处的3840 为设计稿的宽度,记得修改!
  405. let fontSize = clientWidth / 1920;
  406. return res * fontSize;
  407. };
  408. const classPie = reactive({
  409. option: {
  410. color: ["#00bbff", "#00eb7d", "#ffbb00"],
  411. tooltip: {
  412. trigger: "item",
  413. position: "right",
  414. },
  415. series: [
  416. {
  417. type: "pie",
  418. radius: ["85%", "100%"],
  419. avoidLabelOverlap: false,
  420. zlevel: 9999,
  421. labelLine: {},
  422. label: {
  423. show: true,
  424. position: "center",
  425. color: "#fff",
  426. fontSize: fontSize(14),
  427. formatter: () => {
  428. // 格式化要展示的文本
  429. return `{a|总数}\n{b|${roomtotle.value}}{c|间}`;
  430. },
  431. rich: {
  432. a: {
  433. color: "rgba(255, 255, 255, 0.80)",
  434. lineHeight: fontSize(24),
  435. fontSize: fontSize(12),
  436. },
  437. b: {
  438. color: "#fff",
  439. fontSize: fontSize(20),
  440. fontWeight: 700,
  441. },
  442. c: {
  443. color: "rgba(255, 255, 255, 0.80)",
  444. fontSize: fontSize(12),
  445. },
  446. },
  447. },
  448. labelLine: {
  449. show: false,
  450. },
  451. data: classRoomCount,
  452. },
  453. {
  454. name: "虚线",
  455. type: "pie",
  456. zlevel: 10,
  457. silent: true,
  458. radius: ["58%", "56%"],
  459. label: {
  460. normal: {
  461. show: false,
  462. },
  463. },
  464. labelLine: {
  465. normal: {
  466. show: false,
  467. },
  468. },
  469. data: dolitData,
  470. },
  471. {
  472. name: "阴影圈",
  473. type: "pie",
  474. radius: ["100%", "70%"],
  475. center: ["50%", "50%"],
  476. emphasis: {
  477. scale: false,
  478. },
  479. tooltip: {
  480. show: false,
  481. },
  482. itemStyle: {
  483. // color: "rgba(255,225,255, 0.08)",
  484. color: "rgba(34, 81, 113,0.8)",
  485. },
  486. zlevel: 4,
  487. labelLine: {
  488. show: false,
  489. },
  490. data: [100],
  491. },
  492. {
  493. name: "阴影圈2",
  494. type: "pie",
  495. radius: ["70%", "52%"],
  496. center: ["50%", "50%"],
  497. emphasis: {
  498. scale: false,
  499. },
  500. tooltip: {
  501. show: false,
  502. },
  503. itemStyle: {
  504. // color: "rgba(255,225,255, 0.08)",
  505. color: "rgba(36, 66, 88,0.8)",
  506. },
  507. zlevel: 4,
  508. labelLine: {
  509. show: false,
  510. },
  511. data: [100],
  512. },
  513. {
  514. name: "中间圆",
  515. type: "pie",
  516. radius: ["0", "50%"],
  517. center: ["50%", "50%"],
  518. emphasis: {
  519. scale: false,
  520. },
  521. tooltip: {
  522. show: false,
  523. },
  524. itemStyle: {
  525. // color: "rgba(204,225,255, 0.08)",
  526. color: "rgba(34, 81, 113,0.5)",
  527. },
  528. zlevel: 4,
  529. labelLine: {
  530. show: false,
  531. },
  532. data: [100],
  533. },
  534. ],
  535. },
  536. });
  537. let myChart = ref(null);
  538. const initeCharts = () => {
  539. myChart.value = echarts.init(document.getElementById("myChart"));
  540. // 绘制图表
  541. console.log("绘制图表", classPie.option);
  542. myChart.value.setOption(classPie.option);
  543. };
  544. window.addEventListener("resize", function () {
  545. myChart.value.resize();
  546. });
  547. // 物联设备类型统计
  548. const interDevice = ref([]);
  549. const roomVisible = ref(false);
  550. //消失面板
  551. const clearPanel = () => {
  552. roomVisible.value = false;
  553. };
  554. const popoverRef = ref(null);
  555. const triggerRef = ref({
  556. getBoundingClientRect() {
  557. // console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
  558. return position.value;
  559. },
  560. });
  561. // 点击某个模型跟随移动
  562. const mousemoveHandler = (x, y) => {
  563. position.value = DOMRect.fromRect({
  564. width: 0,
  565. height: 0,
  566. x: x,
  567. y: y,
  568. });
  569. };
  570. const position = ref({
  571. top: 0,
  572. left: 0,
  573. bottom: 0,
  574. right: 0,
  575. });
  576. let classInfo = ref({});
  577. const handleRoom = function (item) {
  578. //查看前隐藏
  579. // let a1 = document.getElementById("popoverRef");
  580. // a1.style.display = "none";
  581. // emit("childMethod");
  582. // console.log("kankanitem", item);
  583. // setTimeout(() => {
  584. // roomVisible.value = true;
  585. // classInfo.value = item;
  586. // classInfo.value.online =
  587. // classInfo.value.status == "在用" ? true : false;
  588. // }, 2400);
  589. // mousemoveHandler(1000, 60);
  590. // let meg = item;
  591. // // let a2 =`roomName=${item.class}`
  592. // console.log("meg是多少", meg);
  593. //发消息给UE
  594. let data = {
  595. MainServiceName: "JiaoShiShiNei",
  596. ClassroomName: item.classroom_name,
  597. };
  598. console.log("data", JSON.stringify(data));
  599. emitUIInteraction(data);
  600. };
  601. // 本周课程统计数据
  602. const classCount = ref([]);
  603. // 智慧教室使用数据
  604. const classRoom = ref([]);
  605. const roomtotle = ref([]);
  606. const getClassData = async () => {
  607. let res = await getClass();
  608. console.log("res----教室分类统计", res);
  609. let { course, classroomDetail, category } = res.data;
  610. classRoomCount.value = category;
  611. //获取教室总数
  612. roomtotle.value = category.reduce(
  613. (accumulator, currentValue) => accumulator + currentValue.value,
  614. 0
  615. );
  616. console.log("categorycategory", roomtotle);
  617. if (classRoomCount.value) {
  618. initeCharts();
  619. }
  620. classCount.value = course;
  621. console.log("看一下颜色", classCount.value);
  622. classRoom.value = classroomDetail;
  623. };
  624. let timer = ref(null);
  625. let testMain = ref(null);
  626. onMounted(() => {
  627. getClassData();
  628. start();
  629. // 获取教师下拉选择数据
  630. getClassSelections();
  631. //获取教室列表数据
  632. getClassRoomList();
  633. });
  634. onBeforeUnmount(() => {
  635. clearTimeout(timer.value);
  636. });
  637. onUnmounted(() => {
  638. clearTimeout(timer.value);
  639. });
  640. function testMove() {
  641. clearTimeout(timer.value);
  642. }
  643. function testMend() {
  644. start();
  645. }
  646. //开启定时器方法
  647. function start() {
  648. //清除定时器
  649. clearTimeout(timer.value);
  650. //定时器触发周期
  651. let speed = ref(75);
  652. timer.value = setInterval(MarqueeTest, speed.value);
  653. }
  654. function MarqueeTest() {
  655. return;
  656. let test1 = testMain.value;
  657. //判断组件是否渲染完成
  658. if (test1.offsetHeight == 0) {
  659. test1 = testMain.value;
  660. } else {
  661. //如果列表数量过少不进行滚动
  662. // console.log("test1", test1.childNodes)
  663. if (test1.childNodes.length < 6) {
  664. clearTimeout(timer.value);
  665. return;
  666. }
  667. //组件进行滚动
  668. test1.scrollTop += 1;
  669. //判断滚动条是否滚动到底部
  670. if (test1.scrollTop == test1.scrollHeight - test1.clientHeight) {
  671. //获取组件第一个节点
  672. let a = test1.childNodes[0];
  673. //删除节点
  674. test1.removeChild(a);
  675. //将该节点拼接到组件最后
  676. test1.append(a);
  677. }
  678. }
  679. }
  680. // 定时刷新教师统计数据
  681. let classRoomInterval = ref(null);
  682. const starttimeInterval = () => {
  683. clearTimeout(classRoomInterval.value);
  684. classRoomInterval.value = setInterval(() => {
  685. getClassData();
  686. }, 5000);
  687. };
  688. // 占用教室数量
  689. const occupiedClassroomsCount = computed(() => {
  690. return classRoom.value.filter((classroom) => classroom.status === "在用")
  691. .length;
  692. });
  693. // 计算属性:占用百分比
  694. const getPercentage = computed(() => {
  695. const total = classRoom.value.length;
  696. const occupied = occupiedClassroomsCount.value;
  697. return ((occupied / total) * 100).toFixed(2) || 0;
  698. });
  699. // 获取教师下拉选择
  700. let buildings = ref({});
  701. let categoryType = ref({});
  702. let leafs = ref({});
  703. let statuses = ref({});
  704. const getClassSelections = async () => {
  705. let res = await classSelections();
  706. if (res.code == 200) {
  707. buildings.value = res.data.buildings;
  708. categoryType.value = res.data.categoryType;
  709. leafs.value = res.data.leafs;
  710. statuses.value = res.data.statuses;
  711. }
  712. };
  713. let cureetBuild = ref("全部大楼");
  714. const clickBuildingsropdown = (e) => {
  715. console.log("e选择大楼", e);
  716. gisBuildingCode.value = e;
  717. let build = buildings.value.find((item) => {
  718. return item.gis_building_code == e;
  719. });
  720. cureetBuild.value = build.building_name;
  721. searchHandel();
  722. };
  723. const clickCategoryTypedropdown = (e) => {
  724. console.log("e", e);
  725. category.value = e;
  726. searchHandel();
  727. };
  728. let cureetLeaf = ref("全部楼层");
  729. const clickLeafsdropdown = (e) => {
  730. console.log("e", e);
  731. gisLeaf.value = e;
  732. let leaf = leafs.value.find((item) => {
  733. return item.leaf == e;
  734. });
  735. cureetLeaf.value = leaf.leaf_name;
  736. searchHandel();
  737. };
  738. let cureetStatus = ref("全部状态");
  739. const clickStatusesdropdown = (e) => {
  740. console.log("e", e);
  741. statusCode.value = e;
  742. let status = statuses.value.find((item) => {
  743. return item.status_code == e;
  744. });
  745. cureetStatus.value = status.status_name;
  746. searchHandel();
  747. };
  748. // 搜索
  749. let searchData = ref("");
  750. let category = ref("");
  751. let gisBuildingCode = ref("");
  752. let gisLeaf = ref("");
  753. let statusCode = ref("");
  754. let scrollRef = ref(null);
  755. const offset = () => {
  756. console.log("滚动完成一次");
  757. };
  758. const searchHandel = async () => {
  759. getClassRoomList();
  760. };
  761. let classRoomList = ref([]);
  762. const getClassRoomList = async () => {
  763. let res = await queryClassroom({
  764. classRoomName: searchData.value,
  765. category: category.value,
  766. gisBuildingCode: gisBuildingCode.value,
  767. statusCode: statusCode.value,
  768. gisLeaf: gisLeaf.value,
  769. });
  770. classRoomList.value = [];
  771. setTimeout(() => {
  772. classRoomList.value = res.data;
  773. // scrollRef.value.reset()
  774. }, 0);
  775. };
  776. let deviceDialog = ref(true);
  777. const showDeviceDialog = () => {
  778. deviceDialog.value = true;
  779. };
  780. const leftimg = ref("./img/");
  781. const frame = ref("./img/frame.png");
  782. return {
  783. roomVisible,
  784. classCount,
  785. classRoom,
  786. interDevice,
  787. handleRoom,
  788. testMend,
  789. testMove,
  790. testMain,
  791. popoverRef,
  792. classRoomCount,
  793. triggerRef,
  794. classInfo,
  795. leftimg,
  796. clearPanel,
  797. frame,
  798. ElIcon,
  799. Search,
  800. ArrowDown,
  801. ElIcon,
  802. searchData,
  803. searchHandel,
  804. getClassSelections,
  805. buildings,
  806. categoryType,
  807. leafs,
  808. statuses,
  809. clickCategoryTypedropdown,
  810. clickBuildingsropdown,
  811. clickLeafsdropdown,
  812. clickStatusesdropdown,
  813. // start,
  814. category,
  815. gisBuildingCode,
  816. gisLeaf,
  817. statusCode,
  818. getPercentage,
  819. occupiedClassroomsCount,
  820. classRoomList,
  821. deviceDialog,
  822. showDeviceDialog,
  823. cureetBuild,
  824. cureetLeaf,
  825. cureetStatus,
  826. scrollRef,
  827. offset,
  828. };
  829. },
  830. };
  831. </script>
  832. <style scoped lang="scss">
  833. @import "../assets/css/left.scss";
  834. </style>
  835. <style>
  836. .classpopover {
  837. .el-popper__arrow {
  838. top: 196px !important;
  839. }
  840. .el-popper[data-popper-placement^="bottom"],
  841. .el-popper__arrow::before {
  842. border-left-color: transparent !important;
  843. border-top-color: transparent !important;
  844. }
  845. }
  846. .el-popper.is-light {
  847. border-radius: 10px;
  848. }
  849. </style>