去掉 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 {
@ -18,7 +13,6 @@ import {ref, watch} from "vue"
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,
@ -28,9 +22,7 @@ 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"
class="cropper-drag-box"
></div>
<div
:style="{
'width': cropW + 'px', 'width': cropW + 'px',
'height': cropH + 'px', 'height': cropH + 'px',
'transform': 'translate3d(' + cropOffsertX + 'px,' + cropOffsertY + 'px,' + '0)' 'transform': 'translate3d(' + cropOffsertX + 'px,' + cropOffsertY + 'px,' + '0)'
}" }" class="cropper-crop-box" v-show="cropping">
class="cropper-crop-box"
v-show="cropping"
>
<span class="cropper-view-box"> <span class="cropper-view-box">
<img <img :src="imgs" :style="{
:src="imgs"
:style="{
'width': trueWidth + 'px', 'width': trueWidth + 'px',
'height': trueHeight + 'px', 'height': trueHeight + 'px',
'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d(' + (x - cropOffsertX) / scale + 'px,' + (y - cropOffsertY) / scale + 'px,' + '0)' 'transform': 'scale(' + scale + ',' + scale + ') ' + 'translate3d(' + (x - cropOffsertX) / scale + 'px,' + (y - cropOffsertY) / scale + 'px,' + '0)'
+ 'rotateZ(' + rotate * 90 + 'deg)' + 'rotateZ(' + rotate * 90 + 'deg)'
}" }" alt="cropper-img">
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>
@ -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,12 +1435,10 @@ 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)">
@ -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

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)