MainPage.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <div id="firstPage">
  3. <!-- <img class="img" id="img1" src="../assets/png/title.png" /> -->
  4. <!-- <div id="time_time">10:45:23</div>
  5. <div id="time_week">星期五</div>
  6. <div id="time_day">2021.05.16</div> -->
  7. <Time></Time>
  8. <img class="img" id="img2" src="../assets/png/title.png" />
  9. <img class="img" id="first_img" src="../assets/png/first1.png" />
  10. <div id="left_div">
  11. <img class="menu" src="../assets/png/1.png" />
  12. <ViewPage :szdata='dataAll.index'></ViewPage>
  13. <img class="menu" id="peopleStatus" src="../assets/png/2.png" />
  14. <img id="person_status" src="../assets/png/people_status.png" />
  15. <PersonStatusPage></PersonStatusPage>
  16. <img class="menu" id="insuredStatus" src="../assets/png/3.png" />
  17. <img id="insured_status" src="../assets/png/insured_status.png" />
  18. <InsuredPage></InsuredPage>
  19. </div>
  20. <div id="right_div">
  21. <img class="menu" id="importantPersonStatus" src="../assets/png/4.png" />
  22. <KeyPopulationPage :important='dataAll.important'></KeyPopulationPage>
  23. <img class="menu" id="employmentSituation" src="../assets/png/5.png" />
  24. <EmploymentSituation :working='dataAll.working'></EmploymentSituation>
  25. <img class="menu" id="education" src="../assets/png/6.png" />
  26. <EducationPage :dataAll='dataAll'></EducationPage>
  27. <img class="menu" id="vaccination" src="../assets/png/7.png" />
  28. <VaccinationPage :vaccin='dataAll.vaccin'></VaccinationPage>
  29. </div>
  30. <div id="click" class="click_class" v-on:click="to3DMap"></div>
  31. <div class="click_class" id="click_1" v-on:click="toZheji"></div>
  32. <div class="click_class" id="click_2" v-on:click="toOther"></div>
  33. <div class="click_class" id="click_3" v-on:click="toOther"></div>
  34. <div class="click_class" id="click_4" v-on:click="toOther"></div>
  35. <div id="click_5" v-on:click="toXiMen"></div>
  36. <div class="click_class" id="click_6" v-on:click="toOther"></div>
  37. <div class="click_class" id="click_7" v-on:click="toOther"></div>
  38. <div class="click_class" id="click_8" v-on:click="toOther"></div>
  39. <div class="click_class" id="click_9" v-on:click="toOther"></div>
  40. <div class="click_class" id="click_10" v-on:click="toOther"></div>
  41. <div class="click_class" id="click_11" v-on:click="toOther"></div>
  42. <div class="click_class" id="click_12" v-on:click="toOther"></div>
  43. <div class="click_class" id="click_13" v-on:click="toOther"></div>
  44. <div class="click_class" id="click_14" v-on:click="toOther"></div>
  45. <div class="click_class" id="click_15" v-on:click="toOther"></div>
  46. <div class="click_class" id="click_16" v-on:click="toOther"></div>
  47. </div>
  48. </template>
  49. <script>
  50. import Time from "./Time.vue";
  51. import PersonStatusPage from "./MainPageChild/PersonStatusPage.vue";
  52. import ViewPage from "./MainPageChild/ViewPage.vue";
  53. import InsuredPage from "./MainPageChild/InsuredPage.vue";
  54. import KeyPopulationPage from "./MainPageChild/KeyPopulationPage.vue";
  55. import EmploymentSituation from "./MainPageChild/EmploymentSituation.vue";
  56. import VaccinationPage from "./MainPageChild/VaccinationPage.vue";
  57. import EducationPage from "./MainPageChild/EducationPage.vue";
  58. import {
  59. SZZSY_httpGet,
  60. SZZSQSY_httpGet,
  61. SZZXQ_httpGet,
  62. } from "../assets/api/loadData.js";
  63. export default {
  64. name: "MainPage",
  65. components: {
  66. Time,
  67. PersonStatusPage,
  68. ViewPage,
  69. InsuredPage,
  70. KeyPopulationPage,
  71. EmploymentSituation,
  72. VaccinationPage,
  73. EducationPage,
  74. VaccinationPage,
  75. },
  76. data() {
  77. return {
  78. dataAll: {
  79. }
  80. };
  81. },
  82. created() {},
  83. mounted() {
  84. this.change();
  85. // 拿到首页数据,传给左侧的组件
  86. let clear = setInterval(() => {
  87. if (
  88. this.$store.getters.getSzdata.code === 10000 &&
  89. this.$store.getters.getSzdata.data.index
  90. ) {
  91. this.dataAll = this.$store.getters.getSzdata.data;
  92. console.log('拿到首页全部数据', this.dataAll);
  93. clearInterval(clear);
  94. }
  95. }, 500);
  96. },
  97. methods: {
  98. change() {
  99. let boxCollection = document.getElementsByClassName("click_class");
  100. for (let i = 0; i < boxCollection.length; i++) {
  101. boxCollection[i].addEventListener("click", (event) => {
  102. window.name = window.cesiumMap.addLocationName(event);
  103. console.log("event", event);
  104. setTimeout(() => {
  105. this.changeData(event.view.name);
  106. }, 1000);
  107. });
  108. }
  109. },
  110. changeData(name) {
  111. SZZSQSY_httpGet(
  112. name,
  113. (result) => {
  114. console.log(name, result);
  115. this.$store.commit("setDaZhongdata", result.data);
  116. this.$store.commit("setSzdata", result.data);
  117. },
  118. (result) => {}
  119. );
  120. },
  121. to3DMap() {
  122. setTimeout(() => {
  123. window.cesiumMap.removeGaode();
  124. window.cesiumMap.addEntity();
  125. }, 100);
  126. this.$router.replace("/daZhong");
  127. },
  128. toZheji() {
  129. window.cesiumMap.addGaode();
  130. this.$router.replace("/zheJi");
  131. },
  132. toXiMen() {
  133. window.cesiumMap.loadximen();
  134. window.cesiumMap.addLocationName({
  135. target: {
  136. id: "click_5",
  137. },
  138. });
  139. this.$router.replace("/ximen");
  140. },
  141. toOther() {
  142. window.cesiumMap.addGaode();
  143. this.$router.replace("/other");
  144. },
  145. },
  146. };
  147. </script>
  148. <style scoped>
  149. #peopleStatus {
  150. top: 28%;
  151. }
  152. #insuredStatus {
  153. top: 75%;
  154. }
  155. #importantPersonStatus {
  156. left: 10%;
  157. }
  158. #employmentSituation {
  159. top: 22%;
  160. }
  161. #vaccination {
  162. top: 75%;
  163. width: 200px;
  164. }
  165. #education {
  166. top: 45%;
  167. }
  168. #person_status {
  169. position: absolute;
  170. top: 30%;
  171. left: 50%;
  172. width: 30%;
  173. }
  174. #insured_status {
  175. position: absolute;
  176. bottom: 5%;
  177. left: 50%;
  178. width: 20%;
  179. }
  180. #right_div {
  181. position: absolute;
  182. z-index: 120;
  183. color: azure;
  184. width: 25%;
  185. height: 90%;
  186. top: 10%;
  187. right: 1%;
  188. /* background-color: rgb(0,0,0,0.1); */
  189. }
  190. #left_div {
  191. position: absolute;
  192. z-index: 120;
  193. color: azure;
  194. width: 25%;
  195. height: 90%;
  196. top: 10%;
  197. /* background-color: rgb(0,0,0,0.1); */
  198. }
  199. .menu {
  200. position: absolute;
  201. width: 150px;
  202. left: 10%;
  203. }
  204. .font_background_png {
  205. z-index: 119;
  206. position: absolute;
  207. top: -50%;
  208. }
  209. #firstPage {
  210. position: absolute;
  211. width: 100%;
  212. height: 100%;
  213. margin: 0;
  214. padding: 0;
  215. }
  216. .img {
  217. position: absolute;
  218. }
  219. #img1 {
  220. bottom: 1%;
  221. left: 50%;
  222. transform: translateX(-50%);
  223. z-index: 111;
  224. width: 50%;
  225. }
  226. #img2 {
  227. top: -1%;
  228. left: 50%;
  229. transform: translateX(-50%);
  230. z-index: 111;
  231. width: 30%;
  232. }
  233. #first_img {
  234. position: absolute;
  235. z-index: 110;
  236. width: 100%;
  237. height: 100%;
  238. }
  239. .click_class {
  240. position: absolute;
  241. z-index: 111;
  242. width: 80px;
  243. height: 40px;
  244. cursor: pointer;
  245. }
  246. #click {
  247. position: absolute;
  248. z-index: 111;
  249. width: 80px;
  250. height: 40px;
  251. left: 38%;
  252. top: 33%;
  253. cursor: pointer;
  254. }
  255. #click_1 {
  256. left: 54%;
  257. top: 48%;
  258. }
  259. #click_2 {
  260. left: 47.5%;
  261. top: 32.5%;
  262. }
  263. #click_3 {
  264. left: 57.5%;
  265. top: 31%;
  266. }
  267. #click_4 {
  268. left: 41%;
  269. top: 36%;
  270. }
  271. #click_5 {
  272. position: absolute;
  273. z-index: 111;
  274. width: 80px;
  275. height: 40px;
  276. left: 32%;
  277. top: 38%;
  278. cursor: pointer;
  279. }
  280. #click_6 {
  281. left: 36%;
  282. top: 42%;
  283. }
  284. #click_7 {
  285. left: 42%;
  286. top: 43%;
  287. }
  288. #click_8 {
  289. left: 52%;
  290. top: 40%;
  291. }
  292. #click_9 {
  293. left: 52.5%;
  294. top: 35%;
  295. }
  296. #click_10 {
  297. left: 51.5%;
  298. top: 45%;
  299. }
  300. #click_11 {
  301. left: 59%;
  302. top: 47%;
  303. }
  304. #click_12 {
  305. left: 63%;
  306. top: 54%;
  307. }
  308. #click_13 {
  309. left: 38%;
  310. top: 53%;
  311. }
  312. #click_14 {
  313. left: 27%;
  314. top: 56%;
  315. }
  316. #click_15 {
  317. left: 65%;
  318. top: 43%;
  319. }
  320. #click_16 {
  321. left: 48.5%;
  322. top: 27%;
  323. }
  324. </style>