dev
黄欣 4 years ago
parent 336f3dd82e
commit e6354b9ae7

@ -286,6 +286,27 @@
<span class="drag-placeholder-style-span">{{ $t('chart.placeholder_field') }}</span>
</div>
</el-row>
<el-row v-if="view.type && view.type === 'table-normal'" class="padding-lr">
<span style="width: 80px;text-align: right;">
<span>{{ $t('chart.drag_block_table_data_row') }}</span>
/
<span>{{ $t('chart.dimension') }}</span>
</span>
<draggable
v-model="view.yaxisExt"
:disabled="!hasDataPermission('manage',param.privileges)"
group="drag"
animation="300"
:move="onMove"
class="drag-block-style"
@add="addRowXaxis"
@update="save(true)"
>
<transition-group class="draggable-group">
<dimension-item v-for="(item,index) in view.yaxisExt" :key="item.id" :show-sort="false" :param="param" :index="index" :item="item" @onDimensionItemRemove="dimensionRowItemRemove" @onNameEdit="showRename" />
</transition-group>
</draggable>
</el-row>
<el-row v-if="view.type !=='table-info'" class="padding-lr" style="margin-top: 6px;">
<span style="width: 80px;text-align: right;">
<span v-if="view.type && view.type.includes('table')">{{ $t('chart.drag_block_table_data_column') }}</span>
@ -920,7 +941,7 @@ export default {
ele.filter = []
}
})
if (view.type === 'chart-mix') {
if (view.type === 'chart-mix' || view.type === 'table-normal') {
view.yaxisExt.forEach(function(ele) {
if (!ele.chartType) {
ele.chartType = 'bar'
@ -1046,6 +1067,10 @@ export default {
this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {}
this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {}
this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {}
console.log(this.view.xaxis)
console.log(this.view.yaxis)
console.log(this.view.yaxisExt)
console.log(this.view.type)
// echart
this.chart = response.data
this.data = response.data.data
@ -1120,6 +1145,11 @@ export default {
this.save(true)
},
dimensionRowItemRemove(item) {
this.view.yaxisExt.splice(item.index, 1)
this.save(true)
},
quotaItemChange(item) {
// item
// this.view.yaxis.forEach(function(ele) {
@ -1405,6 +1435,12 @@ export default {
this.dragMoveDuplicate(this.view.xaxis, e)
this.save(true)
},
addRowXaxis(e) {
this.view.yaxisExt = [this.view.yaxisExt[0]]
this.dragCheckType(this.view.yaxisExt, 'd')
this.dragMoveDuplicate(this.view.yaxisExt, e)
this.save(true)
},
addYaxis(e) {
if (this.view.type === 'map' && this.view.yaxis.length > 1) {
this.view.yaxis = [this.view.yaxis[0]]

Loading…
Cancel
Save