feat: 添加显示更多的选项
This commit is contained in:
79
nezha-fronted/src/components/chart/chartHeaderMixin.js
Normal file
79
nezha-fronted/src/components/chart/chartHeaderMixin.js
Normal file
@@ -0,0 +1,79 @@
|
||||
export default {
|
||||
props: {
|
||||
chartInfo: Object,
|
||||
from: String,
|
||||
isGroup: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
error: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isError: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
chartData: {},
|
||||
showAllData: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
allDataLength: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
dropdownMenuShow: false,
|
||||
errorText: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showFullscreen () {
|
||||
this.$emit('showFullscreen', true)
|
||||
},
|
||||
refreshChart () {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
editChart () {
|
||||
// this.$emit('edit-chart', this.chartInfo)
|
||||
this.$store.dispatch('dispatchEditChart', {
|
||||
chart: this.chartInfo,
|
||||
type: 'edit'
|
||||
})
|
||||
},
|
||||
removeChart () {
|
||||
this.$store.dispatch('dispatchDelChart', {
|
||||
chart: this.chartInfo,
|
||||
type: 'delete'
|
||||
})
|
||||
},
|
||||
duplicate () {
|
||||
this.$store.dispatch('dispatchEditChart', {
|
||||
chart: this.chartInfo,
|
||||
type: 'duplicate'
|
||||
})
|
||||
},
|
||||
clickos () {
|
||||
this.dropdownMenuShow = false
|
||||
},
|
||||
groupShow () {
|
||||
this.$emit('groupShow', !this.chartInfo.param.collapse)
|
||||
},
|
||||
loadMore () {
|
||||
this.$emit('loadMore')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isError: {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
if (n) {
|
||||
this.errorText = this.chartData.filter(item => item.error).map(item => item.error).join('\n')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user