提交初始化后的计划规则

This commit is contained in:
Lys 2026-01-19 16:00:42 +08:00
parent 715e263ffb
commit 178551efba
6 changed files with 98 additions and 9 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { NodeGroupVO, NodeGroupForm, NodeGroupQuery, LinkNodeListVO, SaveGroupNodeBo } from '@/api/net/nodeGroup/types';
import { NodeGroupVO, NodeGroupForm, NodeGroupQuery, LinkNodeListVO, SaveGroupNodeBo, NodeGroupQueryBo } from '@/api/net/nodeGroup/types';
/**
*
@ -62,7 +62,7 @@ export const delNodeGroup = (id: string | number | Array<string | number>) => {
});
};
export const linkNodeList = (query?: NodeGroupQuery): AxiosPromise<LinkNodeListVO> => {
export const linkNodeList = (query?: NodeGroupQueryBo): AxiosPromise<LinkNodeListVO> => {
return request({
url: '/net/nodeGroup/linkNodeList',
method: 'get',

View File

@ -87,6 +87,36 @@ export interface NodeGroupQuery extends PageQuery {
params?: any;
}
export interface NodeGroupQueryBo {
id?: string | number;
/**
*
*/
name?: string;
/**
*
*/
strategyType?: string;
/**
*
*/
testUrl?: string;
/**
*
*/
intervalGap?: number;
/**
*
*/
params?: any;
}
export interface GroupVO {
id?: string | number;
intervalGap?: number;

View File

@ -7,32 +7,32 @@ export interface PlanVO {
/**
*
*/
planName: string;
planName?: string;
/**
*
*/
totalFlow: number;
totalFlow?: number;
/**
*
*/
maxSpeedLimit: number;
maxSpeedLimit?: number;
/**
*
*/
minSpeedLimit: number;
minSpeedLimit?: number;
/**
*
*/
outOfFlowStrategy: string;
outOfFlowStrategy?: string;
/**
* ID
*/
groupIds: string | number;
groupIds?: string | number;
}

View File

@ -127,7 +127,7 @@ const getList = async () => {
const groupId = route.params && route.params.groupId;
if (groupId) {
linkNodeList({
id: groupId
id: groupId as string
}).then(res => {
Object.assign(selected.value, res.data.selected);
Object.assign(unselected.value, res.data.unselected);

View File

@ -64,6 +64,10 @@
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['net:plan:edit']"></el-button>
</el-tooltip>
<el-tooltip content="规则模板" placement="top">
<el-button link type="primary" icon="Link" @click="handleLink(scope.row)"
v-hasPermi="['net:plan:rule']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['net:plan:remove']"></el-button>
@ -114,6 +118,7 @@ import { listPlan, getPlan, delPlan, addPlan, updatePlan } from '@/api/net/plan'
import { getNodeGroupList } from '@/api/net/nodeGroup';
import { PlanVO, PlanQuery, PlanForm } from '@/api/net/plan/types';
import { NodeGroupVO } from '@/api/net/nodeGroup/types';
import router from '@/router';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -178,6 +183,12 @@ const getList = async () => {
loading.value = false;
}
/** 修改按钮操作 */
const handleLink = async (row?: PlanVO) => {
const planId = row.id;
router.push('/netServer/plan/planRule/' + planId);
}
const getGroupName = (id) => {
let name = "";
groupList.value.forEach(group => {

View File

@ -0,0 +1,48 @@
<template>
<div class="p-2">
<div class="panel">
<h4 class="panel-title">基本信息</h4>
<el-form :model="planInfo" :inline="true">
<el-row :gutter="10">
<el-col :span="2.5">
<el-form-item label="计划名称" prop="planName" label-width="90">
<el-input v-model="planInfo.planName" disabled />
</el-form-item>
</el-col>
<el-col :span="2.5">
<el-form-item label="最大流量(Gb)" prop="totalFlow" label-width="100px">
<el-input v-model="planInfo.totalFlow" disabled />
</el-form-item>
</el-col>
<el-button type="primary" @click="saveClick">保存</el-button>
</el-row>
</el-form>
</div>
</div>
</template>
<script setup name="PlanRule" lang="ts">
import { getPlan } from '@/api/net/plan';
import { PlanVO, PlanQuery, PlanForm } from '@/api/net/plan/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
let planIdParam = "";
const planInfo = ref<PlanVO>({
id: ''
});
const getPlanInfo = async () => {
const planId = route.params && route.params.planId;
if (planId) {
const res = await getPlan(planId as string);
planInfo.value = res.data;
}
};
onMounted(() => {
getPlanInfo();
});
</script>