hoist.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <template>
  2. <view>
  3. <!-- 公共参数 -->
  4. <view class="common" v-if="data.common">
  5. <view class="section">
  6. <view class="item" v-for="(item,index) in data.common.position" :key="index" @click="show_item(item)">
  7. <view class="label">{{item.label}}</view>
  8. <view class="value">{{item.value}}</view>
  9. <view class="unit">{{item.unit}}</view>
  10. </view>
  11. </view>
  12. <view class="section">
  13. <view class="state" v-for="(item,index) in data.common.direction" :key="index">
  14. <view class="label">{{item.label}}</view>
  15. <!-- 1-开 2-关 -->
  16. <view class="value value_1" v-if="item.state == 1"></view>
  17. <view class="value value_2" v-if="item.state == 2"></view>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 提升机参数 -->
  22. <view class="content">
  23. <view class="hoist" v-for="(item,index) in data.hoist" :key="index">
  24. <view class="box" v-if="item.state == 1">
  25. <image src="./icon/hoist.jpg" mode=""></image>
  26. </view>
  27. <view class="box" v-if="item.state == 2">
  28. <image src="./icon/hoist.png" mode=""></image>
  29. </view>
  30. <view class="name">{{item.name}}</view>
  31. <!-- 运行参数 -->
  32. <view class="parameter run_parameter">
  33. <view class="title">
  34. <view class="icon">
  35. <image src="./icon/canshu.png" mode=""></image>
  36. </view>
  37. <view class="text">运行参数</view>
  38. </view>
  39. <view class="list">
  40. <view class="item" v-for="(item_2,index_2) in item.run_parameter" :key="index_2"
  41. @click="show_item(item_2)">
  42. <view class="label">{{item_2.label}}</view>
  43. <view class="value">{{item_2.value}}</view>
  44. <view class="unit">{{item_2.unit}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 提升机运行模式 -->
  49. <view class="state_section run_mode">
  50. <view class="title">
  51. <view class="icon">
  52. <image src="./icon/warn.png" mode=""></image>
  53. </view>
  54. <view class="text">提升机运行模式</view>
  55. </view>
  56. <view class="list">
  57. <view class="state" v-for="(item_2,index_2) in item.run_mode" :key="index_2" @click="show_label(item_2.label)">
  58. <view class="label">{{item_2.label}}</view>
  59. <!-- 1-开 2-关 -->
  60. <view class="value value_1" v-if="item_2.state == 1"></view>
  61. <view class="value value_2" v-if="item_2.state == 2"></view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 提升机系统信号 -->
  66. <view class="state_section system_signal">
  67. <view class="title">
  68. <view class="icon">
  69. <image src="./icon/warn.png" mode=""></image>
  70. </view>
  71. <view class="text">提升机系统信号</view>
  72. </view>
  73. <view class="list">
  74. <view class="state" v-for="(item_2,index_2) in item.system_signal" :key="index_2" @click="show_label(item_2.label)">
  75. <view class="label">{{item_2.label}}</view>
  76. <!-- 1-开 2-关 -->
  77. <view class="value value_1" v-if="item_2.state == 1"></view>
  78. <view class="value value_2" v-if="item_2.state == 2"></view>
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 提升机状态 -->
  83. <view class="state_section two_row_state">
  84. <view class="title">
  85. <view class="icon">
  86. <image src="./icon/warn.png" mode=""></image>
  87. </view>
  88. <view class="text">提升机状态</view>
  89. </view>
  90. <view class="list">
  91. <view class="state" v-for="(item_2,index_2) in item.hoist_state" :key="index_2" @click="show_label(item_2.label)">
  92. <view class="label">{{item_2.label}}</view>
  93. <!-- 1-开 2-关 -->
  94. <view class="value value_1" v-if="item_2.state == 1"></view>
  95. <view class="value value_2" v-if="item_2.state == 2"></view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 提升机运行状态 -->
  100. <view class="state_section two_row_state">
  101. <view class="title">
  102. <view class="icon">
  103. <image src="./icon/warn.png" mode=""></image>
  104. </view>
  105. <view class="text">提升机运行状态</view>
  106. </view>
  107. <view class="list">
  108. <view class="state" v-for="(item_2,index_2) in item.hoist_run_state" :key="index_2" @click="show_label(item_2.label)">
  109. <view class="label">{{item_2.label}}</view>
  110. <!-- 1-开 2-关 -->
  111. <view class="value value_1" v-if="item_2.state == 1"></view>
  112. <view class="value value_2" v-if="item_2.state == 2"></view>
  113. </view>
  114. </view>
  115. </view>
  116. <!-- 小罐提升过程状态 -->
  117. <view class="state_section two_row_state">
  118. <view class="title">
  119. <view class="icon">
  120. <image src="./icon/warn.png" mode=""></image>
  121. </view>
  122. <view class="text">小罐提升过程状态</view>
  123. </view>
  124. <view class="list">
  125. <view class="state" v-for="(item_2,index_2) in item.small_lifting_process" :key="index_2" @click="show_label(item_2.label)">
  126. <view class="label">{{item_2.label}}</view>
  127. <!-- 1-开 2-关 -->
  128. <view class="value value_1" v-if="item_2.state == 1"></view>
  129. <view class="value value_2" v-if="item_2.state == 2"></view>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- 大罐提升过程状态 -->
  134. <view class="state_section two_row_state">
  135. <view class="title">
  136. <view class="icon">
  137. <image src="./icon/warn.png" mode=""></image>
  138. </view>
  139. <view class="text">大罐提升过程状态</view>
  140. </view>
  141. <view class="list">
  142. <view class="state" v-for="(item_2,index_2) in item.big_lifting_process" :key="index_2" @click="show_label(item_2.label)">
  143. <view class="label">{{item_2.label}}</view>
  144. <!-- 1-开 2-关 -->
  145. <view class="value value_1" v-if="item_2.state == 1"></view>
  146. <view class="value value_2" v-if="item_2.state == 2"></view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </template>
  154. <script>
  155. import data from './hoist.json'
  156. export default {
  157. data() {
  158. return {
  159. data: {}
  160. };
  161. },
  162. onLoad(option) {
  163. // console.log(data)
  164. // this.data = data
  165. uni.setNavigationBarTitle({
  166. title:option.name
  167. })
  168. this.mine_code = option.mine_code
  169. this.system_type = option.system_type
  170. this.get_data()
  171. this.data_timer = setInterval(()=>{
  172. this.get_data()
  173. },5000)
  174. },
  175. onUnload() {
  176. clearInterval(this.data_timer)
  177. },
  178. methods: {
  179. get_data(){
  180. this.$api.unified_automation_system({
  181. mine_code: this.mine_code,
  182. system_type: this.system_type
  183. }).then((res)=>{
  184. console.log(res.data)
  185. this.data = res.data
  186. })
  187. },
  188. show_item(item) {
  189. uni.showToast({
  190. icon: "none",
  191. title: item.label + " " + item.value + " " + item.unit
  192. })
  193. },
  194. show_label(label){
  195. uni.showToast({
  196. icon: "none",
  197. title: label
  198. })
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss">
  204. page {
  205. background-color: #0B163B;
  206. box-sizing: border-box;
  207. padding: 30rpx 10rpx;
  208. }
  209. .common {
  210. margin: 0 auto;
  211. width: 700rpx;
  212. background-image: url(./icon/common.png);
  213. background-size: 100% 100%;
  214. background-repeat: no-repeat;
  215. box-sizing: border-box;
  216. padding: 40rpx;
  217. display: flex;
  218. justify-content: space-between;
  219. .section {
  220. display: flex;
  221. flex-wrap: wrap;
  222. justify-content: space-between;
  223. .item {
  224. height: 60rpx;
  225. display: flex;
  226. align-items: center;
  227. justify-content: space-between;
  228. color: #4CB1FF;
  229. font-size: 28rpx;
  230. .label {
  231. width: 120rpx;
  232. text-overflow: ellipsis;
  233. white-space: nowrap;
  234. overflow: hidden;
  235. }
  236. .value {
  237. margin: 0 20rpx;
  238. width: 120rpx;
  239. height: 40rpx;
  240. box-sizing: border-box;
  241. padding: 0 10rpx;
  242. background: rgba(0, 4, 15, 0.36);
  243. border: 2rpx solid #3D55A5;
  244. color: #FFF600;
  245. font-size: 24rpx;
  246. text-overflow: ellipsis;
  247. white-space: nowrap;
  248. overflow: hidden;
  249. }
  250. .unit {
  251. width: 100rpx;
  252. text-overflow: ellipsis;
  253. white-space: nowrap;
  254. overflow: hidden;
  255. }
  256. }
  257. .state {
  258. height: 60rpx;
  259. display: flex;
  260. align-items: center;
  261. .label {
  262. text-overflow: ellipsis;
  263. white-space: nowrap;
  264. overflow: hidden;
  265. width: 120rpx;
  266. color: #4CB1FF;
  267. font-size: 28rpx;
  268. }
  269. .value {
  270. margin-left: 20rpx;
  271. width: 40rpx;
  272. height: 40rpx;
  273. border-radius: 50%;
  274. }
  275. .value_1 {
  276. background-color: #00FF00;
  277. }
  278. .value_2 {
  279. background-color: #E5E5E5;
  280. }
  281. }
  282. }
  283. }
  284. .content {
  285. margin-top: 40rpx;
  286. .hoist {
  287. margin: 0 auto;
  288. width: 700rpx;
  289. .box {
  290. text-align: center;
  291. image {
  292. width: 150rpx;
  293. height: 174rpx;
  294. }
  295. }
  296. .name {
  297. margin-top: 20rpx;
  298. text-align: center;
  299. color: #DEF1FF;
  300. font-size: 34rpx;
  301. font-weight: 700;
  302. }
  303. .parameter {
  304. box-sizing: border-box;
  305. margin-top: 40rpx;
  306. .title {
  307. margin: 0 auto;
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. width: 230rpx;
  312. height: 60rpx;
  313. background-image: url(./icon/border.png);
  314. background-size: 100% 100%;
  315. background-repeat: no-repeat;
  316. .icon {
  317. margin-right: 20rpx;
  318. image {
  319. width: 30rpx;
  320. height: 30rpx;
  321. }
  322. }
  323. .text {
  324. color: #00FFF6;
  325. font-size: 30rpx;
  326. }
  327. }
  328. .list {
  329. margin-top: 40rpx;
  330. .item {
  331. height: 60rpx;
  332. display: flex;
  333. color: #4CB1FF;
  334. font-size: 28rpx;
  335. .label {
  336. width: 200rpx;
  337. text-align: justify;
  338. text-align-last: justify;
  339. text-overflow: ellipsis;
  340. white-space: nowrap;
  341. overflow: hidden;
  342. }
  343. .value {
  344. margin: 0 40rpx;
  345. width: 200rpx;
  346. height: 40rpx;
  347. box-sizing: border-box;
  348. padding: 0 10rpx;
  349. background: rgba(0, 4, 15, 0.36);
  350. border: 2rpx solid #3D55A5;
  351. color: #FFF600;
  352. font-size: 24rpx;
  353. text-overflow: ellipsis;
  354. white-space: nowrap;
  355. overflow: hidden;
  356. }
  357. .unit {
  358. width: 100rpx;
  359. }
  360. }
  361. }
  362. }
  363. .state_section {
  364. margin-top: 40rpx;
  365. .title {
  366. margin: 20rpx auto;
  367. display: flex;
  368. justify-content: center;
  369. align-items: center;
  370. width: 300rpx;
  371. height: 60rpx;
  372. background-image: url(./icon/border.png);
  373. background-size: 100% 100%;
  374. background-repeat: no-repeat;
  375. .icon {
  376. margin-right: 20rpx;
  377. image {
  378. width: 30rpx;
  379. height: 30rpx;
  380. }
  381. }
  382. .text {
  383. color: #00FFF6;
  384. font-size: 30rpx;
  385. }
  386. }
  387. .list {
  388. overflow: hidden;
  389. .state {
  390. box-sizing: border-box;
  391. float: left;
  392. margin-right: 20rpx;
  393. width: 160rpx;
  394. height: 70rpx;
  395. display: flex;
  396. align-items: center;
  397. .label {
  398. width: 80rpx;
  399. color: #4CB1FF;
  400. font-size: 28rpx;
  401. text-align: justify;
  402. text-align-last: justify;
  403. text-overflow: ellipsis;
  404. white-space: nowrap;
  405. overflow: hidden;
  406. }
  407. .value {
  408. margin-left: 20rpx;
  409. width: 40rpx;
  410. height: 40rpx;
  411. border-radius: 50%;
  412. }
  413. .value_1 {
  414. background-color: #00FF00;
  415. }
  416. .value_2 {
  417. background-color: #DCDCDC;
  418. }
  419. }
  420. .state:nth-child(4n) {
  421. margin-right: 0;
  422. }
  423. }
  424. }
  425. .system_signal {
  426. .list {
  427. overflow: hidden;
  428. .state {
  429. margin-right: 30rpx;
  430. width: 210rpx;
  431. .label {
  432. width: 140rpx;
  433. }
  434. }
  435. .state:nth-child(3n){
  436. margin-right: 0;
  437. }
  438. .state:nth-child(4n) {
  439. margin-right: 30rpx;
  440. }
  441. }
  442. }
  443. .two_row_state{
  444. .list {
  445. display: flex;
  446. flex-wrap: wrap;
  447. justify-content: space-between;
  448. .state {
  449. margin-right: 0;
  450. width: 350rpx;
  451. .label {
  452. width: 200rpx;
  453. margin-right: 40rpx;
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. </style>