提交 beeae23d authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' of github.com:dataease/dataease into dev

...@@ -433,7 +433,7 @@ public class DataSetTableService { ...@@ -433,7 +433,7 @@ public class DataSetTableService {
} }
try { try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()))); datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow())));
dataSetPreviewPage.setTotal(Integer.valueOf(jdbcProvider.getData(datasourceRequest).get(0)[0])); dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -480,7 +480,7 @@ public class DataSetTableService { ...@@ -480,7 +480,7 @@ public class DataSetTableService {
try { try {
datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow()))); datasourceRequest.setQuery(qp.createQueryTableWithLimit(table, fields, Integer.valueOf(dataSetTableRequest.getRow())));
dataSetPreviewPage.setTotal(Integer.valueOf(jdbcProvider.getData(datasourceRequest).get(0)[0])); dataSetPreviewPage.setTotal(jdbcProvider.getData(datasourceRequest).size());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -592,7 +592,7 @@ export default { ...@@ -592,7 +592,7 @@ export default {
create_view: 'Create Chart', create_view: 'Create Chart',
data_preview: 'Data preview', data_preview: 'Data preview',
dimension: 'Dimension', dimension: 'Dimension',
quota: 'Index', quota: 'Quota',
title: 'Title', title: 'Title',
show: 'Show', show: 'Show',
chart_type: 'Chart Type', chart_type: 'Chart Type',
......
...@@ -26,6 +26,7 @@ const getters = { ...@@ -26,6 +26,7 @@ const getters = {
licMsg: state => state.lic.licMsg, licMsg: state => state.lic.licMsg,
uiInfo: state => state.user.uiInfo, uiInfo: state => state.user.uiInfo,
conditions: state => state.conditions.conditions, conditions: state => state.conditions.conditions,
msgTypes: state => state.msg.msgTypes msgTypes: state => state.msg.msgTypes,
geoMap: state => state.map.geoMap
} }
export default getters export default getters
...@@ -12,6 +12,7 @@ import panel from './modules/panel' ...@@ -12,6 +12,7 @@ import panel from './modules/panel'
import application from './modules/application' import application from './modules/application'
import lic from './modules/lic' import lic from './modules/lic'
import msg from './modules/msg' import msg from './modules/msg'
import map from './modules/map'
import animation from '@/components/canvas/store/animation' import animation from '@/components/canvas/store/animation'
import compose from '@/components/canvas/store/compose' import compose from '@/components/canvas/store/compose'
import contextmenu from '@/components/canvas/store/contextmenu' import contextmenu from '@/components/canvas/store/contextmenu'
...@@ -185,7 +186,8 @@ const data = { ...@@ -185,7 +186,8 @@ const data = {
panel, panel,
application, application,
lic, lic,
msg msg,
map
}, },
getters getters
} }
......
const state = {
geoMap: {}
}
const mutations = {
SET_GEO: (state, { key, value }) => {
state.geoMap[key] = value
}
}
const actions = {
setGeo({ commit }, data) {
commit('SET_GEO', data)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
...@@ -35,7 +35,8 @@ export default { ...@@ -35,7 +35,8 @@ export default {
data() { data() {
return { return {
myChart: {}, myChart: {},
chartId: uuid.v1() chartId: uuid.v1(),
currentGeoJson: null
} }
}, },
watch: { watch: {
...@@ -100,22 +101,33 @@ export default { ...@@ -100,22 +101,33 @@ export default {
const customAttr = JSON.parse(chart.customAttr) const customAttr = JSON.parse(chart.customAttr)
if (!customAttr.areaCode) return if (!customAttr.areaCode) return
let areaJson if (this.currentGeoJson) {
if ((areaJson = localStorage.getItem('areaJson' + customAttr.areaCode)) !== null) { this.initMapChart(this.currentGeoJson, chart)
this.initMapChart(areaJson, chart)
return return
} }
if (this.$store.getters.geoMap[customAttr.areaCode]) {
this.currentGeoJson = this.$store.getters.geoMap[customAttr.areaCode]
this.initMapChart(this.currentGeoJson, chart)
return
}
geoJson(customAttr.areaCode).then(res => { geoJson(customAttr.areaCode).then(res => {
this.initMapChart(res.data, chart) this.initMapChart(res.data, chart)
// localStorage最大容量只有5M,先取消缓存
// localStorage.setItem('areaJson' + customAttr.areaCode, res.data) this.$store.dispatch('map/setGeo', {
key: customAttr.areaCode,
value: res.data
})
this.currentGeoJson = res.data
}) })
return return
} }
this.myEcharts(chart_option) this.myEcharts(chart_option)
}, },
initMapChart(geoJson, chart) { initMapChart(geoJson, chart) {
this.$echarts.registerMap('HK', geoJson) // this.$echarts.registerMap('HK', geoJson)
this.$echarts.getMap('HK') || this.$echarts.registerMap('HK', geoJson)
const base_json = JSON.parse(JSON.stringify(BASE_MAP)) const base_json = JSON.parse(JSON.stringify(BASE_MAP))
const chart_option = baseMapOption(base_json, chart) const chart_option = baseMapOption(base_json, chart)
this.myEcharts(chart_option) this.myEcharts(chart_option)
......
...@@ -117,6 +117,7 @@ export default { ...@@ -117,6 +117,7 @@ export default {
}, },
methods: { methods: {
initTable(id) { initTable(id) {
this.resetPage()
this.tableViewRowForm.row = 1000 this.tableViewRowForm.row = 1000
if (id !== null) { if (id !== null) {
this.fields = [] this.fields = []
...@@ -198,6 +199,14 @@ export default { ...@@ -198,6 +199,14 @@ export default {
msg2Current(sourceParam) { msg2Current(sourceParam) {
this.tabActive = 'updateInfo' this.tabActive = 'updateInfo'
this.table.msgTaskId = sourceParam.taskId this.table.msgTaskId = sourceParam.taskId
},
resetPage() {
this.page = {
page: 1,
pageSize: 100,
show: 1000
}
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论