index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="mot_page">
  3. <div class="mot_head">放芯查数据展示平台</div>
  4. <div class="fxc_top">
  5. <div class="fxc_top_item">
  6. <img src="../../assets/images/fxc_img2.png">
  7. <div class="fxc_top_txt">
  8. <div class="fxc_top_num">
  9. <numCard v-for="(item,index) in ''+produced" :key="index" :num="item || 0" :color="'#3AB46D'"></numCard>
  10. </div>
  11. <div class="fxc_top_type">已生产(个)</div>
  12. </div>
  13. </div>
  14. <div class="fxc_top_item">
  15. <img src="../../assets/images/fxc_img3.png">
  16. <div class="fxc_top_txt">
  17. <div class="fxc_top_num">
  18. <numCard v-for="(item,index) in ''+finished" :key="index" :num="item || 0" :color="'#EF4598'"></numCard>
  19. </div>
  20. <div class="fxc_top_type">已出库(个)</div>
  21. </div>
  22. </div>
  23. <div class="fxc_top_item">
  24. <img src="../../assets/images/fxc_img4.png">
  25. <div class="fxc_top_txt">
  26. <div class="fxc_top_num">
  27. <numCard v-for="(item,index) in ''+transit" :key="index" :num="item || 0" :color="'#F8B30E'"></numCard>
  28. </div>
  29. <div class="fxc_top_type">已入库(个)</div>
  30. </div>
  31. </div>
  32. <div class="fxc_top_item">
  33. <img src="../../assets/images/fxc_img5.png">
  34. <div class="fxc_top_txt">
  35. <div class="fxc_top_num">
  36. <numCard v-for="(item,index) in ''+used" :key="index" :num="item || 0" :color="'#3E9DFF'"></numCard>
  37. </div>
  38. <div class="fxc_top_type">已结束(个)</div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="fxc_left">
  43. <div class="fxc_tit">温度监测</div>
  44. <div class="fxc_left_top">
  45. <div class="fxc_lt_item">
  46. <div class="fxc_lt_num">
  47. <numCard v-for="(item,index) in ''+normal" :key="index" :num="item || 0"></numCard>
  48. </div>
  49. <div class="fxc_lt_type">正常</div>
  50. </div>
  51. <div class="fxc_lt_item">
  52. <div class="fxc_lt_num">
  53. <numCard v-for="(item,index) in ''+warning" :key="index" :num="item || 0" :color="'#3AB46D'"></numCard>
  54. </div>
  55. <div class="fxc_lt_type">预警</div>
  56. </div>
  57. <div class="fxc_lt_item">
  58. <div class="fxc_lt_num">
  59. <numCard v-for="(item,index) in ''+error" :key="index" :num="item || 0" :color="'#3AB46D'"></numCard>
  60. </div>
  61. <div class="fxc_lt_type">报警</div>
  62. </div>
  63. </div>
  64. <div class="fxc_left_con1">
  65. <div class="fxc_left_ctit">标签类型</div>
  66. <div class="fxc_left_ch1">
  67. <pie4Chart :warningState="warningState"></pie4Chart>
  68. </div>
  69. </div>
  70. <div class="fxc_left_cline"></div>
  71. <div class="fxc_left_con2">
  72. <div class="fxc_left_ctit">预警情况</div>
  73. <div class="fxc_left_ch2">
  74. <div>
  75. <pie2Chart :warningState="warningState" :id="'pie2Chart20'"></pie2Chart>
  76. </div>
  77. <div>
  78. <pie2Chart :warningState="warningState" :id="'pie2Chart11'"></pie2Chart>
  79. </div>
  80. </div>
  81. </div>
  82. <!-- <div class="fxc_left_btm">
  83. <img class="fxc_left_btm_img" src="../../assets/images/fxc_img11.png">
  84. <pie3d :id="'pie3d1'" :value1="1220" :value2="1000" :value3="1200"></pie3d>
  85. <div class="fxc_left_btm_txt">预警</div>
  86. <div class="fxc_lb_con">
  87. <div class="fxc_lb_item">
  88. <i></i>全程温度<span>{{1220}}</span>
  89. </div>
  90. <div class="fxc_lb_item">
  91. <i></i>实时温控<span>{{1000}}</span>
  92. </div>
  93. <div class="fxc_lb_item">
  94. <i></i>追溯标签<span>{{1200}}</span>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="fxc_left_btm">
  99. <img class="fxc_left_btm_img" src="../../assets/images/fxc_img11.png">
  100. <pie3d :id="'pie3d2'" :value1="1230" :value2="1100" :value3="1200"></pie3d>
  101. <div class="fxc_left_btm_txt">报警</div>
  102. <div class="fxc_lb_con">
  103. <div class="fxc_lb_item">
  104. <i></i>全程温度<span>{{1220}}</span>
  105. </div>
  106. <div class="fxc_lb_item">
  107. <i></i>实时温控<span>{{1000}}</span>
  108. </div>
  109. <div class="fxc_lb_item">
  110. <i></i>追溯标签<span>{{1200}}</span>
  111. </div>
  112. </div>
  113. </div> -->
  114. </div>
  115. <div class="fxc_mid" @click="hideInfo">
  116. <div class="fxc_map">
  117. <mapPage :markers="markers"></mapPage>
  118. </div>
  119. <div class="fxc_mid_con1" v-if="markerInfo">
  120. <div class="fxc_win_icon1"></div>
  121. <div class="fxc_win_icon2"></div>
  122. <div class="fxc_win_icon3"></div>
  123. <div class="fxc_win_icon4"></div>
  124. <div class="fxc_mc1_txt">
  125. 检测对象:{{markerInfo.name||"--"}}<br>
  126. 当前温度:{{markerInfo.lastTemperature||"--"}}℃<br>
  127. 最低温度:{{markerInfo.minTemperature||"--"}}℃<br>
  128. 检测状态:{{markerInfo.statusStr||"--"}}<br>
  129. 更新时间:{{markerInfo.updateTime||"--"}}
  130. </div>
  131. </div>
  132. <div class="fxc_mid_con2" v-if="chaintemp">
  133. <div class="fxc_win_icon1"></div>
  134. <div class="fxc_win_icon2"></div>
  135. <div class="fxc_win_icon3"></div>
  136. <div class="fxc_win_icon4"></div>
  137. <div class="fxc_mc2_con">
  138. <lineChart :chaintemp="chaintemp"></lineChart>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="fxc_right1">
  143. <div class="fxc_tit">储运状态</div>
  144. <div class="fxc_right1_con">
  145. <barChart :chipStates="chipStates"></barChart>
  146. </div>
  147. </div>
  148. <div class="fxc_right2">
  149. <div class="fxc_tit">监测数量</div>
  150. <div class="fxc_right2_con">
  151. <!-- <huan2d :id="'huan2d1'" :chipCountData="chipCountData"></huan2d> -->
  152. <huan2d :id="'huan2d1'" :chipCountData="chipCountData" :value1="1220" :value2="1000" :value3="1200"></huan2d>
  153. </div>
  154. </div>
  155. <div class="no_login" @click="goLogin" v-if="!token">
  156. <div>去登录</div>
  157. </div>
  158. </div>
  159. </template>
  160. <script>
  161. import NumCard from "../../components/fangxincha/numberCard"//
  162. import pie4Chart from "../../components/fangxincha/huan4"//
  163. import pie2Chart from "../../components/fangxincha/huan2"//
  164. import Pie3d from "../../components/fangxincha/pie3d2"//
  165. import Huan3d from "../../components/fangxincha/huan3d"//
  166. import Huan2d from "../../components/fangxincha/huan2d"//
  167. import MapPage from "../../components/fangxincha/map"//高德地图
  168. import LineChart from "../../components/fangxincha/lineChart"//
  169. import BarChart from "../../components/fangxincha/barChart"//
  170. import { getFxcToken,getFxclistChainLocal,getFxcProductTypeChipCount,getFxcWarningState,getFxcProductChipState,getFxcChainStatus,getFxcChainInfo,getFxcChainTemperature } from '@/api/screen'
  171. export default({
  172. name:"Shop",
  173. components: {
  174. NumCard,
  175. Pie3d,
  176. MapPage,
  177. LineChart,
  178. BarChart,
  179. Huan3d,
  180. Huan2d,
  181. pie4Chart,
  182. pie2Chart,
  183. },
  184. data () {
  185. return {
  186. attrs:["produced","finished","transit","used","normal","warning","error"],
  187. produced:6780,
  188. finished:6780,
  189. transit:6780,
  190. used:6780,
  191. normal:6780,
  192. warning:6780,
  193. error:6780,
  194. token:"",
  195. markers:[],
  196. markerInfo:"",
  197. chaintemp:"",
  198. chainStatus:{},
  199. warningState:{},
  200. chipCountData:[],
  201. chipStates:[],
  202. }
  203. },
  204. created () {
  205. this.token = localStorage.getItem("token");
  206. if(this.token){
  207. this.getListChainLocal()
  208. this.getProductTypeChipCount()
  209. this.getProductChipState()
  210. this.getChainStatus()
  211. this.getWarningState()
  212. }else{
  213. this.changeNum()
  214. }
  215. // this.randomNum()
  216. // this.getLoginToken()
  217. // this.$store.dispatch("FxcLogin").then((res)=>{
  218. // var fxcToken = this.$store.getters.fxcToken
  219. // this.getListChainLocal(fxcToken)
  220. // this.getProductTypeChipCount(fxcToken)
  221. // this.getProductChipState(fxcToken)
  222. // })
  223. },
  224. methods: {
  225. // getLoginToken(){
  226. // getFxcToken().then(response => {
  227. // var fxcToken = response.token
  228. // this.getListChainLocal(fxcToken)
  229. // this.getProductTypeChipCount(fxcToken)
  230. // this.getProductChipState(fxcToken)
  231. // this.getChainStatus(fxcToken)
  232. // });
  233. // },
  234. getListChainLocal(){
  235. getFxclistChainLocal().then(response => {
  236. this.markers = response.data
  237. });
  238. },
  239. getWarningState(){
  240. getFxcWarningState().then(response => {
  241. this.warningState = response.data
  242. });
  243. },
  244. getProductChipState(){
  245. getFxcProductChipState().then(response => {
  246. this.chipStates = response.data
  247. });
  248. },
  249. getProductTypeChipCount(){
  250. getFxcProductTypeChipCount().then(response => {
  251. var data = response.data
  252. var list = []
  253. for(var i in data){
  254. list[i] = []
  255. list[i][0] = data[i].productTypeName
  256. list[i][1] = data[i].num
  257. }
  258. this.chipCountData = list
  259. });
  260. },
  261. getChainStatus(){
  262. getFxcChainStatus().then(response => {
  263. var data = response.data
  264. this.produced = data.total
  265. this.finished = data.inTrans
  266. this.transit = data.inStore
  267. this.used = data.inEnd
  268. this.normal = data.temperatureDTO.normal
  269. this.warning = data.temperatureDTO.warning
  270. this.error = data.temperatureDTO.alarm
  271. });
  272. },
  273. getChainInfo(id){
  274. getFxcChainInfo({id}).then(response => {
  275. var data = response.data
  276. data.status && (data.statusStr = {"00": "已入库", "10": "已出库", "20": "已结束"}[data.status])
  277. this.markerInfo = data
  278. });
  279. },
  280. getChainTemperature(id){
  281. getFxcChainTemperature({id}).then(response => {
  282. var data = response.data
  283. this.chaintemp = data.length && data
  284. });
  285. },
  286. hideInfo(){
  287. this.markerInfo = null
  288. this.chaintemp = null
  289. },
  290. changeNum(){
  291. const that = this
  292. var list = that.attrs
  293. for(var i in list){
  294. that.randomNum(list[i])
  295. }
  296. },
  297. randomNum(key){
  298. const that = this
  299. that[key+"Timer"] = window.setInterval(()=>{
  300. //数字每次变化1-10之间
  301. var rdNum = Math.floor(1+Math.random()*9)
  302. that[key]=that[key]+rdNum
  303. },2000)
  304. },
  305. goLogin(){
  306. this.$router.push({
  307. name: 'SignIn',
  308. })
  309. },
  310. }
  311. })
  312. </script>
  313. <style>
  314. html{ font-size:calc(100vw / 19.2);}
  315. body{ font-size:14px; background: #031934;}
  316. .mot_page{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; background: url(../../assets/images/opt_bg.png); background-size: 100% 100%; }
  317. .fxc_page{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; background: url(../../assets/images/fxc_bg1.png); background-size: 100% 100%; }
  318. .mot_head{ position: absolute; top: 0; left: 0; width: 100%; height: 11vh; line-height: 11vh; color: #53A0FF; font-size:2vw; text-align: center;font-weight: bold;
  319. background-image:-webkit-linear-gradient(bottom,#53A0FF,#ffffff);-webkit-background-clip:text;background-clip: text;-webkit-text-fill-color:transparent;
  320. /*-webkit-text-stroke:1px #ffffff; font-style: italic;*/letter-spacing:1vw;}
  321. .fxc_head{ position: absolute; top: 0; left: 0; width: 100%; height: 11vh; display: flex; align-items: center; justify-content: center;}
  322. .fxc_head img{ width: 27vw;}
  323. .fxc_top{ position: absolute; top: 0; left: 0; right: 0;}
  324. .fxc_top_item{ position: absolute; left: 2.4vw; top: 3.7vh; width: 12.6vw; height: 11.1vh; background:url(../../assets/images/fxc_img9.png); background-size: 100% 100%; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0 0 0 0.6vw;}
  325. .fxc_top_item img{ width: 2.6vw; height: 2.6vw; margin: 0 0.5vw 0 0;}
  326. .fxc_top_num{ font-size:1.25vw; line-height: 1em; font-weight: bold; display: flex;}
  327. .fxc_top_type{ font-size: 1vw; color: #65A3F7;}
  328. .fxc_top_item:nth-child(2){ left: 16.3vw;}
  329. .fxc_top_item:nth-child(3){ left: 71.1vw;}
  330. .fxc_top_item:nth-child(4){ left: 85.1vw;}
  331. .fxc_left{position: absolute; padding: 2vh 0 0 0; top: 23.1vh; left: 2.7vw; width: 25.8vw; height: 73.4vh; background: rgba(14, 97, 182, 0.14);border: 2px solid;border-image: linear-gradient(90deg, #093B77, #3E8EFF, #0C4480) 2 2;}
  332. .fxc_tit{ position: absolute; height: 4.4vh; width: 22vw; top: -4.3vh; background: url(../../assets/images/fxc_img1.png); background-size: 100% 100%; left: 50%; font-size: 0.9vw; font-weight: bold; color: #C6DFFF; margin: 0 -11vw; text-align: center; line-height: 4.4vh;}
  333. .fxc_left_top{ width: 21.7vw; margin: auto; height: 16.5vh; display: flex; justify-content: space-between; align-items: center;background: url(../../assets/images/fxc_img12.png); background-size: 100% 100%;}
  334. .fxc_left_btm{ width: 90%; height: 26vh; position: relative; margin:0 0;}
  335. .fxc_lt_item{ flex: auto; width: 100%; text-align: center; border-left: 1px solid #3089F3;}
  336. .fxc_lt_item:nth-child(1){ border: none;}
  337. .fxc_lt_num{ display: flex; justify-content: center; align-items: center; font-size: 1.8vw;}
  338. .fxc_lt_type{ font-size: 1.2vw; color: #75AFFE;}
  339. .fxc_mid{ position: absolute; top: 17.8vh; left: 29.6vw; width: 44.5vw; height: 78.3vh;background: url(../../assets/images/fxc_map.png) center center no-repeat; background-size:7.5rem 5.21rem;}
  340. .fxc_mid_con1{ position: absolute; bottom: 0; left: 1.5vw; width: 11.4vw; height: 23.4vh; height: 1.5rem; background: rgba(2,43,145, 0.5); box-sizing: border-box;}
  341. .fxc_win_icon1::before{ content: ""; position: absolute; top:-4px; left:-4px; width: 2px; height: 1vw; background: #2DC1FF;}
  342. .fxc_win_icon1::after{ content: ""; position: absolute; top:-4px; left:-4px; height: 2px; width: 1vw; background: #2DC1FF;}
  343. .fxc_win_icon2::before{ content: ""; position: absolute; bottom:-4px; left:-4px; width: 2px; height: 1vw; background: #2DC1FF;}
  344. .fxc_win_icon2::after{ content: ""; position: absolute; bottom:-4px; left:-4px; height: 2px; width: 1vw; background: #2DC1FF;}
  345. .fxc_win_icon3::before{ content: ""; position: absolute; top:-4px; right:-4px; width: 2px; height: 1vw; background: #2DC1FF;}
  346. .fxc_win_icon3::after{ content: ""; position: absolute; top:-4px; right:-4px; height: 2px; width: 1vw; background: #2DC1FF;}
  347. .fxc_win_icon4::before{ content: ""; position: absolute; bottom:-4px; right:-4px; width: 2px; height: 1vw; background: #2DC1FF;}
  348. .fxc_win_icon4::after{ content: ""; position: absolute; bottom:-4px; right:-4px; height: 2px; width: 1vw; background: #2DC1FF;}
  349. .fxc_mc1_txt{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; padding: 0 0 0 1vw; line-height: 3.7vh;line-height: 0.24rem; font-size: 0.6vw; color: #65A3F7;}
  350. .fxc_mid_con2{ position: absolute; bottom: 0; right: 1.5vw; width: 13.8vw; height: 26.8vh; background: rgba(4,57,217, 0.5); box-sizing: border-box;}
  351. .fxc_right1{ position: absolute; top: 22vh; right: 2.4vw; width: 22.8vw; height: 34.3vh;background: rgba(14, 97, 182, 0.14);border: 2px solid;border-image: linear-gradient(90deg, #093B77, #3E8EFF, #0C4480) 2 2;}
  352. .fxc_left_btm_txt{ position: absolute; bottom: 0; left:30%; width: 2rem; margin: 0 0 0 -0.93rem; font-size: 0.16rem; color: #ffffff; text-align: center;}
  353. .fxc_right2{ position: absolute; top:62.1vh; right: 2.4vw; width: 22.8vw; height: 34.3vh;background: rgba(14, 97, 182, 0.14);border: 2px solid;border-image: linear-gradient(90deg, #093B77, #3E8EFF, #0C4480) 2 2;}
  354. .fxc_lb_con{position: absolute; top: 10px; bottom:20px; right: 10px; display: flex; flex-direction: column; align-items: center; justify-content:center;}
  355. .fxc_lb_item{ margin: 6px auto; color: #ffffff; font-size: 0.18rem; line-height: 0.18rem;}
  356. .fxc_lb_item i{ display: inline-block; width:0.2rem; height: 0.12rem; margin-right:0.08rem;}
  357. .fxc_lb_item span{ margin-left: 0.08rem;}
  358. .fxc_lb_item:nth-child(1) i{background: #23D9E9;}
  359. .fxc_lb_item:nth-child(2) i{background: #89D44B;}
  360. .fxc_lb_item:nth-child(3) i{background: #E82A30;}
  361. .fxc_lb_item:nth-child(1) span{color: #23D9E9;}
  362. .fxc_lb_item:nth-child(2) span{color: #89D44B;}
  363. .no_login{ position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1; display: flex; justify-content: center; align-items: center;}
  364. .no_login>div{ width: auto; padding: 20px; background: #ffffff; font-size: 20px; line-height: 36px; border-radius: 5px; color: #2DC1FF;}
  365. .fxc_left_con1{ width: 23vw; height:24.4vh; margin: auto; position: relative;}
  366. .fxc_left_con2{ width: 23vw; height: 26.9vh; margin: auto; position: relative;}
  367. .fxc_left_ctit{ font-size: 0.7vw; line-height: 0.28rem; color:#ffffff; position: relative; z-index: 1;}
  368. .fxc_left_ch1{ position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
  369. .fxc_left_ch2{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch;}
  370. .fxc_left_ch2 div{ height: 100%; width: 100%; position: relative;}
  371. .fxc_left_cline{ width: 21.8vw; height: 1px; background: #0653AF; margin: auto;}
  372. </style>