newHome.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711
  1. <!--
  2. * @Description:
  3. * @Autor: lin
  4. * @Date: 2024-04-09 14:26:07
  5. * @LastEditors: lin
  6. * @LastEditTime: 2024-04-29 09:22:14
  7. -->
  8. <template>
  9. <div class="box">
  10. <div class="mapBox" id="newHome"></div>
  11. <!-- 左侧统计图 -->
  12. <transition
  13. leave-active-class="animate__animated animate__fast animate__fadeOutLeft"
  14. enter-active-class="animate__animated animate__fast animate__fadeInLeft"
  15. >
  16. <div v-show="!showBanner">
  17. <div class="smallChar deviceInfo">
  18. <div class="charBox">
  19. <div class="charTitle">
  20. <Title text="设备信息"></Title>
  21. </div>
  22. <div class="charContent">
  23. <div class="charList" v-for="item in deviceInfo" :key="item.device_type_id">
  24. <div class="leftInfo">
  25. <img :src="`${item.icon}`" alt />
  26. <div>{{ item.type_name }}</div>
  27. </div>
  28. <div class="leftInfo">
  29. <span>{{ item.device_count }}台</span>
  30. <img
  31. class="markerIcon"
  32. :src="`${markerObj[item.device_type_id].length == 0 ? eyeClose : eyeOpen}`"
  33. alt
  34. @click="setMarker(item.devices_info, item.device_type_id)"
  35. />
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="smallChar deviceInfo bottomBox">
  42. <div class="charBox">
  43. <div class="charTitle">
  44. <Title text="有害生物监测"></Title>
  45. <el-date-picker
  46. :pickerOptions="pickerOptions"
  47. :clearable="false"
  48. size="mini"
  49. v-model="watchYear"
  50. type="month"
  51. placeholder="选择年月"
  52. format="yyyy-MM"
  53. value-format="yyyy-MM"
  54. @change="getWatchInfo(watchYear)"
  55. ></el-date-picker>
  56. </div>
  57. <div class="charContent">
  58. <el-carousel>
  59. <el-carousel-item
  60. v-for="item in watchInfo"
  61. :key="item.category"
  62. indicator-position="outside"
  63. >
  64. <div class="infoTitle">{{ item.category }}</div>
  65. <div class="small">{{ item.warning }}</div>
  66. <div class="charInfo">
  67. <div class="detailInfo">
  68. <div>有害生物种类</div>
  69. <div>{{ item.count }}</div>
  70. </div>
  71. <div class="detailInfo" v-if="item.category != '杂草'">
  72. <div>有害生物总数</div>
  73. <div>{{ item.sum }}</div>
  74. </div>
  75. </div>
  76. </el-carousel-item>
  77. </el-carousel>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="tipsBox">
  82. <div>
  83. <span>{{ warningTaskInfo.month_warning_count }}</span>
  84. <span>本月预警数量</span>
  85. </div>
  86. <div>
  87. <span>{{ warningTaskInfo.year_warning_count }}</span>
  88. <span>全年预警数量</span>
  89. </div>
  90. </div>
  91. </div>
  92. </transition>
  93. <!-- 右侧统计图 -->
  94. <transition
  95. leave-active-class="animate__animated animate__fast animate__fadeOutRight"
  96. enter-active-class="animate__animated animate__fast animate__fadeInRight"
  97. >
  98. <div v-show="!showBanner">
  99. <div class="smallChar lineBox">
  100. <div class="charBox">
  101. <div class="charTitle">
  102. <Title class="smallTitle" :text="`有害生物发生趋势${new Date().getFullYear() + ''}`"></Title>
  103. <el-select
  104. class="selectThem"
  105. v-model="rightLineCategory"
  106. size="mini"
  107. placeholder="请选择分类"
  108. @change="changeCate"
  109. >
  110. <el-option
  111. v-for="typeItem in typeList"
  112. :label="typeItem.label"
  113. :value="typeItem.value"
  114. :key="typeItem.value"
  115. ></el-option>
  116. </el-select>
  117. <div class="detailBanner" @click="getBannerInfo(bannerYear, bannerBarCategory)"></div>
  118. </div>
  119. <div class="charContent">
  120. <div class="chartDetail" id="chartDetailId"></div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="smallChar lineBox bottomBox">
  125. <div class="charBox">
  126. <div class="charTitle">
  127. <Title class="smallTitle" text="任务统计"></Title>
  128. <el-date-picker
  129. :pickerOptions="pickerOptions"
  130. :clearable="false"
  131. size="mini"
  132. v-model="taskYear"
  133. type="year"
  134. placeholder="选择年"
  135. format="yyyy"
  136. value-format="yyyy"
  137. @change="getTaskInfo(taskYear)"
  138. ></el-date-picker>
  139. </div>
  140. <div class="charContent">
  141. <div class="chartDetail" id="chartTaskId"></div>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="tipsBox rightTips">
  146. <div>
  147. <span>{{ warningTaskInfo.task }}</span>
  148. <span>今日监督任务</span>
  149. </div>
  150. <div>
  151. <span>{{ warningTaskInfo.kong }}</span>
  152. <span>今日监测任务</span>
  153. </div>
  154. </div>
  155. </div>
  156. </transition>
  157. <!-- 点击地图圆圈的详情 -->
  158. <transition
  159. leave-active-class="animate__animated animate__fast animate__fadeOutUp"
  160. enter-active-class="animate__fast animate__animated animate__fadeInDown"
  161. >
  162. <div v-if="groupDialog" class="dialog">
  163. <div class="dialog_content">
  164. <!-- 关闭按钮 -->
  165. <div class="dialog_close" @click="groupDialog = false"></div>
  166. <!-- 内容 -->
  167. <!-- 组织详情 -->
  168. <div class="contentInfo" v-if="checkType == 'circle'">
  169. <div class="title">{{ groupInfo.org_name }}</div>
  170. <div class="address">{{ groupInfo.org_address }}</div>
  171. <div class="infoDesc">
  172. <div>
  173. <span class="num">{{ groupInfo.devices_count }}</span>
  174. <span class="name">设备总数</span>
  175. </div>
  176. <div>
  177. <span class="num">{{ groupInfo.pest_count }}</span>
  178. <span class="name">有害生物总数</span>
  179. </div>
  180. <div>
  181. <span class="num">{{ groupInfo.pest_category_count }}</span>
  182. <span class="name">有害生物种类</span>
  183. </div>
  184. <div>
  185. <span
  186. class="warningText"
  187. :style="`color:${warningObject[groupInfo.alarm_level].color}`"
  188. >
  189. <span
  190. v-if="groupInfo.alarm_level == 0"
  191. >{{ warningObject[groupInfo.alarm_level].text }}</span>
  192. <el-tooltip v-else :content="groupInfo.alarm_latest" placement="top">
  193. <span>{{ warningObject[groupInfo.alarm_level].text }}</span>
  194. </el-tooltip>
  195. </span>
  196. <span class="name">报警状态</span>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="contentInfo" v-else-if="checkType == 'device'">
  201. <div
  202. class="viewDetailBtn newHomeBtn"
  203. v-if="deviceDialogInfo.device_type_id == 3"
  204. @click="goDeviceLink(deviceDialogInfo.device_id)"
  205. >查看详情</div>
  206. <div class="deviceInfo">
  207. <div class="leftInfo">
  208. <img src="../../../assets/images/newHome/id.png" />
  209. <div>设备ID</div>
  210. </div>
  211. <div class="rightInfo">{{ deviceDialogInfo.device_id }}</div>
  212. </div>
  213. <div class="deviceInfo">
  214. <div class="leftInfo">
  215. <img src="../../../assets/images/newHome/name.png" />
  216. <div>设备名称</div>
  217. </div>
  218. <div class="rightInfo">{{ deviceDialogInfo.device_name }}</div>
  219. </div>
  220. <div class="deviceInfo">
  221. <div class="leftInfo">
  222. <img src="../../../assets/images/newHome/point.png" />
  223. <div>设备定位</div>
  224. </div>
  225. <div class="rightInfo">{{ deviceDialogInfo.degrees }}</div>
  226. </div>
  227. <div class="deviceInfo">
  228. <div class="leftInfo">
  229. <img src="../../../assets/images/newHome/time.png" />
  230. <div>最新上报时间</div>
  231. </div>
  232. <div class="rightInfo">{{ deviceDialogInfo.uptime_format }}</div>
  233. </div>
  234. </div>
  235. <div class="contentInfo" v-else-if="checkType == 'warning'">
  236. <div class="title">告警详情</div>
  237. <div class="warningInfo">
  238. <div class="infoContent">
  239. {{ warningList.latest_content }}
  240. <div class="marginBtn">
  241. <router-link to="/index/alermRecord" target="_blank">
  242. <div class="newHomeBtn newHomeBigBtn">查看历史记录</div>
  243. </router-link>
  244. </div>
  245. </div>
  246. <div class="infoDesc">
  247. <div>
  248. <span class="num">{{ warningList.month_count }}</span>
  249. <span class="name">本月预警</span>
  250. </div>
  251. <div>
  252. <span class="num">{{ warningList.year_count }}</span>
  253. <span class="name">本年预警</span>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </transition>
  261. <!-- 点击林木虫害信息右侧放大图标 -->
  262. <transition
  263. leave-active-class="animate__animated animate__fast animate__fadeOutDown"
  264. enter-active-class="animate__animated animate__fast animate__fadeInUp"
  265. >
  266. <div v-if="showBanner" class="dialog bigBanner">
  267. <div class="dialog_content">
  268. <!-- 关闭按钮 -->
  269. <div class="dialog_close" @click="initBanner"></div>
  270. <div class="contentInfo">
  271. <Title text="有害生物发生趋势"></Title>
  272. <div class="barContent">
  273. <div class="searchBox">
  274. <el-date-picker
  275. :pickerOptions="pickerOptions"
  276. :clearable="false"
  277. size="mini"
  278. v-model="bannerYear"
  279. type="year"
  280. placeholder="选择年"
  281. format="yyyy"
  282. value-format="yyyy"
  283. @change="getBannerInfo(bannerYear, bannerBarCategory)"
  284. ></el-date-picker>
  285. <el-select
  286. class="selectThem"
  287. v-model="bannerBarCategory"
  288. size="mini"
  289. placeholder="请选择分类"
  290. @change="getBannerInfo(bannerYear, bannerBarCategory)"
  291. >
  292. <el-option
  293. v-for="typeItem in typeList"
  294. :label="typeItem.label"
  295. :value="typeItem.value"
  296. :key="typeItem.value"
  297. ></el-option>
  298. </el-select>
  299. </div>
  300. <div class="leftContent" v-loading="bannerLoading">
  301. <div class="bannerBarBox" id="bannerBarBoxId"></div>
  302. <!-- <div class="bannerBarBox bottomBar" id="bannerBarBottomId"></div> -->
  303. </div>
  304. <div class="rightContent" v-loading="bannerLoading">
  305. <div class="table">
  306. <div class="item header">
  307. <div>有害生物名称</div>
  308. <div v-if="bannerBarCategory != '杂草'">当前总数量</div>
  309. <div>发现月份</div>
  310. <div>是否新增</div>
  311. </div>
  312. <div class="item" v-for="(item, index) in bannerData.data" :key="`pest${index}`">
  313. <div :class="item.is_new ? 'orangeText' : ''">{{ item.name }}</div>
  314. <div
  315. v-if="bannerBarCategory != '杂草'"
  316. :class="item.is_new ? 'orangeText' : ''"
  317. >{{ item.num }}头</div>
  318. <div :class="item.is_new ? 'orangeText' : ''">{{ item.month }}月</div>
  319. <div :class="item.is_new ? 'orangeText' : ''">{{ item.is_new ? '是' : '否' }}</div>
  320. </div>
  321. </div>
  322. <div class="info">
  323. <div>
  324. 种类:
  325. <span>{{ bannerData.cg_count }}</span>
  326. </div>
  327. <div>
  328. 总数:
  329. <span>{{ bannerData.count }}</span>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </transition>
  338. <!-- 头部告警 -->
  339. <div
  340. class="warningBox"
  341. v-if="warningList.latest_content"
  342. @click="groupDialog = true; checkType = 'warning'"
  343. >
  344. <div class="content">
  345. <div class="item">{{ warningList.latest_content }}</div>
  346. </div>
  347. </div>
  348. </div>
  349. </template>
  350. <script>
  351. import * as echarts from 'echarts';
  352. import Title from './components/Title.vue';
  353. export default {
  354. name: 'newHome',
  355. props: {},
  356. data() {
  357. return {
  358. timmerList: [], // 水波纹的定时器
  359. getFunTimmer: [], // 函数的定时器
  360. overlayList: [],
  361. loading: true,
  362. icon1: require('../../../assets/images/newHome/icon1.png'), // 设备信息图标
  363. icon2: require('../../../assets/images/newHome/icon2.png'),
  364. icon3: require('../../../assets/images/newHome/icon3.png'),
  365. eyeClose: require('../../../assets/images/newHome/eyeclose.png'),
  366. eyeOpen: require('../../../assets/images/newHome/eyeopen.png'),
  367. marker3: require('../../../assets/images/newHome/2.png'),
  368. marker2: require('../../../assets/images/newHome/3.png'),
  369. marker4: require('../../../assets/images/newHome/4.png'),
  370. marker8: require('../../../assets/images/newHome/8.png'),
  371. marker9: require('../../../assets/images/newHome/9.png'),
  372. marker10: require('../../../assets/images/newHome/10.png'),
  373. colorObject: {
  374. 0: '#3ACD9C',
  375. 1: '#FF5951',
  376. 2: '#F4A72F',
  377. 3: '#1890FF',
  378. 4: '#FAFF0A',
  379. },
  380. warningObject: [
  381. {
  382. level: 0,
  383. color: '#3ACD9C',
  384. text: '无',
  385. class: 'green',
  386. },
  387. {
  388. level: 1,
  389. color: '#FF5951',
  390. text: 'Ⅰ',
  391. class: 'red',
  392. },
  393. {
  394. level: 2,
  395. color: '#F4A72F',
  396. text: 'Ⅱ',
  397. class: 'origin',
  398. },
  399. {
  400. level: 3,
  401. color: '#1890FF',
  402. text: 'Ⅲ',
  403. class: 'blue',
  404. },
  405. {
  406. level: 4,
  407. color: '#FAFF0A',
  408. text: 'Ⅳ',
  409. class: 'yellow',
  410. },
  411. ],
  412. map: null,
  413. deviceInfo: [], // 设备信息
  414. markerObj: {
  415. 2: [],
  416. 3: [],
  417. 4: [],
  418. 8: [],
  419. 9: [],
  420. 10: [],
  421. }, //设备点位记录
  422. groupDialog: false, // 圈圈 设备点位 告警 共用弹框
  423. checkType: 'circle',
  424. deviceDialogInfo: {}, //设备弹框内容
  425. groupInfo: {}, // 圈圈弹框内容
  426. typeList: [],
  427. watchYear: '', //有害生物监测统计年份
  428. watchInfo: [], // 有害生物监测信息详情
  429. rightLineCategory: '', // 有害生物发生趋势 下拉框
  430. pestLineObj: {}, // 有害生物发生趋势 类型-》数据
  431. pestChart: null, // 有害生物发生趋势 折线图
  432. showBanner: false, // 有害生物发生趋势 是否放大
  433. bannerBarCategory: '', // 有害生物发生趋势 放大有害生物种类
  434. pickerOptions: {
  435. disabledDate(time) {
  436. return time.getTime() > Date.now();
  437. },
  438. },
  439. bannerYear: new Date().getFullYear() + '',
  440. bannerCountChar: null, // 新增有害生物个数柱状图
  441. bannerTypeChar: null, // 新增有害生物种类柱状图
  442. bannerLoading: true,
  443. bannerData: [],
  444. taskYear: new Date().getFullYear() + '', // 任务统计年份
  445. warningList: {
  446. latest_content: '',
  447. month_count: 0,
  448. year_count: 0,
  449. }, // 告警详情
  450. warningTaskInfo: {},
  451. };
  452. },
  453. computed: {},
  454. created() {},
  455. beforeDestroy() {
  456. this.clerrTimmerFun('fun');
  457. this.clerrTimmerFun('circle');
  458. },
  459. mounted() {
  460. this.typeList = this.$store.state.pestTypeList; // 有害生物分类
  461. this.bannerBarCategory = this.typeList[0].value;
  462. this.rightLineCategory = this.typeList[0].value;
  463. this.initMap();
  464. this.getDeviceInfo();
  465. this.getPestLineInfo();
  466. this.getTaskInfo(this.taskYear);
  467. this.getWatchInfo();
  468. this.getWarningList();
  469. this.getTaskWarningInfo();
  470. },
  471. watch: {},
  472. methods: {
  473. // 测报灯设备详情跳转到对应测报灯轮播页面
  474. goDeviceLink(id) {
  475. this.$router.push({
  476. path: '/newHome/device',
  477. query: {
  478. id,
  479. },
  480. });
  481. },
  482. // 清除指定覆盖物
  483. clearOverlayByType(type) {
  484. var overlays = this.map.getAllOverlays(type);
  485. for (var i = 0, l = overlays.length; i < l; i++) {
  486. this.map.remove(overlays[i]);
  487. }
  488. },
  489. // 清除所有定时器
  490. clerrTimmerFun(type) {
  491. if (type == 'circle') {
  492. this.timmerList.forEach((timmer) => {
  493. clearInterval(timmer);
  494. });
  495. } else {
  496. this.getFunTimmer.forEach((timmer) => {
  497. clearInterval(timmer);
  498. });
  499. }
  500. },
  501. // 获取告警个数任务监督个数表
  502. getTaskWarningInfo() {
  503. this.$axios({
  504. method: 'POST',
  505. url: '/api/api_gateway?method=data_report.screen.Warning_statistics',
  506. data: this.qs.stringify({}),
  507. }).then((res) => {
  508. if (!res.data.data) {
  509. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  510. return;
  511. }
  512. this.warningTaskInfo = res.data.data;
  513. });
  514. },
  515. // 获取告警列表
  516. getWarningList() {
  517. this.$axios({
  518. method: 'POST',
  519. url: '/api/api_gateway?method=data_report.screen.alarm_detail',
  520. data: this.qs.stringify({}),
  521. }).then((res) => {
  522. if (!res.data.data) {
  523. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  524. return;
  525. }
  526. this.warningList = res.data.data;
  527. console.log(this.warningList);
  528. });
  529. },
  530. // 获取设备信息
  531. getDeviceInfo() {
  532. this.$axios({
  533. method: 'POST',
  534. url: '/api/api_gateway?method=data_report.screen.device_deatil',
  535. data: this.qs.stringify({}),
  536. }).then((res) => {
  537. if (!res.data.data) {
  538. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  539. return;
  540. }
  541. this.deviceInfo = res.data.data;
  542. this.deviceInfo.forEach((item) => {
  543. if (item.device_type_id == '2') {
  544. item.icon = this.icon2;
  545. } else if (item.device_type_id == '3') {
  546. item.icon = this.icon1;
  547. } else {
  548. item.icon = this.icon3;
  549. }
  550. });
  551. console.log(this.markerObj);
  552. });
  553. },
  554. // 获取有害生物监测数据
  555. getWatchInfo(date) {
  556. this.$axios({
  557. method: 'POST',
  558. url: '/api/api_gateway?method=data_report.screen.pest_check',
  559. data: this.qs.stringify({
  560. date,
  561. }),
  562. }).then((res) => {
  563. if (!res.data.data) {
  564. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  565. return;
  566. }
  567. console.log(res.data.data);
  568. this.watchInfo = res.data.data.pests;
  569. this.watchYear = res.data.data.time;
  570. });
  571. },
  572. // 获取任务统计图
  573. getTaskInfo(year) {
  574. this.$axios({
  575. method: 'POST',
  576. url: '/api/api_gateway?method=data_report.screen.task_count',
  577. data: this.qs.stringify({
  578. year,
  579. }),
  580. }).then((res) => {
  581. if (!res.data.data) {
  582. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  583. return;
  584. }
  585. // console.log(res.data.data);
  586. let charData = res.data.data;
  587. // let pestLineObj = {};
  588. // 有害生物个数
  589. let taskCountChar = echarts.init(
  590. document.getElementById('chartTaskId')
  591. );
  592. this.setAddBanner(
  593. taskCountChar,
  594. charData.month,
  595. [charData.month_kong, charData.month_task],
  596. ['#60B0FA', '#BFE0FE'],
  597. ['监测任务', '监督任务']
  598. );
  599. });
  600. },
  601. // 初始化筛选框数据
  602. initBanner() {
  603. this.bannerYear = new Date().getFullYear() + '';
  604. this.bannerBarCategory = this.typeList[0].value;
  605. this.showBanner = false;
  606. },
  607. // 获取林木有害生物的详情
  608. getBannerInfo(year, category) {
  609. this.showBanner = true;
  610. this.bannerLoading = true;
  611. this.$axios({
  612. method: 'POST',
  613. url: '/api/api_gateway?method=data_report.screen.pest_going_up',
  614. data: this.qs.stringify({
  615. year,
  616. category,
  617. }),
  618. }).then((res) => {
  619. this.bannerLoading = false;
  620. if (!res.data.data) {
  621. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  622. return;
  623. }
  624. // console.log(res.data.data);
  625. this.bannerData = res.data.data.table;
  626. let charData = res.data.data.lines[0];
  627. // let pestLineObj = {};
  628. // 有害生物个数
  629. this.bannerCountChar = echarts.init(
  630. document.getElementById('bannerBarBoxId')
  631. );
  632. if (category != '杂草') {
  633. this.setAddBanner(
  634. this.bannerCountChar,
  635. charData.month,
  636. [
  637. charData.count,
  638. charData.new_count,
  639. charData.cg_name,
  640. charData.new_cg_name,
  641. ],
  642. ['#60B0FA', '#BFE0FE', '#F4A72F', '#FEE0AE'],
  643. ['有害生物总数', '新记录种数量', '总有害生物种类', '新记录种类型'],
  644. ['count', 'count', 'type', 'type']
  645. );
  646. } else {
  647. this.setAddBanner(
  648. this.bannerCountChar,
  649. charData.month,
  650. [charData.cg_name, charData.new_cg_name],
  651. ['#F4A72F', '#FEE0AE'],
  652. ['总有害生物种类', '新记录种类型']
  653. );
  654. }
  655. // 有害生物种类
  656. // this.bannerTypeChar = echarts.init(document.getElementById('bannerBarBottomId'));
  657. // this.setAddBanner(this.bannerTypeChar, charData.month, [charData.cg_name, charData.new_cg_name], ['#F4A72F', '#FEE0AE'], ['总有害生物种类', '新增种类数']);
  658. });
  659. },
  660. setAddBanner(char, xData, yData, colorList, nameList, type) {
  661. char.clear();
  662. let xDataNew = [];
  663. xData.forEach((item) => {
  664. xDataNew.push(item + '月');
  665. });
  666. let legendData = [];
  667. let series = [];
  668. let yAxis = [];
  669. yData.forEach((data, index) => {
  670. legendData.push({
  671. name: nameList[index],
  672. textStyle: {
  673. color: '#ffffff',
  674. },
  675. });
  676. if(type != undefined) {
  677. if ((index == 0 || index == 2)) {
  678. yAxis.push({
  679. type: 'value',
  680. name: index == 0 ? '数量' : '种类',
  681. color: colorList[index],
  682. position: index == 0 ? 'left' : 'right',
  683. alignTicks: true,
  684. offset: 0,
  685. nameTextStyle: {
  686. color: '#fff',
  687. },
  688. axisLine: {
  689. show: false, // 不显示 y 轴轴线
  690. },
  691. axisLabel: {
  692. color: '#ffffff', // 设置 y 轴标签字体颜色为白色
  693. },
  694. splitLine: {
  695. lineStyle: {
  696. type: 'dotted', // 设置分隔线为点线
  697. color: '#ffffff88',
  698. },
  699. },
  700. });
  701. }
  702. } else {
  703. yAxis = [{
  704. type: 'value',
  705. name: '个数',
  706. nameTextStyle: {
  707. color: '#fff',
  708. },
  709. axisLine: {
  710. show: false, // 不显示 y 轴轴线
  711. },
  712. axisLabel: {
  713. color: '#ffffff', // 设置 y 轴标签字体颜色为白色
  714. },
  715. splitLine: {
  716. lineStyle: {
  717. type: 'dotted', // 设置分隔线为点线
  718. color: '#ffffff88',
  719. },
  720. },
  721. }];
  722. }
  723. series.push({
  724. data: data,
  725. type: 'bar',
  726. // stack: type ? type[index] : 'ab',
  727. name: nameList[index],
  728. yAxisIndex: index < 2 ? 0 : 1,
  729. });
  730. if (!type) return;
  731. // if (index == 0 || index == 2) {
  732. // series.push({
  733. // data: data,
  734. // type: 'line',
  735. // smooth: true,
  736. // name: nameList[index],
  737. // color: colorList[index],
  738. // yAxisIndex: index == 0 ? 0 : 1,
  739. // });
  740. // }
  741. });
  742. console.log(yAxis, series);
  743. let optionsPestLine = {
  744. // 设置全局文本样式
  745. textStyle: {
  746. fontSize: 14, // 设置字体大小为14px
  747. },
  748. grid: {
  749. top: '50',
  750. left: '5%',
  751. bottom: '2%',
  752. right: '10%',
  753. containLabel: true,
  754. },
  755. legend: {
  756. data: legendData,
  757. },
  758. tooltip: {
  759. trigger: 'axis',
  760. },
  761. color: colorList,
  762. xAxis: {
  763. type: 'category',
  764. axisLine: {
  765. lineStyle: {
  766. color: '#ffffff', // 设置 x 轴轴线颜色为白色
  767. },
  768. },
  769. axisLabel: {
  770. color: '#ffffff', // 设置 x 轴标签字体颜色为白色
  771. },
  772. splitLine: {
  773. show: false, // 不显示 x 轴分隔线
  774. },
  775. data: xDataNew,
  776. },
  777. yAxis: yAxis,
  778. series: series,
  779. }; // 有害生物发生趋势 折线图
  780. char.setOption(optionsPestLine);
  781. },
  782. // 林木有害生物折线图配置
  783. setLineOption(char, xData, yData, type) {
  784. char.clear();
  785. let xDataNew = [];
  786. xData.forEach((item) => {
  787. xDataNew.push(item + '月');
  788. });
  789. let optionsPestLine = {
  790. // 设置全局文本样式
  791. textStyle: {
  792. fontSize: 14, // 设置字体大小为14px
  793. },
  794. grid: {
  795. left: '0%',
  796. bottom: '0%',
  797. right: '0%',
  798. containLabel: true,
  799. },
  800. legend: {
  801. textStyle: {
  802. color: '#ffffff',
  803. },
  804. },
  805. tooltip: {
  806. trigger: 'axis',
  807. },
  808. color: ['#1890FF', '#F4A72F'],
  809. xAxis: {
  810. type: 'category',
  811. axisLine: {
  812. lineStyle: {
  813. color: '#ffffff', // 设置 x 轴轴线颜色为白色
  814. },
  815. },
  816. axisLabel: {
  817. color: '#ffffff', // 设置 x 轴标签字体颜色为白色
  818. },
  819. splitLine: {
  820. show: false, // 不显示 x 轴分隔线
  821. },
  822. data: xDataNew,
  823. },
  824. yAxis: {
  825. type: 'value',
  826. name: '个数',
  827. nameTextStyle: {
  828. color: '#fff',
  829. },
  830. axisLine: {
  831. show: false, // 不显示 y 轴轴线
  832. },
  833. axisLabel: {
  834. color: '#ffffff', // 设置 y 轴标签字体颜色为白色
  835. },
  836. splitLine: {
  837. lineStyle: {
  838. type: 'dotted', // 设置分隔线为点线
  839. color: '#ffffff88',
  840. },
  841. },
  842. },
  843. series: [
  844. {
  845. data: yData[0],
  846. type: 'line',
  847. smooth: true,
  848. name: '有害生物数量',
  849. areaStyle: {
  850. opacity: 0.8,
  851. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  852. {
  853. offset: 0,
  854. color: '#1890FF',
  855. },
  856. {
  857. offset: 1,
  858. color: '#1890FF33',
  859. },
  860. ]),
  861. },
  862. },
  863. {
  864. data: yData[1],
  865. type: 'line',
  866. smooth: true,
  867. name: '有害生物类型',
  868. areaStyle: {
  869. opacity: 0.8,
  870. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  871. {
  872. offset: 0,
  873. color: '#F4A72F',
  874. },
  875. {
  876. offset: 1,
  877. color: '#FEE0AE33',
  878. },
  879. ]),
  880. },
  881. },
  882. ],
  883. }; // 有害生物发生趋势 折线图
  884. if (type == '杂草') {
  885. optionsPestLine.series.shift();
  886. }
  887. char.setOption(optionsPestLine);
  888. },
  889. // 切换有害生物下拉框
  890. changeCate(type) {
  891. this.setLineOption(
  892. this.pestChart,
  893. this.pestLineObj[type].month,
  894. [this.pestLineObj[type].count, this.pestLineObj[type].category_count],
  895. type
  896. );
  897. },
  898. // 获取有害生物列表折线图
  899. getPestLineInfo() {
  900. this.$axios({
  901. method: 'POST',
  902. url: '/api/api_gateway?method=data_report.screen.pest_going',
  903. data: this.qs.stringify({}),
  904. }).then((res) => {
  905. if (!res.data.data) {
  906. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  907. return;
  908. }
  909. let pestLineObj = {};
  910. res.data.data.forEach((pest) => {
  911. pestLineObj[pest.category] = pest.data;
  912. });
  913. this.$set(this, 'pestLineObj', pestLineObj);
  914. // console.log(this.pestLineObj);
  915. this.pestChart = echarts.init(document.getElementById('chartDetailId'));
  916. this.setLineOption(
  917. this.pestChart,
  918. pestLineObj[this.rightLineCategory].month,
  919. [
  920. pestLineObj[this.rightLineCategory].count,
  921. pestLineObj[this.rightLineCategory].category_count,
  922. ]
  923. );
  924. });
  925. },
  926. // 点击某类设备,打点/取消打点
  927. setMarker(list, type) {
  928. let icon = this[`marker${type}`];
  929. // 当前是打点
  930. if (this.markerObj[type].length == 0) {
  931. // 创建一个自定义图标对象
  932. list.forEach((item) => {
  933. var customIcon = new AMap.Icon({
  934. size: new AMap.Size(40, 53), // 设置图标的大小,单位:像素
  935. image: icon, // 设置图标的URL
  936. });
  937. var marker = new AMap.Marker({
  938. position: item.lng_lat, // 设置标记点的位置
  939. icon: customIcon, // 设置自定义图标的URL
  940. offset: new AMap.Pixel(-20, -53), // 设置偏移量,向左上方偏移10个像素
  941. });
  942. // 将标记点添加到地图上
  943. marker.setMap(this.map);
  944. marker.on('click', (e) => {
  945. this.groupDialog = true;
  946. this.checkType = 'device';
  947. this.deviceDialogInfo = item;
  948. });
  949. this.markerObj[type].push(marker);
  950. });
  951. } else {
  952. // 当前是取消
  953. this.markerObj[type].forEach((marker) => {
  954. marker.setMap(null);
  955. });
  956. this.markerObj[type] = [];
  957. }
  958. console.log(this.markerObj);
  959. },
  960. // 获取组织水波纹信息
  961. getGroupDeviceFun() {
  962. this.$axios({
  963. method: 'POST',
  964. url: '/api/api_gateway?method=data_report.screen.device_info',
  965. data: this.qs.stringify({}),
  966. }).then((res) => {
  967. this.loading = false;
  968. if (!res.data.data) {
  969. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  970. return;
  971. }
  972. // console.log(res.data.data);
  973. // this.deviceInfo = res.data.data.devices_info;
  974. this.clearOverlayByType('circle');
  975. this.clearOverlayByType('circleMarker');
  976. // 先把所有定时器清空
  977. this.clerrTimmerFun('circle');
  978. this.overlayList = [];
  979. res.data.data.forEach((group) => {
  980. if (group.lng_lat.length == 0) return;
  981. this.waterAmiFun(group);
  982. });
  983. // this.map.setFitView(this.overlayList)
  984. });
  985. },
  986. // 根据组织ID 获取组织设备告警信息
  987. getInfoByGroupId(group) {
  988. this.$axios({
  989. method: 'POST',
  990. url: '/api/api_gateway?method=data_report.screen.group_pest_detail',
  991. data: this.qs.stringify({ group_id: group.org_id }),
  992. }).then((res) => {
  993. if (!res.data.data) {
  994. this.$message.error('网络连接出错或服务报错,请刷新页面重试');
  995. return;
  996. }
  997. this.groupInfo = Object.assign(group, res.data.data);
  998. this.groupDialog = true;
  999. this.checkType = 'circle';
  1000. console.log(this.groupInfo);
  1001. });
  1002. },
  1003. // 画水波纹
  1004. waterAmiFun(group) {
  1005. let { colorObject } = this;
  1006. let _this = this;
  1007. // 绘制圆
  1008. var circle = new AMap.Circle({
  1009. center: group.lng_lat, // 圆心位置
  1010. radius: 2500, // 半径,单位:米
  1011. strokeColor: '#FFFFFF', // 线颜色
  1012. strokeOpacity: 0.8, // 线透明度
  1013. strokeWeight: 1, // 线宽
  1014. fillColor: '#fff', // 填充颜色
  1015. fillOpacity: 0.2, // 填充透明度
  1016. zIndex: 100, // 层级
  1017. extData: group,
  1018. cursor: 'pointer',
  1019. });
  1020. this.map.add(circle);
  1021. // 水波纹点击查看组织详情
  1022. circle.on('click', (e) => {
  1023. let data = e.target._opts.extData;
  1024. this.getInfoByGroupId(data);
  1025. // console.log(data, '当前点击的圆圈是');
  1026. });
  1027. this.overlayList.push(circle);
  1028. // 添加水波纹效果的圆点
  1029. var rippleCircleMaker = new AMap.CircleMarker({
  1030. center: group.lng_lat, // 圆心位置
  1031. radius: 5, // 初始半径,单位:米
  1032. strokeColor: '#FFf', // 线颜色
  1033. strokeOpacity: 1, // 线透明度
  1034. strokeWeight: 1, // 线宽
  1035. fillColor: colorObject[group.alarm_level], // 填充颜色
  1036. fillOpacity: 0.9, // 填充透明度
  1037. zIndex: 102, // 层级
  1038. });
  1039. this.map.add(rippleCircleMaker);
  1040. if (group.alarm_level == 0) return; //等级为0时 不需要水波纹
  1041. // 添加水波纹效果的圆点
  1042. var rippleCircle = new AMap.Circle({
  1043. center: group.lng_lat, // 圆心位置
  1044. radius: 500, // 初始半径,单位:米
  1045. strokeColor: colorObject[group.alarm_level], // 线颜色
  1046. strokeOpacity: 0, // 线透明度
  1047. strokeWeight: 2, // 线宽
  1048. fillColor: colorObject[group.alarm_level], // 填充颜色
  1049. fillOpacity: 0.8, // 填充透明度
  1050. zIndex: 101, // 层级
  1051. extData: group,
  1052. cursor: 'pointer',
  1053. });
  1054. // 水波纹点击查看组织详情
  1055. rippleCircle.on('click', (e) => {
  1056. let data = e.target._opts.extData;
  1057. // console.log(data, '当前点击的水波纹是');
  1058. this.getInfoByGroupId(data);
  1059. });
  1060. this.map.add(rippleCircle);
  1061. // 定义水波纹动画
  1062. var animation;
  1063. // 添加水波纹动画效果
  1064. function addRippleAnimation() {
  1065. var startRadius = 500;
  1066. var startOpacity = 0.8;
  1067. var endRadius = 2700;
  1068. var step = 200;
  1069. var opacityStep = -0.06;
  1070. var currentRadius = startRadius;
  1071. var currentOpacity = startOpacity;
  1072. var increasing = true;
  1073. animation = setInterval(function () {
  1074. if (increasing) {
  1075. if (currentRadius < endRadius) {
  1076. rippleCircle.setRadius(currentRadius); // 设置水波纹半径
  1077. rippleCircle.setOptions({
  1078. fillOpacity: currentOpacity > 0 ? currentOpacity : 0,
  1079. });
  1080. currentRadius += step; // 每次半径增加 step
  1081. currentOpacity += opacityStep; // 每次透明度增加opacityStep
  1082. } else {
  1083. clearInterval(animation); // 清除动画
  1084. currentRadius = startRadius; // 重置水波纹半径为初始值
  1085. currentOpacity = startOpacity;
  1086. addRippleAnimation(); // 重新启动动画
  1087. }
  1088. }
  1089. }, 100); // 设置动画间隔时间,单位:毫秒
  1090. _this.timmerList.push(animation); // 记录定时器
  1091. // console.log(_this.timmerList, '_this.timmerList');
  1092. }
  1093. // 启动水波纹动画
  1094. addRippleAnimation();
  1095. },
  1096. initMap() {
  1097. let _this = this;
  1098. let map = new AMap.Map(document.getElementById('newHome'), {
  1099. center: [114.2, 22.76],
  1100. resizeEnable: true,
  1101. // lang: 'en',
  1102. zoom: 10.5,
  1103. mapStyle: 'amap://styles/fff0c1ac5471818a21cf82c0931f60c0',
  1104. // mapStyle: "amap://styles/dark",
  1105. // features: ['bg', 'road'],
  1106. });
  1107. this.map = map;
  1108. this.map.on('complete', function () {
  1109. _this.getGroupDeviceFun();
  1110. let getGroupTimmer = setInterval(_this.getGroupDeviceFun, 60000);
  1111. _this.getFunTimmer.push(getGroupTimmer);
  1112. import(`./geo.json`).then((res) => {
  1113. addGeo(res, map);
  1114. });
  1115. });
  1116. function addGeo(Json, map) {
  1117. let cityList = [];
  1118. var geojson = new AMap.GeoJSON({
  1119. geoJSON: Json,
  1120. // 还可以自定义getMarker和getPolyline
  1121. getPolygon: function (geojson, lnglats) {
  1122. // 计算面积
  1123. // var area = AMap.GeometryUtil.ringArea(lnglats[0])
  1124. let PolygonObj = new AMap.Polygon({
  1125. path: lnglats,
  1126. fillOpacity: 0.5, // 面积越大透明度越高
  1127. strokeWeight: 2,
  1128. strokeColor: '#fff',
  1129. fillColor: '#64AECE',
  1130. extData: geojson,
  1131. zIndex: 90,
  1132. });
  1133. cityList.push(PolygonObj);
  1134. return PolygonObj;
  1135. },
  1136. });
  1137. map.add(geojson);
  1138. // map.setFitView();
  1139. }
  1140. },
  1141. },
  1142. components: {
  1143. Title,
  1144. },
  1145. };
  1146. </script>
  1147. <style lang="less">
  1148. .green {
  1149. width: 250px;
  1150. background: #3acd9c !important;
  1151. }
  1152. .red {
  1153. width: 250px;
  1154. background: #ff5951 !important;
  1155. }
  1156. .origin {
  1157. width: 250px;
  1158. background: #f4a72f !important;
  1159. }
  1160. .blue {
  1161. width: 250px;
  1162. background: #1890ff !important;
  1163. }
  1164. .yellow {
  1165. width: 250px;
  1166. background: #faff0a !important;
  1167. }
  1168. </style>
  1169. <style scoped lang="less">
  1170. .box {
  1171. position: relative;
  1172. overflow: hidden;
  1173. width: 100%;
  1174. height: 100vh;
  1175. /deep/ .el-select,
  1176. /deep/ .el-date-editor {
  1177. width: 8.8vw;
  1178. font-size: 14px;
  1179. .el-input {
  1180. width: 100%;
  1181. font-size: 16px;
  1182. }
  1183. .el-input__inner {
  1184. background: #ffffff1a;
  1185. color: #fff;
  1186. border: none;
  1187. }
  1188. }
  1189. .mapBox {
  1190. position: absolute;
  1191. top: 0;
  1192. left: 0;
  1193. width: 100%;
  1194. height: 100vh;
  1195. }
  1196. .smallChar {
  1197. position: absolute;
  1198. width: 21.8vw;
  1199. height: 31.3vh;
  1200. z-index: 20;
  1201. left: 6.2vw;
  1202. top: 13.2vh;
  1203. padding: 1%;
  1204. box-sizing: border-box;
  1205. background: url('../../../assets/images/newHome/smallChar.png') center
  1206. center no-repeat;
  1207. background-size: 100% 100%;
  1208. .charBox {
  1209. position: relative;
  1210. overflow: hidden;
  1211. width: 100%;
  1212. .charTitle {
  1213. position: relative;
  1214. display: flex;
  1215. align-items: center;
  1216. justify-content: space-between;
  1217. width: 100%;
  1218. .smallTitle {
  1219. width: 50%;
  1220. }
  1221. .detailBanner {
  1222. width: 2.8rem;
  1223. height: 2.8rem;
  1224. background: url('./../.././../assets/images/newHome/detailBtn.png')
  1225. center center no-repeat;
  1226. background-size: 100% 100%;
  1227. cursor: pointer;
  1228. &:hover {
  1229. background: url('./../.././../assets/images/newHome/detailBtnHover.png')
  1230. center center no-repeat;
  1231. background-size: 100% 100%;
  1232. }
  1233. }
  1234. }
  1235. .charContent {
  1236. margin-top: 1rem;
  1237. .chartDetail {
  1238. width: 100%;
  1239. height: 19.8vh;
  1240. }
  1241. .charList {
  1242. display: flex;
  1243. justify-content: space-between;
  1244. align-items: center;
  1245. color: #fff;
  1246. font-size: 1.4rem;
  1247. height: 3.8vh;
  1248. border-bottom: 1px solid #ffffff4d;
  1249. font-weight: 400;
  1250. .leftInfo {
  1251. display: flex;
  1252. justify-content: space-between;
  1253. align-items: center;
  1254. img {
  1255. width: 2rem;
  1256. height: 2rem;
  1257. margin-right: 0.8rem;
  1258. }
  1259. span {
  1260. cursor: pointer;
  1261. color: yellow;
  1262. margin-right: 0.8rem;
  1263. }
  1264. .markerIcon {
  1265. cursor: pointer;
  1266. }
  1267. }
  1268. }
  1269. .el-carousel {
  1270. height: 22.8vh;
  1271. color: #fff;
  1272. font-size: 1.4rem;
  1273. /deep/ .el-carousel__container {
  1274. height: 100%;
  1275. padding: 0 36px;
  1276. box-sizing: border-box;
  1277. }
  1278. .small {
  1279. line-height: 2rem;
  1280. text-align: center;
  1281. }
  1282. .infoTitle {
  1283. font-size: 2rem;
  1284. // writing-mode: vertical-rl;
  1285. color: yellow;
  1286. margin-bottom: 1rem;
  1287. text-align: center;
  1288. }
  1289. .charInfo {
  1290. width: 90%;
  1291. margin: 0 auto;
  1292. display: flex;
  1293. justify-content: space-around;
  1294. align-items: center;
  1295. height: calc(100% - 5rem);
  1296. .detailInfo {
  1297. width: 40%;
  1298. height: 12vh;
  1299. box-sizing: border-box;
  1300. text-align: center;
  1301. background: url(../../../assets/images/newHome/all.png) bottom center
  1302. no-repeat;
  1303. background-size: cover;
  1304. :first-child {
  1305. margin-top: 1rem;
  1306. }
  1307. :last-child {
  1308. color: #fff;
  1309. font-size: 3rem;
  1310. font-weight: 400;
  1311. text-shadow: 0px 0px 0.4rem #fff;
  1312. }
  1313. }
  1314. }
  1315. }
  1316. }
  1317. }
  1318. }
  1319. .bottomBox {
  1320. top: 46.5vh;
  1321. }
  1322. .dialog {
  1323. position: absolute;
  1324. top: 12.72vh;
  1325. /* 初始位置在视图上方外面 */
  1326. left: 31.1vw;
  1327. z-index: 200;
  1328. width: 37.8vw;
  1329. height: 21.2vh;
  1330. background: url('../../../assets/images/newHome/centerTopBg.png') center
  1331. center no-repeat;
  1332. background-size: 100% 100%;
  1333. &_content {
  1334. position: relative;
  1335. width: 100%;
  1336. height: 100%;
  1337. box-sizing: border-box;
  1338. padding-top: 3.7vh;
  1339. .contentInfo {
  1340. position: relative;
  1341. width: 90%;
  1342. height: 100%;
  1343. margin: 0 auto;
  1344. .title {
  1345. font-weight: 600;
  1346. color: #ffffff;
  1347. font-size: 1.8rem;
  1348. }
  1349. .address {
  1350. color: #ffffff80;
  1351. font-size: 1.2rem;
  1352. margin-top: 0.8%;
  1353. }
  1354. .viewDetailBtn {
  1355. position: absolute;
  1356. right: 2rem;
  1357. bottom: 2rem;
  1358. }
  1359. .infoDesc {
  1360. width: 100%;
  1361. display: flex;
  1362. justify-content: space-between;
  1363. margin-top: 1%;
  1364. div {
  1365. display: flex;
  1366. flex-direction: column;
  1367. align-items: center;
  1368. justify-content: center;
  1369. border-radius: 4px;
  1370. width: 24%;
  1371. height: 9.5vh;
  1372. background: linear-gradient(180deg, #163e8c1f 0%, #9daaccba 100%);
  1373. .num {
  1374. color: #ffffffe6;
  1375. font-size: 2rem;
  1376. font-weight: 600;
  1377. }
  1378. .warningText {
  1379. display: inline-block;
  1380. width: 100%;
  1381. font-size: 2rem;
  1382. font-weight: 600;
  1383. text-align: center;
  1384. }
  1385. .name {
  1386. color: #ffffff99;
  1387. font-size: 1.4rem;
  1388. font-weight: 400;
  1389. margin-top: 1%;
  1390. }
  1391. }
  1392. }
  1393. .deviceInfo {
  1394. display: flex;
  1395. align-items: center;
  1396. height: 3.7vh;
  1397. width: 21vw;
  1398. color: #fff;
  1399. font-size: 1.4rem;
  1400. border-bottom: 1px solid #ffffff4d;
  1401. .leftInfo {
  1402. display: flex;
  1403. width: 50%;
  1404. height: 100%;
  1405. align-items: center;
  1406. img {
  1407. width: 2rem;
  1408. height: 2rem;
  1409. margin-right: 1rem;
  1410. }
  1411. }
  1412. }
  1413. .warningInfo {
  1414. display: flex;
  1415. justify-content: space-between;
  1416. color: #ffffff;
  1417. margin-top: 1.85vh;
  1418. height: 11.39vh;
  1419. font-size: 1.4rem;
  1420. .infoContent {
  1421. width: 18.38vw;
  1422. color: yellow;
  1423. .marginBtn {
  1424. margin-top: 2.3vh;
  1425. }
  1426. }
  1427. .infoDesc {
  1428. width: 13.5vw;
  1429. div {
  1430. width: 49%;
  1431. }
  1432. }
  1433. }
  1434. }
  1435. }
  1436. &_close {
  1437. position: absolute;
  1438. right: 1.85vw;
  1439. top: 3vh;
  1440. z-index: 201;
  1441. width: 4.8rem;
  1442. height: 4.8rem;
  1443. cursor: pointer;
  1444. background: url('../../../assets/images/newHome/close.png') center center
  1445. no-repeat;
  1446. background-size: 100% 100%;
  1447. &:hover {
  1448. background: url('../../../assets/images/newHome/closeHover.png') center
  1449. center no-repeat;
  1450. background-size: 100% 100%;
  1451. }
  1452. }
  1453. }
  1454. .bigBanner {
  1455. position: absolute;
  1456. width: 87.3vw;
  1457. height: 78vh;
  1458. left: 6vw;
  1459. background: url('../../../assets/images/newHome/bigBanner.png') center
  1460. center no-repeat;
  1461. background-size: 100% 100%;
  1462. .contentInfo {
  1463. width: 100%;
  1464. box-sizing: border-box;
  1465. padding: 0 3.125vw 9.4vh 3.125vw;
  1466. overflow: hidden;
  1467. .searchBox {
  1468. display: flex;
  1469. align-items: center;
  1470. margin: 1rem 0;
  1471. .el-select {
  1472. margin-left: 1rem;
  1473. }
  1474. }
  1475. .leftContent {
  1476. width: 51vw;
  1477. float: left;
  1478. .bannerBarBox {
  1479. width: 100%;
  1480. border-radius: 2px;
  1481. // height: 28.38vh;
  1482. height: 59.16vh;
  1483. background: #ffffff1a;
  1484. }
  1485. .bottomBar {
  1486. // margin-top: 2.4vh;
  1487. }
  1488. }
  1489. .rightContent {
  1490. float: left;
  1491. width: 27.76vw;
  1492. height: 59.16vh;
  1493. margin-left: 1.77vw;
  1494. border-radius: 2px;
  1495. background: #ffffff1a;
  1496. box-sizing: border-box;
  1497. padding-top: 1vh;
  1498. .table {
  1499. height: 52.5vh;
  1500. overflow: auto;
  1501. width: 95%;
  1502. margin: 0 auto;
  1503. .item {
  1504. display: flex;
  1505. align-items: center;
  1506. justify-content: space-between;
  1507. color: #fff;
  1508. font-size: 1.4rem;
  1509. &:nth-child(even) {
  1510. background: #ffffff14;
  1511. /* 设置奇数列的背景颜色 */
  1512. }
  1513. div {
  1514. width: 25%;
  1515. box-sizing: border-box;
  1516. padding: 1vh;
  1517. text-align: center;
  1518. }
  1519. .orangeText {
  1520. color: #f4a72f;
  1521. }
  1522. }
  1523. .header {
  1524. color: #33cccc;
  1525. }
  1526. }
  1527. .info {
  1528. float: right;
  1529. display: flex;
  1530. font-size: 1.6rem;
  1531. padding-right: 2.5%;
  1532. div {
  1533. color: #ffffff;
  1534. margin-left: 1rem;
  1535. span {
  1536. color: #fff;
  1537. font-size: 2.5rem;
  1538. }
  1539. }
  1540. }
  1541. }
  1542. }
  1543. }
  1544. .tipsBox {
  1545. position: absolute;
  1546. left: 6.2vw;
  1547. bottom: 8.9vh;
  1548. z-index: 201;
  1549. display: flex;
  1550. div {
  1551. width: 9vw;
  1552. height: 12vh;
  1553. background: url('../../../assets/images/newHome/warningTips.png') bottom
  1554. center no-repeat;
  1555. background-size: 100% 100%;
  1556. text-align: center;
  1557. box-sizing: border-box;
  1558. padding-top: 3vh;
  1559. span {
  1560. display: inline-block;
  1561. width: 100%;
  1562. color: #ffffffbf;
  1563. font-size: 1.4rem;
  1564. }
  1565. :first-child {
  1566. color: #ffffffbf;
  1567. font-size: 4rem;
  1568. text-shadow: 0 0 0.4rem #fff;
  1569. }
  1570. }
  1571. }
  1572. .lineBox,
  1573. .rightTips {
  1574. right: 6.2vw;
  1575. left: auto;
  1576. }
  1577. .warningBox {
  1578. position: absolute;
  1579. top: 7.4vh;
  1580. left: 50%;
  1581. z-index: 190;
  1582. transform: translateX(-50%);
  1583. width: 19.8vw;
  1584. height: 3.7vh;
  1585. cursor: pointer;
  1586. color: yellow;
  1587. font-size: 1.4rem;
  1588. white-space: nowrap;
  1589. /* 禁止文本换行 */
  1590. overflow: hidden;
  1591. /* 隐藏溢出部分 */
  1592. background: url('../../../assets/images/newHome/warningDefault.png') bottom
  1593. center no-repeat;
  1594. background-size: 100% 100%;
  1595. &:hover {
  1596. background: url('../../../assets/images/newHome/warningHover.png') bottom
  1597. center no-repeat;
  1598. background-size: 100% 100%;
  1599. }
  1600. .content {
  1601. position: relative;
  1602. width: 80%;
  1603. margin: 0 auto;
  1604. overflow: hidden;
  1605. }
  1606. .item {
  1607. display: inline-block;
  1608. /* 内联显示项目 */
  1609. white-space: nowrap;
  1610. /* 禁止项目换行 */
  1611. animation: scroll 20s linear infinite;
  1612. /* 使用名为 "scroll" 的动画,持续 10 秒,线性运动,无限循环 */
  1613. }
  1614. @keyframes scroll {
  1615. 0% {
  1616. transform: translateX(0);
  1617. /* 从初始位置开始 */
  1618. }
  1619. 100% {
  1620. transform: translateX(-100%);
  1621. /* 向左平移整个容器宽度 */
  1622. }
  1623. }
  1624. }
  1625. }
  1626. </style>