feat:修改联动

main
liu.shiyi 2 years ago
parent 6b463f4e74
commit c7d92e6be2

@ -7,6 +7,7 @@
:key="updateKey" :key="updateKey"
:class="{'light-theme':customTheme === 'light','auto-theme':customTheme =='auto','dark-theme':customTheme =='dark'}" :class="{'light-theme':customTheme === 'light','auto-theme':customTheme =='auto','dark-theme':customTheme =='dark'}"
:config="option" :config="option"
@click="rowClick"
/> />
</div> </div>
</template> </template>
@ -48,6 +49,11 @@ export default {
this.chartInit() this.chartInit()
}, },
methods: { methods: {
//
rowClick (row) {
console.log('点击')
this.linkage(row)
},
dataFormatting (config, data) { dataFormatting (config, data) {
const header = [] const header = []
const dataList = [] const dataList = []

@ -8,6 +8,7 @@
class="ranking-box" class="ranking-box"
:class="{'light-theme':customTheme === 'light','auto-theme':customTheme =='auto','dark-theme':customTheme =='dark'}" :class="{'light-theme':customTheme === 'light','auto-theme':customTheme =='auto','dark-theme':customTheme =='dark'}"
:config="option" :config="option"
@click="rowClick"
/> />
</div> </div>
</template> </template>
@ -49,6 +50,11 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
//
rowClick (row) {
console.log(row)
this.linkage(row)
},
dataFormatting (config, data) { dataFormatting (config, data) {
const dataSourseList = [] const dataSourseList = []
data.data.forEach(item => { data.data.forEach(item => {

@ -27,35 +27,8 @@ export default {
filterList = this.combineFilterList(isInner).filter( filterList = this.combineFilterList(isInner).filter(
field => ![undefined, ''].includes(field.value) field => ![undefined, ''].includes(field.value)
) )
this.dataLinkageHandle(this.config, this.pageInfo.code, filterList) // this.dataLinkageHandle(this.config, this.pageInfo.code, filterList)
}, this.changeData(this.config, filterList)
// 数据联动时改变数据(与点击设置面板的更新按钮及初始化时的数据处理做区分)
async dataLinkageHandle (config, pageCode, filterList) {
const params = {
chart: {
...config,
option: undefined
},
current: 1,
pageCode,
type: config.type,
filterList,
treeParentId: this.treeParentId || '0'
}
this.dataLoading = true
return getUpdateChartInfo(params)
.then(res => {
console.log(2, res)
config = this.buildOption(config, res)
this.changeChartConfig(config)
this.changeChartKey(config.code)
})
.catch(error => {
console.error(error)
})
.finally(() => {
this.dataLoading = false
})
}, },
/** /**
* 联动数据 * 联动数据

Loading…
Cancel
Save