signMap.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <div class="signMap" id="signMap">
  3. <div class="sum-title">
  4. {{signList.title}}
  5. </div>
  6. <div class="compass">
  7. <img src="../assets/img/main/compass.png" height="30" width="30"/>
  8. </div>
  9. <div class="screen">
  10. <img src="../assets/img/headside/screen_max.png" v-if="!screen_full" height="18" width="19"
  11. @click="full_screen"/>
  12. <img src="../assets/img/headside/screen_min.png" v-if="screen_full" height="18" width="19"
  13. @click="cancle_screen"/>
  14. </div>
  15. <div :class="[{'signMapList':true},{'full_state':full_state}]">
  16. <div class="tips" v-if="scan == ''">
  17. <span>请开始扫描</span>
  18. </div>
  19. <div class="signMapListBg">
  20. <span v-for="s in scan"
  21. :style="{ left: s.X*ruleX - errorX +'PX', top: s.Y *ruleY - errorY +'PX'}"
  22. >
  23. <em class="types" @click="showToast(s.popover)" @mouseover="showToast(s.popover)">
  24. <img src="../assets/img/signMap/ydgsm.png" height="54" width="54"
  25. v-if="s.WirelessType == 1"/>
  26. <img src="../assets/img/signMap/ltgsm.png" height="54" width="54"
  27. v-if="s.WirelessType == 2"/>
  28. <img src="../assets/img/signMap/dxcdma.png" height="54" width="54"
  29. v-if="s.WirelessType == 3"/>
  30. <img src="../assets/img/signMap/yd3g.png" height="54" width="54"
  31. v-if="s.WirelessType == 4"/>
  32. <img src="../assets/img/signMap/lt3g.png" height="54" width="54"
  33. v-if="s.WirelessType == 5"/>
  34. <img src="../assets/img/signMap/yd4g.png" height="54" width="54"
  35. v-if="s.WirelessType == 6"/>
  36. <img src="../assets/img/signMap/lt4g.png" height="54" width="54"
  37. v-if="s.WirelessType == 7"/>
  38. <img src="../assets/img/signMap/dx4g.png" height="54" width="54"
  39. v-if="s.WirelessType == 8"/>
  40. <img src="../assets/img/signMap/433M.png" height="54" width="54"
  41. v-if="s.WirelessType == 9"/>
  42. <img src="../assets/img/signMap/wifi.png" height="54" width="54"
  43. v-if="s.WirelessType == 10"/>
  44. <img src="../assets/img/signMap/ism.png" height="54" width="54"
  45. v-if="s.WirelessType == 11"/>
  46. <img src="../assets/img/signMap/800M.png" height="54" width="54"
  47. v-if="s.WirelessType == 12"/>
  48. <img src="../assets/img/main/unknow.png" height="54" width="54"
  49. v-if="s.WirelessType == 20"/>
  50. <img src="../assets/img/main/cam.png" height="54" width="54"
  51. v-if="s.WirelessType == 21"/>
  52. <img src="../assets/img/main/unknow_w.png" height="54" width="54"
  53. v-if="s.WirelessType == 22"/>
  54. <img src="../assets/img/main/phone.png" height="54" width="54"
  55. v-if="s.WirelessType == 23"/>
  56. <img src="../assets/img/main/wifi_w.png" height="54" width="54"
  57. v-if="s.WirelessType == 24"/>
  58. </em>
  59. <s :class="[
  60. {'yd':s.WirelessType == 1 || s.WirelessType == 4 || s.WirelessType == 6},
  61. {'lt':s.WirelessType == 2 || s.WirelessType == 5 || s.WirelessType == 7},
  62. {'dx':s.WirelessType == 3 || s.WirelessType == 8 },
  63. {'qt':s.WirelessType == 9 || s.WirelessType == 10 || s.WirelessType == 11|| s.WirelessType == 12},
  64. ]"
  65. >{{s.WirelessType | typeName}}</s>
  66. </span>
  67. </div>
  68. <div class="right_rule">
  69. <span>0</span>
  70. <span v-for="i in YMax" v-if="i % yLimit == 0">{{i}}</span>
  71. </div>
  72. <div class="bottom_rule">
  73. <span>0</span>
  74. <span v-for="i in XMax" v-if="i % xLimit == 0">{{i}}</span>
  75. </div>
  76. <el-dialog
  77. title="提示"
  78. :visible.sync="dialogVisible"
  79. width="30%"
  80. >
  81. <span>{{dialogText}}</span>
  82. <span slot="footer" class="dialog-footer">
  83. <el-button @click="dialogVisible = false" size="mini" type="primary">关闭</el-button>
  84. </span>
  85. </el-dialog>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. export default {
  91. data() {
  92. return {
  93. dialogVisible: false,
  94. screen_full: false,
  95. checked: true,
  96. full_state: false,
  97. scan: [],
  98. XMax: 56,
  99. YMax: 56,
  100. xLimit: 2,
  101. yLimit: 2,
  102. ruleX: 0.75,
  103. ruleY: 0.75,
  104. errorX: 20,
  105. errorY: 20,
  106. title: '扫描结果',
  107. dialogText: '',
  108. }
  109. },
  110. props: ['signList'],
  111. watch: {
  112. signList: {
  113. handler(newName, oldName) {
  114. if (!newName.Rs) {
  115. return false
  116. }
  117. this.scan = newName.Rs.Data;
  118. this.XMax = newName.Rs.XMax;
  119. this.YMax = newName.Rs.YMax;
  120. this.xLimit = parseInt(this.XMax / 28);
  121. this.yLimit = parseInt(this.YMax / 12);
  122. let Oem = "未知";
  123. let Ssid = "未知";
  124. if (this.scan) {
  125. this.scan.map(function (item) {
  126. Oem = item.Oem == '' ? "未知" : item.Oem;
  127. Ssid = item.Ssid == '' ? "未知" : item.Ssid;
  128. item.popover = "品牌:" + Oem + " SSID:" + Ssid;
  129. if (item.X < 0) {
  130. item.X = 10
  131. }
  132. if (item.Y < 0) {
  133. item.Y = 50
  134. }
  135. // + "X:" + item.X + " Y:" + item.Y
  136. })
  137. }
  138. },
  139. deep: true,
  140. immediate: true
  141. },
  142. },
  143. methods: {
  144. // 全屏
  145. full_screen() {
  146. let that = this;
  147. this.screen_full = true;
  148. let elem = document.getElementById("signMap");
  149. this.full_state = true;
  150. if (elem.webkitRequestFullScreen) {
  151. elem.webkitRequestFullScreen();
  152. that.full_rule();
  153. } else if (elem.mozRequestFullScreen) {
  154. elem.mozRequestFullScreen();
  155. that.full_rule();
  156. } else if (elem.requestFullScreen) {
  157. elem.requestFullscreen();
  158. that.full_rule();
  159. } else {
  160. this.screen_full = false;
  161. notice.notice_show("浏览器不支持全屏API或已被禁用", null, null, null, true, true);
  162. }
  163. },
  164. full_rule() {
  165. this.ruleX = 1.4;
  166. this.ruleY = 1.6;
  167. this.errorX = -20;
  168. this.errorY = -20;
  169. },
  170. cancle_full_rule() {
  171. this.ruleX = 0.75;
  172. this.ruleY = 0.75;
  173. this.errorX = 20;
  174. this.errorY = 20;
  175. },
  176. // 取消全屏
  177. cancle_screen() {
  178. let that = this;
  179. this.screen_full = false;
  180. this.full_state = false;
  181. var elem = document;
  182. if (elem.webkitCancelFullScreen) {
  183. elem.webkitCancelFullScreen();
  184. that.cancle_full_rule();
  185. } else if (elem.mozCancelFullScreen) {
  186. elem.mozCancelFullScreen();
  187. that.cancle_full_rule();
  188. } else if (elem.cancelFullScreen) {
  189. elem.cancelFullScreen();
  190. that.cancle_full_rule();
  191. } else if (elem.exitFullscreen) {
  192. elem.exitFullscreen();
  193. that.cancle_full_rule();
  194. } else {
  195. this.screen_full = true;
  196. notice.notice_show("浏览器不支持全屏API或已被禁用", null, null, null, true, true);
  197. }
  198. },
  199. showToast(text) {
  200. this.dialogVisible = true;
  201. this.dialogText = text;
  202. }
  203. },
  204. filters: {
  205. typeName: function (value) {
  206. return filterAllType(value)
  207. },
  208. },
  209. }
  210. </script>
  211. <style scoped>
  212. .signMap {
  213. width: 100%;
  214. height: 473px;
  215. overflow: hidden;
  216. display: block;
  217. margin: 0 auto;
  218. margin-top: 0px;
  219. }
  220. .signMapList {
  221. position: relative;
  222. width: 100%;
  223. height: 80%;
  224. overflow: hidden;
  225. display: block;
  226. margin: 0 auto;
  227. margin-top: 20px;
  228. color: #6DC1FF;
  229. }
  230. .sum-title {
  231. width: 150px;
  232. height: 36px;
  233. font-size: 16px;
  234. line-height: 36px;
  235. color: #6DC1FF;
  236. margin: 0 auto;
  237. text-align: center;
  238. background: url("../assets/img/main/tit.png") top center no-repeat;
  239. background-size: 100%;
  240. }
  241. .compass {
  242. position: relative;
  243. left: 3%;
  244. top: -20px;
  245. float: left;
  246. }
  247. .screen {
  248. position: relative;
  249. right: 3%;
  250. top: -20px;
  251. float: right;
  252. cursor: pointer;
  253. }
  254. .signMapListBg {
  255. width: 95%;
  256. /*height: 385px;*/
  257. height: 90%;
  258. float: left;
  259. background: url("../assets/img/main/grid.png");
  260. background-size: 100% 100%;
  261. }
  262. .right_rule {
  263. float: left;
  264. width: 30px;
  265. height: 90%;
  266. }
  267. .right_rule span {
  268. width: 100%;
  269. overflow: hidden;
  270. display: block;
  271. margin: 0 auto;
  272. height: 8%;
  273. line-height: 100%;
  274. text-align: center;
  275. font-size: 12px;
  276. }
  277. .bottom_rule {
  278. width: 100%;
  279. overflow: hidden;
  280. display: block;
  281. margin: 0 auto;
  282. }
  283. .bottom_rule span {
  284. width: 3.2%;
  285. text-align: center;
  286. float: left;
  287. font-size: 12px;
  288. }
  289. .tips {
  290. position: absolute;
  291. top: 10%;
  292. left: 0;
  293. right: 0;
  294. margin: 0 auto;
  295. width: 306px;
  296. height: 306px;
  297. overflow: hidden;
  298. background: url("../assets/img/main/ready.png");
  299. background-size: 100% 100%;
  300. text-align: center;
  301. line-height: 306px;
  302. font-size: 30px;
  303. color: #fff;
  304. }
  305. .signMapListBg > span {
  306. position: absolute;
  307. float: left;
  308. overflow: hidden;
  309. cursor: pointer;
  310. width: 20%;
  311. height: 20%;
  312. }
  313. .signMapListBg em {
  314. overflow: hidden;
  315. display: block;
  316. margin: 0 auto;
  317. }
  318. .signMapListBg s {
  319. width: 100%;
  320. overflow: hidden;
  321. display: block;
  322. margin: 0 auto;
  323. text-align: center;
  324. font-size: 12px;
  325. text-decoration: none;
  326. }
  327. .signMapListBg img {
  328. -webkit-animation: twinkling 1s infinite ease-in-out;
  329. -webkit-animation-duration: 1s;
  330. animation-duration: 1s;
  331. -webkit-animation-fill-mode: both;
  332. animation-fill-mode: both
  333. }
  334. .signMap s {
  335. color: #72FF99;
  336. }
  337. s.yd {
  338. color: #72FF99;
  339. }
  340. s.lt {
  341. color: #FFB06B;
  342. }
  343. s.dx {
  344. color: #00FEFF;
  345. }
  346. s.qt {
  347. color: #FFE853;
  348. }
  349. @-webkit-keyframes twinkling {
  350. 0% {
  351. opacity: 0.5;
  352. }
  353. 100% {
  354. opacity: 1;
  355. }
  356. }
  357. @keyframes twinkling {
  358. 0% {
  359. opacity: 0.5;
  360. }
  361. 100% {
  362. opacity: 1;
  363. }
  364. }
  365. </style>