filecenter.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template name="filecenter">
  2. <view class="container">
  3. <u-navbar title="文件中心" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
  4. <view class="main">
  5. <u-subsection
  6. :list="sectionList"
  7. mode="subsection"
  8. :current="curNow"
  9. @change="sectionChange"
  10. ></u-subsection>
  11. <u-list>
  12. <u-list-item
  13. class="itemback"
  14. v-for="(item, index) in fileData"
  15. :key="index"
  16. >
  17. <div class="content flcard" @tap="openFile(item)">
  18. <view
  19. class="demo-layout bg-purple-light"
  20. style="margin-bottom: 20rpx"
  21. >
  22. <view style="margin-top: 10rpx">
  23. <text class="text-style1">{{ item.fileName }}</text>
  24. </view>
  25. </view>
  26. <view class="datacard laiyuan">
  27. <view style="margin: 20rpx 20rpx">
  28. <text class="text-style">{{ item.fileSource }}</text>
  29. </view>
  30. <view style="margin: 20rpx 20rpx; font-size: small"
  31. >文件来源</view
  32. >
  33. </view>
  34. <view class="datacard zhuangtai">
  35. <view style="margin: 20rpx 20rpx">
  36. <text class="text-style">{{ item.bpmStatus_dictText }}</text>
  37. </view>
  38. <view style="margin: 20rpx 20rpx; font-size: small"
  39. >审批状态</view
  40. >
  41. </view>
  42. <view class="datacard user">
  43. <view style="margin: 20rpx 20rpx">
  44. <text class="text-style">{{ item.createBy }}</text>
  45. </view>
  46. <view style="margin: 20rpx 20rpx; font-size: small">创建人</view>
  47. </view>
  48. <view class="datacard time">
  49. <view style="margin: 20rpx 20rpx">
  50. <text class="text-style">{{ item.createTime }}</text>
  51. </view>
  52. <view style="margin: 20rpx 20rpx; font-size: small"
  53. >上传时间</view
  54. >
  55. </view>
  56. </div>
  57. </u-list-item>
  58. </u-list>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import api from "@/api/api";
  64. import { computed } from "uview-ui/libs/mixin/mixin";
  65. export default {
  66. components: {},
  67. name: "filecenter",
  68. watch: {},
  69. data() {
  70. return {
  71. sectionList: [
  72. { name: "全部", code: 0 },
  73. { name: "待审批", code: 1 },
  74. { name: "已审批", code: 2 },
  75. ],
  76. curNow: 0,
  77. fileData: [],
  78. bpmStatus: 1, //1处理中 2 已完成 3 已驳回
  79. };
  80. },
  81. mounted() {
  82. this.getFileInfo();
  83. },
  84. computed: {},
  85. methods: {
  86. sectionChange(newVal) {
  87. this.curNow = newVal;
  88. if (this.curNow === 0) {
  89. // 如果选择了“全部”,返回所有文件
  90. this.bpmStatus = "";
  91. this.getFileInfo(this.bpmStatus);
  92. } else if (this.curNow === 1) {
  93. // 否则,根据curNow的值过滤文件
  94. this.bpmStatus = 1;
  95. this.getFileInfo(this.bpmStatus);
  96. } else if (this.curNow === 2) {
  97. this.bpmStatus = 2;
  98. this.getFileInfo(this.bpmStatus);
  99. }
  100. },
  101. getFileInfo(code) {
  102. var params = {
  103. bpmStatus: code,
  104. column: "createTime",
  105. fileSuffix: "",
  106. likeFileName: "",
  107. pageNo: 1,
  108. pageSize: 10000,
  109. parentId: "",
  110. selectFlag: true,
  111. sysOrgCode: "",
  112. };
  113. new Promise((resolve, reject) => {
  114. api
  115. .getFileInfo(params)
  116. .then((response) => {
  117. if (response.data.code == 200) {
  118. this.fileData = response.data.result.records;
  119. } else {
  120. reject(response);
  121. }
  122. })
  123. .catch((error) => {
  124. console.log("catch===>response", response);
  125. reject(error);
  126. });
  127. });
  128. },
  129. openFile(params) {
  130. uni.navigateTo({
  131. url: `/pages/filecenter/fileModel?id=${params.id}&type=${params.fileSuffix}`,
  132. });
  133. },
  134. },
  135. };
  136. </script>
  137. <style scoped>
  138. .main {
  139. /* margin-top: 100rpx; */
  140. margin-top: 80px;
  141. display: flex;
  142. flex-direction: column;
  143. margin-top: 80px; /* 内容区域顶部留出导航栏的高度 */
  144. }
  145. .itemback {
  146. padding: 20rpx;
  147. background-color: #ffffff;
  148. margin-bottom: 5rpx;
  149. }
  150. .text-style {
  151. color: #3787fe;
  152. font-weight: bold;
  153. }
  154. .text-style1 {
  155. color: #000000;
  156. font-size: large;
  157. font-weight: bold;
  158. }
  159. .datacard {
  160. width: 48%;
  161. margin: 1%;
  162. float: left;
  163. height: 120rpx;
  164. border-radius: 10px;
  165. }
  166. .time {
  167. background: url(/static/filecenter/time.png),
  168. linear-gradient(
  169. to right,
  170. rgba(55, 135, 254, 0.08),
  171. rgba(4, 184, 255, 0.08),
  172. rgba(60, 161, 237, 0.08)
  173. );
  174. background-size: auto 100%;
  175. background-position: right;
  176. background-repeat: no-repeat;
  177. }
  178. .laiyuan {
  179. background: url(/static/filecenter/laiyuan.png),
  180. linear-gradient(
  181. to right,
  182. rgba(55, 135, 254, 0.08),
  183. rgba(4, 184, 255, 0.08),
  184. rgba(60, 161, 237, 0.08)
  185. );
  186. background-size: auto 100%;
  187. background-position: right;
  188. background-repeat: no-repeat;
  189. }
  190. .user {
  191. background: url(/static/filecenter/user.png),
  192. linear-gradient(
  193. to right,
  194. rgba(55, 135, 254, 0.08),
  195. rgba(4, 184, 255, 0.08),
  196. rgba(60, 161, 237, 0.08)
  197. );
  198. background-size: auto 100%;
  199. background-position: right;
  200. background-repeat: no-repeat;
  201. }
  202. .zhuangtai {
  203. background: url(/static/filecenter/zhuangtai.png),
  204. linear-gradient(
  205. to right,
  206. rgba(55, 135, 254, 0.08),
  207. rgba(4, 184, 255, 0.08),
  208. rgba(60, 161, 237, 0.08)
  209. );
  210. background-size: auto 100%;
  211. background-position: right;
  212. background-repeat: no-repeat;
  213. }
  214. .datacard1 {
  215. width: 100%;
  216. margin: 1%;
  217. float: left;
  218. height: 100rpx;
  219. text-align: center;
  220. border-radius: 10px;
  221. background: linear-gradient(
  222. to right,
  223. rgba(55, 135, 254, 0.08),
  224. rgba(4, 184, 255, 0.08),
  225. rgba(60, 161, 237, 0.08)
  226. );
  227. }
  228. </style>