detail.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <view class="page-body">
  3. <page-header :name="'智能通风'" :bg="'#1560e0'" :showLeft="true" @goBack="goBack()"></page-header>
  4. <view class="scroll-wrap">
  5. <view class="basic-info-wrap">
  6. <view class="detail-wrap">
  7. <view class="system-wrap">
  8. <view class="system-left">
  9. <image src="@/static/jg-icon.png" />
  10. <view class="system-center">通风智能决策及控制系统</view>
  11. </view>
  12. <view class="system-right">
  13. <image src="@/static/right-arrow.png" />
  14. </view>
  15. </view>
  16. <view class="annular-wrap">
  17. <view class="left">
  18. <bar-chart :barType="'ring'" :optSet="optRing" :data="ringChartData"
  19. :barHeight="'200rpx'"></bar-chart>
  20. <view class="title">
  21. 有效风率
  22. </view>
  23. <view class="legend">
  24. <view class="left">
  25. <view class="name">有效风</view>
  26. <view class="icon"></view>
  27. </view>
  28. <view class="right">
  29. <view class="name">无效风</view>
  30. <view class="icon"></view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="right">
  35. <bar-chart :barType="'ring'" :optSet="optRing1" :data="ringChartData1"
  36. :barHeight="'200rpx'"></bar-chart>
  37. <view class="title">
  38. 供需比
  39. </view>
  40. <view class="legend">
  41. <view class="left">
  42. <view class="name">有效风</view>
  43. <view class="icon"></view>
  44. </view>
  45. <view class="right">
  46. <view class="name">无效风</view>
  47. <view class="icon"></view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="info-wrap">
  53. <view class="item" v-for="(item, index) in infoList" :key="index">
  54. <view class="name">{{ item.name }}</view>
  55. <view class="data">{{ item.data }}</view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="radius-wrap"></view>
  60. </view>
  61. <view class="detail-info-wrap">
  62. <page-card v-for="(item, index) in list" :key="index" :name="item.name" :data="item"
  63. style="margin-bottom: 30rpx;" @goDetail="goDetail">
  64. <template v-slot:content>
  65. <view class="machine-wrap">
  66. <status-tip v-for="(item1, index1) in item.children" :key="index1" :name="item1.name"
  67. :status="item1.status" :tip="item1.status ? '运行' : '停止'"></status-tip>
  68. </view>
  69. </template>
  70. </page-card>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. infoList: [{
  80. name: '自动风门',
  81. data: '2扇'
  82. }, {
  83. name: '自动风窗',
  84. data: '2扇'
  85. }, {
  86. name: '变频风扇',
  87. data: '6扇'
  88. }],
  89. list: [{
  90. name: '东井通风机',
  91. children: [{
  92. name: '1#风机',
  93. status: 0
  94. }, {
  95. name: '2#风机',
  96. status: 1
  97. }]
  98. }, {
  99. name: '西井通风机',
  100. children: [{
  101. name: '1#风机',
  102. status: 0
  103. }, {
  104. name: '2#风机',
  105. status: 1
  106. }]
  107. }, {
  108. name: '五分区通风机',
  109. children: [{
  110. name: '1#风机',
  111. status: 0
  112. }, {
  113. name: '2#风机',
  114. status: 1
  115. }]
  116. }, {
  117. name: '1314通风机',
  118. children: [{
  119. name: '1#风机',
  120. status: 0
  121. }, {
  122. name: '2#风机',
  123. status: 1
  124. }]
  125. }, {
  126. name: '150201回风巷通风机',
  127. children: [{
  128. name: '主风机',
  129. status: 0
  130. }, {
  131. name: '副风机',
  132. status: 1
  133. }]
  134. }, {
  135. name: '150201机巷通风机',
  136. children: [{
  137. name: '主风机',
  138. status: 0
  139. }, {
  140. name: '副风机',
  141. status: 1
  142. }]
  143. }, {
  144. name: '220708辅助巷通风机',
  145. children: [{
  146. name: '主风机',
  147. status: 0
  148. }, {
  149. name: '副风机',
  150. status: 1
  151. }]
  152. }, {
  153. name: '220708回风巷通风机',
  154. children: [{
  155. name: '主风机',
  156. status: 0
  157. }, {
  158. name: '副风机',
  159. status: 1
  160. }]
  161. }, {
  162. name: '220708胶带巷通风机',
  163. children: [{
  164. name: '主风机',
  165. status: 0
  166. }, {
  167. name: '副风机',
  168. status: 1
  169. }]
  170. }, ],
  171. ringChartData: {},
  172. optRing: {
  173. color: ["#00FF00", "#FFFF00"], // 圆环中数据的颜色
  174. dataLabel: false, // 是否启用数据标签
  175. legend: { // 是否启用图例
  176. show: false
  177. },
  178. title: { // 标题内容
  179. name: "90%",
  180. fontSize: 18,
  181. color: "#fff"
  182. },
  183. subtitle: { // 副标题内容
  184. name: ""
  185. },
  186. extra: {
  187. ring: {
  188. ringWidth: 10, // 圆环宽度
  189. border: false, // 是否绘制数据间的边框
  190. centerColor: 'rgb(1, 143, 252)' // 圆环中间填充的颜色
  191. }
  192. }
  193. },
  194. ringChartData1: {},
  195. optRing1: {
  196. color: ["#51FFF1", "#FFB944"], // 圆环中数据的颜色
  197. dataLabel: false, // 是否启用数据标签
  198. legend: { // 是否启用图例
  199. show: false
  200. },
  201. title: { // 标题内容
  202. name: "1.07",
  203. fontSize: 18,
  204. color: "#fff"
  205. },
  206. subtitle: { // 副标题内容
  207. name: ""
  208. },
  209. extra: {
  210. ring: {
  211. ringWidth: 10, // 圆环宽度
  212. offsetAngle: 90,
  213. border: false, // 是否绘制数据间的边框
  214. centerColor: 'rgb(1, 143, 252)' // 圆环中间填充的颜色
  215. }
  216. }
  217. }
  218. }
  219. },
  220. onLoad() {
  221. this.getServerData()
  222. },
  223. methods: {
  224. goBack() { // 返回上一頁面
  225. uni.navigateBack()
  226. },
  227. getServerData() { // 获取环形图数据
  228. let res = {
  229. series: [{
  230. data: [{
  231. "name": "有效风",
  232. "value": 90
  233. }, {
  234. "name": "无效风",
  235. "value": 10
  236. }]
  237. }]
  238. };
  239. this.ringChartData = JSON.parse(JSON.stringify(res));
  240. let res1 = {
  241. series: [{
  242. data: [{
  243. "name": "供风量",
  244. "value": 1.07
  245. }, {
  246. "name": "需风量",
  247. "value": 1
  248. }]
  249. }]
  250. };
  251. this.ringChartData1 = JSON.parse(JSON.stringify(res1));
  252. },
  253. goDetail(data) {
  254. if (data.name === "220708胶带巷通风机") {
  255. uni.navigateTo({
  256. url: `/pages/data/ventilation/Lane-system/Lane-system?data=${JSON.stringify(data)}`,
  257. })
  258. } else {
  259. uni.navigateTo({
  260. url: `/pages/data/ventilation/air-system/air-system?data=${JSON.stringify(data)}`,
  261. })
  262. }
  263. }
  264. }
  265. }
  266. </script>
  267. <style scoped lang="scss">
  268. .page-body {
  269. .scroll-wrap {
  270. height: calc(100vh - 85rpx);
  271. overflow: scroll;
  272. .basic-info-wrap {
  273. position: relative;
  274. height: 530rpx;
  275. padding: 25rpx 35rpx 0;
  276. background: url(../../../../static/page_bg.png);
  277. background-size: 100%;
  278. .detail-wrap {
  279. width: 100%;
  280. height: 447rpx;
  281. padding: 42rpx 50rpx;
  282. background: url(../../../../static/chart-bg.png);
  283. background-repeat: no-repeat;
  284. background-size: 100% 447rpx;
  285. .system-wrap {
  286. display: flex;
  287. justify-content: space-between;
  288. .system-left {
  289. display: flex;
  290. align-items: center;
  291. margin-right: 21rpx;
  292. image {
  293. width: 37rpx;
  294. height: 36rpx;
  295. margin-right: 21rpx;
  296. vertical-align: bottom;
  297. }
  298. }
  299. .system-center {
  300. font-size: 34rpx;
  301. font-weight: 700;
  302. color: #fff;
  303. }
  304. .system-right {
  305. image {
  306. width: 16rpx;
  307. height: 29rpx;
  308. vertical-align: middle;
  309. }
  310. }
  311. }
  312. .annular-wrap {
  313. display: flex;
  314. margin-bottom: 20rpx;
  315. .left {
  316. width: 50%;
  317. .title {
  318. text-align: center;
  319. margin-bottom: 10rpx;
  320. font-size: 26rpx;
  321. color: #fff;
  322. }
  323. .legend {
  324. display: flex;
  325. .left {
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. .name {
  330. margin-right: 8rpx;
  331. color: #fff;
  332. font-size: 22rpx;
  333. }
  334. .icon {
  335. width: 18rpx;
  336. height: 18rpx;
  337. background-color: #00FF00;
  338. }
  339. }
  340. .right {
  341. display: flex;
  342. justify-content: center;
  343. align-items: center;
  344. .name {
  345. margin-right: 8rpx;
  346. color: #fff;
  347. font-size: 22rpx;
  348. }
  349. .icon {
  350. width: 18rpx;
  351. height: 18rpx;
  352. background-color: #FFFF00;
  353. }
  354. }
  355. }
  356. }
  357. .right {
  358. width: 50%;
  359. .title {
  360. text-align: center;
  361. margin-bottom: 10rpx;
  362. font-size: 26rpx;
  363. color: #fff;
  364. }
  365. .legend {
  366. display: flex;
  367. .left {
  368. display: flex;
  369. justify-content: center;
  370. align-items: center;
  371. .name {
  372. margin-right: 8rpx;
  373. color: #fff;
  374. font-size: 22rpx;
  375. }
  376. .icon {
  377. width: 18rpx;
  378. height: 18rpx;
  379. background-color: #51FFF1;
  380. }
  381. }
  382. .right {
  383. display: flex;
  384. justify-content: center;
  385. align-items: center;
  386. .name {
  387. margin-right: 8rpx;
  388. color: #fff;
  389. font-size: 22rpx;
  390. }
  391. .icon {
  392. width: 18rpx;
  393. height: 18rpx;
  394. background-color: #FFB944;
  395. }
  396. }
  397. }
  398. }
  399. }
  400. .info-wrap {
  401. display: flex;
  402. .item {
  403. width: 33.33%;
  404. display: flex;
  405. justify-content: center;
  406. font-size: 26rpx;
  407. .name {
  408. color: #fff;
  409. margin-right: 11rpx;
  410. }
  411. .data {
  412. color: #FFFF00;
  413. }
  414. }
  415. }
  416. }
  417. .radius-wrap {
  418. position: absolute;
  419. left: 0;
  420. bottom: 0;
  421. width: 100vw;
  422. height: 30rpx;
  423. background-color: #fff;
  424. border-radius: 35rpx 35rpx 0 0;
  425. }
  426. }
  427. .detail-info-wrap {
  428. padding: 40rpx 35rpx;
  429. /deep/ .card-wrap:last-child {
  430. margin-bottom: 0 !important;
  431. }
  432. .machine-wrap {
  433. display: flex;
  434. justify-content: space-between;
  435. padding: 40rpx 58rpx;
  436. /deep/ .tip-wrap {
  437. font-size: 26rpx;
  438. .name {
  439. color: #8D8D8D;
  440. margin-right: 40rpx;
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. </style>