ing.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <template>
  2. <div class="implementing-container">
  3. <div class="implementing-title">
  4. <img src="@/assets/images/nz.png" class="title-icon" />
  5. 进行中的实施服务
  6. </div>
  7. <div class="implementing-list">
  8. <div
  9. v-for="(item, index) in implementingList"
  10. :key="index"
  11. class="implementing-item"
  12. :class="{ 'even-item': index % 2 === 1 }"
  13. >
  14. <div class="item-content">
  15. <div class="item-date">{{ item.date }}</div>
  16. <div class="item-city">{{ item.city }}</div>
  17. <div class="project-info">
  18. <div class="project-name">{{ item.projectName }}</div>
  19. <div class="company-name">{{ item.companyName }}</div>
  20. </div>
  21. <div class="project-stats">
  22. <div class="stat-item">
  23. <span class="stat-value">{{ item.householdCount }}</span>
  24. <span class="stat-label">户</span>
  25. </div>
  26. <div class="stat-item">
  27. <span class="stat-value">{{ item.area }}</span>
  28. </div>
  29. <div class="stat-item">
  30. <div class="progress-wrapper">
  31. <span class="progress-text">{{ item.progress }}%</span>
  32. </div>
  33. </div>
  34. <div class="stat-item service-item">
  35. <span class="service-content">{{ item.serviceContent }}</span>
  36. </div>
  37. <div class="stat-item">
  38. <span class="period">{{ item.period }}</span>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import { mapState } from "vuex"
  48. import { api } from "@/api"
  49. export default {
  50. name: "ImplementingServices",
  51. data() {
  52. return {
  53. implementingList: [],
  54. timer: null,
  55. }
  56. },
  57. computed: {
  58. ...mapState(["entCode", "communityId"]),
  59. },
  60. mounted() {
  61. this.init()
  62. // 设置定时刷新
  63. this.timer = setInterval(() => {
  64. this.init()
  65. }, 30000) // 每30秒刷新一次
  66. },
  67. beforeDestroy() {
  68. if (this.timer) {
  69. clearInterval(this.timer)
  70. }
  71. },
  72. methods: {
  73. // 初始化数据
  74. async init() {
  75. try {
  76. const params = {
  77. entCode: this.entCode,
  78. communityId: this.communityId,
  79. }
  80. // 这里应该调用实际的API获取数据
  81. // const res = await api.getImplementingServices(params)
  82. // this.implementingList = res.data || []
  83. // 暂时使用模拟数据
  84. this.loadMockData()
  85. } catch (error) {
  86. console.error("获取进行中实施服务数据失败:", error)
  87. }
  88. },
  89. // 加载模拟数据
  90. loadMockData() {
  91. this.implementingList = [
  92. {
  93. date: "2025-11-19",
  94. city: "五指山市",
  95. projectName: "项目名称",
  96. companyName: "物业公司名称",
  97. householdCount: "999",
  98. area: "北滨端",
  99. progress: 90,
  100. serviceContent: "数据清单模板填写培训",
  101. period: "3周前",
  102. },
  103. {
  104. date: "2025-11-19",
  105. city: "五指山市",
  106. projectName: "项目名称",
  107. companyName: "物业公司名称",
  108. householdCount: "999",
  109. area: "北滨端",
  110. progress: 90,
  111. serviceContent: "数据清单模板填写培训",
  112. period: "3周前",
  113. },
  114. {
  115. date: "2025-11-19",
  116. city: "五指山市",
  117. projectName: "项目名称",
  118. companyName: "物业公司名称",
  119. householdCount: "999",
  120. area: "北滨端",
  121. progress: 90,
  122. serviceContent: "数据清单模板填写培训",
  123. period: "3周前",
  124. },
  125. {
  126. date: "2025-11-19",
  127. city: "五指山市",
  128. projectName: "项目名称",
  129. companyName: "物业公司名称",
  130. householdCount: "999",
  131. area: "北滨端",
  132. progress: 90,
  133. serviceContent: "数据清单模板填写培训",
  134. period: "3周前",
  135. },
  136. {
  137. date: "2025-11-19",
  138. city: "五指山市",
  139. projectName: "项目名称",
  140. companyName: "物业公司名称",
  141. householdCount: "999",
  142. area: "北滨端",
  143. progress: 90,
  144. serviceContent: "数据清单模板填写培训",
  145. period: "3周前",
  146. },
  147. {
  148. date: "2025-11-19",
  149. city: "五指山市",
  150. projectName: "项目名称",
  151. companyName: "物业公司名称",
  152. householdCount: "999",
  153. area: "北滨端",
  154. progress: 90,
  155. serviceContent: "数据清单模板填写培训",
  156. period: "3周前",
  157. },
  158. ]
  159. },
  160. },
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. @import "@/assets/css/theme.scss";
  165. .implementing-container {
  166. background: var(--content-bg);
  167. border-radius: 4px;
  168. display: flex;
  169. flex-direction: column;
  170. }
  171. .implementing-title {
  172. background: var(--title-bg);
  173. font-size: 18px;
  174. font-weight: 500;
  175. color: var(--title-primary);
  176. padding: 4px 10px;
  177. border-radius: 4px;
  178. display: flex;
  179. align-items: center;
  180. }
  181. .implementing-list {
  182. flex: 1;
  183. overflow-y: auto;
  184. padding: 0px 10px;
  185. height: calc(100% - 36px);
  186. }
  187. .implementing-item {
  188. background: var(--content-bg); // 第一个项目使用--content-bg
  189. padding: 16px;
  190. &:last-child {
  191. margin-bottom: 0;
  192. }
  193. }
  194. // 偶数项使用--title-bg作为背景色
  195. .implementing-item.even-item {
  196. background: var(--title-bg);
  197. }
  198. .item-content {
  199. display: flex;
  200. justify-content: space-between;
  201. align-items: center;
  202. gap: 20px;
  203. .item-date {
  204. color: var(--title-secondary);
  205. font-size: 14px;
  206. margin-right: 16px;
  207. }
  208. .item-city {
  209. color: var(--title-primary);
  210. font-size: 14px;
  211. font-weight: 500;
  212. padding: 2px 8px;
  213. border-radius: 4px;
  214. }
  215. .project-info {
  216. flex: 1;
  217. min-width: 200px;
  218. margin-right: 20px;
  219. .project-name {
  220. flex: 0 0 1;
  221. color: var(--title-primary);
  222. font-size: 14px;
  223. margin-bottom: 4px;
  224. font-weight: 400;
  225. }
  226. .company-name {
  227. color: var(--title-secondary);
  228. font-size: 14px;
  229. }
  230. }
  231. .project-stats {
  232. display: flex;
  233. align-items: center;
  234. flex-wrap: wrap;
  235. gap: 20px;
  236. }
  237. .stat-item {
  238. display: flex;
  239. align-items: center;
  240. &:first-child {
  241. .stat-value {
  242. color: var(--primary);
  243. }
  244. }
  245. .stat-value {
  246. color: #fff;
  247. font-size: 16px;
  248. font-weight: 500;
  249. margin-right: 4px;
  250. }
  251. .stat-label {
  252. color: #fff;
  253. font-size: 14px;
  254. }
  255. .progress-wrapper {
  256. display: flex;
  257. align-items: center;
  258. gap: 8px;
  259. .progress-text {
  260. color: #40d9ac;
  261. font-size: 14px;
  262. font-weight: 500;
  263. min-width: 35px;
  264. }
  265. }
  266. .service-content {
  267. color: #ffffff;
  268. font-size: 14px;
  269. }
  270. .period {
  271. color: #a0b3d6;
  272. font-size: 14px;
  273. }
  274. }
  275. .service-item {
  276. flex: 1;
  277. }
  278. }
  279. </style>