禅道bug修复
This commit is contained in:
parent
eca22ffd9e
commit
050078c082
|
|
@ -40,7 +40,7 @@ export default {
|
||||||
// 文件类型
|
// 文件类型
|
||||||
fileType: {
|
fileType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: ['png', 'jpg', 'jpeg'],
|
default: [],
|
||||||
},
|
},
|
||||||
// 文件大小
|
// 文件大小
|
||||||
fileSize: {
|
fileSize: {
|
||||||
|
|
@ -185,20 +185,24 @@ export default {
|
||||||
handleChange(file, fileList) {
|
handleChange(file, fileList) {
|
||||||
// console.log(file, fileList, 'file, fileList')
|
// console.log(file, fileList, 'file, fileList')
|
||||||
|
|
||||||
// const isFormat = this.fileType.some((e) => file.name.endsWith(e))
|
if (this.fileType.length > 0) {
|
||||||
// if (!isFormat) {
|
const isFormat = this.fileType.some((e) =>
|
||||||
// this.$modal.msgError(
|
file.name.endsWith(e),
|
||||||
// `文件格式不正确, 请上传${this.fileType.join(
|
)
|
||||||
// '、',
|
if (!isFormat) {
|
||||||
// )}格式的文件!`,
|
this.$modal.msgError(
|
||||||
// )
|
`文件格式不正确, 请上传${this.fileType.join(
|
||||||
|
'、',
|
||||||
|
)}格式的文件!`,
|
||||||
|
)
|
||||||
|
|
||||||
// this.$emit(
|
this.$emit(
|
||||||
// 'update:fileList',
|
'update:fileList',
|
||||||
// fileList.filter((item) => item.uid !== file.uid),
|
fileList.filter((item) => item.uid !== file.uid),
|
||||||
// )
|
)
|
||||||
// return false
|
return false
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 判断文件大小
|
// 判断文件大小
|
||||||
const isLt = file.size / 1024 / 1024 < this.fileSize
|
const isLt = file.size / 1024 / 1024 < this.fileSize
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,12 @@
|
||||||
<!-- {{ scope.row.files[0].originalName }} -->
|
<!-- {{ scope.row.files[0].originalName }} -->
|
||||||
|
|
||||||
<span v-if="scope.row.files.length > 0">
|
<span v-if="scope.row.files.length > 0">
|
||||||
{{ scope.row.files[0].originalName }}
|
<a
|
||||||
|
class="link-text"
|
||||||
|
@click="onHandlePreviewFile(scope.row.files)"
|
||||||
|
>
|
||||||
|
{{ scope.row.files[0].originalName }}
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span v-else> / </span>
|
<span v-else> / </span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -117,6 +122,15 @@
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-if="column.prop === 'cover'">
|
||||||
|
<ImagePreview
|
||||||
|
:width="50"
|
||||||
|
:height="50"
|
||||||
|
:isShowMask="true"
|
||||||
|
:src1="scope.row.image"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{ scope.row[column.prop] }}
|
{{ scope.row[column.prop] }}
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -153,7 +167,6 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 新增和编辑表单 -->
|
<!-- 新增和编辑表单 -->
|
||||||
|
|
||||||
<DialogModel
|
<DialogModel
|
||||||
:dialogConfig="dialogConfig"
|
:dialogConfig="dialogConfig"
|
||||||
@closeDialogOuter="handleCloseDialogOuter"
|
@closeDialogOuter="handleCloseDialogOuter"
|
||||||
|
|
@ -166,6 +179,17 @@
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</DialogModel>
|
</DialogModel>
|
||||||
|
|
||||||
|
<DialogModel
|
||||||
|
:dialogConfig="previewDialogConfig"
|
||||||
|
@closeDialogOuter="handleClosePreviewDialogOuter"
|
||||||
|
>
|
||||||
|
<template #outerContent>
|
||||||
|
<div class="preview-docs">
|
||||||
|
<iframe :src="iframeUrl" width="100%" height="100%" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</DialogModel>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -174,6 +198,8 @@ import {
|
||||||
getProMaterialsListAPI,
|
getProMaterialsListAPI,
|
||||||
deleteProductCenterAPI,
|
deleteProductCenterAPI,
|
||||||
} from '@/api/dataManage/pro-materials'
|
} from '@/api/dataManage/pro-materials'
|
||||||
|
import { encryptCBCTime } from '@/utils/aes'
|
||||||
|
import useBase64 from '@/utils/base64Utils.js'
|
||||||
import DialogModel from '@/components/DialogModel'
|
import DialogModel from '@/components/DialogModel'
|
||||||
import AddAndEditForm from './components/addAndEditForm.vue'
|
import AddAndEditForm from './components/addAndEditForm.vue'
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -212,6 +238,10 @@ export default {
|
||||||
prop: 'file',
|
prop: 'file',
|
||||||
label: '附件',
|
label: '附件',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'cover',
|
||||||
|
label: '封面',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'fileType',
|
prop: 'fileType',
|
||||||
label: '附件类型',
|
label: '附件类型',
|
||||||
|
|
@ -237,6 +267,15 @@ export default {
|
||||||
minHeight: '50vh',
|
minHeight: '50vh',
|
||||||
maxHeight: '90vh',
|
maxHeight: '90vh',
|
||||||
},
|
},
|
||||||
|
previewDialogConfig: {
|
||||||
|
outerTitle: '预览',
|
||||||
|
outerVisible: false,
|
||||||
|
// minHeight: '90vh',
|
||||||
|
// maxHeight: '90vh',
|
||||||
|
},
|
||||||
|
iframeUrl: '',
|
||||||
|
lookFile: 'http://192.168.0.14:8012/onlinePreview?url=',
|
||||||
|
filePreviewPath: 'http://218.21.27.6:18013/onlinePreview?url=',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -298,6 +337,10 @@ export default {
|
||||||
handleCloseDialogOuter() {
|
handleCloseDialogOuter() {
|
||||||
this.dialogConfig.outerVisible = false
|
this.dialogConfig.outerVisible = false
|
||||||
},
|
},
|
||||||
|
// 关闭弹框
|
||||||
|
handleClosePreviewDialogOuter() {
|
||||||
|
this.previewDialogConfig.outerVisible = false
|
||||||
|
},
|
||||||
// 关闭弹框 由子组件调用
|
// 关闭弹框 由子组件调用
|
||||||
closeDialog(isSuccess) {
|
closeDialog(isSuccess) {
|
||||||
this.dialogConfig.outerVisible = false
|
this.dialogConfig.outerVisible = false
|
||||||
|
|
@ -305,6 +348,32 @@ export default {
|
||||||
this.onHandleQuery()
|
this.onHandleQuery()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 预览附件
|
||||||
|
onHandlePreviewFile(files) {
|
||||||
|
if (!files || files.length === 0) return
|
||||||
|
const { originalName, filePath } = files[0]
|
||||||
|
let filePreviewPath = ''
|
||||||
|
let time = encryptCBCTime(Math.floor(Date.now()).toString())
|
||||||
|
const encodedPath = filePath.includes('http')
|
||||||
|
? encodeURIComponent(useBase64.encode64(`${filePath}`))
|
||||||
|
: encodeURIComponent(
|
||||||
|
useBase64.encode64(`${this.lookFile}/${filePath}`),
|
||||||
|
)
|
||||||
|
filePreviewPath = `${this.lookFile}${encodedPath}&token=${time}`
|
||||||
|
|
||||||
|
const isEdgeOrOther = /Edg|Chrome|Firefox|Safari/.test(
|
||||||
|
navigator.userAgent,
|
||||||
|
)
|
||||||
|
if (isEdgeOrOther) {
|
||||||
|
const url = new URL(filePreviewPath)
|
||||||
|
url.searchParams.append('preventDownload', 'true')
|
||||||
|
filePreviewPath = url.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.iframeUrl = filePreviewPath
|
||||||
|
this.previewDialogConfig.outerVisible = true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -318,4 +387,8 @@ export default {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.preview-docs {
|
||||||
|
height: 79vh;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@
|
||||||
<ImagePreview
|
<ImagePreview
|
||||||
:width="50"
|
:width="50"
|
||||||
:height="50"
|
:height="50"
|
||||||
|
:isShowMask="true"
|
||||||
:src1="scope.row.linkImage"
|
:src1="scope.row.linkImage"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="header">
|
<div class="header_new">
|
||||||
<div class="header-content">
|
<div class="header-content">
|
||||||
<div class="header-left">
|
<div class="header-left">
|
||||||
<div class="logo-section" @click="handleLogoClick">
|
<div class="logo-section" @click="handleLogoClick">
|
||||||
|
|
@ -122,7 +122,7 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.header {
|
.header_new {
|
||||||
background-image: url('../../../assets/images/productCenter/topbg.png');
|
background-image: url('../../../assets/images/productCenter/topbg.png');
|
||||||
color: white;
|
color: white;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 顶部导航栏 */
|
/* 顶部导航栏 */
|
||||||
.header {
|
// .header {
|
||||||
background-image: url('/img/psp/productCenter/topbg.png');
|
// background-image: url('/img/psp/productCenter/topbg.png');
|
||||||
color: white;
|
// color: white;
|
||||||
padding: 0;
|
// padding: 0;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
// box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
.header-content {
|
.header-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue