提交初始化后的计划规则
This commit is contained in:
parent
715e263ffb
commit
178551efba
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Reference in New Issue