index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div class="performance">
  3. <customHeader>文件共享中心</customHeader>
  4. <div class="main-container">
  5. <div
  6. class="card"
  7. v-for="(item, index) in titleList"
  8. :class="index === active ? 'actived' : 'isActived'"
  9. :key="index"
  10. @click="getDetails(index)"
  11. >
  12. <div class="card-t">{{ item.sysOrgName }}</div>
  13. <div class="card-b">
  14. <div class="box" v-for="(items, ind) in item.tab" :key="ind" @click="getToggle(ind, item)">
  15. <div class="img"> <img :src="items.src" alt="" /> </div>
  16. <div class="text">{{ items.text }}</div>
  17. <div class="num">{{ items.num }}</div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script lang="ts" setup>
  25. import { reactive, ref, onMounted } from 'vue';
  26. import { useRouter } from 'vue-router';
  27. import leftImg from '../../../../assets/images/files/homes/file.svg';
  28. import rightImg from '../../../../assets/images/files/homes/sp.svg';
  29. import { list } from './fileIndex.api';
  30. import customHeader from '/@/views/vent/comment/components/customHeader.vue';
  31. let router = useRouter(); //路由
  32. let active = ref(); //当前选中项
  33. let titleList = reactive<any[]>([]);
  34. let homeParam = reactive({
  35. sysOrgCode: '',
  36. bpmStatus: null,
  37. flag: '',
  38. });
  39. //获取首页数据
  40. let getPageList = async () => {
  41. let data = await list();
  42. console.log(data, '首页数据');
  43. if (data.length !== 0) {
  44. let datas = data.map((el) => {
  45. return {
  46. sysOrgName: el.sysOrgName,
  47. sysOrgCode: el.sysOrgCode,
  48. flag: el.flag,
  49. tab: [
  50. { src: leftImg, text: '文档总数', num: el.tolalNum },
  51. { src: rightImg, text: '待审批数', num: el.approveNum },
  52. ],
  53. };
  54. });
  55. titleList.push(...datas);
  56. console.log(titleList, '123456');
  57. }
  58. };
  59. //切换选项
  60. let getDetails = (index) => {
  61. active.value = index;
  62. };
  63. // //切换左右选项
  64. let getToggle = (ind, item) => {
  65. console.log(ind, '审批状态索引');
  66. console.log(item, 'item');
  67. homeParam.sysOrgCode = item.sysOrgCode;
  68. homeParam.flag = item.flag;
  69. if (ind) {
  70. homeParam.bpmStatus = 2;
  71. } else {
  72. homeParam.bpmStatus = homeParam.flag ? '' : 'All';
  73. }
  74. console.log(homeParam, 'home0000000000');
  75. router.push({
  76. path: '/fileManager/fileDetail/home',
  77. query: { sysOrgCode: homeParam.sysOrgCode, bpmStatus: homeParam.bpmStatus, flag: homeParam.flag },
  78. });
  79. };
  80. onMounted(() => {
  81. getPageList();
  82. });
  83. </script>
  84. <style lang="less" scoped>
  85. @font-face {
  86. font-family: 'douyuFont';
  87. src: url(../../../../assets/images/files/douyuFont.otf);
  88. }
  89. .performance {
  90. width: 100%;
  91. height: 100%;
  92. padding: 15px;
  93. position: relative;
  94. box-sizing: border-box;
  95. background: url(../../../../assets/images/files/homes/bd.png) no-repeat center;
  96. .main-container {
  97. width: 100%;
  98. height: calc(100% - 30px);
  99. display: flex;
  100. flex-direction: row;
  101. // justify-content: flex-start;
  102. // align-items: flex-start;
  103. justify-content: center;
  104. align-items: center;
  105. flex-wrap: wrap;
  106. .card {
  107. width: 331px;
  108. height: 235px;
  109. background: url(../../../../assets/images/files/homes/default.png) no-repeat center;
  110. background-size: 100% 100%;
  111. margin: 0px 23px 15px 23px;
  112. cursor: pointer;
  113. .card-t {
  114. height: 50px;
  115. display: flex;
  116. justify-content: center;
  117. align-items: center;
  118. font-family: '思源黑体', 'Microsoft Yahei';
  119. font-size: 20px;
  120. color: #fff;
  121. }
  122. .card-b {
  123. height: calc(100% - 65px);
  124. margin-top: 15px;
  125. display: flex;
  126. flex-direction: row;
  127. .box {
  128. display: flex;
  129. flex: 1;
  130. flex-direction: column;
  131. justify-content: flex-start;
  132. align-items: center;
  133. &:first-child .img {
  134. position: relative;
  135. width: 72px;
  136. height: 78px;
  137. background: url(../../../../assets/images/files/homes/file1.png) no-repeat center;
  138. img {
  139. position: absolute;
  140. left: 50%;
  141. top: 50%;
  142. transform: translate(-50%, -75%);
  143. }
  144. }
  145. &:last-child .img {
  146. position: relative;
  147. width: 72px;
  148. height: 78px;
  149. background: url(../../../../assets/images/files/homes/sp.png) no-repeat center;
  150. img {
  151. position: absolute;
  152. left: 50%;
  153. top: 50%;
  154. transform: translate(-50%, -75%);
  155. }
  156. }
  157. .text {
  158. margin: 5px 0px;
  159. font-family: '思源黑体', 'Microsoft Yahei';
  160. color: #fff;
  161. font-size: 14px;
  162. }
  163. &:first-child .num {
  164. width: 120px;
  165. height: 30px;
  166. font-family: 'douyuFont';
  167. color: #fff;
  168. font-size: 20px;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. background: url(../../../../assets/images/files/homes/file2.png) no-repeat center;
  173. }
  174. &:last-child .num {
  175. width: 120px;
  176. height: 30px;
  177. font-family: 'douyuFont';
  178. color: #fff;
  179. font-size: 20px;
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. background: url(../../../../assets/images/files/homes/sp2.png) no-repeat center;
  184. }
  185. }
  186. }
  187. }
  188. .actived {
  189. background: url(../../../../assets/images/files/homes/mouse.png) no-repeat center;
  190. background-size: 100% 100%;
  191. }
  192. .isActived {
  193. background: url(../../../../assets/images/files/homes/default.png) no-repeat center;
  194. background-size: 100% 100%;
  195. }
  196. }
  197. }
  198. </style>