服务器注册添加下架设备列表

This commit is contained in:
康冉冉
2026-02-09 18:04:52 +08:00
parent c9457a3c7f
commit 8bfa06b99a
2 changed files with 182 additions and 128 deletions
+8
View File
@@ -775,6 +775,14 @@ export function removeAlarmFlag(query) {
data: query
})
}
// 下架列表
export function getLossList(query) {
return request({
url: '/system/registration/lossList',
method: 'post',
data: query
})
}
// 下架
export function removeServer(query) {
return request({
+174 -128
View File
@@ -1,14 +1,19 @@
<template>
<div class="app-container pageTopForm">
<div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleClick('noRequest')">
<el-tab-pane label="正常设备" name="first"></el-tab-pane>
<el-tab-pane label="下架设备" name="second"></el-tab-pane>
</el-tabs>
<div class="pageTopForm">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="auto">
<el-col :span="6">
<el-form-item label="搜索" title="搜索" prop="queryParam">
<el-input
v-model="queryParams.queryParam"
placeholder="请输入公网IP/私网IP/设备SN/clientID"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="搜索" title="搜索" prop="queryParam">
<el-input
v-model="queryParams.queryParam"
placeholder="请输入公网IP/私网IP/设备SN/clientID"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="在线状态" title="在线状态" prop="onlineStatus">
@@ -82,132 +87,134 @@
</el-col>
<el-col :span="8">
<el-form-item class="lastBtnSty">
<el-button type="primary" size="mini" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" size="mini" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-col>
</el-form>
<!-- 表格数据 -->
<TableList ref="tabRef" :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getHightLight" @value-change="handleValueChange">
<template #tempCopy="{ row, column}">
<span class="disInlineBlock" :style="`max-width: calc(100% - 19px);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;vertical-align: middle;`">{{row.clientId}}</span>
<el-link :underline="false" icon="el-icon-document-copy" title="复制" v-clipboard:copy="row.clientId" v-clipboard:success="clipboardSuccess" style="margin-left: 5px;color: #409EFF;"></el-link>
</template>
<template #tempOutbound="{ row, column}">
{{row.outboundRate}}<span v-if="row && row.outboundRate">%</span>
</template>
<!-- 多公网IP状态 -->
<template #tempMultipubStatus="{ row, column }">
<dict-tag :options="dict.type.rm_moreip_status" :value="row.multiPublicIpStatus"/>
</template>
<!-- 注册状态 -->
<template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.rm_register_status" :value="row.registrationStatus"/>
</template>
<!-- 在线状态 -->
<template #tempOnlineStatus="{ row, column }">
<dict-tag :options="dict.type.rm_register_online_state" :value="row.onlineStatus"/>
</template>
<!-- 标签 -->
<template #tempRemark="{ row, column }">
<template v-if="row.remark">
<el-tag v-for="(item, index) of row.remark.split(',')" :style="{marginLeft: index !== 0 ? '5px' : null}">
{{item}}<span v-if="index+1 !== row.remark.split(',').length" style="color: transparent;">,</span>
</el-tag>
<TableList ref="tabRef" :columns="columns" :config="config" :modelIdent="this.$options.name" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="handleClick" @value-change="handleValueChange">
<template #tempCopy="{ row, column}">
<span class="disInlineBlock" :style="`max-width: calc(100% - 19px);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;vertical-align: middle;`">{{row.clientId}}</span>
<el-link :underline="false" icon="el-icon-document-copy" title="复制" v-clipboard:copy="row.clientId" v-clipboard:success="clipboardSuccess" style="margin-left: 5px;color: #409EFF;"></el-link>
</template>
</template>
<template #tempHandle="{ row, column }">
<div class="w100">
<!-- 非编辑状态显示文本 -->
<template v-if="!row.editStatus">
<span>{{ row.reportedBandwidth || '-'}}</span>
<el-button icon="el-icon-edit" style="padding: 0px;" type="text" @click="rowDataChange(row, true)"></el-button>
<template #tempOutbound="{ row, column}">
{{row.outboundRate}}<span v-if="row && row.outboundRate">%</span>
</template>
<!-- 多公网IP状态 -->
<template #tempMultipubStatus="{ row, column }">
<dict-tag :options="dict.type.rm_moreip_status" :value="row.multiPublicIpStatus"/>
</template>
<!-- 注册状态 -->
<template #tempStatus="{ row, column }">
<dict-tag :options="dict.type.rm_register_status" :value="row.registrationStatus"/>
</template>
<!-- 在线状态 -->
<template #tempOnlineStatus="{ row, column }">
<dict-tag :options="dict.type.rm_register_online_state" :value="row.onlineStatus"/>
</template>
<!-- 标签 -->
<template #tempRemark="{ row, column }">
<template v-if="row.remark">
<el-tag v-for="(item, index) of row.remark.split(',')" :style="{marginLeft: index !== 0 ? '5px' : null}">
{{item}}<span v-if="index+1 !== row.remark.split(',').length" style="color: transparent;">,</span>
</el-tag>
</template>
<template v-else>
<!-- 编辑状态显示输入框 -->
<el-col :span="12">
<el-input
v-model="row.reportedBandwidth"
size="mini"
class="customSty"
@keyup.enter.native="$event.target.blur"
@blur="handleSubmit(row)"
></el-input>
</el-col>
<el-col :span="12">
<el-button size="mini" style="padding: 6px 5px;margin-left: 5px;" type="primary" @click="handleSubmit(row)">确定</el-button>
<el-button size="mini" style="padding: 6px 5px;margin-left: 5px;" @click="rowDataChange(row, false)">取消</el-button>
</el-col>
</template>
<template #tempHandle="{ row, column }">
<div class="w100">
<!-- 非编辑状态显示文本 -->
<template v-if="!row.editStatus">
<span>{{ row.reportedBandwidth || '-'}}</span>
<el-button icon="el-icon-edit" style="padding: 0px;" type="text" @click="rowDataChange(row, true)"></el-button>
</template>
<template v-else>
<!-- 编辑状态显示输入框 -->
<el-col :span="12">
<el-input
v-model="row.reportedBandwidth"
size="mini"
class="customSty"
@keyup.enter.native="$event.target.blur"
@blur="handleSubmit(row)"
></el-input>
</el-col>
<el-col :span="12">
<el-button size="mini" style="padding: 6px 5px;margin-left: 5px;" type="primary" @click="handleSubmit(row)">确定</el-button>
<el-button size="mini" style="padding: 6px 5px;margin-left: 5px;" @click="rowDataChange(row, false)">取消</el-button>
</el-col>
</template>
</div>
</template>
</TableList>
<!-- 查看执行结果弹窗 -->
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" height="300px" append-to-body>
<div class="block" style="max-height: calc(100vh - 125px);overflow: auto;">
<template v-if="timelineList && timelineList.length > 0">
<el-timeline :reverse="false">
<el-timeline-item v-for="item of timelineList" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</el-timeline>
</template>
<el-empty v-else :image-size="200"></el-empty>
</div>
</template>
</TableList>
<!-- 查看执行结果弹窗 -->
<el-dialog title="命令执行结果" :visible.sync="open" width="800px" height="300px" append-to-body>
<div class="block" style="max-height: calc(100vh - 125px);overflow: auto;">
<template v-if="timelineList && timelineList.length > 0">
<el-timeline :reverse="false">
<el-timeline-item v-for="item of timelineList" :timestamp="item.createTime" placement="top">
<pre>{{item.content}}</pre>
</el-timeline-item>
</el-timeline>
</template>
<el-empty v-else :image-size="200"></el-empty>
</div>
</el-dialog>
<!-- 下发业务 -->
<el-dialog :title="title" :visible.sync="issueOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<BusinessIssuedDetails :open="`type_${issueOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></BusinessIssuedDetails>
</el-dialog>
<!-- 下发脚本策略 -->
<el-dialog :title="title" :visible.sync="scriptOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<severScriptStratDetails :open="`type_${scriptOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></severScriptStratDetails>
</el-dialog>
<!-- 添加监控策略 -->
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1200px" append-to-body>
<MonitorStrategy :open="`type_${stratOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></MonitorStrategy>
</el-dialog>
<!-- mtr探测丢包率趋势图 -->
<el-dialog title="MTR探测丢包率趋势图" :visible.sync="mtrChartOpen" width="1200px" append-to-body>
<lossRateChart :open="`type_${mtrChartOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></lossRateChart>
</el-dialog>
<!-- 选择公网业务IP -->
<el-dialog title="选择公网业务IP" :visible.sync="pubilcNetOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<Form ref="publicNetFormRef" :formList="pubilcNetFormList" :ruleFormData="pubilcNetRuleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submitPubilc">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
<!-- 标签 -->
<el-dialog :title="tagTitle" :visible.sync="tagOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<div v-if="!(tagRuleForm && tagRuleForm.id)" style="margin-left: 20px; margin-bottom: 10px; color: #989898; font-size: 12px;">此页面只会对所选服务器增加标签不能查看和删除服务器原有的标签</div>
<Form ref="tagFormRef" :formList="tagFormList" :ruleFormData="tagRuleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submitTag">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
<!-- 显示frp地址 -->
<el-dialog title="FRP连接地址" :visible.sync="frpOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<div v-if="frpDialogContent.frpStatus == 1" class="textAlignCenter" style="font-size: 1rem;">
地址正在生成中......
</div>
<div v-else class="textAlignCenter" style="font-size: 1rem;">
地址{{frpDialogContent.frpcServerAddr}}端口{{frpDialogContent.port}}
<el-link :underline="false" icon="el-icon-document-copy" title="复制" v-clipboard:copy="frpDialogContent.collect" v-clipboard:success="clipboardSuccess" style="margin-left: 10px;color: #409EFF;"></el-link>
</div>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
</el-dialog>
<!-- 下发业务 -->
<el-dialog :title="title" :visible.sync="issueOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<BusinessIssuedDetails :open="`type_${issueOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></BusinessIssuedDetails>
</el-dialog>
<!-- 下发脚本策略 -->
<el-dialog :title="title" :visible.sync="scriptOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<severScriptStratDetails :open="`type_${scriptOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></severScriptStratDetails>
</el-dialog>
<!-- 添加监控策略 -->
<el-dialog title="添加监控策略" :visible.sync="stratOpen" width="1200px" append-to-body>
<MonitorStrategy :open="`type_${stratOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></MonitorStrategy>
</el-dialog>
<!-- mtr探测丢包率趋势图 -->
<el-dialog title="MTR探测丢包率趋势图" :visible.sync="mtrChartOpen" width="1200px" append-to-body>
<lossRateChart :open="`type_${mtrChartOpen}`" :dialogRowData="dialogRowData" @dialogResult="fnDialogResult"></lossRateChart>
</el-dialog>
<!-- 选择公网业务IP -->
<el-dialog title="选择公网业务IP" :visible.sync="pubilcNetOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<Form ref="publicNetFormRef" :formList="pubilcNetFormList" :ruleFormData="pubilcNetRuleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submitPubilc">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
<!-- 标签 -->
<el-dialog :title="tagTitle" :visible.sync="tagOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<div v-if="!(tagRuleForm && tagRuleForm.id)" style="margin-left: 20px; margin-bottom: 10px; color: #989898; font-size: 12px;">此页面只会对所选服务器增加标签不能查看和删除服务器原有的标签</div>
<Form ref="tagFormRef" :formList="tagFormList" :ruleFormData="tagRuleForm" :config="{labelWidth: '140px', buttonGroup: []}" @fnClick="callback"></Form>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button type="primary" style="margin-left: 10px;" @click="submitTag">提交</el-button>
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
<!-- 显示frp地址 -->
<el-dialog title="FRP连接地址" :visible.sync="frpOpen" width="800px" append-to-body style="padding-bottom: 20px;">
<div v-if="frpDialogContent.frpStatus == 1" class="textAlignCenter" style="font-size: 1rem;">
地址正在生成中......
</div>
<div v-else class="textAlignCenter" style="font-size: 1rem;">
地址{{frpDialogContent.frpcServerAddr}}端口{{frpDialogContent.port}}
<el-link :underline="false" icon="el-icon-document-copy" title="复制" v-clipboard:copy="frpDialogContent.collect" v-clipboard:success="clipboardSuccess" style="margin-left: 10px;color: #409EFF;"></el-link>
</div>
<div style="text-align: right;margin-right: 20px;margin-bottom: 20px;">
<el-button @click="callback({fnCode: 'cancel'})">取消</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script setup name="Register">
import Form from '@/components/form/index.vue';
import {listHandle, networkList, getScriptResultBySn, getLogicalNode, addRemark, updateRemark, repBandwidthSubmit, bindBusPublic, virNetInterfaceChild, getAlarmFlag, removeAlarmFlag, frpConnectLink, listFrpcConfig, removeServer} from '@/api/disRevenue/resource';
import {listHandle, networkList, getScriptResultBySn, getLogicalNode, addRemark, updateRemark, repBandwidthSubmit, bindBusPublic,
virNetInterfaceChild, getAlarmFlag, removeAlarmFlag, frpConnectLink, listFrpcConfig, removeServer, getLossList} from '@/api/disRevenue/resource';
import {listAllBusinessList} from "@/api/disRevenue/earnManage"
import TableList from '@/components/table/index.vue';
import MonitorStrategy from '../serverMonitorStrat/monitorStrategy';
@@ -220,6 +227,8 @@
dicts: ['rm_moreip_status', 'rm_register_status', 'rm_register_online_state', 'policy_method'],
data() {
return {
activeName: 'first',
cacheActiveName: 'first',
open: false,
stratOpen: false,
roleList: [],
@@ -286,14 +295,15 @@
registrationStatus: { label: `注册状态`, slotName: 'tempStatus', minWidth: '60', visible: true},
logicalNodeId: { label: `逻辑节点标识`, minWidth: '90', visible: true},
multiPublicIpStatus: { label: `多公网IP状态`, slotName: 'tempMultipubStatus', minWidth: '90', visible: true },
createTime:{ label: `注册时间`,minWidth: '140'},
onboardTime:{ label: `上机时间`,minWidth: '140'},
createTime:{ label: `注册时间`,minWidth: '90'},
onboardTime:{ label: `上机时间`,minWidth: '90'},
agentVersion:{ label: `agent版本`,minWidth: '80'},
machineCode:{ label: `金山machineCode`,minWidth: '120'},
cpuUtil:{ label: `CPU使用率`,minWidth: '80'},
memUtil:{ label: `内存使用率`,minWidth: '80'},
},
config: {
config: {},
firstConfig: {
tableButton: {
top: [
{content: '添加金山machineCode', fnCode: 'add', type: 'primary', icon: 'el-icon-plus', hasPermi: 'resource:serverRegister:add'},
@@ -325,16 +335,19 @@
]
}
},
secondConfig: {
tableButton: {
line: [
{content: '详情', fnCode: 'details', type: 'primary', icon: 'el-icon-view', hasPermi: 'rocketmq:traffic'}
]
}
},
queryParams: {
pageNum: 1,
pageSize: 10,
total: 0
},
timelineList: [
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-12 12:12:12'},
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-11 12:12:12'},
{content: '【服务器节点名称1】执行脚本命令', time: '2025-12-10 12:12:12'}
],
timelineList: [],
issueOpen: false,
scriptOpen: false,
title: '',
@@ -385,6 +398,37 @@
// });
// },
methods: {
handleClick(val) {
if (val && val === 'noRequest' && this.cacheActiveName === this.activeName) return;
if (this.cacheActiveName !== this.activeName) {
this.queryParams = {pageNum: 1, pageSize: 10, total: 0};
}
this.cacheActiveName = this.activeName;
this.$refs.tabRef.showSearch = true;
if (this.activeName === 'first') {
this.getHightLight();
} else if (this.activeName === 'second') {
this.fnGetLossList();
}
},
fnGetLossList() {
let params = JSON.parse(JSON.stringify(this.queryParams));
if (params && !params.queryParam) {
params.queryParam = null;
}
if (this.alarmFlagHight && !params.bandwidthResultSort) {
params = Object.assign({}, params, {bandwidthResultSort: 4});
}
// this.$modal.loading();
getLossList(this.addDateRange(params)).then(response => {
this.config = {...this.secondConfig};
this.roleList = response.rows;
delete this.queryParams.resetVal;
this.queryParams.total = response.total;
}).catch(() => {
this.config = {...this.secondConfig};
});
},
fnBusNameList() {
listAllBusinessList().then(val => {
this.busNameList = val && val.data.map(item => {
@@ -430,12 +474,14 @@
}
// this.$modal.loading();
listHandle(this.addDateRange(params)).then(response => {
this.config = {...this.firstConfig};
this.roleList = response.rows;
delete this.queryParams.resetVal;
this.queryParams.total = response.total;
// this.$modal.closeLoading();
}).catch(() => {
// this.$modal.closeLoading();
this.config = {...this.firstConfig};
});
},