cuiqian2004
8 天以前 f57571f987f3d25730123f488fccdfa3158ec5b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<template>
    <view class="uni-task-menu">
        <view class="uni-panel-menu-title">
            <view class="uni-panel-image">
                <image class="user-image" :src="userPhoto" mode="widthFix" @error="imageUserError"> </image>
            </view>
            <view class="uni-name-info">{{userName}}</view>
        </view>
        <view class="uni-panel-menu-content">
            <uni-collapse ref="collapse">
                <!-- #ifdef MP-WEIXIN -->
                <!-- <view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickTaskKanban"><text
                        class="uni-collapse-item-ico fs-kanban"></text>看板</view> -->
                <!-- #endif -->
                <uni-collapse-item titleBorder="none" :open="true">
                    <template v-slot:title>
                        <view class="uni-collapse-item-ban"><text
                                class="uni-collapse-item-ico fs-openfolder"></text>我的任务</view>
                    </template>
                    <view class="uni-collapse-content">
                        <view class="uni-collapse-content-item" v-for="(item,index) in myTaskGroup" :key="index"
                            @click="clickMyTask(item)">
                            <text class="uni-collapse-item-ico" :class="item.ico"
                                :style="{'color':item.icoColor}"></text><text class="text">{{item.text}}</text>
                        </view>
                    </view>
                </uni-collapse-item>
                <view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickCreateTask"><text
                        class="uni-collapse-item-ico fs-my_create"></text>我创建的任务</view>
                <view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickAuditTask"><text
                        class="uni-collapse-item-ico fs-Audit"></text><text class="uni-task-group-title">需要我审核的任务</text>
                    <text class="uni-task-item-tipnew"
                        v-if="auditTaskCount>0">{{auditTaskCount >99 ?'99+' : auditTaskCount}}</text></view>
                <view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickRelTask"><text
                        class="uni-collapse-item-ico fs-link"></text>我相关的任务</view>
                <uni-collapse-item titleBorder="none" 
                    v-if="apptype != 'HangChaTesting' && branchUsers.length >0">
                    <template v-slot:title>
                        <view class="uni-collapse-item-ban"><text
                                class="uni-collapse-item-ico fs-department"></text>下属的任务</view>
                    </template>
                    <view class="uni-collapse-content">
                        <view class="uni-collapse-content-item" v-for="(item,index) in branchUsers" :key="index"
                            @click="clickBranchTask(item)">
                            <text class="uni-collapse-item-ico fs-my_solid"></text>{{item.name}}<!-- {{item.Name}} -->
                        </view>
                    </view>
                </uni-collapse-item>
            </uni-collapse>
 
        </view>
    </view>
</template>
 
<script>
    export default {
        name: "pageTaskMenuSearch",
        emits: ['selTaskFactor', 'selTaskKanban'],
        props: {
            branchUsers: {
                type: Array,
                default () {
                    return []
                }
            },
            auditTaskCount: {
                type: Number,
                default () {
                    return 0
                }
            },
        },
        data() {
            return {
                apptype:getApp().globalData.apptype,
                myTaskGroup: [{
                    ico: 'fs-project2',
                    text: '全部',
                    value: '',
                    icoColor: '#ff0000'
                }, {
                    ico: 'fs-PRJ_edit',
                    text: '待完成',
                    value: '待完成',
                    icoColor: '#00aaff'
                }, {
                    ico: 'fs-time',
                    text: '已超期',
                    value: '已超期',
                    icoColor: '#ff55ff'
                }],
            }
        },
        computed: {
            userName() {
                const app = getApp()
                return app.globalData.userdata.user_name
            },
            userPhoto() {
                const app = getApp()
                return `${app.globalData.apiurl.org}/userphoto?login=${app.globalData.userdata.user_login}`
            },
        },
        methods: {
            setData(obj) {
                let that = this;
                let keys = [];
                let val, data;
                Object.keys(obj).forEach(function(key) {
                    keys = key.split(".");
                    val = obj[key];
                    data = that.$data;
                    keys.forEach(function(key2, index) {
                        if (index + 1 == keys.length) {
                            that.$set(data, key2, val);
                        } else {
                            if (!data[key2]) {
                                that.$set(data, key2, {});
                            }
                        }
                        data = data[key2];
                    });
                });
            },
            imageUserError() {
                this.userPhoto = getApp().globalData.defaultuserphoto
            },
            clickMyTask(item) {
                this.$emit('selTaskFactor', {
                    status: [item.text],
                    type: "我的任务",
                    userId: '',
                    userName: '',
                })
            },
            clickBranchTask(item) {
                this.$emit('selTaskFactor', {
                    userId: item.login,
                    userName: item.name,
                    type: '下属任务',
                    status: ['待完成'],
                })
            },
            clickAuditTask() {
                this.$emit('selTaskFactor', {
                    status: [],
                    type: '需要我审核的',
                    userId: '',
                    userName: '',
                })
            },
            clickCreateTask() {
                this.$emit('selTaskFactor', {
                    status: [],
                    type: '我创建的',
                    userId: '',
                    userName: '',
                })
            },
            clickRelTask() {
                this.$emit('selTaskFactor', {
                    status: ['待完成'],
                    type: '我相关的',
                    userId: '',
                    userName: '',
                })
            },
            clickTaskKanban() {
                this.$emit('selTaskKanban', {})
            },
 
        },
 
    }
</script>
 
<style lang="scss">
    .uni-task-menu {
        display: flex;
        flex-direction: column !important;
        background-color: transparent;
        width: 480rpx;
        height: 100%;
        overflow: auto;
 
        .uni-panel-menu-title {
            display: flex;
            flex-direction: row !important;
            background-color: transparent;
            padding: 24px 12px;
            /* height: 90px !important; */
        }
 
        .uni-panel-menu-content {
            flex: 1;
            display: flex;
 
        }
 
        .uni-panel-image {
            height: 80px !important;
            width: 80px;
            padding: 2px;
            text-align: center;
            border-radius: 50%;
        }
 
        .user-image {
            height: 80px !important;
            width: 80px;
            border-radius: 50%;
        }
 
        .uni-name-info {
            flex: 1;
            font-size: 15px;
            line-height: 90px;
            align-items: center;
            margin-left: 12px;
        }
 
        .uni-collapse-content {
            margin: 0 32px;
            display: flex;
            flex-direction: column !important;
 
        }
 
        .uni-collapse-content-item {
            margin: 8px 0px;
            display: flex;
            flex-direction: row !important;
            align-items: center;
        }
 
        .uni-collapse-item-ban {
            display: flex;
            width: 100%;
            height: 48px;
            padding: 0 16px;
            font-size: 14px;
            box-sizing: border-box;
            flex-direction: row;
            align-items: center;
        }
 
        .uni-collapse-item-ico {
            display: flex;
            margin: 4px 16px 4px 4px;
            font-size: 16px;
            color: #e82633;
        }
 
        .uni-task-group-title {
            display: flex;
            flex: 1;
        }
 
        .uni-task-item-tipnew {
            display: flex;
            margin-left: 5px;
            height: 16px;
            padding: 4px 5px;
            background: red;
            border-radius: 12px;
            align-items: center;
            color: #fff;
        }
    }
</style>