|
@@ -1,55 +1,62 @@
|
|
|
<template>
|
|
|
- <el-table :data="addressData" border style="width: 100%">
|
|
|
- <el-table-column label="指标类型" width="180">
|
|
|
- <template #default="scope">
|
|
|
- {{metrics_category.find(item=>item.value==scope.row.metricsType).label}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="普罗米修斯job">
|
|
|
- <template #default="scope">
|
|
|
- <el-input v-model="scope.row.apiAddr" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="100" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary" icon="CircleCheck" @click="handleSave(scope.row)">保存</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12"> 接口配置已完成: {{ scheduleData.complete }}/{{ scheduleData.total }} </el-col>
|
|
|
+ </el-row>
|
|
|
+ <metrics-list :listData="listData" :edit="false">
|
|
|
+ <template #operation="scope">
|
|
|
+ <el-button link
|
|
|
+ :type="!scope.row.dataExp ? 'primary' : 'success'"
|
|
|
+ :icon="!scope.row.dataExp ? 'Edit' : 'CircleCheck'"
|
|
|
+ @click="handleConfigMetrics(scope.row)">
|
|
|
+ {{!scope.row.dataExp?'未配置' : '已配置'}}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </metrics-list>
|
|
|
+ <el-dialog title="选择指标" v-model="openDialog" :width="1000" append-to-body style="top:15vh">
|
|
|
+ <metrics-config :metrics="metricsRow" @cancel="openDialog=false" @success="initData"/>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import {getDataList,updateData,delData} from "@/api/obj/data"
|
|
|
+import {scheduleObj} from "@/api/obj/obj"
|
|
|
import {onMounted, ref} from "vue";
|
|
|
+import metricsList from "./metricsList.vue"
|
|
|
+import metricsConfig from "./metricsConfig.vue"
|
|
|
const {proxy,emit} = getCurrentInstance()
|
|
|
-const {metrics_category} = proxy.useDict('metrics_category');
|
|
|
const props = defineProps(['rowId'])
|
|
|
-const addressData = ref([])
|
|
|
-
|
|
|
+import {listMetrics} from '@/api/obj/metrics'
|
|
|
+const listData=ref([])
|
|
|
+const openDialog=ref(false)
|
|
|
+const metricsRow=ref({})
|
|
|
+const scheduleData=ref({})
|
|
|
onMounted(()=>{
|
|
|
- dataList()
|
|
|
+ initData()
|
|
|
})
|
|
|
|
|
|
-const handleDelete=(row)=>{
|
|
|
- delData(row.dataId).then(res=>{
|
|
|
- proxy.$modal.msgSuccess(res.msg)
|
|
|
- dataList()
|
|
|
- })
|
|
|
+const initData=()=>{
|
|
|
+ openDialog.value = false
|
|
|
+ queryList()
|
|
|
+ getScheduleTotal()
|
|
|
}
|
|
|
|
|
|
-const handleSave=(row)=>{
|
|
|
- updateData(row).then(res=>{
|
|
|
- proxy.$modal.msgSuccess(res.msg)
|
|
|
+const getScheduleTotal=()=>{
|
|
|
+ scheduleObj(props.rowId).then(res=>{
|
|
|
+ scheduleData.value = res.data
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const dataList = () => {
|
|
|
- getDataList(props.rowId).then(res => {
|
|
|
- addressData.value = res.rows
|
|
|
+const handleConfigMetrics=(row)=>{
|
|
|
+ metricsRow.value = {...row}
|
|
|
+ openDialog.value = true
|
|
|
+}
|
|
|
+
|
|
|
+const queryList=()=>{
|
|
|
+ listMetrics({objId:props.rowId,tplId:-1}).then(res=>{
|
|
|
+ listData.value = res.rows
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const submitForm=()=>{
|
|
|
- emit("nextStep", "done")
|
|
|
+ emit("nextStep", 1)
|
|
|
}
|
|
|
|
|
|
defineExpose({submitForm})
|