This commit is contained in:
张良(004796)
2024-01-29 19:04:53 +08:00
parent 5a0e1ffd58
commit 1fb2d171c2
13 changed files with 774 additions and 304 deletions

View File

@@ -26,6 +26,7 @@
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
的文件
<span style="color: red"><br/>{{customTip}}</span>
</div>
<el-dialog
@@ -68,6 +69,10 @@ export default {
isShowTip: {
type: Boolean,
default: true
},
customTip:{
type: String,
default: ''
}
},
data() {

View File

@@ -0,0 +1,224 @@
<template>
<div class="preview">
<div class="title">{{ name }}</div>
<div class="content">
<div class="item" v-if="data.type === 0">
<div class="msg" style="width: 100%">
<div class="word">
{{data.onlyText}}
</div>
</div>
</div>
<div class="item" v-if="data.type === 1">
<div class="msg" style="width: 100%">
<div class="word-title" v-if="data.title">
{{ data.title }}
</div>
<div class="word-time">
2024-01-29 10:10:11
</div>
<div class="word" v-if="data.textText1">
{{ data.textText1 }}
</div>
<div class="word" v-if="textContext">
<div v-for="val in textContext">
{{val.n}} : {{val.v}}
</div>
</div>
<div class="word" v-if="data.textText2">
{{ data.textText2 }}
</div>
</div>
</div>
<div class="item" v-if="data.type === 2">
<div class="msg" style="width: 100%">
<div class="miniprogram">
<div style="position: relative;">
<img class="mini-img" :src="imageFunc(data.oneImageImage)" @click="goTo(data.oneImageLinkType,data.oneImageLinkUrl)"/>
<span style="position: absolute; bottom: 0; left: 0;">添加文字...添加文字...添加文字...</span>
</div>
<div class="word-title" v-if="data.title">
{{ data.title }}
</div>
<div class="word" v-if="data.oneImageText && data.oneImageTitleType === 0">
{{ data.oneImageText }}
</div>
</div>
</div>
</div>
<div class="item" v-if="data.type === 3">
<div class="msg" style="width: 100%">
<div class="miniprogram" >
<div class="mini-img" :style="{'background-image': 'https://nono-1257812345.cos.ap-shanghai.myqcloud.com/images/avatar/woman.png'}">
</div>
<div>
<div>12231231</div>
<img class="mini-img" :src="imageFunc(data.oneImageImage)" @click="goTo(data.oneImageLinkType,data.oneImageLinkUrl)"/>
</div>
<div>
<div>12231231</div>
<img class="mini-img" :src="imageFunc(data.oneImageImage)" @click="goTo(data.oneImageLinkType,data.oneImageLinkUrl)"/>
</div>
</div>
</div>
</div>
<div class="item" v-if="data.type === 4">
<div class="msg" style="width: 100%">
<div class="miniprogram">
<img class="mini-img" :src="imageFunc(data.onlyImage)"/>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PreviewClient',
props: {
name: {
type: String,
default: '系统通知'
},
data: {
type: Object,
default: () => ({
})
},
textContext: {
type: Array,
default: []
},
imageContext:{
type: Array,
default: []
}
},
methods:{
imageFunc(image){
if(image){
return process.env.VUE_APP_COS_BASE_URL + image;
}
return image;
},
goTo(linkType,linkUrl){
if(linkType === 1 && linkUrl){
window.open(linkUrl)
}
}
}
}
</script>
<style lang="scss" scoped>
.preview {
margin: 0 auto;
position: relative;
width: 300px;
height: 500px;
background: url(../../assets/drainageCode/preview-bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
.title {
position: absolute;
top: 37px;
left: 50%;
transform: translateX(-50%);
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.content {
position: absolute;
height: 405px;
width: 280px;
overflow-y: auto;
top: 70px;
left: 50%;
transform: translateX(-50%);
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding: 15px;
.item {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
display: flex;
margin-top: 20px;
&:first-child {
margin-top: 0;
}
.avatar222 {
// align-self: center;
margin-right: 5px;
}
.msg {
position: relative;
min-height: 26px;
background: #ffffff;
box-shadow: 0px 2px 6px 0px rgba(60, 136, 240, 0.1);
border: 1px solid #e1edfc;
display: inline-block;
border-radius: 4px;
box-sizing: border-box;
word-break: break-all;
margin-left: 5px;
&:before {
content: " ";
display: block;
position: absolute;
left: -5px;
box-shadow: 0px 2px 6px 0px rgba(60, 136, 240, 0.1);
border-width: 5px;
border-left: 0;
width: 0;
border-style: solid;
border-color: transparent;
border-right-color: #fff;
top: 8px;
z-index: 888;
}
.word-title {
font-weight: bold;
padding: 4px 12px;
}
.word-time{
color: #99a9bf;
padding: 0px 12px;
}
.word {
padding: 5px 12px;
}
.image {
padding: 12px;
img {
width: 94px;
height: 90px;
}
}
.miniprogram {
padding: 12px;
.mini-img {
margin: 10px 0;
width: 100%;
height: 120px;
}
}
}
}
}
}
</style>