|
@@ -3,7 +3,7 @@
|
|
|
<u-navbar title="文件中心" :safeAreaInsetTop="true" leftIcon=""> </u-navbar>
|
|
|
<view class="main">
|
|
|
<u-subsection
|
|
|
- :list="list"
|
|
|
+ :list="sectionList"
|
|
|
mode="subsection"
|
|
|
:current="curNow"
|
|
|
@change="sectionChange"
|
|
@@ -14,7 +14,7 @@
|
|
|
v-for="(item, index) in fileData"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <view class="content flcard" @click="openFile(item.id)" v-if="item.bpmStatus == 1">
|
|
|
+ <div class="content flcard" @tap="openFile(item)">
|
|
|
<view
|
|
|
class="demo-layout bg-purple-light"
|
|
|
style="margin-bottom: 20rpx"
|
|
@@ -53,7 +53,7 @@
|
|
|
>上传时间</view
|
|
|
>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </div>
|
|
|
</u-list-item>
|
|
|
</u-list>
|
|
|
</view>
|
|
@@ -62,28 +62,46 @@
|
|
|
|
|
|
<script>
|
|
|
import api from "@/api/api";
|
|
|
+import { computed } from "uview-ui/libs/mixin/mixin";
|
|
|
export default {
|
|
|
components: {},
|
|
|
name: "filecenter",
|
|
|
watch: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- list: [{ name: "全部" }, { name: "待审批" }, { name: "已审批" }],
|
|
|
+ sectionList: [
|
|
|
+ { name: "全部", code: 0 },
|
|
|
+ { name: "待审批", code: 1 },
|
|
|
+ { name: "已审批", code: 2 },
|
|
|
+ ],
|
|
|
curNow: 0,
|
|
|
fileData: [],
|
|
|
- bpmStatus:1,//1处理中 2 已完成 3 已驳回
|
|
|
+ bpmStatus: 1, //1处理中 2 已完成 3 已驳回
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getFileInfo();
|
|
|
},
|
|
|
+ computed: {},
|
|
|
methods: {
|
|
|
- sectionChange(index) {
|
|
|
- this.curNow = index;
|
|
|
+ sectionChange(newVal) {
|
|
|
+ this.curNow = newVal;
|
|
|
+ if (this.curNow === 0) {
|
|
|
+ // 如果选择了“全部”,返回所有文件
|
|
|
+ this.bpmStatus = "";
|
|
|
+ this.getFileInfo(this.bpmStatus);
|
|
|
+ } else if (this.curNow === 1) {
|
|
|
+ // 否则,根据curNow的值过滤文件
|
|
|
+ this.bpmStatus = 1;
|
|
|
+ this.getFileInfo(this.bpmStatus);
|
|
|
+ } else if (this.curNow === 2) {
|
|
|
+ this.bpmStatus = 2;
|
|
|
+ this.getFileInfo(this.bpmStatus);
|
|
|
+ }
|
|
|
},
|
|
|
- getFileInfo() {
|
|
|
+ getFileInfo(code) {
|
|
|
var params = {
|
|
|
- bpmStatus: "",
|
|
|
+ bpmStatus: code,
|
|
|
column: "createTime",
|
|
|
fileSuffix: "",
|
|
|
likeFileName: "",
|
|
@@ -109,23 +127,9 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- openFile(ID) {
|
|
|
- var params = {
|
|
|
- id: ID,
|
|
|
- };
|
|
|
- new Promise((resolve, reject) => {
|
|
|
- api
|
|
|
- .getFilePreview(params)
|
|
|
- .then((response) => {
|
|
|
- if (response.data.code == 200) {
|
|
|
- } else {
|
|
|
- reject(response);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- console.log("catch===>response", response);
|
|
|
- reject(error);
|
|
|
- });
|
|
|
+ openFile(params) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/filecenter/fileModel?id=${params.id}&type=${params.fileSuffix}`,
|
|
|
});
|
|
|
},
|
|
|
},
|