|
@@ -3,23 +3,15 @@
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-button type="primary" @click="handleSelect">选择指标</el-button>
|
|
<el-button type="primary" @click="handleSelect">选择指标</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12" style="text-align: right"> 接口配置已完成: {{ scheduleData.complete }}/{{ scheduleData.total }} </el-col>
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <metrics-list :listData="listData" :edit="false">
|
|
|
|
|
|
|
+ <metrics-list :listData="listData" :edit="true">
|
|
|
<template #operation="scope">
|
|
<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>
|
|
|
|
|
-<!-- <el-button link type="primary" icon="Edit" @click="handleUpdateMetrics(scope.row)">保存</el-button>-->
|
|
|
|
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdateMetrics(scope.row)">保存</el-button>
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</metrics-list>
|
|
</metrics-list>
|
|
|
<el-dialog title="选择指标" v-model="openDialog" :width="1000" append-to-body style="top:15vh">
|
|
<el-dialog title="选择指标" v-model="openDialog" :width="1000" append-to-body style="top:15vh">
|
|
|
- <metrics-config :metrics="metricsRow" v-if="metricsType==='config'" @cancel="openDialog=false" @success="initData"/>
|
|
|
|
|
- <metrics-list :listData="addMetricsList" :edit="false" v-else>
|
|
|
|
|
|
|
+ <metrics-list :listData="addMetricsList" :edit="false">
|
|
|
<template #operation="scope">
|
|
<template #operation="scope">
|
|
|
<el-button link type="primary" icon="Delete" @click="handleAddMetrics(scope.row)">添加</el-button>
|
|
<el-button link type="primary" icon="Delete" @click="handleAddMetrics(scope.row)">添加</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -27,10 +19,8 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import {scheduleObj} from "@/api/obj/obj"
|
|
|
|
|
import {onMounted, ref} from "vue";
|
|
import {onMounted, ref} from "vue";
|
|
|
import metricsList from "./metricsList.vue"
|
|
import metricsList from "./metricsList.vue"
|
|
|
-import metricsConfig from "./metricsConfig.vue"
|
|
|
|
|
const {proxy,emit} = getCurrentInstance()
|
|
const {proxy,emit} = getCurrentInstance()
|
|
|
const props = defineProps(['rowId'])
|
|
const props = defineProps(['rowId'])
|
|
|
import {selectMetrics,addMetrics} from "@/api/obj/obj"
|
|
import {selectMetrics,addMetrics} from "@/api/obj/obj"
|
|
@@ -38,30 +28,12 @@ import {listMetrics,delMetrics,updateMetrics} from '@/api/obj/metrics'
|
|
|
const listData=ref([])
|
|
const listData=ref([])
|
|
|
const openDialog=ref(false)
|
|
const openDialog=ref(false)
|
|
|
const addMetricsList=ref([])
|
|
const addMetricsList=ref([])
|
|
|
-const metricsRow=ref({})
|
|
|
|
|
-const metricsType=ref("list")
|
|
|
|
|
-const scheduleData=ref({})
|
|
|
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
|
- initData()
|
|
|
|
|
|
|
+ queryList()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const initData=()=>{
|
|
|
|
|
- openDialog.value = false
|
|
|
|
|
- queryList()
|
|
|
|
|
- getScheduleTotal()
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-const getScheduleTotal=()=>{
|
|
|
|
|
- scheduleObj(props.rowId).then(res=>{
|
|
|
|
|
- scheduleData.value = res.data
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-const handleConfigMetrics=(row)=>{
|
|
|
|
|
- metricsType.value = "config"
|
|
|
|
|
- metricsRow.value = {...row}
|
|
|
|
|
- openDialog.value = true
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const queryList=()=>{
|
|
const queryList=()=>{
|
|
|
listMetrics({objId:props.rowId,tplId:-1}).then(res=>{
|
|
listMetrics({objId:props.rowId,tplId:-1}).then(res=>{
|
|
@@ -77,7 +49,6 @@ const handleAddMetrics = row =>{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const handleSelect=()=>{
|
|
const handleSelect=()=>{
|
|
|
- metricsType.value = "list"
|
|
|
|
|
openDialog.value = true
|
|
openDialog.value = true
|
|
|
selectMetrics(props.rowId).then(res=>{
|
|
selectMetrics(props.rowId).then(res=>{
|
|
|
addMetricsList.value = res.rows.map(p=>{
|
|
addMetricsList.value = res.rows.map(p=>{
|