去掉 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 inputValue: row.name
}).then(async ({ value }) => { }).then(async ({ value }) => {
row.name = value row.name = value
// console.log(row)
const res = await editFileName(row) const res = await editFileName(row)
if (res.code === 0) { if (res.code === 0) {
ElMessage({ ElMessage({

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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