|
@@ -134,12 +134,17 @@
|
|
</template>
|
|
</template>
|
|
<template #default_file="{ row, column }">
|
|
<template #default_file="{ row, column }">
|
|
<template v-if="fileList[column.property] && row[column.property]">
|
|
<template v-if="fileList[column.property] && row[column.property]">
|
|
- <el-button v-for="(item, uindex) in row[column.property].split(';').map((o) => fileList[column.property][o] || null)" type="text" size="mini" @click="imgOpenClick(item.filePath)">
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-for="(item, uindex) in row[column.property].split(';').map((o) => fileList[column.property][o] || null)"
|
|
|
|
+ type="text"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="imgOpenClick(item.filePath, column)"
|
|
|
|
+ >
|
|
{{ item?.fileName }}
|
|
{{ item?.fileName }}
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
<template v-else-if="column.params.jnpfKey === 'uploadFz' && row[column.property] && row[column.property] !== 'null' && row[column.property].includes('uploads/')">
|
|
<template v-else-if="column.params.jnpfKey === 'uploadFz' && row[column.property] && row[column.property] !== 'null' && row[column.property].includes('uploads/')">
|
|
- <el-button v-for="(item, uindex) in JSON.parse(row[column.property])" type="text" size="mini" @click="imgOpenClick(item?.url)">{{ item.name }}</el-button>
|
|
|
|
|
|
+ <el-button v-for="(item, uindex) in JSON.parse(row[column.property])" type="text" size="mini" @click="imgOpenClick(item?.url, column)">{{ item.name }}</el-button>
|
|
</template>
|
|
</template>
|
|
<template v-else>
|
|
<template v-else>
|
|
<template v-if="row[column.property]">
|
|
<template v-if="row[column.property]">
|
|
@@ -838,6 +843,7 @@ import authGroupSelector from '@/views/dataset/auth-group-selector.vue'
|
|
import { noSearchList, useDateList, useInputList } from '@/components/Generator/generator/comConfig'
|
|
import { noSearchList, useDateList, useInputList } from '@/components/Generator/generator/comConfig'
|
|
import { getDrawingList } from '@/components/Generator/utils/db'
|
|
import { getDrawingList } from '@/components/Generator/utils/db'
|
|
import { getToken } from '@/utils/auth'
|
|
import { getToken } from '@/utils/auth'
|
|
|
|
+import { Base64 } from 'js-base64'
|
|
const columnList = {}
|
|
const columnList = {}
|
|
export default {
|
|
export default {
|
|
name: 'dynamicModel',
|
|
name: 'dynamicModel',
|
|
@@ -1538,7 +1544,7 @@ export default {
|
|
obj.values = [node.data[data.treeSearch || data.treePropsLabel]]
|
|
obj.values = [node.data[data.treeSearch || data.treePropsLabel]]
|
|
}
|
|
}
|
|
arr.push(obj)
|
|
arr.push(obj)
|
|
- } else if (i.params?.propId === data.treeRelation) {
|
|
|
|
|
|
+ } else if (i.propId === data.treeRelation) {
|
|
obj.cubeColumnId = data.treeRelation
|
|
obj.cubeColumnId = data.treeRelation
|
|
obj.function = data.treeSearchType || 'like'
|
|
obj.function = data.treeSearchType || 'like'
|
|
if (data.treeDataSource === 'dictionary') {
|
|
if (data.treeDataSource === 'dictionary') {
|
|
@@ -3509,33 +3515,48 @@ export default {
|
|
loading.close()
|
|
loading.close()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- imgOpenClick(url) {
|
|
|
|
- console.log(url)
|
|
|
|
|
|
+ imgOpenClick(url, column) {
|
|
|
|
+ const isWatermark = column.params?.compoentConfig?.watermark
|
|
let ImgUrl = ''
|
|
let ImgUrl = ''
|
|
if (process.env.NODE_ENV === 'development') {
|
|
if (process.env.NODE_ENV === 'development') {
|
|
ImgUrl = this.define.comUrl
|
|
ImgUrl = this.define.comUrl
|
|
} else {
|
|
} else {
|
|
ImgUrl = document.location.origin
|
|
ImgUrl = document.location.origin
|
|
}
|
|
}
|
|
- window.open(ImgUrl + '/' + url)
|
|
|
|
- // let Base64 = require('js-base64').Base64
|
|
|
|
- // // 获取当前时间的时间戳
|
|
|
|
- // let currentTimestamp = Date.now()
|
|
|
|
- // // 创建一个新的Date对象,并设置为当前时间加上一小时
|
|
|
|
- // let oneHourLater = new Date(currentTimestamp)
|
|
|
|
- // oneHourLater.setHours(oneHourLater.getHours() + 1)
|
|
|
|
- // // 获取一小时后的时间戳
|
|
|
|
- // let oneHourTimestamp = oneHourLater.getTime()
|
|
|
|
- // let obj = {
|
|
|
|
- // token: 'bearer ' + getToken(),
|
|
|
|
- // time: oneHourTimestamp,
|
|
|
|
- // env: ImgUrl
|
|
|
|
- // }
|
|
|
|
- // console.log(obj)
|
|
|
|
- // let objJson = Base64.encode(JSON.stringify(obj))
|
|
|
|
- // let upUrl = Base64.encode(ImgUrl + '/' + url)
|
|
|
|
- // let str = `${ImgUrl}/fileview/onlinePreview?url=${upUrl}&json=${objJson}`
|
|
|
|
- // window.open(str, '_blank')
|
|
|
|
|
|
+ //
|
|
|
|
+ console.log(isWatermark)
|
|
|
|
+ if (isWatermark) {
|
|
|
|
+ let Base64 = require('js-base64').Base64
|
|
|
|
+ // 获取当前时间的时间戳
|
|
|
|
+ let currentTimestamp = Date.now()
|
|
|
|
+ // 创建一个新的Date对象,并设置为当前时间加上一小时
|
|
|
|
+ let oneHourLater = new Date(currentTimestamp)
|
|
|
|
+ oneHourLater.setHours(oneHourLater.getHours() + 1)
|
|
|
|
+ // 获取一小时后的时间戳
|
|
|
|
+ let oneHourTimestamp = oneHourLater.getTime()
|
|
|
|
+
|
|
|
|
+ let watermarkText = column.params?.compoentConfig?.watermarkText
|
|
|
|
+ let userInfoObj = JSON.parse(localStorage.getItem('lowcodeUserInfo'))
|
|
|
|
+ const repeceList = {
|
|
|
|
+ $用户名: userInfoObj.name
|
|
|
|
+ }
|
|
|
|
+ for (const repeceListKey in repeceList) {
|
|
|
|
+ // 替换变量
|
|
|
|
+ watermarkText = watermarkText.replace(repeceListKey, repeceList[repeceListKey])
|
|
|
|
+ }
|
|
|
|
+ let obj = {
|
|
|
|
+ token: 'bearer ' + getToken(),
|
|
|
|
+ time: oneHourTimestamp,
|
|
|
|
+ env: ImgUrl,
|
|
|
|
+ watermark: watermarkText
|
|
|
|
+ }
|
|
|
|
+ let objJson = Base64.encode(JSON.stringify(obj))
|
|
|
|
+ let upUrl = Base64.encode(ImgUrl + '/' + url)
|
|
|
|
+ let str = `${ImgUrl}/fileview/onlinePreview?url=${upUrl}&json=${objJson}`
|
|
|
|
+ window.open(str, '_blank')
|
|
|
|
+ } else {
|
|
|
|
+ window.open(ImgUrl + '/' + url)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
formFlowSubmit(row) {
|
|
formFlowSubmit(row) {
|
|
let jsonData = this.getFlowJsonData(row)
|
|
let jsonData = this.getFlowJsonData(row)
|