29793
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
|
||||
save () {
|
||||
this.$loading()
|
||||
this.$refs.reportItem.screenshot().then(canvas => {
|
||||
this.$refs.reportItem.screenshot() && this.$refs.reportItem.screenshot().then(canvas => {
|
||||
let dataURL = canvas.toDataURL('image/png')
|
||||
const file = this.dataURLtoFile(dataURL, 'photo.png')
|
||||
let formData = new FormData()
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
export default {
|
||||
name: 'Daily',
|
||||
label: '日报',
|
||||
@@ -119,6 +120,13 @@
|
||||
|
||||
methods: {
|
||||
screenshot () {
|
||||
for (let i = 0; i < this.configList.length; i ++) {
|
||||
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
|
||||
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||
|
||||
return html2canvas(this.$refs.report, {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import { mapFieldLable } from './../../config'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
export default {
|
||||
name: 'InspectLog',
|
||||
@@ -128,6 +129,13 @@
|
||||
|
||||
methods: {
|
||||
screenshot () {
|
||||
for (let i = 0; i < this.configList.length; i ++) {
|
||||
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
|
||||
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||
|
||||
return html2canvas(this.$refs.report, {
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
export default {
|
||||
name: 'MeetingMminutes',
|
||||
|
||||
@@ -149,6 +150,13 @@
|
||||
|
||||
methods: {
|
||||
screenshot () {
|
||||
for (let i = 0; i < this.configList.length; i ++) {
|
||||
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
|
||||
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||
|
||||
return html2canvas(this.$refs.report, {
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
|
||||
export default {
|
||||
name: 'WorkReport',
|
||||
@@ -119,8 +120,14 @@
|
||||
|
||||
methods: {
|
||||
screenshot () {
|
||||
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||
for (let i = 0; i < this.configList.length; i ++) {
|
||||
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
|
||||
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
|
||||
return html2canvas(this.$refs.report, {
|
||||
allowTaint: true,
|
||||
useCORS: true,
|
||||
|
||||
Reference in New Issue
Block a user