拼图汇报
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="MeetingMminutes">
|
<div class="MeetingMminutes" ref="report">
|
||||||
<table class="table" border="1" cellspacing="0" cellpadding="16px" bordercolor="#2774CE" @click="choose" ref="home">
|
<table @click="linkTo" class="table" border="1" cellspacing="0" cellpadding="16px" bordercolor="#2774CE">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="4" class="title">会议纪要</th>
|
<th colspan="4" class="title">会议纪要</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -33,13 +33,13 @@
|
|||||||
<td colspan="3">2022-01-21 周五</td>
|
<td colspan="3">2022-01-21 周五</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom">
|
<div class="imgs">
|
||||||
<div class="add">
|
<image :src="item" v-for="(item, index) in imgs" mode="widthFix" :key="index" />
|
||||||
<div class="add-btn" @click="choose">
|
|
||||||
<span>添加图片</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="add-btn">
|
<div class="bottom" data-html2canvas-ignore ref="add">
|
||||||
<span>添加文字</span>
|
<div class="add">
|
||||||
|
<div class="add-btn" @click="addPhoto">
|
||||||
|
<span>添加图片</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,30 +53,95 @@
|
|||||||
|
|
||||||
label: '会议纪要',
|
label: '会议纪要',
|
||||||
|
|
||||||
|
props: ['config'],
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
title: '巡查日志',
|
||||||
|
subTitle: '',
|
||||||
|
reporter: '',
|
||||||
|
date: '',
|
||||||
|
remark: '',
|
||||||
|
address: '',
|
||||||
|
weather: '',
|
||||||
|
isShowTitle: true,
|
||||||
|
isShowWeather: true,
|
||||||
|
isShowDate: true,
|
||||||
|
isShowReporter: false,
|
||||||
|
isShowAddress: false,
|
||||||
|
isShowRemark: false,
|
||||||
|
imgs: [],
|
||||||
|
configList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad () {
|
watch: {
|
||||||
|
configList: {
|
||||||
|
handler: function (v) {
|
||||||
|
if (v.length) {
|
||||||
|
const title = v.filter(v => v.type === '17')[0]
|
||||||
|
const reporter = v.filter(v => v.type === '24')[0]
|
||||||
|
const date = v.filter(v => v.type === '1')[0]
|
||||||
|
const address = v.filter(v => v.type === '23')[0]
|
||||||
|
const remark = v.filter(v => v.type === '25')[0]
|
||||||
|
const weather = v.filter(v => v.type === '2')[0]
|
||||||
|
this.isShowTitle = title.status === '1'
|
||||||
|
this.isShowRemark = remark.status === '1'
|
||||||
|
this.isShowReporter = reporter.status === '1'
|
||||||
|
this.isShowWeather = weather.status === '1'
|
||||||
|
this.isShowDate = date.status === '1'
|
||||||
|
this.isShowAddress = address.status === '1'
|
||||||
|
this.title = title.defaultValue || '巡查日志'
|
||||||
|
this.weather = weather.defaultValue || '晴转多云'
|
||||||
|
this.address = date.defaultValue || '武汉天地'
|
||||||
|
this.reporter = reporter.defaultValue || ''
|
||||||
|
this.date = date.defaultValue || this.$dayjs(new Date).format('YYYY-MM-DD')
|
||||||
|
this.remark = remark.defaultValue || ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted () {
|
||||||
|
this.configList = JSON.parse(JSON.stringify(this.config))
|
||||||
|
|
||||||
|
uni.$on('change', e => {
|
||||||
|
this.configList = e
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
choose () {
|
screenshot () {
|
||||||
html2canvas(this.$refs.home, {
|
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||||
|
|
||||||
|
return html2canvas(this.$refs.report, {
|
||||||
allowTaint: true,
|
allowTaint: true,
|
||||||
useCORS: true,
|
useCORS: true,
|
||||||
backgroundColor: '#fff',
|
height
|
||||||
width: this.$refs.home.offsetWidth,
|
})
|
||||||
scale: 2,
|
},
|
||||||
}).then((canvas) => {
|
|
||||||
let dataURL = canvas.toDataURL("image/png");
|
addPhoto () {
|
||||||
this.src = dataURL
|
uni.chooseImage({
|
||||||
console.log(dataURL)
|
count: 1,
|
||||||
}).catch(e => {
|
sizeType: ['compressed'],
|
||||||
console.log(e)
|
success: res => {
|
||||||
|
let formData = new FormData()
|
||||||
|
formData.append('file', res.tempFiles[0])
|
||||||
|
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.imgs.push(res.data.url)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
linkTo () {
|
||||||
|
uni.setStorageSync('waterConfig', this.configList)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: './WatermarkConfig'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,6 +153,14 @@
|
|||||||
padding: 48px 32px 0;
|
padding: 48px 32px 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
|
.imgs {
|
||||||
|
margin-top: 2px;
|
||||||
|
image {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user