index.vue 46 KB

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