codeMan 3 년 전
부모
커밋
5f09ceca32

+ 78 - 0
packageA/public/files/index.js

@@ -0,0 +1,78 @@
+const _Http = getApp().globalData.http,
+    MFT = require("../../../utils/matchingFeilType"),
+    checkFile = require("../../../utils/checkFile");
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        ownertable: String,
+        ownerid: String,
+    },
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null,
+            usetype: ""
+        },
+        list: []
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                "ownertable": this.data.ownertable,
+                "ownerid": this.data.ownerid,
+            };
+            if (init) content.pageNumber = 1
+            _Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "queryFileLink",
+                content
+            }).then(res => {
+                console.log("附件列表", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                res.data = MFT.fileList(res.data)
+                this.setData({
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                })
+            })
+        },
+        addFiles({
+            detail
+        }) {
+            _Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "createFileLink",
+                "content": {
+                    "ownertable": this.data.ownertable,
+                    "ownerid": this.data.ownerid,
+                    "usetype": "default",
+                    "attachmentids": detail
+                }
+            }).then(res => {
+                console.log('上传附件', res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.msg,
+                    icon: "none"
+                });
+                this.getList(1, true);
+            })
+        },
+        openFile(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            checkFile.checkFile(item)
+        }
+    }
+})

+ 6 - 0
packageA/public/files/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "My_upload": "/components/My_upload/index"
+    }
+}

+ 50 - 0
packageA/public/files/index.scss

@@ -0,0 +1,50 @@
+@import "../../setclient/modules/address/head.scss";
+
+.my-card {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 690rpx;
+    margin: 0 auto 10rpx;
+    height: 100rpx;
+    padding: 10rpx 30rpx 0;
+    background-color: #fff;
+    box-sizing: border-box;
+    border-radius: 8rpx;
+
+    .flie {
+        display: flex;
+        align-items: center;
+        height: 100%;
+
+        .image {
+            width: 58rpx;
+            height: 58rpx;
+        }
+
+        .details {
+            width: 500rpx;
+            height: 100%;
+            margin-left: 25rpx;
+
+            .name {
+                display: flex;
+                align-items: center;
+                height: 40rpx;
+                font-size: 28rpx;
+                font-family: PingFang SC-Bold, PingFang SC;
+                font-weight: bold;
+                color: #333333;
+                margin-right: 10rpx;
+            }
+
+            .time {
+                font-size: 20rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #999999;
+                margin-top: 14rpx;
+            }
+        }
+    }
+
+}

+ 25 - 0
packageA/public/files/index.wxml

@@ -0,0 +1,25 @@
+<view class="head">
+    <view class="count">
+        总共{{content.total}}个
+    </view>
+    <view class="expand">
+        <My_upload bind:uploadCallback='addFiles'>
+            <navigator url="#" class="but">
+                <van-icon name="plus" />
+            </navigator>
+        </My_upload>
+    </view>
+</view>
+<navigator class="my-card" url="#" wx:for="{{list}}" wx:key="item.attachmentid" data-item="{{item}}" bindtap="openFile">
+    <view class="flie">
+        <image class="image" src="{{item.cover}}" />
+        <view class="details">
+            <view class="name">
+                <view class="line-1">{{item.document}}</view>
+                <van-icon wx:if="{{item.isCollect==1}}" name="star" color='#FADB14' />
+            </view>
+            <view class="time">{{item.createdate}}</view>
+        </view>
+    </view>
+</navigator>
+<My_empty wx:if="{{list.length==0}}" />

+ 49 - 0
packageA/public/record/index.js

@@ -0,0 +1,49 @@
+const _Http = getApp().globalData.http;
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        ownertable: String,
+        ownerid: String,
+    },
+    data: {
+        content: {
+            nocache: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageTotal: 1,
+            total: null
+        },
+        list: []
+    },
+    methods: {
+        getList(id, init = false) {
+            let content = {
+                ...this.data.content,
+                "ownertable": this.data.ownertable,
+                "ownerid": this.data.ownerid,
+            };
+            if (init) {
+                content.pageNumber = 1
+                content.pageTotal = 1
+            }
+            _Http.basic({
+                "id": 20221114125401,
+                content
+            }).then(res => {
+                console.log("操作记录", res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                this.setData({
+                    "content.pageNumber": res.pageNumber + 1,
+                    "content.pageTotal": res.pageTotal,
+                    "content.total": res.total,
+                    list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
+                })
+            })
+        },
+    }
+})

+ 4 - 0
packageA/public/record/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 82 - 0
packageA/public/record/index.scss

@@ -0,0 +1,82 @@
+@import "../../setclient/modules/address/head.scss";
+
+.exp {
+    margin-top: 8rpx;
+    font-size: 24rpx;
+    font-family: PingFang SC-Regular, PingFang SC;
+    color: #333333;
+}
+
+.record-box {
+    width: 100vw;
+    padding: 0 30rpx;
+    box-sizing: border-box;
+    background-color: #ffffff;
+
+    .item {
+        width: 100%;
+        border-bottom: 1px solid #DDDDDD;
+        padding: 20rpx 0;
+
+        .head {
+            display: flex;
+            width: 100%;
+            height: 80rpx;
+
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                border-radius: 50%;
+                overflow: hidden;
+                margin-right: 20rpx;
+
+                .replace {
+                    text-align: center;
+                    line-height: 80rpx;
+                    background-color: #3874F6;
+                    font-size: 28rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #FFFFFF;
+                }
+            }
+
+            .introduce {
+                flex: 1;
+                height: 80rpx;
+
+                .title {
+                    display: flex;
+                    align-items: flex-end;
+                    height: 42rpx;
+                    font-size: 30rpx;
+                    font-weight: 400;
+                    color: #333333;
+                    font-family: PingFang SC-Regular, PingFang SC;
+
+                    text {
+                        display: inline-block;
+                        width: 80%;
+                        margin-left: 20rpx;
+                        font-size: 24rpx;
+                        color: #666666;
+                    }
+                }
+
+                .time {
+                    font-size: 24rpx;
+                    color: #999999;
+                    margin-top: 6rpx;
+                }
+            }
+        }
+
+        .remarks {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            line-height: 28rpx;
+            margin-top: 20rpx;
+            word-break: break-all;
+        }
+    }
+}

+ 31 - 0
packageA/public/record/index.wxml

@@ -0,0 +1,31 @@
+<view class="head">
+    <view class="count">
+        总共{{content.total}}个
+    </view>
+</view>
+<navigator class="record-box" url="#" wx:for="{{list}}" wx:key="item.actionuserid">
+    <view class="item">
+        <view class="head">
+            <view class="portrait">
+                <van-image wx:if="{{item.headpic}}" width="100%" height="100%" src="{{item.headpic}}" use-loading-slot lazy-load>
+                    <van-loading slot="loading" type="spinner" size="20" vertical />
+                </van-image>
+                <view class="replace" wx:else>
+                    {{item.actionby[0]}}
+                </view>
+            </view>
+            <view class="introduce">
+                <view class="title">
+                    {{item.actionby}}<text class="line-1">{{item.action}}</text>
+                </view>
+                <view class="time">
+                    {{item.actiondate}}
+                </view>
+            </view>
+        </view>
+        <view class="remarks" wx:if="{{item.remarks}}">
+            {{item.remarks}}
+        </view>
+    </view>
+</navigator>
+<My_empty wx:if="{{list.length==0}}" />