space.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div>
  3. <div class="page-query-core">
  4. <Query
  5. :show="['company', 'time']"
  6. :query-data.sync="queryData"
  7. :reset="reset"
  8. :search="search"
  9. style="
  10. background: #fff;
  11. height: 60px;
  12. padding: 10px;
  13. border-radius: 5px;
  14. margin-bottom: 10px;
  15. "
  16. ></Query>
  17. <card :title="'核心指标'">
  18. <CoreData :data-list="coreData"></CoreData>
  19. </card>
  20. </div>
  21. <a-row style="margin-top: 12px">
  22. <a-col :span="18">
  23. <div class="left ioc-card-content">
  24. <card :title="'空间分析'">
  25. <div style="padding: 8px" class="space-image">
  26. <img :src="requireImg('business/联通img.png')" width="100%" />
  27. </div>
  28. </card>
  29. </div>
  30. </a-col>
  31. <a-col :span="6">
  32. <div class="right ioc-card-content">
  33. <card :title="'空间成本'">
  34. <div style="height: 40px">
  35. <span
  36. style="
  37. font-size: 16px;
  38. font-weight: 400;
  39. color: #b2b2b2;
  40. margin-left: 25%;
  41. "
  42. >人均空间成本</span
  43. >
  44. <span style="padding: 0 10%; font-size: 20px; color: #4d4d4d"
  45. >36</span
  46. >
  47. <span style="color: #b2b2b2">元/m2/人</span>
  48. </div>
  49. <div style="padding: 0 15px">
  50. <SpaceCostChart
  51. ref="SpaceCostChart"
  52. :query-data="queryData"
  53. :height="540"
  54. />
  55. </div>
  56. </card>
  57. </div>
  58. </a-col>
  59. </a-row>
  60. </div>
  61. </template>
  62. <script>
  63. import query from "@/components/common/query.vue";
  64. import card from "@/components/common/card.vue";
  65. import { requireImg } from "@/utils/requireImg";
  66. import SpaceCostChart from "@/components/business/space/charts/spaceCostChart.vue";
  67. import apiOperationSpace from "@/api/operation/apiOperationSpace";
  68. export default {
  69. components: {
  70. query,
  71. card,
  72. SpaceCostChart,
  73. },
  74. data() {
  75. const listData = [];
  76. for (let i = 0; i < 100; i++) {
  77. listData.push({
  78. index: i + 1,
  79. name: "物理饭",
  80. department: "技术开发部门",
  81. time: "2023.02.03 00:00:00",
  82. });
  83. }
  84. return {
  85. queryData: {
  86. companyId: "0",
  87. timeRange: this.$util.dateUtil.getNearlyMonthRange(),
  88. },
  89. coreData: [
  90. {
  91. title: "自用工位分配率",
  92. num: "",
  93. unit: "%",
  94. historyDesc: "同比",
  95. historyNum: 0,
  96. },
  97. {
  98. title: "会议室使用率",
  99. num: "",
  100. unit: "%",
  101. historyDesc: "同比",
  102. historyNum: 0,
  103. },
  104. {
  105. title: "流动工位总数",
  106. num: "",
  107. unit: "%",
  108. historyDesc: "同比",
  109. historyNum: 0,
  110. },
  111. {
  112. title: "固定工位总数",
  113. num: "0",
  114. historyDesc: "同比",
  115. historyNum: 0,
  116. },
  117. {
  118. title: "休闲/办公面积(m2)",
  119. num: "0",
  120. historyDesc: "同比",
  121. historyNum: 0,
  122. },
  123. {
  124. type: 1,
  125. showStar: true,
  126. title: "值得关注",
  127. content: "",
  128. },
  129. ],
  130. };
  131. },
  132. mounted() {
  133. this.init();
  134. },
  135. methods: {
  136. requireImg,
  137. init() {
  138. this.$store.loadingStore().loadingWithApi(this.getCoreData(), 2000);
  139. },
  140. reset() {},
  141. search() {
  142. this.$util.asyncPromise(
  143. this.getCoreData(),
  144. this.$refs.SpaceCostChart.getData()
  145. );
  146. },
  147. tabChange(index) {
  148. let that = this;
  149. setTimeout(() => {
  150. switch (index) {
  151. case "1":
  152. // that.$refs.myChart1 = that.clearECharts(that.$refs.myChart1);
  153. that.setEchart1();
  154. break;
  155. case "2":
  156. // that.$refs.myChart2 = that.clearECharts(that.$refs.myChart2);
  157. that.setEchart2();
  158. break;
  159. }
  160. }, 100);
  161. },
  162. getCoreData() {
  163. return apiOperationSpace.getCoreData(this.queryData).then((res) => {
  164. this.coreData[0].num = res.list[0].value;
  165. this.coreData[0].historyNum = res.list[0].compare;
  166. this.coreData[1].num = res.list[1].value;
  167. this.coreData[1].historyNum = res.list[1].compare;
  168. this.coreData[2].num = res.list[2].value;
  169. this.coreData[2].historyNum = res.list[2].compare;
  170. this.coreData[3].num = res.list[3].value;
  171. this.coreData[3].historyNum = res.list[3].compare;
  172. this.coreData[4].num = res.list[4].value;
  173. this.coreData[4].historyNum = res.list[4].compare;
  174. this.coreData[5].content = res.worthAttention;
  175. });
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="less" scoped>
  181. .space-image {
  182. //background-image: url("@/assets/images/business/联通img.png");
  183. //background-position: 50% 50%;
  184. //background-repeat: no-repeat;
  185. height: 550px;
  186. //background-size: 100% auto;
  187. }
  188. .left {
  189. margin-right: 6px;
  190. }
  191. .right {
  192. margin-left: 6px;
  193. }
  194. .cben {
  195. font-weight: bold;
  196. span {
  197. font-size: 20px;
  198. }
  199. }
  200. </style>