hoist.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view>
  3. <!-- 公共参数 -->
  4. <view class="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. mine_code:"",
  160. system_type:"",
  161. // 数据刷新定时器
  162. data_timer:{},
  163. data: {}
  164. };
  165. },
  166. onLoad(option) {
  167. // console.log(data)
  168. // this.data = data
  169. uni.setNavigationBarTitle({
  170. title:option.name
  171. })
  172. this.mine_code = option.mine_code
  173. this.system_type = option.system_type
  174. this.get_data()
  175. this.data_timer = setInterval(()=>{
  176. this.get_data()
  177. },5000)
  178. },
  179. onUnload() {
  180. clearInterval(this.data_timer)
  181. },
  182. methods: {
  183. get_data(){
  184. this.$api.unified_automation_system({
  185. mine_code: this.mine_code,
  186. system_type: this.system_type
  187. }).then((res)=>{
  188. console.log(res.data)
  189. this.data = res.data
  190. })
  191. },
  192. show_item(item) {
  193. uni.showToast({
  194. icon: "none",
  195. title: item.label + " " + item.value + " " + item.unit
  196. })
  197. },
  198. show_label(label){
  199. uni.showToast({
  200. icon: "none",
  201. title: label
  202. })
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="scss">
  208. page {
  209. background-color: #0B163B;
  210. box-sizing: border-box;
  211. padding: 30rpx 10rpx;
  212. }
  213. .common {
  214. margin: 0 auto;
  215. width: 700rpx;
  216. background-image: url(./icon/common.png);
  217. background-size: 100% 100%;
  218. background-repeat: no-repeat;
  219. box-sizing: border-box;
  220. padding: 40rpx;
  221. display: flex;
  222. justify-content: space-between;
  223. .section {
  224. display: flex;
  225. flex-wrap: wrap;
  226. justify-content: space-between;
  227. .item {
  228. height: 60rpx;
  229. display: flex;
  230. align-items: center;
  231. justify-content: space-between;
  232. color: #4CB1FF;
  233. font-size: 28rpx;
  234. .label {
  235. width: 120rpx;
  236. text-overflow: ellipsis;
  237. white-space: nowrap;
  238. overflow: hidden;
  239. }
  240. .value {
  241. margin: 0 20rpx;
  242. width: 120rpx;
  243. height: 40rpx;
  244. box-sizing: border-box;
  245. padding: 0 10rpx;
  246. background: rgba(0, 4, 15, 0.36);
  247. border: 2rpx solid #3D55A5;
  248. color: #FFF600;
  249. font-size: 24rpx;
  250. text-overflow: ellipsis;
  251. white-space: nowrap;
  252. overflow: hidden;
  253. }
  254. .unit {
  255. width: 100rpx;
  256. text-overflow: ellipsis;
  257. white-space: nowrap;
  258. overflow: hidden;
  259. }
  260. }
  261. .state {
  262. height: 60rpx;
  263. display: flex;
  264. align-items: center;
  265. .label {
  266. text-overflow: ellipsis;
  267. white-space: nowrap;
  268. overflow: hidden;
  269. width: 120rpx;
  270. color: #4CB1FF;
  271. font-size: 28rpx;
  272. }
  273. .value {
  274. margin-left: 20rpx;
  275. width: 40rpx;
  276. height: 40rpx;
  277. border-radius: 50%;
  278. }
  279. .value_1 {
  280. background-color: #00FF00;
  281. }
  282. .value_2 {
  283. background-color: #E5E5E5;
  284. }
  285. }
  286. }
  287. }
  288. .content {
  289. margin-top: 40rpx;
  290. .hoist {
  291. margin: 0 auto;
  292. width: 700rpx;
  293. .box {
  294. text-align: center;
  295. image {
  296. width: 150rpx;
  297. height: 174rpx;
  298. }
  299. }
  300. .name {
  301. margin-top: 20rpx;
  302. text-align: center;
  303. color: #DEF1FF;
  304. font-size: 34rpx;
  305. font-weight: 700;
  306. }
  307. .parameter {
  308. box-sizing: border-box;
  309. margin-top: 40rpx;
  310. .title {
  311. margin: 0 auto;
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. width: 230rpx;
  316. height: 60rpx;
  317. background-image: url(./icon/border.png);
  318. background-size: 100% 100%;
  319. background-repeat: no-repeat;
  320. .icon {
  321. margin-right: 20rpx;
  322. image {
  323. width: 30rpx;
  324. height: 30rpx;
  325. }
  326. }
  327. .text {
  328. color: #00FFF6;
  329. font-size: 30rpx;
  330. }
  331. }
  332. .list {
  333. margin-top: 40rpx;
  334. .item {
  335. height: 60rpx;
  336. display: flex;
  337. color: #4CB1FF;
  338. font-size: 28rpx;
  339. .label {
  340. width: 200rpx;
  341. text-align: justify;
  342. text-align-last: justify;
  343. text-overflow: ellipsis;
  344. white-space: nowrap;
  345. overflow: hidden;
  346. }
  347. .value {
  348. margin: 0 40rpx;
  349. width: 200rpx;
  350. height: 40rpx;
  351. box-sizing: border-box;
  352. padding: 0 10rpx;
  353. background: rgba(0, 4, 15, 0.36);
  354. border: 2rpx solid #3D55A5;
  355. color: #FFF600;
  356. font-size: 24rpx;
  357. text-overflow: ellipsis;
  358. white-space: nowrap;
  359. overflow: hidden;
  360. }
  361. .unit {
  362. width: 100rpx;
  363. }
  364. }
  365. }
  366. }
  367. .state_section {
  368. margin-top: 40rpx;
  369. .title {
  370. margin: 20rpx auto;
  371. display: flex;
  372. justify-content: center;
  373. align-items: center;
  374. width: 300rpx;
  375. height: 60rpx;
  376. background-image: url(./icon/border.png);
  377. background-size: 100% 100%;
  378. background-repeat: no-repeat;
  379. .icon {
  380. margin-right: 20rpx;
  381. image {
  382. width: 30rpx;
  383. height: 30rpx;
  384. }
  385. }
  386. .text {
  387. color: #00FFF6;
  388. font-size: 30rpx;
  389. }
  390. }
  391. .list {
  392. overflow: hidden;
  393. .state {
  394. box-sizing: border-box;
  395. float: left;
  396. margin-right: 20rpx;
  397. width: 160rpx;
  398. height: 70rpx;
  399. display: flex;
  400. align-items: center;
  401. .label {
  402. width: 80rpx;
  403. color: #4CB1FF;
  404. font-size: 28rpx;
  405. text-align: justify;
  406. text-align-last: justify;
  407. text-overflow: ellipsis;
  408. white-space: nowrap;
  409. overflow: hidden;
  410. }
  411. .value {
  412. margin-left: 20rpx;
  413. width: 40rpx;
  414. height: 40rpx;
  415. border-radius: 50%;
  416. }
  417. .value_1 {
  418. background-color: #00FF00;
  419. }
  420. .value_2 {
  421. background-color: #DCDCDC;
  422. }
  423. }
  424. .state:nth-child(4n) {
  425. margin-right: 0;
  426. }
  427. }
  428. }
  429. .system_signal {
  430. .list {
  431. overflow: hidden;
  432. .state {
  433. margin-right: 30rpx;
  434. width: 210rpx;
  435. .label {
  436. width: 140rpx;
  437. }
  438. }
  439. .state:nth-child(3n){
  440. margin-right: 0;
  441. }
  442. .state:nth-child(4n) {
  443. margin-right: 30rpx;
  444. }
  445. }
  446. }
  447. .two_row_state{
  448. .list {
  449. display: flex;
  450. flex-wrap: wrap;
  451. justify-content: space-between;
  452. .state {
  453. margin-right: 0;
  454. width: 350rpx;
  455. .label {
  456. width: 200rpx;
  457. margin-right: 40rpx;
  458. }
  459. }
  460. }
  461. }
  462. }
  463. }
  464. </style>