Ai.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <div class="home">
  3. <div class="home_flex">
  4. <transition
  5. name="custom-up"
  6. enter-active-class="animate__animated animate__fadeInLeft"
  7. leave-active-class="animate__animated animate__fadeOutLeft"
  8. >
  9. <x-box v-if="show" name="人员行为分析">
  10. <div class="chart_content">
  11. <div class="chart_scroll">
  12. <vue3-seamless-scroll
  13. v-if="personList.length > 0"
  14. :hover="true"
  15. :step="0.2"
  16. :hover-stop="true"
  17. :list="personList"
  18. class="warn_scroll">
  19. <div class="chart_flex" v-for="(item, i) in personList">
  20. <div class="chart_icon" v-viewer>
  21. <img class="img_url" :src="item.carImgUrl" alt="">
  22. </div>
  23. <div class="chart_text">
  24. <div>巡检时间:{{item.capTime}}</div>
  25. <div class="flex_text">
  26. <div>姓名:{{item.name}}</div>
  27. <div>人员行为:{{item.personType}}</div>
  28. </div>
  29. <div class="flex_text">
  30. <div>巡检位置:{{item.devName}}</div>
  31. <div>巡检结果:{{item.capResult}}</div>
  32. </div>
  33. </div>
  34. </div>
  35. </vue3-seamless-scroll>
  36. <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" v-else />
  37. </div>
  38. </div>
  39. </x-box>
  40. </transition>
  41. <transition
  42. name="custom-up"
  43. enter-active-class="animate__animated animate__fadeInLeft"
  44. leave-active-class="animate__animated animate__fadeOutLeft"
  45. >
  46. <x-box v-if="show" name="车辆识别">
  47. <div class="chart_content">
  48. <div class="chart_scroll">
  49. <vue3-seamless-scroll
  50. v-if="carList.length > 0"
  51. :hover="true"
  52. :step="0.2"
  53. :hover-stop="true"
  54. :list="carList"
  55. class="warn_scroll">
  56. <div class="chart_flex" v-for="item in carList">
  57. <div class="chart_icon" v-viewer>
  58. <img v-if="item.carImgUrl" class="img_url" :src="item.carImgUrl" alt="">
  59. </div>
  60. <div class="chart_text">
  61. <div>巡检时间:{{item.capTime}}</div>
  62. <div class="flex_text">
  63. <div>车牌号:{{item.carNum}}</div>
  64. <div>车牌颜色:黑色</div>
  65. </div>
  66. <div class="flex_text">
  67. <div>巡检位置:{{item.devName}}</div>
  68. <div>巡检结果:{{item.capResult}}</div>
  69. </div>
  70. </div>
  71. </div>
  72. </vue3-seamless-scroll>
  73. <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" v-else />
  74. </div>
  75. </div>
  76. </x-box>
  77. </transition>
  78. <transition
  79. name="custom-up"
  80. enter-active-class="animate__animated animate__fadeInLeft"
  81. leave-active-class="animate__animated animate__fadeOutLeft"
  82. >
  83. <x-box v-if="show" name="镜头脏污">
  84. <div class="chart_content">
  85. <div class="chart_scroll">
  86. <vue3-seamless-scroll
  87. v-if="dirtyList.length > 0"
  88. :hover="true"
  89. :step="0.2"
  90. :hover-stop="true"
  91. :list="dirtyList"
  92. class="warn_scroll">
  93. <div class="chart_flex" v-for="(item, i) in dirtyList" :key="i">
  94. <div class="chart_icon" v-viewer>
  95. <img v-if="item.imgUrl" class="img_url" :src="item.imgUrl" alt="">
  96. </div>
  97. <div class="chart_text">
  98. <div>巡检时间:{{item.capTime}}</div>
  99. <div>巡检位置:{{item.devName}}</div>
  100. </div>
  101. </div>
  102. </vue3-seamless-scroll>
  103. <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" v-else />
  104. </div>
  105. </div>
  106. </x-box>
  107. </transition>
  108. </div>
  109. <div class="home_center">
  110. <transition
  111. name="custom-up"
  112. enter-active-class="animate__animated animate__fadeInDown"
  113. leave-active-class="animate__animated animate__fadeOutUp"
  114. >
  115. <x-tabs v-if="show"></x-tabs>
  116. </transition>
  117. <transition
  118. name="custom-up"
  119. enter-active-class="animate__animated animate__zoomIn"
  120. leave-active-class="animate__animated animate__zoomOut"
  121. >
  122. <div v-if="url" class="video">
  123. <video v-if="url" autoplay muted :src="url"></video>
  124. </div>
  125. </transition>
  126. <div class="picture"></div>
  127. </div>
  128. <div class="home_flex">
  129. <transition
  130. name="custom-up"
  131. enter-active-class="animate__animated animate__fadeInRight"
  132. leave-active-class="animate__animated animate__fadeOutRight"
  133. >
  134. <x-box v-if="show" name="周界巡检">
  135. <div class="chart_content">
  136. <div class="chart_scroll">
  137. <vue3-seamless-scroll
  138. v-if="speciesList.length > 0"
  139. :hover="true"
  140. :step="0.2"
  141. :hover-stop="true"
  142. :list="speciesList"
  143. class="warn_scroll">
  144. <div class="chart_flex" v-for="item in speciesList">
  145. <div class="chart_icon" v-viewer>
  146. <img v-if="item.imgUrl" class="img_url" :src="item.imgUrl" alt="">
  147. </div>
  148. <div class="chart_text">
  149. <div>巡检时间:{{item.capTime}}</div>
  150. <div>巡检位置:{{item.devName}}</div>
  151. </div>
  152. </div>
  153. </vue3-seamless-scroll>
  154. <a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" description="暂无数据" v-else />
  155. </div>
  156. </div>
  157. </x-box>
  158. </transition>
  159. <transition
  160. name="custom-up"
  161. enter-active-class="animate__animated animate__fadeInRight"
  162. leave-active-class="animate__animated animate__fadeOutRight"
  163. >
  164. <x-box v-if="show" name="视频监控" :height="600">
  165. <div class="chart_content">
  166. <div class="chart_scroll">
  167. <div class="monit" v-for="(items, i) in list" :key="items.id">
  168. <div class="monit_parent" @click="clickParent(i)">
  169. <div v-if="items.isShow">
  170. <caret-down-outlined style="color: #00F3FF" />
  171. </div>
  172. <div v-else>
  173. <caret-right-outlined style="color: #00F3FF" />
  174. </div>
  175. <div class="monit_name">{{items.name}}</div>
  176. </div>
  177. <div v-if="items.isShow" class="monit_children">
  178. <div v-for="item in items.children" :class="['monit_children_item', item.isShow ? 'monit_children_select' : '']" @click.stop="clickChild(item)">
  179. <div>{{item.name}}</div>
  180. <div v-if="item.isShow" class="look">查看中</div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </x-box>
  187. </transition>
  188. </div>
  189. </div>
  190. </template>
  191. <script>
  192. export default {
  193. name: "Ai"
  194. }
  195. </script>
  196. <script setup>
  197. import { CaretRightOutlined, CaretDownOutlined } from "@ant-design/icons-vue";
  198. import { getAiPerson, getAiCar, getAiSpecies, getAiDirty } from "../../utils/api";
  199. import {onMounted, ref} from 'vue';
  200. import XBox from "../../components/XBox.vue";
  201. import XTabs from '../../components/XTabs.vue';
  202. import { Empty } from 'ant-design-vue';
  203. const personList = ref([]);
  204. const initPerson = () => {
  205. let params = {
  206. current: 1,
  207. pageSize: 10
  208. }
  209. getAiPerson(params).then(res => {
  210. personList.value = res.data.records
  211. })
  212. }
  213. const carList = ref([])
  214. const initCar = () => {
  215. let params = {
  216. current: 1,
  217. pageSize: 10
  218. }
  219. getAiCar(params).then(res => {
  220. carList.value = res.data.records
  221. })
  222. }
  223. const speciesList = ref([])
  224. const initSpecies = () => {
  225. let params = {
  226. current: 1,
  227. pageSize: 10
  228. }
  229. getAiSpecies(params).then(res => {
  230. speciesList.value = res.data.records
  231. })
  232. }
  233. const dirtyList = ref([])
  234. const initDirty = () => {
  235. let params = {
  236. current: 1,
  237. size: 10
  238. }
  239. getAiDirty(params).then(res => {
  240. dirtyList.value = res.data.records
  241. })
  242. }
  243. const list = ref([
  244. {
  245. name: '育肥一舍',
  246. id: 1,
  247. isShow: false,
  248. children: [
  249. {
  250. name: '育肥一舍一单元',
  251. id: 11,
  252. isShow: false
  253. },
  254. {
  255. name: '育肥一舍二单元',
  256. id: 12,
  257. isShow: false
  258. },
  259. {
  260. name: '育肥一舍三单元',
  261. id: 13,
  262. isShow: false
  263. },
  264. {
  265. name: '育肥一舍四单元',
  266. id: 14,
  267. isShow: false
  268. },
  269. ]
  270. },
  271. {
  272. name: '育肥二舍',
  273. id: 2,
  274. isShow: false,
  275. children: [
  276. {
  277. name: '育肥一舍一单元',
  278. id: 21,
  279. isShow: false
  280. },
  281. {
  282. name: '育肥一舍二单元',
  283. id: 22,
  284. isShow: false
  285. },
  286. {
  287. name: '育肥一舍三单元',
  288. id: 23,
  289. isShow: false
  290. },
  291. {
  292. name: '育肥一舍四单元',
  293. id: 24,
  294. isShow: false
  295. },
  296. ]
  297. },
  298. ])
  299. const clickParent = (i) => {
  300. list.value[i].isShow = !list.value[i].isShow;
  301. }
  302. const url = ref('')
  303. const clickChild = (n) => {
  304. url.value = 'http://119.3.93.18/video/qingshan/sample.mp4'
  305. list.value.forEach(items => {
  306. items.children.forEach(item => {
  307. if(item.id === n.id) {
  308. item.isShow = true
  309. } else {
  310. item.isShow = false
  311. }
  312. })
  313. })
  314. }
  315. const show = ref(false)
  316. onMounted(() => {
  317. initPerson()
  318. initCar()
  319. initSpecies()
  320. initDirty()
  321. show.value = true
  322. })
  323. </script>
  324. <style scoped>
  325. .home {
  326. width: 100%;
  327. height: 100%;
  328. position: relative;
  329. box-sizing: border-box;
  330. padding: 0 25px;
  331. display: flex;
  332. justify-content: space-between;
  333. }
  334. .home_flex {
  335. width: 480px;
  336. height: 100%;
  337. display: flex;
  338. flex-direction: column;
  339. justify-content: space-between;
  340. }
  341. .home_center {
  342. width: 840px;
  343. height: 100%;
  344. display: flex;
  345. flex-direction: column;
  346. justify-content: space-between;
  347. }
  348. .chart_content {
  349. width: 100%;
  350. height: 100%;
  351. box-sizing: border-box;
  352. padding: 14px;
  353. }
  354. .chart_scroll {
  355. width: 100%;
  356. height: 100%;
  357. overflow: auto;
  358. }
  359. .chart_scroll::-webkit-scrollbar {
  360. display: none;
  361. }
  362. .chart_flex {
  363. width: 100%;
  364. height: 100px;
  365. display: flex;
  366. justify-content: space-between;
  367. margin-bottom: 6px;
  368. }
  369. .chart_icon {
  370. width: 100px;
  371. height: 100px;
  372. box-sizing: border-box;
  373. border: 1px solid #018AFE;
  374. background: #00325B;
  375. overflow: hidden;
  376. cursor: pointer;
  377. }
  378. .chart_text {
  379. margin-left: 6px;
  380. flex: 1;
  381. height: 100%;
  382. box-sizing: border-box;
  383. background: #002F50;
  384. box-shadow: inset 0 0 30px rgba(0, 90, 137, .5);
  385. padding: 5px 10px;
  386. color: #BBD6FF;
  387. cursor: pointer;
  388. border: 1px solid #00668D;
  389. display: flex;
  390. flex-direction: column;
  391. justify-content: space-between;
  392. }
  393. .flex_text {
  394. width: 100%;
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. }
  399. .monit {
  400. margin-bottom: 2px;
  401. }
  402. .monit_parent {
  403. width: 100%;
  404. height: 40px;
  405. background: #002F50;
  406. box-shadow: inset 0 0 30px rgba(0, 90, 137, .5);
  407. padding: 5px 10px;
  408. color: #BBD6FF;
  409. cursor: pointer;
  410. border: 1px solid #00668D;
  411. display: flex;
  412. /*justify-content: space-between;*/
  413. align-items: center;
  414. }
  415. .monit_name {
  416. margin-left: 20px;
  417. }
  418. .monit_children {
  419. box-sizing: border-box;
  420. padding: 10px 0;
  421. background: #001836;
  422. }
  423. .monit_children_item {
  424. width: 100%;
  425. height: 40px;
  426. box-sizing: border-box;
  427. padding: 0 45px;
  428. cursor: pointer;
  429. display: flex;
  430. justify-content: space-between;
  431. align-items: center;
  432. }
  433. .monit_children_select {
  434. background: #00325B;
  435. }
  436. .look {
  437. position: relative;
  438. color: #00F3FF
  439. }
  440. .look:before {
  441. content: '';
  442. width: 5px;
  443. height: 5px;
  444. background: #00F3FF;
  445. border-radius: 50%;
  446. position: absolute;
  447. top: 8px;
  448. left: -12px
  449. }
  450. .warn_scroll {
  451. width: 100%;
  452. height: 100%;
  453. overflow: auto;
  454. }
  455. .warn_scroll::-webkit-scrollbar {
  456. display: none;
  457. }
  458. .img_url {
  459. width: 100%;
  460. height: 100%;
  461. object-fit: cover;
  462. }
  463. .video {
  464. width: 100%;
  465. height: 500px;
  466. }
  467. .picture {
  468. width: 100%;
  469. height: 200px;
  470. }
  471. </style>