去掉 console.log 显示

This commit is contained in:
jacky 2024-05-09 18:47:53 +08:00
parent 955a947411
commit 94c9556d5b
14 changed files with 70 additions and 154 deletions

View File

@ -133,7 +133,6 @@ const editFileNameFunc = async (row) => {
inputValue: row.name
}).then(async ({ value }) => {
row.name = value
// console.log(row)
const res = await editFileName(row)
if (res.code === 0) {
ElMessage({

View File

@ -1,10 +1,5 @@
<template>
<vue-office-pdf
:src="pdf"
@rendered="renderedHandler"
@error="errorHandler"
/>
<vue-office-pdf :src="pdf" @rendered="renderedHandler" @error="errorHandler" />
</template>
<script>
export default {
@ -12,13 +7,12 @@ export default {
}
</script>
<script setup>
import {ref, watch} from "vue"
import { ref, watch } from "vue"
//VueOfficeDocx
import VueOfficePdf from "@vue-office/pdf";
//
import '@vue-office/docx/lib/index.css'
console.log("pdf===>")
const props = defineProps({
modelValue: {
type: String,
@ -26,11 +20,9 @@ const props = defineProps({
}
})
const pdf = ref(null)
watch(() => props.modelValue, val => pdf.value = val, {immediate: true})
watch(() => props.modelValue, val => pdf.value = val, { immediate: true })
const renderedHandler = () => {
console.log("pdf 加载成功")
}
const errorHandler = () => {
console.log("pdf 错误")
}
</script>

View File

@ -43,7 +43,6 @@ const fileList = ref(props.modelValue)
const emits = defineEmits(['update:modelValue'])
watch(fileList.value, (val) => {
console.log(val)
emits('update:modelValue', val)
})

View File

@ -160,7 +160,6 @@ const doConfirm = (cropData) => {
var height = img.height
if (width <= desiredWidth && height <= desiredHeight) {
console.log('未超过,直接上传')
//
uploadImage(cropData)
} else {
@ -277,7 +276,6 @@ const handleSelectImg = (e) => {
//
const open = async (data) => {
console.log(Math.min(1500, props.imgWidth + 140))
showDrawer.value = true
vueCropperImg.value = data
}

View File

@ -65,7 +65,6 @@ const beforeUpload = (file) => {
}
const uploadFailure = () => {
console.log('on-failure')
ElMessage({
type: 'error',
message: '上传失败'
@ -74,7 +73,6 @@ const uploadFailure = () => {
}
const uploadSuccess = (res) => {
console.log('on-success')
const { code, data, msg } = res
if (code !== 0) {
ElMessage({ type: 'error', message: msg })

View File

@ -1,113 +1,58 @@
<template>
<div @mouseout="cancelScale" @mouseover="scaleImg" class="vue-cropper" ref="cropper">
<div class="cropper-box">
<div
:style="{
'width': trueWidth + 'px',
'height': trueHeight + 'px',
'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d('+ x / scale + 'px,' + y / scale + 'px,' + '0)'
+ 'rotateZ('+ rotate * 90 +'deg)'
}"
class="cropper-box-canvas"
v-show="!loading"
>
<div :style="{
'width': trueWidth + 'px',
'height': trueHeight + 'px',
'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d(' + x / scale + 'px,' + y / scale + 'px,' + '0)'
+ 'rotateZ(' + rotate * 90 + 'deg)'
}" class="cropper-box-canvas" v-show="!loading">
<img :src="imgs" alt="cropper-img" ref="cropperImg">
</div>
</div>
<div
:class="{'cropper-move': move && !crop, 'cropper-crop': crop, 'cropper-modal': cropping}"
@mousedown="startMove"
@touchstart="startMove"
class="cropper-drag-box"
></div>
<div
:style="{
'width': cropW + 'px',
'height': cropH + 'px',
'transform': 'translate3d('+ cropOffsertX + 'px,' + cropOffsertY + 'px,' + '0)'
}"
class="cropper-crop-box"
v-show="cropping"
>
<div :class="{ 'cropper-move': move && !crop, 'cropper-crop': crop, 'cropper-modal': cropping }"
@mousedown="startMove" @touchstart="startMove" class="cropper-drag-box"></div>
<div :style="{
'width': cropW + 'px',
'height': cropH + 'px',
'transform': 'translate3d(' + cropOffsertX + 'px,' + cropOffsertY + 'px,' + '0)'
}" class="cropper-crop-box" v-show="cropping">
<span class="cropper-view-box">
<img
:src="imgs"
:style="{
'width': trueWidth + 'px',
'height': trueHeight + 'px',
'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d('+ (x - cropOffsertX) / scale + 'px,' + (y - cropOffsertY) / scale + 'px,' + '0)'
+ 'rotateZ('+ rotate * 90 +'deg)'
}"
alt="cropper-img"
>
<img :src="imgs" :style="{
'width': trueWidth + 'px',
'height': trueHeight + 'px',
'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d(' + (x - cropOffsertX) / scale + 'px,' + (y - cropOffsertY) / scale + 'px,' + '0)'
+ 'rotateZ(' + rotate * 90 + 'deg)'
}" alt="cropper-img">
</span>
<span @mousedown="cropMove" @touchstart="cropMove" class="cropper-face cropper-move"></span>
<span
:style="{'top': cropInfo.top}"
class="crop-info"
v-if="info"
>{{ this.cropInfo.width }} × {{ this.cropInfo.height }}</span>
<span :style="{ 'top': cropInfo.top }" class="crop-info" v-if="info">{{ this.cropInfo.width }} × {{
this.cropInfo.height }}</span>
<span v-if="!fixedBox">
<span
@mousedown="changeCropSize($event, false, true, 0, 1)"
@touchstart="changeCropSize($event, false, true, 0, 1)"
class="crop-line line-w"
></span>
<span
@mousedown="changeCropSize($event, true, false, 1, 0)"
@touchstart="changeCropSize($event, true, false, 1, 0)"
class="crop-line line-a"
></span>
<span
@mousedown="changeCropSize($event, false, true, 0, 2)"
@touchstart="changeCropSize($event, false, true, 0, 2)"
class="crop-line line-s"
></span>
<span
@mousedown="changeCropSize($event, true, false, 2, 0)"
@touchstart="changeCropSize($event, true, false, 2, 0)"
class="crop-line line-d"
></span>
<span
@mousedown="changeCropSize($event, true, true, 1, 1)"
@touchstart="changeCropSize($event, true, true, 1, 1)"
class="crop-point point1"
></span>
<span
@mousedown="changeCropSize($event, false, true, 0, 1)"
@touchstart="changeCropSize($event, false, true, 0, 1)"
class="crop-point point2"
></span>
<span
@mousedown="changeCropSize($event, true, true, 2, 1)"
@touchstart="changeCropSize($event, true, true, 2, 1)"
class="crop-point point3"
></span>
<span
@mousedown="changeCropSize($event, true, false, 1, 0)"
@touchstart="changeCropSize($event, true, false, 1, 0)"
class="crop-point point4"
></span>
<span
@mousedown="changeCropSize($event, true, false, 2, 0)"
@touchstart="changeCropSize($event, true, false, 2, 0)"
class="crop-point point5"
></span>
<span
@mousedown="changeCropSize($event, true, true, 1, 2)"
@touchstart="changeCropSize($event, true, true, 1, 2)"
class="crop-point point6"
></span>
<span
@mousedown="changeCropSize($event, false, true, 0, 2)"
@touchstart="changeCropSize($event, false, true, 0, 2)"
class="crop-point point7"
></span>
<span
@mousedown="changeCropSize($event, true, true, 2, 2)"
@touchstart="changeCropSize($event, true, true, 2, 2)"
class="crop-point point8"
></span>
<span @mousedown="changeCropSize($event, false, true, 0, 1)"
@touchstart="changeCropSize($event, false, true, 0, 1)" class="crop-line line-w"></span>
<span @mousedown="changeCropSize($event, true, false, 1, 0)"
@touchstart="changeCropSize($event, true, false, 1, 0)" class="crop-line line-a"></span>
<span @mousedown="changeCropSize($event, false, true, 0, 2)"
@touchstart="changeCropSize($event, false, true, 0, 2)" class="crop-line line-s"></span>
<span @mousedown="changeCropSize($event, true, false, 2, 0)"
@touchstart="changeCropSize($event, true, false, 2, 0)" class="crop-line line-d"></span>
<span @mousedown="changeCropSize($event, true, true, 1, 1)"
@touchstart="changeCropSize($event, true, true, 1, 1)" class="crop-point point1"></span>
<span @mousedown="changeCropSize($event, false, true, 0, 1)"
@touchstart="changeCropSize($event, false, true, 0, 1)" class="crop-point point2"></span>
<span @mousedown="changeCropSize($event, true, true, 2, 1)"
@touchstart="changeCropSize($event, true, true, 2, 1)" class="crop-point point3"></span>
<span @mousedown="changeCropSize($event, true, false, 1, 0)"
@touchstart="changeCropSize($event, true, false, 1, 0)" class="crop-point point4"></span>
<span @mousedown="changeCropSize($event, true, false, 2, 0)"
@touchstart="changeCropSize($event, true, false, 2, 0)" class="crop-point point5"></span>
<span @mousedown="changeCropSize($event, true, true, 1, 2)"
@touchstart="changeCropSize($event, true, true, 1, 2)" class="crop-point point6"></span>
<span @mousedown="changeCropSize($event, false, true, 0, 2)"
@touchstart="changeCropSize($event, false, true, 0, 2)" class="crop-point point7"></span>
<span @mousedown="changeCropSize($event, true, true, 2, 2)"
@touchstart="changeCropSize($event, true, true, 2, 2)" class="crop-point point8"></span>
</span>
</div>
</div>
@ -117,8 +62,8 @@
import exifmin from '../exif-js-min'
export default {
name:'vue-cropper',
data: function() {
name: 'vue-cropper',
data: function () {
return {
//
w: 0,
@ -522,7 +467,7 @@ export default {
if (this.isIE) {
var xhr = new XMLHttpRequest()
xhr.onload = function() {
xhr.onload = function () {
var url = URL.createObjectURL(this.response)
img.src = url
}
@ -614,11 +559,11 @@ export default {
}
var oldL = Math.sqrt(
Math.pow(oldTouch1.x - oldTouch2.x, 2) +
Math.pow(oldTouch1.y - oldTouch2.y, 2)
Math.pow(oldTouch1.y - oldTouch2.y, 2)
)
var newL = Math.sqrt(
Math.pow(newTouch1.x - newTouch2.x, 2) +
Math.pow(newTouch1.y - newTouch2.y, 2)
Math.pow(newTouch1.y - newTouch2.y, 2)
)
var cha = newL - oldL
// ,
@ -787,8 +732,8 @@ export default {
num < 0
? (scale += Math.abs(num))
: scale > Math.abs(num)
? (scale -= Math.abs(num))
: scale
? (scale -= Math.abs(num))
: scale
// 0.1s
let status = num < 0 ? 'add' : 'reduce'
if (status !== this.coeStatus) {
@ -821,8 +766,8 @@ export default {
num > 0
? (scale += Math.abs(num))
: scale > Math.abs(num)
? (scale -= Math.abs(num))
: scale
? (scale -= Math.abs(num))
: scale
if (!this.checkoutImgAxis(this.x, this.y, scale)) {
return false
}
@ -967,12 +912,12 @@ export default {
//
this.cropW =
wrapperW - this.cropChangeX + Math.abs(fw + this.cropOldW) <=
wrapperW - minX
wrapperW - minX
? Math.abs(fw + this.cropOldW)
: this.cropChangeX - minX
this.cropOffsertX =
wrapperW - this.cropChangeX + Math.abs(fw + this.cropOldW) <=
wrapperW - minX
wrapperW - minX
? this.cropChangeX - Math.abs(fw + this.cropOldW)
: minX
}
@ -1007,12 +952,12 @@ export default {
} else {
this.cropH =
wrapperH - this.cropChangeY + Math.abs(fh + this.cropOldH) <=
wrapperH - minY
wrapperH - minY
? Math.abs(fh + this.cropOldH)
: this.cropChangeY - minY
this.cropOffsertY =
wrapperH - this.cropChangeY + Math.abs(fh + this.cropOldH) <=
wrapperH - minY
wrapperH - minY
? this.cropChangeY - Math.abs(fh + this.cropOldH)
: minY
}
@ -1066,19 +1011,16 @@ export default {
//
startCrop() {
this.crop = true
// console.log('')
},
//
stopCrop() {
this.crop = false
// console.log('')
},
//
clearCrop() {
this.cropping = false
this.cropW = 0
this.cropH = 0
// console.log('')
},
//
cropMove(e) {
@ -1276,7 +1218,6 @@ export default {
}
if ((this.enlarge !== 1) & !this.full) {
dpr = Math.abs(Number(this.enlarge))
// console.log(dpr);
}
let width = this.cropW * dpr
let height = this.cropH * dpr
@ -1290,7 +1231,6 @@ export default {
let dy =
(this.y - cropOffsertY + (this.trueHeight * (1 - this.scale)) / 2) *
dpr
// console.log(dx, dy)
//
setCanvasSize(width, height)
ctx.save()
@ -1495,15 +1435,13 @@ export default {
.rotate * 90}deg)`
}
obj.html = `
<div class="show-preview" style="width: ${obj.w}px; height: ${
obj.h
}px,; overflow: hidden">
<div class="show-preview" style="width: ${obj.w}px; height: ${obj.h
}px,; overflow: hidden">
<div style="width: ${w}px; height: ${h}px">
<img src=${obj.url} style="width: ${this.trueWidth}px; height: ${
this.trueHeight
}px; transform:
<img src=${obj.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight
}px; transform:
scale(${scale})translate3d(${transformX}px, ${transformY}px, ${transformZ}px)rotateZ(${this
.rotate * 90}deg)">
.rotate * 90}deg)">
</div>
</div>`
this.$emit('realTime', obj)
@ -1685,7 +1623,6 @@ export default {
},
//
refresh() {
// console.log('refresh')
this.imgs = ''
this.scale = 1
this.crop = false
@ -1753,15 +1690,15 @@ export default {
'onwheel' in document.createElement('div')
? 'wheel'
: document.onmousewheel !== undefined
? 'mousewheel'
: 'DOMMouseScroll'
? 'mousewheel'
: 'DOMMouseScroll'
let that = this
var u = navigator.userAgent
this.isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
// blob
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function(callback, type, quality) {
value: function (callback, type, quality) {
var binStr = atob(this.toDataURL(type, quality).split(',')[1]),
len = binStr.length,
arr = new Uint8Array(len)

View File

@ -9,7 +9,7 @@ const config = {
}
export const viteLogo = (env) => {
console.log('哈哈哈')
// console.log('哈哈哈')
}
export default config

View File

@ -254,7 +254,6 @@ defineOptions({
const imgUploadPath = ref(import.meta.env.VITE_BASE_API)
const beforeUpload = (file) => {
console.log(file)
const isLt500K = file.size / 1024 / 1024 < 0.5 // 500K, @todo
const isImage = isImageMime(file.type)
if (!isImage) {

View File

@ -288,7 +288,6 @@ const emptyForm = () => {
tags: '',
imgs: '',
}
console.log(editForm.value)
}
const getCurrentDatetime = () => {

View File

@ -268,7 +268,6 @@ const handleCurrentChange = (val) => {
//
const handleFormSubmit = async () => {
console.log('handleFormSubmit before validate')
copyTimelineData()
editFormRef.value.validate(async valid => {

View File

@ -98,7 +98,6 @@ const handleSubmit = async () => {
}
const openEdit = async (row) => {
console.log(row)
if (row !== null && row.name && row.name !== '') {
isEdit.value = true
dialogTitle.value = '修改-' + row.name

View File

@ -128,7 +128,6 @@ const closeAddUserDialog = () => {
const dialogFlag = ref('add')
const openEdit = (row) => {
console.log(row)
if (row !== null && row.userName && row.userName !== '') {
dialogFlag.value = 'edit'
userInfo.value = JSON.parse(JSON.stringify(row))

View File

@ -99,7 +99,6 @@ const handleNodeEdit = async (data) => {
elOrganizeEditRef.value.openEdit(data)
}
const handleNodeRemove = (data) => {
console.log(data)
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',

View File

@ -221,7 +221,6 @@ const enterEdit = async () => {
}
const handleClick = (tab, event) => {
console.log(tab, event)
}
const changePhoneFlag = ref(false)