index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  1. <!--
  2. * @Description:
  3. * @Author: wangcc
  4. * @Date: 2022-07-06 15:56:45
  5. * @LastEditors: wangcc
  6. * @LastEditTime: 2022-12-08 16:31:08
  7. * @FilePath: \castgroup_bigscreen\src\views\index.vue
  8. * @Copyright: Copyright (c) 2016~2022 by wangcc, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class>
  12. <!-- <dv-full-screen-container> -->
  13. <Map></Map>
  14. <Header></Header>
  15. <section class="nav-wrap">
  16. <div
  17. class="nav-item"
  18. :class="{ active: (index + 1) == page }"
  19. v-for="(item,index) in navList"
  20. @click="navClick(index + 1)"
  21. :key="index"
  22. >{{ item.text }}</div>
  23. </section>
  24. <Alarm v-if="page == 6 && alarmData.length >= 1" :data="alarmData" />
  25. <section class="left-wrap" v-if="$store.state.addr.page == 'forest'">
  26. <Numerical class="left-item" :data="page1numerical" pageName="forest" />
  27. <MyEcharts
  28. class="left-item chart-wrap"
  29. mid="page1Char1"
  30. streetTitleText="各小班"
  31. ref="page1Char1"
  32. :option="page1Char1"
  33. style
  34. />
  35. <MyEcharts
  36. class="left-item chart-wrap"
  37. mid="page1Char2"
  38. streetTitleText="各小班"
  39. ref="page1Char2"
  40. :option="page1Char2"
  41. style
  42. />
  43. </section>
  44. <section class="left-wrap" v-if="$store.state.addr.page == 'treeSpecies'">
  45. <Numerical class="left-item" :data="page2numerical" pageName="treeSpecies" />
  46. <!-- <MyEcharts
  47. class="left-item chart-wrap"
  48. mid="page2Char1"
  49. :option="page2Char1"
  50. ref="page2Char1"
  51. />-->
  52. <MyEcharts
  53. class="left-item chart-wrap"
  54. mid="page2Char2"
  55. streetTitleText="各小班"
  56. :option="page2Char2"
  57. ref="page2Char2"
  58. />
  59. <MyEcharts
  60. class="left-item chart-wrap"
  61. mid="page2Char3"
  62. streetTitleText="各小班"
  63. :option="page2Char3"
  64. ref="page2Char3"
  65. />
  66. </section>
  67. <!-- 林业经济 -->
  68. <section class="left-wrap" v-if="$store.state.addr.page == 'economics'">
  69. <!-- <Typeslide :data="typeSlideData" /> -->
  70. <Numerical class="left-item" :data="page5numerical" pageName="economics" />
  71. <MyEcharts
  72. class="left-item chart-wrap"
  73. mid="page5Char2"
  74. ref="page5Char2"
  75. :option="page5Char2"
  76. />
  77. <MyEcharts
  78. class="left-item chart-wrap"
  79. mid="page5Char1"
  80. ref="page5Char1"
  81. :option="page5Char1"
  82. />
  83. </section>
  84. <!-- 事件信息 -->
  85. <section class="left-wrap event-page" v-if="$store.state.addr.page == 'event'">
  86. <Numerical class="left-item" :data="page6numerical" />
  87. <MyEcharts
  88. class="left-item chart-wrap"
  89. mid="page6Char1"
  90. ref="page6Char1"
  91. :option="page6Char1"
  92. />
  93. <!-- <MyEcharts
  94. class="left-item chart-wrap"
  95. mid="page6Char2"
  96. ref="page6Char2"
  97. :option="page6Char2"
  98. />-->
  99. <div class="left-item">
  100. <!-- <div class="ntitle">{{$store.state.addr.selectAddr}}事件发生记录</div> -->
  101. <div class="ntitle">
  102. <span
  103. v-if="$store.state.addr.mapLevel == 'province'"
  104. >{{ $store.state.addr.selectAddr }}各地州(市)事件发生记录</span>
  105. <span
  106. v-if="$store.state.addr.mapLevel == 'city'"
  107. >{{ $store.state.addr.selectAddr }}各县事件发生记录</span>
  108. <span
  109. v-if="$store.state.addr.mapLevel == 'district'"
  110. >{{ $store.state.addr.selectAddr }}各乡镇事件发生记录</span>
  111. <span
  112. v-if="$store.state.addr.mapLevel == 'street'"
  113. >{{ $store.state.addr.selectAddr }}各村事件发生记录</span>
  114. </div>
  115. <dv-scroll-board
  116. :key="scrollBoardKey"
  117. class="scroll-event"
  118. :config="scrollEventConfig"
  119. ref="scrollBoard"
  120. @click="scrollEventClick"
  121. @mouseout="scrollEventOut"
  122. />
  123. </div>
  124. </section>
  125. <section class="right-wrap">
  126. <PickerAddr />
  127. <div v-if="showbase" class="xiaoban u-flex" style="width:100%;justify-content: right;">
  128. <div class="selectBox">
  129. <div class="title">基地查询:</div>
  130. <el-input v-model="baseinput" placeholder="请输入基地名称">
  131. <i class="el-icon-search el-input__icon" slot="suffix" @click="basesearch"></i>
  132. </el-input>
  133. </div>
  134. </div>
  135. <div class="right_xiaoban">
  136. <div class="tab-box" v-if="showxiaoban">
  137. <div
  138. class="tab-btn"
  139. :class="classFunc(index)"
  140. @click="tabLink(index)"
  141. v-for="(item, index) in tabData"
  142. :key="index"
  143. >
  144. <span class="tab-span">{{ item.name }}</span>
  145. </div>
  146. </div>
  147. <div v-if="showxiaoban" class="xiaoban u-flex">
  148. <div class="tab-class-search" v-if="cur == 1">
  149. <!-- <div class="title">小班查询:</div> -->
  150. <el-input v-model="xiaobaninput" placeholder="请输入小班号">
  151. <i class="el-icon-search el-input__icon" slot="suffix" @click="xiaobansearch"></i>
  152. </el-input>
  153. </div>
  154. <div class="tab-class-search" v-if="cur == 0">
  155. <!-- <div class="title">项目查询:</div> -->
  156. <el-input v-model="projectInput" placeholder="请输入项目名称">
  157. <i class="el-icon-search el-input__icon" slot="suffix" @click="projectSearch"></i>
  158. </el-input>
  159. </div>
  160. </div>
  161. <section
  162. v-if="showxiaoban || showbase"
  163. class="scroll-board-wrap"
  164. :class="{ close: showScrollBoard == true }"
  165. >
  166. <dv-scroll-board
  167. v-if="showbase"
  168. :key="scrollBoardKey"
  169. class="scroll-board-01 scroll-base"
  170. :config="scrollBaseListConfig"
  171. ref="scrollBaseList"
  172. @click="scrollBaseListClick"
  173. @mouseout="baseListClick"
  174. />
  175. <dv-scroll-board
  176. v-if="showxiaoban && cur == 1"
  177. :key="scrollBoardKey"
  178. class="scroll-board-01"
  179. :config="scrollBoardConfig"
  180. ref="scrollBoard"
  181. @click="scrollBoardClick"
  182. :style="scrollBoardStyle"
  183. />
  184. <dv-scroll-board
  185. v-if="showxiaoban && cur == 0"
  186. :key="scrollBoardKey"
  187. class="scroll-board-01"
  188. id="projectId"
  189. :config="scrollPeojectConfig"
  190. ref="scrollProjectBoard"
  191. @click="scrollProjectClick"
  192. @mouseout="scrollOutPro"
  193. :style="scrollBoardStyle"
  194. />
  195. <div class="scroll-board-tool" @click="toggleShowScrollBoard">
  196. <div class="inner">
  197. <img src="../assets/img/jiantou.png" alt />
  198. </div>
  199. </div>
  200. </section>
  201. </div>
  202. </section>
  203. <!-- </dv-full-screen-container> -->
  204. </div>
  205. </template>
  206. <script>
  207. import Map from '../components/amapPow.vue';
  208. import Header from '../components/header';
  209. import MyEcharts from '../components/echarts';
  210. import Numerical from '../components/numerical';
  211. import Alarm from '../components/alarm';
  212. import PickerAddr from '../components/pickerAddr';
  213. import Typeslide from '../components/typeslide';
  214. import { Message } from 'element-ui';
  215. import { debounce } from '@/utils/mdebounce';
  216. import { sliceArray } from '@/utils/sliceArray';
  217. import { mapMutations, mapState, mapGetters } from 'vuex';
  218. import {
  219. page1numerical,
  220. page1echarts01,
  221. page1echarts02,
  222. rightScrollData,
  223. baseList,
  224. alarmDataApi,
  225. page2numerical,
  226. page2echarts01,
  227. page2echarts02,
  228. page2echarts03,
  229. page5numerical,
  230. typeSlideApi,
  231. page5echarts01,
  232. page5echarts02,
  233. page6numerical,
  234. page6echarts01,
  235. page6echarts02,
  236. eventList,
  237. smallClassDetail,
  238. smallInfo,
  239. eventDetail,
  240. financeBaseDetail,
  241. projectList,
  242. projectSmallClass
  243. } from '../service/index';
  244. import scrollBoardSchema from '../dataSchema/scrollBoardSchema';
  245. import scrollPeojectSchema from '../dataSchema/scrollPeojectSchema';
  246. import scrollBaseListSchema from '../dataSchema/scrollBaseListSchema';
  247. import page1Char1Schema from '../dataSchema/page1Char1Schema';
  248. import page1Char2Schema from '../dataSchema/page1Char2Schema';
  249. import page2Char1Schema from '../dataSchema/page2Char1Schema';
  250. import page2Char2Schema from '../dataSchema/page2Char2Schema';
  251. import page2Char3Schema from '../dataSchema/page2Char3Schema';
  252. import page5Char1Schema from '../dataSchema/page5Char1Schema';
  253. import page5Char2Schema from '../dataSchema/page5Char2Schema';
  254. import page6Char1Schema from '../dataSchema/page6Char1Schema';
  255. import page6Char2Schema from '../dataSchema/page6Char2Schema';
  256. import scrollEventSchema from '../dataSchema/scrollEventSchema';
  257. //柱状图颜色
  258. let colorArr = ['#00FAFD', '#FF4E46', '#FFAA00', '#19D800'];
  259. // import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data';
  260. export default {
  261. name: '',
  262. components: {
  263. Map,
  264. Header,
  265. MyEcharts,
  266. Numerical,
  267. Alarm,
  268. PickerAddr,
  269. Typeslide
  270. },
  271. data() {
  272. return {
  273. tabData: [
  274. {
  275. id: 1,
  276. name: '项目查询'
  277. },
  278. {
  279. id: 2,
  280. name: '小班查询'
  281. }
  282. ],
  283. rowList: [],
  284. cur: 0,
  285. showxiaoban: true,
  286. showbase: false,
  287. showScrollBoard: false,
  288. alarData: {},
  289. page: 1,
  290. // addrOptions: regionDataPlus,
  291. addrSelectedOptions: ['520000', ''],
  292. navList: [
  293. { text: '森林资源', en: 'forest' },
  294. { text: '林木结构', en: 'treeSpecies' },
  295. { text: '碳汇管理', en: 'sink' },
  296. { text: '林下经济', en: 'economics' },
  297. { text: '土地流转', en: 'circulation' },
  298. { text: '事件信息', en: 'event' }
  299. ],
  300. scrollBoardKey: Date.now(),
  301. scrollBoardStyle: {
  302. // width: '100%',
  303. // height: '60vh'
  304. },
  305. scrollBoardConfig: scrollBoardSchema,
  306. scrollBaseListConfig: scrollBaseListSchema,
  307. scrollPeojectConfig: scrollPeojectSchema,
  308. page1numerical: [
  309. { name: '蓄积量', number: '2309', unit: '立方米' },
  310. { name: '占地面积', number: '55.4', unit: '万亩' }
  311. ],
  312. alarmData: [
  313. // {msg:'三都林场01小班于15:00:00发现火情,请尽快处理!'},
  314. // {msg:'测试1!'},
  315. // {msg:'测试22222222!'},
  316. ],
  317. page1Char1: page1Char1Schema,
  318. page1Char2: page1Char2Schema,
  319. page2numerical: [],
  320. page2Char1: page2Char1Schema,
  321. page2Char2: page2Char2Schema,
  322. page2Char3: page2Char3Schema,
  323. page5numerical: [],
  324. typeSlideData: [],
  325. page5Char1: page5Char1Schema,
  326. page5Char2: page5Char2Schema,
  327. page6numerical: [],
  328. page6Char1: page6Char1Schema,
  329. page6Char2: page6Char2Schema,
  330. scrollEventConfig: scrollEventSchema,
  331. xiaobaninput: '',
  332. projectInput: '',
  333. baseinput: ''
  334. };
  335. },
  336. created() {},
  337. computed: {
  338. ...mapGetters(['vuexCityList', 'vuexDistrictList', 'vuexStreetList'])
  339. },
  340. mounted() {
  341. this.getPageData();
  342. // this.getRightScrollData();
  343. setInterval(() => {
  344. this.getPageData();
  345. }, 1160000);
  346. window.onresize = () => {
  347. //图表resize
  348. if (this.$store.state.addr.page == 'forest') {
  349. let page1Char1Uuid = this.$refs.page1Char1.mid;
  350. this.$refs.page1Char1.resizeChar(page1Char1Uuid);
  351. let page1Char2Uuid = this.$refs.page1Char2.mid;
  352. this.$refs.page1Char2.resizeChar(page1Char2Uuid);
  353. } else if (this.$store.state.addr.page == 'treeSpecies') {
  354. let page2Char2Uuid = this.$refs.page2Char2.mid;
  355. this.$refs.page2Char2.resizeChar(page2Char2Uuid);
  356. let page2Char3Uuid = this.$refs.page2Char3.mid;
  357. this.$refs.page2Char3.resizeChar(page2Char3Uuid);
  358. } else if (this.$store.state.addr.page == 'economics') {
  359. let page5Char1Uuid = this.$refs.page5Char1.mid;
  360. this.$refs.page5Char1.resizeChar(page5Char1Uuid);
  361. let page5Char2Uuid = this.$refs.page5Char2.mid;
  362. this.$refs.page5Char2.resizeChar(page5Char2Uuid);
  363. } else if (this.$store.state.addr.page == 'event') {
  364. let page6Char1Uuid = this.$refs.page6Char1.mid;
  365. this.$refs.page6Char1.resizeChar(page6Char1Uuid);
  366. let page6Char2Uuid = this.$refs.page6Char2.mid;
  367. this.$refs.page6Char2.resizeChar(page6Char2Uuid);
  368. }
  369. };
  370. },
  371. watch: {
  372. xiaobaninput: {
  373. handler: function () {
  374. debounce(this.xiaobansearch, 500, false);
  375. }
  376. },
  377. projectInput: {
  378. handler: function () {
  379. debounce(this.projectSearch, 500, false);
  380. }
  381. },
  382. baseinput: {
  383. handler: function () {
  384. debounce(this.basesearch, 500, false);
  385. }
  386. },
  387. '$store.state.addr.selectCity'(val) {
  388. // debounce(this.getPageData(), 1000, false)
  389. this.getPageData();
  390. },
  391. '$store.state.addr.selectDistrict'(val) {
  392. this.getPageData();
  393. },
  394. '$store.state.addr.selectStreet'(val) {
  395. this.getPageData();
  396. },
  397. '$store.state.addr.mapLevel': {
  398. handler(val) {
  399. if (val === 'city' && this.$store.state.addr.selectCity.prop == '2') {
  400. this.jumpDistrict();
  401. }
  402. }
  403. },
  404. '$store.state.addr.selectProject'(val) {
  405. // console.log('addr.selectProject',val);
  406. this.getPageData();
  407. }
  408. },
  409. methods: {
  410. ...mapMutations([
  411. 'changeSearchSmallClass',
  412. 'changeEvenData',
  413. 'changeBaseDetail',
  414. 'changeSelectCity',
  415. 'changeSelectDistrict',
  416. 'changeSelectStreet',
  417. 'getProjectSmallClassMap',
  418. 'changeSelectProject'
  419. ]),
  420. addrChange(value) {
  421. console.log('addrChange', value);
  422. },
  423. navClick(index) {
  424. let pageName = this.navList[index - 1].en;
  425. if (pageName == 'sink' || pageName == 'circulation') {
  426. Message('暂未开放!');
  427. return;
  428. }
  429. this.$store.commit('changePage', this.navList[index - 1].en);
  430. this.page = index;
  431. if (this.navList[index - 1].en == 'economics') {
  432. this.showbase = true;
  433. this.showxiaoban = false;
  434. } else if (this.navList[index - 1].en == 'event') {
  435. this.showbase = false;
  436. this.showxiaoban = false;
  437. } else {
  438. this.showbase = false;
  439. this.showxiaoban = true;
  440. }
  441. // 切换专题时,重置区域
  442. // this.$store.dispatch('searchArea', {
  443. // parentId: '520000',
  444. // name: '贵州省',
  445. // mapLevel: 'province'
  446. // });
  447. this.getPageData();
  448. },
  449. getPageData() {
  450. debounce(this.debounceGetData, 300, false);
  451. },
  452. debounceGetData() {
  453. console.log('请求数据');
  454. // console.log('page', this.$store.state.addr.page);
  455. // {text:'森林资源',en:'forest'},
  456. // {text:'林木结构',en:'treeSpecies'},
  457. // {text:'碳汇管理',en:'sink'},
  458. // {text:'林下经济',en:'economics'},
  459. // {text:'土地流转',en:'circulation'},
  460. // {text:'事件信息',en:'event'},
  461. if (this.$store.state.addr.page == 'forest') {
  462. this.getPage1numerical();
  463. this.getPage1echarts01();
  464. this.getPage1echarts02();
  465. this.getRightScrollData();
  466. this.getProjectScrollData();
  467. } else if (this.$store.state.addr.page == 'treeSpecies') {
  468. this.getPage2numerical();
  469. // this.getPage2echarts01();
  470. this.getPage2echarts02();
  471. this.getPage2echarts03();
  472. this.getRightScrollData();
  473. this.getProjectScrollData();
  474. } else if (this.$store.state.addr.page == 'economics') {
  475. this.getPage5numerical();
  476. // this.getTypeSlideData();
  477. this.getPage5echarts01();
  478. this.getPage5echarts02();
  479. this.getBaseList();
  480. } else if (this.$store.state.addr.page == 'event') {
  481. this.getPage6numerical();
  482. this.getPage6echarts01();
  483. this.getEventList();
  484. // this.getPage6echarts02();
  485. this.getAlarmData();
  486. // this.getRightScrollData();
  487. }
  488. },
  489. getPage1numerical() {
  490. let param = {
  491. cityId: this.$store.state.addr.selectCity.areaId,
  492. countyId: this.$store.state.addr.selectDistrict.areaId,
  493. townId: this.$store.state.addr.selectStreet.areaId,
  494. courseId: this.$store.state.addr.selectProject.ProjectID
  495. };
  496. page1numerical(param)
  497. .then((res) => {
  498. // console.log('res',res);
  499. this.page1numerical = res.data;
  500. })
  501. .catch((err) => {
  502. console.log('echarts01 err', err);
  503. });
  504. },
  505. getPage1echarts01() {
  506. let param = {
  507. cityId: this.$store.state.addr.selectCity.areaId,
  508. countyId: this.$store.state.addr.selectDistrict.areaId,
  509. townId: this.$store.state.addr.selectStreet.areaId,
  510. courseId: this.$store.state.addr.selectProject.ProjectID
  511. };
  512. // console.log('cityId',param.cityId);
  513. page1echarts01(param)
  514. .then((res) => {
  515. this.page1Char1.xAxis.data = res.data.map((item) => {
  516. return item.name;
  517. });
  518. this.page1Char1.series[0].data = res.data.map((item) => {
  519. return item.number;
  520. });
  521. //数量过小时隐藏滚动
  522. if (this.page1Char1.xAxis.data.length <= 5) {
  523. this.page1Char1.dataZoom[0].show = false;
  524. } else {
  525. this.page1Char1.dataZoom[0].show = true;
  526. }
  527. let charUuid = this.$refs.page1Char1.mid;
  528. this.$refs.page1Char1.intChar(charUuid);
  529. })
  530. .catch((err) => {
  531. console.log('getPage1echarts01 err', err);
  532. });
  533. },
  534. getPage1echarts02() {
  535. let param = {
  536. cityId: this.$store.state.addr.selectCity.areaId,
  537. countyId: this.$store.state.addr.selectDistrict.areaId,
  538. townId: this.$store.state.addr.selectStreet.areaId,
  539. courseId: this.$store.state.addr.selectProject.ProjectID
  540. };
  541. // console.log('cityId',param.cityId);
  542. page1echarts02(param)
  543. .then((res) => {
  544. this.page1Char2.xAxis.data = res.data.map((item) => {
  545. return item.name;
  546. });
  547. this.page1Char2.series[0].data = res.data.map((item) => {
  548. return item.number;
  549. });
  550. //数量过小时隐藏滚动
  551. if (this.page1Char2.xAxis.data.length <= 5) {
  552. this.page1Char2.dataZoom[0].show = false;
  553. } else {
  554. this.page1Char2.dataZoom[0].show = true;
  555. }
  556. let charUuid = this.$refs.page1Char2.mid;
  557. this.$refs.page1Char2.intChar(charUuid);
  558. })
  559. .catch((err) => {
  560. console.log('getPage1echarts02 err', err);
  561. });
  562. },
  563. getRightScrollData() {
  564. let param = {
  565. smallNumber: this.xiaobaninput,
  566. cityId: this.$store.state.addr.selectCity.areaId,
  567. countyId: this.$store.state.addr.selectDistrict.areaId,
  568. townId: this.$store.state.addr.selectStreet.areaId,
  569. courseId: this.$store.state.addr.selectProject.ProjectID,
  570. pageNum: 1,
  571. pageSize: 50
  572. };
  573. rightScrollData(param)
  574. .then((res) => {
  575. // console.log('res',res.rows.length);
  576. // console.log('this.scrollBoardConfig',this.scrollBoardConfig);
  577. //当小班滚动数据少时重设参数
  578. // if(res.rows.length<=15){
  579. // this.scrollBoardConfig.rowNum = 5;
  580. // this.scrollBoardStyle.height = '25vh'
  581. // }
  582. this.scrollBoardConfig.data = [];
  583. res.rows.forEach((element) => {
  584. this.scrollBoardConfig.data.push([
  585. element.smallNumber,
  586. element.treeComp,
  587. element.perAcreStock + 'm³',
  588. element.landArea + '亩',
  589. element.id
  590. ]);
  591. });
  592. this.scrollBoardKey = Date.now();
  593. this.$refs.scrollBoard &&
  594. this.$refs.scrollBoard.updateRows(this.scrollBoardConfig.data);
  595. // console.log('this.scrollBoardConfig.data', this.scrollBoardConfig.data);
  596. // this.scrollBoardConfig = res.data;
  597. })
  598. .catch((err) => {
  599. console.log('scrollBoard err', err);
  600. });
  601. },
  602. getProjectScrollData() {
  603. let param = {
  604. courseName: this.projectInput,
  605. cityId: this.$store.state.addr.selectCity.areaId,
  606. countyId: this.$store.state.addr.selectDistrict.areaId,
  607. townId: this.$store.state.addr.selectStreet.areaId,
  608. pageNum: 1,
  609. pageSize: 50
  610. };
  611. projectList(param)
  612. .then((res) => {
  613. // console.log('res',res.rows.length);
  614. // console.log('this.scrollBoardConfig',this.scrollBoardConfig);
  615. //当小班滚动数据少时重设参数
  616. // if(res.rows.length<=15){
  617. // this.scrollBoardConfig.rowNum = 5;
  618. // this.scrollBoardStyle.height = '25vh'
  619. // }
  620. let that = this;
  621. this.scrollPeojectConfig.data = [];
  622. res.rows.forEach((element) => {
  623. this.scrollPeojectConfig.data.push([
  624. element.courseName,
  625. element.smallClassStock + 'm³',
  626. element.landArea + '亩',
  627. element.classNumber,
  628. element.id
  629. ]);
  630. });
  631. this.scrollBoardKey = Date.now();
  632. this.$refs.scrollProjectBoard.updateRows(
  633. this.scrollPeojectConfig.data
  634. );
  635. //监听是否有选中项目,有的话高亮
  636. let timer1 = setInterval(function () {
  637. // 每 10 毫秒检查一下 html 是否已存在
  638. let domId = that.$store.state.addr.selectProject.ProjectID;
  639. let dom = document.getElementById(
  640. that.$store.state.addr.selectProject.ProjectID
  641. );
  642. // console.log('dom',domId);
  643. if (domId && dom) {
  644. // console.log('dom',dom.classList);
  645. if (dom.classList.contains('active') == true) {
  646. // clearInterval(timer1);
  647. } else {
  648. dom.classList.add('active');
  649. }
  650. }
  651. }, 500);
  652. // setTimeout(() => {
  653. // this.$store.state.addr.selectProject.ProjectID&&document.getElementById(this.$store.state.addr.selectProject.ProjectID).classList.add('active');
  654. // }, 2000);
  655. // console.log('this.scrollBoardConfig.data', this.scrollBoardConfig.data);
  656. // this.scrollBoardConfig = res.data;
  657. })
  658. .catch((err) => {
  659. console.log('scrollProjectBoard err', err);
  660. });
  661. },
  662. getBaseList() {
  663. let param = {
  664. baseName: this.baseinput,
  665. cityId: this.$store.state.addr.selectCity.areaId,
  666. countyId: this.$store.state.addr.selectDistrict.areaId,
  667. townId: this.$store.state.addr.selectStreet.areaId
  668. };
  669. baseList(param)
  670. .then((res) => {
  671. this.scrollBaseListConfig.data = [];
  672. res.rows.forEach((element) => {
  673. let cateInfoList = element.cateInfoList;
  674. let cropName = '';
  675. for (let index = 0; index < cateInfoList.length; index++) {
  676. const item = cateInfoList[index];
  677. cropName += item.cropName + ',';
  678. }
  679. cropName = cropName.substring(0, cropName.lastIndexOf(','));
  680. this.scrollBaseListConfig.data.push([
  681. element.baseName,
  682. cropName || '暂无作物',
  683. element.baseArea + '亩',
  684. element.id
  685. ]);
  686. });
  687. this.scrollBoardKey = Date.now();
  688. })
  689. .catch((err) => {
  690. console.log('echarts01 err', err);
  691. });
  692. },
  693. getEventList() {
  694. let param = {
  695. cityId: this.$store.state.addr.selectCity.areaId,
  696. countyId: this.$store.state.addr.selectDistrict.areaId,
  697. townId: this.$store.state.addr.selectStreet.areaId
  698. };
  699. eventList(param)
  700. .then((res) => {
  701. this.scrollEventConfig.data = [];
  702. res.rows.forEach((element) => {
  703. this.scrollEventConfig.data.push([
  704. element.createTime.slice(5, 16),
  705. element.townName + element.villageName,
  706. this.eventTypeFilter(element.eventType),
  707. // element.createBy,
  708. this.eventStateFilter(element.state),
  709. element.id
  710. ]);
  711. });
  712. this.scrollBoardKey = Date.now();
  713. })
  714. .catch((err) => {
  715. console.log('getEventList err', err);
  716. });
  717. },
  718. eventTypeFilter(e) {
  719. if (e == '1') {
  720. return '火灾';
  721. } else if (e == '2') {
  722. return '砍伐';
  723. } else if (e == '3') {
  724. return '病虫害';
  725. } else if (e == '4') {
  726. return '偷盗林木';
  727. }
  728. },
  729. eventStateFilter(e) {
  730. if (e == '0') {
  731. return '未反馈';
  732. } else if (e == '1') {
  733. return '已反馈';
  734. }
  735. },
  736. getAlarmData() {
  737. alarmDataApi()
  738. .then((res) => {
  739. // console.log('this.page',this.page);
  740. // console.log('res',res);
  741. this.alarmData = res.data;
  742. // console.log('alarmData.length',this.alarmData.length);
  743. })
  744. .catch((err) => {
  745. console.log('echarts01 err', err);
  746. });
  747. },
  748. getPage2numerical() {
  749. let param = {
  750. cityId: this.$store.state.addr.selectCity.areaId,
  751. countyId: this.$store.state.addr.selectDistrict.areaId,
  752. townId: this.$store.state.addr.selectStreet.areaId,
  753. smallNumber: this.xiaobaninput,
  754. courseId: this.$store.state.addr.selectProject.ProjectID
  755. };
  756. page2numerical(param)
  757. .then((res) => {
  758. // console.log('res',res);
  759. this.page2numerical = res.data;
  760. })
  761. .catch((err) => {
  762. console.log('page2numerical err', err);
  763. });
  764. },
  765. getPage2echarts01() {
  766. let param = {
  767. smallNumber: this.xiaobaninput,
  768. cityId: this.$store.state.addr.selectCity.areaId,
  769. countyId: this.$store.state.addr.selectDistrict.areaId,
  770. townId: this.$store.state.addr.selectStreet.areaId,
  771. courseId: this.$store.state.addr.selectProject.ProjectID
  772. };
  773. page2echarts01(param)
  774. .then((res) => {
  775. // console.log('res',res);
  776. this.page2Char1.series[0].data = [];
  777. this.page2Char1.series[0].data = res.data;
  778. let charUuid = this.$refs.page2Char1.mid;
  779. this.$refs.page2Char1.intChar(charUuid);
  780. })
  781. .catch((err) => {
  782. console.log('getPage2echarts01 err', err);
  783. });
  784. },
  785. getPage2echarts02() {
  786. let param = {
  787. smallNumber: this.xiaobaninput,
  788. cityId: this.$store.state.addr.selectCity.areaId,
  789. countyId: this.$store.state.addr.selectDistrict.areaId,
  790. townId: this.$store.state.addr.selectStreet.areaId,
  791. courseId: this.$store.state.addr.selectProject.ProjectID
  792. };
  793. page2echarts02(param)
  794. .then((res) => {
  795. // console.log('res',res);
  796. // this.page2Char2 = res.data;
  797. // console.log('this.page2Char2.series', this.page2Char2.series);
  798. this.page2Char2.xAxis.data = [];
  799. this.page2Char2.series = [];
  800. const rows = res.data;
  801. // console.log(rows)
  802. // x坐标
  803. this.page2Char2.xAxis.data = rows.map((item) => {
  804. return item.smallNumber;
  805. });
  806. // console.log('x坐标', this.page2Char2.xAxis.data)
  807. // 获取所有项
  808. let seriesList = rows.map((item) => {
  809. return item.treeList || [];
  810. });
  811. // 数组扁平化
  812. seriesList = seriesList.flat();
  813. // 去重
  814. let obj = {};
  815. seriesList = seriesList.reduce((newArr, next) => {
  816. // console.log('page2Char2 seriesList',seriesList);
  817. // console.log('page2Char2 next',next);
  818. obj[next.name] ? '' : (obj[next.name] = true && newArr.push(next));
  819. return newArr;
  820. }, []);
  821. seriesList.sort((star, next) => {
  822. // 按name的指定顺序排序,不排序可以删掉
  823. var order = ['杉木', '马尾松', '软阔', '硬阔'];
  824. return order.indexOf(star.name) - order.indexOf(next.name);
  825. });
  826. seriesList = seriesList.map((item, index) => {
  827. let itemColor = null;
  828. if (item.name == '杉木' || item.name == '杉') {
  829. itemColor = colorArr[0];
  830. } else if (item.name == '马尾松' || item.name == '马') {
  831. itemColor = colorArr[1];
  832. } else if (item.name == '软阔' || item.name == '软') {
  833. itemColor = colorArr[2];
  834. } else if (item.name == '硬阔' || item.name == '硬') {
  835. itemColor = colorArr[3];
  836. }
  837. return {
  838. name: item.name,
  839. type: 'bar',
  840. stack: 'total',
  841. label: {
  842. show: false
  843. },
  844. emphasis: {
  845. focus: 'series'
  846. },
  847. data: [],
  848. itemStyle: {
  849. normal: { color: itemColor || 'auto' }
  850. }
  851. };
  852. });
  853. // console.log(seriesList)
  854. rows.forEach((item) => {
  855. seriesList.forEach((jtem, index) => {
  856. let num = 0;
  857. item.treeList &&
  858. item.treeList.map((ktem) => {
  859. if (ktem.name.indexOf(jtem.name) > -1) {
  860. num = ktem.value;
  861. }
  862. });
  863. seriesList[index].data.push(num);
  864. });
  865. });
  866. // console.log('page2echarts02 seriesList',seriesList)
  867. this.page2Char2.series = seriesList;
  868. //数量过小时隐藏滚动
  869. if (this.page2Char2.xAxis.data.length <= 5) {
  870. this.page2Char2.dataZoom[0].show = false;
  871. } else {
  872. this.page2Char2.dataZoom[0].show = true;
  873. }
  874. let charUuid = this.$refs.page2Char2.mid;
  875. this.$refs.page2Char2.intChar(charUuid);
  876. })
  877. .catch((err) => {
  878. console.log('getPage2echarts02 err', err);
  879. });
  880. },
  881. getPage2echarts03() {
  882. let param = {
  883. smallNumber: this.xiaobaninput,
  884. cityId: this.$store.state.addr.selectCity.areaId,
  885. countyId: this.$store.state.addr.selectDistrict.areaId,
  886. townId: this.$store.state.addr.selectStreet.areaId,
  887. courseId: this.$store.state.addr.selectProject.ProjectID
  888. };
  889. page2echarts03(param)
  890. .then((res) => {
  891. // console.log('res',res);
  892. // this.page2Char2 = res.data;
  893. // console.log('this.page2Char2.series', this.page2Char2.series);
  894. this.page2Char3.xAxis.data = [];
  895. this.page2Char3.series = [];
  896. const rows = res.data;
  897. // console.log(rows)
  898. // x坐标
  899. this.page2Char3.xAxis.data = rows.map((item) => {
  900. return item.smallNumber;
  901. });
  902. // console.log('x坐标', this.page2Char2.xAxis.data)
  903. // 获取所有项
  904. let seriesList = rows.map((item) => {
  905. return item.treeList || [];
  906. });
  907. // 数组扁平化
  908. seriesList = seriesList.flat();
  909. // 去重
  910. let obj = {};
  911. seriesList = seriesList.reduce((newArr, next) => {
  912. obj[next.name] ? '' : (obj[next.name] = true && newArr.push(next));
  913. return newArr;
  914. }, []);
  915. // console.log('seriesList',seriesList);
  916. seriesList.sort((star, next) => {
  917. // 按name的指定顺序排序,不排序可以删掉
  918. var order = ['杉木', '马尾松', '软阔', '硬阔'];
  919. return order.indexOf(star.name) - order.indexOf(next.name);
  920. });
  921. seriesList = seriesList.map((item, index) => {
  922. let itemColor = null;
  923. if (item.name == '杉木' || item.name == '杉') {
  924. itemColor = colorArr[0];
  925. } else if (item.name == '马尾松' || item.name == '马') {
  926. itemColor = colorArr[1];
  927. } else if (item.name == '软阔' || item.name == '软') {
  928. itemColor = colorArr[2];
  929. } else if (item.name == '硬阔' || item.name == '硬') {
  930. itemColor = colorArr[3];
  931. }
  932. return {
  933. name: item.name,
  934. type: 'bar',
  935. stack: 'total',
  936. label: {
  937. show: false
  938. },
  939. emphasis: {
  940. focus: 'series'
  941. },
  942. data: [],
  943. itemStyle: {
  944. normal: { color: itemColor || 'auto' }
  945. }
  946. };
  947. });
  948. // console.log(seriesList)
  949. rows.forEach((item) => {
  950. seriesList.forEach((jtem, index) => {
  951. let num = 0;
  952. item.treeList &&
  953. item.treeList.map((ktem) => {
  954. if (ktem.name.indexOf(jtem.name) > -1) {
  955. num = ktem.value;
  956. }
  957. });
  958. seriesList[index].data.push(num);
  959. });
  960. });
  961. // console.log(seriesList)
  962. this.page2Char3.series = seriesList;
  963. //数量过小时隐藏滚动
  964. if (this.page2Char3.xAxis.data.length <= 5) {
  965. this.page2Char3.dataZoom[0].show = false;
  966. } else {
  967. this.page2Char3.dataZoom[0].show = true;
  968. }
  969. let charUuid = this.$refs.page2Char3.mid;
  970. this.$refs.page2Char3.intChar(charUuid);
  971. })
  972. .catch((err) => {
  973. console.log('getPage2echarts03 err', err);
  974. });
  975. },
  976. getPage5numerical() {
  977. let param = {
  978. cityId: this.$store.state.addr.selectCity.areaId,
  979. countyId: this.$store.state.addr.selectDistrict.areaId,
  980. townId: this.$store.state.addr.selectStreet.areaId
  981. };
  982. page5numerical(param)
  983. .then((res) => {
  984. // console.log('res',res);
  985. this.page5numerical = res.data;
  986. })
  987. .catch((err) => {
  988. console.log('echarts01 err', err);
  989. });
  990. },
  991. getTypeSlideData() {
  992. let param = {
  993. cityId: this.$store.state.addr.selectCity.areaId,
  994. countyId: this.$store.state.addr.selectDistrict.areaId,
  995. townId: this.$store.state.addr.selectStreet.areaId
  996. };
  997. typeSlideApi(param)
  998. .then((res) => {
  999. this.typeSlideData = sliceArray(res.data, 3);
  1000. // console.log(' this.typeSlideData', this.typeSlideData);
  1001. })
  1002. .catch((err) => {
  1003. console.log('getTypeSlideData err', err);
  1004. });
  1005. },
  1006. getPage5echarts01() {
  1007. let param = {
  1008. cityId: this.$store.state.addr.selectCity.areaId,
  1009. countyId: this.$store.state.addr.selectDistrict.areaId,
  1010. townId: this.$store.state.addr.selectStreet.areaId
  1011. };
  1012. page5echarts01(param)
  1013. .then((res) => {
  1014. // console.log('res',res);
  1015. // this.page5Char1 = res.data;
  1016. this.page5Char1.xAxis.data = res.data.map((item) => {
  1017. return item.baseName;
  1018. });
  1019. this.page5Char1.series[0].data = res.data.map((item) => {
  1020. return item.baseArea;
  1021. });
  1022. //数量过小时隐藏滚动
  1023. if (this.page5Char1.xAxis.data.length <= 5) {
  1024. this.page5Char1.dataZoom[0].show = false;
  1025. } else {
  1026. this.page5Char1.dataZoom[0].show = true;
  1027. }
  1028. let charUuid = this.$refs.page5Char1.mid;
  1029. this.$refs.page5Char1.intChar(charUuid);
  1030. })
  1031. .catch((err) => {
  1032. console.log('getPage5echarts01 err', err);
  1033. });
  1034. },
  1035. getPage5echarts02() {
  1036. let param = {
  1037. cityId: this.$store.state.addr.selectCity.areaId,
  1038. countyId: this.$store.state.addr.selectDistrict.areaId,
  1039. townId: this.$store.state.addr.selectStreet.areaId
  1040. };
  1041. page5echarts02(param)
  1042. .then((res) => {
  1043. // console.log('res',res);
  1044. // this.page5Char2 = res.data;
  1045. this.page5Char2.xAxis.data = res.data.map((item) => {
  1046. return item.name;
  1047. });
  1048. this.page5Char2.series[0].data = res.data.map((item) => {
  1049. return item.number;
  1050. });
  1051. //数量过小时隐藏滚动
  1052. if (this.page5Char2.xAxis.data.length <= 5) {
  1053. this.page5Char2.dataZoom[0].show = false;
  1054. } else {
  1055. this.page5Char2.dataZoom[0].show = true;
  1056. }
  1057. let charUuid = this.$refs.page5Char2.mid;
  1058. this.$refs.page5Char2.intChar(charUuid);
  1059. })
  1060. .catch((err) => {
  1061. console.log('getPage5echarts02 err', err);
  1062. });
  1063. },
  1064. getPage6numerical() {
  1065. let param = {
  1066. cityId: this.$store.state.addr.selectCity.areaId,
  1067. countyId: this.$store.state.addr.selectDistrict.areaId,
  1068. townId: this.$store.state.addr.selectStreet.areaId
  1069. };
  1070. //第一屏统计
  1071. page6numerical(param)
  1072. .then((res) => {
  1073. // console.log('res',res);
  1074. this.page6numerical = res.data;
  1075. })
  1076. .catch((err) => {
  1077. console.log('getPage6numerical err', err);
  1078. });
  1079. },
  1080. getPage6echarts01() {
  1081. let param = {
  1082. cityId: this.$store.state.addr.selectCity.areaId,
  1083. countyId: this.$store.state.addr.selectDistrict.areaId,
  1084. townId: this.$store.state.addr.selectStreet.areaId
  1085. };
  1086. page6echarts01(param)
  1087. .then((res) => {
  1088. // console.log('res',res);
  1089. // this.page6Char1 = res.data;
  1090. // this.page6Char1.xAxis[0].data = [];
  1091. // this.page6Char1.series[0].data = [];
  1092. // this.page6Char1.series[1].data = [];
  1093. // this.page6Char1.series[2].data = [];
  1094. // res.data &&
  1095. // res.data.forEach((element) => {
  1096. // this.page6Char1.xAxis[0].data.push(element.villageName);
  1097. // this.page6Char1.series[0].data.push(element.fireCount);
  1098. // this.page6Char1.series[1].data.push(element.cutCount);
  1099. // this.page6Char1.series[2].data.push(element.pestCount);
  1100. // });
  1101. this.page6Char1.xAxis.data = [];
  1102. this.page6Char1.series[0].data = [];
  1103. this.page6Char1.series[1].data = [];
  1104. this.page6Char1.series[2].data = [];
  1105. this.page6Char1.series[3].data = [];
  1106. const rows = res.data;
  1107. // console.log(rows)
  1108. // x坐标
  1109. this.page6Char1.xAxis.data = rows.map((item) => {
  1110. return item.villageName;
  1111. });
  1112. rows.forEach((element) => {
  1113. this.page6Char1.series[0].data.push(element.pestCount);
  1114. this.page6Char1.series[1].data.push(element.fireCount);
  1115. this.page6Char1.series[2].data.push(element.cutCount);
  1116. this.page6Char1.series[3].data.push(element.stealCount);
  1117. });
  1118. // console.log('x坐标', this.page6Char1.xAxis.data)
  1119. //数量过小时隐藏滚动
  1120. if (this.page6Char1.xAxis.data.length <= 5) {
  1121. this.page6Char1.dataZoom[0].show = false;
  1122. } else {
  1123. this.page6Char1.dataZoom[0].show = true;
  1124. }
  1125. let charUuid = this.$refs.page6Char1.mid;
  1126. this.$refs.page6Char1.intChar(charUuid);
  1127. })
  1128. .catch((err) => {
  1129. console.log('getPage6echarts01 err', err);
  1130. });
  1131. },
  1132. getPage6echarts02() {
  1133. let param = {
  1134. cityId: this.$store.state.addr.selectCity.areaId,
  1135. countyId: this.$store.state.addr.selectDistrict.areaId,
  1136. townId: this.$store.state.addr.selectStreet.areaId
  1137. };
  1138. page6echarts02(param)
  1139. .then((res) => {
  1140. const rows = res.data;
  1141. // console.log(rows)
  1142. // x坐标
  1143. this.page6Char2.xAxis.data = [];
  1144. this.page6Char2.series[0].data = [];
  1145. this.page6Char2.series[1].data = [];
  1146. this.page6Char2.series[2].data = [];
  1147. this.page6Char2.xAxis.data = rows.map((item) => {
  1148. return item.month;
  1149. });
  1150. rows.forEach((element) => {
  1151. // console.log('element',element.eventList);
  1152. this.page6Char2.series[0].data.push(element.eventList[0].value);
  1153. this.page6Char2.series[1].data.push(element.eventList[1].value);
  1154. this.page6Char2.series[2].data.push(element.eventList[2].value);
  1155. });
  1156. let charUuid = this.$refs.page6Char2.mid;
  1157. this.$refs.page6Char2.intChar(charUuid);
  1158. })
  1159. .catch((err) => {
  1160. console.log('page6echarts02 err', err);
  1161. });
  1162. },
  1163. xiaobansearch() {
  1164. // console.log('xiaobansearch');
  1165. this.getRightScrollData();
  1166. this.getPageData();
  1167. },
  1168. projectSearch() {
  1169. // console.log('projectSearch');
  1170. this.getProjectScrollData();
  1171. // this.getPageData();
  1172. },
  1173. basesearch() {
  1174. // console.log('xiaobansearch');
  1175. this.getBaseList();
  1176. this.getPageData();
  1177. },
  1178. scrollBoardClick(e) {
  1179. let param = {
  1180. id: e.row[4]
  1181. };
  1182. smallClassDetail(param).then((res) => {
  1183. this.changeSearchSmallClass(res.data);
  1184. this.alarData = res.data;
  1185. // if (this.$store.state.addr.mapLevel == 'city') {
  1186. // this.jumpDistrict();
  1187. // } else {
  1188. // this.vuexCityList.forEach((element) => {
  1189. // if (res.data.cityId === element.areaId) {
  1190. // this.changeSelectCity({
  1191. // value: element.areaCode,
  1192. // label: res.data.cityName,
  1193. // areaId: element.areaId
  1194. // });
  1195. // this.$store.dispatch('searchArea', {
  1196. // parentId: element.areaCode.substring(0, 6),
  1197. // name: res.data.cityName,
  1198. // mapLevel: 'city'
  1199. // });
  1200. // }
  1201. // });
  1202. // }
  1203. });
  1204. },
  1205. removeAllClass(className) {
  1206. //找到所有包含className的结点
  1207. let nodeList = document.querySelectorAll(
  1208. `.dv-scroll-board .${className}`
  1209. );
  1210. // let nodeList = document.getElementsByClassName('row-item');
  1211. //删除这些标签对应的class
  1212. Array.prototype.forEach.call(nodeList, (el) => {
  1213. el && el.classList.remove(className);
  1214. });
  1215. },
  1216. scrollProjectClick(e) {
  1217. // 点击添加class
  1218. // let removeAllClass = (className)=>{
  1219. // //找到所有包含className的结点
  1220. // let nodeList = document.querySelectorAll(`.dv-scroll-board .${className}`);
  1221. // // let nodeList = document.getElementsByClassName('row-item');
  1222. // //删除这些标签对应的class
  1223. // Array.prototype.forEach.call(nodeList,(el)=>{
  1224. // el.classList.remove(className)
  1225. // })
  1226. // }
  1227. let proClass = document.getElementsByClassName('row-item');
  1228. // proClass[e.rowIndex].style.background = 'rgb(4, 145, 110)';
  1229. this.removeAllClass('active');
  1230. // console.log('proClass',proClass);
  1231. // proClass[e.rowIndex]&&proClass[e.rowIndex].classList.add('active');
  1232. let rowId = e.row[4];
  1233. this.changeSelectProject({ ProjectID: rowId, ProjectName: e.row[0] });
  1234. document.getElementById(rowId).classList.add('active');
  1235. let param = {
  1236. courseId: rowId
  1237. // pageNum: 1,
  1238. // pageSize: 20
  1239. };
  1240. projectSmallClass(param).then((res) => {
  1241. if (res.code == 200) {
  1242. this.getProjectSmallClassMap(res.rows);
  1243. }
  1244. });
  1245. },
  1246. jumpDistrict() {
  1247. if (this.vuexDistrictList) {
  1248. this.vuexDistrictList.forEach((element) => {
  1249. if (this.alarData.countyId === element.areaId) {
  1250. this.changeSelectDistrict({
  1251. value: element.areaCode,
  1252. label: this.alarData.cityName,
  1253. areaId: element.areaId,
  1254. prop: '2'
  1255. });
  1256. this.$store.dispatch('searchArea', {
  1257. parentId: element.areaCode.substring(0, 6),
  1258. name: element.areaName,
  1259. mapLevel: 'district'
  1260. });
  1261. }
  1262. });
  1263. }
  1264. },
  1265. scrollOut(e) {
  1266. // console.log(e);
  1267. this.changeSearchSmallClass({ name: false });
  1268. },
  1269. scrollOutPro(e) {
  1270. // let proClass = document.getElementsByClassName('row-item')
  1271. // proClass[e.rowIndex].style.background = '';
  1272. },
  1273. scrollBaseListClick(e) {
  1274. let param = {
  1275. baseId: e.row[3]
  1276. };
  1277. financeBaseDetail(param).then((res) => {
  1278. this.changeBaseDetail(res.data);
  1279. });
  1280. },
  1281. baseListClick() {
  1282. this.changeBaseDetail({ name: false });
  1283. },
  1284. scrollEventClick(e) {
  1285. let param = {
  1286. id: e.row[4]
  1287. };
  1288. eventDetail(param).then((res) => {
  1289. this.changeEvenData(res.data);
  1290. });
  1291. },
  1292. scrollEventOut() {
  1293. this.changeEvenData({ name: false });
  1294. },
  1295. toggleShowScrollBoard() {
  1296. this.showScrollBoard = !this.showScrollBoard;
  1297. },
  1298. tabLink(e) {
  1299. this.cur = e;
  1300. if (this.cur == '1') {
  1301. this.removeAllClass('active');
  1302. }
  1303. },
  1304. classFunc(index) {
  1305. if (this.cur == index) {
  1306. return `active active${index}`;
  1307. }
  1308. }
  1309. }
  1310. };
  1311. </script>
  1312. <style lang='scss' scoped>
  1313. @import url(./index.scss);
  1314. .tab-box {
  1315. // background-color: rgba(1, 33, 35, 0.7);
  1316. // background: linear-gradient(90deg, rgba(0,99,113,0.9) 0%, #00ADAF 54%, rgba(0,50,57,0.9) 100%);
  1317. background-color: rgba(0, 161, 173, 0.2);
  1318. box-shadow: inset 0px -2px 9px -3px rgba(0, 250, 253, 0.4);
  1319. width: 100%;
  1320. .tab-btn {
  1321. float: left;
  1322. width: 148px;
  1323. height: 46px;
  1324. line-height: 46px;
  1325. text-align: center;
  1326. color: rgba(255, 255, 255, 0.6);
  1327. &:first-of-type {
  1328. text-indent: -10px;
  1329. }
  1330. cursor: pointer;
  1331. &.active0 {
  1332. background: url(../assets/img/tab-btn-first.png) no-repeat;
  1333. }
  1334. &.active1 {
  1335. background: url(../assets/img/tab-btn-center.png) no-repeat;
  1336. transform: translateX(-22px);
  1337. }
  1338. &.active {
  1339. background-size: 100%;
  1340. color: #00fafd;
  1341. }
  1342. .tab-span {
  1343. display: inline-block;
  1344. }
  1345. }
  1346. }
  1347. .tab-class-search {
  1348. // display: flex;
  1349. height: 40px;
  1350. width: 100%;
  1351. align-items: center;
  1352. margin: 0 15px;
  1353. }
  1354. /deep/ .row-item {
  1355. line-height: normal !important;
  1356. align-items: center;
  1357. }
  1358. /deep/ .dv-scroll-board .rows .ceil {
  1359. white-space: normal;
  1360. overflow: unset;
  1361. text-overflow: unset;
  1362. display: grid;
  1363. height: 100%;
  1364. align-items: center;
  1365. }
  1366. .right_xiaoban {
  1367. background-color: rgba(1, 33, 35, 0.7);
  1368. display: flex;
  1369. flex-direction: column;
  1370. /* justify-content: right; */
  1371. // width: 59%;
  1372. float: right;
  1373. }
  1374. .rowClass {
  1375. box-shadow: inset 0px 0px 31px 1px rgba(0, 250, 253, 0.4);
  1376. border-radius: 0px 0px 0px 0px;
  1377. opacity: 1;
  1378. border: 1px solid rgba(0, 250, 253, 1);
  1379. background: #04916e;
  1380. }
  1381. .selectBox{
  1382. display: flex;
  1383. align-items: center;
  1384. justify-content: center;
  1385. }
  1386. </style>