index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div class="b1-screen">
  3. <div class="logo">
  4. <img src="@/assets/images/hjkj1.png" class="logo-img" />
  5. </div>
  6. <div class="b1-screen-content">
  7. <div style="color: #fff" class="item-1">1</div>
  8. <div class="middle-wrap">
  9. <div style="color: #fff" class="item-2">2</div>
  10. <div style="color: #fff" class="item-3">3</div>
  11. <div style="color: #fff" class="item-4">4</div>
  12. </div>
  13. <div class="right-wrap">
  14. <Market :data="state.market_vs_month" />
  15. <implementationTotal :data="state.summary" />
  16. </div>
  17. <div class="bottom-wrap">
  18. <implementationIng :data="state.data" />
  19. <implementationNowYear :data="serviceData" />
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import implementationTotal from "../components/implementary/total.vue"
  26. import implementationIng from "../components/implementary/ing.vue"
  27. import implementationNowYear from "../components/implementary/now-year.vue"
  28. import Market from "../components/market.vue"
  29. import { huiJiaApi } from "@/api"
  30. export default {
  31. name: "B1Screen",
  32. components: {
  33. implementationTotal,
  34. implementationIng,
  35. implementationNowYear,
  36. Market,
  37. },
  38. data() {
  39. return {
  40. state: {
  41. data: [
  42. ], // 进行中的实施服务列表
  43. market_vs_month: {
  44. customer: {
  45. // 新增企业
  46. last_month: 3,
  47. this_month: 2,
  48. },
  49. followup: {
  50. // 新增企业
  51. last_month: 0,
  52. this_month: 0,
  53. },
  54. contact: {
  55. // 新增联系人
  56. last_month: 1,
  57. this_month: 0,
  58. },
  59. residence: {
  60. // 新增小区
  61. last_month: 3,
  62. this_month: 4,
  63. },
  64. contract: {
  65. // 新增合同
  66. last_month: 5,
  67. this_month: 3,
  68. },
  69. household: {
  70. // 新增户数
  71. last_month: 0,
  72. this_month: 1,
  73. },
  74. }, // 市场拓展数据
  75. summary: {
  76. cities: 35, // 城市总数
  77. customers: 270, // 企业总数
  78. contracts: 349, // 合同总数
  79. perform_times: 815, // 履约次数
  80. service_time: 163990350, // 服务时长
  81. residences: 806, // 小区总数
  82. contracted_households: 473652, // 签约户数
  83. actual_households: 459667, // 实施户数
  84. }, // 实施服务,汇总
  85. year_summary: {
  86. cities: 14, // 履约城市
  87. customers: 35, // 服务企业
  88. residences: 71, // 服务小区
  89. contracts: 44, // 合同份数
  90. contracted_households: "24107", // 签约户数
  91. actual_households: "22808", // 实施户数
  92. },
  93. service_ing: {
  94. // 实施服务,进行中
  95. cities: 7,
  96. customers: 11,
  97. contracts: 11,
  98. residences: 9,
  99. contracted_households: "3040",
  100. plan: 0,
  101. },
  102. service_last_month: {
  103. // 实施服务,上月
  104. cities: 0,
  105. customers: 0,
  106. contracts: 0,
  107. residences: 0,
  108. contracted_households: 0,
  109. actual_households: 0,
  110. },
  111. },
  112. implementationData: {
  113. ing: {},
  114. nowYear: {},
  115. total: {},
  116. },
  117. }
  118. },
  119. computed: {
  120. serviceData() {
  121. // 图表字段顺序
  122. const properties = [
  123. "contracted_households",
  124. "contracts",
  125. "residences",
  126. "customers",
  127. "cities",
  128. ]
  129. const result = {
  130. year_summary: properties.map((key) => this.state.year_summary[key]),
  131. service_ing: properties.map((key) => this.state.service_ing[key]),
  132. service_last_month: properties.map(
  133. (key) => this.state.service_last_month[key]
  134. )
  135. }
  136. return result
  137. },
  138. },
  139. mounted() {
  140. huiJiaApi.getImplementaryData().then((res) => {
  141. this.implementationData = res.data.data
  142. })
  143. },
  144. methods: {
  145. getData() {
  146. huiJiaApi.getScreenData().then((res) => {
  147. if (res && res.data) {
  148. console.log("大屏数据----", res)
  149. }
  150. })
  151. },
  152. },
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. @import "@/assets/css/theme.scss";
  157. $gap-padding: halfW(8);
  158. .b1-screen {
  159. height: 100vh;
  160. width: 100vw;
  161. background: var(--page-bg);
  162. .logo {
  163. text-align: right;
  164. padding: halfH(10) 0;
  165. .logo-img {
  166. height: halfH(64);
  167. }
  168. }
  169. }
  170. .b1-screen-content {
  171. height: calc(100% - halfH(64) - halfH(28));
  172. width: 100%;
  173. display: flex;
  174. flex-wrap: wrap;
  175. justify-content: center;
  176. align-items: center;
  177. gap: halfW(16);
  178. // padding: 0px halfW(16) halfW(16);
  179. .item-1 {
  180. width: calc(25% - $gap-padding - $gap-padding);
  181. height: calc(64% - $gap-padding - $gap-padding);
  182. background: #f5f5f5;
  183. }
  184. .middle-wrap {
  185. width: calc(
  186. 50% - $gap-padding - $gap-padding - $gap-padding - $gap-padding
  187. );
  188. height: calc(64% - $gap-padding - $gap-padding);
  189. display: flex;
  190. flex-wrap: wrap;
  191. gap: halfW(16);
  192. justify-content: flex-start;
  193. align-items: center;
  194. .item-2 {
  195. flex: 0 0 100%;
  196. width: 100%;
  197. height: calc(50% - $gap-padding);
  198. background: #f5f5f5;
  199. }
  200. .item-3 {
  201. background: green;
  202. width: calc(50% - $gap-padding);
  203. height: calc(50% - $gap-padding);
  204. }
  205. .item-4 {
  206. width: calc(50% - $gap-padding);
  207. height: calc(50% - $gap-padding);
  208. background: green;
  209. }
  210. }
  211. .right-wrap {
  212. display: flex;
  213. flex-direction: column;
  214. width: calc(25% - $gap-padding - $gap-padding);
  215. height: calc(64% - $gap-padding);
  216. gap: calc($gap-padding * 2);
  217. .total-container {
  218. height: calc(50% - $gap-padding);
  219. }
  220. .market-container {
  221. height: calc(50% - $gap-padding);
  222. }
  223. }
  224. .bottom-wrap {
  225. display: flex;
  226. justify-content: space-around;
  227. gap: halfW(16);
  228. width: calc(
  229. 100% - $gap-padding - $gap-padding - $gap-padding - $gap-padding
  230. );
  231. height: calc(36% - $gap-padding);
  232. .now-year-container {
  233. width: 50%;
  234. }
  235. .implementing-container {
  236. width: 50%;
  237. }
  238. }
  239. }
  240. </style>