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
nezha-nezha-fronted/nezha-fronted/src/components/common/chartUnit.vue
chenjinsong ef664be5ef Merge remote-tracking branch 'origin/dev-3.1' into dev-3.1.1_theme
# Conflicts:
#	nezha-fronted/src/assets/css/common.scss
#	nezha-fronted/src/assets/css/common/tableCommon.scss
#	nezha-fronted/src/assets/stylus/main.scss
#	nezha-fronted/src/components/charts/chart-list.vue
#	nezha-fronted/src/components/charts/logs.vue
#	nezha-fronted/src/components/common/alert/alertLabel.vue
#	nezha-fronted/src/components/common/alert/alertRuleInfo.vue
#	nezha-fronted/src/components/common/bottomBox/bottomBox.vue
#	nezha-fronted/src/components/common/bottomBox/tabs/endpointQuery.vue
#	nezha-fronted/src/components/common/bottomBox/tabs/endpointQueryTab.vue
#	nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue
#	nezha-fronted/src/components/common/bottomBox/tabs/panelTabNew.vue
#	nezha-fronted/src/components/common/detailView/list/alertRule/alertRuleDetail.vue
#	nezha-fronted/src/components/common/detailView/list/asset/assetDetail.vue
#	nezha-fronted/src/components/common/detailView/list/dc/dcDetail.vue
#	nezha-fronted/src/components/common/detailView/list/endpoint/endpointDetail.vue
#	nezha-fronted/src/components/common/detailView/list/module/moduleDetail.vue
#	nezha-fronted/src/components/common/detailView/nzDetailView.vue
#	nezha-fronted/src/components/common/detailView/view/detailViewRight.vue
#	nezha-fronted/src/components/common/labelFilter/clickSearch.vue
#	nezha-fronted/src/components/common/multipleTime.vue
#	nezha-fronted/src/components/common/pickTime.vue
#	nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue
#	nezha-fronted/src/components/common/project/L5/topoTooltip.vue
#	nezha-fronted/src/components/common/project/popData/Info.vue
#	nezha-fronted/src/components/common/rightBox/alertRuleBox.vue
#	nezha-fronted/src/components/common/table/alert/alertRuleTable.vue
#	nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue
#	nezha-fronted/src/components/common/table/settings/userTable.vue
#	nezha-fronted/src/components/layout/header.vue
#	nezha-fronted/src/components/page/alert/alertMessage.vue
#	nezha-fronted/src/components/page/alert/nzAlertTag.vue
#	nezha-fronted/src/components/page/asset/components/operation.vue
#	nezha-fronted/src/components/page/config/mibBrowser.vue
#	nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue
#	nezha-fronted/src/components/page/dashboard/explore/logTab.vue
#	nezha-fronted/src/components/page/dashboard/explore/promqlInput.vue
#	nezha-fronted/src/components/page/dashboard/overview/overview2.vue
#	nezha-fronted/src/components/page/dashboard/panel.vue
2021-11-01 18:24:01 +08:00

57 lines
1.5 KiB
Vue

<template>
<div class="top-tool-btn-group">
<button
:id="id+'-open-select'"
class="top-tool-btn top-tool-btn--text"
style="border-radius: 2px 0 0 2px; border-right: none;"
@click="openSeletor"
>{{$t('dashboard.panel.chartForm.unit')}}</button>
<el-cascader :id="id+'-unit-input'" ref="unitSelector" v-model="unit"
:options="chartUnits"
:props="{ expandTrigger: 'click' ,emitPath:false}"
:show-all-levels="false"
class="chart-unit"
placeholder=""
popper-class="prevent-clickoutside unit-pop-class right-box-select-top right-public-box-dropdown-top"
size="small"
style="border-radius: 0 2px 2px 0;"
@change="unitSelected"
>
</el-cascader>
</div>
</template>
<script>
import chartDataFormat from '../charts/chartDataFormat'
export default {
name: 'chartUnit',
model: {
event: 'change',
prop: 'postUnit'
},
props: {
postUnit: {},
id: { type: String, default: 'chart-unit' }
},
data () {
return {
chartUnits: chartDataFormat.unitOptions(),
visibel: false,
unit: 0
}
},
created () {
this.unit = this.postUnit
},
methods: {
unitSelected: function (value) {
this.unit = value
this.$emit('change', this.unit)
},
openSeletor: function () {
this.$refs.unitSelector.toggleDropDownVisible(!this.$refs.unitSelector.dropDownVisible)
}
}
}
</script>