Compare commits

..

No commits in common. "dev-v2" and "pr@dev-v2_st" have entirely different histories.

16 changed files with 35 additions and 99 deletions

View File

@ -139,7 +139,8 @@ const previewOuter = () => {
}
canvasSave(() => {
const url = '#/preview?dvId=' + dvInfo.value.id + '&ignoreParams=true'
const newWindow = window.open(url, '_blank')
const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank'
const newWindow = window.open(url, openType)
initOpenHandler(newWindow)
})
}

View File

@ -195,11 +195,7 @@
:disabled="canvasStyleData.dashboard.resultMode === 'all'"
/>
</el-form-item>
<el-form-item
v-show="dvInfo.type === 'dashboard'"
style="margin-top: 16px; margin-bottom: 8px"
:class="'form-item-' + themes"
>
<el-form-item style="margin-top: 16px; margin-bottom: 8px" :class="'form-item-' + themes">
<el-checkbox
:effect="themes"
size="small"
@ -219,11 +215,7 @@
</span>
</el-checkbox>
</el-form-item>
<el-form-item
v-show="dvInfo.type === 'dashboard'"
class="form-item"
:class="'form-item-' + themes"
>
<el-form-item class="form-item" :class="'form-item-' + themes">
<el-checkbox
:effect="themes"
size="small"

View File

@ -13,7 +13,7 @@
<el-color-picker
:effect="themes"
v-model="seniorStyleSetting.linkageIconColor"
:trigger-width="100"
:trigger-width="197"
is-custom
:predefine="state.predefineColors"
@change="themeChange"
@ -30,7 +30,7 @@
<el-color-picker
v-model="seniorStyleSetting.drillLayerColor"
:effect="themes"
:trigger-width="100"
:trigger-width="197"
is-custom
:predefine="state.predefineColors"
@change="themeChange"

View File

@ -10,7 +10,7 @@
<path
:d="smallGridPathD"
fill="none"
stroke="rgba(207, 207, 207, 0.4)"
stroke="rgba(207, 207, 207, 0.3)"
stroke-width="0.8"
/>
</pattern>
@ -21,11 +21,11 @@
patternUnits="userSpaceOnUse"
>
<rect :width="middleGridW" :height="middleGridH" fill="url(#smallGrid)" />
<path :d="middleGridPathD" fill="none" stroke="rgba(207, 207, 207, 0.4)" stroke-width="1" />
<path :d="middleGridPathD" fill="none" stroke="rgba(207, 207, 207, 0.3)" stroke-width="1" />
</pattern>
<pattern id="grid" :width="gridW" :height="gridH" patternUnits="userSpaceOnUse">
<rect :width="gridW" :height="gridH" fill="url(#middleGrid)" />
<path :d="pathD" fill="none" stroke="rgba(207, 207, 207, 0.4)" stroke-width="1.2" />
<path :d="pathD" fill="none" stroke="rgba(207, 207, 207, 0.3)" stroke-width="1.2" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#grid)" />

View File

@ -3,7 +3,7 @@
<defs>
<pattern id="grid" :width="gridW" :height="gridH" patternUnits="userSpaceOnUse">
<rect :width="gridW" :height="gridH" fill="url(#middleGrid)" />
<path :d="pathD" fill="none" stroke="rgba(207, 207, 207, 0.4)" stroke-width="0.7" />
<path :d="pathD" fill="none" stroke="rgba(207, 207, 207, 0.2)" stroke-width="0.5" />
</pattern>
<pattern
id="middleGrid"
@ -15,7 +15,7 @@
<path
:d="middleGridPathD"
fill="none"
stroke="rgba(207, 207, 207, 0.4)"
stroke="rgba(207, 207, 207, 0.2)"
stroke-width="0.3"
/>
</pattern>

View File

@ -74,6 +74,14 @@ const closeEditComponentName = () => {
const dragOnEnd = ({ oldIndex, newIndex }) => {
const source = componentData.value[newIndex]
const comLength = componentData.value.length
//
componentData.value.splice(newIndex, 1)
componentData.value.splice(oldIndex, 0, source)
const target = componentData.value[comLength - 1 - oldIndex]
//
componentData.value.splice(comLength - 1 - oldIndex, 1)
componentData.value.splice(comLength - 1 - newIndex, 0, target)
dvMainStore.setCurTabName(source.title)
eventBus.emit('onTabSortChange-' + tabElement.value?.id)
snapshotStore.recordSnapshotCache()

View File

@ -453,7 +453,7 @@ const exportAsExcel = () => {
const viewDataInfo = dvMainStore.getViewDataDetails(element.value.id)
const chartExtRequest = dvMainStore.getLastViewRequestInfo(element.value.id)
const viewInfo = dvMainStore.getViewDetails(element.value.id)
const chart = { ...viewInfo, chartExtRequest, data: viewDataInfo, busiFlag: dvInfo.value.type }
const chart = { ...viewInfo, chartExtRequest, data: viewDataInfo }
exportExcelDownload(chart, () => {
openMessageLoading(callbackExport)
})

View File

@ -225,7 +225,7 @@ const init = ref({
//
originalHandle.style.display = ''
if (cloneHandle) {
cloneHandle.parentNode?.removeChild(cloneHandle) //
cloneHandle.parentNode.removeChild(cloneHandle) //
}
cloneHandle = null
originalHandle = null
@ -539,9 +539,6 @@ const calcData = (view: Chart, callback) => {
updateEmptyValue(view)
if (view.tableId || view['dataFrom'] === 'template') {
const v = JSON.parse(JSON.stringify(view))
v.type = 'table-info'
v.render = 'antv'
v.resultCount = 1
getData(v)
.then(res => {
if (res.code && res.code !== 0) {
@ -549,8 +546,6 @@ const calcData = (view: Chart, callback) => {
errMsg.value = res.msg
} else {
state.data = res?.data
res.type = 'rich-text'
res.render = 'custom'
state.viewDataInfo = res
state.totalItems = res?.totalItems
const curViewInfo = canvasViewInfo.value[element.value.id]

View File

@ -187,16 +187,16 @@ function move(keyCode) {
const scale = dvMainStore.canvasStyleData.scale / 100
if (keyCode === leftKey) {
curComponent.value.style.left = curComponent.value.style.left - scale
groupAreaAdaptor(-scale, 0)
groupAreaAdaptor(-1, 0)
} else if (keyCode === rightKey) {
curComponent.value.style.left = curComponent.value.style.left + scale
groupAreaAdaptor(scale, 0)
groupAreaAdaptor(1, 0)
} else if (keyCode === upKey) {
curComponent.value.style.top = curComponent.value.style.top - scale
groupAreaAdaptor(0, -scale)
groupAreaAdaptor(0, -1)
} else if (keyCode === downKey) {
curComponent.value.style.top = curComponent.value.style.top + scale
groupAreaAdaptor(0, scale)
groupAreaAdaptor(0, 1)
}
snapshotStore.recordSnapshotCache('key-move')
}
@ -212,11 +212,6 @@ function groupAreaAdaptor(leftOffset = 0, topOffset = 0) {
width: parentNode.offsetWidth,
height: parentNode.offsetHeight
})
} else if (curComponent.value.component === 'GroupArea' && areaData.value.components.length > 0) {
areaData.value.components.forEach(component => {
component.style.top = component.style.top + topOffset
component.style.left = component.style.left + leftOffset
})
}
}

View File

@ -282,7 +282,8 @@ onMounted(() => {
:deep(.ed-tabs__content) {
height: calc(100% - 35px);
overflow: hidden;
overflow-y: auto;
overflow-x: hidden;
}
}
.padding-tab {

View File

@ -4,7 +4,6 @@ import {
S2Event,
S2Options,
S2Theme,
ScrollbarPositionType,
TableColCell,
TableSheet,
ViewMeta
@ -23,8 +22,7 @@ import {
calculateHeaderHeight,
SortTooltip,
configSummaryRow,
summaryRowStyle,
configEmptyDataStyle
summaryRowStyle
} from '@/views/chart/components/js/panel/common/common_table'
const { t } = useI18n()
@ -169,10 +167,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
renderTooltip: sheet => new SortTooltip(sheet)
},
interaction: {
hoverHighlight: !(basicStyle.showHoverStyle === false),
scrollbarPosition: newData.length
? ScrollbarPositionType.CONTENT
: ScrollbarPositionType.CANVAS
hoverHighlight: !(basicStyle.showHoverStyle === false)
}
}
s2Options.style = this.configStyle(chart, s2DataConfig)
@ -340,8 +335,6 @@ export class TableInfo extends S2ChartView<TableSheet> {
ev.colsHierarchy.width = containerWidth
})
}
// 空数据时表格样式
configEmptyDataStyle(newChart, basicStyle, newData, container)
// click
newChart.on(S2Event.DATA_CELL_CLICK, ev => {
const cell = newChart.getCell(ev.target)

View File

@ -1,7 +1,6 @@
import { useI18n } from '@/hooks/web/useI18n'
import { formatterItem, valueFormatter } from '@/views/chart/components/js/formatter'
import {
configEmptyDataStyle,
configSummaryRow,
copyContent,
SortTooltip,
@ -14,7 +13,6 @@ import {
S2DataConfig,
S2Event,
S2Options,
ScrollbarPositionType,
TableColCell,
TableSheet,
ViewMeta
@ -147,10 +145,7 @@ export class TableNormal extends S2ChartView<TableSheet> {
renderTooltip: sheet => new SortTooltip(sheet)
},
interaction: {
hoverHighlight: !(basicStyle.showHoverStyle === false),
scrollbarPosition: newData.length
? ScrollbarPositionType.CONTENT
: ScrollbarPositionType.CANVAS
hoverHighlight: !(basicStyle.showHoverStyle === false)
}
}
// 列宽设置
@ -247,7 +242,6 @@ export class TableNormal extends S2ChartView<TableSheet> {
ev.colsHierarchy.width = containerWidth
})
}
configEmptyDataStyle(newChart, basicStyle, newData, container)
// click
newChart.on(S2Event.DATA_CELL_CLICK, ev => {
const cell = newChart.getCell(ev.target)

View File

@ -1671,7 +1671,6 @@ const drawTextShape = (cell, isHeader) => {
* @param layoutResult
*/
export const calculateHeaderHeight = (info, newChart, tableHeader, basicStyle, layoutResult) => {
if (tableHeader.showTableHeader === false ) return
const ev = layoutResult || newChart.facet.layoutResult
const maxLines = basicStyle.maxLines ?? 1
const textStyle = { ...newChart.theme.cornerCell.text }
@ -1764,7 +1763,7 @@ const getWrapTextHeight = (wrapText, textStyle, spreadsheet, maxLines) => {
* @param showSummary
*/
export const configSummaryRow = (chart, s2Options, newData, tableHeader, basicStyle, showSummary) =>{
if (!showSummary || !newData.length) return
if (!showSummary) return
// 设置汇总行高度和表头一致
const heightByField = {}
heightByField[newData.length] = tableHeader.tableTitleHeight
@ -1822,13 +1821,10 @@ export const configSummaryRow = (chart, s2Options, newData, tableHeader, basicSt
* @param showSummary
*/
export const summaryRowStyle = (newChart, newData, tableCell, tableHeader, showSummary) => {
if (!showSummary || !newData.length) return
if (!showSummary) return
newChart.on(S2Event.LAYOUT_BEFORE_RENDER, () => {
const showHeader = tableHeader.showTableHeader === true
// 不显示表头时减少一个表头的高度
const headerAndSummaryHeight = showHeader ? 2 : 1
const totalHeight =
tableHeader.tableTitleHeight * headerAndSummaryHeight + tableCell.tableItemHeight * (newData.length - 1)
tableHeader.tableTitleHeight * 2 + tableCell.tableItemHeight * (newData.length - 1)
if (totalHeight < newChart.options.height) {
// 6 是阴影高度
newChart.options.height =
@ -1848,41 +1844,3 @@ export class SummaryCell extends CustomDataCell {
return { backgroundColor, backgroundColorOpacity }
}
}
/**
* 配置空数据样式
* @param newChart
* @param basicStyle
* @param newData
* @param container
*/
export const configEmptyDataStyle = (newChart, basicStyle, newData, container) => {
/**
* 辅助函数移除空数据dom
*/
const removeEmptyDom = () => {
const emptyElement = document.getElementById(container + '_empty')
if (emptyElement) {
emptyElement.parentElement.removeChild(emptyElement)
}
}
removeEmptyDom()
if (newData.length) return
newChart.on(S2Event.LAYOUT_AFTER_HEADER_LAYOUT, (ev) => {
removeEmptyDom()
if (!newData.length) {
const emptyDom = document.createElement('div')
const left = Math.min(newChart.options.width, ev.colsHierarchy.width) / 2 - 32
emptyDom.id = container + '_empty'
emptyDom.textContent = t('data_set.no_data')
emptyDom.setAttribute(
'style',
`position: absolute;
left: ${left}px;
top: 50%;`
)
const parent = document.getElementById(container)
parent.insertBefore(emptyDom, parent.firstChild)
}
})
}

View File

@ -34,7 +34,7 @@ const favorited = ref(false)
const preview = () => {
const baseUrl = isDataEaseBi.value ? embeddedStore.baseUrl : ''
const url = baseUrl + '#/preview?dvId=' + dvInfo.value.id + '&ignoreParams=true'
const newWindow = window.open(url, '_blank')
const newWindow = window.open(url, openType)
initOpenHandler(newWindow)
}
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)

@ -1 +1 @@
Subproject commit 13ecdfab148086cf6e66fed2bcb41d88fdd5efab
Subproject commit a081d74e3ce5b6cb32097a53c058178220c724d1

View File

@ -371,7 +371,6 @@ function restore() {
mkdir -p $DE_RUNNING_BASE
fi
echo "恢复备份 $target"
rm -rf $DE_RUNNING_BASE/data/mysql/*
tar -zxf $target --directory=$DE_RUNNING_BASE
service dataease start
else