|
@@ -13,10 +13,12 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref } from 'vue'
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
api: {
|
|
|
type: Function,
|
|
|
- required: true
|
|
|
+ required: false,
|
|
|
+ default: () => {}
|
|
|
},
|
|
|
title: {
|
|
|
type: String,
|
|
@@ -27,8 +29,13 @@ const props = defineProps({
|
|
|
|
|
|
const showResultDialogVisible = ref(false)
|
|
|
const ResultData = ref([])
|
|
|
-const get_statistics_result = async (id: number | string) => {
|
|
|
- const res: any = await props.api(id)
|
|
|
+const get_statistics_result = async (id: number | string, api: Function = undefined) => {
|
|
|
+ let res: any = {}
|
|
|
+ if (!api) {
|
|
|
+ res = await props.api(id)
|
|
|
+ } else {
|
|
|
+ res = await api(id)
|
|
|
+ }
|
|
|
ResultData.value = res.data
|
|
|
showResultDialogVisible.value = true
|
|
|
}
|