<template>
|
<view class="uni-project-event-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">
|
<view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickResponsible"><text
|
class="uni-collapse-item-ico fs-my_create"></text>我负责的</view>
|
<view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickCreate"><text
|
class="uni-collapse-item-ico fs-my_create"></text>我创建的</view>
|
<view class="uni-collapse-item-ban" v-if="apptype != 'HangChaTesting'" @click="clickRelational"><text
|
class="uni-collapse-item-ico fs-link"></text>我相关的</view>
|
<uni-collapse-item titleBorder="none" v-if="apptype != 'HangChaTesting'" :open="true">
|
<template v-slot:title>
|
<view class="uni-collapse-item-ban"><text
|
class="uni-collapse-item-ico fs-myproject"></text>项目列表</view>
|
</template>
|
<view class="uni-collapse-content">
|
<view class="uni-collapse-content-item" v-for="(item,index) in myPrjList" :key="index"
|
@click="clickMyProject(item)">
|
<text class="uni-collapse-item-ico fs-project"></text>{{item.Name}}<!-- {{item.Name}} -->
|
</view>
|
</view>
|
</uni-collapse-item>
|
</uni-collapse>
|
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
name: "pageProjectEventMenu",
|
emits: ['selFactor'],
|
props: {
|
myPrjList: {
|
type: Array,
|
default () {
|
return []
|
}
|
},
|
},
|
data() {
|
return {
|
apptype: getApp().globalData.apptype,
|
}
|
},
|
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
|
},
|
clickResponsible() {
|
this.$emit('selFactor', {
|
listType: '我负责的',
|
status: ["未关闭"],
|
prjId: '',
|
prjName: '',
|
})
|
},
|
clickCreate() {
|
this.$emit('selFactor', {
|
listType: '我创建的',
|
status: [],
|
prjId: '',
|
prjName: '',
|
})
|
},
|
|
clickRelational() {
|
this.$emit('selFactor', {
|
listType: '我相关的',
|
status: ["未关闭"],
|
prjId: '',
|
prjName: '',
|
})
|
},
|
clickMyProject(item) {
|
this.$emit('selFactor', {
|
listType: '我的项目',
|
status: [],
|
prjId: item.ID,
|
prjName: item.Name,
|
})
|
},
|
|
},
|
|
}
|
</script>
|
|
<style lang="scss">
|
.uni-project-event-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;
|
}
|
}
|
</style>
|