page1.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. <!-- -->
  2. <template>
  3. <div class="inner">
  4. <div class="mapCover">
  5. <el-amap
  6. class="bm-view"
  7. vid="amapDemo"
  8. :center="center"
  9. :amap-manager="amapManager"
  10. :zoom="zoom"
  11. :plugin="plugin"
  12. :events="mapEvents"
  13. >
  14. <el-amap-marker vid="component-marker" v-if="componentMarker.position.length" :position="componentMarker.position" ></el-amap-marker>
  15. </el-amap>
  16. </div>
  17. <div class="mapTypebox">
  18. <el-radio-group v-model="mapType" @change="changeMapType">
  19. <el-radio :label="0">标准图</el-radio>
  20. <el-radio :label="1">卫星图</el-radio>
  21. </el-radio-group>
  22. </div>
  23. <!-- tabs设备类型 -->
  24. <div class="equipTypebox">
  25. <div class="equipTypeBody">
  26. <div class="equipTypeList">
  27. <div v-for="(item,index) in equipType" @click="changeEquip(index,item)" @mouseover='mouseOve(index,item)' @mouseleave='mouseOut(index,item)' :key="item.type" :class="[currSelectType==item.type?'active':'']" >{{item.name}}</div>
  28. </div>
  29. <div :style="'left:'+equipStyleLeft+'px'" class="equipHighLight"></div>
  30. </div>
  31. </div>
  32. <!-- 控制 -->
  33. <!-- <sidebar></sidebar> -->
  34. <components :is="sidebarComponents" @sidebarClear="sidebarClear()" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='queryInfo.type' :model="queryInfo.model"></components>
  35. <!-- 设备列表 -->
  36. <equip-list>
  37. <p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p>
  38. <button @click="detailsShow == 3">ceshi</button>
  39. </equip-list>
  40. <!-- 杀虫灯数据框 -->
  41. <transition
  42. enter-active-class="animate__animated animate__zoomIn"
  43. leave-active-class="animate__animated animate__rotateOut"
  44. >
  45. <dialog-box v-if="detailsShow==2" width='800'>
  46. <template v-slot:header>
  47. <span class="dialog-title">杀虫灯数据框</span>
  48. <button type="button" @click="detailsShow=''" class="dialog-headerbtn">
  49. <i class="el-icon el-icon-close"></i>
  50. </button>
  51. </template>
  52. <template v-slot:inner>
  53. <equip-info :equipId="queryInfo.equip_id" :equipType='detailsShow'>
  54. <template v-solt:equipStateInner></template>
  55. </equip-info>
  56. <div class="equipData">
  57. <div class="more" @click="lookmore()">查看更多</div>
  58. <template>
  59. <el-tabs v-model="activeName" @tab-click="tabshandleClick">
  60. <el-tab-pane
  61. v-for="(pages, index) in pages['2']"
  62. v-bind:key="index"
  63. :label="pages.label"
  64. :name="pages.name"
  65. >
  66. <!-- <keep-alive> -->
  67. <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage"></components>
  68. <!-- </keep-alive> -->
  69. </el-tab-pane>
  70. </el-tabs>
  71. </template>
  72. </div>
  73. </template>
  74. </dialog-box>
  75. </transition>
  76. <!-- 测报灯数据框 -->
  77. <transition
  78. enter-active-class="animate__animated animate__zoomIn"
  79. leave-active-class="animate__animated animate__rotateOut"
  80. >
  81. <dialog-box v-if="detailsShow==3" width='800'>
  82. <template v-slot:header>
  83. <span class="dialog-title">测报灯数据框</span>
  84. <button type="button" @click="detailsShow=''" class="dialog-headerbtn">
  85. <i class="el-icon el-icon-close"></i>
  86. </button>
  87. </template>
  88. <template v-slot:inner>
  89. <equip-info :equipId="queryInfo.equip_id" :equipType='detailsShow'>
  90. <template v-solt:equipStateInner></template>
  91. </equip-info>
  92. <div class="equipData">
  93. <div class="more" @click="lookmore()">查看更多</div>
  94. <template>
  95. <el-tabs v-model="activeName" @tab-click="tabshandleClick">
  96. <el-tab-pane
  97. v-for="(pages, index) in pages['3']"
  98. v-bind:key="index"
  99. :label="pages.label"
  100. :name="pages.name"
  101. >
  102. <keep-alive>
  103. <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage"></components>
  104. </keep-alive>
  105. </el-tab-pane>
  106. </el-tabs>
  107. </template>
  108. </div>
  109. </template>
  110. </dialog-box>
  111. </transition>
  112. <!-- 性诱设备数据框 -->
  113. <transition
  114. enter-active-class="animate__animated animate__zoomIn"
  115. leave-active-class="animate__animated animate__rotateOut"
  116. >
  117. <dialog-box v-if="detailsShow==4" width='800'>
  118. <template v-slot:header>
  119. <span class="dialog-title">性诱设备数据框</span>
  120. <button type="button" @click="detailsShow=''" class="dialog-headerbtn">
  121. <i class="el-icon el-icon-close"></i>
  122. </button>
  123. </template>
  124. <template v-slot:inner>
  125. <equip-info :equipId="queryInfo.equip_id" :equipType='detailsShow'>
  126. <template v-solt:equipStateInner></template>
  127. </equip-info>
  128. <div class="equipData">
  129. <div class="more" @click="lookmore()">查看更多</div>
  130. <template>
  131. <el-tabs v-model="activeName" @tab-click="tabshandleClick">
  132. <el-tab-pane
  133. v-for="(pages, index) in pages['4']"
  134. v-bind:key="index"
  135. :label="pages.label"
  136. :name="pages.name"
  137. >
  138. <keep-alive>
  139. <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage"></components>
  140. </keep-alive>
  141. </el-tab-pane>
  142. </el-tabs>
  143. </template>
  144. </div>
  145. </template>
  146. </dialog-box>
  147. </transition>
  148. <!-- 气象站数据框 -->
  149. <transition
  150. enter-active-class="animate__animated animate__zoomIn"
  151. leave-active-class="animate__animated animate__rotateOut"
  152. >
  153. <dialog-box v-if="detailsShow==5" width='800'>
  154. <template v-slot:header>
  155. <span class="dialog-title">气象站数据框</span>
  156. <button type="button" @click="detailsShow=''" class="dialog-headerbtn">
  157. <i class="el-icon el-icon-close"></i>
  158. </button>
  159. </template>
  160. <template v-slot:inner>
  161. <equip-info :equipId='queryInfo.equip_id' :equipType='detailsShow'>
  162. <template v-solt:equipStateInner></template>
  163. </equip-info>
  164. <div class="equipData">
  165. <div class="more" @click="lookmore()">查看更多</div>
  166. <template>
  167. <el-tabs v-model="activeName" @tab-click="tabshandleClick">
  168. <el-tab-pane
  169. v-for="(pages, index) in pages['5']"
  170. v-bind:key="index"
  171. :label="pages.label"
  172. :name="pages.name"
  173. >
  174. <keep-alive>
  175. <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage"></components>
  176. </keep-alive>
  177. </el-tab-pane>
  178. </el-tabs>
  179. </template>
  180. </div>
  181. </template>
  182. </dialog-box>
  183. </transition>
  184. <!-- 孢子仪数据框 -->
  185. <transition
  186. enter-active-class="animate__animated animate__zoomIn"
  187. leave-active-class="animate__animated animate__rotateOut"
  188. >
  189. <dialog-box v-if="detailsShow==7" width='800'>
  190. <template v-slot:header>
  191. <span class="dialog-title">孢子仪数据框</span>
  192. <button type="button" @click="detailsShow=''" class="dialog-headerbtn">
  193. <i class="el-icon el-icon-close"></i>
  194. </button>
  195. </template>
  196. <template v-slot:inner>
  197. <equip-info @child-event="setTimeDialogShow" :equipId='queryInfo.equip_id' :equipType='detailsShow'>
  198. <template v-solt:equipStateInner></template>
  199. </equip-info>
  200. <div class="equipData">
  201. <div class="more" @click="lookmore()">查看更多</div>
  202. <template>
  203. <el-tabs v-model="activeName" @tab-click="tabshandleClick">
  204. <el-tab-pane
  205. v-for="(pages, index) in pages['7']"
  206. v-bind:key="index"
  207. :label="pages.label"
  208. :name="pages.name"
  209. >
  210. <keep-alive>
  211. <components :is="pages.name" :equipId="queryInfo.equip_id" :d_id="queryInfo.d_id" :equipType='detailsShow' v-if="pages.name == nowPage"></components>
  212. </keep-alive>
  213. </el-tab-pane>
  214. </el-tabs>
  215. </template>
  216. </div>
  217. </template>
  218. </dialog-box>
  219. </transition>
  220. <!-- 设置孢子仪载玻片、培养液更换时间配置弹框 -->
  221. <el-dialog
  222. title="配置(请及时填写)"
  223. :visible.sync="setTimeDialogVisible"
  224. width="420px"
  225. >
  226. <el-form ref="form" :model="time" label-width="130px">
  227. <el-form-item label="载玻片更换时间: ">
  228. <el-date-picker
  229. v-model="time.time01"
  230. type="date"
  231. placeholder="选择日期"
  232. ></el-date-picker>
  233. </el-form-item>
  234. <el-form-item label="培养液更换时间: ">
  235. <el-date-picker
  236. v-model="time.time02"
  237. type="date"
  238. placeholder="选择日期"
  239. ></el-date-picker>
  240. </el-form-item>
  241. </el-form>
  242. <span slot="footer" class="dialog-footer">
  243. <el-button type="grayInfo" @click="setTimeDialogVisible = false">取 消</el-button>
  244. <el-button type="blueInfo" @click="setTimeSubm()">确 定</el-button>
  245. </span>
  246. </el-dialog>
  247. </div>
  248. </template>
  249. <script>
  250. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  251. //例如:import 《组件名称》 from '《组件路径》';
  252. import VueAMap from "vue-amap";
  253. let amapManager = new VueAMap.AMapManager();
  254. import sidebar from "@/components/highStand/sidebar"
  255. import equipList from "@/components/highStand/equipList"
  256. import { bd09togcj02,gcj02tobd09,wgs84togcj02,gcj02towgs84 } from "@/components/home/coordtransform_utils.js"; //纠偏方法
  257. import dialogBox from './dialogHollow' //地图镂空弹框
  258. import equipState from './equipState' //设备状态
  259. import qxzEquipState from './equipStateQxz' //气象站设备状态
  260. import equipInfo from './equipInfo' //设备基础信息
  261. import equipHistoryDate from './equipHistoryDate' //设备历史数据
  262. import qxzEquipHistoryDate from './equipHistoryDateQxz' //气象站设备历史数据
  263. import twentyFourHistoryDate from './twentyFourHistoryDate' //气象站24小时数据
  264. import cbdPhoto from './cbdPhoto/cbdPhoto' //测报灯图片
  265. export default {
  266. //import引入的组件需要注入到对象中才能使用
  267. components: {
  268. sidebar,
  269. equipList,
  270. dialogBox,
  271. equipState,
  272. qxzEquipState,
  273. equipInfo,
  274. equipHistoryDate,
  275. qxzEquipHistoryDate,
  276. twentyFourHistoryDate,
  277. cbdPhoto,
  278. },
  279. data() {
  280. //这里存放数据
  281. return {
  282. sidebarComponents:'',
  283. amapManager,
  284. center: [120.298433, 31.680335],
  285. zoom: 6,
  286. mapType: 1,
  287. plugin: [
  288. // {
  289. // pName: "ToolBar",
  290. // events: {
  291. // init(instance) {
  292. // console.log(instance);
  293. // }
  294. // }
  295. // },
  296. {
  297. pName: "Scale",
  298. events: {
  299. init(instance) {
  300. console.log(instance);
  301. }
  302. }
  303. }
  304. // {
  305. // pName: 'MapType',
  306. // defaultType: 0,
  307. // events: {
  308. // init(instance) {
  309. // console.log(instance);
  310. // }
  311. // }
  312. // }
  313. ],
  314. componentMarker: {
  315. position: []
  316. },
  317. infoWindow: null,
  318. xyzTileLayer: null,
  319. xyzTileLayer2: null,
  320. mapEvents: {
  321. init: o => {
  322. this.xyzTileLayer = new AMap.TileLayer({
  323. // 图块取图地址
  324. getTileUrl:
  325. "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=img_w&tk=888bc7de1a5f14aa1b335b02e558d9b3&x=[x]&y=[y]&l=[z]",
  326. zIndex: 100
  327. });
  328. this.xyzTileLayer2 = new AMap.TileLayer({
  329. // 图块取图地址
  330. getTileUrl:
  331. "http://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?T=cta_w&tk=888bc7de1a5f14aa1b335b02e558d9b3&x=[x]&y=[y]&l=[z]",
  332. zIndex: 101
  333. });
  334. o.add(this.xyzTileLayer);
  335. o.add(this.xyzTileLayer2);
  336. }
  337. },
  338. // tabs导航
  339. equipType:[
  340. {
  341. type:'',
  342. name:"全部",
  343. },
  344. {
  345. type:7,
  346. name:"孢子仪",
  347. },
  348. {
  349. type:6,
  350. name:"监控",
  351. },
  352. {
  353. type:5,
  354. name:"环境监测",
  355. },
  356. {
  357. type:4,
  358. name:"性诱设备",
  359. },
  360. {
  361. type:3,
  362. name:"虫情测报",
  363. },
  364. {
  365. type:2,
  366. name:"杀虫灯"
  367. },
  368. ],
  369. currSelectType:0,
  370. currSelectSite:0,
  371. equipStyleLeft:0,
  372. // 海量点样式表
  373. equipPoints:[],
  374. massMarks:null,
  375. geocoder:null,
  376. equipStyleObject:[
  377. {
  378. url: require("@/assets/images/home/mapView/scd.png"), // 设别类型0
  379. size: new AMap.Size(25, 15), // 图标大小
  380. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  381. },
  382. {
  383. url: require("@/assets/images/home/mapView/scd.png"), // 设别类型1
  384. size: new AMap.Size(25, 15), // 图标大小
  385. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  386. },
  387. {
  388. url: require("@/assets/images/home/mapView/scd.png"), // 设别类型2
  389. size: new AMap.Size(25, 15), // 图标大小
  390. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  391. },
  392. {
  393. url: require("@/assets/images/home/mapView/cbd.png"), // 设别类型3
  394. size: new AMap.Size(25, 15), // 图标大小
  395. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  396. },
  397. {
  398. url: require("@/assets/images/home/mapView/xyq.png"), // 设别类型4
  399. size: new AMap.Size(25, 15), // 图标大小
  400. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  401. },
  402. {
  403. url: require("@/assets/images/home/mapView/qxz.png"), // 设别类型5
  404. size: new AMap.Size(25, 15), // 图标大小
  405. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  406. },
  407. {
  408. url: require("@/assets/images/home/mapView/jk.png"), // 设别类型6
  409. size: new AMap.Size(25, 15), // 图标大小
  410. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  411. },
  412. {
  413. url: require("@/assets/images/home/mapView/bzy.png"), // 设别类型7
  414. size: new AMap.Size(25, 15), // 图标大小
  415. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  416. },
  417. {
  418. url: require("@/assets/images/home/mapView/bzy.png"), // 设别类型8
  419. size: new AMap.Size(25, 15), // 图标大小
  420. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  421. },
  422. {
  423. url: require("@/assets/images/home/mapView/tccb.png"), // 设别类型9
  424. size: new AMap.Size(25, 15), // 图标大小
  425. anchor: new AMap.Pixel(5, 5) // 图标显示位置偏移量,基准点为图标左上角
  426. },
  427. ],
  428. queryInfo:{
  429. equip_id:"",
  430. d_id:"",
  431. type:"",
  432. model:""
  433. },
  434. // 信息弹框
  435. detailsShow:false,
  436. // 孢子仪弹框
  437. setTimeDialogVisible:false,
  438. time:{
  439. time01:"",
  440. time02:"",
  441. },
  442. // 孢子仪配置载玻片时间did
  443. currbzyGlass:"",
  444. // 设备tabs标签
  445. activeName: "equipState",
  446. nowPage: "equipState",
  447. pages:{
  448. "2":[{
  449. name:"equipState",
  450. label:"实时状态",
  451. },{
  452. name:"equipHistoryDate",
  453. label:"历史数据",
  454. }],
  455. "3":[{
  456. name:"equipState",
  457. label:"实时状态",
  458. },
  459. {
  460. name:"cbdPhoto",
  461. label:"查看图片",
  462. },
  463. {
  464. name:"equipHistoryDate",
  465. label:"历史数据",
  466. },
  467. // {
  468. // name:"equipState",
  469. // label:"害虫统计",
  470. // }
  471. ],
  472. "4":[{
  473. name:"equipState",
  474. label:"实时状态",
  475. },{
  476. name:"equipHistoryDate",
  477. label:"历史数据",
  478. }],
  479. "5":[{
  480. name:"qxzEquipState",
  481. label:"实时状态",
  482. },{
  483. name:"twentyFourHistoryDate",
  484. label:"24小时数据",
  485. },{
  486. name:"qxzEquipHistoryDate",
  487. label:"历史数据",
  488. }],
  489. "7":[{
  490. name:"equipState",
  491. label:"实时状态",
  492. },{
  493. name:"equipHistoryDate",
  494. label:"历史数据",
  495. }],
  496. },
  497. // 右侧控制
  498. sidebarState:false,
  499. };
  500. },
  501. //监听属性 类似于data概念
  502. computed: {},
  503. //监控data中的数据变化
  504. watch: {},
  505. //方法集合
  506. methods: {
  507. changeMapType(val){
  508. let o = amapManager.getMap();
  509. if(val==0){
  510. this.xyzTileLayer.hide()
  511. this.xyzTileLayer2.hide()
  512. }else{
  513. this.xyzTileLayer.show()
  514. this.xyzTileLayer2.show()
  515. }
  516. },
  517. changeEquip(index,item){
  518. this.currSelectType = item.type;
  519. this.currSelectSite = index;
  520. this.detailsShow = ''
  521. this.getEquipList(item.type)
  522. console.log(item.type);
  523. this.activeName = this.pages[item.type][0].name
  524. this.nowPage = this.pages[item.type][0].name
  525. },
  526. mouseOve(index,item){
  527. this.equipStyleLeft = 80*index
  528. },
  529. mouseOut(index,item){
  530. if(item.type!=this.currSelectType){
  531. this.equipStyleLeft = 80*this.currSelectSite
  532. }
  533. },
  534. iconFormat(equip_ip, item) {
  535. switch (equip_ip + "") {
  536. case "2":
  537. item.icon = require("@/assets/images/home/mapView/scd.png");
  538. break;
  539. case "3":
  540. item.icon = require("@/assets/images/home/mapView/cbd.png");
  541. break;
  542. case "4":
  543. item.icon = require("@/assets/images/home/mapView/xyq.png");
  544. break;
  545. case "5":
  546. item.icon = require("@/assets/images/home/mapView/qxz.png");
  547. break;
  548. case "6":
  549. item.icon = require("@/assets/images/home/mapView/jk.png");
  550. break;
  551. case "7":
  552. item.icon = require("@/assets/images/home/mapView/bzy.png");
  553. break;
  554. case "9":
  555. item.icon = require("@/assets/images/home/mapView/tccb.png");
  556. break;
  557. }
  558. },
  559. getEquipList(type) {
  560. this.componentMarker.position = []
  561. if(this.infoWindow){
  562. this.infoWindow.close()
  563. }
  564. let o = amapManager.getMap();
  565. o.setZoom(4);
  566. this.$axios({
  567. method: "POST",
  568. url: "/api/api_gateway?method=home.homes.equip_map_location",
  569. data: this.qs.stringify({
  570. equip_type: type,
  571. })
  572. }).then(res => {
  573. if (res.data.message == "") {
  574. let data = res.data.data;
  575. this.equipShow = false;
  576. this.equips = data.map(item => {
  577. this.iconFormat(item.device_type_id, item);
  578. item.style = item.device_type_id
  579. if(item.gps_type == 1){ //GPS
  580. console.log(wgs84togcj02)
  581. item.lnglat = wgs84togcj02(item.lng,item.lat)
  582. }else{
  583. // this.lnglatFormat(item);
  584. }
  585. return item;
  586. });
  587. if(this.massMarks){
  588. this.massMarks.clear()
  589. }
  590. console.log(this.equips)
  591. this.massMarks = new AMap.MassMarks(this.equips, {
  592. zIndex: 199, // 海量点图层叠加的顺序
  593. zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层
  594. style: this.equipStyleObject // 设置样式对象
  595. });
  596. this.massMarks.setMap(o)
  597. var _this = this
  598. this.massMarks.on('click',e =>{
  599. this.equipMarkerClick(e.data)
  600. // this.openInfo(e.data)
  601. console.log(e.data)
  602. })
  603. // this.equipPoints = []
  604. // this.equips.forEach((item) =>{
  605. // this.equipPoints.push(new AMap.Marker({
  606. // position: item.lnglat
  607. // }))
  608. // })
  609. // this.$nextTick(()=>{
  610. // o.setFitView(this.equipPoints)
  611. // })
  612. } else {
  613. this.$message.error(res.data.message);
  614. }
  615. });
  616. },
  617. equipMarkerClick(item) {
  618. this.equipShow = true; //图标上设备信息框
  619. this.equipsVisible = true; //右侧设备弹框
  620. this.detailsShow = item.device_type_id; //右侧弹框根据不同设备类型,显示设备信息
  621. this.currEquip = item;
  622. this.queryInfo.equip_id = item.device_id
  623. this.queryInfo.d_id = item.d_id
  624. this.queryInfo.type = item.device_type_id
  625. this.queryInfo.model = item.device_model
  626. this.sidebarComponents = "" //siderbar为空
  627. },
  628. //载玻片、培养液更换时间展示
  629. setTimeDialogShow(data){
  630. this.setTimeDialogVisible = true;
  631. this.time.time01 = data.glass
  632. this.time.time02 = data.cultivate
  633. this.currbzyGlass = data.d_id
  634. },
  635. //载玻片、培养液更换时间配置提交
  636. setTimeSubm() {
  637. let glass_slide_time = parseInt(
  638. new Date(this.time.time01).getTime() / 1000
  639. );
  640. let cultivate_time = parseInt(
  641. new Date(this.time.time02).getTime() / 1000
  642. );
  643. this.$axios({
  644. method: "POST",
  645. url: "/api/api_gateway?method=device.device_manage.updata_spore_time",
  646. data: this.qs.stringify({
  647. device_type_id: 7,
  648. d_id: this.currbzyGlass,
  649. glass_slide_time,
  650. cultivate_time,
  651. }),
  652. }).then((res) => {
  653. if (res.data.message == "") {
  654. this.$message.success("修改成功!");
  655. } else {
  656. this.$message.error(res.data.message);
  657. }
  658. this.setTimeDialogVisible = false;
  659. });
  660. },
  661. //tabs每次切换只渲染一个界面
  662. tabshandleClick(tab) {
  663. this.nowPage = tab.name;
  664. },
  665. // 查看更多控制
  666. lookmore(){
  667. this.sidebarComponents = 'sidebar'
  668. this.detailsShow=""
  669. },
  670. // 注销控制组件
  671. sidebarClear(val){
  672. this.sidebarComponents = ''
  673. },
  674. },
  675. //生命周期 - 创建完成(可以访问当前this实例)
  676. created() {},
  677. //生命周期 - 挂载完成(可以访问DOM元素)
  678. mounted() {
  679. // this.getEquipList('')
  680. },
  681. beforeCreate() {}, //生命周期 - 创建之前
  682. beforeMount() {}, //生命周期 - 挂载之前
  683. beforeUpdate() {}, //生命周期 - 更新之前
  684. updated() {}, //生命周期 - 更新之后
  685. beforeDestroy() {}, //生命周期 - 销毁之前
  686. destroyed() {}, //生命周期 - 销毁完成
  687. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  688. };
  689. </script>
  690. <style scoped lang="less">
  691. .inner{
  692. height: 100%;
  693. position: relative;
  694. .mapCover{
  695. height: 100%;
  696. }
  697. .mapTypebox{
  698. position: absolute;
  699. right: 20px;
  700. top:30px;
  701. background: #fff;
  702. padding: 5px;
  703. border-radius: 5px;
  704. }
  705. }
  706. // tabs设备类型
  707. .equipTypebox{
  708. position: absolute;
  709. left: 20px;
  710. top:30px;
  711. // background: #fff;
  712. line-height: 32px;
  713. border-radius: 20px;
  714. .equipTypeBody{
  715. position: relative;
  716. z-index: 10;
  717. background: #262a31;
  718. border-radius: 43px;
  719. color: #fff;
  720. .equipTypeList{
  721. position: relative;
  722. z-index: 1;
  723. display: flex;
  724. justify-content: space-around;
  725. align-items: center;
  726. >div{
  727. width: 80px;
  728. text-align: center;
  729. border-radius: 20px;
  730. cursor: pointer;
  731. }
  732. >div.active{
  733. // background: #0195ff;
  734. // color:#eee;
  735. }
  736. >div:hover{
  737. // color: #eee;
  738. }
  739. }
  740. .equipHighLight{
  741. position: absolute;
  742. top: 0;
  743. height: 32px;
  744. width: 80px;
  745. border-radius: 20px;
  746. background: #0195ff;
  747. z-index: 0;
  748. transition: all 1s;
  749. }
  750. }
  751. }
  752. // 设备数据样式
  753. .equipData{
  754. padding-top: 10px;
  755. position: relative;
  756. .more{
  757. position: absolute;
  758. right: 5px;
  759. top: 20px;
  760. z-index: 9999;
  761. cursor: pointer;
  762. }
  763. .more:hover{
  764. color: #0195ff;
  765. }
  766. }
  767. // 弹框tabs样式覆盖
  768. /deep/.el-tabs__active-bar{
  769. background-color: #0295ff;
  770. }
  771. </style>