injectionNeedle.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <!-- 注射针 -->
  3. <view class="equipmentDtl">
  4. <commons-header title=" 注射针"></commons-header>
  5. <view class="equ-img">
  6. <image src="../../static/img_jbj.png" mode=""></image>
  7. <!-- <view class="err-modal">
  8. <image src="../../static/icon_jb@2x.png" mode=""></image>
  9. </view> -->
  10. </view>
  11. <view class="state">
  12. <view class="state-box">
  13. <image src="../../static/icon_sbzt.png" mode=""></image>
  14. <view class="text">
  15. <view class="label">
  16. 设备状态
  17. </view>
  18. <view class="state-text" style="color: #3FBF31;">
  19. {{swichType ? '在线' : '离线'}}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="state-box">
  24. <image src="../../static/icon_gzms.png" mode=""></image>
  25. <view class="text">
  26. <view class="label">
  27. 工作模式
  28. </view>
  29. <view class="state-text" style="color:#FF8800">
  30. 自动
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="ebc-content">
  36. <view class="commons-title">
  37. 上座
  38. </view>
  39. <ul>
  40. <li>
  41. <view class="list-long">
  42. <view class="" style="display: flex;">
  43. <image src="../../static/icon_yxzt.png" mode=""></image>
  44. <view class="list-label" style="line-height: 80rpx;color: #666666;">运行状态</view>
  45. </view>
  46. <view class="list-val" style="line-height: 80rpx;">
  47. 正常
  48. </view>
  49. </view>
  50. </li>
  51. <li>
  52. <view class="list-long">
  53. <view class="" style="display: flex;">
  54. <image src="../../static/icon_yxms.png" mode=""></image>
  55. <view class="list-label" style="line-height: 80rpx;color: #666666;">运行模式</view>
  56. </view>
  57. <view class="list-val" style="line-height: 80rpx;">
  58. 自动
  59. </view>
  60. </view>
  61. </li>
  62. <li>
  63. <view class="list-long">
  64. <view class="" style="display: flex;">
  65. <image src="../../static/icon_kjsj.png" mode=""></image>
  66. <view class="list-label" style="line-height: 80rpx;color: #666666;">开机时间</view>
  67. </view>
  68. <view class="list-val" style="line-height: 80rpx;">
  69. 6.5H
  70. </view>
  71. </view>
  72. </li>
  73. </ul>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. getInfo
  80. } from "@/util/api.js";
  81. import Vue from 'vue'
  82. import commonsHeader from '../../components/commons-header/index.vue'
  83. export default {
  84. components: {
  85. commonsHeader
  86. },
  87. data() {
  88. return {
  89. userInfoData: [],
  90. notificationData: [],
  91. equData:{
  92. properties:{
  93. status:{
  94. main_speed:0,
  95. bu_len:0,
  96. },
  97. parameter:{
  98. max_bulen:0,
  99. },
  100. },
  101. },
  102. axisData:[],
  103. swichType:false,
  104. }
  105. },
  106. onLoad(option) {
  107. const v = this
  108. //v.getData(option.id)
  109. },
  110. methods: {
  111. getData(_id){
  112. const v = this
  113. v.$post('/api/syringe-production/factoryProduct/getData',{equipmentNo:_id}).then(res => {
  114. console.log(res.data)
  115. this.axisData = []
  116. for (let key in res.data.properties.parameter) {
  117. if(key.substring(0,11) === 'axis_allnum'){
  118. this.axisData.push({
  119. axis:res.data.properties.parameter[key],
  120. index:key.substring(12,13),
  121. curr:res.data.properties.status['curr_num_' + key.substring(12,13)] || 0,
  122. time:res.data.properties.status['left_time_' + key.substring(12,13)] || 0,
  123. })
  124. }
  125. }
  126. function up(x,y){
  127. return x.index -y.index;
  128. }
  129. this.axisData.sort(up)
  130. v.equData = res.data
  131. const time1 = new Date(res.data.eventTime).getTime()
  132. const time2 = new Date().getTime()
  133. if(time1 + 600000 > time2){
  134. this.swichType = true
  135. }else{
  136. this.swichType = false
  137. }
  138. console.log(time1,time2)
  139. })
  140. setTimeout(()=>{
  141. if(v.equData) v.getData(_id)
  142. },5000)
  143. },
  144. toRouter(j) {
  145. console.log(j)
  146. uni.navigateTo({
  147. url: '/pages/' + j.menuKey + '/' + j.menuKey
  148. })
  149. },
  150. },
  151. }
  152. </script>
  153. <style lang="less">
  154. .equipmentDtl {
  155. background-color: #f0f0f0;
  156. min-height: 100vh;
  157. margin-top: 128rpx;
  158. .ebc-content{
  159. background-color: #fff;
  160. margin: 24rpx 24rpx;
  161. border-radius: 10rpx;
  162. padding-bottom: 24rpx;
  163. padding-top:8rpx;
  164. .list-long{
  165. height: 122rpx;
  166. margin: 24rpx 24rpx 0;
  167. display: flex;
  168. justify-content: space-between;
  169. background-color: #F1F1F1;
  170. padding: 24rpx 24rpx;
  171. box-sizing: border-box;
  172. border-radius: 10rpx;
  173. font-size: 24rpx;
  174. .list-val{
  175. font-size: 32rpx;
  176. }
  177. image{
  178. width: 80rpx;
  179. height: 80rpx;
  180. margin-right: 24rpx;
  181. }
  182. }
  183. .list-bc{
  184. display: flex;
  185. justify-content: space-between;
  186. padding: 0 24rpx;
  187. .bc-box{
  188. height: 112rpx;
  189. width: 48%;
  190. display: flex;
  191. background-color: #F1F1F1;
  192. padding: 18rpx 24rpx;
  193. box-sizing: border-box;
  194. border-radius: 10rpx;
  195. font-size: 24rpx;
  196. .list-val{
  197. font-size: 32rpx;
  198. font-weight: bold;
  199. }
  200. image{
  201. width: 80rpx;
  202. height: 80rpx;
  203. margin-right: 24rpx;
  204. }
  205. }
  206. }
  207. }
  208. .action{
  209. display: flex;
  210. justify-content: space-between;
  211. margin: 24rpx 24rpx 0;
  212. li{
  213. width: 32%;
  214. text-align: center;
  215. background-color: #fff;
  216. font-size: 28rpx;
  217. border-radius: 10rpx;
  218. padding: 24rpx 0;
  219. image{
  220. width: 100rpx;
  221. height: 100rpx;
  222. }
  223. .state-text{
  224. text-align: center;
  225. }
  226. }
  227. }
  228. .rate-warp{
  229. margin-top: 20rpx;
  230. .sm-rate{
  231. display: flex;
  232. justify-content: space-between;
  233. flex-wrap: wrap;
  234. padding: 0 24rpx;
  235. li{
  236. background-color: #fff;
  237. border-radius: 10rpx;
  238. height: 120rpx;
  239. display: flex;
  240. justify-content: space-between;
  241. margin-top: 24rpx;
  242. align-items: center;
  243. padding: 0 24rpx;
  244. width: 296rpx;
  245. font-size: 28rpx;
  246. color: #666;
  247. .right-box{
  248. font-size: 32rpx;
  249. color: #333;
  250. .line{
  251. width: 70rpx;
  252. height: 8rpx;
  253. background: rgba(238,238,238,1);
  254. border-radius: 4rpx;
  255. margin-top: 6rpx;
  256. .box{
  257. width:50%;
  258. background-color: #BB99F6;
  259. height: 100%;
  260. border-radius: 12rpx;
  261. }
  262. }
  263. }
  264. }
  265. }
  266. .big-rate{
  267. li{
  268. margin-top: 24rpx;
  269. height: 128rpx;
  270. display: flex;
  271. align-items: center;
  272. background-color: #fff;
  273. margin: 0 24rpx;
  274. border-radius: 10rpx;
  275. padding: 0 24rpx;
  276. .text{
  277. font-weight: 500;
  278. font-size: 28rpx;
  279. color: #333;
  280. }
  281. .line{
  282. width: 240rpx;
  283. margin-left: 90rpx;
  284. height: 24rpx;
  285. background: rgba(238,238,238,1);
  286. margin-right: 40rpx;
  287. border-radius: 12rpx;
  288. .box{
  289. width:50%;
  290. background-color: rgba(255,175,83,1);
  291. height: 100%;
  292. border-radius: 12rpx;
  293. }
  294. }
  295. }
  296. }
  297. }
  298. .parts-list{
  299. padding: 0 24rpx;
  300. margin-top: 24rpx;
  301. ul{
  302. display: flex;
  303. justify-content: space-between;
  304. }
  305. li{
  306. width: 32%;
  307. padding: 30rpx 0;
  308. text-align: center;
  309. position: relative;
  310. background-color: #fff;
  311. image{
  312. width: 60rpx;
  313. height: 60rpx;
  314. display: block;
  315. margin: 0 auto 20rpx;
  316. }
  317. }
  318. .before{
  319. width: 30rpx;
  320. height: 30rpx;
  321. border-radius: 50%;
  322. background-color: rgba(204,204,204,0.2);
  323. display: block;
  324. position: absolute;
  325. right: 16rpx;
  326. top: 16rpx;
  327. }
  328. .before::before{
  329. position: absolute;
  330. display: block;
  331. top: 7rpx;
  332. left: 7rpx;
  333. width: 19rpx;
  334. height: 19rpx;
  335. border-radius: 50%;
  336. content:" ";
  337. background: #cccccc;
  338. }
  339. .before.succes{
  340. background-color: rgba(63,191,49,0.2);
  341. }
  342. .before.succes::before{
  343. background: #3FBF31;
  344. }
  345. }
  346. .echarts {
  347. background: #fff;
  348. margin: 24rpx 24rpx 0;
  349. .content{
  350. .text{
  351. font-size: 28rpx;
  352. font-weight: 700;
  353. color: #333;
  354. text-align: center;
  355. margin-bottom: 40rpx;
  356. }
  357. }
  358. .title{
  359. font-size: 28rpx;
  360. height: 90rpx;
  361. line-height: 90rpx;
  362. display: flex;
  363. padding: 0 24rpx;
  364. font-weight: 500;
  365. image{
  366. width: 40rpx;
  367. height: 40rpx;
  368. margin-top: 25rpx;
  369. margin-right: 16rpx;
  370. }
  371. }
  372. }
  373. .parts-list {}
  374. .equ-img {
  375. padding: 24rpx;
  376. background-color: #ffffff;
  377. position: relative;
  378. image {
  379. width: 100%;
  380. height: 395rpx;
  381. }
  382. .err-modal{
  383. position: absolute;
  384. left: 0;
  385. right: 0;
  386. bottom: 0;
  387. top: 0;
  388. background: rgba(0,0,0,0.60);
  389. text-align: center;
  390. display: flex;
  391. align-items: center;
  392. image{
  393. width: 160rpx;
  394. height: 160rpx;
  395. margin: 0 auto;
  396. }
  397. }
  398. }
  399. .state {
  400. display: flex;
  401. justify-content: space-between;
  402. margin: 24rpx 24rpx 0;
  403. .state-box {
  404. padding: 20rpx;
  405. width: 48%;
  406. background-color: #fff;
  407. display: flex;
  408. box-sizing: border-box;
  409. border-radius: 10rpx;
  410. .text{
  411. padding: 12rpx 0;
  412. }
  413. .state-text{
  414. font-size: 32rpx;
  415. font-weight: bold;
  416. margin-top: 5rpx;
  417. }
  418. .label{
  419. font-weight: 400;
  420. font-size: 28rpx;
  421. }
  422. image {
  423. width: 110rpx;
  424. height: 110rpx;
  425. }
  426. }
  427. }
  428. }
  429. </style>