step4.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <el-row :gutter="20">
  3. <el-col :span="12"> 接口配置已完成: {{ scheduleData.complete }}/{{ scheduleData.total }} </el-col>
  4. </el-row>
  5. <metrics-list :listData="listData" :edit="false">
  6. <template #operation="scope">
  7. <el-button link
  8. :type="!scope.row.dataExp ? 'primary' : 'success'"
  9. :icon="!scope.row.dataExp ? 'Edit' : 'CircleCheck'"
  10. @click="handleConfigMetrics(scope.row)">
  11. {{!scope.row.dataExp?'未配置' : '已配置'}}
  12. </el-button>
  13. </template>
  14. </metrics-list>
  15. <el-dialog title="选择指标" v-model="openDialog" :width="1000" append-to-body style="top:15vh">
  16. <metrics-config :metrics="metricsRow" @cancel="openDialog=false" @success="initData"/>
  17. </el-dialog>
  18. </template>
  19. <script setup lang="ts">
  20. import {scheduleObj} from "@/api/obj/obj"
  21. import {onMounted, ref} from "vue";
  22. import metricsList from "./metricsList.vue"
  23. import metricsConfig from "./metricsConfig.vue"
  24. const {proxy,emit} = getCurrentInstance()
  25. const props = defineProps(['rowId'])
  26. import {listMetrics} from '@/api/obj/metrics'
  27. const listData=ref([])
  28. const openDialog=ref(false)
  29. const metricsRow=ref({})
  30. const scheduleData=ref({})
  31. onMounted(()=>{
  32. initData()
  33. })
  34. const initData=()=>{
  35. openDialog.value = false
  36. queryList()
  37. getScheduleTotal()
  38. }
  39. const getScheduleTotal=()=>{
  40. scheduleObj(props.rowId).then(res=>{
  41. scheduleData.value = res.data
  42. })
  43. }
  44. const handleConfigMetrics=(row)=>{
  45. metricsRow.value = {...row}
  46. openDialog.value = true
  47. }
  48. const queryList=()=>{
  49. listMetrics({objId:props.rowId,pageSize:100}).then(res=>{
  50. listData.value = res.rows
  51. })
  52. }
  53. const submitForm=()=>{
  54. emit("nextStep", 1)
  55. }
  56. defineExpose({submitForm,queryList})
  57. </script>
  58. <style scoped lang="scss">
  59. </style>