warpKnitting.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <van-nav-bar title="标题" left-arrow />
  3. <van-pull-refresh v-model="loading" @refresh="onRefresh">
  4. <div class="warpKnitting">
  5. <div class="stat">
  6. <div class="title">
  7. <span>设备状态</span>
  8. <div class="type">运行</div>
  9. </div>
  10. <ul>
  11. <li>
  12. <div class="icon">
  13. <van-icon name="location-o" />
  14. </div>
  15. <div class="text">EBC</div>
  16. <div class="btn">运行</div>
  17. </li>
  18. <li>
  19. <div class="icon">
  20. <van-icon name="location-o" />
  21. </div>
  22. <div class="text">EBC</div>
  23. <div class="btn">运行</div>
  24. </li>
  25. <li>
  26. <div class="icon">
  27. <van-icon name="location-o" />
  28. </div>
  29. <div class="text">EBC</div>
  30. <div class="btn">运行</div>
  31. </li>
  32. </ul>
  33. </div>
  34. <div class="speed">
  35. <div style="display: flex">
  36. <div class="icon">
  37. <van-icon name="location-o" />
  38. </div>
  39. <div class="text">主轴转速</div>
  40. </div>
  41. <div class="num">400 RPM</div>
  42. </div>
  43. <div class="commons-title">产量数据</div>
  44. <div class="chart-warp">
  45. <div class="chart-box" id="myCharts" ref="myCharts"></div>
  46. <div class="label-box">
  47. </div>
  48. </div>
  49. <div class="commons-title">EBC</div>
  50. <ul class="buchang">
  51. <li>
  52. <div class="icon">
  53. <van-icon size="20px" name="location-o" />
  54. </div>
  55. <div class="text">当前布长</div>
  56. <div class="btn">200M</div>
  57. </li>
  58. <li>
  59. <div class="icon">
  60. <van-icon size="20px" name="location-o" />
  61. </div>
  62. <div class="text">设定布长</div>
  63. <div class="btn">300M</div>
  64. </li>
  65. <li>
  66. <div class="icon">
  67. <van-icon size="20px" name="location-o" />
  68. </div>
  69. <div class="text">密度</div>
  70. <div class="btn">50</div>
  71. </li>
  72. </ul>
  73. <ul class="qianla">
  74. <li>
  75. <div class="icon">
  76. <van-icon size="20px" name="location-o" />
  77. </div>
  78. <div class="text">牵拉</div>
  79. </li>
  80. <li>
  81. <div class="icon">
  82. <van-icon size="20px" name="location-o" />
  83. </div>
  84. <div class="text">卷曲</div>
  85. </li>
  86. </ul>
  87. <ul class="songjin">
  88. <li>
  89. <div style="display: flex">
  90. <div class="icon">
  91. <van-icon name="location-o" />
  92. </div>
  93. <div class="text" style="margin-left: 8px">
  94. 主轴转速
  95. </div>
  96. </div>
  97. <div class="num">
  98. <p>剩余圈数: <span>35 N</span></p>
  99. <p>剩余圈数: <span>35 N</span></p>
  100. </div>
  101. </li>
  102. <li>
  103. <div style="display: flex">
  104. <div class="icon">
  105. <van-icon name="location-o" />
  106. </div>
  107. <div class="text" style="margin-left: 8px">
  108. 主轴转速
  109. </div>
  110. </div>
  111. <div class="num">
  112. <p>剩余圈数: <span>35 N</span></p>
  113. <p>剩余圈数: <span>35 N</span></p>
  114. </div>
  115. </li>
  116. <li>
  117. <div style="display: flex">
  118. <div class="icon">
  119. <van-icon name="location-o" />
  120. </div>
  121. <div class="text" style="margin-left: 8px">
  122. 主轴转速
  123. </div>
  124. </div>
  125. <div class="num">
  126. <p>剩余圈数: <span>35 N</span></p>
  127. <p>剩余圈数: <span>35 N</span></p>
  128. </div>
  129. </li>
  130. </ul>
  131. </div>
  132. </van-pull-refresh>
  133. </template>
  134. <script setup>
  135. import * as echarts from 'echarts'
  136. import { ref, onMounted,getCurrentInstance } from 'vue'
  137. import { useRouter } from 'vue-router'
  138. const proxy = getCurrentInstance().proxy
  139. const loading = ref(false)
  140. const onRefresh = () => {
  141. setTimeout(() => {
  142. loading.value = false
  143. }, 500)
  144. }
  145. const router = useRouter()
  146. const getDtl = () => {
  147. proxy.post('/tdaDevice/data', { deviceId: router.currentRoute.value.params.id }).then(
  148. (res) => {
  149. console.log(res)
  150. }
  151. )
  152. }
  153. getDtl()
  154. onMounted(() => {
  155. const myChart = echarts.init(document.getElementById('myCharts'))
  156. const option = {
  157. grid: {
  158. top: '8%',
  159. left: '4%',
  160. right: '8%',
  161. bottom: '8%',
  162. containLabel: true,
  163. },
  164. tooltip: {
  165. trigger: 'axis',
  166. axisPointer: {
  167. type: 'cross',
  168. label: {
  169. backgroundColor: '#6a7985',
  170. },
  171. },
  172. },
  173. xAxis: {
  174. type: 'category',
  175. boundaryGap: false,
  176. data: ['0', '1', '2', '3', '4', '5', '6'],
  177. },
  178. yAxis: {
  179. type: 'value',
  180. },
  181. series: [
  182. {
  183. data: [135, 135, 122, 211, 345, 567, 654],
  184. type: 'line',
  185. symbolSize: 10,
  186. showSymbol: false,
  187. areaStyle: {
  188. opacity: 0,
  189. },
  190. stack: 'Total',
  191. smooth: true,
  192. lineStyle: {
  193. normal: {
  194. color: '#0084FF',
  195. width: 4,
  196. },
  197. },
  198. },
  199. {
  200. data: [150, 150, 150, 150, 150, 150, 150],
  201. type: 'line',
  202. symbolSize: 10,
  203. showSymbol: false,
  204. areaStyle: {
  205. opacity: 0,
  206. },
  207. lineStyle: {
  208. normal: {
  209. color: '#FF8C33',
  210. width: 4,
  211. },
  212. },
  213. },
  214. ],
  215. }
  216. myChart.setOption(option)
  217. })
  218. </script>
  219. <style lang="scss" scoped>
  220. .warpKnitting {
  221. padding: 0 12px 80px;
  222. .chart-warp{
  223. background: #fff;
  224. .chart-box {
  225. height: 250px;
  226. }
  227. }
  228. .songjin {
  229. li {
  230. height: 74px;
  231. background: #ffffff;
  232. border-radius: 5px 5px 5px 5px;
  233. line-height: 50px;
  234. display: flex;
  235. justify-content: space-between;
  236. margin-top: 12px;
  237. padding: 12px;
  238. box-sizing: border-box;
  239. font-size: 14px;
  240. .icon {
  241. width: 50px;
  242. height: 50px;
  243. border-radius: 50%;
  244. background: #eeeeee;
  245. text-align: center;
  246. .van-icon {
  247. color: #0084ff;
  248. }
  249. }
  250. .num {
  251. margin-left: 8px;
  252. font-size: 14px;
  253. font-weight: 500;
  254. color: #333;
  255. p {
  256. margin: 0;
  257. line-height: 25px;
  258. color: #999999;
  259. }
  260. span {
  261. color: #333333;
  262. }
  263. }
  264. }
  265. }
  266. .qianla {
  267. display: flex;
  268. justify-content: space-between;
  269. margin-top: 12px;
  270. li {
  271. display: flex;
  272. width: 49%;
  273. line-height: 50px;
  274. padding: 12px;
  275. box-sizing: border-box;
  276. font-size: 14px;
  277. background: #ffffff;
  278. border-radius: 5px 5px 5px 5px;
  279. .icon {
  280. width: 50px;
  281. height: 50px;
  282. border-radius: 50%;
  283. background: #eeeeee;
  284. text-align: center;
  285. .van-icon {
  286. color: #0084ff;
  287. }
  288. }
  289. .text {
  290. margin-left: 8px;
  291. font-size: 14px;
  292. font-weight: 500;
  293. color: #333;
  294. }
  295. }
  296. }
  297. .buchang {
  298. display: flex;
  299. justify-content: space-between;
  300. text-align: center;
  301. li {
  302. width: 32%;
  303. background: #ffffff;
  304. border-radius: 5px 5px 5px 5px;
  305. line-height: 50px;
  306. padding: 12px;
  307. box-sizing: border-box;
  308. font-size: 14px;
  309. .icon {
  310. width: 50px;
  311. height: 50px;
  312. border-radius: 50%;
  313. background: #eeeeee;
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. margin: 0 auto;
  318. .van-icon {
  319. color: #0084ff;
  320. }
  321. }
  322. .btn {
  323. font-size: 16px;
  324. font-weight: bold;
  325. line-height: 20px;
  326. }
  327. .text {
  328. line-height: 20px;
  329. margin: 12px 0 8px;
  330. }
  331. }
  332. }
  333. .speed {
  334. height: 74px;
  335. background: #ffffff;
  336. border-radius: 5px 5px 5px 5px;
  337. line-height: 50px;
  338. display: flex;
  339. justify-content: space-between;
  340. margin-top: 12px;
  341. padding: 12px;
  342. box-sizing: border-box;
  343. font-size: 14px;
  344. .icon {
  345. width: 50px;
  346. height: 50px;
  347. border-radius: 15px;
  348. background: #00b0ff;
  349. display: flex;
  350. justify-content: center;
  351. align-items: center;
  352. margin-right: 12px;
  353. .van-icon {
  354. color: #fff;
  355. }
  356. }
  357. .num {
  358. font-size: 16px;
  359. font-weight: bold;
  360. }
  361. }
  362. .stat {
  363. background: #ffffff;
  364. border-radius: 5px 5px 5px 5px;
  365. margin-top: 12px;
  366. .title {
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. height: 48px;
  371. line-height: 48px;
  372. padding: 0 12px;
  373. border-bottom: 1px solid #dddddd;
  374. .type {
  375. color: #00b0ff;
  376. font-size: 14px;
  377. width: 60px;
  378. height: 24px;
  379. background: #f1f1f1;
  380. color: #3fbf31;
  381. line-height: 24px;
  382. position: relative;
  383. border-radius: 12px 12px 12px 12px;
  384. padding-left: 20px;
  385. box-sizing: border-box;
  386. }
  387. .type:before {
  388. content: '';
  389. position: absolute;
  390. left: 6px;
  391. top: 6px;
  392. width: 12px;
  393. height: 12px;
  394. background: #3fbf31;
  395. border-radius: 50%;
  396. }
  397. }
  398. ul {
  399. display: flex;
  400. justify-content: space-between;
  401. align-items: center;
  402. padding: 20px 30px 22px;
  403. box-sizing: border-box;
  404. li {
  405. display: flex;
  406. flex-direction: column;
  407. align-items: center;
  408. .icon {
  409. width: 50px;
  410. height: 50px;
  411. border-radius: 15px;
  412. background: #00b0ff;
  413. display: flex;
  414. justify-content: center;
  415. align-items: center;
  416. margin-bottom: 12px;
  417. .van-icon {
  418. color: #fff;
  419. }
  420. }
  421. .text {
  422. color: #333;
  423. font-size: 14px;
  424. }
  425. .btn {
  426. width: 60px;
  427. height: 24px;
  428. background: #f1f1f1;
  429. border-radius: 12px 12px 12px 12px;
  430. margin-top: 8px;
  431. text-align: center;
  432. line-height: 24px;
  433. font-weight: 500;
  434. font-size: 14px;
  435. color: #3fbf31;
  436. }
  437. }
  438. }
  439. }
  440. }
  441. </style>