1、联调业务下发管理 2、联调交换机管理 3、拓扑管理列表和表单添加新字段 4、修改知识分享库搜索样式

This commit is contained in:
康冉冉
2025-10-14 18:16:32 +08:00
parent 59e0b5774e
commit 432cdc7c14
12 changed files with 407 additions and 191 deletions

View File

@@ -340,3 +340,11 @@ export function delBusDeploy(roleId) {
method: 'delete'
})
}
// 提交审核
export function reviewBusiness(data) {
return request({
url: '/system/businessDeploy/reviewBusiness',
method: 'post',
data: data
})
}

View File

@@ -408,3 +408,121 @@ export function delAgentManage(Ids) {
method: 'delete'
})
}
/** --------------交换机管理--------------- */
// 查询列表
export function listSwitchManage(query) {
return request({
url: '/system/switchManagement/list',
method: 'post',
data: query
})
}
// 所有列表
export function listAllSwitchName(query) {
return request({
url: '/system/switchManagement/getAllSwitchName',
method: 'post',
data: query
})
}
// 查询详细
export function getSwitchManage(Id) {
return request({
url: '/system/switchManagement/' + Id,
method: 'get'
})
}
// 新增
export function addSwitchManage(data) {
return request({
url: '/system/switchManagement',
method: 'post',
data: data
})
}
// 修改
export function updateSwitchManage(data) {
return request({
url: '/system/switchManagement',
method: 'put',
data: data
})
}
// 图形监控-基础信息
export function switchMonitorData(data) {
return request({
url: '/rocketmq/switchOtherData/getSwitchMonitorMsg',
method: 'post',
data: data
})
}
// 图形监控-设备cpu使用率
export function switchCpuData(data) {
return request({
url: '/rocketmq/switchOtherData/getSwitchCpuUseMsg',
method: 'post',
data: data
})
}
// 图形监控-设备内存使用率
export function switchMemData(data) {
return request({
url: '/rocketmq/switchOtherData/getSwitchMemUseMsg',
method: 'post',
data: data
})
}
// 图形监控-功率
export function switchPowerData(data) {
return request({
url: '/rocketmq/switchOtherData/getSwitchPowerMsg',
method: 'post',
data: data
})
}
/** --------------接口备注信息--------------- */
// 查询列表
// export function listAllSwitchInterface(query) {
// return request({
// url: '/system/switchInterfaceInfo/list',
// method: 'post',
// data: query
// })
// }
// 查询详细
export function getSwitchInterface(Id) {
return request({
url: '/system/switchInterfaceInfo/' + Id,
method: 'get'
})
}
// 新增
export function addSwitchInterface(data) {
return request({
url: '/system/switchInterfaceInfo',
method: 'post',
data: data
})
}
// 修改
export function updateSwitchInterface(data) {
return request({
url: '/system/switchInterfaceInfo',
method: 'put',
data: data
})
}
// 删除
export function delSwitchInterface(Ids) {
return request({
url: '/system/switchInterfaceInfo/' + Ids,
method: 'delete'
})
}

View File

@@ -22,7 +22,11 @@
@[formVal.eventName]="(val) => handleChange(key,val,formVal)"></el-input>
</template>
<template v-if="formVal.type === 'textarea'">
<div v-if="toBoolean(formVal.disabled || formItem.config.readonly)">
<span style="color: #C0C4CC;">{{ruleForm[key]}}</span>
</div>
<el-input
v-else
v-model="ruleForm[key]"
:disabled="toBoolean(formVal.disabled || formItem.config.readonly)"
type="textarea"
@@ -159,21 +163,21 @@
</el-form-item>
</el-col>
</el-row>
<!-- 表单操作按钮 -->
<el-row v-if="config && config['buttonGroup'] || !config['buttonGroup']" style="float: right;">
<template v-if="config['buttonGroup'] && config['buttonGroup'].length > 0">
<el-form-item>
<el-button v-for="item of config['buttonGroup']" :type="item.type" @click="fnEventChange(item)">{{item.title}}</el-button>
</el-form-item>
</template>
<template v-else-if="!config['buttonGroup'] || config['buttonGroup'] && config['buttonGroup'].length !== 0">
<el-form-item>
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="handleReset">返回</el-button>
</el-form-item>
</template>
</el-row>
</template>
<!-- 表单操作按钮 -->
<el-row v-if="config && config['buttonGroup'] || !config['buttonGroup']" style="float: right;">
<template v-if="config['buttonGroup'] && config['buttonGroup'].length > 0">
<el-form-item>
<el-button v-for="item of config['buttonGroup']" :type="item.type" @click="fnEventChange(item)">{{item.title}}</el-button>
</el-form-item>
</template>
<template v-else-if="!config['buttonGroup'] || config['buttonGroup'] && config['buttonGroup'].length !== 0">
<el-form-item>
<el-button type="primary" @click="submitForm('submit')">提交</el-button>
<el-button @click="handleReset">返回</el-button>
</el-form-item>
</template>
</el-row>
</el-form>
</div>
</template>
@@ -239,7 +243,7 @@
});
});
},
submitForm() {
submitForm(fnCodeName) {
let forList = {...this.ruleForm};
this.$refs.ruleForm.validate(valid => {
if (valid) {
@@ -252,7 +256,7 @@
}
});
});
this.$emit('fnClick', {fnCode: 'submit'}, {...forList});
this.$emit('fnClick', {fnCode: fnCodeName}, {...forList});
} else {
return false;
}
@@ -280,6 +284,7 @@
this.handleReset();
break;
default:
this.submitForm(result.fnCode);
}
}
},

View File

@@ -27,7 +27,7 @@
<script setup>
import TableList from "@/components/table/index.vue"
import {listBusDeploy, delBusDeploy} from "@/api/disRevenue/earnManage"
import {listBusDeploy, delBusDeploy, updateBusDeploy} from "@/api/disRevenue/earnManage"
export default {
name: 'BusinessIssued',
components: {TableList},
@@ -65,11 +65,11 @@
{content: '导出', fnCode: 'export', type: 'warning', icon: 'el-icon-download', hasPermi: 'earnManage:businessIssued:export'},
],
line: [
{content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', hasPermi: 'disRevenue:earnManage:businessIssued:edit'},
{content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', showName: 'reviewStatus', showVal: ['0', '3'], hasPermi: 'disRevenue:earnManage:businessIssued:edit'},
{content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'disRevenue:earnManage:businessIssued:details'},
{content: '删除', fnCode: 'delete', type: 'text', icon: 'el-icon-delete', hasPermi: 'disRevenue:earnManage:businessIssued:delete'},
{content: '删除', fnCode: 'delete', type: 'text', icon: 'el-icon-delete', showName: 'reviewStatus', showVal: ['0', '3'], hasPermi: 'disRevenue:earnManage:businessIssued:delete'},
{content: '审核', fnCode: 'audit', type: 'text', showName: 'reviewStatus', showVal: '1', icon: 'el-icon-document-add', hasPermi: 'disRevenue:earnManage:businessIssued:audit'},
{content: '提交审核', fnCode: 'upAudit', type: 'text', showName: 'reviewStatus', showVal: ['0', '1', '3'], icon: 'el-icon-document-checked', hasPermi: 'disRevenue:earnManage:businessIssued:upAudit'},
{content: '提交审核', fnCode: 'upAudit', type: 'text', showName: 'reviewStatus', showVal: ['0', '3'], icon: 'el-icon-document-checked', hasPermi: 'disRevenue:earnManage:businessIssued:upAudit'},
]
}
}
@@ -144,7 +144,7 @@
path:'/earnManage/businessIssued/details',
query:{
id: rowData.id,
audit: true
reviewStatus: rowData.reviewStatus
}
});
break;
@@ -152,11 +152,14 @@
let content = '<p style="font-size: 1rem;font-weight: 600;">提交审核</p>' +
'<p style="height: 0px;margin:10px 0 50px;">提交审核后,相关的任务内容将不能修改</p>';
this.$modal.confirm(content, {submitTitle: '继续提交'}).then(() => {
// rowData['registrationStatus'] = '0';
// updateregisterType(rowData).then(res => {
// this.$modal.msgSuccess("取消注册成功!");
// this.getList();
// });
let params = {
id: rowData.id,
reviewStatus: '1'
};
updateBusDeploy(params).then(res => {
this.$modal.msgSuccess("提交审核成功!");
this.getList();
});
}).catch(() => {});
break;
case 'delete':

View File

@@ -1,12 +1,12 @@
<template>
<div class="app-container">
<Form :formList="formList" :ruleFormData="ruleForm" @fnClick="callback"></Form>
<Form :formList="formList" :ruleFormData="ruleForm" :config="config" @fnClick="callback"></Form>
</div>
</template>
<script setup>
import Form from '@/components/form/index.vue';
import {addBusDeploy, getBusDeploy, updateBusDeploy, listAllBusinessList, getAllBusScriptName} from "@/api/disRevenue/earnManage"
import {addBusDeploy, getBusDeploy, updateBusDeploy, listAllBusinessList, getAllBusScriptName, reviewBusiness} from "@/api/disRevenue/earnManage"
export default {
name: 'BusinessIssuedDetails',
components: {Form},
@@ -17,11 +17,25 @@
ruleForm: {},
formList: [],
scriptList: {},
paramsData: {}
paramsData: {},
config: {}
}
},
created() {
this.paramsData = this.$route && this.$route.query;
if (this.paramsData && this.paramsData.readonly) {
this.config = {
buttonGroup: [{title: '返回', fnCode: 'goBack'}]
};
} else if (this.paramsData && this.paramsData.reviewStatus) {
this.config = {
buttonGroup: [
{title: '返回', fnCode: 'goBack'},
{title: '审核驳回', fnCode: 'rejection'},
{title: '审核通过', fnCode: 'byMeans', type: 'primary'},
]
};
}
if (this.paramsData && this.paramsData.id) {
this.getFormDataList(this.paramsData.id);
}
@@ -32,25 +46,51 @@
methods: {
// formList集合
fnFormList(objVal) {
this.formList = [{
config: {title: '基本信息', colSpan: this.paramsData && this.paramsData.readonly ? '' : 'disBlock', readonly: this.paramsData && this.paramsData.readonly},
controls: {
id: {label: 'ID',hidden: true},
taskName: {label: '任务名称', span: 12, type: 'input', required: true},
businessName: {label: '务名称', span: 12, type: 'select', options: [], required: true},
scriptName: {label: '脚本名称', span: 12, type: 'select', options: [], eventName: 'change', required: true},
scriptPath: {label: '脚本文件地址', span: 12, type: 'input', required: true, disabled: true},
scriptParams: {label: '脚本参数', span: 12, type: 'input'},
submitBy: {label: '提交人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewStatus: {label: '审核状态', span: 12, type: 'select', options: this.dict.type.eps_business_review_status, hidden: !(this.paramsData && this.paramsData.readonly)},
reviewBy: {label: '审核人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewTime: {label: '审核时间', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewComment: {label: '审核意见', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows: 15, required: true},
}
}];
if (this.paramsData && this.paramsData.reviewStatus) {
this.formList = [{
config: {title: '基本信息', colSpan: 'disBlock', readonly: true},
controls: {
id: {label: 'ID',hidden: true},
taskName: {label: '务名称', span: 12, type: 'input', required: true},
scriptName: {label: '脚本名称', span: 12, type: 'select', options: [], eventName: 'change', required: true},
scriptPath: {label: '脚本文件地址', span: 12, type: 'input', required: true},
scriptParams: {label: '脚本参数', span: 12, type: 'input'},
businessName: {label: '业务名称', span: 12, type: 'select', options: [], required: true},
submitBy: {label: '提交人', span: 12, type: 'input'},
// reviewBy: {label: '审核人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
// reviewTime: {label: '审核时间', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date'},
createTime: {label: '创建时间', span: 12, type: 'date'},
reviewStatus: {label: '审核状态', span: 12, type: 'select', options: this.dict.type.eps_business_review_status,},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows: 15, required: true},
}
},{
config: {},
controls: {
reviewComment: {label: '审核意见', span: 18, type: 'textarea'},
}
}];
} else {
this.formList = [{
config: {title: '基本信息', colSpan: this.paramsData && this.paramsData.readonly ? '' : 'disBlock', readonly: this.paramsData && this.paramsData.readonly},
controls: {
id: {label: 'ID',hidden: true},
taskName: {label: '任务名称', span: 12, type: 'input', required: true},
businessName: {label: '业务名称', span: 12, type: 'select', options: [], required: true},
scriptName: {label: '脚本名称', span: 12, type: 'select', options: [], eventName: 'change', required: true},
scriptPath: {label: '脚本文件地址', span: 12, type: 'input', required: true, disabled: true},
scriptParams: {label: '脚本参数', span: 12, type: 'input'},
submitBy: {label: '提交人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewStatus: {label: '审核状态', span: 12, type: 'select', options: this.dict.type.eps_business_review_status, hidden: !(this.paramsData && this.paramsData.readonly)},
reviewBy: {label: '审核人', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewTime: {label: '审核时间', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
reviewComment: {label: '审核意见', span: 12, type: 'input', hidden: !(this.paramsData && this.paramsData.readonly)},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: !(this.paramsData && this.paramsData.readonly)},
deployDevice: {label: '部署设备', span: 18, type: 'textarea', rows: 15, required: true},
}
}];
}
},
// 获取详情
getFormDataList(id) {
@@ -82,6 +122,7 @@
},
// 监听事件
callback(result, dataVal, formVal) {
console.log('result===',result);
if (result && result.fnCode) {
switch (result.fnCode) {
case 'scriptName':
@@ -106,6 +147,32 @@
this.loading = false;
});
break;
case 'rejection': // 审核驳回
let params = {
id: dataVal.id,
reviewStatus: '3',
reviewComment: dataVal.reviewComment
};
reviewBusiness(params).then(res => {
this.$modal.msgSuccess(res.msg);
this.$router.push("/earnManage/businessIssued");
}).catch(() => {
this.$modal.msgError("操作失败");
});
break;
case 'byMeans': // 审核通过
let paramsBy = {
id: dataVal.id,
reviewStatus: '2',
reviewComment: dataVal.reviewComment
};
reviewBusiness(paramsBy).then(res => {
this.$modal.msgSuccess(res.msg);
this.$router.push("/earnManage/businessIssued");
}).catch(() => {
this.$modal.msgError("操作失败");
});
break;
case 'cancel':
this.$router.push("/earnManage/businessIssued");
break;

View File

@@ -2,10 +2,10 @@
<div class="app-container pageTopForm">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="130px">
<el-col :span="6">
<el-form-item label="节点名称" prop="nodeName">
<el-form-item label="ClientID" prop="nodeName">
<el-select
v-model="queryParams.nodeName"
placeholder="请选择节点名称"
placeholder="请选择ClientID"
clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
@@ -56,7 +56,7 @@
columns: {
id: {label: `ID`, visible: false},
createTime: {label: `修改时间`, visible: true},
nodeName: {label: `节点名称`, minWidth: '130', visible: true},
nodeName: {label: `ClientID`, minWidth: '130', visible: true},
hardwareSn: {label: `硬件SN`},
changeContent: {label: `修改内容`, minWidth: '350', visible: true},
creatBy: {label: `修改人`, width: '80', visible: true},

View File

@@ -4,17 +4,17 @@
<div v-if="this.paramsData && this.paramsData.readonly">
<p style="font-size: 1rem;font-weight: 500;border-bottom: 1px solid #ddd;">接口备注信息</p>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback">
<template #tempHandle="{ row, column }">
<template #tempChange="{ row, column }">
<div>
<!-- 非编辑状态显示文本 -->
<template v-if="!row.editStatus">
<span>{{ row.resourceName }}</span>
<span>{{ row.interfaceRemark }}</span>
<el-button icon="el-icon-edit" type="text" @click="rowDataChange(row)"></el-button>
</template>
<template v-else>
<!-- 编辑状态显示输入框 -->
<el-col :span="16">
<el-input v-model="row.resourceName" size="mini"></el-input>
<el-input v-model="row.interfaceRemark" size="mini"></el-input>
</el-col>
<el-col :span="8">
<el-button size="mini" type="primary" @click="submit(row)">确定</el-button>
@@ -29,27 +29,24 @@
</div>
</template>
<script setup name="Handle">
<script setup>
import Form from '@/components/form/index.vue';
import TableList from '@/components/table/index.vue';
import {addHandle, getHandle, updateHandle,listHandle, delTopology} from "@/api/disRevenue/resource"
import {addSwitchManage, getSwitchManage, updateSwitchManage,updateSwitchInterface, delSwitchInterface} from "@/api/disRevenue/resource"
export default {
name: 'RegisterHandle',
components: {Form, TableList},
dicts: ['rm_register_resource_type', 'rm_register_online_state','rm_register_version', 'rm_register_security_level', 'rm_register_permission', 'rm_register_encryption'],
dicts: ['switch_type', 'rm_register_online_state','rm_register_version', 'rm_register_security_level', 'rm_register_permission', 'rm_register_encryption'],
data() {
return {
ruleForm: {
resourceVersion: '1',
snmpVersion: '1',
securityLevel: '2',
rwPermission: '2',
encryption: '2',
switchNum: '3次',
switchWeek: '5秒',
switchOID: '1.3.6.1.2.1.1.5',
// agentWeek: '5秒',
// agentNum: '3次',
// agentOID: '1.3.6.1.2.1.1.5'
readWritePermission: '2',
encryptionMethod: '2',
heartbeatCount: '3次',
heartbeatInterval: '30s',
heartbeatOid: '1.3.6.1.2.1.1.5',
},
formList: [],
paramsData: {},
@@ -57,8 +54,8 @@
// 列显隐信息
columns: {
id: { label: `ID`,width: '80'},
resourceName: { label: `接口名称`, slotName: 'tempHandle', visible: true, minWidth: '200'},
hardwareSn: { label: `接口备注`, visible: true, minWidth: '250'},
interfaceName: { label: `接口名称`, visible: true, minWidth: '200'},
interfaceRemark: { label: `接口备注`, slotName: 'tempChange', visible: true, minWidth: '250'},
},
queryParams: {
pageNum: 1,
@@ -83,20 +80,17 @@
} else {
this.fnFormList(this.ruleForm);
}
if(this.paramsData && this.paramsData.readonly) {
this.getList();
}
},
methods: {
rowDataChange(row) {
this.$set(row, 'editStatus', true);
},
getList(){
listHandle(this.addDateRange(this.queryParams)).then(response => {
this.tableList = response.rows;
this.queryParams.total = response.total;
})
},
// getList(){
// listHandle(this.addDateRange(this.queryParams)).then(response => {
// this.tableList = response.rows;
// this.queryParams.total = response.total;
// })
// },
// formList集合
fnFormList(objVal) {
this.formList = [{
@@ -105,45 +99,52 @@
id: {label: 'ID',hidden: true},
switchName: {label: '交换机名称', span: 12, type: 'input', required: true},
hardwareSn: {label: '硬件SN', span: 12, type: 'input'},
switchNum: {label: '交换机心跳检测次数', span: 12, type: 'input', disabled: true},
switchWeek: {label: '交换机心跳检测周期', span: 12, type: 'input', disabled: true},
switchOID: {label: '交换机心跳检测OID', span: 12, type: 'input', disabled: true},
resourceVersion: {label: 'SNMP版本', span: 12, type: 'radio', eventName: 'change', required: true, options: this.dict.type.rm_register_version},
rwPermission: {label: '读写权限', span: 12, type: 'radio', options: this.dict.type.rm_register_permission},
securityLevel: {label: '安全级别', span: 12, type: 'radio', options: this.dict.type.rm_register_security_level, hidden: objVal && objVal.resourceVersion === '1' ? true : false},
encryption: {label: '加密方式', span: 12, type: 'radio', options: this.dict.type.rm_register_encryption, hidden: objVal && objVal.resourceVersion === '1' ? true : false},
teamName: {label: '团体名称', span: 12, type: 'input'},
snmpCollectAddr: {label: 'SNMP采集地址', span: 12, type: 'input',required: true},
snmpCollectPort: {label: 'SNMP采集端口', span: 12, type: 'input',required: true},
resourceUserName: {label: '用户名', span: 12, type: 'input', hidden: objVal && objVal.resourceVersion === '1' ? true : false},
resourcePwd: {label: '密码', span: 12, type: 'input', hidden: objVal && objVal.resourceVersion === '1' ? true : false},
heartbeatCount: {label: '交换机心跳检测次数', span: 12, type: 'input', disabled: true},
heartbeatInterval: {label: '交换机心跳检测周期', span: 12, type: 'input', disabled: true},
heartbeatOid: {label: '交换机心跳检测OID', span: 12, type: 'input', disabled: true},
snmpVersion: {label: 'SNMP版本', span: 12, type: 'radio', eventName: 'change', required: true, options: this.dict.type.rm_register_version},
readWritePermission: {label: '读写权限', span: 12, type: 'radio', options: this.dict.type.rm_register_permission},
securityLevel: {label: '安全级别', span: 12, type: 'radio', options: this.dict.type.rm_register_security_level, hidden: objVal && objVal.snmpVersion === '1' ? true : false},
encryptionMethod: {label: '加密方式', span: 12, type: 'radio', options: this.dict.type.rm_register_encryption, hidden: objVal && objVal.snmpVersion === '1' ? true : false},
communityName: {label: '团体名称', span: 12, type: 'input'},
snmpAddress: {label: 'SNMP采集地址', span: 12, type: 'input',required: true},
snmpPort: {label: 'SNMP采集端口', span: 12, type: 'input',required: true},
switchUser: {label: '用户名', span: 12, type: 'input', hidden: objVal && objVal.snmpVersion === '1' ? true : false},
switchPassword: {label: '密码', span: 12, type: 'input', hidden: objVal && objVal.snmpVersion === '1' ? true : false},
updateTime: {label: '修改时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
createTime: {label: '创建时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
onlineStatus: {label: '在线状态', span: 12, type: 'select', options: this.dict.type.rm_register_online_state, hidden: this.paramsData && this.paramsData.readonly ? false : true},
resourceType: {label: '交换机类型', span: 12, type: 'select', required: true, options: this.dict.type.rm_register_resource_type},
showTime: {label: '上机时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
switchType: {label: '交换机类型', span: 12, type: 'select', required: true, options: this.dict.type.switch_type},
upTime: {label: '上机时间', span: 12, type: 'date', hidden: this.paramsData && this.paramsData.readonly ? false : true},
}
}];
},
// 获取详情
getFormDataList(id) {
getHandle(id).then(val => {
this.ruleForm = val && val.data;
this.fnFormList(this.ruleForm);
getSwitchManage(id).then(val => {
if (val && val.data) {
// val.data['switchType'] = val.data['switchType'] && val.data['switchType'].toString();
this.ruleForm = val && val.data;
this.fnFormList(this.ruleForm);
if(this.paramsData && this.paramsData.readonly) {
this.tableList = val.data['switchInterfaceInfoList'];
}
}
}).catch(() => {
this.fnFormList(this.ruleForm);
this.$modal.msgError("操作失败")
});
},
// 列表上修改名称
submit(rowData) {
this.$set(rowData, 'editStatus', false);
// updateHandle(rowData).then(response => {
// this.$set(rowData, 'editStatus', false);
// this.getList();
// this.$modal.msgSuccess(response.msg);
// }).catch(() => {
// this.$modal.msgError("操作失败");
// });
updateSwitchInterface(rowData).then(response => {
this.$modal.msgSuccess(response.msg);
this.$set(rowData, 'editStatus', false);
this.getFormDataList(this.paramsData.id);
}).catch(() => {
// this.$modal.msgError("操作失败");
});
},
// 取消列表修改
cancel(rowData) {
@@ -151,26 +152,26 @@
},
// 监听事件
callback(result, dataVal, selectChange) {
console.log('result===',result);
// console.log('result===',result);
if (result && result.fnCode) {
switch (result.fnCode) {
case 'resourceVersion':
case 'snmpVersion':
if (dataVal === '2') {
this.formList[0].controls.securityLevel['hidden'] = false;
this.formList[0].controls.encryption['hidden'] = false;
this.formList[0].controls.resourceUserName['hidden'] = false;
this.formList[0].controls.resourcePwd['hidden'] = false;
this.formList[0].controls.encryptionMethod['hidden'] = false;
this.formList[0].controls.switchUser['hidden'] = false;
this.formList[0].controls.switchPassword['hidden'] = false;
} else {
this.formList[0].controls.securityLevel['hidden'] = true;
this.formList[0].controls.encryption['hidden'] = true;
this.formList[0].controls.resourceUserName['hidden'] = true;
this.formList[0].controls.resourcePwd['hidden'] = true;
this.formList[0].controls.encryptionMethod['hidden'] = true;
this.formList[0].controls.switchUser['hidden'] = true;
this.formList[0].controls.switchPassword['hidden'] = true;
}
break;
case 'submit':
let fnType = addHandle;
let fnType = addSwitchManage;
if (dataVal && dataVal.id) {
fnType = updateHandle;
fnType = updateSwitchManage;
}
fnType(dataVal).then(response => {
this.$modal.msgSuccess(response.msg);
@@ -184,9 +185,9 @@
break;
case 'delete':
this.$modal.confirm('是否确认删除数据项?').then(function() {
return delTopology(selectChange)
return delSwitchInterface(dataVal.id)
}).then(() => {
this.getList();
this.getFormDataList(this.paramsData.id);
this.$modal.msgSuccess("删除成功")
}).catch(() => {});
break;

View File

@@ -2,18 +2,18 @@
<div class="app-container pageTopForm">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="auto">
<el-col :span="6">
<el-form-item label="交换机名称" prop="resourceName">
<el-form-item label="交换机名称" title="交换机名称" prop="switchName">
<el-input
v-model="queryParams.resourceName"
v-model="queryParams.switchName"
placeholder="请输入交换机名称"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="交换机在线状态" title="交换机在线状态" prop="switchStatus">
<el-form-item label="交换机在线状态" title="交换机在线状态" prop="onlineStatus">
<el-select
v-model="queryParams.switchStatus"
v-model="queryParams.onlineStatus"
placeholder="请选择交换机在线状态"
clearable>
<el-option
@@ -63,11 +63,11 @@
</template>
<script setup name="Register">
import {listHandle, updateregisterType} from '@/api/disRevenue/resource';
import {listSwitchManage} from '@/api/disRevenue/resource';
import TableList from '@/components/table/index.vue';
import MonitorStrategy from './monitorStrategy';
export default {
name: 'RegisterIndex',
name: 'SwitchRegister',
components: {TableList, MonitorStrategy},
dicts: ['rm_register_resource_type', 'rm_register_protocol', 'rm_register_status', 'rm_register_port', 'rm_register_online_state'],
data() {
@@ -85,20 +85,20 @@
switchName: { label: `交换机名称`, visible: true, minWidth: '200'},
hardwareSn: { label: `硬件SN`,minWidth: '250'},
resourceType: { label: `交换机类型`, minWidth: '100', slotName: 'tempType'},
snmpCollectAddr: { label: `SNMP采集地址`, visible: true, minWidth: '150'},
snmpCollectPort: { label: `SNMP采集端口`, visible: true, minWidth: '150'},
snmpAddress: { label: `SNMP采集地址`, visible: true, minWidth: '150'},
snmpPort: { label: `SNMP采集端口`, visible: true, minWidth: '150'},
onlineStatus: { label: `在线状态`, slotName: 'tempOnlineStatus', minWidth: '120', visible: true },
showTime:{ label: `上机时间`,minWidth: '160'},
upTime:{ label: `上机时间`,minWidth: '160'},
updateTime:{ label: `修改时间`,minWidth: '160'},
createTime:{ label: `创建时间`,minWidth: '160'},
agentNum: { label: `交换机心跳检测次数`, minWidth: '180'},
agentWeek: { label: `交换机心跳检测周期`, minWidth: '180'},
agentOID: { label: `交换机心跳检测OID`, minWidth: '180'},
heartbeatCount: { label: `交换机心跳检测次数`, minWidth: '180'},
heartbeatInterval: { label: `交换机心跳检测周期`, minWidth: '180'},
heartbeatOid: { label: `交换机心跳检测OID`, minWidth: '180'},
protocol: { label: `SNMP版本`, minWidth: '80'},
rwPermission: { label: `读写权限`, minWidth: '120'},
readWritePermission: { label: `读写权限`, minWidth: '120'},
securityLevel: { label: `安全级别`, minWidth: '120'},
encryption: { label: `加密方式`, minWidth: '120'},
teamName: { label: `团体名称`, minWidth: '120'},
encryptionMethod: { label: `加密方式`, minWidth: '120'},
communityName: { label: `团体名称`, minWidth: '120'},
resourceUserName: { label: `用户名`, minWidth: '120'},
resourcePwd: { label: `密码`, minWidth: '120'}
},
@@ -132,6 +132,11 @@
created() {
this.getList();
},
activated() {
this.$nextTick(() => {
this.getList();
});
},
methods: {
// 处理子组件传递的新值
handleValueChange(newValue) {
@@ -142,7 +147,7 @@
/** 查询角色列表 */
getList() {
this.loading = true
listHandle(this.addDateRange(this.queryParams)).then(response => {
listSwitchManage(this.addDateRange(this.queryParams)).then(response => {
this.roleList = response.rows;
this.queryParams.total = response.total;
this.loading = false;
@@ -173,37 +178,38 @@
this.open = false;
},
callback(result, rowData, selectChange) {
console.log('result==',result);
// console.log('result==',result);
if (result && result.fnCode) {
switch (result.fnCode) {
case 'add':
this.$router.push("/resource/switchRegister/edit/index");
break;
case 'portRemarks':
if (selectChange && selectChange.length <= 0) {
this.$modal.msgWarning("请选择数据!");
return;
}
// if (selectChange && selectChange.length <= 0) {
// this.$modal.msgWarning("请选择数据!");
// return;
// }
this.$router.push({
path: '/resource/switchRegister/portRemarks',
query: {ids: selectChange}
// query: {ids: selectChange}
});
break;
case 'edit':
this.$router.push({
path:'/resource/switchRegister/edit/index/',
path:'/resource/switchRegister/edit/index',
query: {id: rowData.id}
});
break;
case 'details':
this.$router.push({
path:'/resource/switchRegister/edit/index/',
path:'/resource/switchRegister/edit/index',
query: {id: rowData.id, readonly: true}
});
break;
case 'echartView':
this.$router.push({
path:'/resource/switchRegister/monitorChart'
path:'/resource/switchRegister/monitorChart',
query: {clientId: rowData.hardwareSn}
});
break;
case 'monitorStrategy':
@@ -218,7 +224,7 @@
// });
// this.download("/system/registration/export", {properties: dataList,}, `资源管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/registration/export", paramsList, `资源注册_${new Date().getTime()}.xlsx`, null, 'json');
this.download("system/switchManagement/export", paramsList, `交换机管理_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:

View File

@@ -6,7 +6,7 @@
<script setup>
import Form from '@/components/form/index.vue';
import {listHandle, resNameBtType, addTopology, getTopology, updateTopology, postInterFaceName} from "@/api/disRevenue/resource"
import {listAllSwitchName, addSwitchInterface, getSwitchInterface, updateSwitchInterface, postInterFaceName} from "@/api/disRevenue/resource"
export default {
name: 'PortRemarks',
components: {Form},
@@ -39,28 +39,25 @@
controls: {
id: {label: 'ID',hidden: true},
switchName: {label: '交换机名称', span: 18, type: 'select', eventName: 'change', options:[], required: true},
interfaceName: {label: '交换机口名称', span: 18, type: 'select', options:[], required: true},
serverPort: {label: '端口备注', span: 18, type: 'textarea', required: true},
interfaceName: {label: '交换机口名称', span: 18, type: 'select', options:[], required: true},
interfaceRemark: {label: '端口备注', span: 18, type: 'textarea', required: true},
}
}];
},
// 获取交换机下拉
switchList() {
resNameBtType({resourceType: 2}).then(val => {
this.switchNameList = val && val;
this.formList[0].controls.switchName['options'] = val && val.map(item => {
if (this.paramsData && this.paramsData.id) {
if (item.resourceName === this.ruleForm.switchName) {
this.fnInterFaceNameList({switchIp: item.ipAddress});
}
}
return Object.assign({label: item.resourceName, value: item.resourceName});
});
listAllSwitchName({}).then(val => {
if(val && val.data) {
this.switchNameList = val && val.data;
this.formList[0].controls.switchName['options'] = val && val.data.map(item => {
return Object.assign({label: item.switchName, value: item.id});
});
}
});
},
// 接口名称
fnInterFaceNameList(val) {
postInterFaceName(Object.assign({},{resourceType: 2}, val)).then(res => {
postInterFaceName(val).then(res => {
this.interfaceNameList = res;
this.formList[0].controls.interfaceName['options'] = res && res.map(item => {
return Object.assign({label: item.interfaceName, value: item.id});
@@ -69,7 +66,7 @@
},
// 获取详情
getFormDataList(id) {
getTopology(id).then(val => {
getSwitchInterface(id).then(val => {
this.ruleForm = val && val.data;
this.switchList();
}).catch(() => {
@@ -83,17 +80,17 @@
case 'switchName':
let switchIp = '';
this.switchNameList.find(item => {
if (item.resourceName === dataVal) {
switchIp = item.ipAddress;
if (item.id === dataVal) {
switchIp = item.snmpAddress;
}
});
this.fnInterFaceNameList({switchIp: switchIp});
break;
case 'submit':
this.switchNameList.find(item => {
if (item.resourceName === dataVal['switchName'] || item.resourceName === dataVal['switchName']) {
dataVal['switchName'] = item.resourceName;
dataVal['switchIpAddress'] = item.ipAddress;
if (item.id === dataVal['switchName']) {
dataVal['switchName'] = item.switchName;
// dataVal['switchIpAddress'] = item.ipAddress;
dataVal['switchSn'] = item.hardwareSn;
}
});
@@ -102,9 +99,9 @@
dataVal['interfaceName'] = item.interfaceName;
}
});
let fnType = addTopology;
let fnType = addSwitchInterface;
if (dataVal && dataVal.id) {
fnType = updateTopology;
fnType = updateSwitchInterface;
}
if(this.loading) return;
this.loading = true;

View File

@@ -43,8 +43,8 @@
id: {label: 'ID',hidden: true},
switchName: {label: '交换机名称', span: 12, type: 'select', eventName: 'change', options:[], rules: [{required: true, message: '请输入硬件SN', trigger: 'blur'}]},
interfaceName: {label: '接口名称', span: 12, type: 'select', options:[]},
connectedDeviceType: {label: '接口连接设备类型', span: 12, type: 'select', options:this.dict.type.rm_topology_type},
serverName: {label: '服务器名称', span: 12, eventName: 'change', options:[], type: 'select'},
connectedDeviceType: {label: '接口连接设备类型', span: 12, type: 'radio', options:this.dict.type.rm_topology_type},
serverClientId: {label: '服务器ClientID', span: 12, eventName: 'change', options:[], type: 'select'},
serverPort: {label: '服务器网口', span: 12, options:[], type: 'select'},
}
}];
@@ -76,9 +76,9 @@
fnServerNameList(){
resNameBtType({resourceType: 1}).then(val => {
this.serverNameList = val && val;
this.formList[0].controls.serverName['options'] = val && val.map(item => {
this.formList[0].controls.serverClientId['options'] = val && val.map(item => {
if (this.paramsData && this.paramsData.id) {
if (item.resourceName === this.ruleForm.serverName) {
if (item.resourceName === this.ruleForm.serverClientId) {
this.fnServerPortList({serverIp: item.ipAddress});
}
}
@@ -118,7 +118,7 @@
});
this.fnInterFaceNameList({switchIp: switchIp});
break;
case 'serverName':
case 'serverClientId':
let serverIp = '';
this.serverNameList.find(item => {
if (item.resourceName === dataVal) {
@@ -136,8 +136,8 @@
}
});
this.serverNameList.find(item => {
if (item.resourceName === dataVal['serverName'] || item.resourceName === dataVal['serverName']) {
dataVal['serverName'] = item.resourceName;
if (item.resourceName === dataVal['serverClientId'] || item.resourceName === dataVal['serverClientId']) {
dataVal['serverClientId'] = item.resourceName;
dataVal['serverSn'] = item.hardwareSn;
}
});
@@ -175,5 +175,8 @@
}
}
</script>
<style>
<style scoped>
::v-deep .el-radio {
margin-right: 15px!important;
}
</style>

View File

@@ -5,7 +5,7 @@
<el-form-item label="交换机名称" prop="switchName">
<el-input
v-model="queryParams.switchName"
placeholder="请输入交机名称"
placeholder="请输入交机名称"
clearable
@keyup.enter.native="handleQuery"/>
</el-form-item>
@@ -46,14 +46,16 @@
columns: {
id: { label: `ID`, width: '50', visible: false },
switchName: { label: `交换机名称`, minWidth: '150', visible: true },
switchSn: { label: `交换机硬件SN`, minWidth: '200', visible: false},
switchSn: { label: `交换机硬件SN`, minWidth: '200'},
interfaceName: { label: `接口名称`, minWidth: '100', visible: true },
connectedDeviceType: { label: `接口连接设备类型`, slotName: 'tempType', minWidth: '150', visible: true },
serverName: { label: `服务器名称`, minWidth: '200', visible: true},
serverName: { label: `服务器ClientID`, minWidth: '200', visible: true},
serverSn: { label: `服务器硬件SN`, minWidth: '200', visible: false},
serverPort: { label: `服务器网口`, minWidth: '250', visible: true },
createTime: { label: `创建时间`, minWidth: '150', visible: false},
updateTime:{ label: `修改时间`, minWidth: '150', visible: false}
peerSwitchName: { label: `对端交换机名称`, minWidth: '250', visible: true },
peerSwitchInterface: { label: `对端交换机接口`, minWidth: '250', visible: true },
createTime: { label: `创建时间`, minWidth: '150'},
updateTime:{ label: `修改时间`, minWidth: '150'}
},
config: {
searcherForm: [

View File

@@ -1,21 +1,22 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true" label-width="130px">
<el-form-item label="标题" prop="title">
<el-col :span="4">
<el-input
v-model="queryParams.title"
placeholder="请输入标题"
clearable
style="width: 220px"
@keyup.enter.native="handleQuery"
/>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
<div class="app-container pageTopForm">
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" size="small" label-width="80px" class="demo-ruleForm">
<el-col :span="8">
<el-form-item label="标题" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item class="lastBtnSty">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-col>
</el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempTitle="{ row, column }">
@@ -160,3 +161,8 @@
}
}
</script>
<style scoped>
::v-deep .lastBtnSty .el-form-item__content{
margin-left: 10px!important;
}
</style>