resource.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. <template>
  2. <div id="resource">
  3. <el-row>
  4. <el-col :span="24">
  5. <div id="container">
  6. <!-- 自定义列表 -->
  7. <div style="width:200px" class="menus">
  8. <el-menu @select="typeSelect">
  9. <el-submenu index="1">
  10. <template #title>
  11. <span>科技部门</span>
  12. </template>
  13. <el-menu-item index="1-1">科技部门</el-menu-item>
  14. <!-- <el-menu-item-group>
  15. <el-submenu index="1-1">
  16. <template #title>
  17. <span>科技部门</span>
  18. </template>
  19. <el-menu-item index="1-1-1">力旺系</el-menu-item>
  20. <el-menu-item index="1-2-2">南湖系</el-menu-item>
  21. </el-submenu>
  22. </el-menu-item-group> -->
  23. </el-submenu>
  24. <el-submenu index="2">
  25. <template #title>
  26. <span>科研院所</span>
  27. </template>
  28. <el-menu-item-group>
  29. <el-submenu index="2-1">
  30. <template #title>
  31. <span>科研院所</span>
  32. </template>
  33. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  34. </el-submenu>
  35. </el-menu-item-group>
  36. </el-submenu>
  37. <el-submenu index="3">
  38. <template #title>
  39. <span>大专院校</span>
  40. </template>
  41. <el-menu-item-group>
  42. <el-submenu index="3-1">
  43. <template #title>
  44. <span>大专院校</span>
  45. </template>
  46. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  47. </el-submenu>
  48. </el-menu-item-group>
  49. </el-submenu>
  50. <el-submenu index="4">
  51. <template #title>
  52. <span>科技企业</span>
  53. </template>
  54. <el-menu-item-group>
  55. <el-submenu index="4-1">
  56. <template #title>
  57. <span>高新技术企业</span>
  58. </template>
  59. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  60. </el-submenu>
  61. <el-submenu index="4-2">
  62. <template #title>
  63. <span>创新型企业</span>
  64. </template>
  65. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  66. </el-submenu>
  67. <!-- <el-submenu index="4-3">
  68. <template #title>
  69. <span>科技小巨人</span>
  70. </template>
  71. </el-submenu> -->
  72. </el-menu-item-group>
  73. </el-submenu>
  74. <el-submenu index="5">
  75. <template #title>
  76. <span>条件平台</span>
  77. </template>
  78. <el-menu-item-group>
  79. <el-submenu index="5-1">
  80. <template #title>
  81. <span>重点实验室</span>
  82. </template>
  83. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  84. </el-submenu>
  85. <el-submenu index="5-2">
  86. <template #title>
  87. <span>工程技术研究中心</span>
  88. </template>
  89. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  90. </el-submenu>
  91. <el-submenu index="5-3">
  92. <template #title>
  93. <span>大学科技园</span>
  94. </template>
  95. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  96. </el-submenu>
  97. <el-submenu index="5-4">
  98. <template #title>
  99. <span>科技企业孵化器</span>
  100. </template>
  101. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  102. </el-submenu>
  103. <el-submenu index="5-5">
  104. <template #title>
  105. <span>产业化基地</span>
  106. </template>
  107. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  108. </el-submenu>
  109. <el-submenu index="5-6">
  110. <template #title>
  111. <span>技术转移示范机构</span>
  112. </template>
  113. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  114. </el-submenu>
  115. <el-submenu index="5-7">
  116. <template #title>
  117. <span>科技合作基地</span>
  118. </template>
  119. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  120. </el-submenu>
  121. <el-submenu index="5-8">
  122. <template #title>
  123. <span>院士工作站</span>
  124. </template>
  125. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  126. </el-submenu>
  127. <el-submenu index="5-9">
  128. <template #title>
  129. <span>技术创新联盟</span>
  130. </template>
  131. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  132. </el-submenu>
  133. <el-submenu index="5-10">
  134. <template #title>
  135. <span>科技创新中心</span>
  136. </template>
  137. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  138. </el-submenu>
  139. <el-submenu index="5-11">
  140. <template #title>
  141. <span>科技成果转化中试中心</span>
  142. </template>
  143. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  144. </el-submenu>
  145. </el-menu-item-group>
  146. </el-submenu>
  147. <el-submenu index="6">
  148. <template #title>
  149. <span>服务机构(科技)</span>
  150. </template>
  151. <el-menu-item-group>
  152. <el-submenu index="6-1">
  153. <template #title>
  154. <span>生产力促进中心</span>
  155. </template>
  156. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  157. </el-submenu>
  158. <el-submenu index="6-2">
  159. <template #title>
  160. <span>技术合同登记点</span>
  161. </template>
  162. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  163. </el-submenu>
  164. <el-submenu index="6-3">
  165. <template #title>
  166. <span>技术大市场</span>
  167. </template>
  168. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  169. </el-submenu>
  170. <el-submenu index="6-4">
  171. <template #title>
  172. <span>科技成功评价试点</span>
  173. </template>
  174. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  175. </el-submenu>
  176. </el-menu-item-group>
  177. </el-submenu>
  178. <el-submenu index="7">
  179. <template #title>
  180. <span>重大项目</span>
  181. </template>
  182. <el-menu-item-group>
  183. <el-submenu index="7-1">
  184. <template #title>
  185. <span>重大项目</span>
  186. </template>
  187. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  188. </el-submenu>
  189. </el-menu-item-group>
  190. </el-submenu>
  191. <el-submenu index="8">
  192. <template #title>
  193. <span>科技奖励</span>
  194. </template>
  195. <el-menu-item-group>
  196. <el-submenu index="8-1">
  197. <template #title>
  198. <span>科技奖励</span>
  199. </template>
  200. <!-- <el-menu-item index="2-1-1">农大系</el-menu-item> -->
  201. </el-submenu>
  202. </el-menu-item-group>
  203. </el-submenu>
  204. </el-menu>
  205. </div>
  206. <!-- 搜索框 -->
  207. <el-amap-search-box class="search-box" :search-option="searchOption" :on-search-result="onSearchResult"></el-amap-search-box>
  208. <el-amap class="amap-box" :vid="'amap-vue'" :zoom="zoom" :center="center" :plugin="plugin">
  209. <!-- mark上方文字 -->
  210. <el-amap-text v-for="(t, index) in marktext" :key="`text${index}`" :text="t.text" :offset="[0, -50]" :position="t.position"></el-amap-text>
  211. <!-- 标记 -->
  212. <el-amap-marker
  213. v-for="(i, index) in markers"
  214. :key="`mark${index}`"
  215. :position="i.position"
  216. :events="i.events"
  217. :title="i.title"
  218. :address="i.address"
  219. :vid="index"
  220. ></el-amap-marker>
  221. <!-- 信息框体 -->
  222. <el-amap-info-window :position="window.position" :visible="window.visible" :events="window.events" :autoMove="true">
  223. <el-row>
  224. <el-col :span="24">
  225. <el-link type="primary">标题:{{ windowInfo.title }}</el-link>
  226. </el-col>
  227. <el-col :span="24">图片:{{ windowInfo.pic }}</el-col>
  228. <el-col :span="24">地址:{{ windowInfo.address }}</el-col>
  229. </el-row>
  230. </el-amap-info-window>
  231. </el-amap>
  232. </div>
  233. </el-col>
  234. </el-row>
  235. </div>
  236. </template>
  237. <script>
  238. const _ = require('lodash');
  239. import { mapState, createNamespacedHelpers } from 'vuex';
  240. import VueAMap from 'vue-amap';
  241. import Vue from 'vue';
  242. Vue.use(VueAMap);
  243. export default {
  244. metaInfo() {
  245. return { title: this.$route.meta.title };
  246. },
  247. name: 'resource',
  248. props: {},
  249. components: {},
  250. data: function() {
  251. return {
  252. zoom: '17',
  253. center: [125.291162, 43.838597], //初始定位到中心
  254. // 标记点列表
  255. markers: [],
  256. // 标记点提示
  257. marktext: [],
  258. // 窗体信息
  259. window: {
  260. position: [125.291162, 43.838597],
  261. visible: false,
  262. },
  263. windowInfo: { name: 'an', pic: 'pic' },
  264. // 搜索框
  265. searchOption: {
  266. city: '长春',
  267. citylimit: true,
  268. },
  269. // 插件
  270. plugin: [
  271. {
  272. pName: 'Scale',
  273. events: {
  274. init(instance) {},
  275. },
  276. },
  277. ],
  278. // 数据
  279. list: [
  280. {
  281. id: 'B0FFGY6JEE',
  282. name: '力旺广场',
  283. type: '购物服务;商场;普通商场',
  284. location: { Q: 43.840745, R: 125.290821, lng: 125.290821, lat: 43.840745 },
  285. address: '前进大街旁',
  286. tel: '0431-81338098',
  287. distance: '__vue_devtool_nan__',
  288. shopinfo: '0',
  289. lat: 43.840745,
  290. lng: 125.290821,
  291. },
  292. {
  293. id: 'B0FFH2A0ZH',
  294. name: '力旺广场B座',
  295. type: '商务住宅;楼宇;商务写字楼',
  296. location: { Q: 43.840772, R: 125.29062299999998, lng: 125.290623, lat: 43.840772 },
  297. address: '前进大街996号力旺广场',
  298. tel: '0431-81296666',
  299. distance: '__vue_devtool_nan__',
  300. shopinfo: '0',
  301. lat: 43.840772,
  302. lng: 125.290623,
  303. },
  304. {
  305. id: 'B0FFH62X6K',
  306. name: '力旺广场',
  307. type: '风景名胜;公园广场;公园广场',
  308. location: { Q: 43.942781, R: 125.36932200000001, lng: 125.369322, lat: 43.942781 },
  309. address: '金钱路力旺康城1期',
  310. tel: '',
  311. distance: '__vue_devtool_nan__',
  312. shopinfo: '2',
  313. lat: 43.942781,
  314. lng: 125.369322,
  315. },
  316. {
  317. id: 'B0FFH29EHL',
  318. name: '力旺广场写字楼C栋',
  319. type: '商务住宅;楼宇;商务写字楼',
  320. location: { Q: 43.840163, R: 125.29054100000002, lng: 125.290541, lat: 43.840163 },
  321. address: '前进大街996号力旺广场',
  322. tel: '',
  323. distance: '__vue_devtool_nan__',
  324. shopinfo: '0',
  325. lat: 43.840163,
  326. lng: 125.290541,
  327. },
  328. {
  329. id: 'B0FFL7FPXU',
  330. name: '力旺广场(1号门)',
  331. type: '通行设施;临街院门;临街院门',
  332. location: { Q: 43.84039, R: 125.29037, lng: 125.29037, lat: 43.84039 },
  333. address: '前进大街996号',
  334. tel: '',
  335. distance: '__vue_devtool_nan__',
  336. shopinfo: '2',
  337. lat: 43.84039,
  338. lng: 125.29037,
  339. },
  340. {
  341. id: 'B0FFHZXXDI',
  342. name: '力旺广场(西门)',
  343. type: '通行设施;临街院门;临街院门',
  344. location: { Q: 43.84208, R: 125.29029200000002, lng: 125.290292, lat: 43.84208 },
  345. address: '前进大街990号附近',
  346. tel: '',
  347. distance: '__vue_devtool_nan__',
  348. shopinfo: '2',
  349. lat: 43.84208,
  350. lng: 125.290292,
  351. },
  352. {
  353. id: 'B0FFM88ZHZ',
  354. name: '力旺广场(3号门)',
  355. type: '通行设施;临街院门;临街院门',
  356. location: { Q: 43.840071, R: 125.29147, lng: 125.29147, lat: 43.840071 },
  357. address: '前进大街996号',
  358. tel: '',
  359. distance: '__vue_devtool_nan__',
  360. shopinfo: '2',
  361. lat: 43.840071,
  362. lng: 125.29147,
  363. },
  364. {
  365. id: 'B0FFLD96C2',
  366. name: '力旺广场(3A号门)',
  367. type: '通行设施;临街院门;临街院门',
  368. location: { Q: 43.840601, R: 125.29088999999999, lng: 125.29089, lat: 43.840601 },
  369. address: '前进大街996号',
  370. tel: '',
  371. distance: '__vue_devtool_nan__',
  372. shopinfo: '2',
  373. lat: 43.840601,
  374. lng: 125.29089,
  375. },
  376. {
  377. id: 'B0FFIR6YOH',
  378. name: '力旺广场A座',
  379. type: '商务住宅;商务住宅相关;商务住宅相关',
  380. location: { Q: 43.841961, R: 125.29061100000001, lng: 125.290611, lat: 43.841961 },
  381. address: '前进大街996号力旺广场',
  382. tel: '',
  383. distance: '__vue_devtool_nan__',
  384. shopinfo: '0',
  385. lat: 43.841961,
  386. lng: 125.290611,
  387. },
  388. {
  389. id: 'B0FFIR6YOB',
  390. name: '力旺广场D座',
  391. type: '商务住宅;商务住宅相关;商务住宅相关',
  392. location: { Q: 43.840163, R: 125.29054200000002, lng: 125.290542, lat: 43.840163 },
  393. address: '前进大街996号力旺广场d栋',
  394. tel: '',
  395. distance: '__vue_devtool_nan__',
  396. shopinfo: '0',
  397. lat: 43.840163,
  398. lng: 125.290542,
  399. },
  400. ],
  401. list2: [
  402. {
  403. id: 'B01AF07OT6',
  404. name: '南湖公园',
  405. type: '风景名胜;公园广场;公园',
  406. location: { Q: 43.856452, R: 125.30678899999998, lng: 125.306789, lat: 43.856452 },
  407. address: '工农大路2715号',
  408. tel: '0431-85663059;0431-85664455',
  409. distance: '__vue_devtool_nan__',
  410. shopinfo: '2',
  411. lat: 43.856452,
  412. lng: 125.306789,
  413. },
  414. {
  415. id: 'BV10111530',
  416. name: '南湖公园(公交站)',
  417. type: '交通设施服务;公交车站;公交车站相关',
  418. location: { Q: 43.859222, R: 125.31698599999999, lng: 125.316986, lat: 43.859222 },
  419. address: '232路;270路;277路;315路;62路',
  420. tel: '',
  421. distance: '__vue_devtool_nan__',
  422. shopinfo: '2',
  423. lat: 43.859222,
  424. lng: 125.316986,
  425. },
  426. {
  427. id: 'B01AF02511',
  428. name: '南湖公园-长春解放纪念碑',
  429. type: '风景名胜;风景名胜;风景名胜',
  430. location: { Q: 43.862086, R: 125.30811299999999, lng: 125.308113, lat: 43.862086 },
  431. address: '工农大路51号南湖公园(近建昌街)',
  432. tel: '0431-85664455',
  433. distance: '__vue_devtool_nan__',
  434. shopinfo: '2',
  435. lat: 43.862086,
  436. lng: 125.308113,
  437. },
  438. {
  439. id: 'B01AF0CKC8',
  440. name: '南湖公园(3号门)',
  441. type: '通行设施;临街院门;临街院门',
  442. location: { Q: 43.862941, R: 125.30814399999997, lng: 125.308144, lat: 43.862941 },
  443. address: '工农大路51号南湖公园附近',
  444. tel: '',
  445. distance: '__vue_devtool_nan__',
  446. shopinfo: '2',
  447. lat: 43.862941,
  448. lng: 125.308144,
  449. },
  450. {
  451. id: 'B01AF0B6EB',
  452. name: '南湖公园-沙滩浴场',
  453. type: '体育休闲服务;运动场馆;海滨浴场',
  454. location: { Q: 43.852974, R: 125.31971099999998, lng: 125.319711, lat: 43.852974 },
  455. address: '工农大路与昂昂溪路交汇处西100米',
  456. tel: '',
  457. distance: '__vue_devtool_nan__',
  458. shopinfo: '0',
  459. lat: 43.852974,
  460. lng: 125.319711,
  461. },
  462. {
  463. id: 'B0FFFRCYR9',
  464. name: '南湖公园-荷花池',
  465. type: '风景名胜;风景名胜相关;旅游景点',
  466. location: { Q: 43.859825, R: 125.30918099999997, lng: 125.309181, lat: 43.859825 },
  467. address: '南湖公园内',
  468. tel: '',
  469. distance: '__vue_devtool_nan__',
  470. shopinfo: '2',
  471. lat: 43.859825,
  472. lng: 125.309181,
  473. },
  474. {
  475. id: 'B0FFFTN0A1',
  476. name: '南湖公园(南3门)',
  477. type: '通行设施;临街院门;临街院门',
  478. location: { Q: 43.850824, R: 125.293613, lng: 125.293613, lat: 43.850824 },
  479. address: '南湖大路南湖公园',
  480. tel: '',
  481. distance: '__vue_devtool_nan__',
  482. shopinfo: '2',
  483. lat: 43.850824,
  484. lng: 125.293613,
  485. },
  486. {
  487. id: 'B0FFIC9UPB',
  488. name: '南湖公园(南1号门)',
  489. type: '通行设施;临街院门;临街院门',
  490. location: { Q: 43.851119, R: 125.31657200000001, lng: 125.316572, lat: 43.851119 },
  491. address: '南湖大路南湖大桥东',
  492. tel: '',
  493. distance: '__vue_devtool_nan__',
  494. shopinfo: '2',
  495. lat: 43.851119,
  496. lng: 125.316572,
  497. },
  498. {
  499. id: 'B0FFJO7O4R',
  500. name: '南湖公园(西北5门)',
  501. type: '通行设施;临街院门;临街院门',
  502. location: { Q: 43.862738, R: 125.30659100000003, lng: 125.306591, lat: 43.862738 },
  503. address: '工农大路2715号',
  504. tel: '',
  505. distance: '__vue_devtool_nan__',
  506. shopinfo: '2',
  507. lat: 43.862738,
  508. lng: 125.306591,
  509. },
  510. {
  511. id: 'B0FFH2ITPR',
  512. name: '南湖公园(东北1门)',
  513. type: '通行设施;临街院门;临街院门',
  514. location: { Q: 43.858587, R: 125.31510400000002, lng: 125.315104, lat: 43.858587 },
  515. address: '同志街与工农大路交叉口西北100米',
  516. tel: '',
  517. distance: '__vue_devtool_nan__',
  518. shopinfo: '2',
  519. lat: 43.858587,
  520. lng: 125.315104,
  521. },
  522. ],
  523. list3: [
  524. {
  525. id: 'B01AF09G3A',
  526. name: '吉林农业大学',
  527. type: '科教文化服务;学校;高等院校',
  528. location: { Q: 43.809821, R: 125.41048699999999, lng: 125.410487, lat: 43.809821 },
  529. address: '新城大街2888号',
  530. tel: '0431-84533101;0431-84532980;0431-84532983',
  531. distance: '__vue_devtool_nan__',
  532. shopinfo: '0',
  533. lat: 43.809821,
  534. lng: 125.410487,
  535. },
  536. {
  537. id: 'BV10110500',
  538. name: '农大(公交站)',
  539. type: '交通设施服务;公交车站;公交车站相关',
  540. location: { Q: 43.816765, R: 125.40742499999999, lng: 125.407425, lat: 43.816765 },
  541. address: '341路;349路',
  542. tel: '',
  543. distance: '__vue_devtool_nan__',
  544. shopinfo: '2',
  545. lat: 43.816765,
  546. lng: 125.407425,
  547. },
  548. {
  549. id: 'BV10110589',
  550. name: '吉林农大(公交站)',
  551. type: '交通设施服务;公交车站;公交车站相关',
  552. location: { Q: 43.816803, R: 125.40744000000001, lng: 125.40744, lat: 43.816803 },
  553. address: '103路;115路;341路;342路;343路;345路;346路;348路;349路;350路',
  554. tel: '',
  555. distance: '__vue_devtool_nan__',
  556. shopinfo: '2',
  557. lat: 43.816803,
  558. lng: 125.40744,
  559. },
  560. {
  561. id: 'B0FFH2KIYR',
  562. name: '农大社区',
  563. type: '商务住宅;住宅区;住宅小区',
  564. location: { Q: 43.817344, R: 125.41352699999999, lng: 125.413527, lat: 43.817344 },
  565. address: '净月旅游开发区新城大街与博学路交汇',
  566. tel: '13179045829',
  567. distance: '__vue_devtool_nan__',
  568. shopinfo: '0',
  569. lat: 43.817344,
  570. lng: 125.413527,
  571. },
  572. {
  573. id: 'B0FFKDO9ZT',
  574. name: '农大老区',
  575. type: '商务住宅;住宅区;住宅小区',
  576. location: { Q: 43.817121, R: 125.41370599999999, lng: 125.413706, lat: 43.817121 },
  577. address: '净月旅游开发区',
  578. tel: '',
  579. distance: '__vue_devtool_nan__',
  580. shopinfo: '0',
  581. lat: 43.817121,
  582. lng: 125.413706,
  583. },
  584. {
  585. id: 'BV10454240',
  586. name: '农大宿舍(公交站)',
  587. type: '交通设施服务;公交车站;公交车站相关',
  588. location: { Q: 43.820824, R: 125.41961700000002, lng: 125.419617, lat: 43.820824 },
  589. address: '158路东环',
  590. tel: '',
  591. distance: '__vue_devtool_nan__',
  592. shopinfo: '2',
  593. lat: 43.820824,
  594. lng: 125.419617,
  595. },
  596. {
  597. id: 'B0FFFGXVEZ',
  598. name: '君安驾校农大直属分校',
  599. type: '科教文化服务;驾校;驾校',
  600. location: { Q: 43.821857, R: 125.41017499999998, lng: 125.410175, lat: 43.821857 },
  601. address: '新城大街1888号',
  602. tel: '',
  603. distance: '__vue_devtool_nan__',
  604. shopinfo: '1',
  605. lat: 43.821857,
  606. lng: 125.410175,
  607. },
  608. {
  609. id: 'B0FFLC02A9',
  610. name: '农大老区42号楼双凤学堂',
  611. type: '科教文化服务;科教文化场所;科教文化场所',
  612. location: { Q: 43.818345, R: 125.41272200000003, lng: 125.412722, lat: 43.818345 },
  613. address: '紫薇街',
  614. tel: '',
  615. distance: '__vue_devtool_nan__',
  616. shopinfo: '0',
  617. lat: 43.818345,
  618. lng: 125.412722,
  619. },
  620. {
  621. id: 'B0FFH6FRPL',
  622. name: '永兴街道办事处农大社区党校',
  623. type: '科教文化服务;学校;学校',
  624. location: { Q: 43.818295, R: 125.41407500000003, lng: 125.414075, lat: 43.818295 },
  625. address: '博学路南200米',
  626. tel: '',
  627. distance: '__vue_devtool_nan__',
  628. shopinfo: '0',
  629. lat: 43.818295,
  630. lng: 125.414075,
  631. },
  632. {
  633. id: 'B01AF0ZQXP',
  634. name: '吉林农业大学教学科研基地',
  635. type: '科教文化服务;科研机构;科研机构',
  636. location: { Q: 43.816967, R: 125.406455, lng: 125.406455, lat: 43.816967 },
  637. address: '新城大街2555号',
  638. tel: '',
  639. distance: '__vue_devtool_nan__',
  640. shopinfo: '0',
  641. lat: 43.816967,
  642. lng: 125.406455,
  643. },
  644. ],
  645. };
  646. },
  647. created() {
  648. this.handlemyMapFn();
  649. },
  650. methods: {
  651. // 搜索框回调
  652. onSearchResult(pois) {
  653. let latSum = 0;
  654. let lngSum = 0;
  655. if (pois.length > 0) {
  656. // 只处理第一个结果了
  657. const r = this.setMark(_.head(pois));
  658. const { position } = r;
  659. this.center = position;
  660. }
  661. },
  662. // 添加标记
  663. setMark(place) {
  664. let name = _.get(place, 'name');
  665. let address = _.get(place, 'address');
  666. let lng = _.get(place, 'lng');
  667. let lat = _.get(place, 'lat');
  668. let position = [lng, lat];
  669. let obj = {
  670. position: position,
  671. events: {
  672. click: () => {
  673. this.markClick(position);
  674. },
  675. },
  676. title: `${name}`,
  677. address: `${address}`,
  678. label: { content: 'lable', offset: [3, 3] },
  679. desc: 'abc',
  680. };
  681. let text = {
  682. position: position,
  683. text: name,
  684. };
  685. let isDiff = this.markers.find(f => _.isEqual(f.position, position));
  686. if (!isDiff) {
  687. this.markers.push(obj);
  688. this.marktext.push(text);
  689. }
  690. return obj;
  691. },
  692. // 初始化地图
  693. handlemyMapFn() {
  694. VueAMap.initAMapApiLoader({
  695. key: '47947a002b2cddf99df02a1a5b1bc198',
  696. plugin: [
  697. 'AMap.PolyEditor', //编辑 折线多,边形
  698. 'AMap.PlaceSearch', // 查询
  699. 'AMap.Autocomplete',
  700. 'AMap.Scale',
  701. 'AMap.OverView',
  702. 'AMap.ToolBar',
  703. 'AMap.MapType',
  704. 'AMap.PolyEditor',
  705. 'AMap.CircleEditor',
  706. ], // 默认高德 sdk 版本为 1.4.4
  707. v: '1.4.4',
  708. });
  709. },
  710. // 标记点击
  711. markClick(posi) {
  712. console.log(this.markers);
  713. const r = this.markers.find(f => _.isEqual(f.position, posi));
  714. console.log(r);
  715. // 设置窗口信息,自定义.反正在slot里的字段对上
  716. const info = {
  717. title: r.title,
  718. address: r.address,
  719. pic: 'pic',
  720. };
  721. this.$set(this, `windowInfo`, info);
  722. // 设置窗口信息
  723. const obj = {
  724. position: r.position,
  725. visible: true,
  726. events: {
  727. close: () => {
  728. // 初始化
  729. this.$set(this, `window`, { position: [125.291162, 43.838597], visible: false });
  730. },
  731. },
  732. };
  733. this.$set(this, `window`, obj);
  734. },
  735. // 点击导航菜单
  736. typeSelect(index) {
  737. this.$set(this, `markers`, []);
  738. this.$set(this, `marktext`, []);
  739. if (index === '2-1-1') {
  740. for (const i of this.list3) {
  741. this.setMark(i);
  742. }
  743. } else if (index === '1-1-1') {
  744. for (const i of this.list) {
  745. this.setMark(i);
  746. }
  747. } else {
  748. for (const i of this.list2) {
  749. this.setMark(i);
  750. }
  751. }
  752. },
  753. },
  754. computed: {
  755. ...mapState(['user']),
  756. },
  757. };
  758. </script>
  759. <style lang="less" scoped>
  760. #container {
  761. width: 100%;
  762. height: 100vh;
  763. }
  764. .search-box {
  765. position: absolute;
  766. top: 25px;
  767. right: 20px;
  768. }
  769. .menus {
  770. position: absolute;
  771. top: 25px;
  772. left: 20px;
  773. z-index: 200;
  774. }
  775. </style>