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