workPrint.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div>
  3. <div class="page-query-core">
  4. <query :show="['company', 'floor', 'time']" :floor-options="floorData" :query-data.sync="queryData" :reset="reset" :search="search"></query>
  5. <card :title="'核心指标'">
  6. <CoreData :data-list="coreData"></CoreData>
  7. </card>
  8. </div>
  9. <a-row :style="{ marginTop: '12px' }">
  10. <a-col :span="18">
  11. <div class="left ioc-card-content">
  12. <card :title="'文印管理'">
  13. <WorkPrintChart ref="WorkPrintChart" :query-data="queryData" :height="450" />
  14. </card>
  15. </div>
  16. </a-col>
  17. <a-col :span="6">
  18. <div class="right ioc-card-content">
  19. <card :title="'成本趋势'">
  20. <div style="padding: 0 15px">
  21. <WorkPrintTrend ref="WorkPrintTrend" :query-data="queryData" :height="450" />
  22. </div>
  23. </card>
  24. </div>
  25. </a-col>
  26. </a-row>
  27. </div>
  28. </template>
  29. <script>
  30. import query from "@/components/common/query.vue";
  31. import card from "@/components/common/card.vue";
  32. import WorkPrintChart from "@/components/work/print/component/workPrintChart.vue";
  33. import WorkPrintTrend from "@/components/work/print/component/workPrintTrend.vue";
  34. import apiWorkPrint from "@/api/work/apiWorkPrint";
  35. export default {
  36. components: {
  37. query,
  38. card,
  39. WorkPrintChart,
  40. WorkPrintTrend,
  41. },
  42. data() {
  43. const listData = [];
  44. for (let i = 0; i < 100; i++) {
  45. listData.push({
  46. index: i + 1,
  47. name: "物理饭",
  48. department: "技术开发部门",
  49. time: "2023.02.03 00:00:00",
  50. });
  51. }
  52. let timeRange = this.$util.dateUtil.getNearlyMonthRange();
  53. return {
  54. queryData: {
  55. companyId: '0',
  56. floorId: '16',
  57. timeRange: timeRange,
  58. },
  59. floorData: [
  60. {
  61. value: '16',
  62. label: "16F"
  63. },
  64. {
  65. value: '17',
  66. label: "17F"
  67. },
  68. {
  69. value: '18',
  70. label: "18F"
  71. },
  72. {
  73. value: '19',
  74. label: "19F"
  75. },
  76. ],
  77. columns: [
  78. {title: "序号", dataIndex: "index", key: "1", width: 48},
  79. {title: "姓名", dataIndex: "name", key: "2", width: 60},
  80. {title: "部门", dataIndex: "department", key: "3", width: 80},
  81. {title: "最后进入时间", dataIndex: "time", key: "4", width: 90},
  82. ],
  83. listData: listData,
  84. coreData: [
  85. {
  86. title: "人均消耗成本(元/天)",
  87. num: "0",
  88. historyDesc: "同比",
  89. historyNum: 0,
  90. },
  91. {
  92. title: "人均打印纸张(张/天)",
  93. num: "0",
  94. historyDesc: "同比",
  95. historyNum: 0,
  96. },
  97. {
  98. title: "人均打印碳排放(tco2e)",
  99. num: "0",
  100. historyDesc: "同比",
  101. historyNum: 0,
  102. },
  103. {
  104. title: "打印人次(人/天)",
  105. num: 0,
  106. historyDesc: "同比",
  107. historyNum: 0,
  108. },
  109. {
  110. type: 1,
  111. showStar: true,
  112. title: "值得关注",
  113. content: "",
  114. },
  115. ],
  116. };
  117. },
  118. mounted() {
  119. this.init();
  120. },
  121. methods: {
  122. init() {
  123. this.$store.loadingStore().loadingWithApi(this.getCoreData(), 2000)
  124. },
  125. reset() {
  126. },
  127. search() {
  128. this.$util.asyncPromise(
  129. this.getCoreData(),
  130. this.$refs.WorkPrintChart.getData(),
  131. this.$refs.WorkPrintTrend.getData(),
  132. )
  133. },
  134. getCoreData() {
  135. return apiWorkPrint.getCoreData(this.queryData).then(res=>{
  136. this.coreData[0].num = res.list[0].value
  137. this.coreData[0].historyNum = res.list[0].compare
  138. this.coreData[1].num = res.list[1].value
  139. this.coreData[1].historyNum = res.list[1].compare
  140. this.coreData[2].num = res.list[2].value
  141. this.coreData[2].historyNum = res.list[2].compare
  142. this.coreData[3].num = res.list[3].value
  143. this.coreData[3].historyNum = res.list[3].compare
  144. this.coreData[4].content = res.worthAttention
  145. })
  146. }
  147. },
  148. };
  149. </script>
  150. <style lang="less" scoped>
  151. .left {
  152. margin-right: 6px;
  153. padding-bottom: 15px;
  154. }
  155. .right {
  156. background-color: #ffffff;
  157. margin-left: 6px;
  158. padding-bottom: 15px;
  159. }
  160. </style>