Przeglądaj źródła

fix: 修改ShowStatisticResult的封装,添加title

WANGKANG 3 miesięcy temu
rodzic
commit
6a272dc0c9

+ 7 - 2
src/views/demo/components/ShowStatisticResult.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog v-model="showResultDialogVisible" :title="props.title" width="700">
+  <el-dialog v-model="showResultDialogVisible" :title="title" width="700">
     <el-card style="width: 100%; margin-bottom: 10px">
       <div class="evaluate-data">
         <template v-for="(item, index) in ResultData" :key="index">
@@ -27,15 +27,20 @@ const props = defineProps({
   }
 })
 
+const title = ref(props.title)
+
 const showResultDialogVisible = ref(false)
 const ResultData = ref([])
-const get_statistics_result = async (id: number | string, api: Function = undefined) => {
+const get_statistics_result = async (id: number | string, api: Function = undefined, title__: string = undefined) => {
   let res: any = {}
   if (!api) {
     res = await props.api(id)
   } else {
     res = await api(id)
   }
+  if (title__) {
+    title.value = title__
+  }
   ResultData.value = res.data
   showResultDialogVisible.value = true
 }