stats.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <div class="hc-page-box">
  3. <HcCard scrollbar>
  4. <template #header>
  5. <div class="hc-project-box">
  6. <HcIcon name="stack" class="project-icon"/>
  7. <span class="project-alias">{{projectInfo['projectAlias']}}</span>
  8. </div>
  9. </template>
  10. <div class="hc-chart-flex">
  11. <el-row :gutter="20" class="h-full">
  12. <el-col :span="8" class="h-full">
  13. <div class="hc-chart-card-box">
  14. <div class="header">原生、数字化文件数量(份)</div>
  15. <div class="body" v-loading="isNativeLoading">
  16. <BarChart ref="nativeChartRef" :config="nativeChartConfig" :datas="nativeChartData"/>
  17. </div>
  18. </div>
  19. </el-col>
  20. <el-col :span="8" class="h-full">
  21. <div class="hc-chart-card-box gird">
  22. <div class="header">档案总存储</div>
  23. <div class="body font-FZGongYHJW num-text">
  24. {{ allArchiveFileSizedata }}
  25. </div>
  26. </div>
  27. <div class="hc-chart-card-box gird">
  28. <div class="header">已组案卷</div>
  29. <div class="body" v-loading="isHasBeenLoading">
  30. <ArrRoundChart ref="hasBeenChartRef" :config="hasBeenChartConfig" :datas="hasBeenChartData"/>
  31. </div>
  32. </div>
  33. </el-col>
  34. <el-col :span="8" class="h-full">
  35. <div class="hc-chart-card-box gird">
  36. <div class="header">档案年限占比</div>
  37. <div class="body" v-loading="isFixedLoading">
  38. <RoundPieChart ref="fixedChartRef" :datas="fixedChartData"/>
  39. </div>
  40. </div>
  41. <div class="hc-chart-card-box gird">
  42. <div class="header">已销毁案卷</div>
  43. <div class="body" v-loading="isDestroyLoading">
  44. <ArrRoundChart ref="destroyChartRef" :config="destroyChartConfig" :datas="destroyChartData"/>
  45. </div>
  46. </div>
  47. </el-col>
  48. </el-row>
  49. </div>
  50. <el-table :data="tableData" lazy :load="loadData" v-loading="isLoading" border row-key="primaryKeyId">
  51. <el-table-column prop="title" label="归档目录文件夹"></el-table-column>
  52. <el-table-column prop="hasBeen" label="已组卷" align="center" width="100"></el-table-column>
  53. <el-table-column prop="destroy" label="已销毁" align="center" width="100"></el-table-column>
  54. </el-table>
  55. </HcCard>
  56. </div>
  57. </template>
  58. <script setup>
  59. import {ref, onMounted} from "vue";
  60. import {useAppStore} from "~src/store";
  61. import BarChart from "./components/echarts/BarChart.vue"
  62. import ArrRoundChart from "./components/echarts/ArrRoundChart.vue"
  63. import RoundPieChart from "./components/echarts/RoundPieChart.vue"
  64. import archivesStatsApi from "~api/using/stats.js";
  65. import {getObjValue,getArrValue} from "js-fast-way"
  66. //变量
  67. const useAppState = useAppStore()
  68. const projectId = ref(useAppState.getProjectId);
  69. const contractId = ref(useAppState.getContractId);
  70. const projectInfo = ref(useAppState.getProjectInfo);
  71. //渲染完成
  72. onMounted(() => {
  73. gethasBeenChartData()
  74. getfixedChartData()
  75. getdestroyChartData()
  76. getnativeChartData()
  77. getallArchiveFileSize()
  78. })
  79. //原生、数字化文件数量 图表配置
  80. const nativeChartRef = ref(null)
  81. const nativeChartConfig = {
  82. name: ['原生', '数字化'],
  83. key: ['key1', 'key2'],
  84. color: ['#3187FF', '#1ACC96'],
  85. label: '',
  86. }
  87. //原生、数字化文件数量 图表数据
  88. const isNativeLoading = ref(false)
  89. const nativeChartData = ref([
  90. {title: '施工', key1: 100, key2: 50},
  91. {title: '监理', key1: 60, key2: 80},
  92. {title: '业主', key1: 4, key2: 30},
  93. ])
  94. //获取原生文件数量
  95. const getnativeChartData = async () => {
  96. const { error, code, data } = await archivesStatsApi.getallnativeChartData({
  97. projectId: projectId.value,
  98. });
  99. if (!error && code === 200) {
  100. nativeChartData.value = getArrValue(data);
  101. } else {
  102. nativeChartData.value = [];
  103. }
  104. }
  105. //已组案卷 图表配置
  106. const hasBeenChartRef = ref(null)
  107. const hasBeenChartConfig = {
  108. name: ['施工', '监理', '业主'],
  109. key: ['key1', 'key2', 'key3'],
  110. color: ['#3187FF', '#FF8F3E', '#1ACC96'],
  111. label: '已组案卷',
  112. }
  113. //已组案卷 图表数据
  114. const isHasBeenLoading = ref(false)
  115. const hasBeenChartData = ref({
  116. key1: 3210, key2: 850, key3: 1203
  117. })
  118. //获取已组案卷
  119. const gethasBeenChartData = async () => {
  120. const { error, code, data } = await archivesStatsApi.getallArchiveByContractType({
  121. projectId: projectId.value,
  122. });
  123. if (!error && code === 200) {
  124. hasBeenChartData.value = getObjValue(data);
  125. } else {
  126. hasBeenChartData.value = {};
  127. }
  128. }
  129. //档案年限占比 图表数据
  130. const fixedChartRef = ref(null)
  131. const isFixedLoading = ref(false)
  132. const fixedChartData = ref([
  133. { value: 1048, name: '永久' },
  134. { value: 735, name: '30年' },
  135. { value: 580, name: '20年' },
  136. { value: 484, name: '10年' },
  137. { value: 300, name: '5年' }
  138. ])
  139. //获取档案年限
  140. const getfixedChartData = async () => {
  141. const { error, code, data } = await archivesStatsApi.getallArchiveAge({
  142. projectId: projectId.value,
  143. });
  144. if (!error && code === 200) {
  145. console.log(data,'data');
  146. fixedChartData.value = getArrValue(data);
  147. } else {
  148. fixedChartData.value = [];
  149. }
  150. }
  151. //已销毁案卷 图表配置
  152. const destroyChartRef = ref(null)
  153. const destroyChartConfig = {
  154. name: ['施工', '监理', '业主'],
  155. key: ['key1', 'key2', 'key3'],
  156. color: ['#63686E', '#999FA6', '#42494F'],
  157. label: '已销毁案卷',
  158. }
  159. //已销毁案卷 图表数据
  160. const isDestroyLoading = ref(false)
  161. const destroyChartData = ref({
  162. key1: 202, key2: 150, key3: 100
  163. })
  164. //获取已销毁案卷
  165. const getdestroyChartData = async () => {
  166. const { error, code, data } = await archivesStatsApi.getallArchiveDestory({
  167. projectId: projectId.value,
  168. });
  169. if (!error && code === 200) {
  170. destroyChartData.value = getObjValue(data);
  171. console.log(data,'已销毁');
  172. } else {
  173. destroyChartData.value = [];
  174. }
  175. }
  176. //获取总存储数据
  177. const allArchiveFileSizedata = ref('')
  178. const getallArchiveFileSize = async () => {
  179. const { error, code, data } = await archivesStatsApi.getallArchiveSize({
  180. projectId: projectId.value,
  181. });
  182. if (!error && code === 200) {
  183. allArchiveFileSizedata.value = data;
  184. } else {
  185. allArchiveFileSizedata.value = '';
  186. }
  187. }
  188. //初始数据获取
  189. const isLoading = ref(false)
  190. const tableData = ref([])
  191. const loadData = async () => {
  192. isLoading.value=true
  193. const { error, code, data } = await archivesStatsApi.getallArchiveDestory({
  194. projectId: projectId.value,
  195. });
  196. if (!error && code === 200) {
  197. // tableData.value = getObjValue(data);
  198. console.log(data,'已销毁');
  199. } else {
  200. tableData.value = [];
  201. }
  202. }
  203. </script>
  204. <style lang="scss" scoped>
  205. @import '~style/using/scoped/stats.scss';
  206. </style>