facilitystate.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view class="facilitystate-container">
  3. <view class="facilitystate-title-warp">
  4. <view class="facilitystate-title">
  5. <view class="radius-user"></view>使用中
  6. </view>
  7. <view class="facilitystate-subtitle">
  8. <view class="radius-close"></view>
  9. 已关闭</view>
  10. </view>
  11. <view class="facilitystate-list">
  12. <image :src="ggbCurrent.value == 1?bucketOpenTop:bucketCloseTop" class="bucketOpenTop" />
  13. <image :src="sfbCurrent.value == 1?bucketOpenTop:bucketCloseTop" class="bucketOpenTop2"/>
  14. <view class="facilitystate-list__left-label">
  15. <view class="facilitystate-item__left-label-text" style="margin-bottom: 2rpx;">瞬时 L/min :</view>
  16. <view class="facilitystate-item__left-label-text">累计L:</view>
  17. </view>
  18. <view class="facilitystate-list__left">
  19. <view
  20. class="facilitystate-item"
  21. :style="{width:100/(alreadyfertilizerBucketList.length)+'%'}"
  22. :class="index == alreadyfertilizerBucketList.length - 1?'facilitystate-item--last':''"
  23. v-for="(item, index) in alreadyfertilizerBucketList"
  24. :key="index"
  25. >
  26. <view class="facilitystate-item__label">
  27. <view class="facilitystate-item__label-text">{{getTopDeviceName(item.childrenList)}}</view>
  28. <view class="facilitystate-item__label-value">{{getBottomDeviceName(item.childrenList)}}</view>
  29. </view>
  30. <view class="facilitystate-item__image">
  31. <image :src="getJSCurrentValue(item.childrenList)?bucketOpen:bucketClose" class="bucketClose"/>
  32. <view v-if="index == alreadyfertilizerBucketList.length - 1? false:true">
  33. <image :src="lineTopBottom" class="facilitystate-item__bg"/>
  34. <image :src="lineTopAndBottom" class="facilitystate-item__line"/>
  35. </view>
  36. <view v-else>
  37. <image :src="lineTopBottom" class="facilitystate-item__bg2"/>
  38. <image :src="lastBorder" class="facilitystate-item__line2"/>
  39. </view>
  40. <view class="facilitystate-item-fan">
  41. <view class="fertTopBottom">
  42. <text class="fertTopBottom-text">{{item.sfDisplayname || item.sfName}}</text>
  43. <image :src="getJBCurrentValue(item.childrenList)? fanRun : fan" class="fan" :class="{'fan-run': getJBCurrentValue(item.childrenList)}" />
  44. </view>
  45. </view>
  46. <image :src="getXSCurrentValue(item.childrenList)?bucketOpen:bucketClose" class="bucketClose1" />
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <irrigatedArea :irrigatedAreaList="irrigatedAreaList"/>
  52. </view>
  53. </template>
  54. <script>
  55. import irrigatedArea from './irrigatedArea.vue';
  56. export default {
  57. props:{
  58. irrigatedAreaList:{
  59. type:Array,
  60. default:()=>[]
  61. },
  62. alreadyfertilizerBucketList:{
  63. type:Array,
  64. default:()=>[]
  65. },
  66. ggbCurrent:{
  67. type:Object,
  68. default:()=>{}
  69. },
  70. sfbCurrent:{
  71. type:Object,
  72. default:()=>{}
  73. }
  74. },
  75. components:{
  76. irrigatedArea
  77. },
  78. data() {
  79. return {
  80. fan:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/fan.png',
  81. fanRun:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/fanRun.png',
  82. lastBorder:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/lastBorder.png',
  83. lineTopBottom:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/lineTopBottom.png',
  84. fertTopBottom:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/fertTopBottom.png',
  85. lineTopAndBottom:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/lineTopAndBottom.png',
  86. bucketOpenTop:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/bucketOpenTop.png',
  87. bucketOpenTopStatus:false,
  88. bucketOpenTopStatus2:false,
  89. bucketCloseTop:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/bucketCloseTop.png',
  90. bucketClose:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/bucketClose.png',
  91. bucketOpen:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/bucketOpen.png',
  92. fertTopBottomRadius:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/deviceIcons/shuifei/fertTopBottomRadius.png',
  93. };
  94. },
  95. methods:{
  96. getTopDeviceName(list){
  97. let current = {}
  98. list?.forEach(item =>{
  99. if(item.sfType === '6'){
  100. const name = item.sfDisplayname || item.sfName;
  101. if(name.indexOf('瞬时') != -1){
  102. current = item
  103. }
  104. }
  105. })
  106. return current?.value || '0'
  107. },
  108. getBottomDeviceName(list){
  109. let current = {}
  110. list?.forEach(item =>{
  111. if(item.sfType === '6'){
  112. const name = item.sfDisplayname || item.sfName;
  113. if(name.indexOf('累计') != -1){
  114. current = item
  115. }
  116. }
  117. })
  118. return current?.value || '0'
  119. },
  120. getJSCurrentValue(list){
  121. // 进水阀
  122. let current = {};
  123. list?.forEach(item =>{
  124. if(item.sfType === '8'){
  125. const name = item.sfCode;
  126. current = item;
  127. }
  128. })
  129. return current?.value == 1
  130. },
  131. getJBCurrentValue(list){
  132. // 搅拌机
  133. let current = {};
  134. list?.forEach(item =>{
  135. if(item.sfType === '3'){
  136. const name = item.sfCode;
  137. current = item
  138. }
  139. })
  140. return current?.value == 1
  141. },
  142. getXSCurrentValue(list){
  143. // 吸水泵
  144. let current = {};
  145. list?.forEach(item =>{
  146. if(item.sfType === '2'){
  147. const name = item.sfCode;
  148. current = item
  149. }
  150. })
  151. return current?.value == 1
  152. },
  153. handleClick(item){
  154. item.fan = !item.fan;
  155. },
  156. handleOpenClick(){
  157. this.bucketOpenTopStatus = !this.bucketOpenTopStatus;
  158. },
  159. handleOpenClick1(){
  160. this.bucketOpenTopStatus2 = !this.bucketOpenTopStatus2;
  161. },
  162. handleBucketCloseClick(item){
  163. item.isTopStatus = !item.isTopStatus;
  164. },
  165. handleBucketCloseClick1(item){
  166. item.isBottomStatus = !item.isBottomStatus;
  167. }
  168. }
  169. };
  170. </script>
  171. <style scoped lang="scss">
  172. .facilitystate-container {
  173. padding: 16rpx 32rpx;
  174. justify-content: space-between;
  175. border-radius: 16rpx;
  176. position: relative;
  177. .facilitystate-title-warp{
  178. position: absolute;
  179. right: 32rpx;
  180. top: 10rpx;
  181. display: flex;
  182. align-items: center;
  183. color: #374d59;
  184. font-family: "Source Han Sans CN VF";
  185. font-size: 24rpx;
  186. font-weight: 400;
  187. .facilitystate-title{
  188. display: flex;
  189. align-items: center;
  190. margin-right: 32rpx;
  191. .radius-user{
  192. width: 16rpx;
  193. height: 16rpx;
  194. border-radius: 50%;
  195. background: #14A478;
  196. margin-right:8rpx;
  197. }
  198. }
  199. .facilitystate-subtitle{
  200. display: flex;
  201. align-items: center;
  202. .radius-close{
  203. width: 16rpx;
  204. height: 16rpx;
  205. border-radius: 50%;
  206. background: #7A8291;
  207. margin-right:8rpx;
  208. }
  209. }
  210. }
  211. .facilitystate-list {
  212. background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/beijing.png') no-repeat;
  213. background-size: 100%;
  214. height: 376rpx;
  215. width: 690rpx;
  216. display: flex;
  217. margin-bottom: 16rpx;
  218. position: relative;
  219. &__left-label{
  220. align-self: stretch;
  221. color: #687a74;
  222. text-align: right;
  223. font-family: "Source Han Sans CN VF";
  224. font-size: 24rpx;
  225. font-weight: 400;
  226. position: absolute;
  227. left: 30rpx;
  228. top: 120rpx;
  229. }
  230. .bucketOpenTop{
  231. width: 20rpx;
  232. height: 20rpx;
  233. position: absolute;
  234. left: 120rpx;
  235. top: 328rpx;
  236. }
  237. .bucketOpenTop2{
  238. width: 20rpx;
  239. height: 20rpx;
  240. position: absolute;
  241. left: 200rpx;
  242. top: 72rpx;
  243. }
  244. &__left{
  245. height: 100%;
  246. display: flex;
  247. margin-left: 160rpx;
  248. justify-content: space-between;
  249. width: 100%;
  250. }
  251. .facilitystate-item {
  252. display: flex;
  253. flex-direction: column;
  254. justify-content: center;
  255. align-items: center;
  256. height: 228rpx;
  257. margin-top: 112rpx;
  258. &__label{
  259. display: flex;
  260. flex-direction: column;
  261. justify-content: center;
  262. align-items: center;
  263. width: 100%;
  264. text-align: center;
  265. margin-bottom: 5rpx;
  266. }
  267. &__label-text,&__label-value {
  268. color: #042118;
  269. font-family: "Source Han Sans CN VF";
  270. font-size: 24rpx;
  271. font-weight: 400;
  272. height: 36rpx;
  273. width:90%;
  274. margin: 0 auto;
  275. // 超出隐藏
  276. overflow: hidden;
  277. text-overflow: ellipsis;
  278. white-space: nowrap;
  279. }
  280. &__image {
  281. width: 100%;
  282. height: 140rpx;
  283. position: relative;
  284. .facilitystate-item-fan{
  285. position: absolute;
  286. top: 20rpx;
  287. left:0;
  288. bottom:0;
  289. right:0;
  290. margin: auto;
  291. z-index:100;
  292. }
  293. .bucketClose{
  294. position: absolute;
  295. width: 20rpx;
  296. height: 20rpx;
  297. left: 50%;
  298. transform: translateX(-25%);
  299. top: 6rpx;
  300. z-index:100;
  301. }
  302. .bucketClose1{
  303. position: absolute;
  304. width: 20rpx;
  305. height: 20rpx;
  306. left: 50%;
  307. transform: translateX(-25%);
  308. bottom: -6rpx;
  309. z-index:100;
  310. }
  311. }
  312. &__bg{
  313. width: 100%;
  314. height: 153rpx;
  315. top: 0rpx;
  316. }
  317. &__line{
  318. position: absolute;
  319. width: 8rpx;
  320. height: 152rpx;
  321. left: 50%;
  322. top: 0;
  323. transform: translateX(-50%);
  324. }
  325. &__bg2{
  326. width: 50%;
  327. height: 153rpx;
  328. left: -4rpx;
  329. }
  330. &__line2{
  331. position: absolute;
  332. width: 16rpx;
  333. height: 153rpx;
  334. top: -1rpx;
  335. margin-left: -6rpx;
  336. transform: translateX(-50%);
  337. }
  338. .fertTopBottom{
  339. width: 70rpx;
  340. height: 94rpx;
  341. margin: 0 auto;
  342. margin-top: 12rpx;
  343. background: url('https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/newindex/bucket.png') no-repeat center center;
  344. background-size: 100% 100%;
  345. display: flex;
  346. flex-direction: column;
  347. justify-content: center;
  348. align-items: center;
  349. .fertTopBottom-text{
  350. width: 70rpx;
  351. font-size: 24rpx;
  352. color: #FFB800;
  353. text-align: center;
  354. // 超出隐藏
  355. overflow: hidden;
  356. text-overflow: ellipsis;
  357. white-space: nowrap;
  358. }
  359. .fan{
  360. width: 40rpx;
  361. height:40rpx;
  362. margin-left: 10rpx;
  363. }
  364. .fan-run{
  365. animation: rotate .5s linear infinite;
  366. @keyframes rotate {
  367. from {
  368. transform: rotate(0deg);
  369. }
  370. to {
  371. transform: rotate(360deg);
  372. }
  373. }
  374. }
  375. }
  376. }
  377. .facilitystate-item--last{
  378. width: 100rpx;
  379. display: flex;
  380. }
  381. }
  382. }
  383. </style>