forked from github/dataease
Merge branch 'dev' into pr@dev@fixrowpermissions
This commit is contained in:
commit
67c09dd069
18
.typos.toml
18
.typos.toml
@ -9,5 +9,21 @@ keynode = "keynode"
|
||||
SCHEM = "SCHEM"
|
||||
|
||||
[files]
|
||||
extend-exclude = ["public/", "amap-wx/", "m-icon/", "uni-card/", "uni-col/", "uni-link/", "uni-list/", "uni-list-item/", "uni-row/", "migration/", "mapFiles/", "frontend/src/views/chart/components/table/TableNormal.vue"]
|
||||
extend-exclude = [
|
||||
"public/",
|
||||
"amap-wx/",
|
||||
"m-icon/",
|
||||
"uni-card/",
|
||||
"uni-col/",
|
||||
"uni-link/",
|
||||
"uni-list/",
|
||||
"uni-list-item/",
|
||||
"uni-row/",
|
||||
"migration/",
|
||||
"mapFiles/",
|
||||
"core/frontend/src/views/chart/components/table/TableNormal.vue",
|
||||
"core/backend/src/main/java/io/dataease/ext/ExtSysUserMapper.xml",
|
||||
"core/backend/src/main/java/io/dataease/ext/AuthMapper.xml",
|
||||
"installer/dataease/templates/be.conf"
|
||||
]
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1220,8 +1220,8 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
if (x.getDeExtractType() == 0) {
|
||||
if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) {
|
||||
fieldName = String.format(format,
|
||||
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(DorisConstants.QUARTER, String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT)));
|
||||
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(DorisConstants.QUARTER, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT)));
|
||||
} else {
|
||||
fieldName = String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT), format);
|
||||
}
|
||||
|
@ -604,12 +604,21 @@ public class ChartViewService {
|
||||
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
|
||||
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(viewFields)) {
|
||||
viewFields.forEach(field -> {
|
||||
String[] busiFlagArray = new String[] {"daxis", "locationXaxis", "locationYaxis"};
|
||||
Map<String, Boolean> flagMap = new HashMap<>();
|
||||
for (String s : busiFlagArray) {
|
||||
flagMap.put(s, false);
|
||||
}
|
||||
for (ChartViewFieldDTO field : viewFields) {
|
||||
flagMap.put(field.getBusiType(), true);
|
||||
String busiType = field.getBusiType();
|
||||
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
|
||||
list.add(field);
|
||||
extFieldsMap.put(field.getBusiType(), list);
|
||||
});
|
||||
}
|
||||
if (flagMap.get("daxis") && (!flagMap.get("locationXaxis") || !flagMap.get("locationYaxis"))) {
|
||||
viewFields = viewFields.stream().filter(field -> !StringUtils.equals("daxis", field.getBusiType())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), tokenType);
|
||||
|
@ -35,6 +35,7 @@
|
||||
:obj="{active, chart, trackMenu, searchCount, terminalType: scaleCoefficientType}"
|
||||
:chart="chart"
|
||||
:track-menu="trackMenu"
|
||||
:in-screen="inScreen"
|
||||
:search-count="searchCount"
|
||||
:terminal-type="scaleCoefficientType"
|
||||
:scale="scale"
|
||||
@ -432,7 +433,7 @@ export default {
|
||||
const trackMenuInfo = []
|
||||
let linkageCount = 0
|
||||
let jumpCount = 0
|
||||
if(this.drillFilters.length && !this.chart.type.includes('table')){
|
||||
if (this.drillFilters.length && !this.chart.type.includes('table')) {
|
||||
const checkItem = this.drillFields[this.drillFilters.length]
|
||||
const sourceInfo = this.chart.id + '#' + checkItem.id
|
||||
if (this.nowPanelTrackInfo[sourceInfo]) {
|
||||
@ -441,7 +442,7 @@ export default {
|
||||
if (this.nowPanelJumpInfo[sourceInfo]) {
|
||||
jumpCount++
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
this.chart.data && this.chart.data.fields && this.chart.data.fields.forEach(item => {
|
||||
const sourceInfo = this.chart.id + '#' + item.id
|
||||
if (this.nowPanelTrackInfo[sourceInfo]) {
|
||||
@ -633,7 +634,7 @@ export default {
|
||||
},
|
||||
exportViewImg() {
|
||||
this.imageDownloading = true
|
||||
this.$refs['userViewDialog'].exportViewImg(()=>{
|
||||
this.$refs['userViewDialog'].exportViewImg(() => {
|
||||
this.imageDownloading = false
|
||||
})
|
||||
},
|
||||
|
@ -60,7 +60,8 @@ export default {
|
||||
values: null,
|
||||
onFocus: false,
|
||||
show: true,
|
||||
timer: null
|
||||
outTimer: null,
|
||||
innerTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -134,12 +135,7 @@ export default {
|
||||
|
||||
},
|
||||
watch: {
|
||||
canvasStyleData: {
|
||||
handler(newVal, oldVla) {
|
||||
this.canvasStyleDataInit()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
'viewIds': function(value, old) {
|
||||
if (typeof value === 'undefined' || value === old) return
|
||||
this.setCondition()
|
||||
@ -174,7 +170,9 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.loadInit()
|
||||
this.canvasStyleDataInit()
|
||||
this.$nextTick(() => {
|
||||
this.dynamicRefresh()
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
bus.$on('onScroll', this.onScroll)
|
||||
@ -183,18 +181,14 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.timer && clearInterval(this.timer)
|
||||
this.clearTime()
|
||||
bus.$off('onScroll', this.onScroll)
|
||||
bus.$off('reset-default-value', this.resetDefaultValue)
|
||||
},
|
||||
methods: {
|
||||
loadInit() {
|
||||
if (this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) {
|
||||
if (this.element.options.attrs.default) {
|
||||
const widget = ApplicationContext.getService(this.element.serviceName)
|
||||
this.values = widget.dynamicDateFormNow(this.element)
|
||||
this.dateChange(this.values)
|
||||
}
|
||||
this.clearTime()
|
||||
if (this.refreshHandler()) {
|
||||
return
|
||||
}
|
||||
if (this.element.options.value) {
|
||||
@ -202,22 +196,42 @@ export default {
|
||||
this.dateChange(this.values)
|
||||
}
|
||||
},
|
||||
canvasStyleDataInit() {
|
||||
if (this.inDraw && this.canvasStyleData.refreshViewEnable && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) {
|
||||
this.searchCount = 0
|
||||
this.timer && clearInterval(this.timer)
|
||||
let refreshTime = 300000
|
||||
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) {
|
||||
if (this.canvasStyleData.refreshUnit === 'second') {
|
||||
refreshTime = this.canvasStyleData.refreshTime * 1000
|
||||
} else {
|
||||
refreshTime = this.canvasStyleData.refreshTime * 60000
|
||||
refreshHandler() {
|
||||
if (this.element.options.attrs.default?.isDynamic) {
|
||||
const widget = ApplicationContext.getService(this.element.serviceName)
|
||||
this.values = widget.dynamicDateFormNow(this.element)
|
||||
this.dateChange(this.values)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
clearTime() {
|
||||
if (this.outTimer) {
|
||||
clearTimeout(this.outTimer)
|
||||
this.outTimer = null
|
||||
}
|
||||
if (this.innerTimer) {
|
||||
clearInterval(this.innerTimer)
|
||||
this.innerTimer = null
|
||||
}
|
||||
},
|
||||
dynamicRefresh() {
|
||||
if (this.inDraw && this.element.options.attrs.default?.isDynamic) {
|
||||
const nowDate = new Date()
|
||||
const nowTime = nowDate.getTime()
|
||||
const tomorrow = new Date(`${nowDate.getFullYear()}-${nowDate.getMonth() + 1}-${nowDate.getDate() + 1} 00:00:01`)
|
||||
const tomorrowTime = tomorrow.getTime()
|
||||
this.clearTime()
|
||||
this.outTimer = setTimeout(() => {
|
||||
if (this.inDraw) {
|
||||
this.refreshHandler()
|
||||
}
|
||||
}
|
||||
this.timer = setInterval(() => {
|
||||
this.loadInit()
|
||||
this.searchCount++
|
||||
}, refreshTime)
|
||||
this.innerTimer = setInterval(() => {
|
||||
if (this.inDraw) {
|
||||
this.refreshHandler()
|
||||
}
|
||||
}, 24 * 3600 * 1000)
|
||||
}, tomorrowTime - nowTime)
|
||||
}
|
||||
},
|
||||
clearHandler() {
|
||||
|
@ -1489,6 +1489,8 @@ export default {
|
||||
label_content: 'Label Content',
|
||||
percent: 'Percent',
|
||||
table_index_desc: 'Index Header Name',
|
||||
table_row_tooltip: 'Row Tooltip',
|
||||
table_col_tooltip: 'Column Tooltip',
|
||||
total_sort: 'Total Sort',
|
||||
total_sort_none: 'None',
|
||||
total_sort_asc: 'ASC',
|
||||
|
@ -1488,6 +1488,8 @@ export default {
|
||||
label_content: '標籤展示',
|
||||
percent: '占比',
|
||||
table_index_desc: '表頭名稱',
|
||||
table_row_tooltip: '行頭提示',
|
||||
table_col_tooltip: '列頭提示',
|
||||
total_sort: '總計排序',
|
||||
total_sort_none: '無',
|
||||
total_sort_asc: '升序',
|
||||
|
@ -1487,6 +1487,8 @@ export default {
|
||||
label_content: '标签展示',
|
||||
percent: '占比',
|
||||
table_index_desc: '表头名称',
|
||||
table_row_tooltip: '行头提示',
|
||||
table_col_tooltip: '列头提示',
|
||||
total_sort: '总计排序',
|
||||
total_sort_none: '无',
|
||||
total_sort_asc: '升序',
|
||||
|
@ -40,6 +40,7 @@ import VueFriendlyIframe from 'vue-friendly-iframe'
|
||||
import vueToPdf from 'vue-to-pdf'
|
||||
import VueVideoPlayer from 'vue-video-player'
|
||||
import 'video.js/dist/video-js.css'
|
||||
import '@antv/s2/dist/style.min.css'
|
||||
// 控制标签宽高成比例的指令
|
||||
import proportion from 'vue-proportion-directive'
|
||||
|
||||
|
@ -45,6 +45,16 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
|
||||
yAxis: yAxis,
|
||||
slider: slider,
|
||||
annotations: analyse,
|
||||
brush: {
|
||||
enabled: true,
|
||||
isStartEnable: (context) => {
|
||||
// 按住 shift 键,才能开启交互
|
||||
if (context.event.gEvent.originalEvent?.shiftKey) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active', cfg: {
|
||||
@ -162,6 +172,16 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
||||
yAxis: yAxis,
|
||||
slider: slider,
|
||||
annotations: analyse,
|
||||
brush: {
|
||||
enabled: true,
|
||||
isStartEnable: (context) => {
|
||||
// 按住 shift 键,才能开启交互
|
||||
if (context.event.gEvent.originalEvent?.shiftKey) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
interactions: [
|
||||
{
|
||||
type: 'legend-active', cfg: {
|
||||
|
@ -86,6 +86,12 @@ export const DEFAULT_SIZE = {
|
||||
tableHeaderAlign: 'left',
|
||||
tableItemAlign: 'right',
|
||||
tableAutoBreakLine: false,
|
||||
tableRowTooltip: {
|
||||
show: false
|
||||
},
|
||||
tableColTooltip: {
|
||||
show: false
|
||||
},
|
||||
gaugeMinType: 'fix', // fix or dynamic
|
||||
gaugeMinField: {
|
||||
id: '',
|
||||
|
@ -593,9 +593,11 @@ export function getXAxis(chart) {
|
||||
stroke: axisCfg.lineStyle.color
|
||||
}
|
||||
} : null
|
||||
const rotate = parseInt(a.axisLabel.rotate)
|
||||
const label = a.axisLabel.show ? {
|
||||
rotate: parseInt(a.axisLabel.rotate) * Math.PI / 180,
|
||||
rotate: rotate * Math.PI / 180,
|
||||
style: {
|
||||
textAlign: rotate > 20 ? 'start' : rotate < -20 ? 'end' : 'center',
|
||||
fill: a.axisLabel.color,
|
||||
fontSize: parseInt(a.axisLabel.fontSize)
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { TableSheet, S2Event, PivotSheet, DataCell, EXTRA_FIELD, TOTAL_VALUE } from '@antv/s2'
|
||||
import { TableSheet, S2Event, PivotSheet, DataCell, EXTRA_FIELD, TOTAL_VALUE, BaseEvent } from '@antv/s2'
|
||||
import { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table'
|
||||
import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter'
|
||||
@ -7,7 +7,7 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
const containerDom = document.getElementById(container)
|
||||
|
||||
// fields
|
||||
const fields = chart.data.fields
|
||||
let fields = chart.data.fields
|
||||
if (!fields || fields.length === 0) {
|
||||
if (s2) {
|
||||
s2.destroy()
|
||||
@ -17,8 +17,17 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
|
||||
const columns = []
|
||||
const meta = []
|
||||
|
||||
// add drill list
|
||||
// 记录下钻起始字段的index
|
||||
let xAxis = []
|
||||
try {
|
||||
xAxis = JSON.parse(chart.xaxis)
|
||||
} catch (err) {
|
||||
xAxis = JSON.parse(JSON.stringify(chart.xaxis))
|
||||
}
|
||||
const nameMap = xAxis.reduce((pre, next) => {
|
||||
pre[next.dataeaseName] = next
|
||||
return pre
|
||||
}, {})
|
||||
if (chart.drill) {
|
||||
let drillFields = []
|
||||
try {
|
||||
@ -26,107 +35,44 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
} catch (err) {
|
||||
drillFields = JSON.parse(JSON.stringify(chart.drillFields))
|
||||
}
|
||||
|
||||
const drillField = drillFields[chart.drillFilters.length]
|
||||
|
||||
const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters))
|
||||
const drillExp = drillFilters[drillFilters.length - 1].datasetTableField
|
||||
|
||||
// 记录下钻起始字段的index
|
||||
let xAxis = []
|
||||
try {
|
||||
xAxis = JSON.parse(chart.xaxis)
|
||||
} catch (err) {
|
||||
xAxis = JSON.parse(JSON.stringify(chart.xaxis))
|
||||
}
|
||||
let index = 0
|
||||
for (let i = 0; i < xAxis.length; i++) {
|
||||
if (xAxis[i].id === drillFilters[0].fieldId) {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// 移除所有下钻字段
|
||||
const removeField = []
|
||||
for (let i = 0; i < chart.drillFilters.length; i++) {
|
||||
const ele = chart.drillFilters[i].datasetTableField
|
||||
removeField.push(ele.dataeaseName)
|
||||
}
|
||||
|
||||
// build field
|
||||
fields.forEach(ele => {
|
||||
if (removeField.indexOf(ele.dataeaseName) < 0) {
|
||||
// 用下钻字段替换当前字段
|
||||
if (drillExp.dataeaseName === ele.dataeaseName) {
|
||||
columns.push(drillField.dataeaseName)
|
||||
meta.push({
|
||||
field: drillField.dataeaseName,
|
||||
name: drillField.name
|
||||
})
|
||||
} else {
|
||||
const f = getCurrentField(chart.xaxis, ele)
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 修正下钻字段的index,获取下钻位置元素添加到index位置,并删除
|
||||
const ele = columns[columns.length - 1]
|
||||
columns.splice(index, 0, ele)
|
||||
columns.splice(columns.length - 1, 1)
|
||||
} else {
|
||||
fields.forEach(ele => {
|
||||
const f = getCurrentField(chart.xaxis, ele)
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
// 总下钻过滤字段
|
||||
const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters)).map(i => i.fieldId)
|
||||
// 当前下钻字段
|
||||
const curDrillField = drillFields[chart.drillFilters.length]
|
||||
drillFilters.push(curDrillField.id)
|
||||
// 下钻入口字段的下标
|
||||
const drillEnterFieldIndex = xAxis.findIndex(item => item.id === drillFilters[0])
|
||||
// 移除所有下钻字段,调整当前下钻字段到下钻入口位置
|
||||
fields = fields.filter(item => !drillFilters.includes(item.id))
|
||||
fields.splice(drillEnterFieldIndex, 0, curDrillField)
|
||||
}
|
||||
fields.forEach(ele => {
|
||||
const f = nameMap[ele.dataeaseName]
|
||||
columns.push(ele.dataeaseName)
|
||||
meta.push({
|
||||
field: ele.dataeaseName,
|
||||
name: ele.name,
|
||||
formatter: function(value) {
|
||||
if (!f) {
|
||||
return value
|
||||
}
|
||||
if (value === null || value === undefined) {
|
||||
return value
|
||||
}
|
||||
if (f.groupType === 'd') {
|
||||
return value
|
||||
} else {
|
||||
if (f.formatterCfg) {
|
||||
const v = valueFormatter(value, f.formatterCfg)
|
||||
return v.includes('NaN') ? value : v
|
||||
} else {
|
||||
const v = valueFormatter(value, formatterItem)
|
||||
return v.includes('NaN') ? value : v
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
// 空值处理
|
||||
const newData = handleTableEmptyStrategy(tableData, chart)
|
||||
// data config
|
||||
@ -174,6 +120,11 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
|
||||
// click
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
// hover
|
||||
const size = customAttr.size
|
||||
if (size.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
@ -342,7 +293,11 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
|
||||
// click
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
|
||||
// hover
|
||||
const size = customAttr.size
|
||||
if (size.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
@ -455,8 +410,8 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
|
||||
// total config
|
||||
let totalCfg = {}
|
||||
const chartObj = JSON.parse(JSON.stringify(chart))
|
||||
let customAttr
|
||||
if (chartObj.customAttr) {
|
||||
let customAttr = null
|
||||
if (Object.prototype.toString.call(chartObj.customAttr) === '[object Object]') {
|
||||
customAttr = JSON.parse(JSON.stringify(chartObj.customAttr))
|
||||
} else {
|
||||
@ -528,7 +483,14 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
|
||||
s2.on(S2Event.DATA_CELL_CLICK, action)
|
||||
s2.on(S2Event.ROW_CELL_CLICK, headerAction)
|
||||
s2.on(S2Event.COL_CELL_CLICK, headerAction)
|
||||
|
||||
// hover
|
||||
const size = customAttr?.size
|
||||
if (size?.tableRowTooltip?.show) {
|
||||
s2.on(S2Event.ROW_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
if (size?.tableColTooltip?.show) {
|
||||
s2.on(S2Event.COL_CELL_HOVER, event => showTooltip(s2, event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
@ -740,3 +702,16 @@ function mappingColor(value, defaultColor, field, type) {
|
||||
}
|
||||
return color
|
||||
}
|
||||
|
||||
function showTooltip(s2Instance, event) {
|
||||
const cell = s2Instance.getCell(event.target)
|
||||
const content = cell.actualText
|
||||
|
||||
s2Instance.showTooltip({
|
||||
position: {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
},
|
||||
content
|
||||
})
|
||||
}
|
||||
|
@ -62,7 +62,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -111,7 +112,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -157,7 +159,9 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemAlign',
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnMode'
|
||||
'tableColumnMode',
|
||||
'tableRowTooltip',
|
||||
'tableColTooltip'
|
||||
],
|
||||
'total-cfg': [
|
||||
'row',
|
||||
|
@ -189,13 +189,19 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
bus.$on('change-series-id', this.changeSeriesId)
|
||||
document.getElementById(this.chartId).addEventListener('mouseover', this.bodyMouseover)
|
||||
document.getElementById(this.chartId).addEventListener('mouseout', this.bodyMouseout)
|
||||
const dom = document.getElementById(this.chartId)
|
||||
if (dom) {
|
||||
dom.addEventListener('mouseover', this.bodyMouseover)
|
||||
dom.addEventListener('mouseout', this.bodyMouseout)
|
||||
}
|
||||
this.preDraw()
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.getElementById(this.chartId).removeEventListener('mouseover', this.bodyMouseover)
|
||||
document.getElementById(this.chartId).removeEventListener('mouseout', this.bodyMouseout)
|
||||
const dom = document.getElementById(this.chartId)
|
||||
if (dom) {
|
||||
dom.removeEventListener('mouseover', this.bodyMouseover)
|
||||
dom.removeEventListener('mouseout', this.bodyMouseout)
|
||||
}
|
||||
bus.$off('change-series-id', this.changeSeriesId)
|
||||
window.removeEventListener('resize', this.myChart.resize)
|
||||
this.myChart.dispose()
|
||||
|
@ -614,3 +614,8 @@ export default {
|
||||
background: transparent !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.antv-s2-tooltip-container {
|
||||
padding: 4px 2px;
|
||||
}
|
||||
</style>
|
||||
|
@ -384,6 +384,28 @@
|
||||
@blur="changeBarSizeCase('indexLabel')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableRowTooltip')"
|
||||
label-width="100px"
|
||||
:label="$t('chart.table_row_tooltip')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.tableRowTooltip.show"
|
||||
@change="changeBarSizeCase('tableRowTooltip')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableColTooltip')"
|
||||
label-width="100px"
|
||||
:label="$t('chart.table_col_tooltip')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.tableColTooltip.show"
|
||||
@change="changeBarSizeCase('tableColTooltip')"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<!--chart-mix-start-->
|
||||
<span v-show="showProperty('mix')">
|
||||
@ -893,6 +915,54 @@
|
||||
@change="changeBarSizeCase('quotaFontShadow')"
|
||||
>{{ $t('chart.font_shadow') }}</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('hPosition')"
|
||||
:label="$t('chart.h_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.hPosition"
|
||||
:placeholder="$t('chart.h_position')"
|
||||
@change="changeBarSizeCase('hPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_left')"
|
||||
>{{ $t('chart.p_left') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_right')"
|
||||
>{{ $t('chart.p_right') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('vPosition')"
|
||||
:label="$t('chart.v_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.vPosition"
|
||||
:placeholder="$t('chart.v_position')"
|
||||
@change="changeBarSizeCase('vPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_top')"
|
||||
>{{ $t('chart.p_top') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_bottom')"
|
||||
>{{ $t('chart.p_bottom') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-divider v-if="showProperty('dimensionShow')" />
|
||||
<el-form-item
|
||||
v-show="showProperty('dimensionShow')"
|
||||
@ -983,7 +1053,6 @@
|
||||
@change="changeBarSizeCase('dimensionFontShadow')"
|
||||
>{{ $t('chart.font_shadow') }}</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-divider v-if="showProperty('spaceSplit')" />
|
||||
<el-form-item
|
||||
v-show="showProperty('spaceSplit')"
|
||||
:label="$t('chart.space_split')"
|
||||
@ -996,54 +1065,6 @@
|
||||
@change="changeBarSizeCase('spaceSplit')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('hPosition')"
|
||||
:label="$t('chart.h_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.hPosition"
|
||||
:placeholder="$t('chart.h_position')"
|
||||
@change="changeBarSizeCase('hPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_left')"
|
||||
>{{ $t('chart.p_left') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_right')"
|
||||
>{{ $t('chart.p_right') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('vPosition')"
|
||||
:label="$t('chart.v_position')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-select
|
||||
v-model="sizeForm.vPosition"
|
||||
:placeholder="$t('chart.v_position')"
|
||||
@change="changeBarSizeCase('vPosition')"
|
||||
>
|
||||
<el-option
|
||||
value="start"
|
||||
:label="$t('chart.p_top')"
|
||||
>{{ $t('chart.p_top') }}</el-option>
|
||||
<el-option
|
||||
value="center"
|
||||
:label="$t('chart.p_center')"
|
||||
>{{ $t('chart.p_center') }}</el-option>
|
||||
<el-option
|
||||
value="end"
|
||||
:label="$t('chart.p_bottom')"
|
||||
>{{ $t('chart.p_bottom') }}</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!--text&label-end-->
|
||||
<!--scatter-begin-->
|
||||
@ -1565,6 +1586,8 @@ export default {
|
||||
|
||||
this.sizeForm.tableHeaderAlign = this.sizeForm.tableHeaderAlign ? this.sizeForm.tableHeaderAlign : DEFAULT_SIZE.tableHeaderAlign
|
||||
this.sizeForm.tableItemAlign = this.sizeForm.tableItemAlign ? this.sizeForm.tableItemAlign : DEFAULT_SIZE.tableItemAlign
|
||||
this.sizeForm.tableRowTooltip = this.sizeForm.tableRowTooltip ?? DEFAULT_SIZE.tableRowTooltip
|
||||
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
|
||||
|
||||
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
||||
if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
@click="add('group')"
|
||||
/>
|
||||
</el-row>
|
||||
<el-divider/>
|
||||
<el-divider />
|
||||
<el-row style="margin-bottom: 10px">
|
||||
<el-col :span="16">
|
||||
<el-input
|
||||
@ -31,7 +31,7 @@
|
||||
size="mini"
|
||||
type="primary"
|
||||
>
|
||||
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right"/>
|
||||
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="searchTypeClick('all')">{{ $t('commons.all') }}</el-dropdown-item>
|
||||
@ -63,7 +63,7 @@
|
||||
>
|
||||
<span style="display: flex;flex: 1;width: 0;">
|
||||
<span>
|
||||
<i class="el-icon-folder"/>
|
||||
<i class="el-icon-folder" />
|
||||
</span>
|
||||
<span
|
||||
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
|
||||
@ -152,7 +152,7 @@
|
||||
class="custom-tree-node-list father"
|
||||
>
|
||||
<span style="display: flex;flex: 1;width: 0;">
|
||||
<span><svg-icon :icon-class="data.modelInnerType"/></span>
|
||||
<span><svg-icon :icon-class="data.modelInnerType" /></span>
|
||||
<span
|
||||
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
|
||||
:title="data.name"
|
||||
@ -225,7 +225,7 @@
|
||||
:label="$t('commons.name')"
|
||||
prop="name"
|
||||
>
|
||||
<el-input v-model="groupForm.name"/>
|
||||
<el-input v-model="groupForm.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div
|
||||
@ -266,7 +266,7 @@
|
||||
:label="$t('commons.name')"
|
||||
prop="name"
|
||||
>
|
||||
<el-input v-model="tableForm.name"/>
|
||||
<el-input v-model="tableForm.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div
|
||||
@ -322,8 +322,8 @@
|
||||
:active="createActive"
|
||||
align-center
|
||||
>
|
||||
<el-step :title="$t('chart.select_dataset')"/>
|
||||
<el-step :title="$t('chart.select_chart_type')"/>
|
||||
<el-step :title="$t('chart.select_dataset')" />
|
||||
<el-step :title="$t('chart.select_chart_type')" />
|
||||
</el-steps>
|
||||
|
||||
<table-selector
|
||||
@ -397,8 +397,8 @@
|
||||
size="mini"
|
||||
@click="createPreview"
|
||||
>{{
|
||||
$t('chart.preview')
|
||||
}}
|
||||
$t('chart.preview')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="createActive === 1"
|
||||
@ -447,8 +447,8 @@
|
||||
size="mini"
|
||||
@click="saveMoveGroup(tGroup)"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -481,8 +481,8 @@
|
||||
size="mini"
|
||||
@click="saveMoveDs(tDs)"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -630,6 +630,10 @@ export default {
|
||||
},
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
},
|
||||
watchChartTypeChangeObj() {
|
||||
const { type, render } = this.view
|
||||
return { type, render }
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -649,8 +653,14 @@ export default {
|
||||
this.searchPids = []
|
||||
this.$refs.chartTreeRef.filter(this.filterText)
|
||||
},
|
||||
chartType(val) {
|
||||
this.view.isPlugin = val && this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(val)
|
||||
// chartType(val) {
|
||||
// this.view.isPlugin = val && this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(val)
|
||||
// },
|
||||
watchChartTypeChangeObj(newVal, oldVal) {
|
||||
if (newVal.type === oldVal.type && newVal.render === oldVal.render) {
|
||||
return
|
||||
}
|
||||
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal.type, newVal.render)
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -924,6 +924,7 @@
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:chart="chart"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
@onItemChange="bubbleItemChange"
|
||||
@ -1323,8 +1324,8 @@
|
||||
ref="itemForm"
|
||||
label-width="80px"
|
||||
:model="itemForm"
|
||||
@submit.native.prevent
|
||||
:rules="itemFormRules"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('dataset.field_origin_name')"
|
||||
@ -1734,7 +1735,6 @@ import QuotaFilterEditor from '../components/filter/QuotaFilterEditor'
|
||||
import DimensionFilterEditor from '../components/filter/DimensionFilterEditor'
|
||||
import TableNormal from '../components/table/TableNormal'
|
||||
import LabelNormal from '../components/normal/LabelNormal'
|
||||
// import html2canvas from 'html2canvasde'
|
||||
import TableSelector from './TableSelector'
|
||||
import FieldEdit from '../../dataset/data/FieldEdit'
|
||||
import { areaMapping } from '@/api/map/map'
|
||||
@ -1996,6 +1996,10 @@ export default {
|
||||
!equalsAny(this.view.type, 'liquid', 'bidirectional-bar',
|
||||
'word-cloud', 'table-pivot', 'label', 'richTextView', 'flow-map')
|
||||
},
|
||||
watchChartTypeChangeObj() {
|
||||
const { type, render } = this.view
|
||||
return { type, render }
|
||||
},
|
||||
...mapState([
|
||||
'curComponent',
|
||||
'panelViewEditInfo',
|
||||
@ -2016,7 +2020,7 @@ export default {
|
||||
},
|
||||
'param': function(val) {
|
||||
if (this.param.optType === 'new') {
|
||||
//
|
||||
// Do Nothing
|
||||
} else if (this.param.id !== this.preChartId && this.editStatus) {
|
||||
this.preChartId = this.param.id
|
||||
this.chartInit()
|
||||
@ -2031,8 +2035,14 @@ export default {
|
||||
}
|
||||
this.$emit('typeChange', newVal)
|
||||
},
|
||||
'view.type': function(newVal, oldVal) {
|
||||
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal)
|
||||
watchChartTypeChangeObj(newVal, oldVal) {
|
||||
if (newVal.type === oldVal.type && newVal.render === oldVal.render) {
|
||||
return
|
||||
}
|
||||
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal.type, newVal.render)
|
||||
|
||||
this.setChartDefaultOptions()
|
||||
this.calcData(true, 'chart', true, newVal.type !== oldVal.type, newVal.render !== oldVal.render)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -2124,9 +2134,6 @@ export default {
|
||||
this.resetDrill()
|
||||
this.initFromPanel()
|
||||
this.getChart(this.param.id)
|
||||
// if (this.componentViewsData[this.param.id]) {
|
||||
// this.chart = this.componentViewsData[this.param.id]
|
||||
// }
|
||||
},
|
||||
bindPluginEvent() {
|
||||
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
|
||||
@ -2257,9 +2264,6 @@ export default {
|
||||
view.xaxis = [view.xaxis[0]]
|
||||
}
|
||||
view.xaxis.forEach(function(ele) {
|
||||
// if (!ele.summary || ele.summary === '') {
|
||||
// ele.summary = 'sum'
|
||||
// }
|
||||
if (!ele.dateStyle || ele.dateStyle === '') {
|
||||
ele.dateStyle = 'y_M_d'
|
||||
}
|
||||
@ -2417,6 +2421,7 @@ export default {
|
||||
view.extBubble = JSON.stringify(view.extBubble)
|
||||
view.senior = JSON.stringify(view.senior)
|
||||
delete view.data
|
||||
|
||||
return view
|
||||
},
|
||||
refreshAttrChange() {
|
||||
@ -2435,7 +2440,6 @@ export default {
|
||||
const view = this.buildParam(true, 'chart', false, switchType, switchRender)
|
||||
if (!view) return
|
||||
viewEditSave(this.panelInfo.id, view).then(() => {
|
||||
// this.getData(this.param.id)
|
||||
this.getChart(this.param.id)
|
||||
bus.$emit('view-in-cache', {
|
||||
type: 'propChange',
|
||||
@ -2462,7 +2466,6 @@ export default {
|
||||
view.senior = JSON.stringify(this.view.senior)
|
||||
view.title = this.view.title
|
||||
view.stylePriority = this.view.stylePriority
|
||||
// view.data = this.data
|
||||
this.chart = view
|
||||
|
||||
// 保存到缓存表
|
||||
@ -2514,7 +2517,6 @@ export default {
|
||||
}
|
||||
},
|
||||
getData(id) {
|
||||
// this.hasEdit = true
|
||||
if (id) {
|
||||
ajaxGetDataOnly(id, this.panelInfo.id, {
|
||||
filter: [],
|
||||
@ -2894,12 +2896,7 @@ export default {
|
||||
},
|
||||
closeRename() {
|
||||
this.renameItem = false
|
||||
this.resetRename()
|
||||
},
|
||||
resetRename() {
|
||||
// this.itemForm = {}
|
||||
},
|
||||
|
||||
showQuotaEditCompare(item) {
|
||||
this.quotaItemCompare = JSON.parse(JSON.stringify(item))
|
||||
this.showEditQuotaCompare = true
|
||||
@ -3107,14 +3104,8 @@ export default {
|
||||
},
|
||||
|
||||
initAreas() {
|
||||
// let mapping
|
||||
// if ((mapping = localStorage.getItem('areaMapping')) !== null) {
|
||||
// this.places = JSON.parse(mapping)
|
||||
// return
|
||||
// }
|
||||
Object.keys(this.places).length === 0 && areaMapping().then(res => {
|
||||
this.places = res.data
|
||||
// localStorage.setItem('areaMapping', JSON.stringify(res.data))
|
||||
})
|
||||
},
|
||||
|
||||
@ -3182,16 +3173,13 @@ export default {
|
||||
|
||||
chartClick(param) {
|
||||
if (this.drillClickDimensionList.length < this.view.drillFields.length - 1) {
|
||||
// const isSwitch = (this.chart.type === 'map' && this.sendToChildren(param))
|
||||
if (this.chart.type === 'map' || this.chart.type === 'buddle-map') {
|
||||
if (this.sendToChildren(param)) {
|
||||
this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
|
||||
// this.getData(this.param.id)
|
||||
this.calcData(true, 'chart', false, false)
|
||||
}
|
||||
} else {
|
||||
this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
|
||||
// this.getData(this.param.id)
|
||||
this.calcData(true, 'chart', false, false)
|
||||
}
|
||||
} else if (this.view.drillFields.length > 0) {
|
||||
@ -3219,7 +3207,6 @@ export default {
|
||||
} else {
|
||||
current && current.registerDynamicMap && current.registerDynamicMap(null)
|
||||
}
|
||||
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(null)
|
||||
}
|
||||
},
|
||||
drillJump(index) {
|
||||
@ -3228,8 +3215,6 @@ export default {
|
||||
if (this.chart.type === 'map' || this.chart.type === 'buddle-map') {
|
||||
this.backToParent(index, length)
|
||||
}
|
||||
|
||||
// this.getData(this.param.id)
|
||||
this.calcData(true, 'chart', false, false)
|
||||
},
|
||||
// 回到父级地图
|
||||
@ -3245,7 +3230,6 @@ export default {
|
||||
}
|
||||
|
||||
this.currentAcreaNode = tempNode
|
||||
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(this.currentAcreaNode.code)
|
||||
const current = this.$refs.dynamicChart
|
||||
if (this.view.isPlugin) {
|
||||
current && current.callPluginInner && this.setDetailMapCode(this.currentAcreaNode.code) && current.callPluginInner({
|
||||
@ -3271,14 +3255,11 @@ export default {
|
||||
if (this.currentAcreaNode) {
|
||||
aCode = this.currentAcreaNode.code
|
||||
}
|
||||
// const aCode = this.currentAcreaNode ? this.currentAcreaNode.code : null
|
||||
const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places)
|
||||
if (currentNode && currentNode.children && currentNode.children.length > 0) {
|
||||
const nextNode = currentNode.children.find(item => item.name === name)
|
||||
if (!nextNode || !nextNode.code) return null
|
||||
// this.view.customAttr.areaCode = nextNode.code
|
||||
this.currentAcreaNode = nextNode
|
||||
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
|
||||
const current = this.$refs.dynamicChart
|
||||
if (this.view.isPlugin) {
|
||||
nextNode && current && current.callPluginInner && this.setDetailMapCode(nextNode.code) && current.callPluginInner({
|
||||
@ -3329,12 +3310,10 @@ export default {
|
||||
this.$store.commit('recordViewEdit', { viewId: this.param.id, hasEdit: status })
|
||||
},
|
||||
changeChartRender() {
|
||||
this.setChartDefaultOptions()
|
||||
this.calcData(true, 'chart', true, false, true)
|
||||
// Do Nothing
|
||||
},
|
||||
changeChartType() {
|
||||
this.setChartDefaultOptions()
|
||||
this.calcData(true, 'chart', true, true)
|
||||
// Do Nothing
|
||||
},
|
||||
|
||||
setChartDefaultOptions() {
|
||||
|
@ -93,9 +93,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
currentIsPlugin(type) {
|
||||
currentIsPlugin(type, render) {
|
||||
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
|
||||
return plugins.some(plugin => plugin.value === type)
|
||||
return plugins.some(plugin => plugin.value === type && plugin.render === render)
|
||||
},
|
||||
initTypes(plugins) {
|
||||
plugins.forEach(plugin => {
|
||||
|
@ -798,7 +798,7 @@ export default {
|
||||
async loadField(tableId, init) {
|
||||
const res = await fieldListWithPermission(tableId)
|
||||
let data = res.data || []
|
||||
if (init && !this.checkSuperior(data, this.anotherTableInfo(tableId))) {
|
||||
if (init && (!data.length || !this.checkSuperior(data, this.anotherTableInfo(tableId)))) {
|
||||
this.backToLink()
|
||||
}
|
||||
if (this.widget && this.widget.filterFieldMethod) {
|
||||
|
@ -155,7 +155,7 @@
|
||||
:format="element.options.attrs.accuracy"
|
||||
style="width: auto; min-width: 110px;"
|
||||
placeholder=""
|
||||
@change="eDynamicSuffixTimeChange"
|
||||
@change="sDynamicSuffixTimeChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@ -384,10 +384,22 @@ export default {
|
||||
}
|
||||
},
|
||||
eDynamicSuffixTimeChange(val) {
|
||||
const time = this.convertTime(val)
|
||||
this.$set(this.element.options.attrs.default, 'eDynamicSuffixTime', time)
|
||||
this.setDval()
|
||||
},
|
||||
sDynamicSuffixTimeChange(val) {
|
||||
const time = this.convertTime(val)
|
||||
this.$set(this.element.options.attrs.default, 'sDynamicSuffixTime', time)
|
||||
this.setDval()
|
||||
},
|
||||
convertTime(val) {
|
||||
const date = new Date(val)
|
||||
const baseDate = new Date(this.baseTime)
|
||||
date.setFullYear(baseDate.getFullYear())
|
||||
date.setMonth(baseDate.getMonth())
|
||||
date.setDate(baseDate.getDate())
|
||||
return date.getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -937,7 +937,8 @@ export default {
|
||||
top: inherit !important;
|
||||
}
|
||||
|
||||
.track-menu {
|
||||
.track-menu,
|
||||
.coustom-date-picker {
|
||||
left: inherit !important;
|
||||
}
|
||||
}
|
||||
|
@ -98,10 +98,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DimensionItem from '@/components/views/DimensionItem'
|
||||
import QuotaItem from '@/components/views/QuotaItem'
|
||||
import QuotaExtItem from '@/components/views/QuotaExtItem'
|
||||
import FilterItem from '@/components/views/FilterItem'
|
||||
import DimensionItem from '../../../components/views/DimensionItem'
|
||||
import QuotaItem from '../../../components/views/QuotaItem'
|
||||
import QuotaExtItem from '../../../components/views/QuotaExtItem'
|
||||
import FilterItem from '../../../components/views/FilterItem'
|
||||
import messages from '@/de-base/lang/messages'
|
||||
|
||||
export default {
|
||||
|
@ -9,12 +9,12 @@
|
||||
v-if="chart.type && antVRenderStatus"
|
||||
v-show="title_show"
|
||||
ref="title"
|
||||
:style="title_class"
|
||||
:style="titleClass"
|
||||
style="cursor: default;display: block;"
|
||||
>
|
||||
<div style="padding:4px 4px 0;margin: 0;">
|
||||
<chart-title-update
|
||||
:title-class="title_class"
|
||||
:title-class="titleClass"
|
||||
:chart-info="chartInfo"
|
||||
:bus="bus"
|
||||
:axios-request="axiosRequest"
|
||||
@ -33,20 +33,20 @@
|
||||
|
||||
<script>
|
||||
import {Mix} from '@antv/g2plot'
|
||||
import {uuid, hexColorToRGBA} from '@/utils/chartmix'
|
||||
import ViewTrackBar from '@/components/views/ViewTrackBar'
|
||||
import {getRemark} from "@/components/views/utils";
|
||||
import {uuid, hexColorToRGBA} from '../../../utils/chartmix'
|
||||
import ViewTrackBar from '../../../components/views/ViewTrackBar'
|
||||
import {getRemark} from "../../../components/views/utils";
|
||||
import {
|
||||
DEFAULT_TITLE_STYLE,
|
||||
DEFAULT_XAXIS_STYLE,
|
||||
DEFAULT_YAXIS_STYLE,
|
||||
transAxisPosition,
|
||||
getLineDash
|
||||
} from '@/utils/map';
|
||||
import ChartTitleUpdate from '@/components/views/ChartTitleUpdate';
|
||||
} from '../../../utils/map';
|
||||
import ChartTitleUpdate from '../../../components/views/ChartTitleUpdate';
|
||||
import _ from 'lodash';
|
||||
import {clear} from 'size-sensor'
|
||||
import {valueFormatter} from '@/utils/formatter'
|
||||
import {valueFormatter} from '../../../utils/formatter'
|
||||
|
||||
export default {
|
||||
name: 'ChartComponent',
|
||||
@ -128,16 +128,6 @@ export default {
|
||||
fontWeight: 'normal',
|
||||
background: hexColorToRGBA('#ffffff', 0)
|
||||
},
|
||||
title_class: {
|
||||
margin: '0 0',
|
||||
width: '100%',
|
||||
fontSize: '18px',
|
||||
color: '#303133',
|
||||
textAlign: 'left',
|
||||
fontStyle: 'normal',
|
||||
fontWeight: 'normal',
|
||||
background: ''
|
||||
},
|
||||
linkageActiveParam: null,
|
||||
linkageActiveHistory: false,
|
||||
CHART_CONT_FAMILY_MAP: {
|
||||
@ -252,7 +242,6 @@ export default {
|
||||
this.titleClass.textAlign = customStyle.text.hPosition
|
||||
this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
|
||||
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
|
||||
this.titleClass.fontFamily = customStyle.text.fontFamily ? this.CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : 'Microsoft YaHei'
|
||||
this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
|
||||
@ -325,10 +314,12 @@ export default {
|
||||
|
||||
const _chartType = this.getChartType(yaxisList[_index].chartType);
|
||||
|
||||
if (_chartType === "column") {
|
||||
_labelSetting.position = labelPosition;
|
||||
} else {
|
||||
_labelSetting.position = undefined;
|
||||
if (_labelSetting) {
|
||||
if (_chartType === "column") {
|
||||
_labelSetting.position = labelPosition;
|
||||
} else {
|
||||
_labelSetting.position = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
@ -378,10 +369,12 @@ export default {
|
||||
|
||||
const _chartType = this.getChartType(yaxisExtList[_index].chartType);
|
||||
|
||||
if (_chartType === "column") {
|
||||
_labelSetting.position = labelPosition;
|
||||
} else {
|
||||
_labelSetting.position = undefined;
|
||||
if (_labelSetting) {
|
||||
if (_chartType === "column") {
|
||||
_labelSetting.position = labelPosition;
|
||||
} else {
|
||||
_labelSetting.position = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -59,10 +59,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ColorSelector from '@/components/selector/ColorSelector'
|
||||
import TitleSelector from '@/components/selector/TitleSelector'
|
||||
import TooltipSelectorAntV from '@/components/selector/TooltipSelectorAntV'
|
||||
import LabelSelector from '@/components/selector/LabelSelector.vue'
|
||||
import ColorSelector from '../../../components/selector/ColorSelector'
|
||||
import TitleSelector from '../../../components/selector/TitleSelector'
|
||||
import TooltipSelectorAntV from '../../../components/selector/TooltipSelectorAntV'
|
||||
import LabelSelector from '../../../components/selector/LabelSelector.vue'
|
||||
import messages from '@/de-base/lang/messages'
|
||||
export default {
|
||||
components: {
|
||||
|
@ -150,7 +150,7 @@ public class RaceBarService extends ViewPluginService {
|
||||
data.forEach(ss -> {
|
||||
xs.add(ss[encode.get("y")]);
|
||||
|
||||
String key = ss[(Integer) map.get("extIndex")];
|
||||
String key = StringUtils.defaultString(ss[(Integer) map.get("extIndex")], StringUtils.EMPTY);
|
||||
if (!keySet.contains(key)) {
|
||||
keySet.add(key);
|
||||
keyList.add(key);
|
||||
@ -160,7 +160,7 @@ public class RaceBarService extends ViewPluginService {
|
||||
|
||||
|
||||
Map<String, List<String[]>> groupData = data.stream().collect(Collectors.toMap(
|
||||
k -> k[(Integer) map.get("extIndex")],
|
||||
k -> StringUtils.defaultString(k[(Integer) map.get("extIndex")], StringUtils.EMPTY),
|
||||
v -> {
|
||||
List<String[]> list = new ArrayList<>();
|
||||
list.add(v);
|
||||
@ -179,6 +179,7 @@ public class RaceBarService extends ViewPluginService {
|
||||
|
||||
map.put("xs", xs);
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,11 @@ export default {
|
||||
return ['drill']
|
||||
}
|
||||
},
|
||||
inScreen: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
},
|
||||
searchCount: {
|
||||
type: Number,
|
||||
required: false,
|
||||
@ -393,6 +398,8 @@ export default {
|
||||
this.myChart.on('finished', () => {
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
this.currentIndex = 0;
|
||||
})
|
||||
},
|
||||
loadThemeStyle() {
|
||||
@ -594,7 +601,7 @@ export default {
|
||||
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
|
||||
}
|
||||
}
|
||||
if (chart_option.tooltip) {
|
||||
if (chart_option.tooltip && this.inScreen) {
|
||||
chart_option.tooltip.appendToBody = true
|
||||
}
|
||||
|
||||
|
@ -105,9 +105,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SankeyDimensionItem from '@/components/views/SankeyDimensionItem'
|
||||
import SankeyQuotaItem from '@/components/views/SankeyQuotaItem'
|
||||
import FilterItem from '@/components/views/FilterItem'
|
||||
import SankeyDimensionItem from '../../../components/views/SankeyDimensionItem'
|
||||
import SankeyQuotaItem from '../../../components/views/SankeyQuotaItem'
|
||||
import FilterItem from '../../../components/views/FilterItem'
|
||||
import messages from '@/de-base/lang/messages'
|
||||
|
||||
export default {
|
||||
|
@ -9,12 +9,12 @@
|
||||
v-if="chart.type && antVRenderStatus"
|
||||
v-show="title_show"
|
||||
ref="title"
|
||||
:style="title_class"
|
||||
:style="titleClass"
|
||||
style="cursor: default;display: block;"
|
||||
>
|
||||
<div style="padding:4px 4px 0;margin: 0;">
|
||||
<chart-title-update
|
||||
:title-class="title_class"
|
||||
:title-class="titleClass"
|
||||
:chart-info="chartInfo"
|
||||
:bus="bus"
|
||||
:axios-request="axiosRequest"
|
||||
@ -33,11 +33,11 @@
|
||||
|
||||
<script>
|
||||
import {Sankey} from '@antv/g2plot'
|
||||
import {uuid, hexColorToRGBA} from '@/utils/sankey'
|
||||
import ViewTrackBar from '@/components/views/ViewTrackBar'
|
||||
import {getRemark} from "@/components/views/utils";
|
||||
import {DEFAULT_TITLE_STYLE} from '@/utils/map';
|
||||
import ChartTitleUpdate from '@/components/views/ChartTitleUpdate';
|
||||
import {uuid, hexColorToRGBA} from '../../../utils/sankey'
|
||||
import ViewTrackBar from '../../../components/views/ViewTrackBar'
|
||||
import {getRemark} from "../../../components/views/utils";
|
||||
import {DEFAULT_TITLE_STYLE} from '../../../utils/map';
|
||||
import ChartTitleUpdate from '../../../components/views/ChartTitleUpdate';
|
||||
import _ from 'lodash';
|
||||
import {clear} from 'size-sensor'
|
||||
|
||||
@ -121,16 +121,6 @@ export default {
|
||||
fontWeight: 'normal',
|
||||
background: hexColorToRGBA('#ffffff', 0)
|
||||
},
|
||||
title_class: {
|
||||
margin: '0 0',
|
||||
width: '100%',
|
||||
fontSize: '18px',
|
||||
color: '#303133',
|
||||
textAlign: 'left',
|
||||
fontStyle: 'normal',
|
||||
fontWeight: 'normal',
|
||||
background: ''
|
||||
},
|
||||
linkageActiveParam: null,
|
||||
linkageActiveHistory: false,
|
||||
CHART_CONT_FAMILY_MAP: {
|
||||
@ -244,7 +234,6 @@ export default {
|
||||
this.titleClass.textAlign = customStyle.text.hPosition
|
||||
this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
|
||||
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
this.titleClass.fontSize = customStyle.text.isBolder ? 'bold' : 'normal'
|
||||
|
||||
this.titleClass.fontFamily = customStyle.text.fontFamily ? this.CHART_CONT_FAMILY_MAP[customStyle.text.fontFamily] : 'Microsoft YaHei'
|
||||
this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
|
||||
|
@ -59,10 +59,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ColorSelector from '@/components/selector/ColorSelector'
|
||||
import TitleSelector from '@/components/selector/TitleSelector'
|
||||
import TooltipSelectorAntV from '@/components/selector/TooltipSelectorAntV'
|
||||
import LabelSelector from '@/components/selector/LabelSelector.vue'
|
||||
import ColorSelector from '../../../components/selector/ColorSelector'
|
||||
import TitleSelector from '../../../components/selector/TitleSelector'
|
||||
import TooltipSelectorAntV from '../../../components/selector/TooltipSelectorAntV'
|
||||
import LabelSelector from '../../../components/selector/LabelSelector.vue'
|
||||
import messages from '@/de-base/lang/messages'
|
||||
export default {
|
||||
components: {
|
||||
|
Loading…
Reference in New Issue
Block a user