forked from github/dataease
refactor(图表): 明细表图片字段显示优化
This commit is contained in:
parent
231db603a0
commit
9b945f931d
@ -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)
|
||||
|
@ -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>>
|
||||
|
@ -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) {
|
||||
|
@ -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')
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user