lifeHealthyHome.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <script>
  2. import Query from "@/components/common/query.vue";
  3. import Card from "@/components/common/card.vue";
  4. import CoreData from "@/components/common/coreData.vue";
  5. import LifeHealthyHomeChart from "@/components/life/healthyHome/components/lifeHealthyHomeChart.vue";
  6. import LifeHealthyHomeMonitor from "@/components/life/healthyHome/components/lifeHealthyHomeMonitor.vue";
  7. import apiLifeHealthyHome from "@/api/life/apiLifeHealthyHome";
  8. export default {
  9. data() {
  10. let range = this.$util.dateUtil.getNearlyMonthRange();
  11. return {
  12. queryData: {
  13. company: '0',
  14. dept: '0',
  15. timeRange: range
  16. },
  17. coreData: [
  18. {
  19. title: '累计检查人数(人/月)',
  20. num: 0,
  21. historyDesc: '同比',
  22. historyNum: 0
  23. },
  24. {
  25. title: '健康人数(人/月)',
  26. num: 0,
  27. historyDesc: '同比',
  28. historyNum: 0
  29. },
  30. {
  31. title: '亚健康人数(人/月)',
  32. num: 0,
  33. unit: '元',
  34. historyDesc: '同比',
  35. historyNum: 0
  36. },
  37. {
  38. type: 1,
  39. isHighLight: false,
  40. title: '最多患病问题',
  41. content: ''
  42. },
  43. {
  44. type: 1,
  45. isHighLight: false,
  46. title: '值得关注',
  47. showStar: true,
  48. content: ''
  49. },
  50. ]
  51. }
  52. },
  53. components: {
  54. Query,
  55. Card,
  56. CoreData,
  57. LifeHealthyHomeChart,
  58. LifeHealthyHomeMonitor,
  59. },
  60. mounted() {
  61. this.init();
  62. },
  63. methods: {
  64. init() {
  65. this.$store.loadingStore().loadingWithApi(this.getCoreData(), 2000)
  66. },
  67. reset() {
  68. console.log('reset')
  69. },
  70. search(data) {
  71. this.$util.asyncPromise(
  72. this.getCoreData(),
  73. this.$refs.LifeHealthyHomeChart.getData(),
  74. )
  75. },
  76. getCoreData() {
  77. return apiLifeHealthyHome.getCoreData(this.queryData).then(res=>{
  78. this.coreData[0].num = res.list[0].value
  79. this.coreData[0].historyNum = res.list[0].compare
  80. this.coreData[1].num = res.list[1].value
  81. this.coreData[1].historyNum = res.list[1].compare
  82. this.coreData[2].num = res.list[2].value
  83. this.coreData[2].historyNum = res.list[2].compare
  84. this.coreData[3].content = res.list[3].value
  85. this.coreData[4].content = res.worthAttention
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <template>
  92. <div class="lifeHealthyHome">
  93. <div class="page-query-core">
  94. <a-row>
  95. <a-col>
  96. <div class="lifeHealthyHome-query">
  97. <Query :query-data.sync="queryData" :show="['company','dept','time']" :reset="reset"
  98. :search="search"></Query>
  99. </div>
  100. </a-col>
  101. <a-col>
  102. <div class="lifeHealthyHome-core">
  103. <Card title="核心指标">
  104. <CoreData :data-list="coreData"></CoreData>
  105. </Card>
  106. </div>
  107. </a-col>
  108. </a-row>
  109. </div>
  110. <a-row >
  111. <a-col :span="18">
  112. <div class="lifeHealthyHome-left">
  113. <div class="lifeHealthyHome-detail ioc-card-content">
  114. <Card title="小屋分析">
  115. <LifeHealthyHomeChart ref="LifeHealthyHomeChart" :query-data="queryData" :height="450"></LifeHealthyHomeChart>
  116. </Card>
  117. </div>
  118. </div>
  119. </a-col>
  120. <a-col :span="6">
  121. <div class="lifeHealthyHome-right">
  122. <div class="lifeHealthyHome-top ioc-card-content">
  123. <Card title="环境监测">
  124. <a-row :gutter="[12,18]" style="padding: 12px">
  125. <a-col style="color: #B3B3B3">
  126. <div style="width: 50%;display: inline-block;text-align: center">
  127. <span style="background-color: #73e6ac;display: inline-block;width: 14px;height: 14px;"></span>
  128. <span style="display: inline-block;vertical-align: text-bottom;margin-left: 12px">室内</span>
  129. </div>
  130. <div style="width: 50%;display: inline-block;text-align: center">
  131. <span style="background-color: #80d4ff;display: inline-block;width: 14px;height: 14px"></span>
  132. <span style="display: inline-block;vertical-align: text-bottom;margin-left: 12px">室外</span>
  133. </div>
  134. </a-col>
  135. <a-col :span="12">
  136. <LifeHealthyHomeMonitor title="PM2.5" :value="'75'" icon="life/pm_green.png"></LifeHealthyHomeMonitor>
  137. </a-col>
  138. <a-col :span="12">
  139. <LifeHealthyHomeMonitor title="PM2.5" :value="'75'" icon="life/pm_blue.png"></LifeHealthyHomeMonitor>
  140. </a-col>
  141. <a-col :span="12">
  142. <LifeHealthyHomeMonitor title="湿 度" :value="'75'" icon="life/humidity_green.png"></LifeHealthyHomeMonitor>
  143. </a-col>
  144. <a-col :span="12">
  145. <LifeHealthyHomeMonitor title="湿 度" :value="'75'" icon="life/humidity_blue.png"></LifeHealthyHomeMonitor>
  146. </a-col>
  147. <a-col :span="12">
  148. <LifeHealthyHomeMonitor title="温 度" :value="'75'" icon="life/temperature_green.png"></LifeHealthyHomeMonitor>
  149. </a-col>
  150. <a-col :span="12">
  151. <LifeHealthyHomeMonitor title="温 度" :value="'75'" icon="life/temperature_blue.png"></LifeHealthyHomeMonitor>
  152. </a-col>
  153. </a-row>
  154. </Card>
  155. </div>
  156. </div>
  157. </a-col>
  158. </a-row>
  159. </div>
  160. </template>
  161. <style lang="less" scoped>
  162. .lifeHealthyHome {
  163. width: 100%;
  164. height: auto;
  165. display: inline-block;
  166. vertical-align: top;
  167. .lifeHealthyHome-query {
  168. width: 100%;
  169. }
  170. .lifeHealthyHome-core {
  171. width: 100%;
  172. }
  173. .lifeHealthyHome-left {
  174. margin-top: 12px;
  175. margin-right: 6px;
  176. height: 490px;
  177. overflow: hidden;
  178. background-color: #ffffff;
  179. border-radius: 4px;
  180. > div {
  181. border-radius: 4px;
  182. }
  183. }
  184. .lifeHealthyHome-right {
  185. margin-top: 12px;
  186. margin-left: 6px;
  187. height: 490px;
  188. overflow: hidden;
  189. background-color: #ffffff;
  190. border-radius: 4px;
  191. > div {
  192. border-radius: 4px;
  193. }
  194. }
  195. }
  196. </style>