|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div style="padding:16px;">
|
|
|
- <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px" @submit.native.prevent>
|
|
|
+ <!-- <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px" @submit.native.prevent>
|
|
|
<el-form-item label="" prop="url">
|
|
|
<el-input
|
|
|
v-model="queryParams.url"
|
|
@@ -10,45 +10,55 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </el-form> -->
|
|
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
+ <!-- <el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
- v-permisaction="['disposition:index:add']"
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
- </el-row>
|
|
|
+ </el-row> -->
|
|
|
|
|
|
<div>
|
|
|
- <!-- v-el-table-infinite-scroll="loadMore" :height="tableHeight"-->
|
|
|
+ <!-- <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :key="isUpdate"
|
|
|
+ :data="serveceMapList"
|
|
|
+ :default-sort = "{prop: 'total', order: 'descending'}"
|
|
|
+ @row-click="handleRowClick"
|
|
|
+ > -->
|
|
|
<el-table
|
|
|
v-loading="loading"
|
|
|
+ :key="isUpdate"
|
|
|
:data="serveceMapList"
|
|
|
:default-sort = "{prop: 'total', order: 'descending'}"
|
|
|
@row-click="handleRowClick"
|
|
|
>
|
|
|
- <el-table-column header-align="left" label="接口名" prop="name" align="left" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column header-align="left" label="URL组" prop="url" align="left" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column header-align="left" label="服务名" prop="name" align="left" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column header-align="left" label="起始服务" prop="service_name" align="left" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <span style="cursor:pointer" @click="toogleExpand(row,$index)">{{scope.row.url}}</span> -->
|
|
|
- <span>{{scope.row.url}}</span>
|
|
|
+ <span>{{scope.row.service_name}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column header-align="left" label="SpanName" prop="span_name" align="left" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.span_name}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column header-align="center" label="rpm" sortable prop="rpm" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <!-- <span>{{ Number(scope.row.rpm).toFixed(2)}}</span> -->
|
|
|
- <el-tag>{{ Number(scope.row.rpm).toFixed(2)}}</el-tag>
|
|
|
+
|
|
|
+ <el-tag>{{ scope.row.rpm == undefined?0:Number(scope.row.rpm).toFixed(2)}}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column header-align="center" label="count" sortable prop="total" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <span>{{ Number(scope.row.rpm).toFixed(2)}}</span> -->
|
|
|
- <el-tag>{{ Number(scope.row.total).toFixed(2)}}</el-tag>
|
|
|
+ <el-tag>{{ scope.row.total== undefined?0:Number(scope.row.total).toFixed(2)}}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column header-align="center" label="errRate" sortable prop="error_rate" align="center">
|
|
@@ -77,7 +87,7 @@
|
|
|
<div :id="`tiger-five-trend-index` + scope.$index" class="tiger-trend-charts"></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
@@ -85,7 +95,6 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
- v-permisaction="['disposition:index:edit']"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
@@ -113,7 +122,7 @@
|
|
|
@click.native.stop="handleDelete(scope.row)"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="more" v-if="serveceMapList.length<tableCount" @click="loadMore">加载更多</div>
|
|
@@ -123,7 +132,7 @@
|
|
|
:total="total"
|
|
|
:page.sync="childQueryParams.pageIndex"
|
|
|
:limit.sync="childQueryParams.pageSize"
|
|
|
- @pagination="handelgetUrlMappingRange"
|
|
|
+ @pagination="handelgetBizDetail"
|
|
|
/> -->
|
|
|
|
|
|
<!-- 添加或修改应用配置对话框 -->
|
|
@@ -177,92 +186,152 @@
|
|
|
<el-drawer
|
|
|
:visible.sync="drawer"
|
|
|
direction="rtl"
|
|
|
- size="55%"
|
|
|
+ size="calc( 100vw - 210px)"
|
|
|
@close="drawerClose"
|
|
|
>
|
|
|
- <div style="margin-bottom:16px">
|
|
|
+ <div style="margin-bottom:16px;margin-top:-32px;">
|
|
|
+ <div class="flexWrap">
|
|
|
+ <div class="flex-left">
|
|
|
+ <!-- <Topo /> -->
|
|
|
+ <Topo v-if='drawer' :graphData='graphData' topoId='container' v-on:changeState="clickRowHandleNode" ref='topo'/>
|
|
|
+ </div>
|
|
|
+ <div class="flex-right">
|
|
|
+ <div id="scaleMain" style="width:100%;min-width:500px;height:180px;margin-bottom:24px"></div>
|
|
|
|
|
|
- <div id="scaleMain" style="width:100%;min-width:500px;height:180px;margin-bottom:24px"></div>
|
|
|
+ <el-table
|
|
|
+ v-loading="tableLoading"
|
|
|
+ :data="rowData"
|
|
|
+ >
|
|
|
+ <el-table-column header-align="center" label="TraceID" prop="trace_id" align="center" width="240">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span @click="goto(scope.row)">{{scope.row.trace_id}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column header-align="center" label="ServiceName" prop="service_name" align="center" :show-overflow-tooltip="true" />
|
|
|
+ <!-- <el-table-column header-align="center" label="SpanName" prop="span_name" align="center" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column header-align="center" label="SpanKind" prop="span_kind" align="center" width="100"/> -->
|
|
|
+ <el-table-column header-align="center" label="Target" prop="target" align="center" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column header-align="center" label="Method" prop="method" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag type="info">{{ scope.row.method }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column header-align="center" label="StatusCode" prop="status_code" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>
|
|
|
+ <span v-if="scope.row.status_code<400"><i class="green_small"></i>{{scope.row.status_code}}</span>
|
|
|
+ <span v-else><i class="red_small"></i>{{scope.row.status_code}}</span>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column header-align="center" label="Duration(ms)" prop="duration" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.duration>=2000" type="danger">{{ scope.row.duration }}</el-tag>
|
|
|
+ <el-tag v-if="scope.row.duration<2000" type="info">{{ scope.row.duration }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column header-align="center" label="max(ms)" sortable="custom" prop="duration_stats" align="center" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ Number(scope.row.max).toFixed(2)}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column header-align="center" label="avg(ms)" sortable="custom" prop="duration_stats" align="center" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ Number(scope.row.avg).toFixed(2)}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="childQueryParams.pageIndex"
|
|
|
+ :limit.sync="childQueryParams.pageSize"
|
|
|
+ @pagination="handelgetBizDetail"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <el-table
|
|
|
- v-loading="tableLoading"
|
|
|
- :data="rowData"
|
|
|
- >
|
|
|
- <el-table-column header-align="center" label="TraceID" prop="trace_id" align="center" width="240">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span @click="goto(scope.row)">{{scope.row.trace_id}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column header-align="center" label="ServiceName" prop="service_name" align="center" :show-overflow-tooltip="true" />
|
|
|
- <!-- <el-table-column header-align="center" label="SpanName" prop="span_name" align="center" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column header-align="center" label="SpanKind" prop="span_kind" align="center" width="100"/> -->
|
|
|
- <el-table-column header-align="center" label="Target" prop="target" align="center" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column header-align="center" label="Method" prop="method" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag type="info">{{ scope.row.method }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column header-align="center" label="StatusCode" prop="status_code" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>
|
|
|
- <span v-if="scope.row.status_code<400"><i class="green_small"></i>{{scope.row.status_code}}</span>
|
|
|
- <span v-else><i class="red_small"></i>{{scope.row.status_code}}</span>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column header-align="center" label="Duration(ms)" prop="duration" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.duration>=2000" type="danger">{{ scope.row.duration }}</el-tag>
|
|
|
- <el-tag v-if="scope.row.duration<2000" type="info">{{ scope.row.duration }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column header-align="center" label="max(ms)" sortable="custom" prop="duration_stats" align="center" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ Number(scope.row.max).toFixed(2)}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column header-align="center" label="avg(ms)" sortable="custom" prop="duration_stats" align="center" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ Number(scope.row.avg).toFixed(2)}}</span>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- </el-table>
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="childQueryParams.pageIndex"
|
|
|
- :limit.sync="childQueryParams.pageSize"
|
|
|
- @pagination="handelgetUrlMappingRange"
|
|
|
- />
|
|
|
+
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
+
|
|
|
+ <el-drawer
|
|
|
+ :visible.sync="drawerDetail"
|
|
|
+ direction="rtl"
|
|
|
+ size="55%"
|
|
|
+ @close="drawerCloseDetail"
|
|
|
+ v-if='JSON.stringify(detailData) != "{}"'
|
|
|
+ >
|
|
|
+ <el-collapse v-model="activeNames">
|
|
|
+ <el-collapse-item title="Attributes" name="one">
|
|
|
+ <ul class='ul_box' v-if='detailData.span_attributes !=null'>
|
|
|
+ <li v-for='(value,key) in detailData.span_attributes' :key='key'>
|
|
|
+ <div class="ul_label">{{key}}</div>
|
|
|
+ <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-collapse-item>
|
|
|
+ <el-collapse-item title="Resource" name="tow">
|
|
|
+ <ul class='ul_box' v-if='detailData.resource_attributes !=null'>
|
|
|
+ <li v-for='(value,key) in detailData.resource_attributes' :key='key'>
|
|
|
+ <div class="ul_label">{{key}}</div>
|
|
|
+ <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-collapse-item>
|
|
|
+ <el-collapse-item v-if='detailData.events_timestamp.length>0 && detailData.events_timestamp!=null' :title="'Events'+'('+ detailData.events_timestamp.length +')'" name="three">
|
|
|
+ <div class='events_box'>
|
|
|
+ <el-collapse :value="activeIn">
|
|
|
+ <el-collapse-item v-for='(item,index) in detailData.events_timestamp' :key='index' :title="item" :name="index">
|
|
|
+ <ul class='ul_box'>
|
|
|
+ <li>
|
|
|
+ <div class="ul_label">message</div>
|
|
|
+ <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{detailData.events_name[index]}}"</div>
|
|
|
+ </li>
|
|
|
+ <li v-for='(value,key) in detailData.events_attributes[index]' :key='key'>
|
|
|
+ <div class="ul_label">{{key}}</div>
|
|
|
+ <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listUrlMapping, addUrlMapping, getUrlMapping, updateUrlMapping, delUrlMapping, favor,getUrlMappingRange } from '@/api/mapping'
|
|
|
+import { listUrlMapping, addUrlMapping, getUrlMapping, updateUrlMapping, delUrlMapping, favor,getUrlMappingRange,getBizDetail,listBizGraph,listBizGraphStats,updateBiz,delBiz,favorBiz } from '@/api/mapping'
|
|
|
import { formatJson } from '@/utils'
|
|
|
import storage from '@/utils/storage'
|
|
|
// import bus from '@/utils/bus'
|
|
|
+import {listService,listServiceStats,serviceSpans} from "@/api/service"
|
|
|
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
// import echarts from 'echarts'
|
|
|
import resize from './mixins/resize'
|
|
|
import moment from 'moment'
|
|
|
// import elTableInfiniteScroll from 'el-table-infinite-scroll';
|
|
|
+import Topo from './TopoNew1'
|
|
|
export default {
|
|
|
name: 'ServiceMap',
|
|
|
mixins: [resize],
|
|
|
components: {
|
|
|
-
|
|
|
+ Topo
|
|
|
},
|
|
|
// directives: {
|
|
|
// 'el-table-infinite-scroll': elTableInfiniteScroll
|
|
|
// },
|
|
|
data() {
|
|
|
return {
|
|
|
+ isUpdate:false,
|
|
|
+ isflag:false,
|
|
|
+ tableflag:false,
|
|
|
drawer:false,
|
|
|
detailData:{},
|
|
|
+ drawerDetail:false,
|
|
|
tableLoading:false,
|
|
|
// 表格高度
|
|
|
tableHeight:"",
|
|
@@ -293,13 +362,11 @@ export default {
|
|
|
queryParams: {
|
|
|
// start_time:Math.round((new Date().getTime())/1000 - (5*60)),
|
|
|
// end_time:Math.round(new Date().getTime()/1000),
|
|
|
- start_time:0,
|
|
|
- end_time:0,
|
|
|
- app_id:undefined,
|
|
|
- favor:'',
|
|
|
- url:'',
|
|
|
- pageIndex: 1,
|
|
|
- pageSize: 50,
|
|
|
+ app_id:'',
|
|
|
+ start_time:'',
|
|
|
+ end_time:'',
|
|
|
+ pageIndex:1,
|
|
|
+ pageSize:50,
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {
|
|
@@ -323,15 +390,25 @@ export default {
|
|
|
// end_time:Math.round(new Date().getTime()/1000),
|
|
|
start_time:0,
|
|
|
end_time:0,
|
|
|
- id:0,
|
|
|
- app_id:0,
|
|
|
- kind:'',
|
|
|
- only_error:0,
|
|
|
+ biz_id:1,
|
|
|
pageIndex: 1,
|
|
|
pageSize: 10,
|
|
|
},
|
|
|
rowData:[],
|
|
|
- serviceMapTimer:null
|
|
|
+ serviceMapTimer:null,
|
|
|
+ BizStatsQuery:{
|
|
|
+ id:0,
|
|
|
+ start_time:'',
|
|
|
+ end_time:'',
|
|
|
+ },
|
|
|
+ tempList:[],
|
|
|
+ graphData:{},
|
|
|
+ graphStatsQuery:{
|
|
|
+ biz_node_id:0,// 仅支持传递单个节点,多个节点需要并发请求分别调用
|
|
|
+ end_time:1702972800,
|
|
|
+ start_time:1702969200,
|
|
|
+ },
|
|
|
+ graphObj:[]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -340,6 +417,10 @@ export default {
|
|
|
if(newValue){
|
|
|
this.queryParams.start_time = newValue.startTime;
|
|
|
this.queryParams.end_time = newValue.endTime
|
|
|
+ this.BizStatsQuery.start_time= newValue.start_time;
|
|
|
+ this.BizStatsQuery.end_time= newValue.end_time;
|
|
|
+ this.graphStatsQuery.start_time= newValue.start_time;
|
|
|
+ this.graphStatsQuery.end_time= newValue.end_time;
|
|
|
this.childQueryParams.start_time = newValue.startTime;
|
|
|
this.childQueryParams.end_time = newValue.endTime
|
|
|
this.queryParams.pageIndex = 1
|
|
@@ -359,28 +440,56 @@ export default {
|
|
|
// immediate: true,
|
|
|
deep: true
|
|
|
},
|
|
|
+ serveceMapList:{
|
|
|
+ handler(newVal,oldVal){
|
|
|
+ if(newVal){
|
|
|
+ this.serveceMapList = newVal;
|
|
|
+ this.tableflag = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // immediate: true,
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.serviceMapTimer);
|
|
|
},
|
|
|
- created() {
|
|
|
- // this.queryParams.start_time = this.$store.getters.globalTimes.startTime;
|
|
|
- // this.queryParams.end_time = this.$store.getters.globalTimes.endTime
|
|
|
- // this.childQueryParams.start_time = this.$store.getters.globalTimes.startTime;
|
|
|
- // this.childQueryParams.end_time = this.$store.getters.globalTimes.endTime
|
|
|
- let windowHeight =document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
- // 动态计算表格的高度,200为屏幕内除了表格以外其他元素的高度,依实际情况而定
|
|
|
- this.tableHeight = windowHeight - 200 + "px";
|
|
|
- this.appsItem=storage.get('appsItem');
|
|
|
- if(this.appsItem.id!=''||this.appsItem.id!=undefined){
|
|
|
- this.queryParams.app_id=this.appsItem.id;
|
|
|
- this.childQueryParams.app_id = this.appsItem.id;
|
|
|
+ // created() {
|
|
|
+ // let windowHeight =document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
+ // // 动态计算表格的高度,200为屏幕内除了表格以外其他元素的高度,依实际情况而定
|
|
|
+ // this.tableHeight = windowHeight - 200 + "px";
|
|
|
+ // this.appsItem=storage.get('appsItem');
|
|
|
+ // if(this.appsItem.id!=''||this.appsItem.id!=undefined){
|
|
|
+ // this.queryParams.app_id=this.appsItem.id;
|
|
|
+ // this.childQueryParams.app_id = this.appsItem.id;
|
|
|
+ // this.getList()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ created(){
|
|
|
+ this.$store.commit('time/setTimeFlag',false)
|
|
|
+
|
|
|
+ this.appItem=storage.get('appsItem');
|
|
|
+ if(JSON.stringify(this.appItem) !="{}"){
|
|
|
+ this.queryParams.app_id = this.appItem.id;
|
|
|
+ this.queryParams.start_time = this.appItem.start_time;
|
|
|
+ this.queryParams.end_time = this.appItem.end_time;
|
|
|
+ this.BizStatsQuery.start_time= this.appItem.start_time;
|
|
|
+ this.BizStatsQuery.end_time= this.appItem.end_time;
|
|
|
+ this.childQueryParams.start_time = this.appItem.start_time;
|
|
|
+ this.childQueryParams.end_time = this.appItem.end_time;
|
|
|
this.getList()
|
|
|
+ this.$forceUpdate();
|
|
|
}
|
|
|
+ // this.columnChange();
|
|
|
},
|
|
|
mounted(){
|
|
|
+ this.$forceUpdate();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // clickFull() {
|
|
|
+ // this.Visible=true;
|
|
|
+ // this.$refs['topo'].initGraph();
|
|
|
+ // },
|
|
|
Refresh(timeOut){
|
|
|
this.serviceMapTimer = setInterval(()=>{
|
|
|
this.getList();
|
|
@@ -399,37 +508,99 @@ export default {
|
|
|
drawerClose(){
|
|
|
this.drawer = false;
|
|
|
},
|
|
|
+ drawerCloseDetail(){
|
|
|
+ this.drawerDetail = false;
|
|
|
+ },
|
|
|
toogleExpand(row, column, event){
|
|
|
console.log(row,'点击展开行');
|
|
|
this.drawer=true;
|
|
|
this.childQueryParams.id = row.id;
|
|
|
- this.handelgetUrlMappingRange();
|
|
|
+ this.handelgetBizDetail();
|
|
|
},
|
|
|
handleRowClick(row, column, event){
|
|
|
console.log(row,'点击行');
|
|
|
- this.drawer=true;
|
|
|
- this.$nextTick(() =>{
|
|
|
- this.drawEchartsScale(row);
|
|
|
- })
|
|
|
+ console.log(column,'column')
|
|
|
+ this.childQueryParams.biz_id = row.id;
|
|
|
+ this.handelgetBizDetail();
|
|
|
+ this.getListBizGraph(row.id)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
setTimeout(()=>{
|
|
|
-
|
|
|
- // this.childQueryParams.id = row.id;
|
|
|
- this.childQueryParams.kind = row.kind;
|
|
|
- this.handelgetUrlMappingRange();
|
|
|
- },0)
|
|
|
+ // this.childQueryParams.biz_id = row.id;
|
|
|
+ // this.handelgetBizDetail();
|
|
|
+ // this.getListBizGraph(row.id)
|
|
|
+ this.drawer=true;
|
|
|
+ this.$nextTick(() =>{
|
|
|
+ this.drawEchartsScale(row);
|
|
|
+ })
|
|
|
+ },300)
|
|
|
},
|
|
|
- handelgetUrlMappingRange(){
|
|
|
+ handelgetBizDetail(){
|
|
|
this.tableLoading = true
|
|
|
- console.log(this.childQueryParams,'this.childQueryParams')
|
|
|
- getUrlMappingRange(this.childQueryParams).then(res => {
|
|
|
+ getBizDetail(this.childQueryParams).then(res => {
|
|
|
if(res.code == 200){
|
|
|
this.tableLoading = false;
|
|
|
- console.log(res.data.list,'业务映射获取行的数据')
|
|
|
this.rowData= res.data.list;
|
|
|
this.total = res.data.count;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getListBizGraph(id){
|
|
|
+ listBizGraph({biz_id:id}).then((res)=>{
|
|
|
+ console.log(res,'决策树数据')
|
|
|
+ if(res.code == 200){
|
|
|
+ let arr = res.data
|
|
|
+ if(arr.length>0){
|
|
|
+ let List = this.handelListBizData(arr)
|
|
|
+ console.log(List,'处理后的数据')
|
|
|
+ this.graphData =List[0];
|
|
|
+ console.log(this.graphData,'graphData=======')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handelListBizData(data){
|
|
|
+ data.forEach((v,k)=>{
|
|
|
+ v.collapsed = false;
|
|
|
+ v.id = String(v.id);
|
|
|
+ v.name = v.name;
|
|
|
+ v.label = v.stats.duration!=undefined?v.stats.duration.toFixed(2):0;
|
|
|
+ v.currency = 'ms';
|
|
|
+ v.rate = v.stats.success_rate;
|
|
|
+ v.status = 'B'
|
|
|
+ v.variableValue = v.stats.success_rate;
|
|
|
+ if (v.children != undefined && v.children.length > 0) {
|
|
|
+ v.children = this.handelListBizData(v.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ handleData(data) {
|
|
|
+ data.forEach((v, k) => {
|
|
|
+ // let string = key === '' ? k + 1 : key + '.' + (k + 1)
|
|
|
+
|
|
|
+ // v.span_name += '---' + string
|
|
|
+ // v.id = v.span_name;
|
|
|
+
|
|
|
+ v.id = v.biz_id;
|
|
|
+
|
|
|
+ v.collapsed = false;
|
|
|
+ v.name = v.name;
|
|
|
+ // v.label = (v.duration).toFixed(2);
|
|
|
+ v.label = v.service_name;
|
|
|
+ v.currency='ms';
|
|
|
+ v.rate = v.duration_persent;
|
|
|
+ v.status = (v.status_code == 'STATUS_CODE_ERROR'||v.events_timestamp.length>0||v.http_code>399)?'R':(v.duration>500)?'Y':'G';
|
|
|
+ v.variableValue = v.duration_persent;
|
|
|
+ // v.status_code = 'UNSET'
|
|
|
+
|
|
|
+ if (v.children != undefined && v.children.length > 0) {
|
|
|
+ v.children = this.handleData(v.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ },
|
|
|
// 根据行的id判断
|
|
|
getRowKeys(row) {
|
|
|
return row.id;
|
|
@@ -437,6 +608,11 @@ export default {
|
|
|
clickRowHandle(row, column, event) {
|
|
|
// alert('a')
|
|
|
},
|
|
|
+ clickRowHandleNode(item){
|
|
|
+ console.log(item,'点击节点')
|
|
|
+ this.detailData = item;
|
|
|
+ this.drawerDetail=true;
|
|
|
+ },
|
|
|
handleSortChang(column, prop, order) {
|
|
|
prop = column.prop
|
|
|
order = column.order
|
|
@@ -474,14 +650,33 @@ export default {
|
|
|
},
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- listUrlMapping(this.queryParams).then(res => {
|
|
|
+ const _this = this;
|
|
|
+ listService(this.queryParams).then(res => {
|
|
|
+ console.log(res.data.list,'服务列表')
|
|
|
if(res.code == 200){
|
|
|
- console.log(res.data.list,'业务映射')
|
|
|
- this.loading = false;
|
|
|
- this.serveceMapList= this.serveceMapList.concat(res.data.list);
|
|
|
- console.log(this.serveceMapList,'this.serveceMapList 所有接口映射内容')
|
|
|
+ _this.serveceMapList= _this.serveceMapList.concat(res.data.list);
|
|
|
this.tableCount = res.data.count;
|
|
|
this.queryParams.pageIndex = res.data.pageIndex;
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ // this.tempList = this.tempList.concat(res.data.list);
|
|
|
+ if(_this.serveceMapList.length>0){
|
|
|
+ for(let i=0;i<_this.serveceMapList.length;i++){
|
|
|
+ this.BizStatsQuery.id = _this.serveceMapList[i].id
|
|
|
+ listServiceStats(this.BizStatsQuery).then(resq=>{
|
|
|
+ console.log(resq,'服务解析列表=======')
|
|
|
+ if(resq.data.id != undefined){
|
|
|
+ if(_this.serveceMapList[i].id == resq.data.id){
|
|
|
+ _this.serveceMapList[i] = Object.assign({},_this.serveceMapList[i], resq.data);
|
|
|
+ _this.isUpdate = !_this.isUpdate;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$forceUpdate();
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -518,6 +713,7 @@ export default {
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageIndex = 1
|
|
|
this.serveceMapList=[];
|
|
|
+ this.tempList=[];
|
|
|
this.getList()
|
|
|
// this.getList()
|
|
|
// if(this.queryParams.url != ''){
|
|
@@ -562,7 +758,6 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- console.log(row,'-------')
|
|
|
this.reset()
|
|
|
const id = row.id || this.ids
|
|
|
if(row.id != 0){
|
|
@@ -570,7 +765,7 @@ export default {
|
|
|
console.log(response.data,'修改URL组')
|
|
|
this.form = response.data
|
|
|
this.form.id = row.id
|
|
|
- this.title = '修改URL组'
|
|
|
+ this.title = '修改业务名'
|
|
|
this.isEdit = true
|
|
|
this.open = true
|
|
|
})
|
|
@@ -587,12 +782,13 @@ export default {
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.id !== undefined || this.form.id !=0) {
|
|
|
- updateUrlMapping(this.form, this.form.id).then(response => {
|
|
|
+ updateBiz(this.form, this.form.id).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
this.msgSuccess(response.msg)
|
|
|
this.open = false
|
|
|
this.queryParams.pageIndex =1;
|
|
|
this.serveceMapList=[];
|
|
|
+ this.tempList=[];
|
|
|
this.getList()
|
|
|
} else {
|
|
|
this.msgError(response.msg)
|
|
@@ -605,6 +801,7 @@ export default {
|
|
|
this.open = false
|
|
|
this.queryParams.pageIndex =1;
|
|
|
this.serveceMapList=[];
|
|
|
+ this.tempList=[];
|
|
|
this.getList()
|
|
|
} else {
|
|
|
this.msgError(response.msg)
|
|
@@ -623,10 +820,11 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(function() {
|
|
|
- return delUrlMapping(id)
|
|
|
+ return delBiz(id)
|
|
|
}).then((response) => {
|
|
|
this.queryParams.pageIndex =1;
|
|
|
this.serveceMapList=[];
|
|
|
+ this.tempList=[];
|
|
|
this.msgSuccess(response.msg);
|
|
|
this.getList()
|
|
|
}).catch(function() {})
|
|
@@ -638,11 +836,12 @@ export default {
|
|
|
row.favor = '1';
|
|
|
}
|
|
|
|
|
|
- favor({favor:row.favor},row.id).then(res=>{
|
|
|
+ favorBiz({favor:row.favor},row.id).then(res=>{
|
|
|
if(res.code = 200){
|
|
|
this.msgSuccess(res.msg);
|
|
|
this.queryParams.pageIndex =1;
|
|
|
this.serveceMapList=[];
|
|
|
+ this.tempList=[];
|
|
|
this.getList()
|
|
|
}
|
|
|
})
|
|
@@ -687,7 +886,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- drawEchartsp5(row, index) {
|
|
|
+ drawEchartsp5(row, index) {
|
|
|
let option = {
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
@@ -705,7 +904,7 @@ export default {
|
|
|
type: 'category',
|
|
|
boundaryGap: false,
|
|
|
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
|
- data: row.duration_stats.time,
|
|
|
+ data: row.quantiles.time,
|
|
|
show:false
|
|
|
},
|
|
|
yAxis: {
|
|
@@ -720,7 +919,7 @@ export default {
|
|
|
symbol: 'none',
|
|
|
// // data: [120, 132, 101, 134, 90, 230, 210]
|
|
|
// data: Number(row.duration_stats.p50).toFixed(2)
|
|
|
- data:row.duration_stats.p50
|
|
|
+ data:row.quantiles.p50
|
|
|
},
|
|
|
{
|
|
|
name: 'P.95',
|
|
@@ -729,7 +928,7 @@ export default {
|
|
|
symbol: 'none',
|
|
|
// data: [320, 332, 301, 334, 390, 330, 320]
|
|
|
// data: Number(row.duration_stats.p90).toFixed(2)
|
|
|
- data:row.duration_stats.p90
|
|
|
+ data:row.quantiles.p90
|
|
|
},
|
|
|
{
|
|
|
name: 'P.99',
|
|
@@ -738,7 +937,7 @@ export default {
|
|
|
symbol: 'none',
|
|
|
// data: [820, 932, 901, 934, 1290, 1330, 1320]
|
|
|
// data: Number(row.duration_stats.p99).toFixed(2)
|
|
|
- data:row.duration_stats.p99
|
|
|
+ data:row.quantiles.p99
|
|
|
}
|
|
|
]
|
|
|
};
|
|
@@ -787,15 +986,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
grid: {
|
|
|
- left: '4%',
|
|
|
+ top:'2%',
|
|
|
+ left: '3%',
|
|
|
right: '4%',
|
|
|
- bottom: '3%',
|
|
|
+ bottom: '1%',
|
|
|
containLabel: true
|
|
|
},
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
boundaryGap: false,
|
|
|
- data: row.duration_stats.time,
|
|
|
+ data: row.quantiles.time,
|
|
|
// show:true
|
|
|
},
|
|
|
yAxis: {
|
|
@@ -822,7 +1022,7 @@ export default {
|
|
|
stack: 'Total',
|
|
|
symbol: 'none',
|
|
|
// symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p50
|
|
|
+ data:row.quantiles.p50
|
|
|
},
|
|
|
{
|
|
|
name: 'P.95',
|
|
@@ -830,7 +1030,7 @@ export default {
|
|
|
stack: 'Total',
|
|
|
symbol: 'none',//拐点
|
|
|
// symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p90
|
|
|
+ data:row.quantiles.p90
|
|
|
},
|
|
|
{
|
|
|
name: 'P.99',
|
|
@@ -838,7 +1038,7 @@ export default {
|
|
|
stack: 'Total',
|
|
|
symbol: 'none',//拐点
|
|
|
// symbol: 'emptyCircle',//拐点
|
|
|
- data:row.duration_stats.p99
|
|
|
+ data:row.quantiles.p99
|
|
|
}
|
|
|
]
|
|
|
};
|
|
@@ -867,7 +1067,7 @@ export default {
|
|
|
|
|
|
_this.childQueryParams.start_time = timestamp
|
|
|
_this.childQueryParams.end_time =timestamp
|
|
|
- _this.handelgetUrlMappingRange();
|
|
|
+ _this.handelgetBizDetail();
|
|
|
})
|
|
|
},
|
|
|
drawEchartsp99() {
|
|
@@ -978,4 +1178,14 @@ export default {
|
|
|
background:#F56C6C;
|
|
|
margin-right:8px;
|
|
|
}
|
|
|
+ .flexWrap{
|
|
|
+ display:flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ .flex-left{
|
|
|
+ width:60%;
|
|
|
+ }
|
|
|
+ .flex-right{
|
|
|
+ width:39.99
|
|
|
+ }
|
|
|
</style>
|