修改dataeaseName为gisbiName
This commit is contained in:
parent
abf14fc7ba
commit
e12552eb1f
@ -8,7 +8,7 @@ export interface Field {
|
||||
datasetGroupId: number | string
|
||||
originName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
groupType: string
|
||||
type: string
|
||||
deType: number
|
||||
|
@ -97,6 +97,7 @@ const storeCacheProxy = byteArray => {
|
||||
}
|
||||
const pluginProxy = ref(null)
|
||||
const invokeMethod = param => {
|
||||
debugger
|
||||
if (pluginProxy.value && pluginProxy.value['invokeMethod']) {
|
||||
pluginProxy.value['invokeMethod'](param)
|
||||
} else if (param.methodName && pluginProxy.value[param.methodName]) {
|
||||
|
@ -141,7 +141,7 @@ const initCurFields = chartDetails => {
|
||||
dataRowFiledName.value.push(`[记录数*]`)
|
||||
}
|
||||
const sourceFieldNameIdMap = chartDetails.data.fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['name']
|
||||
pre[next['gisbiName']] = next['name']
|
||||
return pre
|
||||
}, {})
|
||||
const rowData = chartDetails.data.tableRow[0]
|
||||
|
@ -629,25 +629,25 @@ const initCurFields = chartDetails => {
|
||||
}
|
||||
// Get the corresponding relationship between id and value
|
||||
const nameIdMap = chartDetails.data.fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
pre[next['gisbiName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
const sourceFieldNameIdMap = chartDetails.data.fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['name']
|
||||
pre[next['gisbiName']] = next['name']
|
||||
return pre
|
||||
}, {})
|
||||
const rowData = chartDetails.data.tableRow[0]
|
||||
if (chartDetails.type === 'rich-text') {
|
||||
let yAxis = JSON.parse(JSON.stringify(chartDetails.yAxis))
|
||||
const yDataeaseNames = []
|
||||
const yDataeaseNamesCfg = []
|
||||
const ygisbiNames = []
|
||||
const ygisbiNamesCfg = []
|
||||
yAxis.forEach(yItem => {
|
||||
yDataeaseNames.push(yItem.dataeaseName)
|
||||
yDataeaseNamesCfg[yItem.dataeaseName] = yItem.formatterCfg
|
||||
ygisbiNames.push(yItem.gisbiName)
|
||||
ygisbiNamesCfg[yItem.gisbiName] = yItem.formatterCfg
|
||||
})
|
||||
}
|
||||
const valueFieldMap: Record<string, Axis> = chartDetails.yAxis.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
for (const key in rowData) {
|
||||
|
@ -640,7 +640,7 @@ declare interface CalcTotals {
|
||||
* 汇总聚合配置
|
||||
*/
|
||||
declare interface CalcTotalCfg extends Axis {
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
/**
|
||||
* 聚合方式
|
||||
*/
|
||||
|
@ -187,7 +187,7 @@ declare interface ChartViewField {
|
||||
/**
|
||||
* de名称
|
||||
*/
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
|
@ -10,25 +10,25 @@ export function viewFieldTimeTrans(viewDataInfo, params) {
|
||||
: []
|
||||
|
||||
const idNameMap = fields.reduce((pre, next) => {
|
||||
pre[next['id']] = next['dataeaseName']
|
||||
pre[next['id']] = next['gisbiName']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
const nameTypeMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['deType']
|
||||
pre[next['gisbiName']] = next['deType']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
const nameDateStyleMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['dateStyle']
|
||||
pre[next['gisbiName']] = next['dateStyle']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
params.dimensionList.forEach(dimension => {
|
||||
const dataeaseName = idNameMap[dimension.id]
|
||||
const gisbiName = idNameMap[dimension.id]
|
||||
// deType === 1 表示是时间类型
|
||||
if (nameTypeMap[dataeaseName] === 1) {
|
||||
dimension['timeValue'] = getRange(dimension.value, nameDateStyleMap[dataeaseName])
|
||||
if (nameTypeMap[gisbiName] === 1) {
|
||||
dimension['timeValue'] = getRange(dimension.value, nameDateStyleMap[gisbiName])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export function getItemType(dimensionData, quotaData, item) {
|
||||
if (item.chartId) {
|
||||
if (
|
||||
ele.originName === item.originName &&
|
||||
ele.dataeaseName === item.dataeaseName &&
|
||||
ele.gisbiName === item.gisbiName &&
|
||||
ele.deType === item.deType &&
|
||||
ele.groupType === item.groupType
|
||||
) {
|
||||
@ -39,7 +39,7 @@ export function getItemType(dimensionData, quotaData, item) {
|
||||
if (item.chartId) {
|
||||
if (
|
||||
ele.originName === item.originName &&
|
||||
ele.dataeaseName === item.dataeaseName &&
|
||||
ele.gisbiName === item.gisbiName &&
|
||||
ele.deType === item.deType &&
|
||||
ele.groupType === item.groupType
|
||||
) {
|
||||
|
@ -87,7 +87,7 @@ const initFieldCtrl = () => {
|
||||
if (item.groupType === 'q') {
|
||||
fieldOptions.value.push({
|
||||
label: item.name,
|
||||
value: item.dataeaseName
|
||||
value: item.gisbiName
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -182,7 +182,7 @@ const initTableColumnWidth = () => {
|
||||
const { tableHeader } = customAttr
|
||||
if (allAxis.length && tableHeader.showIndex) {
|
||||
const indexColumn = {
|
||||
dataeaseName: SERIES_NUMBER_FIELD,
|
||||
gisbiName: SERIES_NUMBER_FIELD,
|
||||
name: tableHeader.indexLabel
|
||||
} as unknown as Axis
|
||||
allAxis.unshift(indexColumn)
|
||||
@ -197,7 +197,7 @@ const initTableColumnWidth = () => {
|
||||
const defaultWidth = parseFloat((100 / allAxis.length).toFixed(2))
|
||||
allAxis.forEach(item => {
|
||||
state.basicStyleForm.tableFieldWidth.push({
|
||||
fieldId: item.dataeaseName,
|
||||
fieldId: item.gisbiName,
|
||||
name: item.name,
|
||||
width: defaultWidth
|
||||
})
|
||||
@ -210,11 +210,11 @@ const initTableColumnWidth = () => {
|
||||
state.basicStyleForm.tableFieldWidth.splice(0)
|
||||
allAxis.forEach(item => {
|
||||
let width = 10
|
||||
if (fieldMap[item.dataeaseName]) {
|
||||
width = fieldMap[item.dataeaseName].width
|
||||
if (fieldMap[item.gisbiName]) {
|
||||
width = fieldMap[item.gisbiName].width
|
||||
}
|
||||
state.basicStyleForm.tableFieldWidth.push({
|
||||
fieldId: item.dataeaseName,
|
||||
fieldId: item.gisbiName,
|
||||
name: item.name,
|
||||
width
|
||||
})
|
||||
|
@ -438,9 +438,9 @@ watch(chartType, () => {
|
||||
|
||||
const allFields = computed(() => {
|
||||
return defaultTo(props.allFields, []).map(item => ({
|
||||
key: item.dataeaseName,
|
||||
key: item.gisbiName,
|
||||
name: item.name,
|
||||
value: `${item.dataeaseName}@${item.name}`,
|
||||
value: `${item.gisbiName}@${item.name}`,
|
||||
disabled: false
|
||||
}))
|
||||
})
|
||||
|
@ -81,7 +81,7 @@ const init = () => {
|
||||
const tempList = []
|
||||
for (let i = 0; i < axisList.length; i++) {
|
||||
const axis = axisList[i]
|
||||
let savedAxis = find(state.basicStyleForm.seriesSummary, s => s.field === axis.dataeaseName)
|
||||
let savedAxis = find(state.basicStyleForm.seriesSummary, s => s.field === axis.gisbiName)
|
||||
if (savedAxis) {
|
||||
if (savedAxis.summary == undefined) {
|
||||
savedAxis.summary = 'sum'
|
||||
@ -91,7 +91,7 @@ const init = () => {
|
||||
}
|
||||
} else {
|
||||
savedAxis = {
|
||||
field: axis.dataeaseName,
|
||||
field: axis.gisbiName,
|
||||
summary: 'sum',
|
||||
show: true
|
||||
}
|
||||
@ -148,8 +148,8 @@ onMounted(() => {
|
||||
>
|
||||
<el-option
|
||||
v-for="c in computedAxis"
|
||||
:key="c.dataeaseName"
|
||||
:value="c.dataeaseName"
|
||||
:key="c.gisbiName"
|
||||
:value="c.gisbiName"
|
||||
:label="c.chartShowName ?? c.name"
|
||||
/>
|
||||
</el-select>
|
||||
|
@ -420,9 +420,9 @@ const updateAxis = (form: AxisEditForm) => {
|
||||
}
|
||||
const allFields = computed(() => {
|
||||
return defaultTo(props.allFields, []).map(item => ({
|
||||
key: item.dataeaseName,
|
||||
key: item.gisbiName,
|
||||
name: item.name,
|
||||
value: `${item.dataeaseName}@${item.name}`,
|
||||
value: `${item.gisbiName}@${item.name}`,
|
||||
disabled: false
|
||||
}))
|
||||
})
|
||||
|
@ -19,7 +19,7 @@ export interface CalcFieldType {
|
||||
datasetGroupId?: string // 有就传,没有null
|
||||
originName: string // 物理字段名
|
||||
name: string // 字段显示名
|
||||
dataeaseName?: string // 字段别名
|
||||
gisbiName?: string // 字段别名
|
||||
groupType: 'd' | 'q' // d=维度,q=指标
|
||||
type: string
|
||||
params?: Array<{ id: string; name: string; value: number }>
|
||||
|
@ -55,7 +55,7 @@ const onCancelConfig = () => {
|
||||
|
||||
const onConfigChange = () => {
|
||||
const allAxis = props.chart.xAxis
|
||||
?.map(axis => axis.hide !== true && axis.dataeaseName)
|
||||
?.map(axis => axis.hide !== true && axis.gisbiName)
|
||||
.filter(i => i)
|
||||
const { fields, meta } = s2.dataCfg
|
||||
const groupMeta = meta.filter(item => !allAxis.includes(item.field))
|
||||
@ -68,7 +68,7 @@ const init = () => {
|
||||
const { headerGroupConfig } = chart.customAttr.tableHeader
|
||||
const showColumns = []
|
||||
xAxis?.forEach(axis => {
|
||||
axis.hide !== true && showColumns.push({ key: axis.dataeaseName })
|
||||
axis.hide !== true && showColumns.push({ key: axis.gisbiName })
|
||||
})
|
||||
if (!showColumns.length) {
|
||||
return
|
||||
@ -110,17 +110,17 @@ const renderTable = (chart: ChartObj) => {
|
||||
const meta = [...headerGroupConfig.meta]
|
||||
const columns = headerGroupConfig.columns
|
||||
const axisMap = chart.xAxis.reduce((pre, cur) => {
|
||||
pre[cur.dataeaseName] = cur
|
||||
pre[cur.gisbiName] = cur
|
||||
return pre
|
||||
}, {})
|
||||
if (data?.fields?.length) {
|
||||
data.fields.forEach(ele => {
|
||||
const f = axisMap[ele.dataeaseName]
|
||||
const f = axisMap[ele.gisbiName]
|
||||
if (f?.hide === true) {
|
||||
return
|
||||
}
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
field: ele.gisbiName,
|
||||
name: ele.chartShowName ?? ele.name,
|
||||
formatter: function (value) {
|
||||
if (!f) {
|
||||
@ -144,7 +144,7 @@ const renderTable = (chart: ChartObj) => {
|
||||
chart.xAxis?.forEach(axis => {
|
||||
if (axis.hide !== true) {
|
||||
meta.push({
|
||||
field: axis.dataeaseName,
|
||||
field: axis.gisbiName,
|
||||
name: axis.chartShowName ?? axis.name
|
||||
})
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ const groupConfigValid = computed(() => {
|
||||
const xAxis = props.chart.xAxis
|
||||
const showColumns = []
|
||||
xAxis?.forEach(axis => {
|
||||
axis.hide !== true && showColumns.push({ key: axis.dataeaseName })
|
||||
axis.hide !== true && showColumns.push({ key: axis.gisbiName })
|
||||
})
|
||||
if (!showColumns.length) {
|
||||
return false
|
||||
|
@ -96,11 +96,11 @@ const initSubTotalDimensionList = () => {
|
||||
//排除最后一个
|
||||
const old = includes(
|
||||
state.tableTotalForm.row.subTotalsDimensions,
|
||||
props.chart.xAxis[i].dataeaseName
|
||||
props.chart.xAxis[i].gisbiName
|
||||
)
|
||||
list.push({
|
||||
displayName: props.chart.xAxis[i].name,
|
||||
name: props.chart.xAxis[i].dataeaseName,
|
||||
name: props.chart.xAxis[i].gisbiName,
|
||||
checked: !!state.tableTotalForm.row.subTotalsDimensionsNew ? old : true
|
||||
})
|
||||
}
|
||||
@ -139,12 +139,12 @@ const init = () => {
|
||||
}
|
||||
const yAxis = props.chart.yAxis
|
||||
if (yAxis?.length > 0) {
|
||||
const axisArr = yAxis.map(i => i.dataeaseName)
|
||||
const axisArr = yAxis.map(i => i.gisbiName)
|
||||
if (axisArr.indexOf(state.tableTotalForm.row.totalSortField) === -1) {
|
||||
state.tableTotalForm.row.totalSortField = yAxis[0].dataeaseName
|
||||
state.tableTotalForm.row.totalSortField = yAxis[0].gisbiName
|
||||
}
|
||||
if (axisArr.indexOf(state.tableTotalForm.col.totalSortField) === -1) {
|
||||
state.tableTotalForm.col.totalSortField = yAxis[0].dataeaseName
|
||||
state.tableTotalForm.col.totalSortField = yAxis[0].gisbiName
|
||||
}
|
||||
} else {
|
||||
state.tableTotalForm.row.totalSortField = ''
|
||||
@ -168,16 +168,16 @@ const init = () => {
|
||||
totalTupleArr.forEach(tuple => {
|
||||
const [total, totalCfg] = tuple
|
||||
if (!totalCfg.length) {
|
||||
total.dataeaseName = ''
|
||||
total.gisbiName = ''
|
||||
total.aggregation = ''
|
||||
total.originName = ''
|
||||
return
|
||||
}
|
||||
const totalIndex = totalCfg.findIndex(i => i.dataeaseName === total.dataeaseName)
|
||||
const totalIndex = totalCfg.findIndex(i => i.gisbiName === total.gisbiName)
|
||||
if (totalIndex !== -1) {
|
||||
total.aggregation = totalCfg[totalIndex].aggregation
|
||||
} else {
|
||||
total.dataeaseName = totalCfg[0].dataeaseName
|
||||
total.gisbiName = totalCfg[0].gisbiName
|
||||
total.aggregation = totalCfg[0].aggregation
|
||||
total.originName = totalCfg[0].originName
|
||||
total.label = totalCfg[0].label
|
||||
@ -193,7 +193,7 @@ const showProperty = prop => props.propertyInner?.includes(prop)
|
||||
const changeTotal = (totalItem, totals) => {
|
||||
for (let i = 0; i < totals.length; i++) {
|
||||
const item = totals[i]
|
||||
if (item.dataeaseName === totalItem.dataeaseName) {
|
||||
if (item.gisbiName === totalItem.gisbiName) {
|
||||
totalItem.aggregation = item.aggregation
|
||||
totalItem.originName = item.originName
|
||||
totalItem.label = item.label
|
||||
@ -204,7 +204,7 @@ const changeTotal = (totalItem, totals) => {
|
||||
const changeTotalAggr = (totalItem, totals, colOrNum) => {
|
||||
for (let i = 0; i < totals.length; i++) {
|
||||
const item = totals[i]
|
||||
if (item.dataeaseName === totalItem.dataeaseName) {
|
||||
if (item.gisbiName === totalItem.gisbiName) {
|
||||
item.aggregation = totalItem.aggregation
|
||||
item.label = totalItem.label
|
||||
break
|
||||
@ -219,7 +219,7 @@ const setupTotalCfg = (totalCfg, axis) => {
|
||||
if (!totalCfg.length) {
|
||||
axis.forEach(i => {
|
||||
totalCfg.push({
|
||||
dataeaseName: i.dataeaseName,
|
||||
gisbiName: i.gisbiName,
|
||||
aggregation: 'SUM',
|
||||
label: i.chartShowName ?? i.name
|
||||
})
|
||||
@ -231,17 +231,17 @@ const setupTotalCfg = (totalCfg, axis) => {
|
||||
return
|
||||
}
|
||||
const cfgMap = totalCfg.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
totalCfg.splice(0, totalCfg.length)
|
||||
axis.forEach(i => {
|
||||
totalCfg.push({
|
||||
dataeaseName: i.dataeaseName,
|
||||
aggregation: cfgMap[i.dataeaseName] ? cfgMap[i.dataeaseName].aggregation : 'SUM',
|
||||
originName: cfgMap[i.dataeaseName] ? cfgMap[i.dataeaseName].originName : '',
|
||||
label: cfgMap[i.dataeaseName]?.label
|
||||
? cfgMap[i.dataeaseName].label
|
||||
gisbiName: i.gisbiName,
|
||||
aggregation: cfgMap[i.gisbiName] ? cfgMap[i.gisbiName].aggregation : 'SUM',
|
||||
originName: cfgMap[i.gisbiName] ? cfgMap[i.gisbiName].originName : '',
|
||||
label: cfgMap[i.gisbiName]?.label
|
||||
? cfgMap[i.gisbiName].label
|
||||
: i.chartShowName ?? i.name
|
||||
})
|
||||
})
|
||||
@ -269,7 +269,7 @@ const confirmEditCalc = () => {
|
||||
calcEdit.value.setFieldForm()
|
||||
const obj = cloneDeep(calcEdit.value.fieldForm)
|
||||
state.totalCfg?.forEach(item => {
|
||||
if (item.dataeaseName === obj.dataeaseName) {
|
||||
if (item.gisbiName === obj.gisbiName) {
|
||||
item.originName = obj.originName
|
||||
setFieldDefaultValue(item)
|
||||
state.totalItem.originName = item.originName
|
||||
@ -352,15 +352,15 @@ onMounted(() => {
|
||||
<el-col :span="11">
|
||||
<el-select
|
||||
:effect="themes"
|
||||
v-model="state.rowTotalItem.dataeaseName"
|
||||
v-model="state.rowTotalItem.gisbiName"
|
||||
:placeholder="t('chart.aggregation')"
|
||||
@change="changeTotal(state.rowTotalItem, state.tableTotalForm.row.calcTotals.cfg)"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
@ -452,9 +452,9 @@ onMounted(() => {
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -550,16 +550,16 @@ onMounted(() => {
|
||||
<el-col :span="11">
|
||||
<el-select
|
||||
:effect="themes"
|
||||
v-model="state.rowSubTotalItem.dataeaseName"
|
||||
v-model="state.rowSubTotalItem.gisbiName"
|
||||
:disabled="chart.xAxis.length < 2"
|
||||
:placeholder="t('chart.aggregation')"
|
||||
@change="changeTotal(state.rowSubTotalItem, state.tableTotalForm.row.calcSubTotals.cfg)"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
@ -659,15 +659,15 @@ onMounted(() => {
|
||||
<el-col :span="11">
|
||||
<el-select
|
||||
:effect="themes"
|
||||
v-model="state.colTotalItem.dataeaseName"
|
||||
v-model="state.colTotalItem.gisbiName"
|
||||
:placeholder="t('chart.aggregation')"
|
||||
@change="changeTotal(state.colTotalItem, state.tableTotalForm.col.calcTotals.cfg)"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
@ -758,9 +758,9 @@ onMounted(() => {
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -820,16 +820,16 @@ onMounted(() => {
|
||||
<el-col :span="11">
|
||||
<el-select
|
||||
:effect="themes"
|
||||
v-model="state.colSubTotalItem.dataeaseName"
|
||||
v-model="state.colSubTotalItem.gisbiName"
|
||||
:disabled="chart.xAxisExt?.length < 2"
|
||||
:placeholder="t('chart.aggregation')"
|
||||
@change="changeTotal(state.colSubTotalItem, state.tableTotalForm.col.calcSubTotals.cfg)"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in chart.yAxis"
|
||||
:key="option.dataeaseName"
|
||||
:key="option.gisbiName"
|
||||
:label="option.name"
|
||||
:value="option.dataeaseName"
|
||||
:value="option.gisbiName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
@ -1729,7 +1729,7 @@ const setFieldDefaultValue = field => {
|
||||
field.extField = 2
|
||||
field.chartId = view.value.id
|
||||
field.datasetGroupId = view.value.tableId
|
||||
field.dataeaseName = null
|
||||
field.gisbiName = null
|
||||
field.lastSyncTime = null
|
||||
field.columnIndex = state.dimension.length + state.quota.length
|
||||
field.deExtractType = field.deType
|
||||
|
File diff suppressed because one or more lines are too long
@ -68,22 +68,22 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
const xAxis = chart.xAxis
|
||||
const yAxis = chart.yAxis
|
||||
// 时间字段
|
||||
const xAxisDataeaseName = xAxis[0].dataeaseName
|
||||
const xAxisgisbiName = xAxis[0].gisbiName
|
||||
// 收盘价字段
|
||||
const yAxisDataeaseName = yAxis[1].dataeaseName
|
||||
const yAxisgisbiName = yAxis[1].gisbiName
|
||||
const result = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (i < dayCount) {
|
||||
result.push({
|
||||
[xAxisDataeaseName]: data[i][xAxisDataeaseName],
|
||||
[xAxisgisbiName]: data[i][xAxisgisbiName],
|
||||
value: null
|
||||
})
|
||||
} else {
|
||||
const sum = data
|
||||
.slice(i - dayCount + 1, i + 1)
|
||||
.reduce((sum, item) => sum + item[yAxisDataeaseName], 0)
|
||||
.reduce((sum, item) => sum + item[yAxisgisbiName], 0)
|
||||
result.push({
|
||||
[xAxisDataeaseName]: data[i][xAxisDataeaseName],
|
||||
[xAxisgisbiName]: data[i][xAxisgisbiName],
|
||||
value: parseFloat((sum / dayCount).toFixed(3))
|
||||
})
|
||||
}
|
||||
@ -228,7 +228,7 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
const data = parseJson(chart.data?.tableRow)
|
||||
|
||||
// 时间字段
|
||||
const xAxisDataeaseName = xAxis[0].dataeaseName
|
||||
const xAxisgisbiName = xAxis[0].gisbiName
|
||||
const averages = [5, 10, 20, 60, 120, 180]
|
||||
const legendItems: any[] = [
|
||||
{
|
||||
@ -262,9 +262,9 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
|
||||
// 将均线数据设置到主数据中
|
||||
data.forEach((item: any) => {
|
||||
const date = item[xAxisDataeaseName]
|
||||
const date = item[xAxisgisbiName]
|
||||
for (const [key, value] of averagesLineData) {
|
||||
item[key] = value.find(m => m[xAxisDataeaseName] === date)?.value
|
||||
item[key] = value.find(m => m[xAxisgisbiName] === date)?.value
|
||||
}
|
||||
})
|
||||
|
||||
@ -283,7 +283,7 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
top: true,
|
||||
options: {
|
||||
smooth: false,
|
||||
xField: xAxisDataeaseName,
|
||||
xField: xAxisgisbiName,
|
||||
yField: key,
|
||||
color: colors[index - 1],
|
||||
xAxis: null,
|
||||
@ -349,7 +349,7 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
|
||||
options: {
|
||||
meta: {
|
||||
[xAxisDataeaseName]: {
|
||||
[xAxisgisbiName]: {
|
||||
mask: dateFormat
|
||||
}
|
||||
},
|
||||
@ -363,12 +363,12 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
min: minValue,
|
||||
max: maxValue
|
||||
},
|
||||
xField: xAxisDataeaseName,
|
||||
xField: xAxisgisbiName,
|
||||
yField: [
|
||||
yAxis[0].dataeaseName,
|
||||
yAxis[1].dataeaseName,
|
||||
yAxis[2].dataeaseName,
|
||||
yAxis[3].dataeaseName
|
||||
yAxis[0].gisbiName,
|
||||
yAxis[1].gisbiName,
|
||||
yAxis[2].gisbiName,
|
||||
yAxis[3].gisbiName
|
||||
],
|
||||
legend: {
|
||||
position: 'top',
|
||||
@ -384,7 +384,7 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
const plot = new MixClass(container, option)
|
||||
this.registerEvent(data, plot, averagesLineData)
|
||||
plot.on('schema:click', evt => {
|
||||
const selectSchema = evt.data.data[xAxisDataeaseName]
|
||||
const selectSchema = evt.data.data[xAxisgisbiName]
|
||||
const paramData = parseJson(chart.data?.data)
|
||||
const selectData = paramData.filter(item => item.field === selectSchema)
|
||||
const quotaList = []
|
||||
@ -463,7 +463,7 @@ export class StockLine extends G2PlotChartView<MixOptions, Mix> {
|
||||
const showFiled = chart.data.fields
|
||||
const customTooltipItems = originalItems => {
|
||||
const formattedItems = originalItems.map(item => {
|
||||
const fieldObj = showFiled.find(q => q.dataeaseName === item.name)
|
||||
const fieldObj = showFiled.find(q => q.gisbiName === item.name)
|
||||
const displayName = fieldObj?.chartShowName || fieldObj?.name || item.name
|
||||
const formattedName = displayName.startsWith('ma') ? displayName.toUpperCase() : displayName
|
||||
tooltipAttr.tooltipFormatter.decimalCount = 3
|
||||
|
@ -143,13 +143,13 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
let lineWidthField = null
|
||||
const yAxis = deepCopy(chart.yAxis)
|
||||
if (yAxis.length > 0) {
|
||||
lineWidthField = yAxis[0].dataeaseName
|
||||
lineWidthField = yAxis[0].gisbiName
|
||||
}
|
||||
// 线条颜色
|
||||
let lineColorField = null
|
||||
const yAxisExt = deepCopy(chart.yAxisExt)
|
||||
if (yAxisExt.length > 0) {
|
||||
lineColorField = yAxisExt[0].dataeaseName
|
||||
lineColorField = yAxisExt[0].gisbiName
|
||||
}
|
||||
const asteriskField = '*'
|
||||
const data = []
|
||||
@ -173,10 +173,10 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(data, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxis[0].dataeaseName,
|
||||
y: xAxis[1].dataeaseName,
|
||||
x1: xAxisExt[0].dataeaseName,
|
||||
y1: xAxisExt[1].dataeaseName
|
||||
x: xAxis[0].gisbiName,
|
||||
y: xAxis[1].gisbiName,
|
||||
x1: xAxisExt[0].gisbiName,
|
||||
y1: xAxisExt[1].gisbiName
|
||||
}
|
||||
})
|
||||
.size(flowLineStyle.size)
|
||||
@ -226,11 +226,11 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(chart.data?.tableRow, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxis[0].dataeaseName,
|
||||
y: xAxis[1].dataeaseName
|
||||
x: xAxis[0].gisbiName,
|
||||
y: xAxis[1].gisbiName
|
||||
}
|
||||
})
|
||||
.shape(flowMapStartName[0].dataeaseName, args => {
|
||||
.shape(flowMapStartName[0].gisbiName, args => {
|
||||
if (has.has('from-' + args)) {
|
||||
return ''
|
||||
}
|
||||
@ -254,11 +254,11 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(chart.data?.tableRow, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxisExt[0].dataeaseName,
|
||||
y: xAxisExt[1].dataeaseName
|
||||
x: xAxisExt[0].gisbiName,
|
||||
y: xAxisExt[1].gisbiName
|
||||
}
|
||||
})
|
||||
.shape(flowMapEndName[0].dataeaseName, args => {
|
||||
.shape(flowMapEndName[0].gisbiName, args => {
|
||||
if (has.has('from-' + args) || has.has('to-' + args)) {
|
||||
return ''
|
||||
}
|
||||
@ -287,8 +287,8 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(chart.data?.tableRow, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxis[0].dataeaseName,
|
||||
y: xAxis[1].dataeaseName
|
||||
x: xAxis[0].gisbiName,
|
||||
y: xAxis[1].gisbiName
|
||||
}
|
||||
})
|
||||
.shape('circle')
|
||||
@ -301,8 +301,8 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(chart.data?.tableRow, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxisExt[0].dataeaseName,
|
||||
y: xAxisExt[1].dataeaseName
|
||||
x: xAxisExt[0].gisbiName,
|
||||
y: xAxisExt[1].gisbiName
|
||||
}
|
||||
})
|
||||
.shape('circle')
|
||||
|
@ -117,9 +117,9 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
chart.data?.tableRow.length
|
||||
) {
|
||||
// 经度
|
||||
const lng = chart.data?.tableRow?.[0][chart.xAxis[0].dataeaseName]
|
||||
const lng = chart.data?.tableRow?.[0][chart.xAxis[0].gisbiName]
|
||||
// 纬度
|
||||
const lat = chart.data?.tableRow?.[0][chart.xAxis[1].dataeaseName]
|
||||
const lat = chart.data?.tableRow?.[0][chart.xAxis[1].gisbiName]
|
||||
center = [lng, lat]
|
||||
}
|
||||
const chartObj = drawOption.chartObj as unknown as L7Wrapper<L7Config, Scene>
|
||||
@ -161,17 +161,17 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
const quotaList = []
|
||||
chart.data.fields.forEach((item, index) => {
|
||||
Object.keys(data).forEach(key => {
|
||||
if (key.startsWith('f_') && item.dataeaseName === key) {
|
||||
if (key.startsWith('f_') && item.gisbiName === key) {
|
||||
if (index === 0) {
|
||||
dimensionList.push({
|
||||
id: item.id,
|
||||
dataeaseName: item.dataeaseName,
|
||||
gisbiName: item.gisbiName,
|
||||
value: data[key]
|
||||
})
|
||||
} else {
|
||||
quotaList.push({
|
||||
id: item.id,
|
||||
dataeaseName: item.dataeaseName,
|
||||
gisbiName: item.gisbiName,
|
||||
value: data[key]
|
||||
})
|
||||
}
|
||||
@ -219,7 +219,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
let colorIndex = 0
|
||||
// 存储已分配的颜色
|
||||
const colorAssignments = new Map()
|
||||
const sizeKey = extBubble.length > 0 ? extBubble[0].dataeaseName : ''
|
||||
const sizeKey = extBubble.length > 0 ? extBubble[0].gisbiName : ''
|
||||
|
||||
//条件颜色
|
||||
const { threshold } = parseJson(chart.senior)
|
||||
@ -237,7 +237,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
? chart.data.tableRow.map((item, index) => {
|
||||
item['_index'] = '_index' + index
|
||||
// 颜色标识
|
||||
const identifier = item[xAxisExt[0]?.dataeaseName]
|
||||
const identifier = item[xAxisExt[0]?.gisbiName]
|
||||
// 检查该标识是否已有颜色分配,如果没有则分配
|
||||
let color = colorAssignments.get(identifier)
|
||||
if (!color) {
|
||||
@ -251,7 +251,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
if (conditions.length > 0) {
|
||||
for (let i = 0; i < conditions.length; i++) {
|
||||
const c = conditions[i]
|
||||
const value = item[c.field.dataeaseName]
|
||||
const value = item[c.field.gisbiName]
|
||||
for (const t of c.conditions) {
|
||||
const v = t.value
|
||||
|
||||
@ -312,12 +312,12 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(data, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxis[0].dataeaseName,
|
||||
y: xAxis[1].dataeaseName
|
||||
x: xAxis[0].gisbiName,
|
||||
y: xAxis[1].gisbiName
|
||||
}
|
||||
})
|
||||
.active(true)
|
||||
if (xAxisExt[0]?.dataeaseName) {
|
||||
if (xAxisExt[0]?.gisbiName) {
|
||||
if (basicStyle.mapSymbol === 'custom' && basicStyle.customIcon) {
|
||||
// 图片无法改色
|
||||
if (basicStyle.customIcon.startsWith('data')) {
|
||||
@ -432,8 +432,8 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
let showFields = tooltip.showFields || []
|
||||
if (!tooltip.showFields || tooltip.showFields.length === 0) {
|
||||
showFields = [
|
||||
...chart.xAxisExt.map(i => `${i.dataeaseName}@${i.name}`),
|
||||
...chart.xAxis.map(i => `${i.dataeaseName}@${i.name}`)
|
||||
...chart.xAxisExt.map(i => `${i.gisbiName}@${i.name}`),
|
||||
...chart.xAxis.map(i => `${i.gisbiName}@${i.name}`)
|
||||
]
|
||||
}
|
||||
// 修改背景色
|
||||
@ -564,8 +564,8 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
let showFields = label.showFields || []
|
||||
if (!label.showFields || label.showFields.length === 0) {
|
||||
showFields = [
|
||||
...chart.xAxisExt.map(i => `${i.dataeaseName}@${i.name}`),
|
||||
...chart.xAxis.map(i => `${i.dataeaseName}@${i.name}`)
|
||||
...chart.xAxisExt.map(i => `${i.gisbiName}@${i.name}`),
|
||||
...chart.xAxis.map(i => `${i.gisbiName}@${i.name}`)
|
||||
]
|
||||
}
|
||||
data.forEach(item => {
|
||||
@ -593,8 +593,8 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
||||
.source(data, {
|
||||
parser: {
|
||||
type: 'json',
|
||||
x: xAxis[0].dataeaseName,
|
||||
y: xAxis[1].dataeaseName
|
||||
x: xAxis[0].gisbiName,
|
||||
y: xAxis[1].gisbiName
|
||||
}
|
||||
})
|
||||
.shape('textLayerContent', 'text')
|
||||
|
@ -469,8 +469,8 @@ export class CarouselManager {
|
||||
})
|
||||
}
|
||||
if (this.chart.type === 'symbolic-map') {
|
||||
const lngField = this.chart.xAxis[0].dataeaseName
|
||||
const latField = this.chart.xAxis[1].dataeaseName
|
||||
const lngField = this.chart.xAxis[0].gisbiName
|
||||
const latField = this.chart.xAxis[1].gisbiName
|
||||
const { _id } = this.scene
|
||||
?.getLayers()
|
||||
?.find(i => i.type === 'PointLayer')
|
||||
@ -554,8 +554,8 @@ export class CarouselManager {
|
||||
let showFields = tooltip.showFields || []
|
||||
if (!tooltip.showFields || tooltip.showFields.length === 0) {
|
||||
showFields = [
|
||||
...this.chart.xAxisExt.map(i => `${i.dataeaseName}@${i.name}`),
|
||||
...this.chart.xAxis.map(i => `${i.dataeaseName}@${i.name}`)
|
||||
...this.chart.xAxisExt.map(i => `${i.gisbiName}@${i.name}`),
|
||||
...this.chart.xAxis.map(i => `${i.gisbiName}@${i.name}`)
|
||||
]
|
||||
}
|
||||
const style = document.createElement('style')
|
||||
@ -571,8 +571,8 @@ export class CarouselManager {
|
||||
}
|
||||
`
|
||||
document.head.appendChild(style)
|
||||
const lngField = this.chart.xAxis[0].dataeaseName
|
||||
const latField = this.chart.xAxis[1].dataeaseName
|
||||
const lngField = this.chart.xAxis[0].gisbiName
|
||||
const latField = this.chart.xAxis[1].gisbiName
|
||||
const htmlPrefix = `<div style='font-size:${tooltip.fontSize}px;color:${tooltip.color};'>`
|
||||
const htmlSuffix = '</div>'
|
||||
const data = this.view.sourceOption.data[index]
|
||||
|
@ -119,9 +119,9 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
if (!xAxis?.length || !xAxisExt?.length || !extColor?.length) {
|
||||
return
|
||||
}
|
||||
const xField = xAxis[0].dataeaseName
|
||||
const xFieldExt = xAxisExt[0].dataeaseName
|
||||
const extColorField = extColor[0].dataeaseName
|
||||
const xField = xAxis[0].gisbiName
|
||||
const xFieldExt = xAxisExt[0].gisbiName
|
||||
const extColorField = extColor[0].gisbiName
|
||||
// data
|
||||
const tmpData = cloneDeep(chart.data.tableRow)
|
||||
const data = tmpData.filter(cell => cell[xField] && cell[xFieldExt] && cell[extColorField])
|
||||
@ -172,10 +172,10 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
const dimensionList = []
|
||||
chart.data.fields.forEach(item => {
|
||||
Object.keys(pointData).forEach(key => {
|
||||
if (key.startsWith('f_') && item.dataeaseName === key) {
|
||||
if (key.startsWith('f_') && item.gisbiName === key) {
|
||||
dimensionList.push({
|
||||
id: item.id,
|
||||
dataeaseName: item.dataeaseName,
|
||||
gisbiName: item.gisbiName,
|
||||
value: pointData[key]
|
||||
})
|
||||
}
|
||||
@ -198,7 +198,7 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
newChart.on('afterrender', ev => {
|
||||
const l = JSON.parse(JSON.stringify(parseJson(chart.customStyle).legend))
|
||||
if (l.show) {
|
||||
const rail = ev.view.getController('legend').option[extColor[0].dataeaseName]?.['rail']
|
||||
const rail = ev.view.getController('legend').option[extColor[0].gisbiName]?.['rail']
|
||||
if (rail) {
|
||||
rail.defaultLength = this.getDefaultLength(chart, l)
|
||||
}
|
||||
@ -242,7 +242,7 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
const items = []
|
||||
const createItem = (fieldObj, items, originalItems) => {
|
||||
const name = fieldObj?.chartShowName ? fieldObj?.chartShowName : fieldObj?.name
|
||||
let value = originalItems[0].data[fieldObj.dataeaseName]
|
||||
let value = originalItems[0].data[fieldObj.gisbiName]
|
||||
if (!isNaN(Number(value))) {
|
||||
value = valueFormatter(value, fieldObj?.formatterCfg)
|
||||
}
|
||||
@ -336,7 +336,7 @@ export class TableHeatmap extends G2PlotChartView<HeatmapOptions, Heatmap> {
|
||||
position: 'middle',
|
||||
layout,
|
||||
formatter: data => {
|
||||
const value = data[extColor[0]?.dataeaseName]
|
||||
const value = data[extColor[0]?.gisbiName]
|
||||
if (!isNaN(Number(value))) {
|
||||
return valueFormatter(value, extColor[0]?.formatterCfg)
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
const columns = []
|
||||
const meta = []
|
||||
const axisMap = chart.xAxis.reduce((pre, cur) => {
|
||||
pre[cur.dataeaseName] = cur
|
||||
pre[cur.gisbiName] = cur
|
||||
return pre
|
||||
}, {})
|
||||
const drillFieldMap = {}
|
||||
@ -102,17 +102,17 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
fields = fields.filter(ele => {
|
||||
return !filterFields.includes(ele.id)
|
||||
})
|
||||
drillFieldMap[curDrillField.dataeaseName] = chart.drillFields[0].dataeaseName
|
||||
drillFieldMap[curDrillField.gisbiName] = chart.drillFields[0].gisbiName
|
||||
fields.splice(drillFieldIndex, 0, curDrillField)
|
||||
}
|
||||
fields.forEach(ele => {
|
||||
const f = axisMap[ele.dataeaseName]
|
||||
const f = axisMap[ele.gisbiName]
|
||||
if (f?.hide === true) {
|
||||
return
|
||||
}
|
||||
columns.push(ele.dataeaseName)
|
||||
columns.push(ele.gisbiName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
field: ele.gisbiName,
|
||||
name: ele.chartShowName ?? ele.name,
|
||||
formatter: function (value) {
|
||||
if (!f) {
|
||||
@ -185,7 +185,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
// 自适应列宽模式下,URL 字段的宽度固定为 120
|
||||
if (basicStyle.tableColumnMode === 'adapt') {
|
||||
const urlFields = fields.filter(
|
||||
field => field.deType === 7 && !axisMap[field.dataeaseName]?.hide
|
||||
field => field.deType === 7 && !axisMap[field.gisbiName]?.hide
|
||||
)
|
||||
s2Options.style.colCfg.widthByFieldValue = urlFields?.reduce((p, n) => {
|
||||
p[n.chartShowName ?? n.name] = 120
|
||||
@ -290,8 +290,8 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
}
|
||||
// 第一次渲染初始化,把图片字段固定为 120 进行计算
|
||||
const urlFields = fields
|
||||
.filter(field => field.deType === 7 && !axisMap[field.dataeaseName]?.hide)
|
||||
.map(f => f.dataeaseName)
|
||||
.filter(field => field.deType === 7 && !axisMap[field.gisbiName]?.hide)
|
||||
.map(f => f.gisbiName)
|
||||
const totalWidthWithImg = ev.colLeafNodes.reduce((p, n) => {
|
||||
return p + (urlFields.includes(n.field) ? 120 : n.width)
|
||||
}, 0)
|
||||
@ -336,7 +336,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
const cell = newChart.getCell(ev.target)
|
||||
const meta = cell.getMeta() as ViewMeta
|
||||
const nameIdMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
pre[next['gisbiName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
@ -493,7 +493,7 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
}
|
||||
return new SummaryCell(viewMeta, viewMeta?.spreadsheet)
|
||||
}
|
||||
const field = fields.find(f => f.dataeaseName === viewMeta.valueField)
|
||||
const field = fields.find(f => f.gisbiName === viewMeta.valueField)
|
||||
if (field?.deType === 7 && chart.showPosition !== 'dialog') {
|
||||
return new ImageCell(viewMeta, viewMeta?.spreadsheet)
|
||||
}
|
||||
|
@ -93,18 +93,18 @@ export class TableNormal extends S2ChartView<TableSheet> {
|
||||
fields.splice(drillFieldIndex, 0, ...curDrillField)
|
||||
}
|
||||
const axisMap = [...chart.xAxis, ...chart.yAxis].reduce((pre, cur) => {
|
||||
pre[cur.dataeaseName] = cur
|
||||
pre[cur.gisbiName] = cur
|
||||
return pre
|
||||
}, {})
|
||||
// add drill list
|
||||
fields.forEach(ele => {
|
||||
const f = axisMap[ele.dataeaseName]
|
||||
const f = axisMap[ele.gisbiName]
|
||||
if (f?.hide === true) {
|
||||
return
|
||||
}
|
||||
columns.push(ele.dataeaseName)
|
||||
columns.push(ele.gisbiName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
field: ele.gisbiName,
|
||||
name: ele.chartShowName ?? ele.name,
|
||||
formatter: function (value) {
|
||||
if (!f) {
|
||||
@ -240,7 +240,7 @@ export class TableNormal extends S2ChartView<TableSheet> {
|
||||
const cell = newChart.getCell(ev.target)
|
||||
const meta = cell.getMeta() as ViewMeta
|
||||
const nameIdMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
pre[next['gisbiName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
|
@ -130,7 +130,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
|
||||
const { xAxisExt: columnFields, xAxis: rowFields, yAxis: valueFields } = chart
|
||||
const [c, r, v] = [columnFields, rowFields, valueFields].map(arr =>
|
||||
arr.map(i => i.dataeaseName)
|
||||
arr.map(i => i.gisbiName)
|
||||
)
|
||||
|
||||
// fields
|
||||
@ -150,14 +150,14 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
...chart.xAxisExt,
|
||||
...chart.yAxis
|
||||
].reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
fields.forEach(ele => {
|
||||
const f = valueFieldMap[ele.dataeaseName]
|
||||
columns.push(ele.dataeaseName)
|
||||
const f = valueFieldMap[ele.gisbiName]
|
||||
columns.push(ele.gisbiName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
field: ele.gisbiName,
|
||||
name: ele.chartShowName ?? ele.name,
|
||||
formatter: value => {
|
||||
if (!f) {
|
||||
@ -238,7 +238,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
sortMethod: sortField.sort.toUpperCase(),
|
||||
sortByMeasure: TOTAL_VALUE,
|
||||
query: {
|
||||
[EXTRA_FIELD]: sortField.dataeaseName
|
||||
[EXTRA_FIELD]: sortField.gisbiName
|
||||
}
|
||||
}
|
||||
sortParams.push(sort)
|
||||
@ -264,7 +264,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
if (!tableTotal.col.calcTotals.cfg?.length) {
|
||||
tableTotal.col.calcTotals.cfg = chart.yAxis.map(y => {
|
||||
return {
|
||||
dataeaseName: y.dataeaseName,
|
||||
gisbiName: y.gisbiName,
|
||||
aggregation: 'SUM'
|
||||
}
|
||||
})
|
||||
@ -278,7 +278,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
if (total.cfg?.length) {
|
||||
delete total.aggregation
|
||||
const totalCfgMap = total.cfg.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
total.calcFunc = (query, data, _, status) => {
|
||||
@ -428,7 +428,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
tableTotal.col.calcTotals?.cfg?.length
|
||||
) {
|
||||
const colTotalCfgMap = tableTotal.col.calcTotals.cfg.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
s2Options.layoutCoordinate = (_, __, col) => {
|
||||
@ -447,7 +447,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
tableTotal.row.calcTotals?.cfg?.length
|
||||
) {
|
||||
const rowTotalCfgMap = tableTotal.row.calcTotals.cfg.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {})
|
||||
// eslint-disable-next-line
|
||||
@ -630,7 +630,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
const cell = s2Instance.getCell(ev.target)
|
||||
const meta = cell.getMeta()
|
||||
const nameIdMap = chart.data.fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
pre[next['gisbiName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
const rowData = { ...meta.rowQuery, ...meta.colQuery }
|
||||
@ -658,7 +658,7 @@ export class TablePivot extends S2ChartView<PivotSheet> {
|
||||
const meta = cell.getMeta()
|
||||
const rowData = meta.query
|
||||
const nameIdMap = chart.data.fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
pre[next['gisbiName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
const dimensionList = []
|
||||
@ -1106,7 +1106,7 @@ function getCustomCalcResult(query, axisMap, chart: ChartObj, status: TotalStatu
|
||||
}
|
||||
|
||||
function getSubLevel(query, axis) {
|
||||
const fields: [] = axis.map(a => a.dataeaseName)
|
||||
const fields: [] = axis.map(a => a.gisbiName)
|
||||
let subLevel = -1
|
||||
const queryFields = keys(query)
|
||||
for (let i = fields.length - 1; i >= 0; i--) {
|
||||
@ -1123,9 +1123,9 @@ function getTreePath(query, axis) {
|
||||
const path = []
|
||||
const fields = keys(query)
|
||||
axis.forEach(a => {
|
||||
const index = fields.findIndex(f => f === a.dataeaseName)
|
||||
const index = fields.findIndex(f => f === a.gisbiName)
|
||||
if (index !== -1) {
|
||||
path.push(query[a.dataeaseName])
|
||||
path.push(query[a.gisbiName])
|
||||
}
|
||||
})
|
||||
return path
|
||||
|
@ -1334,19 +1334,19 @@ export function configL7Zoom(
|
||||
const endAxis = chart.xAxisExt
|
||||
if (startAxis?.length === 2) {
|
||||
chart.data?.tableRow?.forEach(row => {
|
||||
coordinates.push([row[startAxis[0].dataeaseName], row[startAxis[1].dataeaseName]])
|
||||
coordinates.push([row[startAxis[0].gisbiName], row[startAxis[1].gisbiName]])
|
||||
})
|
||||
}
|
||||
if (endAxis?.length === 2) {
|
||||
chart.data?.tableRow?.forEach(row => {
|
||||
coordinates.push([row[endAxis[0].dataeaseName], row[endAxis[1].dataeaseName]])
|
||||
coordinates.push([row[endAxis[0].gisbiName], row[endAxis[1].gisbiName]])
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const axis = chart.xAxis
|
||||
if (axis?.length === 2) {
|
||||
chart.data?.tableRow?.forEach(row => {
|
||||
coordinates.push([row[axis[0].dataeaseName], row[axis[1].dataeaseName]])
|
||||
coordinates.push([row[axis[0].gisbiName], row[axis[1].gisbiName]])
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -523,8 +523,8 @@ export function getStyle(chart: Chart, dataConfig: S2DataConfig): Style {
|
||||
item => item.id === chart.drillFilters[0].fieldId
|
||||
)
|
||||
const drillEnterField = xAxis[drillEnterFieldIndex]
|
||||
fieldMap[curDrillField.dataeaseName] = {
|
||||
width: fieldMap[drillEnterField.dataeaseName]?.width
|
||||
fieldMap[curDrillField.gisbiName] = {
|
||||
width: fieldMap[drillEnterField.gisbiName]?.width
|
||||
}
|
||||
}
|
||||
// 铺满
|
||||
@ -598,7 +598,7 @@ export function getCurrentField(valueFieldList: Axis[], field: ChartViewField) {
|
||||
if (list) {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const f = list[i]
|
||||
if (field.dataeaseName === f.dataeaseName) {
|
||||
if (field.gisbiName === f.gisbiName) {
|
||||
res = f
|
||||
break
|
||||
}
|
||||
@ -619,7 +619,7 @@ export function getConditions(chart: Chart) {
|
||||
}
|
||||
const conditions = threshold.tableThreshold ?? []
|
||||
|
||||
const dimFields = [...chart.xAxis, ...chart.xAxisExt].map(i => i.dataeaseName)
|
||||
const dimFields = [...chart.xAxis, ...chart.xAxisExt].map(i => i.gisbiName)
|
||||
if (conditions?.length > 0) {
|
||||
const { tableCell, basicStyle, tableHeader } = parseJson(chart.customAttr)
|
||||
// 合并单元格时斑马纹失效
|
||||
@ -645,12 +645,12 @@ export function getConditions(chart: Chart) {
|
||||
let defaultValueColor = valueColor
|
||||
let defaultBgColor = valueBgColor
|
||||
// 透视表表头颜色配置
|
||||
if (chart.type === 'table-pivot' && dimFields.includes(field.field.dataeaseName)) {
|
||||
if (chart.type === 'table-pivot' && dimFields.includes(field.field.gisbiName)) {
|
||||
defaultValueColor = headerValueColor
|
||||
defaultBgColor = headerValueBgColor
|
||||
}
|
||||
res.text.push({
|
||||
field: field.field.dataeaseName,
|
||||
field: field.field.gisbiName,
|
||||
mapping(value, rowData) {
|
||||
// 总计小计
|
||||
if (rowData?.isTotals) {
|
||||
@ -666,7 +666,7 @@ export function getConditions(chart: Chart) {
|
||||
}
|
||||
})
|
||||
res.background.push({
|
||||
field: field.field.dataeaseName,
|
||||
field: field.field.gisbiName,
|
||||
mapping(value, rowData) {
|
||||
if (rowData?.isTotals) {
|
||||
return null
|
||||
@ -864,7 +864,7 @@ function getFieldValueMap(view) {
|
||||
|
||||
function getValue(field, filedValueMap, rowData) {
|
||||
if (field.summary === 'value') {
|
||||
return rowData ? rowData[field.field?.dataeaseName] : undefined
|
||||
return rowData ? rowData[field.field?.gisbiName] : undefined
|
||||
} else {
|
||||
return filedValueMap[field.summary + '-' + field.fieldId]
|
||||
}
|
||||
@ -1844,7 +1844,7 @@ export function configMergeCells(chart: Chart, options: S2Options, dataConfig: S
|
||||
const fields = chart.data.fields || []
|
||||
const fieldsMap =
|
||||
fields.reduce((p, n) => {
|
||||
p[n.dataeaseName] = n
|
||||
p[n.gisbiName] = n
|
||||
return p
|
||||
}, {}) || {}
|
||||
const quotaIndex = dataConfig.meta.findIndex(m => fieldsMap[m.field]?.groupType === 'q')
|
||||
@ -2201,7 +2201,7 @@ const getWrapTextHeight = (wrapText, textStyle, spreadsheet, maxLines) => {
|
||||
export function getSummaryRow(data, axis, sumCon = []) {
|
||||
const summaryObj = { SUMMARY: true }
|
||||
for (let i = 0; i < axis.length; i++) {
|
||||
const a = axis[i].dataeaseName
|
||||
const a = axis[i].gisbiName
|
||||
let savedAxis = find(sumCon, s => s.field === a)
|
||||
if (savedAxis) {
|
||||
if (savedAxis.summary == undefined) {
|
||||
|
@ -514,7 +514,7 @@ const getExcelDownloadRequest = (data, type?) => {
|
||||
const tableRow = JSON.parse(JSON.stringify(data.tableRow))
|
||||
const excelHeader = fields.map(item => item.chartShowName ?? item.name)
|
||||
const excelTypes = fields.map(item => item.deType)
|
||||
const excelHeaderKeys = fields.map(item => item.dataeaseName)
|
||||
const excelHeaderKeys = fields.map(item => item.gisbiName)
|
||||
let excelData = tableRow.map(item => excelHeaderKeys.map(i => item[i]))
|
||||
let detailFields = []
|
||||
if (data.detailFields?.length) {
|
||||
@ -522,7 +522,7 @@ const getExcelDownloadRequest = (data, type?) => {
|
||||
return {
|
||||
name: item.name,
|
||||
deType: item.deType,
|
||||
dataeaseName: item.dataeaseName
|
||||
gisbiName: item.gisbiName
|
||||
}
|
||||
})
|
||||
excelData = tableRow.map(item => {
|
||||
@ -530,7 +530,7 @@ const getExcelDownloadRequest = (data, type?) => {
|
||||
if (i === 'detail' && !item[i] && Array.isArray(item['details'])) {
|
||||
const arr = item['details']
|
||||
if (arr?.length) {
|
||||
return arr.map(ele => detailFields.map(field => ele[field.dataeaseName]))
|
||||
return arr.map(ele => detailFields.map(field => ele[field.gisbiName]))
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export interface CalcFieldType {
|
||||
datasetGroupId?: string // 有就传,没有null
|
||||
originName: string // 物理字段名
|
||||
name: string // 字段显示名
|
||||
dataeaseName?: string // 字段别名
|
||||
gisbiName?: string // 字段别名
|
||||
groupType: 'd' | 'q' // d=维度,q=指标
|
||||
type: string
|
||||
params?: Array<{ id: string; name: string; value: number }>
|
||||
|
@ -77,7 +77,7 @@ interface DragEvent extends MouseEvent {
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
@ -462,7 +462,7 @@ const copyField = item => {
|
||||
param.extField = 2
|
||||
param.originName = item.extField === 2 ? item.originName : '[' + item.id + ']'
|
||||
param.name = getFieldName(dimensions.value.concat(quota.value), item.name)
|
||||
param.dataeaseName = null
|
||||
param.gisbiName = null
|
||||
param.lastSyncTime = null
|
||||
const index = allfields.value.findIndex(ele => ele.id === item.id)
|
||||
allfields.value.splice(index + 1, 0, param)
|
||||
@ -657,9 +657,9 @@ const confirmEditCalc = () => {
|
||||
|
||||
const generateColumns = (arr: Field[]) =>
|
||||
arr.map(ele => ({
|
||||
key: ele.dataeaseName,
|
||||
key: ele.gisbiName,
|
||||
deType: ele.deType,
|
||||
dataKey: ele.dataeaseName,
|
||||
dataKey: ele.gisbiName,
|
||||
title: ele.name,
|
||||
width: 150,
|
||||
headerCellRenderer: ({ column }) => (
|
||||
|
@ -89,7 +89,7 @@ const { wsCache } = useCache()
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
@ -269,9 +269,9 @@ const { handleDrop, allowDrop, handleDragStart } = treeDraggble(
|
||||
|
||||
const generateColumns = (arr: Field[]) =>
|
||||
arr.map(ele => ({
|
||||
key: ele.dataeaseName,
|
||||
key: ele.gisbiName,
|
||||
deType: ele.deType,
|
||||
dataKey: ele.dataeaseName,
|
||||
dataKey: ele.gisbiName,
|
||||
title: ele.name,
|
||||
width: 150,
|
||||
headerCellRenderer: ({ column }) => (
|
||||
|
@ -97,7 +97,7 @@ const interactiveStore = interactiveStoreWithOut()
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export interface CalcFieldType {
|
||||
datasetGroupId?: string // 有就传,没有null
|
||||
originName: string // 物理字段名
|
||||
name: string // 字段显示名
|
||||
dataeaseName?: string // 字段别名
|
||||
gisbiName?: string // 字段别名
|
||||
groupType: 'd' | 'q' // d=维度,q=指标
|
||||
type: string
|
||||
params?: Array<{ id: string; name: string; value: number }>
|
||||
|
@ -77,7 +77,7 @@ interface DragEvent extends MouseEvent {
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
@ -466,7 +466,7 @@ const copyField = item => {
|
||||
param.extField = 2
|
||||
param.originName = item.extField === 2 ? item.originName : '[' + item.id + ']'
|
||||
param.name = getFieldName(dimensions.value.concat(quota.value), item.name)
|
||||
param.dataeaseName = null
|
||||
param.gisbiName = null
|
||||
param.lastSyncTime = null
|
||||
const index = allfields.value.findIndex(ele => ele.id === item.id)
|
||||
allfields.value.splice(index + 1, 0, param)
|
||||
@ -661,9 +661,9 @@ const confirmEditCalc = () => {
|
||||
|
||||
const generateColumns = (arr: Field[]) =>
|
||||
arr.map(ele => ({
|
||||
key: ele.dataeaseName,
|
||||
key: ele.gisbiName,
|
||||
deType: ele.deType,
|
||||
dataKey: ele.dataeaseName,
|
||||
dataKey: ele.gisbiName,
|
||||
title: ele.name,
|
||||
width: 150,
|
||||
headerCellRenderer: ({ column }) => (
|
||||
|
@ -6,19 +6,11 @@ import icon_intoItem_outlined from '@/assets/svg/icon_into-item_outlined.svg'
|
||||
import { debounce } from 'lodash-es'
|
||||
import Header from '../header.vue'
|
||||
import icon_rename_outlined from '@/assets/svg/icon_rename_outlined.svg'
|
||||
import dvNewFolder from '@/assets/svg/dv-new-folder.svg'
|
||||
import icon_fileAdd_outlined from '@/assets/svg/icon_file-add_outlined.svg'
|
||||
import { moveDatasetTree } from '@/api/dataset'
|
||||
import icon_searchOutline_outlined from '@/assets/svg/icon_search-outline_outlined.svg'
|
||||
import dvSortAsc from '@/assets/svg/dv-sort-asc.svg'
|
||||
import dvSortDesc from '@/assets/svg/dv-sort-desc.svg'
|
||||
import dvFolder from '@/assets/svg/dv-folder.svg'
|
||||
import { treeDraggble } from '@/utils/treeDraggble'
|
||||
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
|
||||
import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg'
|
||||
import icon_dashboard_outlined from '@/assets/svg/icon_dashboard_outlined.svg'
|
||||
import icon_operationAnalysis_outlined from '@/assets/svg/icon_operation-analysis_outlined.svg'
|
||||
import icon_download_outlined from '@/assets/svg/icon_download_outlined.svg'
|
||||
import icon_edit_outlined from '@/assets/svg/icon_edit_outlined.svg'
|
||||
import { findApplicationById } from "@/api/application/application"
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
@ -113,7 +105,7 @@ const { wsCache } = useCache()
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
@ -291,9 +283,9 @@ const { handleDrop, allowDrop, handleDragStart } = treeDraggble(
|
||||
|
||||
const generateColumns = (arr: Field[]) =>
|
||||
arr.map(ele => ({
|
||||
key: ele.dataeaseName,
|
||||
key: ele.gisbiName,
|
||||
deType: ele.deType,
|
||||
dataKey: ele.dataeaseName,
|
||||
dataKey: ele.gisbiName,
|
||||
title: ele.name,
|
||||
width: 150,
|
||||
headerCellRenderer: ({ column }) => (
|
||||
@ -1037,12 +1029,11 @@ const proxyAllowDrop = debounce((arg1, arg2) => {
|
||||
key="structPreview"
|
||||
:columns="columns"
|
||||
v-loading="dataPreviewLoading"
|
||||
header-class="header-cell"
|
||||
:data="tableData"
|
||||
header-class="excel-header-cell"
|
||||
:width="width"
|
||||
:height="height"
|
||||
fixed
|
||||
border
|
||||
><template #empty>
|
||||
<empty-background
|
||||
:description="t('data_set.no_data')"
|
||||
@ -1055,7 +1046,6 @@ const proxyAllowDrop = debounce((arg1, arg2) => {
|
||||
<el-table
|
||||
v-loading="dataPreviewLoading"
|
||||
class="dataset-preview_table"
|
||||
header-class="header-cell"
|
||||
:data="tableData"
|
||||
@row-click="rowClick"
|
||||
key="dataPreview"
|
||||
@ -1108,9 +1098,6 @@ const proxyAllowDrop = debounce((arg1, arg2) => {
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<div v-if="activeName === 'dataPreview'" class="preview-num">
|
||||
{{ t('data_set.pieces_in_total', { msg: total }) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="mounted">
|
||||
|
@ -101,7 +101,7 @@ const interactiveStore = interactiveStoreWithOut()
|
||||
interface Field {
|
||||
fieldShortName: string
|
||||
name: string
|
||||
dataeaseName: string
|
||||
gisbiName: string
|
||||
originName: string
|
||||
deType: number
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user