Merge pull request #11609 from dataease/pr@dev-v2@refactor_table_url_field

Pr@dev v2@refactor table url field
This commit is contained in:
wisonic-s 2024-08-16 16:22:20 +08:00 committed by GitHub
commit e9c37ca9b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 6 deletions

View File

@ -189,7 +189,8 @@ const DETAIL_CHART_ATTR: DeepPartial<ChartObj> = {
scrollCfg: {
open: false
}
}
},
showPosition: 'dialog'
}
const state = reactive({
@ -200,7 +201,8 @@ const DETAIL_TABLE_ATTR: DeepPartial<ChartObj> = {
scrollCfg: {
open: false
}
}
},
showPosition: 'dialog'
}
const authShow = computed(() => editMode.value === 'edit' || dvInfo.value.weight > 3)

View File

@ -67,6 +67,7 @@ declare interface Chart {
seriesFieldObjs?: any[]
flowMapStartName?: Axis[]
flowMapEndName?: Axis[]
showPosition: string
}
declare type CustomAttr = DeepPartial<ChartAttr> | JSONString<DeepPartial<ChartAttr>>
declare type CustomStyle = DeepPartial<ChartStyle> | JSONString<DeepPartial<ChartStyle>>

View File

@ -267,6 +267,7 @@ init()
:key="fieldOption.id"
:label="fieldOption.name"
:value="fieldOption.id"
:disabled="chart.type === 'table-info' && fieldOption.deType === 7"
>
<el-icon style="margin-right: 8px">
<Icon

View File

@ -18,8 +18,9 @@ class ImageCell extends TableDataCell {
!this.cfg.children && (this.cfg.children = [])
const { width: imgWidth, height: imgHeight } = img
const ratio = Math.max(imgWidth / width, imgHeight / height)
const imgShowWidth = imgWidth / ratio
const imgShowHeight = imgHeight / ratio
// 不铺满部分留白
const imgShowWidth = (imgWidth / ratio) * 0.8
const imgShowHeight = (imgHeight / ratio) * 0.8
this.textShape = this.addShape('image', {
attrs: {
x: x + (imgShowWidth < width ? (width - imgShowWidth) / 2 : 0),
@ -162,7 +163,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
}
s2Options.dataCell = viewMeta => {
const deType = axisMap[viewMeta.valueField]?.deType
if (deType === 7) {
if (deType === 7 && chart.showPosition !== 'dialog') {
return new ImageCell(viewMeta, viewMeta?.spreadsheet)
}
if (viewMeta.colIndex === 0 && s2Options.showSeriesNumber) {

View File

@ -506,7 +506,7 @@ const trackMenuCalc = itemId => {
// URL
if (view.value.type === 'table-info') {
view.value.xAxis?.forEach(axis => {
if (axis.id === itemId) {
if (axis.id === itemId && axis.deType === 7) {
trackMenuInfo.push('enlarge')
}
})