filecenter.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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="list"
  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. <view class="content flcard" @click="openFile(item.id)" v-if="item.bpmStatus == 1">
  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. </view>
  57. </u-list-item>
  58. </u-list>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import api from "@/api/api";
  64. export default {
  65. components: {},
  66. name: "filecenter",
  67. watch: {},
  68. data() {
  69. return {
  70. list: [{ name: "全部" }, { name: "待审批" }, { name: "已审批" }],
  71. curNow: 0,
  72. fileData: [],
  73. bpmStatus:1,//1处理中 2 已完成 3 已驳回
  74. };
  75. },
  76. mounted() {
  77. this.getFileInfo();
  78. },
  79. methods: {
  80. sectionChange(index) {
  81. this.curNow = index;
  82. },
  83. getFileInfo() {
  84. var params = {
  85. bpmStatus: "",
  86. column: "createTime",
  87. fileSuffix: "",
  88. likeFileName: "",
  89. pageNo: 1,
  90. pageSize: 10000,
  91. parentId: "",
  92. selectFlag: true,
  93. sysOrgCode: "",
  94. };
  95. new Promise((resolve, reject) => {
  96. api
  97. .getFileInfo(params)
  98. .then((response) => {
  99. if (response.data.code == 200) {
  100. this.fileData = response.data.result.records;
  101. } else {
  102. reject(response);
  103. }
  104. })
  105. .catch((error) => {
  106. console.log("catch===>response", response);
  107. reject(error);
  108. });
  109. });
  110. },
  111. openFile(ID) {
  112. var params = {
  113. id: ID,
  114. };
  115. new Promise((resolve, reject) => {
  116. api
  117. .getFilePreview(params)
  118. .then((response) => {
  119. if (response.data.code == 200) {
  120. } else {
  121. reject(response);
  122. }
  123. })
  124. .catch((error) => {
  125. console.log("catch===>response", response);
  126. reject(error);
  127. });
  128. });
  129. },
  130. },
  131. };
  132. </script>
  133. <style scoped>
  134. .main {
  135. /* margin-top: 100rpx; */
  136. margin-top: 80px;
  137. display: flex;
  138. flex-direction: column;
  139. margin-top: 80px; /* 内容区域顶部留出导航栏的高度 */
  140. }
  141. .itemback {
  142. padding: 20rpx;
  143. background-color: #ffffff;
  144. margin-bottom: 5rpx;
  145. }
  146. .text-style {
  147. color: #3787fe;
  148. font-weight: bold;
  149. }
  150. .text-style1 {
  151. color: #000000;
  152. font-size: large;
  153. font-weight: bold;
  154. }
  155. .datacard {
  156. width: 48%;
  157. margin: 1%;
  158. float: left;
  159. height: 120rpx;
  160. border-radius: 10px;
  161. }
  162. .time {
  163. background: url(/static/filecenter/time.png),
  164. linear-gradient(
  165. to right,
  166. rgba(55, 135, 254, 0.08),
  167. rgba(4, 184, 255, 0.08),
  168. rgba(60, 161, 237, 0.08)
  169. );
  170. background-size: auto 100%;
  171. background-position: right;
  172. background-repeat: no-repeat;
  173. }
  174. .laiyuan {
  175. background: url(/static/filecenter/laiyuan.png),
  176. linear-gradient(
  177. to right,
  178. rgba(55, 135, 254, 0.08),
  179. rgba(4, 184, 255, 0.08),
  180. rgba(60, 161, 237, 0.08)
  181. );
  182. background-size: auto 100%;
  183. background-position: right;
  184. background-repeat: no-repeat;
  185. }
  186. .user {
  187. background: url(/static/filecenter/user.png),
  188. linear-gradient(
  189. to right,
  190. rgba(55, 135, 254, 0.08),
  191. rgba(4, 184, 255, 0.08),
  192. rgba(60, 161, 237, 0.08)
  193. );
  194. background-size: auto 100%;
  195. background-position: right;
  196. background-repeat: no-repeat;
  197. }
  198. .zhuangtai {
  199. background: url(/static/filecenter/zhuangtai.png),
  200. linear-gradient(
  201. to right,
  202. rgba(55, 135, 254, 0.08),
  203. rgba(4, 184, 255, 0.08),
  204. rgba(60, 161, 237, 0.08)
  205. );
  206. background-size: auto 100%;
  207. background-position: right;
  208. background-repeat: no-repeat;
  209. }
  210. .datacard1 {
  211. width: 100%;
  212. margin: 1%;
  213. float: left;
  214. height: 100rpx;
  215. text-align: center;
  216. border-radius: 10px;
  217. background: linear-gradient(
  218. to right,
  219. rgba(55, 135, 254, 0.08),
  220. rgba(4, 184, 255, 0.08),
  221. rgba(60, 161, 237, 0.08)
  222. );
  223. }
  224. </style>