feat(视图): 下钻字段支持设置显示名称 #9226
This commit is contained in:
parent
4e842580bf
commit
ce99f03cd0
@ -146,7 +146,13 @@
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
icon="el-icon-edit-outline"
|
||||
divided
|
||||
:command="beforeClickItem('rename')"
|
||||
>
|
||||
<span>{{ $t('chart.show_name_set') }}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
icon="el-icon-delete"
|
||||
:command="beforeClickItem('remove')"
|
||||
@ -161,7 +167,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getItemType } from '@/views/chart/components/dragItem/utils'
|
||||
import { getItemType, getOriginFieldName } from '@/views/chart/components/dragItem/utils'
|
||||
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
@ -234,6 +240,9 @@ export default {
|
||||
return
|
||||
}
|
||||
switch (param.type) {
|
||||
case 'rename':
|
||||
this.showRename()
|
||||
break
|
||||
case 'remove':
|
||||
this.removeItem()
|
||||
break
|
||||
@ -246,6 +255,15 @@ export default {
|
||||
type: type
|
||||
}
|
||||
},
|
||||
showRename() {
|
||||
this.item.index = this.index
|
||||
this.item.renameType = 'drill'
|
||||
if (this.specialType) {
|
||||
this.item.renameType = this.specialType
|
||||
}
|
||||
this.item.dsFieldName = getOriginFieldName(this.dimensionData, this.quotaData, this.item)
|
||||
this.$emit('onNameEdit', this.item)
|
||||
},
|
||||
removeItem() {
|
||||
this.item.index = this.index
|
||||
this.$emit('onDimensionItemRemove', this.item)
|
||||
|
||||
@ -1186,6 +1186,7 @@
|
||||
:chart="chart"
|
||||
@onDimensionItemChange="drillItemChange"
|
||||
@onDimensionItemRemove="drillItemRemove"
|
||||
@onNameEdit="showRename"
|
||||
@onCustomSort="item => onCustomSort(item, 'drillFields')"
|
||||
/>
|
||||
</transition-group>
|
||||
@ -3202,6 +3203,8 @@ export default {
|
||||
this.view.xaxisExt[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'extStack') {
|
||||
this.view.extStack[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'drill') {
|
||||
this.view.drillFields[this.itemForm.index].name = this.itemForm.name
|
||||
}
|
||||
this.calcData(true)
|
||||
this.closeRename()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user