|
@@ -159,7 +159,7 @@
|
|
|
<!-- </el-button>-->
|
|
|
</template>
|
|
|
<template #tag="{ row, column }">
|
|
|
- <el-tag :style="`color:#fff;background-color: ${getColor(row[column.property])}`">
|
|
|
+ <el-tag :style="`color:#fff;background-color: ${getColor(row[column.property], row, column)}`">
|
|
|
{{ row[column.property] }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
@@ -564,7 +564,8 @@
|
|
|
:cardInfo="columnData.cardTypeStyle"
|
|
|
:btnList="columnData.columnBtnsList"
|
|
|
:cardData="cardData"
|
|
|
- :config="config" :columnDict="columnDict"
|
|
|
+ :config="config"
|
|
|
+ :columnDict="columnDict"
|
|
|
></CardTemplate>
|
|
|
<div class="pager" style="position: absolute; bottom: 10px; right: 20px; z-index: 99; width: 100%">
|
|
|
<vxe-pager
|
|
@@ -813,6 +814,7 @@ import Scene from '@/components/ColumnDesign/scene.vue'
|
|
|
import authGroupSelector from '@/views/dataset/auth-group-selector.vue'
|
|
|
import { noSearchList, useDateList, useInputList } from '@/components/Generator/generator/comConfig'
|
|
|
import { getDrawingList } from '@/components/Generator/utils/db'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
const columnList = {}
|
|
|
export default {
|
|
|
name: 'dynamicModel',
|
|
@@ -2476,6 +2478,7 @@ export default {
|
|
|
if (this.config?.visualdevCustomise?.fromJson) {
|
|
|
customWidth = JSON.parse(customWidth)
|
|
|
}
|
|
|
+ this.colorScale = {}
|
|
|
const columnHeader = async (data, dbLinkId) => {
|
|
|
let comName = {}
|
|
|
let compoentConfig = {}
|
|
@@ -2547,6 +2550,8 @@ export default {
|
|
|
data.slots.default = 'relationDefault'
|
|
|
}
|
|
|
if (find?.colorScale?.isColorShow) {
|
|
|
+ console.log(data)
|
|
|
+ this.colorScale[data.field] = find.colorScale
|
|
|
data.slots.default = 'tag'
|
|
|
}
|
|
|
data.editRender = {
|
|
@@ -3473,30 +3478,32 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
imgOpenClick(url) {
|
|
|
+ console.log(url)
|
|
|
let ImgUrl = ''
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
ImgUrl = this.define.comUrl
|
|
|
} else {
|
|
|
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: document.location.origin
|
|
|
- // }
|
|
|
- // let objJson = Base64.encode(JSON.stringify(obj))
|
|
|
- // let upUrl = Base64.encode(document.location.origin + '/' + url)
|
|
|
- // let str = `/fileview/onlinePreview?url=${upUrl}&json=${objJson}`
|
|
|
- // window.open(str, '_blank')
|
|
|
+ // 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')
|
|
|
},
|
|
|
formFlowSubmit(row) {
|
|
|
let jsonData = this.getFlowJsonData(row)
|
|
@@ -3933,8 +3940,7 @@ export default {
|
|
|
.then(() => {
|
|
|
sceneDelete({
|
|
|
id: item.id
|
|
|
- }).then((res) => {
|
|
|
- })
|
|
|
+ }).then((res) => {})
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!'
|
|
@@ -3944,10 +3950,16 @@ export default {
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
// 随机颜色
|
|
|
- getColor(field) {
|
|
|
+ getColor(field, row, column) {
|
|
|
if (columnList[field]) {
|
|
|
return columnList[field]
|
|
|
} else {
|
|
|
+ if (this.colorScale[column.field]) {
|
|
|
+ const text = this.colorScale[column.field].colorArr.map((v) => v.text)
|
|
|
+ if (text.includes(field)) {
|
|
|
+ return this.colorScale[column.field].colorArr.find((v) => v.text === field).color
|
|
|
+ }
|
|
|
+ }
|
|
|
const r = Math.floor(Math.random() * 128) + 64 // 64至191之间,偏向于深红色
|
|
|
const g = Math.floor(Math.random() * 128) + 64 // 64至191之间,偏向于深绿色
|
|
|
const b = Math.floor(Math.random() * 128) + 64 // 64至191之间,偏向于深蓝色
|