warpKnitting.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <!-- 精编机 -->
  3. <view class="equipmentDtl">
  4. <commons-header :title="$t('warpKnitting.name')"></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/jinbian/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/jinbian/icon_gzms.png" mode=""></image>
  25. <view class="text">
  26. <view class="label">
  27. 主轴转速
  28. </view>
  29. <view class="state-text">
  30. {{equData.properties.status.main_speed / 2}} RPM
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <ul class="action">
  36. <li>
  37. <image src="../../static/jinbian/icon_ebc2.png" mode=""></image>
  38. <p>EBC</p>
  39. <view class="state-text">{{swichType ? '在线' : '离线'}}</view>
  40. </li>
  41. <li>
  42. <image src="../../static/jinbian/icon_jk2.png" mode=""></image>
  43. <p>贾卡</p>
  44. <view class="state-text">离线</view>
  45. </li>
  46. <li>
  47. <image src="../../static/jinbian/icon_hy.png" mode=""></image>
  48. <p>横移</p>
  49. <view class="state-text">离线</view>
  50. </li>
  51. </ul>
  52. <view class="echarts">
  53. <view class="title">
  54. <image src="../../static/jinbian/btn_kanban_blue.png" mode=""></image>
  55. <span>产量数据</span>
  56. </view>
  57. <view class="content">
  58. <view class="text">
  59. 12小时产量
  60. </view>
  61. <qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
  62. </view>
  63. </view>
  64. <view class="ebc-content">
  65. <view class="commons-title">
  66. EBC
  67. </view>
  68. <view class="list-bc">
  69. <view class="bc-box">
  70. <image src="../../static/jinbian/icon_currentl.png" mode=""></image>
  71. <view class="text">
  72. <view class="list-label">当前布长</view>
  73. <view class="list-val">
  74. {{equData.properties.status.bu_len / 100}} M
  75. </view>
  76. </view>
  77. </view>
  78. <view class="bc-box">
  79. <image src="../../static/jinbian/icon_currentl.png" mode=""></image>
  80. <view class="text">
  81. <view class="list-label">设定布长</view>
  82. <view class="list-val">
  83. {{equData.properties.parameter.max_bulen}} M
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="list-long">
  89. <view class="" style="display: flex;">
  90. <image src="../../static/jinbian/icon_density.png" mode=""></image>
  91. <view class="list-label" style="line-height: 80rpx;">密度</view>
  92. </view>
  93. <view class="list-val" style="line-height: 80rpx;">
  94. {{equData.properties.parameter.bumi}} Row/cm
  95. </view>
  96. </view>
  97. <view class="list-long" v-for="i in axisData">
  98. <view class="" style="display: flex;">
  99. <image src="../../static/jinbian/icon_xlj.png" mode=""></image>
  100. <view class="list-label" style="line-height: 80rpx;font-size: 28rpx;font-weight: bold;">送经轴{{i.index}}</view>
  101. </view>
  102. <view class="list-val" style="line-height: 40rpx;color: #666666;font-size: 24rpx;">
  103. <!-- {{i.axis - i.curr}} -->
  104. <p>剩余圈数:{{i.curr}} N</p>
  105. <p>剩余时间:{{i.time}} H</p>
  106. </view>
  107. </view>
  108. <view class="list-bc mt-24">
  109. <view class="bc-box">
  110. <image src="../../static/jinbian/icon_drawoff.png" mode=""></image>
  111. <view class="text" style="line-height: 80rpx;">
  112. 牵拉
  113. </view>
  114. </view>
  115. <view class="bc-box">
  116. <image src="../../static/jinbian/icon_batching.png" mode=""></image>
  117. <view class="text" style="line-height: 80rpx;">
  118. 卷曲
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="ebc-content">
  124. <view class="commons-title">
  125. 贾卡
  126. </view>
  127. <view class="list-bc">
  128. <view class="bc-box">
  129. <image src="../../static/jinbian/icon_currentl.png" mode=""></image>
  130. <view class="text">
  131. <view class="list-label">工艺宽度</view>
  132. <view class="list-val">
  133. 0
  134. </view>
  135. </view>
  136. </view>
  137. <view class="bc-box">
  138. <image src="../../static/jinbian/icon_currentl.png" mode=""></image>
  139. <view class="text">
  140. <view class="list-label">工艺高度</view>
  141. <view class="list-val">
  142. 0
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. <view class="ebc-content">
  149. <view class="commons-title">
  150. 横移
  151. </view>
  152. <view class="list-long">
  153. <view class="" style="display: flex;">
  154. <image src="../../static/jinbian/icon_density.png" mode=""></image>
  155. <view class="list-label" style="line-height: 80rpx;">总轴数</view>
  156. </view>
  157. <view class="list-val" style="line-height: 80rpx;">
  158. 0
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </template>
  164. <script>
  165. import {
  166. getInfo
  167. } from "@/util/api.js";
  168. import Vue from 'vue'
  169. import commonsHeader from '../../components/commons-header/index.vue'
  170. export default {
  171. components: {
  172. commonsHeader
  173. },
  174. data() {
  175. return {
  176. userInfoData: [],
  177. notificationData: [],
  178. opts: {
  179. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  180. "#ea7ccc"
  181. ],
  182. padding: [15, 10, 0, 15],
  183. legend: {},
  184. xAxis: {
  185. disableGrid: true
  186. },
  187. yAxis: {
  188. gridType: "dash",
  189. dashLength: 2
  190. },
  191. extra: {
  192. line: {
  193. type: "curve",
  194. width: 2
  195. }
  196. }
  197. },
  198. chartData: {
  199. categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
  200. series: [{
  201. name: "极限产量",
  202. data: [0,0,0,0,0,0,0,0]
  203. },
  204. {
  205. name: "实际产量",
  206. data: [0, 0, 0, 0, 0, 0]
  207. },
  208. ]
  209. },
  210. equData:{
  211. properties:{
  212. status:{
  213. main_speed:0,
  214. bu_len:0,
  215. },
  216. parameter:{
  217. max_bulen:0,
  218. },
  219. },
  220. },
  221. axisData:[],
  222. swichType:false,
  223. }
  224. },
  225. onLoad(option) {
  226. const v = this
  227. v.getData(option.id)
  228. },
  229. methods: {
  230. getData(_id){
  231. const v = this
  232. v.$post('/api/syringe-production/factoryProduct/getData',{equipmentNo:_id}).then(res => {
  233. console.log(res.data)
  234. this.axisData = []
  235. for (let key in res.data.properties.parameter) {
  236. if(key.substring(0,11) === 'axis_allnum'){
  237. this.axisData.push({
  238. axis:res.data.properties.parameter[key],
  239. index:key.substring(12,13),
  240. curr:res.data.properties.status['curr_num_' + key.substring(12,13)] || 0,
  241. time:res.data.properties.status['left_time_' + key.substring(12,13)] || 0,
  242. })
  243. }
  244. }
  245. function up(x,y){
  246. return x.index -y.index;
  247. }
  248. this.axisData.sort(up)
  249. v.equData = res.data
  250. const time1 = new Date(res.data.eventTime).getTime()
  251. const time2 = new Date().getTime()
  252. if(time1 + 600000 > time2){
  253. this.swichType = true
  254. }else{
  255. this.swichType = false
  256. }
  257. console.log(time1,time2)
  258. })
  259. setTimeout(()=>{
  260. if(v.equData) v.getData(_id)
  261. },5000)
  262. },
  263. toRouter(j) {
  264. console.log(j)
  265. uni.navigateTo({
  266. url: '/pages/' + j.menuKey + '/' + j.menuKey
  267. })
  268. },
  269. },
  270. }
  271. </script>
  272. <style lang="less">
  273. .equipmentDtl {
  274. background-color: #f0f0f0;
  275. min-height: 100vh;
  276. margin-top: 128rpx;
  277. .ebc-content{
  278. background-color: #fff;
  279. margin: 24rpx 24rpx;
  280. border-radius: 10rpx;
  281. padding-bottom: 24rpx;
  282. .list-long{
  283. height: 112rpx;
  284. margin: 24rpx 24rpx 0;
  285. display: flex;
  286. justify-content: space-between;
  287. background-color: #F1F1F1;
  288. padding: 18rpx 24rpx;
  289. box-sizing: border-box;
  290. border-radius: 10rpx;
  291. font-size: 24rpx;
  292. .list-val{
  293. font-size: 32rpx;
  294. font-weight: bold;
  295. }
  296. image{
  297. width: 80rpx;
  298. height: 80rpx;
  299. margin-right: 24rpx;
  300. }
  301. }
  302. .list-bc{
  303. display: flex;
  304. justify-content: space-between;
  305. padding: 0 24rpx;
  306. .bc-box{
  307. height: 112rpx;
  308. width: 48%;
  309. display: flex;
  310. background-color: #F1F1F1;
  311. padding: 18rpx 24rpx;
  312. box-sizing: border-box;
  313. border-radius: 10rpx;
  314. font-size: 24rpx;
  315. .list-val{
  316. font-size: 32rpx;
  317. font-weight: bold;
  318. }
  319. image{
  320. width: 80rpx;
  321. height: 80rpx;
  322. margin-right: 24rpx;
  323. }
  324. }
  325. }
  326. }
  327. .action{
  328. display: flex;
  329. justify-content: space-between;
  330. margin: 24rpx 24rpx 0;
  331. li{
  332. width: 32%;
  333. text-align: center;
  334. background-color: #fff;
  335. font-size: 28rpx;
  336. border-radius: 10rpx;
  337. padding: 24rpx 0;
  338. image{
  339. width: 100rpx;
  340. height: 100rpx;
  341. }
  342. .state-text{
  343. text-align: center;
  344. }
  345. }
  346. }
  347. .rate-warp{
  348. margin-top: 20rpx;
  349. .sm-rate{
  350. display: flex;
  351. justify-content: space-between;
  352. flex-wrap: wrap;
  353. padding: 0 24rpx;
  354. li{
  355. background-color: #fff;
  356. border-radius: 10rpx;
  357. height: 120rpx;
  358. display: flex;
  359. justify-content: space-between;
  360. margin-top: 24rpx;
  361. align-items: center;
  362. padding: 0 24rpx;
  363. width: 296rpx;
  364. font-size: 28rpx;
  365. color: #666;
  366. .right-box{
  367. font-size: 32rpx;
  368. color: #333;
  369. .line{
  370. width: 70rpx;
  371. height: 8rpx;
  372. background: rgba(238,238,238,1);
  373. border-radius: 4rpx;
  374. margin-top: 6rpx;
  375. .box{
  376. width:50%;
  377. background-color: #BB99F6;
  378. height: 100%;
  379. border-radius: 12rpx;
  380. }
  381. }
  382. }
  383. }
  384. }
  385. .big-rate{
  386. li{
  387. margin-top: 24rpx;
  388. height: 128rpx;
  389. display: flex;
  390. align-items: center;
  391. background-color: #fff;
  392. margin: 0 24rpx;
  393. border-radius: 10rpx;
  394. padding: 0 24rpx;
  395. .text{
  396. font-weight: 500;
  397. font-size: 28rpx;
  398. color: #333;
  399. }
  400. .line{
  401. width: 240rpx;
  402. margin-left: 90rpx;
  403. height: 24rpx;
  404. background: rgba(238,238,238,1);
  405. margin-right: 40rpx;
  406. border-radius: 12rpx;
  407. .box{
  408. width:50%;
  409. background-color: rgba(255,175,83,1);
  410. height: 100%;
  411. border-radius: 12rpx;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. .parts-list{
  418. padding: 0 24rpx;
  419. margin-top: 24rpx;
  420. ul{
  421. display: flex;
  422. justify-content: space-between;
  423. }
  424. li{
  425. width: 32%;
  426. padding: 30rpx 0;
  427. text-align: center;
  428. position: relative;
  429. background-color: #fff;
  430. image{
  431. width: 60rpx;
  432. height: 60rpx;
  433. display: block;
  434. margin: 0 auto 20rpx;
  435. }
  436. }
  437. .before{
  438. width: 30rpx;
  439. height: 30rpx;
  440. border-radius: 50%;
  441. background-color: rgba(204,204,204,0.2);
  442. display: block;
  443. position: absolute;
  444. right: 16rpx;
  445. top: 16rpx;
  446. }
  447. .before::before{
  448. position: absolute;
  449. display: block;
  450. top: 7rpx;
  451. left: 7rpx;
  452. width: 19rpx;
  453. height: 19rpx;
  454. border-radius: 50%;
  455. content:" ";
  456. background: #cccccc;
  457. }
  458. .before.succes{
  459. background-color: rgba(63,191,49,0.2);
  460. }
  461. .before.succes::before{
  462. background: #3FBF31;
  463. }
  464. }
  465. .echarts {
  466. background: #fff;
  467. margin: 24rpx 24rpx 0;
  468. .content{
  469. .text{
  470. font-size: 28rpx;
  471. font-weight: 700;
  472. color: #333;
  473. text-align: center;
  474. margin-bottom: 40rpx;
  475. }
  476. }
  477. .title{
  478. font-size: 28rpx;
  479. height: 90rpx;
  480. line-height: 90rpx;
  481. display: flex;
  482. padding: 0 24rpx;
  483. font-weight: 500;
  484. image{
  485. width: 40rpx;
  486. height: 40rpx;
  487. margin-top: 25rpx;
  488. margin-right: 16rpx;
  489. }
  490. }
  491. }
  492. .parts-list {}
  493. .equ-img {
  494. padding: 24rpx;
  495. background-color: #ffffff;
  496. position: relative;
  497. image {
  498. width: 100%;
  499. height: 395rpx;
  500. }
  501. .err-modal{
  502. position: absolute;
  503. left: 0;
  504. right: 0;
  505. bottom: 0;
  506. top: 0;
  507. background: rgba(0,0,0,0.60);
  508. text-align: center;
  509. display: flex;
  510. align-items: center;
  511. image{
  512. width: 160rpx;
  513. height: 160rpx;
  514. margin: 0 auto;
  515. }
  516. }
  517. }
  518. .state {
  519. display: flex;
  520. justify-content: space-between;
  521. margin: 24rpx 24rpx 0;
  522. .state-box {
  523. padding: 20rpx;
  524. width: 48%;
  525. background-color: #fff;
  526. display: flex;
  527. box-sizing: border-box;
  528. border-radius: 10rpx;
  529. .text{
  530. padding: 12rpx 0;
  531. }
  532. .state-text{
  533. font-size: 32rpx;
  534. font-weight: bold;
  535. margin-top: 5rpx;
  536. }
  537. .label{
  538. font-weight: 400;
  539. font-size: 28rpx;
  540. }
  541. image {
  542. width: 110rpx;
  543. height: 110rpx;
  544. }
  545. }
  546. }
  547. }
  548. </style>