This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/views/charts/ChartHeader.vue

54 lines
1.3 KiB
Vue
Raw Normal View History

2022-01-16 23:16:00 +08:00
<template>
<div class="chart-header" :class="{'chart-header--title-chart': isTitle}">
<div class="chart-header__title">{{chartInfo.name}}</div>
<chart-error :isError="isError" :errorInfo="errorInfo"></chart-error>
2022-01-17 17:06:14 +08:00
<div class="chart-header__tools" v-if="!isTitle && !isTabs">
2022-01-16 23:16:00 +08:00
<el-popover trigger="click" placement="top" :content="chartInfo.remark" v-if="chartInfo.remark">
<template #reference>
<span class="header__operation-btn"><i class="cn-icon el-icon-info"></i></span>
</template>
</el-popover>
<span class="header__operation-btn" @click="refresh"><i class="cn-icon cn-icon-refresh"></i></span>
</div>
</div>
</template>
<script>
2022-01-17 17:06:14 +08:00
import { isTitle, isTabs } from './charts/tools'
2022-01-16 23:16:00 +08:00
import ChartError from '@/components/charts/ChartError'
export default {
name: 'ChartHeader',
props: {
chartInfo: Object,
errorInfo: {
type: String,
default: ''
},
isError: {
type: Boolean,
default: false
}
},
components: {
ChartError
},
data () {
return {
dropdownMenuShow: false,
errorText: ''
}
},
methods: {
refresh () {
this.$emit('refresh')
}
},
setup (props) {
return {
2022-01-17 17:06:14 +08:00
isTitle: isTitle(props.chartInfo.type),
isTabs: isTabs(props.chartInfo.type)
2022-01-16 23:16:00 +08:00
}
}
}
</script>