revert: rollback

This commit is contained in:
junjun 2022-05-11 13:11:59 +08:00
parent 2e0d919066
commit 6b12ba6a20
13 changed files with 34 additions and 179 deletions

View File

@ -49,8 +49,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort
data_from
) SELECT
id,
`name`,
@ -79,8 +78,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort from chart_view
data_from from chart_view
WHERE
chart_view.id = #{id}
</insert>
@ -114,8 +112,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort
data_from
) SELECT
#{newViewId} as id,
`name`,
@ -144,8 +141,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort from chart_view_cache
data_from from chart_view_cache
WHERE
chart_view_cache.id = #{sourceViewId}
</insert>
@ -179,8 +175,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort
data_from
) SELECT
id,
`name`,
@ -209,8 +204,7 @@
drill_fields,
senior,
SNAPSHOT,
data_from,
custom_sort from chart_view
data_from from chart_view
WHERE
chart_view.scene_id = #{panelId}
</insert>
@ -293,8 +287,7 @@
`chart_type`,
`is_plugin`,
`senior`,
`data_from`,
`custom_sort`)
`data_from`)
SELECT #{newChartId},
GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `name`,
#{panelId},
@ -322,8 +315,7 @@
'private',
`is_plugin`,
`senior`,
`data_from`,
`custom_sort`
`data_from`
FROM chart_view
WHERE id = #{oldChartId}
</insert>
@ -373,8 +365,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
data_from,
custom_sort)
data_from)
SELECT pv_copy.chart_view_id AS id,
`name`,
title,
@ -401,8 +392,7 @@
custom_filter,
drill_fields,
SNAPSHOT,
data_from,
custom_sort
data_from
FROM (
SELECT panel_id,
copy_from_view,
@ -512,8 +502,7 @@
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from,
cv.custom_sort = cve.custom_sort
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id in
<foreach collection="viewIds" item="viewId" open='(' separator=',' close=')'>
#{viewId}
@ -549,8 +538,7 @@
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from,
cv.custom_sort = cve.custom_sort
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id =#{viewId}
</update>
@ -584,8 +572,7 @@
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from,
cv.custom_sort = cve.custom_sort
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id =#{viewId}
</update>

View File

@ -1,4 +0,0 @@
ALTER TABLE `chart_view` ADD COLUMN `custom_sort` LONGTEXT COMMENT '自定义排序';
UPDATE `chart_view` SET `custom_sort` = '[]';
ALTER TABLE `chart_view_cache` ADD COLUMN `custom_sort` LONGTEXT COMMENT '自定义排序';
UPDATE `chart_view_cache` SET `custom_sort` = '[]';

View File

@ -1096,7 +1096,7 @@ export default {
formatter_decimal_count_error: 'Range 0-10',
gauge_threshold_compare_error: 'Range must added',
tick_count: 'Tick Split',
custom_sort: 'Custom Sort',
custom_sort: 'Custom',
custom_sort_tip: 'Custom sort field first',
clean_custom_sort: 'Clean'
},

View File

@ -1096,7 +1096,7 @@ export default {
formatter_decimal_count_error: '請輸入0-10的整數',
gauge_threshold_compare_error: '阈值範圍需逐級遞增',
tick_count: '刻度間隔數',
custom_sort: '自定義排序',
custom_sort: '自定義',
custom_sort_tip: '自定義排序優先級高於字段排序',
clean_custom_sort: '清除自定義排序'
},

View File

@ -1098,7 +1098,7 @@ export default {
formatter_decimal_count_error: '请输入0-10的整数',
gauge_threshold_compare_error: '阈值范围需逐级递增',
tick_count: '刻度间隔数',
custom_sort: '自定义排序',
custom_sort: '自定义',
custom_sort_tip: '自定义排序优先级高于字段排序',
clean_custom_sort: '清除自定义排序'
},

View File

@ -10,7 +10,6 @@ import {
getSlider,
getAnalyse
} from '@/views/chart/chart/common/common_antv'
import { customSort } from '@/views/chart/chart/util'
export function baseBarOptionAntV(plot, container, chart, action, isGroup, isStack) {
// theme
@ -23,13 +22,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -129,13 +122,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)

View File

@ -1,6 +1,5 @@
import { getLabel, getLegend, getPadding, getTheme, getTooltip } from '@/views/chart/chart/common/common_antv'
import { Funnel } from '@antv/g2plot'
import { customSort } from '@/views/chart/chart/util'
export function baseFunnelOptionAntV(plot, container, chart, action) {
// theme
@ -11,13 +10,7 @@ export function baseFunnelOptionAntV(plot, container, chart, action) {
// style
const legend = getLegend(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// options
const options = {
theme: theme,

View File

@ -10,7 +10,6 @@ import {
getSlider,
getAnalyse
} from '@/views/chart/chart/common/common_antv'
import { customSort } from '@/views/chart/chart/util'
export function baseLineOptionAntV(plot, container, chart, action) {
// theme
@ -23,13 +22,7 @@ export function baseLineOptionAntV(plot, container, chart, action) {
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -121,13 +114,7 @@ export function baseAreaOptionAntV(plot, container, chart, action) {
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)

View File

@ -7,7 +7,6 @@ import {
} from '@/views/chart/chart/common/common_antv'
import { Pie, Rose } from '@antv/g2plot'
import { customSort } from '@/views/chart/chart/util'
export function basePieOptionAntV(plot, container, chart, action) {
// theme
@ -18,13 +17,7 @@ export function basePieOptionAntV(plot, container, chart, action) {
// style
const legend = getLegend(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// options
const options = {
theme: theme,
@ -113,13 +106,7 @@ export function basePieRoseOptionAntV(plot, container, chart, action) {
// style
const legend = getLegend(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// options
const options = {
theme: theme,

View File

@ -1,6 +1,5 @@
import { getLabel, getLegend, getPadding, getTheme, getTooltip } from '@/views/chart/chart/common/common_antv'
import { Radar } from '@antv/g2plot'
import { customSort } from '@/views/chart/chart/util'
export function baseRadarOptionAntV(plot, container, chart, action) {
// theme
@ -11,13 +10,7 @@ export function baseRadarOptionAntV(plot, container, chart, action) {
// style
const legend = getLegend(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
const xAxis = {
tickLine: null,

View File

@ -11,7 +11,6 @@ import {
} from '@/views/chart/chart/common/common_antv'
import { Scatter } from '@antv/g2plot'
import { customSort } from '@/views/chart/chart/util'
export function baseScatterOptionAntV(plot, container, chart, action) {
// theme
@ -24,13 +23,7 @@ export function baseScatterOptionAntV(plot, container, chart, action) {
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)

View File

@ -1,6 +1,5 @@
import {
getLabel,
getLegend,
getPadding,
getTheme,
getTooltip,
@ -8,7 +7,6 @@ import {
getYAxis
} from '@/views/chart/chart/common/common_antv'
import { Waterfall } from '@antv/g2plot'
import { customSort } from '@/views/chart/chart/util'
export function baseWaterfallOptionAntV(plot, container, chart, action) {
// theme
@ -28,13 +26,7 @@ export function baseWaterfallOptionAntV(plot, container, chart, action) {
delete yAxis.maxLimit
}
// data
let data
const cus = JSON.parse(chart.customSort)
if (cus && cus.length > 0) {
data = customSort(cus, chart.data.datas)
} else {
data = chart.data.datas
}
const data = chart.data.datas
// total
const total = {
label: '合计',

View File

@ -347,15 +347,6 @@
<span
v-else-if="view.type && view.type === 'table-info'"
>{{ $t('chart.dimension_or_quota') }}</span>
<!--自定义排序-->
<i
v-if="false && view.render === 'antv' && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('funnel') || view.type.includes('pie') || view.type.includes('radar') || view.type.includes('scatter') || view.type.includes('waterfall'))"
style="margin-left: 4px;cursor: pointer;"
class="el-icon-sort"
:title="$t('chart.custom_sort')"
@click="customSort"
/>
</span>
<draggable
v-model="view.xaxis"
@ -364,8 +355,7 @@
:move="onMove"
class="drag-block-style"
@add="addXaxis"
@update="resetCustomSort"
@remove="resetCustomSort"
@update="calcData(true)"
>
<transition-group class="draggable-group">
<dimension-item
@ -944,25 +934,6 @@
<el-button type="primary" size="mini" @click="saveValueFormatter">{{ $t('chart.confirm') }}</el-button>
</div>
</el-dialog>
<!--自定义排序-->
<el-dialog
v-if="showCustomSort"
v-dialogDrag
:title="$t('chart.custom_sort')"
:visible="showCustomSort"
:show-close="false"
width="500px"
class="dialog-css"
>
<!-- <value-formatter-edit :formatter-item="valueFormatterItem" :chart="chart" />-->
<custom-sort-edit :chart="chart" @onSortChange="customSortChange" />
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeCustomSort">{{ $t('chart.cancel') }}</el-button>
<el-button size="mini" @click="resetCustomSort">{{ $t('chart.clean_custom_sort') }}</el-button>
<el-button type="primary" size="mini" @click="saveCustomSort">{{ $t('chart.confirm') }}</el-button>
</div>
</el-dialog>
</el-row>
</template>
@ -1024,13 +995,11 @@ import Threshold from '@/views/chart/components/senior/Threshold'
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
import { pluginTypes } from '@/api/chart/chart'
import ValueFormatterEdit from '@/views/chart/components/value-formatter/ValueFormatterEdit'
import CustomSortEdit from '@/views/chart/components/compare/CustomSortEdit'
import ChartStyle from '@/views/chart/view/ChartStyle'
export default {
name: 'ChartEdit',
components: {
ChartStyle,
CustomSortEdit,
ValueFormatterEdit,
LabelNormalText,
Threshold,
@ -1111,8 +1080,7 @@ export default {
},
customFilter: [],
render: 'antv',
isPlugin: false,
customSort: []
isPlugin: false
},
moveId: -1,
chart: {
@ -1163,9 +1131,7 @@ export default {
preChartId: '',
pluginRenderOptions: [],
showValueFormatter: false,
valueFormatterItem: {},
showCustomSort: false,
customSortList: []
valueFormatterItem: {}
}
},
@ -1258,7 +1224,6 @@ export default {
this.resetDrill()
this.initFromPanel()
this.getChart(this.param.id)
this.getData(this.param.id)
},
bindPluginEvent() {
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
@ -1525,7 +1490,6 @@ export default {
view.drillFields = JSON.stringify(view.drillFields)
view.extBubble = JSON.stringify(view.extBubble)
view.senior = JSON.stringify(view.senior)
view.customSort = JSON.stringify(view.customSort)
delete view.data
return view
},
@ -1595,7 +1559,6 @@ export default {
view.customStyle = JSON.stringify(this.view.customStyle)
view.customFilter = JSON.stringify(this.view.customFilter)
view.senior = JSON.stringify(this.view.senior)
view.customSort = JSON.stringify(this.view.customSort)
view.title = this.view.title
view.stylePriority = this.view.stylePriority
// view.data = this.data
@ -1661,7 +1624,6 @@ export default {
this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {}
this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {}
this.view.senior = this.view.senior ? JSON.parse(this.view.senior) : {}
this.view.customSort = this.view.customSort ? JSON.parse(this.view.customSort) : []
// echart
this.chart = response.data
this.data = response.data.data
@ -1713,7 +1675,6 @@ export default {
this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {}
this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {}
this.view.senior = this.view.senior ? JSON.parse(this.view.senior) : {}
this.view.customSort = this.view.customSort ? JSON.parse(this.view.customSort) : []
// echart
this.chart = response.data
@ -2113,7 +2074,7 @@ export default {
if ((this.view.type === 'map' || this.view.type === 'word-cloud' || this.view.type === 'label') && this.view.xaxis.length > 1) {
this.view.xaxis = [this.view.xaxis[0]]
}
this.resetCustomSort()
this.calcData(true)
},
addXaxisExt(e) {
if (this.view.type !== 'table-info') {
@ -2236,12 +2197,12 @@ export default {
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.getData(this.param.id)
this.calcData(true, 'chart', false, false)
}
} else {
this.drillClickDimensionList.push({ dimensionList: param.data.dimensionList })
this.getData(this.param.id)
// this.getData(this.param.id)
this.calcData(true, 'chart', false, false)
}
} else if (this.view.drillFields.length > 0) {
@ -2276,7 +2237,7 @@ export default {
this.backToParent(index, length)
}
this.getData(this.param.id)
// this.getData(this.param.id)
this.calcData(true, 'chart', false, false)
},
//
@ -2359,7 +2320,7 @@ export default {
resetViewCacheCallBack(_this.param.id, _this.panelInfo.id, function(rsp) {
_this.changeEditStatus(false)
_this.getChart(_this.param.id, 'panel')
_this.getData(_this.param.id)
// _this.getData(_this.param.id)
bus.$emit('view-in-cache', { type: 'propChange', viewId: _this.param.id })
})
},
@ -2424,27 +2385,6 @@ export default {
}
this.calcData(true)
this.closeValueFormatter()
},
customSort() {
this.showCustomSort = true
},
customSortChange(val) {
this.customSortList = val
},
closeCustomSort() {
this.showCustomSort = false
},
saveCustomSort() {
this.view.customSort = JSON.parse(JSON.stringify(this.customSortList))
this.calcData(true)
this.closeCustomSort()
},
resetCustomSort() {
this.chart.customSort = []
this.view.customSort = []
this.calcData(true)
this.closeCustomSort()
}
}
}