Merge branch 'dev' into pr@dev@fixrowpermissions

This commit is contained in:
taojinlong 2023-09-12 11:34:18 +08:00
commit 67c09dd069
33 changed files with 405 additions and 3741 deletions

View File

@ -9,5 +9,21 @@ keynode = "keynode"
SCHEM = "SCHEM" SCHEM = "SCHEM"
[files] [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

View File

@ -1220,8 +1220,8 @@ public class DorisQueryProvider extends QueryProvider {
if (x.getDeExtractType() == 0) { if (x.getDeExtractType() == 0) {
if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) { if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) {
fieldName = String.format(format, fieldName = String.format(format,
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT), "%Y"), 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, DorisConstants.DEFAULT_DATE_FORMAT))); String.format(DorisConstants.QUARTER, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT)));
} else { } 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); fieldName = String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT), format);
} }

View File

@ -604,12 +604,21 @@ public class ChartViewService {
List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType); List<ChartViewFieldDTO> viewFields = gson.fromJson(view.getViewFields(), tokenType);
final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>(); final Map<String, List<ChartViewFieldDTO>> extFieldsMap = new LinkedHashMap<>();
if (CollectionUtils.isNotEmpty(viewFields)) { 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(); String busiType = field.getBusiType();
List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>(); List<ChartViewFieldDTO> list = extFieldsMap.containsKey(busiType) ? extFieldsMap.get(busiType) : new ArrayList<>();
list.add(field); list.add(field);
extFieldsMap.put(field.getBusiType(), list); 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); List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), tokenType);

View File

@ -35,6 +35,7 @@
:obj="{active, chart, trackMenu, searchCount, terminalType: scaleCoefficientType}" :obj="{active, chart, trackMenu, searchCount, terminalType: scaleCoefficientType}"
:chart="chart" :chart="chart"
:track-menu="trackMenu" :track-menu="trackMenu"
:in-screen="inScreen"
:search-count="searchCount" :search-count="searchCount"
:terminal-type="scaleCoefficientType" :terminal-type="scaleCoefficientType"
:scale="scale" :scale="scale"
@ -432,7 +433,7 @@ export default {
const trackMenuInfo = [] const trackMenuInfo = []
let linkageCount = 0 let linkageCount = 0
let jumpCount = 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 checkItem = this.drillFields[this.drillFilters.length]
const sourceInfo = this.chart.id + '#' + checkItem.id const sourceInfo = this.chart.id + '#' + checkItem.id
if (this.nowPanelTrackInfo[sourceInfo]) { if (this.nowPanelTrackInfo[sourceInfo]) {
@ -441,7 +442,7 @@ export default {
if (this.nowPanelJumpInfo[sourceInfo]) { if (this.nowPanelJumpInfo[sourceInfo]) {
jumpCount++ jumpCount++
} }
}else{ } else {
this.chart.data && this.chart.data.fields && this.chart.data.fields.forEach(item => { this.chart.data && this.chart.data.fields && this.chart.data.fields.forEach(item => {
const sourceInfo = this.chart.id + '#' + item.id const sourceInfo = this.chart.id + '#' + item.id
if (this.nowPanelTrackInfo[sourceInfo]) { if (this.nowPanelTrackInfo[sourceInfo]) {
@ -633,7 +634,7 @@ export default {
}, },
exportViewImg() { exportViewImg() {
this.imageDownloading = true this.imageDownloading = true
this.$refs['userViewDialog'].exportViewImg(()=>{ this.$refs['userViewDialog'].exportViewImg(() => {
this.imageDownloading = false this.imageDownloading = false
}) })
}, },

View File

@ -60,7 +60,8 @@ export default {
values: null, values: null,
onFocus: false, onFocus: false,
show: true, show: true,
timer: null outTimer: null,
innerTimer: null
} }
}, },
computed: { computed: {
@ -134,12 +135,7 @@ export default {
}, },
watch: { watch: {
canvasStyleData: {
handler(newVal, oldVla) {
this.canvasStyleDataInit()
},
deep: true
},
'viewIds': function(value, old) { 'viewIds': function(value, old) {
if (typeof value === 'undefined' || value === old) return if (typeof value === 'undefined' || value === old) return
this.setCondition() this.setCondition()
@ -174,7 +170,9 @@ export default {
}, },
created() { created() {
this.loadInit() this.loadInit()
this.canvasStyleDataInit() this.$nextTick(() => {
this.dynamicRefresh()
})
}, },
mounted() { mounted() {
bus.$on('onScroll', this.onScroll) bus.$on('onScroll', this.onScroll)
@ -183,18 +181,14 @@ export default {
} }
}, },
beforeDestroy() { beforeDestroy() {
this.timer && clearInterval(this.timer) this.clearTime()
bus.$off('onScroll', this.onScroll) bus.$off('onScroll', this.onScroll)
bus.$off('reset-default-value', this.resetDefaultValue) bus.$off('reset-default-value', this.resetDefaultValue)
}, },
methods: { methods: {
loadInit() { loadInit() {
if (this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { this.clearTime()
if (this.element.options.attrs.default) { if (this.refreshHandler()) {
const widget = ApplicationContext.getService(this.element.serviceName)
this.values = widget.dynamicDateFormNow(this.element)
this.dateChange(this.values)
}
return return
} }
if (this.element.options.value) { if (this.element.options.value) {
@ -202,22 +196,42 @@ export default {
this.dateChange(this.values) this.dateChange(this.values)
} }
}, },
canvasStyleDataInit() { refreshHandler() {
if (this.inDraw && this.canvasStyleData.refreshViewEnable && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { if (this.element.options.attrs.default?.isDynamic) {
this.searchCount = 0 const widget = ApplicationContext.getService(this.element.serviceName)
this.timer && clearInterval(this.timer) this.values = widget.dynamicDateFormNow(this.element)
let refreshTime = 300000 this.dateChange(this.values)
if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) { return true
if (this.canvasStyleData.refreshUnit === 'second') { }
refreshTime = this.canvasStyleData.refreshTime * 1000 return false
} else { },
refreshTime = this.canvasStyleData.refreshTime * 60000 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.innerTimer = setInterval(() => {
this.timer = setInterval(() => { if (this.inDraw) {
this.loadInit() this.refreshHandler()
this.searchCount++ }
}, refreshTime) }, 24 * 3600 * 1000)
}, tomorrowTime - nowTime)
} }
}, },
clearHandler() { clearHandler() {

View File

@ -1489,6 +1489,8 @@ export default {
label_content: 'Label Content', label_content: 'Label Content',
percent: 'Percent', percent: 'Percent',
table_index_desc: 'Index Header Name', table_index_desc: 'Index Header Name',
table_row_tooltip: 'Row Tooltip',
table_col_tooltip: 'Column Tooltip',
total_sort: 'Total Sort', total_sort: 'Total Sort',
total_sort_none: 'None', total_sort_none: 'None',
total_sort_asc: 'ASC', total_sort_asc: 'ASC',

View File

@ -1488,6 +1488,8 @@ export default {
label_content: '標籤展示', label_content: '標籤展示',
percent: '占比', percent: '占比',
table_index_desc: '表頭名稱', table_index_desc: '表頭名稱',
table_row_tooltip: '行頭提示',
table_col_tooltip: '列頭提示',
total_sort: '總計排序', total_sort: '總計排序',
total_sort_none: '無', total_sort_none: '無',
total_sort_asc: '升序', total_sort_asc: '升序',

View File

@ -1487,6 +1487,8 @@ export default {
label_content: '标签展示', label_content: '标签展示',
percent: '占比', percent: '占比',
table_index_desc: '表头名称', table_index_desc: '表头名称',
table_row_tooltip: '行头提示',
table_col_tooltip: '列头提示',
total_sort: '总计排序', total_sort: '总计排序',
total_sort_none: '无', total_sort_none: '无',
total_sort_asc: '升序', total_sort_asc: '升序',

View File

@ -40,6 +40,7 @@ import VueFriendlyIframe from 'vue-friendly-iframe'
import vueToPdf from 'vue-to-pdf' import vueToPdf from 'vue-to-pdf'
import VueVideoPlayer from 'vue-video-player' import VueVideoPlayer from 'vue-video-player'
import 'video.js/dist/video-js.css' import 'video.js/dist/video-js.css'
import '@antv/s2/dist/style.min.css'
// 控制标签宽高成比例的指令 // 控制标签宽高成比例的指令
import proportion from 'vue-proportion-directive' import proportion from 'vue-proportion-directive'

View File

@ -45,6 +45,16 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
yAxis: yAxis, yAxis: yAxis,
slider: slider, slider: slider,
annotations: analyse, annotations: analyse,
brush: {
enabled: true,
isStartEnable: (context) => {
// 按住 shift 键,才能开启交互
if (context.event.gEvent.originalEvent?.shiftKey) {
return true
}
return false
}
},
interactions: [ interactions: [
{ {
type: 'legend-active', cfg: { type: 'legend-active', cfg: {
@ -162,6 +172,16 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
yAxis: yAxis, yAxis: yAxis,
slider: slider, slider: slider,
annotations: analyse, annotations: analyse,
brush: {
enabled: true,
isStartEnable: (context) => {
// 按住 shift 键,才能开启交互
if (context.event.gEvent.originalEvent?.shiftKey) {
return true
}
return false
}
},
interactions: [ interactions: [
{ {
type: 'legend-active', cfg: { type: 'legend-active', cfg: {

View File

@ -86,6 +86,12 @@ export const DEFAULT_SIZE = {
tableHeaderAlign: 'left', tableHeaderAlign: 'left',
tableItemAlign: 'right', tableItemAlign: 'right',
tableAutoBreakLine: false, tableAutoBreakLine: false,
tableRowTooltip: {
show: false
},
tableColTooltip: {
show: false
},
gaugeMinType: 'fix', // fix or dynamic gaugeMinType: 'fix', // fix or dynamic
gaugeMinField: { gaugeMinField: {
id: '', id: '',

View File

@ -593,9 +593,11 @@ export function getXAxis(chart) {
stroke: axisCfg.lineStyle.color stroke: axisCfg.lineStyle.color
} }
} : null } : null
const rotate = parseInt(a.axisLabel.rotate)
const label = a.axisLabel.show ? { const label = a.axisLabel.show ? {
rotate: parseInt(a.axisLabel.rotate) * Math.PI / 180, rotate: rotate * Math.PI / 180,
style: { style: {
textAlign: rotate > 20 ? 'start' : rotate < -20 ? 'end' : 'center',
fill: a.axisLabel.color, fill: a.axisLabel.color,
fontSize: parseInt(a.axisLabel.fontSize) fontSize: parseInt(a.axisLabel.fontSize)
}, },

View File

@ -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 { getCustomTheme, getSize } from '@/views/chart/chart/common/common_table'
import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart' import { DEFAULT_COLOR_CASE, DEFAULT_TOTAL } from '@/views/chart/chart/chart'
import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' 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) const containerDom = document.getElementById(container)
// fields // fields
const fields = chart.data.fields let fields = chart.data.fields
if (!fields || fields.length === 0) { if (!fields || fields.length === 0) {
if (s2) { if (s2) {
s2.destroy() s2.destroy()
@ -17,8 +17,17 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
const columns = [] const columns = []
const meta = [] const meta = []
// 记录下钻起始字段的index
// add drill list 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) { if (chart.drill) {
let drillFields = [] let drillFields = []
try { try {
@ -26,107 +35,44 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
} catch (err) { } catch (err) {
drillFields = JSON.parse(JSON.stringify(chart.drillFields)) drillFields = JSON.parse(JSON.stringify(chart.drillFields))
} }
// 总下钻过滤字段
const drillField = drillFields[chart.drillFilters.length] const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters)).map(i => i.fieldId)
// 当前下钻字段
const drillFilters = JSON.parse(JSON.stringify(chart.drillFilters)) const curDrillField = drillFields[chart.drillFilters.length]
const drillExp = drillFilters[drillFilters.length - 1].datasetTableField drillFilters.push(curDrillField.id)
// 下钻入口字段的下标
// 记录下钻起始字段的index const drillEnterFieldIndex = xAxis.findIndex(item => item.id === drillFilters[0])
let xAxis = [] // 移除所有下钻字段,调整当前下钻字段到下钻入口位置
try { fields = fields.filter(item => !drillFilters.includes(item.id))
xAxis = JSON.parse(chart.xaxis) fields.splice(drillEnterFieldIndex, 0, curDrillField)
} 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
}
}
}
})
})
} }
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) const newData = handleTableEmptyStrategy(tableData, chart)
// data config // data config
@ -174,6 +120,11 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
// click // click
s2.on(S2Event.DATA_CELL_CLICK, action) 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 // theme
const customTheme = getCustomTheme(chart) const customTheme = getCustomTheme(chart)
@ -342,7 +293,11 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
// click // click
s2.on(S2Event.DATA_CELL_CLICK, action) 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 // theme
const customTheme = getCustomTheme(chart) const customTheme = getCustomTheme(chart)
s2.setThemeCfg({ theme: customTheme }) s2.setThemeCfg({ theme: customTheme })
@ -455,8 +410,8 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
// total config // total config
let totalCfg = {} let totalCfg = {}
const chartObj = JSON.parse(JSON.stringify(chart)) const chartObj = JSON.parse(JSON.stringify(chart))
let customAttr
if (chartObj.customAttr) { if (chartObj.customAttr) {
let customAttr = null
if (Object.prototype.toString.call(chartObj.customAttr) === '[object Object]') { if (Object.prototype.toString.call(chartObj.customAttr) === '[object Object]') {
customAttr = JSON.parse(JSON.stringify(chartObj.customAttr)) customAttr = JSON.parse(JSON.stringify(chartObj.customAttr))
} else { } else {
@ -528,7 +483,14 @@ export function baseTablePivot(s2, container, chart, action, headerAction, table
s2.on(S2Event.DATA_CELL_CLICK, action) s2.on(S2Event.DATA_CELL_CLICK, action)
s2.on(S2Event.ROW_CELL_CLICK, headerAction) s2.on(S2Event.ROW_CELL_CLICK, headerAction)
s2.on(S2Event.COL_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 // theme
const customTheme = getCustomTheme(chart) const customTheme = getCustomTheme(chart)
s2.setThemeCfg({ theme: customTheme }) s2.setThemeCfg({ theme: customTheme })
@ -740,3 +702,16 @@ function mappingColor(value, defaultColor, field, type) {
} }
return color 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
})
}

View File

@ -62,7 +62,8 @@ export const TYPE_CONFIGS = [
'tableItemHeight', 'tableItemHeight',
'tableColumnMode', 'tableColumnMode',
'showIndex', 'showIndex',
'indexLabel' 'indexLabel',
'tableColTooltip'
], ],
'title-selector-ant-v': [ 'title-selector-ant-v': [
'show', 'show',
@ -111,7 +112,8 @@ export const TYPE_CONFIGS = [
'tableItemHeight', 'tableItemHeight',
'tableColumnMode', 'tableColumnMode',
'showIndex', 'showIndex',
'indexLabel' 'indexLabel',
'tableColTooltip'
], ],
'title-selector-ant-v': [ 'title-selector-ant-v': [
'show', 'show',
@ -157,7 +159,9 @@ export const TYPE_CONFIGS = [
'tableItemAlign', 'tableItemAlign',
'tableTitleHeight', 'tableTitleHeight',
'tableItemHeight', 'tableItemHeight',
'tableColumnMode' 'tableColumnMode',
'tableRowTooltip',
'tableColTooltip'
], ],
'total-cfg': [ 'total-cfg': [
'row', 'row',

View File

@ -189,13 +189,19 @@ export default {
}, },
mounted() { mounted() {
bus.$on('change-series-id', this.changeSeriesId) bus.$on('change-series-id', this.changeSeriesId)
document.getElementById(this.chartId).addEventListener('mouseover', this.bodyMouseover) const dom = document.getElementById(this.chartId)
document.getElementById(this.chartId).addEventListener('mouseout', this.bodyMouseout) if (dom) {
dom.addEventListener('mouseover', this.bodyMouseover)
dom.addEventListener('mouseout', this.bodyMouseout)
}
this.preDraw() this.preDraw()
}, },
beforeDestroy() { beforeDestroy() {
document.getElementById(this.chartId).removeEventListener('mouseover', this.bodyMouseover) const dom = document.getElementById(this.chartId)
document.getElementById(this.chartId).removeEventListener('mouseout', this.bodyMouseout) if (dom) {
dom.removeEventListener('mouseover', this.bodyMouseover)
dom.removeEventListener('mouseout', this.bodyMouseout)
}
bus.$off('change-series-id', this.changeSeriesId) bus.$off('change-series-id', this.changeSeriesId)
window.removeEventListener('resize', this.myChart.resize) window.removeEventListener('resize', this.myChart.resize)
this.myChart.dispose() this.myChart.dispose()

View File

@ -614,3 +614,8 @@ export default {
background: transparent !important; background: transparent !important;
} }
</style> </style>
<style>
.antv-s2-tooltip-container {
padding: 4px 2px;
}
</style>

View File

@ -384,6 +384,28 @@
@blur="changeBarSizeCase('indexLabel')" @blur="changeBarSizeCase('indexLabel')"
/> />
</el-form-item> </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--> <!--chart-mix-start-->
<span v-show="showProperty('mix')"> <span v-show="showProperty('mix')">
@ -893,6 +915,54 @@
@change="changeBarSizeCase('quotaFontShadow')" @change="changeBarSizeCase('quotaFontShadow')"
>{{ $t('chart.font_shadow') }}</el-checkbox> >{{ $t('chart.font_shadow') }}</el-checkbox>
</el-form-item> </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-divider v-if="showProperty('dimensionShow')" />
<el-form-item <el-form-item
v-show="showProperty('dimensionShow')" v-show="showProperty('dimensionShow')"
@ -983,7 +1053,6 @@
@change="changeBarSizeCase('dimensionFontShadow')" @change="changeBarSizeCase('dimensionFontShadow')"
>{{ $t('chart.font_shadow') }}</el-checkbox> >{{ $t('chart.font_shadow') }}</el-checkbox>
</el-form-item> </el-form-item>
<el-divider v-if="showProperty('spaceSplit')" />
<el-form-item <el-form-item
v-show="showProperty('spaceSplit')" v-show="showProperty('spaceSplit')"
:label="$t('chart.space_split')" :label="$t('chart.space_split')"
@ -996,54 +1065,6 @@
@change="changeBarSizeCase('spaceSplit')" @change="changeBarSizeCase('spaceSplit')"
/> />
</el-form-item> </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> </div>
<!--text&label-end--> <!--text&label-end-->
<!--scatter-begin--> <!--scatter-begin-->
@ -1565,6 +1586,8 @@ export default {
this.sizeForm.tableHeaderAlign = this.sizeForm.tableHeaderAlign ? this.sizeForm.tableHeaderAlign : DEFAULT_SIZE.tableHeaderAlign 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.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 this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) { if (this.sizeForm.indexLabel === null || this.sizeForm.indexLabel === undefined) {

View File

@ -13,7 +13,7 @@
@click="add('group')" @click="add('group')"
/> />
</el-row> </el-row>
<el-divider/> <el-divider />
<el-row style="margin-bottom: 10px"> <el-row style="margin-bottom: 10px">
<el-col :span="16"> <el-col :span="16">
<el-input <el-input
@ -31,7 +31,7 @@
size="mini" size="mini"
type="primary" 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-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="searchTypeClick('all')">{{ $t('commons.all') }}</el-dropdown-item> <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 style="display: flex;flex: 1;width: 0;">
<span> <span>
<i class="el-icon-folder"/> <i class="el-icon-folder" />
</span> </span>
<span <span
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
@ -152,7 +152,7 @@
class="custom-tree-node-list father" class="custom-tree-node-list father"
> >
<span style="display: flex;flex: 1;width: 0;"> <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 <span
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
:title="data.name" :title="data.name"
@ -225,7 +225,7 @@
:label="$t('commons.name')" :label="$t('commons.name')"
prop="name" prop="name"
> >
<el-input v-model="groupForm.name"/> <el-input v-model="groupForm.name" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div
@ -266,7 +266,7 @@
:label="$t('commons.name')" :label="$t('commons.name')"
prop="name" prop="name"
> >
<el-input v-model="tableForm.name"/> <el-input v-model="tableForm.name" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div <div
@ -322,8 +322,8 @@
:active="createActive" :active="createActive"
align-center align-center
> >
<el-step :title="$t('chart.select_dataset')"/> <el-step :title="$t('chart.select_dataset')" />
<el-step :title="$t('chart.select_chart_type')"/> <el-step :title="$t('chart.select_chart_type')" />
</el-steps> </el-steps>
<table-selector <table-selector
@ -397,8 +397,8 @@
size="mini" size="mini"
@click="createPreview" @click="createPreview"
>{{ >{{
$t('chart.preview') $t('chart.preview')
}} }}
</el-button> </el-button>
<el-button <el-button
v-if="createActive === 1" v-if="createActive === 1"
@ -447,8 +447,8 @@
size="mini" size="mini"
@click="saveMoveGroup(tGroup)" @click="saveMoveGroup(tGroup)"
>{{ >{{
$t('dataset.confirm') $t('dataset.confirm')
}} }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -481,8 +481,8 @@
size="mini" size="mini"
@click="saveMoveDs(tDs)" @click="saveMoveDs(tDs)"
>{{ >{{
$t('dataset.confirm') $t('dataset.confirm')
}} }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -630,6 +630,10 @@ export default {
}, },
panelInfo() { panelInfo() {
return this.$store.state.panel.panelInfo return this.$store.state.panel.panelInfo
},
watchChartTypeChangeObj() {
const { type, render } = this.view
return { type, render }
} }
}, },
watch: { watch: {
@ -649,8 +653,14 @@ export default {
this.searchPids = [] this.searchPids = []
this.$refs.chartTreeRef.filter(this.filterText) this.$refs.chartTreeRef.filter(this.filterText)
}, },
chartType(val) { // chartType(val) {
this.view.isPlugin = val && this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(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)
} }
}, },

View File

@ -924,6 +924,7 @@
:param="param" :param="param"
:index="index" :index="index"
:item="item" :item="item"
:chart="chart"
:dimension-data="dimension" :dimension-data="dimension"
:quota-data="quota" :quota-data="quota"
@onItemChange="bubbleItemChange" @onItemChange="bubbleItemChange"
@ -1323,8 +1324,8 @@
ref="itemForm" ref="itemForm"
label-width="80px" label-width="80px"
:model="itemForm" :model="itemForm"
@submit.native.prevent
:rules="itemFormRules" :rules="itemFormRules"
@submit.native.prevent
> >
<el-form-item <el-form-item
:label="$t('dataset.field_origin_name')" :label="$t('dataset.field_origin_name')"
@ -1734,7 +1735,6 @@ import QuotaFilterEditor from '../components/filter/QuotaFilterEditor'
import DimensionFilterEditor from '../components/filter/DimensionFilterEditor' import DimensionFilterEditor from '../components/filter/DimensionFilterEditor'
import TableNormal from '../components/table/TableNormal' import TableNormal from '../components/table/TableNormal'
import LabelNormal from '../components/normal/LabelNormal' import LabelNormal from '../components/normal/LabelNormal'
// import html2canvas from 'html2canvasde'
import TableSelector from './TableSelector' import TableSelector from './TableSelector'
import FieldEdit from '../../dataset/data/FieldEdit' import FieldEdit from '../../dataset/data/FieldEdit'
import { areaMapping } from '@/api/map/map' import { areaMapping } from '@/api/map/map'
@ -1996,6 +1996,10 @@ export default {
!equalsAny(this.view.type, 'liquid', 'bidirectional-bar', !equalsAny(this.view.type, 'liquid', 'bidirectional-bar',
'word-cloud', 'table-pivot', 'label', 'richTextView', 'flow-map') 'word-cloud', 'table-pivot', 'label', 'richTextView', 'flow-map')
}, },
watchChartTypeChangeObj() {
const { type, render } = this.view
return { type, render }
},
...mapState([ ...mapState([
'curComponent', 'curComponent',
'panelViewEditInfo', 'panelViewEditInfo',
@ -2016,7 +2020,7 @@ export default {
}, },
'param': function(val) { 'param': function(val) {
if (this.param.optType === 'new') { if (this.param.optType === 'new') {
// // Do Nothing
} else if (this.param.id !== this.preChartId && this.editStatus) { } else if (this.param.id !== this.preChartId && this.editStatus) {
this.preChartId = this.param.id this.preChartId = this.param.id
this.chartInit() this.chartInit()
@ -2031,8 +2035,14 @@ export default {
} }
this.$emit('typeChange', newVal) this.$emit('typeChange', newVal)
}, },
'view.type': function(newVal, oldVal) { watchChartTypeChangeObj(newVal, oldVal) {
this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal) 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() { created() {
@ -2124,9 +2134,6 @@ export default {
this.resetDrill() this.resetDrill()
this.initFromPanel() this.initFromPanel()
this.getChart(this.param.id) this.getChart(this.param.id)
// if (this.componentViewsData[this.param.id]) {
// this.chart = this.componentViewsData[this.param.id]
// }
}, },
bindPluginEvent() { bindPluginEvent() {
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter) bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
@ -2257,9 +2264,6 @@ export default {
view.xaxis = [view.xaxis[0]] view.xaxis = [view.xaxis[0]]
} }
view.xaxis.forEach(function(ele) { view.xaxis.forEach(function(ele) {
// if (!ele.summary || ele.summary === '') {
// ele.summary = 'sum'
// }
if (!ele.dateStyle || ele.dateStyle === '') { if (!ele.dateStyle || ele.dateStyle === '') {
ele.dateStyle = 'y_M_d' ele.dateStyle = 'y_M_d'
} }
@ -2417,6 +2421,7 @@ export default {
view.extBubble = JSON.stringify(view.extBubble) view.extBubble = JSON.stringify(view.extBubble)
view.senior = JSON.stringify(view.senior) view.senior = JSON.stringify(view.senior)
delete view.data delete view.data
return view return view
}, },
refreshAttrChange() { refreshAttrChange() {
@ -2435,7 +2440,6 @@ export default {
const view = this.buildParam(true, 'chart', false, switchType, switchRender) const view = this.buildParam(true, 'chart', false, switchType, switchRender)
if (!view) return if (!view) return
viewEditSave(this.panelInfo.id, view).then(() => { viewEditSave(this.panelInfo.id, view).then(() => {
// this.getData(this.param.id)
this.getChart(this.param.id) this.getChart(this.param.id)
bus.$emit('view-in-cache', { bus.$emit('view-in-cache', {
type: 'propChange', type: 'propChange',
@ -2462,7 +2466,6 @@ export default {
view.senior = JSON.stringify(this.view.senior) view.senior = JSON.stringify(this.view.senior)
view.title = this.view.title view.title = this.view.title
view.stylePriority = this.view.stylePriority view.stylePriority = this.view.stylePriority
// view.data = this.data
this.chart = view this.chart = view
// //
@ -2514,7 +2517,6 @@ export default {
} }
}, },
getData(id) { getData(id) {
// this.hasEdit = true
if (id) { if (id) {
ajaxGetDataOnly(id, this.panelInfo.id, { ajaxGetDataOnly(id, this.panelInfo.id, {
filter: [], filter: [],
@ -2894,12 +2896,7 @@ export default {
}, },
closeRename() { closeRename() {
this.renameItem = false this.renameItem = false
this.resetRename()
}, },
resetRename() {
// this.itemForm = {}
},
showQuotaEditCompare(item) { showQuotaEditCompare(item) {
this.quotaItemCompare = JSON.parse(JSON.stringify(item)) this.quotaItemCompare = JSON.parse(JSON.stringify(item))
this.showEditQuotaCompare = true this.showEditQuotaCompare = true
@ -3107,14 +3104,8 @@ export default {
}, },
initAreas() { initAreas() {
// let mapping
// if ((mapping = localStorage.getItem('areaMapping')) !== null) {
// this.places = JSON.parse(mapping)
// return
// }
Object.keys(this.places).length === 0 && areaMapping().then(res => { Object.keys(this.places).length === 0 && areaMapping().then(res => {
this.places = res.data this.places = res.data
// localStorage.setItem('areaMapping', JSON.stringify(res.data))
}) })
}, },
@ -3182,16 +3173,13 @@ export default {
chartClick(param) { chartClick(param) {
if (this.drillClickDimensionList.length < this.view.drillFields.length - 1) { 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.chart.type === 'map' || this.chart.type === 'buddle-map') {
if (this.sendToChildren(param)) { if (this.sendToChildren(param)) {
this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList }) this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
// this.getData(this.param.id)
this.calcData(true, 'chart', false, false) this.calcData(true, 'chart', false, false)
} }
} else { } else {
this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList }) this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
// this.getData(this.param.id)
this.calcData(true, 'chart', false, false) this.calcData(true, 'chart', false, false)
} }
} else if (this.view.drillFields.length > 0) { } else if (this.view.drillFields.length > 0) {
@ -3219,7 +3207,6 @@ export default {
} else { } else {
current && current.registerDynamicMap && current.registerDynamicMap(null) current && current.registerDynamicMap && current.registerDynamicMap(null)
} }
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(null)
} }
}, },
drillJump(index) { drillJump(index) {
@ -3228,8 +3215,6 @@ export default {
if (this.chart.type === 'map' || this.chart.type === 'buddle-map') { if (this.chart.type === 'map' || this.chart.type === 'buddle-map') {
this.backToParent(index, length) this.backToParent(index, length)
} }
// this.getData(this.param.id)
this.calcData(true, 'chart', false, false) this.calcData(true, 'chart', false, false)
}, },
// //
@ -3245,7 +3230,6 @@ export default {
} }
this.currentAcreaNode = tempNode this.currentAcreaNode = tempNode
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(this.currentAcreaNode.code)
const current = this.$refs.dynamicChart const current = this.$refs.dynamicChart
if (this.view.isPlugin) { if (this.view.isPlugin) {
current && current.callPluginInner && this.setDetailMapCode(this.currentAcreaNode.code) && current.callPluginInner({ current && current.callPluginInner && this.setDetailMapCode(this.currentAcreaNode.code) && current.callPluginInner({
@ -3271,14 +3255,11 @@ export default {
if (this.currentAcreaNode) { if (this.currentAcreaNode) {
aCode = this.currentAcreaNode.code aCode = this.currentAcreaNode.code
} }
// const aCode = this.currentAcreaNode ? this.currentAcreaNode.code : null
const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places) const currentNode = this.findEntityByCode(aCode || this.view.customAttr.areaCode, this.places)
if (currentNode && currentNode.children && currentNode.children.length > 0) { if (currentNode && currentNode.children && currentNode.children.length > 0) {
const nextNode = currentNode.children.find(item => item.name === name) const nextNode = currentNode.children.find(item => item.name === name)
if (!nextNode || !nextNode.code) return null if (!nextNode || !nextNode.code) return null
// this.view.customAttr.areaCode = nextNode.code
this.currentAcreaNode = nextNode this.currentAcreaNode = nextNode
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
const current = this.$refs.dynamicChart const current = this.$refs.dynamicChart
if (this.view.isPlugin) { if (this.view.isPlugin) {
nextNode && current && current.callPluginInner && this.setDetailMapCode(nextNode.code) && current.callPluginInner({ 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 }) this.$store.commit('recordViewEdit', { viewId: this.param.id, hasEdit: status })
}, },
changeChartRender() { changeChartRender() {
this.setChartDefaultOptions() // Do Nothing
this.calcData(true, 'chart', true, false, true)
}, },
changeChartType() { changeChartType() {
this.setChartDefaultOptions() // Do Nothing
this.calcData(true, 'chart', true, true)
}, },
setChartDefaultOptions() { setChartDefaultOptions() {

View File

@ -93,9 +93,9 @@ export default {
} }
}, },
methods: { methods: {
currentIsPlugin(type) { currentIsPlugin(type, render) {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || [] 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) { initTypes(plugins) {
plugins.forEach(plugin => { plugins.forEach(plugin => {

View File

@ -798,7 +798,7 @@ export default {
async loadField(tableId, init) { async loadField(tableId, init) {
const res = await fieldListWithPermission(tableId) const res = await fieldListWithPermission(tableId)
let data = res.data || [] let data = res.data || []
if (init && !this.checkSuperior(data, this.anotherTableInfo(tableId))) { if (init && (!data.length || !this.checkSuperior(data, this.anotherTableInfo(tableId)))) {
this.backToLink() this.backToLink()
} }
if (this.widget && this.widget.filterFieldMethod) { if (this.widget && this.widget.filterFieldMethod) {

View File

@ -155,7 +155,7 @@
:format="element.options.attrs.accuracy" :format="element.options.attrs.accuracy"
style="width: auto; min-width: 110px;" style="width: auto; min-width: 110px;"
placeholder="" placeholder=""
@change="eDynamicSuffixTimeChange" @change="sDynamicSuffixTimeChange"
/> />
</el-form-item> </el-form-item>
@ -384,10 +384,22 @@ export default {
} }
}, },
eDynamicSuffixTimeChange(val) { eDynamicSuffixTimeChange(val) {
const time = this.convertTime(val)
this.$set(this.element.options.attrs.default, 'eDynamicSuffixTime', time)
this.setDval() this.setDval()
}, },
sDynamicSuffixTimeChange(val) { sDynamicSuffixTimeChange(val) {
const time = this.convertTime(val)
this.$set(this.element.options.attrs.default, 'sDynamicSuffixTime', time)
this.setDval() 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()
} }
} }
} }

View File

@ -937,7 +937,8 @@ export default {
top: inherit !important; top: inherit !important;
} }
.track-menu { .track-menu,
.coustom-date-picker {
left: inherit !important; left: inherit !important;
} }
} }

View File

@ -98,10 +98,10 @@
</template> </template>
<script> <script>
import DimensionItem from '@/components/views/DimensionItem' import DimensionItem from '../../../components/views/DimensionItem'
import QuotaItem from '@/components/views/QuotaItem' import QuotaItem from '../../../components/views/QuotaItem'
import QuotaExtItem from '@/components/views/QuotaExtItem' import QuotaExtItem from '../../../components/views/QuotaExtItem'
import FilterItem from '@/components/views/FilterItem' import FilterItem from '../../../components/views/FilterItem'
import messages from '@/de-base/lang/messages' import messages from '@/de-base/lang/messages'
export default { export default {

View File

@ -9,12 +9,12 @@
v-if="chart.type && antVRenderStatus" v-if="chart.type && antVRenderStatus"
v-show="title_show" v-show="title_show"
ref="title" ref="title"
:style="title_class" :style="titleClass"
style="cursor: default;display: block;" style="cursor: default;display: block;"
> >
<div style="padding:4px 4px 0;margin: 0;"> <div style="padding:4px 4px 0;margin: 0;">
<chart-title-update <chart-title-update
:title-class="title_class" :title-class="titleClass"
:chart-info="chartInfo" :chart-info="chartInfo"
:bus="bus" :bus="bus"
:axios-request="axiosRequest" :axios-request="axiosRequest"
@ -33,20 +33,20 @@
<script> <script>
import {Mix} from '@antv/g2plot' import {Mix} from '@antv/g2plot'
import {uuid, hexColorToRGBA} from '@/utils/chartmix' import {uuid, hexColorToRGBA} from '../../../utils/chartmix'
import ViewTrackBar from '@/components/views/ViewTrackBar' import ViewTrackBar from '../../../components/views/ViewTrackBar'
import {getRemark} from "@/components/views/utils"; import {getRemark} from "../../../components/views/utils";
import { import {
DEFAULT_TITLE_STYLE, DEFAULT_TITLE_STYLE,
DEFAULT_XAXIS_STYLE, DEFAULT_XAXIS_STYLE,
DEFAULT_YAXIS_STYLE, DEFAULT_YAXIS_STYLE,
transAxisPosition, transAxisPosition,
getLineDash getLineDash
} from '@/utils/map'; } from '../../../utils/map';
import ChartTitleUpdate from '@/components/views/ChartTitleUpdate'; import ChartTitleUpdate from '../../../components/views/ChartTitleUpdate';
import _ from 'lodash'; import _ from 'lodash';
import {clear} from 'size-sensor' import {clear} from 'size-sensor'
import {valueFormatter} from '@/utils/formatter' import {valueFormatter} from '../../../utils/formatter'
export default { export default {
name: 'ChartComponent', name: 'ChartComponent',
@ -128,16 +128,6 @@ export default {
fontWeight: 'normal', fontWeight: 'normal',
background: hexColorToRGBA('#ffffff', 0) background: hexColorToRGBA('#ffffff', 0)
}, },
title_class: {
margin: '0 0',
width: '100%',
fontSize: '18px',
color: '#303133',
textAlign: 'left',
fontStyle: 'normal',
fontWeight: 'normal',
background: ''
},
linkageActiveParam: null, linkageActiveParam: null,
linkageActiveHistory: false, linkageActiveHistory: false,
CHART_CONT_FAMILY_MAP: { CHART_CONT_FAMILY_MAP: {
@ -252,7 +242,6 @@ export default {
this.titleClass.textAlign = customStyle.text.hPosition this.titleClass.textAlign = customStyle.text.hPosition
this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : '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.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' this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'
@ -325,10 +314,12 @@ export default {
const _chartType = this.getChartType(yaxisList[_index].chartType); const _chartType = this.getChartType(yaxisList[_index].chartType);
if (_chartType === "column") { if (_labelSetting) {
_labelSetting.position = labelPosition; if (_chartType === "column") {
} else { _labelSetting.position = labelPosition;
_labelSetting.position = undefined; } else {
_labelSetting.position = undefined;
}
} }
return { return {
@ -378,10 +369,12 @@ export default {
const _chartType = this.getChartType(yaxisExtList[_index].chartType); const _chartType = this.getChartType(yaxisExtList[_index].chartType);
if (_chartType === "column") { if (_labelSetting) {
_labelSetting.position = labelPosition; if (_chartType === "column") {
} else { _labelSetting.position = labelPosition;
_labelSetting.position = undefined; } else {
_labelSetting.position = undefined;
}
} }
return { return {

View File

@ -59,10 +59,10 @@
</template> </template>
<script> <script>
import ColorSelector from '@/components/selector/ColorSelector' import ColorSelector from '../../../components/selector/ColorSelector'
import TitleSelector from '@/components/selector/TitleSelector' import TitleSelector from '../../../components/selector/TitleSelector'
import TooltipSelectorAntV from '@/components/selector/TooltipSelectorAntV' import TooltipSelectorAntV from '../../../components/selector/TooltipSelectorAntV'
import LabelSelector from '@/components/selector/LabelSelector.vue' import LabelSelector from '../../../components/selector/LabelSelector.vue'
import messages from '@/de-base/lang/messages' import messages from '@/de-base/lang/messages'
export default { export default {
components: { components: {

View File

@ -150,7 +150,7 @@ public class RaceBarService extends ViewPluginService {
data.forEach(ss -> { data.forEach(ss -> {
xs.add(ss[encode.get("y")]); 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)) { if (!keySet.contains(key)) {
keySet.add(key); keySet.add(key);
keyList.add(key); keyList.add(key);
@ -160,7 +160,7 @@ public class RaceBarService extends ViewPluginService {
Map<String, List<String[]>> groupData = data.stream().collect(Collectors.toMap( 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 -> { v -> {
List<String[]> list = new ArrayList<>(); List<String[]> list = new ArrayList<>();
list.add(v); list.add(v);
@ -179,6 +179,7 @@ public class RaceBarService extends ViewPluginService {
map.put("xs", xs); map.put("xs", xs);
return map; return map;
} }

View File

@ -76,6 +76,11 @@ export default {
return ['drill'] return ['drill']
} }
}, },
inScreen: {
type: Boolean,
required: false,
default: true
},
searchCount: { searchCount: {
type: Number, type: Number,
required: false, required: false,
@ -393,6 +398,8 @@ export default {
this.myChart.on('finished', () => { this.myChart.on('finished', () => {
this.loading = false this.loading = false
}) })
this.currentIndex = 0;
}) })
}, },
loadThemeStyle() { loadThemeStyle() {
@ -594,7 +601,7 @@ export default {
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c' chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
} }
} }
if (chart_option.tooltip) { if (chart_option.tooltip && this.inScreen) {
chart_option.tooltip.appendToBody = true chart_option.tooltip.appendToBody = true
} }

View File

@ -105,9 +105,9 @@
</template> </template>
<script> <script>
import SankeyDimensionItem from '@/components/views/SankeyDimensionItem' import SankeyDimensionItem from '../../../components/views/SankeyDimensionItem'
import SankeyQuotaItem from '@/components/views/SankeyQuotaItem' import SankeyQuotaItem from '../../../components/views/SankeyQuotaItem'
import FilterItem from '@/components/views/FilterItem' import FilterItem from '../../../components/views/FilterItem'
import messages from '@/de-base/lang/messages' import messages from '@/de-base/lang/messages'
export default { export default {

View File

@ -9,12 +9,12 @@
v-if="chart.type && antVRenderStatus" v-if="chart.type && antVRenderStatus"
v-show="title_show" v-show="title_show"
ref="title" ref="title"
:style="title_class" :style="titleClass"
style="cursor: default;display: block;" style="cursor: default;display: block;"
> >
<div style="padding:4px 4px 0;margin: 0;"> <div style="padding:4px 4px 0;margin: 0;">
<chart-title-update <chart-title-update
:title-class="title_class" :title-class="titleClass"
:chart-info="chartInfo" :chart-info="chartInfo"
:bus="bus" :bus="bus"
:axios-request="axiosRequest" :axios-request="axiosRequest"
@ -33,11 +33,11 @@
<script> <script>
import {Sankey} from '@antv/g2plot' import {Sankey} from '@antv/g2plot'
import {uuid, hexColorToRGBA} from '@/utils/sankey' import {uuid, hexColorToRGBA} from '../../../utils/sankey'
import ViewTrackBar from '@/components/views/ViewTrackBar' import ViewTrackBar from '../../../components/views/ViewTrackBar'
import {getRemark} from "@/components/views/utils"; import {getRemark} from "../../../components/views/utils";
import {DEFAULT_TITLE_STYLE} from '@/utils/map'; import {DEFAULT_TITLE_STYLE} from '../../../utils/map';
import ChartTitleUpdate from '@/components/views/ChartTitleUpdate'; import ChartTitleUpdate from '../../../components/views/ChartTitleUpdate';
import _ from 'lodash'; import _ from 'lodash';
import {clear} from 'size-sensor' import {clear} from 'size-sensor'
@ -121,16 +121,6 @@ export default {
fontWeight: 'normal', fontWeight: 'normal',
background: hexColorToRGBA('#ffffff', 0) background: hexColorToRGBA('#ffffff', 0)
}, },
title_class: {
margin: '0 0',
width: '100%',
fontSize: '18px',
color: '#303133',
textAlign: 'left',
fontStyle: 'normal',
fontWeight: 'normal',
background: ''
},
linkageActiveParam: null, linkageActiveParam: null,
linkageActiveHistory: false, linkageActiveHistory: false,
CHART_CONT_FAMILY_MAP: { CHART_CONT_FAMILY_MAP: {
@ -244,7 +234,6 @@ export default {
this.titleClass.textAlign = customStyle.text.hPosition this.titleClass.textAlign = customStyle.text.hPosition
this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal' this.titleClass.fontStyle = customStyle.text.isItalic ? 'italic' : 'normal'
this.titleClass.fontWeight = customStyle.text.isBolder ? 'bold' : '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.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' this.titleClass.letterSpacing = (customStyle.text.letterSpace ? customStyle.text.letterSpace : '0') + 'px'

View File

@ -59,10 +59,10 @@
</template> </template>
<script> <script>
import ColorSelector from '@/components/selector/ColorSelector' import ColorSelector from '../../../components/selector/ColorSelector'
import TitleSelector from '@/components/selector/TitleSelector' import TitleSelector from '../../../components/selector/TitleSelector'
import TooltipSelectorAntV from '@/components/selector/TooltipSelectorAntV' import TooltipSelectorAntV from '../../../components/selector/TooltipSelectorAntV'
import LabelSelector from '@/components/selector/LabelSelector.vue' import LabelSelector from '../../../components/selector/LabelSelector.vue'
import messages from '@/de-base/lang/messages' import messages from '@/de-base/lang/messages'
export default { export default {
components: { components: {