fix: 修复图表block刷新按钮无效的问题
This commit is contained in:
@@ -103,6 +103,9 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.panel__time {
|
||||
top: 7px;
|
||||
}
|
||||
.header__operation-btn {
|
||||
margin-left: 12px;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -396,7 +396,7 @@ export default {
|
||||
isError: Boolean,
|
||||
table: Object,
|
||||
timeFilter: Object,
|
||||
orderPieTable: Object,
|
||||
orderPieTable: String,
|
||||
tabHandleClickType: String
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -264,7 +264,7 @@ export default {
|
||||
default: false
|
||||
},
|
||||
table: Object,
|
||||
orderPieTable: Object
|
||||
orderPieTable: String
|
||||
},
|
||||
components: {
|
||||
ChartError
|
||||
|
||||
@@ -266,14 +266,16 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
} else if (this.isGroup || this.isTabs) {
|
||||
this.$refs.chart.$refs.chart.reload()
|
||||
this.$refs.chart && this.$refs.chart.$refs.chart && this.$refs.chart.$refs.chart.reload()
|
||||
} else if (this.isBlock) {
|
||||
if (!this.chartInfo.firstShow) {
|
||||
this.chartInfo.firstShow = true
|
||||
} else {
|
||||
if (this.$refs.chart && this.$refs.chart.$refs.chart) {
|
||||
this.$refs.chart.$refs.chart.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
setTimeout(() => {
|
||||
@@ -400,7 +402,7 @@ export default {
|
||||
const dateRangeValue = 60
|
||||
const { startTime, endTime } = getNowTime(dateRangeValue)
|
||||
const chartTimeFilter = ref({ startTime, endTime, dateRangeValue })
|
||||
const table = ref('')
|
||||
const table = ref({})
|
||||
if (isBasicTable(props.chartInfo.type)) {
|
||||
table.value = {
|
||||
pageSize: chartTableDefaultPageSize,
|
||||
|
||||
@@ -11,22 +11,18 @@
|
||||
<script>
|
||||
import chartMixin from '@/views/charts/charts/chart-mixin'
|
||||
import _ from 'lodash'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'ChartBlock',
|
||||
mixins: [chartMixin],
|
||||
data () {
|
||||
return {
|
||||
time: {},
|
||||
firstShow: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.firstShow = true
|
||||
},
|
||||
methods: {
|
||||
reload () {
|
||||
this.dataList = _.cloneDeep(this.dataList)
|
||||
const t = _.cloneDeep(this.dataList)
|
||||
this.dataList = []
|
||||
this.$nextTick(() => {
|
||||
this.dataList = t
|
||||
})
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
@@ -36,7 +32,7 @@ export default {
|
||||
return data1.x - data2.x
|
||||
})
|
||||
}
|
||||
const dataList = copyAndSort(props.chartInfo.children)
|
||||
const dataList = ref(copyAndSort(props.chartInfo.children))
|
||||
return {
|
||||
copyAndSort,
|
||||
dataList
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
props: {
|
||||
resultType: Object,
|
||||
queryParams: Object,
|
||||
orderPieTable: Object
|
||||
orderPieTable: String
|
||||
},
|
||||
components: {
|
||||
PieTable
|
||||
|
||||
Reference in New Issue
Block a user