@@ -39,7 +39,8 @@ const props = withDefaults(
3939 chatType? : ChartTypes
4040 enlarge? : boolean
4141 loadingData? : boolean
42- thousandsSeparatorList? : Array <string >
42+ thousandsSeparatorList: Array <string >
43+ showLabel: boolean
4344 }>(),
4445 {
4546 recordId: undefined ,
@@ -48,14 +49,15 @@ const props = withDefaults(
4849 enlarge: false ,
4950 loadingData: false ,
5051 thousandsSeparatorList : () => [],
52+ showLabel: false ,
5153 }
5254)
5355
5456const { copy } = useClipboard ({ legacy: true })
5557const loading = ref <boolean >(false )
5658const { t } = useI18n ()
5759const addViewRef = ref (null )
58- const emits = defineEmits ([' exitFullScreen' , ' update:thousandsSeparatorList' ])
60+ const emits = defineEmits ([' exitFullScreen' , ' update:thousandsSeparatorList' , ' update:showLabel ' ])
5961
6062const dataObject = computed <{
6163 fields: Array <string >
@@ -229,8 +231,6 @@ function showSql() {
229231 sqlShow .value = true
230232}
231233
232- const showLabel = ref (false )
233-
234234function addToDashboard() {
235235 const recordeInfo = {
236236 id: ' 1-1' ,
@@ -368,6 +368,15 @@ watch(
368368 }
369369)
370370
371+ const _showLabel = computed ({
372+ get() {
373+ return props .showLabel
374+ },
375+ set(v ) {
376+ emits (' update:showLabel' , v )
377+ },
378+ })
379+
371380const enableThousandsSeparatorList = computed ({
372381 get() {
373382 return props .thousandsSeparatorList
@@ -434,14 +443,14 @@ function getBaseAxis() {
434443 <el-tooltip
435444 effect =" dark"
436445 :offset =" 8"
437- :content =" showLabel ? t('chat.hide_label') : t('chat.show_label')"
446+ :content =" _showLabel ? t('chat.hide_label') : t('chat.show_label')"
438447 placement =" top"
439448 >
440449 <el-button
441450 class =" tool-btn"
442- :class =" { 'chart-active': showLabel }"
451+ :class =" { 'chart-active': _showLabel }"
443452 text
444- @click =" showLabel = !showLabel "
453+ @click =" _showLabel = !_showLabel "
445454 >
446455 <el-icon size =" 16" >
447456 <ICON _STYLE />
@@ -589,7 +598,7 @@ function getBaseAxis() {
589598 :message =" message "
590599 :data =" data "
591600 :loading-data =" loadingData "
592- :show-label =" showLabel "
601+ :show-label =" _showLabel "
593602 :thousands-separator-list =" enableThousandsSeparatorList "
594603 />
595604 </div >
@@ -610,6 +619,7 @@ function getBaseAxis() {
610619 >
611620 <ChartBlock
612621 v-if =" dialogVisible && ! enlarge "
622+ v-model :show-label =" _showLabel "
613623 v-model :thousands-separator-list =" enableThousandsSeparatorList "
614624 :message =" message "
615625 :record-id =" recordId "
0 commit comments