<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>
|