forked from github/dataease
feat(视图): 视图计算字段支持复制
This commit is contained in:
parent
a48ea79e9b
commit
4ed62c396d
@ -242,6 +242,12 @@
|
|||||||
:label="$t('dataset.operator')"
|
:label="$t('dataset.operator')"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="copyField(scope.row)"
|
||||||
|
>{{ $t('dataset.copy') }}
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.extField !== 0"
|
v-if="scope.row.extField !== 0"
|
||||||
type="text"
|
type="text"
|
||||||
@ -493,6 +499,7 @@
|
|||||||
</el-collapse>
|
</el-collapse>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
|
v-if="editCalcField"
|
||||||
:visible.sync="editCalcField"
|
:visible.sync="editCalcField"
|
||||||
class="de-dialog-form de-center-dialog"
|
class="de-dialog-form de-center-dialog"
|
||||||
width="980px"
|
width="980px"
|
||||||
@ -512,6 +519,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { post } from '@/api/dataset/dataset'
|
import { post } from '@/api/dataset/dataset'
|
||||||
import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
|
import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
|
||||||
|
import { getFieldName } from '@/views/dataset/data/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartFieldEdit',
|
name: 'ChartFieldEdit',
|
||||||
@ -657,6 +665,33 @@ export default {
|
|||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
copyField(item) {
|
||||||
|
const param = { ...item }
|
||||||
|
param.id = null
|
||||||
|
param.extField = 2
|
||||||
|
param.originName =
|
||||||
|
item.extField === 2 ? item.originName : '[' + item.id + ']'
|
||||||
|
param.name = getFieldName(
|
||||||
|
this.tableFields.dimensionListData.concat(
|
||||||
|
this.tableFields.quotaListData
|
||||||
|
),
|
||||||
|
item.name
|
||||||
|
)
|
||||||
|
param.dataeaseName = null
|
||||||
|
param.lastSyncTime = null
|
||||||
|
param.columnIndex =
|
||||||
|
this.tableFields.dimensionListData.length +
|
||||||
|
this.tableFields.quotaListData.length
|
||||||
|
|
||||||
|
post('/chart/field/save/' + this.panelInfo.id, param)
|
||||||
|
.then((response) => {
|
||||||
|
this.initField()
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.initField()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user