服务器资源查看前端提交
This commit is contained in:
parent
18ecf05d1d
commit
ffda3a3117
|
@ -89,3 +89,17 @@ export const getRealTimeLog = async (params) => {
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日该执行端调用接口执行次数
|
||||||
|
* @param params :page、limit
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getInvokeNumToday = async (params) => {
|
||||||
|
return await platformRequest({
|
||||||
|
url: "/api/rest/statistics/getInvokeNumToday",
|
||||||
|
method: 'GET',
|
||||||
|
cType: false,
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
};
|
|
@ -213,3 +213,31 @@ export const downLoadInterfaceFile = async (uri) => {
|
||||||
responseType:'blob'
|
responseType:'blob'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取注册接口数量列表--执行端
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getRegisterNum = async (params) => {
|
||||||
|
return await platformRequest({
|
||||||
|
url: "/api/rest/interface/getRegisterNum",
|
||||||
|
method: 'GET',
|
||||||
|
cType: false,
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取接口注册执行端IP端口
|
||||||
|
* @param params
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getIpPortByInterfaceId = async (params) => {
|
||||||
|
return await platformRequest({
|
||||||
|
url: "/api/rest/interface/getIpPortByInterfaceId",
|
||||||
|
method: 'GET',
|
||||||
|
cType: false,
|
||||||
|
params: params,
|
||||||
|
});
|
||||||
|
};
|
|
@ -22,7 +22,7 @@ function y9Request(baseUrl = '') {
|
||||||
let requestList = new Set();
|
let requestList = new Set();
|
||||||
|
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: import.meta.env.VUE_APP_CONTEXT,
|
baseURL: baseUrl==""?import.meta.env.VUE_APP_CONTEXT:baseUrl,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,16 +23,63 @@
|
||||||
</template>
|
</template>
|
||||||
</y9Dialog>
|
</y9Dialog>
|
||||||
|
|
||||||
|
<y9Dialog v-model:config="openChartConfig">
|
||||||
|
<template v-slot>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div class="card-header">
|
||||||
|
<span>{{ $t('服务使用概况') }}</span>
|
||||||
|
<div style="height: 32px;"></div>
|
||||||
|
</div>
|
||||||
|
<div class="overview-content">
|
||||||
|
<!-- 数值展示 -->
|
||||||
|
<div class="stat-items">
|
||||||
|
<div class="stat-item">
|
||||||
|
<h2>{{ serviceUsedData.registerCount }}</h2>
|
||||||
|
<span>{{ $t('注册接口数') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<h2>{{ serviceUsedData.aveCount }}</h2>
|
||||||
|
<span>{{ $t('平均每天请求次数') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<h2>{{ serviceUsedData.todayCount }}</h2>
|
||||||
|
<span>{{ $t('今日调用次数') }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-row class="bottomArea">
|
||||||
|
<el-col :span="4"></el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-row class="labelTitle"><span>系统CPU使用率</span></el-row>
|
||||||
|
<el-row>
|
||||||
|
<div ref="cpuChartContainerRef" style="width: 100%; height: 200px;"></div>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-row class="labelTitle"><span>内存使用率</span></el-row>
|
||||||
|
<el-row>
|
||||||
|
<div ref="memoryChartContainerRef" style="width: 100%; height: 200px;"></div>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4"></el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
</y9Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, h, ref, inject } from 'vue';
|
import { computed, h, ref, inject, nextTick } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import { getPage, saveInfo, getInfoById, delInfoById, updateEnable } from '@/api/execute/execute'
|
import { getPage, saveInfo, delInfoById } from '@/api/execute/execute'
|
||||||
import {getMayApplyInterfaceList} from '@/api/interface/interface'
|
import {getRegisterNum} from '@/api/interface/interface'
|
||||||
|
import { getCpuUsed, getMaxMemory, getUsedMemory,getHttpServerReqs } from '@/api/serviceResourceIndicators/serviceResourceIndicators'
|
||||||
|
import {getInvokeNumToday} from "@/api/home/home";
|
||||||
import { ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
|
import { ElMessage, ElMessageBox, ElSwitch } from 'element-plus';
|
||||||
import '@/assets/css/tablestatusfontcolor.css';
|
import '@/assets/css/tablestatusfontcolor.css';
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
import 'echarts-liquidfill';
|
||||||
|
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
|
@ -42,9 +89,17 @@ const selectedDate = ref();
|
||||||
const query: any = ref({});
|
const query: any = ref({});
|
||||||
const filterRef = ref();
|
const filterRef = ref();
|
||||||
const interfaceList = ref([]);
|
const interfaceList = ref([]);
|
||||||
|
const cpuChartContainerRef = ref();
|
||||||
|
const memoryChartContainerRef = ref();
|
||||||
|
const serviceUsedData = ref({
|
||||||
|
registerCount:0,
|
||||||
|
todayCount:0,
|
||||||
|
aveCount:0
|
||||||
|
})
|
||||||
|
|
||||||
const limitInfo = ref(false)
|
const limitInfo = ref(false)
|
||||||
const sameId = ref()
|
const sameId = ref()
|
||||||
|
const qbaseUrl = ref()
|
||||||
|
|
||||||
//表格配置
|
//表格配置
|
||||||
let y9TableConfig = ref({
|
let y9TableConfig = ref({
|
||||||
|
@ -123,10 +178,12 @@ let y9TableConfig = ref({
|
||||||
{
|
{
|
||||||
title: computed(() => t('操作')),
|
title: computed(() => t('操作')),
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
width: 210,
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
return h('div', [h('span', { onClick: () => { view(row) } }, t("详情")),
|
return h('div', [h('span', { onClick: () => { view(row) } }, t("详情")),
|
||||||
h('span', { class: 'leftMargin', onClick: () => { edit(row,"OUT_OF_SERVICE") } }, t('下线')),
|
h('span', { class: 'leftMargin', onClick: () => { edit(row,"OUT_OF_SERVICE") } }, t('下线')),
|
||||||
h('span', { class: 'leftMargin', onClick: () => { edit(row,"UP") } }, t('上线')),
|
h('span', { class: 'leftMargin', onClick: () => { edit(row,"UP") } }, t('上线')),
|
||||||
|
h('span', { class: 'leftMargin', onClick: () => { openChartView(row) } }, t('服务使用情况')),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,7 +202,15 @@ const filterOperaConfig = ref({
|
||||||
value: '',
|
value: '',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
label: computed(() => t('名称')),
|
label: computed(() => t('名称')),
|
||||||
labelWidth: '82px',
|
labelWidth: '42px',
|
||||||
|
span: settingStore.device === 'mobile' ? 24 : 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
value: '',
|
||||||
|
key: 'ip',
|
||||||
|
label: computed(() => t('IP')),
|
||||||
|
labelWidth: '42px',
|
||||||
span: settingStore.device === 'mobile' ? 24 : 6
|
span: settingStore.device === 'mobile' ? 24 : 6
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -216,7 +281,8 @@ function analysisData(data){
|
||||||
ip: instance.ipAddr,
|
ip: instance.ipAddr,
|
||||||
port: instance.port["$"],
|
port: instance.port["$"],
|
||||||
status: instance.status,
|
status: instance.status,
|
||||||
createTime: instance.leaseInfo.registrationTimestamp
|
createTime: instance.leaseInfo.registrationTimestamp,
|
||||||
|
baseUrl: instance.healthCheckUrl.slice(0,-6)
|
||||||
}
|
}
|
||||||
tableData.push(instanceData)
|
tableData.push(instanceData)
|
||||||
}
|
}
|
||||||
|
@ -251,6 +317,16 @@ const validateNumber = (rule: any, value: any, callback: any) => {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// 服务器使用情况
|
||||||
|
let openChartConfig = ref({
|
||||||
|
show: false,
|
||||||
|
title: computed(() => t('')),
|
||||||
|
showFooter: true,
|
||||||
|
onOkLoading: true,
|
||||||
|
onOk:(newConfig) =>{
|
||||||
|
openChartView(qbaseUrl.value)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 增加 修改应用 弹框的变量配置 控制
|
// 增加 修改应用 弹框的变量配置 控制
|
||||||
let addDialogConfig = ref({
|
let addDialogConfig = ref({
|
||||||
|
@ -372,24 +448,6 @@ let ruleFormConfig = ref({
|
||||||
labelAlign: 'center',
|
labelAlign: 'center',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
function addDialog() {
|
|
||||||
initInterfaceList()
|
|
||||||
ruleFormConfig.value.model = {isEnable: true }
|
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
|
||||||
if (it.props == undefined) {
|
|
||||||
it.props = {
|
|
||||||
disabled: false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it.props.disabled = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
addDialogConfig.value.okText = "保存"
|
|
||||||
addDialogConfig.value.title = computed(() => t('新增黑名单信息'))
|
|
||||||
addDialogConfig.value.show = true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//编辑
|
//编辑
|
||||||
async function edit(row,type) {
|
async function edit(row,type) {
|
||||||
let alertText = "下线"
|
let alertText = "下线"
|
||||||
|
@ -465,55 +523,243 @@ async function view(data) {
|
||||||
addDialogConfig.value.title = computed(() => t('查看实例信息'))
|
addDialogConfig.value.title = computed(() => t('查看实例信息'))
|
||||||
addDialogConfig.value.show = true
|
addDialogConfig.value.show = true
|
||||||
}
|
}
|
||||||
//删除
|
const openChartView = (data)=>{
|
||||||
async function delData(id) {
|
qbaseUrl.value = data
|
||||||
ElMessageBox.confirm(
|
openChartConfig.value.okText = "刷新"
|
||||||
'是否确认删除这条数据',
|
openChartConfig.value.title = computed(() => t('查看服务使用情况'))
|
||||||
'删除数据确认',
|
openChartConfig.value.show = true
|
||||||
{
|
let baseData = {
|
||||||
confirmButtonText: '确定',
|
baseUrl:data.baseUrl
|
||||||
cancelButtonText: '取消',
|
}
|
||||||
type: 'info',
|
getCpuUsed(baseData).then((res)=>{
|
||||||
draggable: true
|
console.log(res)
|
||||||
}
|
nextTick(() => {
|
||||||
).then(() => {
|
const myChart = echarts.init(cpuChartContainerRef.value)
|
||||||
let para = {
|
myChart.setOption(buildOptions(parseFloat(res.measurements[0].value.toFixed(4))))
|
||||||
id: id
|
|
||||||
}
|
|
||||||
delInfoById(para).then((res) => {
|
|
||||||
if (res.status == "success") {
|
|
||||||
ElMessage({ type: 'info', message: '删除成功' })
|
|
||||||
getDataList(null)
|
|
||||||
} else {
|
|
||||||
ElMessage({ type: 'warning', message: "删除失败" + res.msg })
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
})
|
||||||
|
getMaxMemory(baseData).then((res) => {
|
||||||
|
let maxMemory = res.measurements[0].value
|
||||||
|
getUsedMemory(baseData).then((res) => {
|
||||||
|
let usedMemory = res.measurements[0].value;
|
||||||
|
let used = (usedMemory/maxMemory).toFixed(4);
|
||||||
|
nextTick(() => {
|
||||||
|
const memoryChart = echarts.init(memoryChartContainerRef.value)
|
||||||
|
memoryChart.setOption(buildOptions(parseFloat(used)))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
let param = {
|
||||||
|
id:data.instanceId
|
||||||
|
}
|
||||||
|
getRegisterNum(param).then((res)=>{
|
||||||
|
serviceUsedData.value.registerCount = res.data[0].num
|
||||||
|
})
|
||||||
|
getInvokeNumToday(param).then((res)=>{
|
||||||
|
serviceUsedData.value.todayCount = res.data
|
||||||
|
})
|
||||||
|
getHttpServerReqs(baseData).then((res)=>{
|
||||||
|
let measurements = res.measurements;
|
||||||
|
for(let it of measurements){
|
||||||
|
if(it.statistic.toUpperCase()=="COUNT"){
|
||||||
|
serviceUsedData.value.aveCount = calculateAverageDailyCallCount(data.createTime,it.value)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
async function initInterfaceList() {
|
// 计算平均每天调用次数
|
||||||
let para = {
|
const calculateAverageDailyCallCount = (registrationDate,totalCallCount) => {
|
||||||
page:1,
|
const now = new Date();
|
||||||
limit:9999999,
|
const registrationDateObj = new Date(registrationDate);
|
||||||
mayApply:'发布'
|
const daysSinceRegistration = (now - registrationDateObj) / (1000 * 60 * 60 * 24);
|
||||||
}
|
if(daysSinceRegistration<1){
|
||||||
getMayApplyInterfaceList(para).then((res) => {
|
return totalCallCount;
|
||||||
interfaceList.value = []
|
|
||||||
for (let it of res.data) {
|
|
||||||
let item = {
|
|
||||||
label: it.interfaceName+"-"+it.version,
|
|
||||||
value: it.id
|
|
||||||
}
|
|
||||||
interfaceList.value.push(item)
|
|
||||||
}
|
}
|
||||||
|
const averageDailyCallCount = totalCallCount / daysSinceRegistration;
|
||||||
|
return averageDailyCallCount.toFixed(2); // 保留两位小数
|
||||||
|
};
|
||||||
|
|
||||||
for(let it of ruleFormConfig.value.itemList){
|
function Pie() {
|
||||||
if(it.prop=='interfaceIds'){
|
let dataArr = [];
|
||||||
it.props.options = interfaceList.value
|
for (var i = 0; i < 150; i++) {
|
||||||
|
if (i % 2 === 0) {
|
||||||
|
dataArr.push({
|
||||||
|
name: (i + 1).toString(),
|
||||||
|
value: 50,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "#00AFFF",
|
||||||
|
borderWidth: 0,
|
||||||
|
borderColor: "rgba(0,0,0,0)",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
dataArr.push({
|
||||||
|
name: (i + 1).toString(),
|
||||||
|
value: 100,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: "rgba(0,0,0,0)",
|
||||||
|
borderWidth: 0,
|
||||||
|
borderColor: "rgba(0,0,0,0)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dataArr
|
||||||
|
}
|
||||||
|
function buildOptions(usedData){
|
||||||
|
let options = {
|
||||||
|
backgroundColor: 'transparent', // 画布背景色
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
// value: 50, // 内容 配合formatter
|
||||||
|
type: 'liquidFill',
|
||||||
|
radius: '70%', // 控制中间圆球的尺寸(此处可以理解为距离外圈圆的距离控制)
|
||||||
|
center: ['50%', '50%'],
|
||||||
|
data: [usedData, {
|
||||||
|
value: usedData,
|
||||||
|
direction: 'left', //波浪方向
|
||||||
|
}], // data个数代表波浪数
|
||||||
|
backgroundStyle: {
|
||||||
|
borderWidth: 1,
|
||||||
|
color: 'rgba(62, 208, 255, 1)' // 球体本景色
|
||||||
|
},
|
||||||
|
amplitude: '6 %',//波浪的振幅
|
||||||
|
// 修改波浪颜色
|
||||||
|
// color: ['#0286ea', 'l#0b99ff'], // 每个波浪不同颜色,颜色数组长度为对应的波浪个数
|
||||||
|
color: [{
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 0,
|
||||||
|
y2: 1,
|
||||||
|
colorStops: [
|
||||||
|
{
|
||||||
|
offset: 1,
|
||||||
|
color: '#6CDEFC',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
offset: 0,
|
||||||
|
color: '#429BF7',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
globalCoord: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
formatter: (usedData * 100).toFixed(2)+'%',
|
||||||
|
// formatter: function(params){
|
||||||
|
// return params.value* 100 + " \n%";
|
||||||
|
// },
|
||||||
|
rich: {
|
||||||
|
d: {
|
||||||
|
fontSize: 20,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 32,
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
outline: {
|
||||||
|
show: false
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
})
|
{
|
||||||
|
type: 'pie',
|
||||||
|
z: 1,
|
||||||
|
center: ['50%', '50%'],
|
||||||
|
radius: ['72%', '73.5%'], // 控制外圈圆的粗细
|
||||||
|
hoverAnimation: false,
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
name: '',
|
||||||
|
value: 500,
|
||||||
|
labelLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#00AFFF'
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
labelLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#00AFFF'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ //外发光
|
||||||
|
type: 'pie',
|
||||||
|
z: 1,
|
||||||
|
zlevel: -1,
|
||||||
|
radius: ['70%', '90.5%'],
|
||||||
|
center: ["50%", "50%"],
|
||||||
|
hoverAnimation: false,
|
||||||
|
clockWise: false,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
borderWidth: 20,
|
||||||
|
color: 'rgba(224,242,255,1)',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
data: [100]
|
||||||
|
},
|
||||||
|
{ //底层外发光
|
||||||
|
type: 'pie',
|
||||||
|
z:1,
|
||||||
|
zlevel: -2,
|
||||||
|
radius: ['70%', '100%'],
|
||||||
|
center: ["50%", "50%"],
|
||||||
|
hoverAnimation: false,
|
||||||
|
clockWise: false,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
borderWidth: 20,
|
||||||
|
color: 'rgba(224,242,255,.4)',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
data: [100]
|
||||||
|
},
|
||||||
|
// 虚点
|
||||||
|
{
|
||||||
|
type: 'pie',
|
||||||
|
zlevel: 0,
|
||||||
|
silent: true,
|
||||||
|
radius: ['78%', '80%'],
|
||||||
|
z: 1,
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
normal: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: Pie()
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return options
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
@ -525,3 +771,98 @@ getMayApplyInterfaceList(para).then((res) => {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style scoped>
|
||||||
|
.box-card {
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid var(--el-border-color-lighter);
|
||||||
|
}
|
||||||
|
:deep(.el-card__header) {
|
||||||
|
padding: 12px 20px;
|
||||||
|
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||||
|
background-color: var(--el-bg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-card__body) {
|
||||||
|
height: 130px !important;
|
||||||
|
padding: 0px 15px 15px 15px !important;
|
||||||
|
}
|
||||||
|
.overview-content {
|
||||||
|
height: calc(100% - 21px);
|
||||||
|
display: flex;
|
||||||
|
padding: 0px 20px;
|
||||||
|
|
||||||
|
.stat-items {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.stat-item {
|
||||||
|
text-align: center;
|
||||||
|
min-width: 80px;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 45px;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
margin-bottom: 6px;
|
||||||
|
font-family: yjsz;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px 20px;
|
||||||
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-pagination) {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.el-pagination__jump {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-prev,
|
||||||
|
.btn-next {
|
||||||
|
min-width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-pager {
|
||||||
|
li {
|
||||||
|
min-width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.labelTitle{
|
||||||
|
text-align: center;
|
||||||
|
display: flex; justify-content: center;
|
||||||
|
span {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bottomArea{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -24,7 +24,7 @@
|
||||||
import { computed, ref, nextTick } from 'vue';
|
import { computed, ref, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import applyInfo from './applyInfo.vue';
|
import applyInfo from './applyInfo.vue';
|
||||||
import { getApplyInfoByInterfaceId } from '@/api/interface/interface'
|
import { getApplyInfoByInterfaceId,getIpPortByInterfaceId } from '@/api/interface/interface'
|
||||||
import { downLoadSecret, getApplyInfoById } from '@/api/apply/apply'
|
import { downLoadSecret, getApplyInfoById } from '@/api/apply/apply'
|
||||||
|
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
|
@ -64,7 +64,9 @@ let ruleFormConfig = ref({
|
||||||
model: {
|
model: {
|
||||||
interfaceId: props.interfaceId,
|
interfaceId: props.interfaceId,
|
||||||
applyStopTime: "",
|
applyStopTime: "",
|
||||||
applyTime: ""
|
applyTime: "",
|
||||||
|
ip:"",
|
||||||
|
port:""
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// 表单验证规则。类型:FormRules
|
// 表单验证规则。类型:FormRules
|
||||||
|
@ -91,6 +93,22 @@ let ruleFormConfig = ref({
|
||||||
props: {
|
props: {
|
||||||
slotName: "openAuthDialog"
|
slotName: "openAuthDialog"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: computed(() => t('执行端IP')),
|
||||||
|
prop: 'ip',
|
||||||
|
props: {
|
||||||
|
disabled: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: computed(() => t('执行端端口')),
|
||||||
|
prop: 'port',
|
||||||
|
props: {
|
||||||
|
disabled: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
descriptionsFormConfig: {
|
descriptionsFormConfig: {
|
||||||
|
@ -121,8 +139,15 @@ function openPubDialog(id, type, name, isAuth) {
|
||||||
getApplyInfoById(para).then((response) => {
|
getApplyInfoById(para).then((response) => {
|
||||||
ruleFormConfig.value.model = response.data
|
ruleFormConfig.value.model = response.data
|
||||||
interfaceId.value = response.data.interfaceId
|
interfaceId.value = response.data.interfaceId
|
||||||
nextTick(() => {
|
let paraInterfaceId = {
|
||||||
applyInfoRef.value.initFormData(response.data)
|
id:interfaceId.value
|
||||||
|
}
|
||||||
|
getIpPortByInterfaceId(paraInterfaceId).then((resD)=>{
|
||||||
|
ruleFormConfig.value.model.ip = resD.data.ip;
|
||||||
|
ruleFormConfig.value.model.port = resD.data.port;
|
||||||
|
nextTick(() => {
|
||||||
|
applyInfoRef.value.initFormData(response.data)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -752,8 +752,7 @@ const uploadInterfaceFile = (id) => {
|
||||||
}
|
}
|
||||||
//接口文档预览按钮
|
//接口文档预览按钮
|
||||||
const viewInterfaceFile = (url, interfaceId) => {
|
const viewInterfaceFile = (url, interfaceId) => {
|
||||||
console.log(url)
|
|
||||||
console.log(interfaceId)
|
|
||||||
if (url != null && url != undefined && url != "") {
|
if (url != null && url != undefined && url != "") {
|
||||||
if (props.status == "发布" || props.status == "申请") {
|
if (props.status == "发布" || props.status == "申请") {
|
||||||
let para = {
|
let para = {
|
||||||
|
|
|
@ -144,7 +144,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,downLoadInterfaceFile } from '@/api/interface/interface'
|
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,downLoadInterfaceFile,getRegisterNum } from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -152,6 +152,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -851,7 +853,9 @@ let ruleFormConfig = ref({
|
||||||
{ required: true, message: computed(() => t('请输入链接地址')), trigger: 'blur' },
|
{ required: true, message: computed(() => t('请输入链接地址')), trigger: 'blur' },
|
||||||
{ validator: validateUrl, trigger: 'blur' }
|
{ validator: validateUrl, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
illustrate: [{ required: true, message: computed(() => t('接口描述不能为空')), trigger: 'blur' }]
|
illustrate: [{ required: true, message: computed(() => t('接口描述不能为空')), trigger: 'blur' }],
|
||||||
|
executeInstanceId:[{required:true,message:computed(()=> t('部署实例不能为空')),trigger:'blur'}]
|
||||||
|
|
||||||
},
|
},
|
||||||
itemList: [
|
itemList: [
|
||||||
{
|
{
|
||||||
|
@ -955,6 +959,14 @@ let ruleFormConfig = ref({
|
||||||
slotName: "isLimitData"
|
slotName: "isLimitData"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: computed(() => t('部署实例')),
|
||||||
|
prop: 'executeInstanceId',
|
||||||
|
props: {
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: computed(() => t('接口负责人')),
|
label: computed(() => t('接口负责人')),
|
||||||
|
@ -1241,6 +1253,16 @@ async function addDialog() {
|
||||||
ruleFormConfig.value.model.id = res.data
|
ruleFormConfig.value.model.id = res.data
|
||||||
discardInterfaceId.value = res.data
|
discardInterfaceId.value = res.data
|
||||||
interfaceId.value = res.data
|
interfaceId.value = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
value1.value = "false"
|
value1.value = "false"
|
||||||
value2.value = "false"
|
value2.value = "false"
|
||||||
value3.value = "false"
|
value3.value = "false"
|
||||||
|
@ -1252,6 +1274,9 @@ async function addDialog() {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
analysisYableData('[]', false)
|
analysisYableData('[]', false)
|
||||||
analysisTreeData(res)
|
analysisTreeData(res)
|
||||||
|
@ -1268,6 +1293,16 @@ async function edit(id) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1276,6 +1311,9 @@ async function edit(id) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, false)
|
analysisYableData(res.data.parameters, false)
|
||||||
|
@ -1292,6 +1330,16 @@ async function updateVersion(id) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1300,6 +1348,9 @@ async function updateVersion(id) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, false)
|
analysisYableData(res.data.parameters, false)
|
||||||
|
@ -1326,6 +1377,16 @@ async function view(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1334,6 +1395,9 @@ async function view(id, show) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = true
|
it.props.disabled = true
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, true)
|
analysisYableData(res.data.parameters, true)
|
||||||
|
@ -1352,6 +1416,16 @@ async function approveView(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
let arry = []
|
let arry = []
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
|
@ -1373,6 +1447,9 @@ async function approveView(id, show) {
|
||||||
}
|
}
|
||||||
arry.push(interfaceFileUrl)
|
arry.push(interfaceFileUrl)
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ruleFormConfig.value.itemList = arry;
|
ruleFormConfig.value.itemList = arry;
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
|
|
|
@ -144,7 +144,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById } from '@/api/interface/interface'
|
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,getRegisterNum } from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -152,6 +152,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//部署实例信息
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -960,6 +962,14 @@ let ruleFormConfig = ref({
|
||||||
slotName: "isLimitData"
|
slotName: "isLimitData"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: computed(() => t('部署实例')),
|
||||||
|
prop: 'executeInstanceId',
|
||||||
|
props: {
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: computed(() => t('接口负责人')),
|
label: computed(() => t('接口负责人')),
|
||||||
|
@ -1246,6 +1256,15 @@ async function view(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1254,6 +1273,9 @@ async function view(id, show) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = true
|
it.props.disabled = true
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, true)
|
analysisYableData(res.data.parameters, true)
|
||||||
|
|
|
@ -183,7 +183,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import {saveUpdateVersionInfo,saveInterfaceInfo,getInterfaceId,getInterfaceInfoById} from '@/api/interface/interface'
|
import {saveUpdateVersionInfo,saveInterfaceInfo,getInterfaceId,getInterfaceInfoById,getRegisterNum} from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -191,6 +191,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//部署实例信息
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
@ -739,7 +741,8 @@ let ruleFormConfig = ref({
|
||||||
],
|
],
|
||||||
illustrate:[{required:true,message:computed(()=> t('接口描述不能为空')),trigger:'blur'}],
|
illustrate:[{required:true,message:computed(()=> t('接口描述不能为空')),trigger:'blur'}],
|
||||||
systemId:[{required:true,message:computed(()=> t('接口归属系统不能为空')),trigger:'blur'}],
|
systemId:[{required:true,message:computed(()=> t('接口归属系统不能为空')),trigger:'blur'}],
|
||||||
deptId:[{required:true,message:computed(()=> t('接口负责人单位不能为空')),trigger:'blur'}]
|
deptId:[{required:true,message:computed(()=> t('接口负责人单位不能为空')),trigger:'blur'}],
|
||||||
|
executeInstanceId:[{required:true,message:computed(()=> t('部署实例不能为空')),trigger:'blur'}]
|
||||||
},
|
},
|
||||||
itemList: [
|
itemList: [
|
||||||
{
|
{
|
||||||
|
@ -844,6 +847,14 @@ let ruleFormConfig = ref({
|
||||||
slotName: "isLimitData"
|
slotName: "isLimitData"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: computed(() => t('部署实例')),
|
||||||
|
prop: 'executeInstanceId',
|
||||||
|
props: {
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: computed(() => t('接口负责人')),
|
label: computed(() => t('接口负责人')),
|
||||||
|
@ -1154,6 +1165,15 @@ async function addDialog(){
|
||||||
ruleFormConfig.value.model.id = res.data
|
ruleFormConfig.value.model.id = res.data
|
||||||
discardInterfaceId.value = res.data
|
discardInterfaceId.value = res.data
|
||||||
interfaceId.value = res.data
|
interfaceId.value = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for(let it of ruleFormConfig.value.itemList){
|
for(let it of ruleFormConfig.value.itemList){
|
||||||
if(it.props==undefined){
|
if(it.props==undefined){
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1162,6 +1182,9 @@ async function addDialog(){
|
||||||
}else{
|
}else{
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
analysisYableData('[]',false)
|
analysisYableData('[]',false)
|
||||||
analysisTreeData(res)
|
analysisTreeData(res)
|
||||||
|
@ -1614,6 +1637,32 @@ getListByType(selectParameter).then((res) => {
|
||||||
deptList.value.push(item)
|
deptList.value.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//解析json数据
|
||||||
|
function analysisData(data){
|
||||||
|
//存储需要的列表数据
|
||||||
|
let tableData = []
|
||||||
|
//获取注册应用数据列表
|
||||||
|
let applications = data.applications.application
|
||||||
|
//解析转化为table数据
|
||||||
|
for(let application of applications){
|
||||||
|
let appName = application.name
|
||||||
|
//解析实例
|
||||||
|
for(let instance of application.instance){
|
||||||
|
let instanceData = {
|
||||||
|
name: appName,
|
||||||
|
instanceId: instance.instanceId,
|
||||||
|
hostName:instance.hostName,
|
||||||
|
ip: instance.ipAddr,
|
||||||
|
port: instance.port["$"],
|
||||||
|
status: instance.status,
|
||||||
|
createTime: instance.leaseInfo.registrationTimestamp,
|
||||||
|
baseUrl: instance.healthCheckUrl.slice(0,-6)
|
||||||
|
}
|
||||||
|
tableData.push(instanceData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tableData
|
||||||
|
}
|
||||||
defineExpose({addDialog,edit,view,updateVersion})
|
defineExpose({addDialog,edit,view,updateVersion})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
import { computed, ref, nextTick } from 'vue';
|
import { computed, ref, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import applyInfo from './applyInfo.vue';
|
import applyInfo from './applyInfo.vue';
|
||||||
import { getApplyInfoByInterfaceId } from '@/api/interface/interface'
|
import { getApplyInfoByInterfaceId,getIpPortByInterfaceId } from '@/api/interface/interface'
|
||||||
import { downLoadSecret, getApplyInfoById } from '@/api/apply/apply'
|
import { downLoadSecret, getApplyInfoById } from '@/api/apply/apply'
|
||||||
|
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
|
@ -64,7 +64,9 @@ let ruleFormConfig = ref({
|
||||||
model: {
|
model: {
|
||||||
interfaceId: props.interfaceId,
|
interfaceId: props.interfaceId,
|
||||||
applyStopTime: "",
|
applyStopTime: "",
|
||||||
applyTime: ""
|
applyTime: "",
|
||||||
|
ip:"",
|
||||||
|
port:""
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// 表单验证规则。类型:FormRules
|
// 表单验证规则。类型:FormRules
|
||||||
|
@ -91,6 +93,22 @@ let ruleFormConfig = ref({
|
||||||
props: {
|
props: {
|
||||||
slotName: "openAuthDialog"
|
slotName: "openAuthDialog"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: computed(() => t('执行端IP')),
|
||||||
|
prop: 'ip',
|
||||||
|
props: {
|
||||||
|
disabled: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: computed(() => t('执行端端口')),
|
||||||
|
prop: 'port',
|
||||||
|
props: {
|
||||||
|
disabled: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
descriptionsFormConfig: {
|
descriptionsFormConfig: {
|
||||||
|
@ -103,7 +121,6 @@ let ruleFormConfig = ref({
|
||||||
function openPubDialog(id, type, name, isAuth) {
|
function openPubDialog(id, type, name, isAuth) {
|
||||||
interfaceId.value = id
|
interfaceId.value = id
|
||||||
openDialog.value = true
|
openDialog.value = true
|
||||||
debugger
|
|
||||||
if (type == "申请") {
|
if (type == "申请") {
|
||||||
let para = {
|
let para = {
|
||||||
id: id
|
id: id
|
||||||
|
@ -121,8 +138,15 @@ function openPubDialog(id, type, name, isAuth) {
|
||||||
getApplyInfoById(para).then((response) => {
|
getApplyInfoById(para).then((response) => {
|
||||||
ruleFormConfig.value.model = response.data
|
ruleFormConfig.value.model = response.data
|
||||||
interfaceId.value = response.data.interfaceId
|
interfaceId.value = response.data.interfaceId
|
||||||
nextTick(() => {
|
let paraInterfaceId = {
|
||||||
applyInfoRef.value.initFormData(response.data)
|
id:interfaceId.value
|
||||||
|
}
|
||||||
|
getIpPortByInterfaceId(paraInterfaceId).then((resD)=>{
|
||||||
|
ruleFormConfig.value.model.ip = resD.data.ip;
|
||||||
|
ruleFormConfig.value.model.port = resD.data.port;
|
||||||
|
nextTick(() => {
|
||||||
|
applyInfoRef.value.initFormData(response.data)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,downLoadInterfaceFile } from '@/api/interface/interface'
|
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,downLoadInterfaceFile,getRegisterNum } from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -152,6 +152,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//实例信息
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -850,7 +852,8 @@ let ruleFormConfig = ref({
|
||||||
{ required: true, message: computed(() => t('请输入链接地址')), trigger: 'blur' },
|
{ required: true, message: computed(() => t('请输入链接地址')), trigger: 'blur' },
|
||||||
{ validator: validateUrl, trigger: 'blur' }
|
{ validator: validateUrl, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
illustrate: [{ required: true, message: computed(() => t('接口描述不能为空')), trigger: 'blur' }]
|
illustrate: [{ required: true, message: computed(() => t('接口描述不能为空')), trigger: 'blur' }],
|
||||||
|
executeInstanceId:[{required:true,message:computed(()=> t('部署实例不能为空')),trigger:'blur'}]
|
||||||
},
|
},
|
||||||
itemList: [
|
itemList: [
|
||||||
{
|
{
|
||||||
|
@ -946,6 +949,14 @@ let ruleFormConfig = ref({
|
||||||
slotName: "isAuth"
|
slotName: "isAuth"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: computed(() => t('部署实例')),
|
||||||
|
prop: 'executeInstanceId',
|
||||||
|
props: {
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'slot',
|
type: 'slot',
|
||||||
label: computed(() => t('是否控制数据请求范围')),
|
label: computed(() => t('是否控制数据请求范围')),
|
||||||
|
@ -1267,6 +1278,16 @@ async function edit(id) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1275,6 +1296,9 @@ async function edit(id) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, false)
|
analysisYableData(res.data.parameters, false)
|
||||||
|
@ -1291,6 +1315,16 @@ async function updateVersion(id) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1299,6 +1333,9 @@ async function updateVersion(id) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, false)
|
analysisYableData(res.data.parameters, false)
|
||||||
|
@ -1329,6 +1366,16 @@ async function view(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1337,6 +1384,9 @@ async function view(id, show) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = true
|
it.props.disabled = true
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, true)
|
analysisYableData(res.data.parameters, true)
|
||||||
|
@ -1355,6 +1405,16 @@ async function approveView(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
let arry = []
|
let arry = []
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
|
@ -1376,6 +1436,9 @@ async function approveView(id, show) {
|
||||||
}
|
}
|
||||||
arry.push(interfaceFileUrl)
|
arry.push(interfaceFileUrl)
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ruleFormConfig.value.itemList = arry;
|
ruleFormConfig.value.itemList = arry;
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
|
|
|
@ -144,7 +144,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById } from '@/api/interface/interface'
|
import { saveUpdateVersionInfo, saveInterfaceInfo, getInterfaceId, getInterfaceInfoById,getRegisterNum } from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -152,6 +152,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -953,11 +955,11 @@ let ruleFormConfig = ref({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'slot',
|
type: 'select',
|
||||||
label: computed(() => t('是否控制数据请求范围')),
|
label: computed(() => t('部署实例')),
|
||||||
prop: 'isLimitData',
|
prop: 'executeInstanceId',
|
||||||
props:{
|
props: {
|
||||||
slotName: "isLimitData"
|
options: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1246,6 +1248,16 @@ async function view(id, show) {
|
||||||
}
|
}
|
||||||
let res = await getInterfaceInfoById(para)
|
let res = await getInterfaceInfoById(para)
|
||||||
ruleFormConfig.value.model = res.data
|
ruleFormConfig.value.model = res.data
|
||||||
|
exceuteInstanceInfo.value = []
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for (let it of ruleFormConfig.value.itemList) {
|
for (let it of ruleFormConfig.value.itemList) {
|
||||||
if (it.props == undefined) {
|
if (it.props == undefined) {
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1254,6 +1266,9 @@ async function view(id, show) {
|
||||||
} else {
|
} else {
|
||||||
it.props.disabled = true
|
it.props.disabled = true
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initData(res.data)
|
initData(res.data)
|
||||||
analysisYableData(res.data.parameters, true)
|
analysisYableData(res.data.parameters, true)
|
||||||
|
|
|
@ -186,7 +186,7 @@ import { computed, h, ref, inject } from 'vue';
|
||||||
import { useSettingStore } from '@/store/modules/settingStore';
|
import { useSettingStore } from '@/store/modules/settingStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { $validCheck } from '@/utils/validate'
|
import { $validCheck } from '@/utils/validate'
|
||||||
import {saveUpdateVersionInfo,saveInterfaceInfo,getInterfaceId,getInterfaceInfoById} from '@/api/interface/interface'
|
import {saveUpdateVersionInfo,saveInterfaceInfo,getInterfaceId,getInterfaceInfoById,getRegisterNum} from '@/api/interface/interface'
|
||||||
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
import {getListByType,getListByPid} from '@/api/systemidentifier/systemidentifier'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
import interfaceAuth from '@/views/auth/interfaceAuth.vue';
|
||||||
|
@ -194,6 +194,8 @@ import parameter from '../parameter/parameterTable.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { nextTick } from 'vue';
|
import { nextTick } from 'vue';
|
||||||
|
|
||||||
|
//
|
||||||
|
const exceuteInstanceInfo = ref([])
|
||||||
// 注入 字体对象
|
// 注入 字体对象
|
||||||
const fontSizeObj: any = inject('sizeObjInfo');
|
const fontSizeObj: any = inject('sizeObjInfo');
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
@ -742,7 +744,8 @@ let ruleFormConfig = ref({
|
||||||
],
|
],
|
||||||
illustrate:[{required:true,message:computed(()=> t('接口描述不能为空')),trigger:'blur'}],
|
illustrate:[{required:true,message:computed(()=> t('接口描述不能为空')),trigger:'blur'}],
|
||||||
systemId:[{required:true,message:computed(()=> t('接口归属系统不能为空')),trigger:'blur'}],
|
systemId:[{required:true,message:computed(()=> t('接口归属系统不能为空')),trigger:'blur'}],
|
||||||
deptId:[{required:true,message:computed(()=> t('接口负责人单位不能为空')),trigger:'blur'}]
|
deptId:[{required:true,message:computed(()=> t('接口负责人单位不能为空')),trigger:'blur'}],
|
||||||
|
executeInstanceId:[{required:true,message:computed(()=> t('部署实例不能为空')),trigger:'blur'}]
|
||||||
},
|
},
|
||||||
itemList: [
|
itemList: [
|
||||||
{
|
{
|
||||||
|
@ -839,6 +842,14 @@ let ruleFormConfig = ref({
|
||||||
slotName: "isAuth"
|
slotName: "isAuth"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: computed(() => t('部署实例')),
|
||||||
|
prop: 'executeInstanceId',
|
||||||
|
props: {
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// type: 'slot',
|
// type: 'slot',
|
||||||
// label: computed(() => t('是否控制数据请求范围')),
|
// label: computed(() => t('是否控制数据请求范围')),
|
||||||
|
@ -888,7 +899,12 @@ let ruleFormConfig = ref({
|
||||||
}
|
}
|
||||||
systemList.value.push(item)
|
systemList.value.push(item)
|
||||||
}
|
}
|
||||||
ruleFormConfig.value.itemList[11].props.options = systemList.value
|
for(let it of ruleFormConfig.value.itemList){
|
||||||
|
if(it.prop == "systemId"){
|
||||||
|
it.props.options = systemList.value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1152,6 +1168,15 @@ async function addDialog(){
|
||||||
ruleFormConfig.value.model.id = res.data
|
ruleFormConfig.value.model.id = res.data
|
||||||
discardInterfaceId.value = res.data
|
discardInterfaceId.value = res.data
|
||||||
interfaceId.value = res.data
|
interfaceId.value = res.data
|
||||||
|
let resExecute = await getRegisterNum()
|
||||||
|
//let executeTable = analysisData(resExecute)
|
||||||
|
for(let it of resExecute.data){
|
||||||
|
let item = {
|
||||||
|
label: computed(() => t("实例ID:" + it.instanceId + " 已注册接口数:"+it.num)), value: it.instanceId
|
||||||
|
}
|
||||||
|
exceuteInstanceInfo.value.push(item)
|
||||||
|
|
||||||
|
}
|
||||||
for(let it of ruleFormConfig.value.itemList){
|
for(let it of ruleFormConfig.value.itemList){
|
||||||
if(it.props==undefined){
|
if(it.props==undefined){
|
||||||
it.props = {
|
it.props = {
|
||||||
|
@ -1160,6 +1185,9 @@ async function addDialog(){
|
||||||
}else{
|
}else{
|
||||||
it.props.disabled = false
|
it.props.disabled = false
|
||||||
}
|
}
|
||||||
|
if(it.prop=="executeInstanceId"){
|
||||||
|
it.props.options = exceuteInstanceInfo.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
analysisYableData('[]',false)
|
analysisYableData('[]',false)
|
||||||
analysisTreeData(res)
|
analysisTreeData(res)
|
||||||
|
@ -1612,6 +1640,32 @@ getListByType(selectParameter).then((res) => {
|
||||||
deptList.value.push(item)
|
deptList.value.push(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//解析json数据
|
||||||
|
function analysisData(data){
|
||||||
|
//存储需要的列表数据
|
||||||
|
let tableData = []
|
||||||
|
//获取注册应用数据列表
|
||||||
|
let applications = data.applications.application
|
||||||
|
//解析转化为table数据
|
||||||
|
for(let application of applications){
|
||||||
|
let appName = application.name
|
||||||
|
//解析实例
|
||||||
|
for(let instance of application.instance){
|
||||||
|
let instanceData = {
|
||||||
|
name: appName,
|
||||||
|
instanceId: instance.instanceId,
|
||||||
|
hostName:instance.hostName,
|
||||||
|
ip: instance.ipAddr,
|
||||||
|
port: instance.port["$"],
|
||||||
|
status: instance.status,
|
||||||
|
createTime: instance.leaseInfo.registrationTimestamp,
|
||||||
|
baseUrl: instance.healthCheckUrl.slice(0,-6)
|
||||||
|
}
|
||||||
|
tableData.push(instanceData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tableData
|
||||||
|
}
|
||||||
defineExpose({addDialog,edit,view,updateVersion})
|
defineExpose({addDialog,edit,view,updateVersion})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
Loading…
Reference in New Issue