朱思禹提交:添加待办列表页单个组件类

init
Administrator 4 years ago
parent db439faa95
commit 2c09b862ab

@ -0,0 +1,150 @@
<template>
<div class="business-item-container-style">
<div class="create-time-style">{{timeHandle(business.create_time)}}</div>
<div class="system-title-style">
<div class="icon-container-style">
<my-icon :type="business.icon" class="icon-style"></my-icon>
</div>
<div class="system-name-style">{{business.system_name}}</div>
</div>
<div class="item-content-style clearfix" title="点击查看详情">
<div class="item-title-style">
您有一条新的<span style="color: rgba(0,0,0,1);font-weight: bold">{{business.biz_name}}</span>{{getItemTitleAfter()}}
</div>
<div v-for="content,index in business.showData" :key="business.id + '-' + index" class="content-style"
:style="{width:content.one_line === true?'100%':'50%'}">
<div v-if="content.title && content.title !== ''" class="content-title-style">
{{content.title}}
</div>
<div class="content-text-style" :style="{width:content.title && content.title !== ''?'calc(100% - 80px)':'100%'}">
{{content.text}}
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "BusinessItem",
props:{
typeData:{//
type:Object,
require:true,
},
businessData:{//
type:Object,
require:true,
}
},
data:function () {
return{
type:this.typeData,
business:this.businessData
}
},
methods:{
timeHandle:function (create_time) {
let str = create_time.split(" ");
let date = str[0].split("-");
date = date[1] + "月" + date[2] + "日";
let time = str[1].substr(0,5);
return date + " " + time;
},
getItemTitleAfter:function () {
let str = '';
let typeId = this.type.id;
if (typeId === 'approval'){
str = '尚未审批';
}else if(typeId === 'notice' || typeId === 'announcement' || typeId === 'sendToMe'){
str = '尚未查阅';
}else if (typeId === 'document' || typeId === 'affair'){
str = '尚未处理';
}else if(typeId === 'meeting'){
str = '请准时参加';
}else{
str = '请即时查看';
}
return str;
}
},
watch:{
typeData:function (newData) {
this.type = newData;
},
businessData:function (newData) {
this.business = newData;
}
}
}
</script>
<style scoped lang="scss">
.business-item-container-style{
font-size: 14px;
color: #999999;
width: 100%;
padding: 20px 10px 0 10px;
.create-time-style{
width: 100%;
text-align: center;
}
.system-title-style{
width: 100%;
display: flex;
height: 30px;
align-content: center;
align-items: center;
.icon-container-style{
display: flex;
align-items: center;
align-content: center;
justify-content: center;
justify-items: center;
width: 30px;
height: 30px;
border-radius: 15px;
background:linear-gradient(to bottom right,var(--todoTwoBtn),var(--todoOneBtn));
background:-moz-linear-gradient(to bottom right,var(--todoTwoBtn),var(--todoOneBtn));
background:-webkit-linear-gradient(bottom right,var(--todoTwoBtn),var(--todoOneBtn));
.icon-style{
font-size: 16px;
color: white;
}
}
.system-name-style{
margin-left: 10px;
color:rgba(0,0,0,0.65);
}
}
.item-content-style{
width: calc(100% - 40px);
padding: 10px;
background-color: white;
border:1px solid #e5e5e5;
border-radius: 5px;
min-height: 3rem;
margin-left: 40px;
cursor: pointer;
.item-title-style{
width: 100%;
height: 20px;
line-height: 20px;
color: rgba(0,0,0,0.65);
margin-bottom: 10px;
}
.content-style{
/*height: 20px;*/
float: left;
display: flex;
.content-title-style{
width: 80px;
text-align: right;
height: 20px;
}
}
}
}
</style>
Loading…
Cancel
Save