From c57f8938050cf7a6794e87cff27d40827619be72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E5=86=89=E5=86=89?= Date: Mon, 15 Sep 2025 18:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=B3=A8=E5=86=8C=E6=B7=BB=E5=8A=A0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=9D=A1=E4=BB=B6=E5=92=8Cform=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/index.scss | 9 +- src/components/form/index.vue | 278 +++++++++--------- src/plugins/modal.js | 167 +++++------ src/router/index.js | 15 + .../disRevenue/resource/alarmLog/alarmLog.vue | 2 +- .../resource/fileManage/fileManage.vue | 97 +++--- .../resource/fileManage/fileManageView.vue | 133 +++++++++ .../disRevenue/resource/group/details.vue | 6 +- .../disRevenue/resource/register/handle.vue | 24 +- .../disRevenue/resource/register/index.vue | 75 ++++- 10 files changed, 528 insertions(+), 278 deletions(-) create mode 100644 src/views/disRevenue/resource/fileManage/fileManageView.vue diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 182b49e..93ebad0 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -92,6 +92,9 @@ div:focus { .mtb10 { margin: 10px 0; } +.mt50 { + margin-top: 50px; +} .fontSize15 { font-size: 15px; } @@ -270,7 +273,8 @@ aside { .pageTopForm .el-form-item__label { width: 68px!important; overflow: hidden; - height: 36px; + text-overflow: ellipsis; + white-space: nowrap; } // table列表上方 form搜索条件 label后面的选项框 .pageTopForm .el-form-item__content { @@ -291,11 +295,12 @@ aside { right: 0px; } // form表单只读时 -.el-input.is-disabled .el-input__inner { +.el-textarea.is-disabled .el-textarea__inner , .el-input.is-disabled .el-input__inner { background-color: transparent; border-color: transparent; color: #C0C4CC; cursor: not-allowed; + resize: none; } .el-input.is-disabled .el-input__icon { display: none; diff --git a/src/components/form/index.vue b/src/components/form/index.vue index d57d404..0694efe 100644 --- a/src/components/form/index.vue +++ b/src/components/form/index.vue @@ -1,151 +1,154 @@ @@ -259,5 +262,10 @@ ::v-deep .cursorAuto textarea { cursor: auto!important; } + ::v-deep .el-form-item__label { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } diff --git a/src/plugins/modal.js b/src/plugins/modal.js index 99cea2e..8c9fa50 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -1,83 +1,84 @@ -import { Message, MessageBox, Notification, Loading } from 'element-ui' - -let loadingInstance - -export default { - // 消息提示 - msg(content) { - Message.info(content) - }, - // 错误消息 - msgError(content) { - Message.error(content) - }, - // 成功消息 - msgSuccess(content) { - Message.success(content) - }, - // 警告消息 - msgWarning(content) { - Message.warning(content) - }, - // 弹出提示 - alert(content) { - MessageBox.alert(content, "系统提示") - }, - // 错误提示 - alertError(content) { - MessageBox.alert(content, "系统提示", { type: 'error' }) - }, - // 成功提示 - alertSuccess(content) { - MessageBox.alert(content, "系统提示", { type: 'success' }) - }, - // 警告提示 - alertWarning(content) { - MessageBox.alert(content, "系统提示", { type: 'warning' }) - }, - // 通知提示 - notify(content) { - Notification.info(content) - }, - // 错误通知 - notifyError(content) { - Notification.error(content) - }, - // 成功通知 - notifySuccess(content) { - Notification.success(content) - }, - // 警告通知 - notifyWarning(content) { - Notification.warning(content) - }, - // 确认窗体 - confirm(content) { - return MessageBox.confirm(content, "系统提示", { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: "warning", - }) - }, - // 提交内容 - prompt(content) { - return MessageBox.prompt(content, "系统提示", { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: "warning", - }) - }, - // 打开遮罩层 - loading(content) { - loadingInstance = Loading.service({ - lock: true, - text: content, - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)", - }) - }, - // 关闭遮罩层 - closeLoading() { - loadingInstance.close() - } -} +import { Message, MessageBox, Notification, Loading } from 'element-ui' + +let loadingInstance + +export default { + // 消息提示 + msg(content) { + Message.info(content) + }, + // 错误消息 + msgError(content) { + Message.error(content) + }, + // 成功消息 + msgSuccess(content) { + Message.success(content) + }, + // 警告消息 + msgWarning(content) { + Message.warning(content) + }, + // 弹出提示 + alert(content) { + MessageBox.alert(content, "系统提示") + }, + // 错误提示 + alertError(content) { + MessageBox.alert(content, "系统提示", { type: 'error' }) + }, + // 成功提示 + alertSuccess(content) { + MessageBox.alert(content, "系统提示", { type: 'success' }) + }, + // 警告提示 + alertWarning(content) { + MessageBox.alert(content, "系统提示", { type: 'warning' }) + }, + // 通知提示 + notify(content) { + Notification.info(content) + }, + // 错误通知 + notifyError(content) { + Notification.error(content) + }, + // 成功通知 + notifySuccess(content) { + Notification.success(content) + }, + // 警告通知 + notifyWarning(content) { + Notification.warning(content) + }, + // 确认窗体 + confirm(content) { + return MessageBox.confirm(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + dangerouslyUseHTMLString: true, + type: "warning", + }) + }, + // 提交内容 + prompt(content) { + return MessageBox.prompt(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 打开遮罩层 + loading(content) { + loadingInstance = Loading.service({ + lock: true, + text: content, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }) + }, + // 关闭遮罩层 + closeLoading() { + loadingInstance.close() + } +} diff --git a/src/router/index.js b/src/router/index.js index 1db175b..73f0024 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -442,6 +442,21 @@ export const dynamicRoutes = [ } ] }, + // 文件管理 + { + path: '/disRevenue/resource/fileManage/view', + component: Layout, + hidden: true, + permissions: ['disRevenue:resource:fileManage:view'], + children: [ + { + path: ':id?', + component: () => import('@/views/disRevenue/resource/fileManage/fileManageView'), + name: 'fileManageView', + meta: { title: '文件管理信息', activeMenu: '/disRevenue/resource/fileManage' } + } + ] + }, // agent采集数据 { path: '/agentCollect/cpuData/view', diff --git a/src/views/disRevenue/resource/alarmLog/alarmLog.vue b/src/views/disRevenue/resource/alarmLog/alarmLog.vue index 4120a9f..7373dae 100644 --- a/src/views/disRevenue/resource/alarmLog/alarmLog.vue +++ b/src/views/disRevenue/resource/alarmLog/alarmLog.vue @@ -1,7 +1,7 @@ - +
- 移动到: + {{title}}到:
@@ -133,7 +122,8 @@ deptOptions: undefined, defaultProps: { children: "children", - label: "label" + label: "label", + disabled: true }, showSearch: true, @@ -162,30 +152,31 @@ ], tableButton: { top: [ - {content: '上传文件', fnCode: 'upload', type: 'warning', icon: 'el-icon-download', hasPermi: 'disRevenue:resource:fileManage:upload'}, - {content: '新建文件夹', fnCode: 'newFile', type: 'warning', icon: 'el-icon-download', hasPermi: 'disRevenue:resource:fileManage:file'}, - {content: '移动', fnCode: 'move', type: 'warning', icon: 'el-icon-download', hasPermi: 'disRevenue:resource:fileManage:move'}, + {content: '上传文件', fnCode: 'upload', type: 'success', icon: 'el-icon-upload2', hasPermi: 'disRevenue:resource:fileManage:upload'}, + {content: '新建文件夹', fnCode: 'newFile', type: 'primary', icon: 'el-icon-plus', hasPermi: 'disRevenue:resource:fileManage:file'}, + {content: '移动', fnCode: 'move', type: 'warning', icon: 'el-icon-sort', hasPermi: 'disRevenue:resource:fileManage:move'}, ], line: [ {content: '详情', fnCode: 'details', type: 'text', icon: 'el-icon-view', hasPermi: 'disRevenue:resource:fileManage:details'}, {content: '修改', fnCode: 'edit', type: 'text', icon: 'el-icon-edit', hasPermi: 'disRevenue:resource:fileManage:edit'}, {content: '删除', fnCode: 'delete', type: 'text', icon: 'el-icon-delete', hasPermi: 'disRevenue:resource:fileManage:delete'}, - {content: '移动', fnCode: 'move', type: 'text', icon: 'el-icon-view', hasPermi: 'disRevenue:resource:fileManage:move'}, - {content: '复制', fnCode: 'copy', type: 'text', icon: 'el-icon-view', hasPermi: 'disRevenue:resource:fileManage:copy'}, + {content: '移动', fnCode: 'move', type: 'text', icon: 'el-icon-sort', hasPermi: 'disRevenue:resource:fileManage:move'}, + {content: '复制', fnCode: 'copy', type: 'text', icon: 'el-icon-document-copy', hasPermi: 'disRevenue:resource:fileManage:copy'}, {content: '下载', fnCode: 'download', type: 'text', icon: 'el-icon-download', hasPermi: 'disRevenue:resource:fileManage:download'}, ] } }, open: false, openMove: false, + title: '', moveList: [], catalogList: null, formList:{ - fileName: '', + switchName: '', remarks: '' }, rules: { - fileName: [ + switchName: [ { required: true, message: '请输入名称', trigger: 'blur' }, ] } @@ -264,7 +255,10 @@ // console.log('父组件拿到新值:', newValue); }, /** 搜索按钮操作 */ - handleQuery() { + handleQuery(val) { + if (val && val === 1) { + delete this.queryParams.deptId; + } this.queryParams.pageNum = 1; this.getList(); }, @@ -291,6 +285,7 @@ /** 取消按钮 */ cancel() { this.open = false; + this.openMove = false; }, callback(result, rowData, selectChange, selectList) { @@ -299,25 +294,49 @@ case 'upload': this.$refs.fileInput.click(); break; - case 'newFile': - this.open = true; - this.$nextTick(() => { - this.$refs['noticeRef'].resetFields(); - }); - break; - case 'move': - console.log('rowData==',rowData); - this.openMove = true; - this.moveList = selectList; - break; - case 'details': + case 'newFile': + this.open = true; + this.$nextTick(() => { + this.$refs['noticeRef'].resetFields(); + }); + break; + case 'move': + this.title = '移动'; + if (rowData && rowData.id) { + this.moveList = [rowData]; + } else { + if (selectList && selectList.length <= 0) { + this.$modal.msgWarning("请选择数据!"); + return; + } + this.moveList = selectList; + } + this.openMove = true; + break; + case 'copy': + this.title = '复制'; + this.moveList = [rowData]; + this.openMove = true; + break; + case 'edit': this.$router.push({ - path:'/disRevenue/resource/resMonitor/details/index', + path:'/disRevenue/resource/fileManage/view', query:{ id: rowData.id } }); break; + case 'details': + this.$router.push({ + path:'/disRevenue/resource/fileManage/view', + query:{ + id: rowData.id, + readonly: true + } + }); + break; + case 'download': + break; case 'delete': this.$modal.confirm('是否确认删除数据项?').then(function() { return delTopology(selectChange) diff --git a/src/views/disRevenue/resource/fileManage/fileManageView.vue b/src/views/disRevenue/resource/fileManage/fileManageView.vue new file mode 100644 index 0000000..a4504ae --- /dev/null +++ b/src/views/disRevenue/resource/fileManage/fileManageView.vue @@ -0,0 +1,133 @@ + + + + diff --git a/src/views/disRevenue/resource/group/details.vue b/src/views/disRevenue/resource/group/details.vue index 394d946..a4184da 100644 --- a/src/views/disRevenue/resource/group/details.vue +++ b/src/views/disRevenue/resource/group/details.vue @@ -42,11 +42,13 @@ getFormDataList(id) { getGroup(id).then(val => { if (val && val.data) { - val.data['includedDevices'] = val.data['includedDevices'].split(','); + if (val.data && val.data['includedDevices']) { + val.data['includedDevices'] = val.data['includedDevices'].split(','); + } this.ruleForm = val.data; } }).catch(() => { - this.$modal.msgError("操作失败") + // this.$modal.msgError("操作失败") }); }, // 包含设备 diff --git a/src/views/disRevenue/resource/register/handle.vue b/src/views/disRevenue/resource/register/handle.vue index aa8bc4f..d58513e 100644 --- a/src/views/disRevenue/resource/register/handle.vue +++ b/src/views/disRevenue/resource/register/handle.vue @@ -16,11 +16,14 @@ ruleForm: { resourceType: '1', snmpDetect: '1', - protocol: '1', + protocol: '2', resourceVersion: '1', securityLevel: '1', rwPermission: '1', encryption: '1', + agentWeek: '5秒', + agentNum: '3次', + agentOID: '1.3.6.1.2.1.1.5' }, formList: [], paramsData: {} @@ -44,25 +47,28 @@ hardwareSn: {label: '硬件SN', span: 12, type: 'input', disabled: objVal && objVal.id ? true : false, required: true}, resourceName: {label: '资源名称', span: 12, type: 'input',required: true}, - resourceType: {label: '资源类型', span: 12, type: 'radio', options: this.dict.type.rm_register_resource_type}, + resourceType: {label: '资源类型', span: 12, type: 'radio', options: this.dict.type.rm_register_resource_type, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, ipAddress: {label: 'IP地址', span: 12, type: 'input',required: true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, - protocol: {label: '协议', span: 12, type: 'radio', options: this.dict.type.rm_register_protocol, required: true}, + protocol: {label: '协议', span: 12, type: 'radio', options: this.dict.type.rm_register_protocol, required: true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, resourcePort: {label: '端口', span: 12, type: 'input',required: true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, // otherPortName: {label: ' ', span: 4, type: 'input', // hidden: objVal && objVal.resourcePort === '2' ? false : true}, - snmpDetect: {label: 'SNMP探测', span: 12, type: 'radio', eventName: 'change',required: true, options: this.dict.type.rm_register_snmp_detect}, - resourceVersion: {label: 'SNMP版本', span: 12, type: 'radio',required: true, options: this.dict.type.rm_register_version,hidden: objVal && objVal.snmpDetect === '1' ? false : true}, - rwPermission: {label: '读写权限', span: 12, type: 'radio', options: this.dict.type.rm_register_permission,hidden: objVal && objVal.snmpDetect === '1' ? false : true}, - securityLevel: {label: '安全级别', span: 12, type: 'radio', options: this.dict.type.rm_register_security_level,hidden: objVal && objVal.id ? false : true}, - encryption: {label: '加密方式', span: 12, type: 'radio', options: this.dict.type.rm_register_encryption,hidden: objVal && objVal.id ? false : true}, + snmpDetect: {label: 'SNMP探测', span: 12, type: 'radio', eventName: 'change',required: true, options: this.dict.type.rm_register_snmp_detect, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, + resourceVersion: {label: 'SNMP版本', span: 12, type: 'radio',required: true, options: this.dict.type.rm_register_version,hidden: objVal && objVal.snmpDetect === '1' ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, + rwPermission: {label: '读写权限', span: 12, type: 'radio', options: this.dict.type.rm_register_permission,hidden: objVal && objVal.snmpDetect === '1' ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, + securityLevel: {label: '安全级别', span: 12, type: 'radio', options: this.dict.type.rm_register_security_level,hidden: objVal && objVal.id ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, + encryption: {label: '加密方式', span: 12, type: 'radio', options: this.dict.type.rm_register_encryption,hidden: objVal && objVal.id ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, teamName: {label: '团体名称', span: 12, type: 'input', hidden: objVal && objVal.snmpDetect === '1' ? false : true,disabled: objVal && objVal.registrationStatus === '1' ? true : false}, snmpCollectAddr: {label: 'SNMP采集地址', span: 12, type: 'input',required: true, hidden: objVal && objVal.snmpDetect === '1' ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, resourceUserName: {label: '用户名', span: 12, type: 'input', hidden: objVal && objVal.id ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, resourcePwd: {label: '密码', span: 12, type: 'input', hidden: objVal && objVal.id ? false : true, disabled: objVal && objVal.registrationStatus === '1' ? true : false}, - description: {label: '描述', span: 12, type: 'textarea'}, + description: {label: '描述', span: 12, type: 'textarea',disabled: objVal && objVal.registrationStatus === '1' ? true : false}, agentVersion: {label: 'AGENT版本', span: 12, type: 'input',disabled: objVal && objVal.id ? true : false}, // customerName: {label: '设备业务客户', span: 12, type: 'input'}, // serviceNumber: {label: '业务号', span: 12, type: 'input'}, + agentWeek: {label: 'Agent与交换机心跳检测周期', span: 12, type: 'input', disabled: true}, + agentNum: {label: 'Agent与交换机心跳检测次数', span: 12, type: 'input', disabled: true}, + agentOID: {label: 'Agent与交换机心跳检测OID', span: 12, type: 'input', disabled: true}, } }]; }, diff --git a/src/views/disRevenue/resource/register/index.vue b/src/views/disRevenue/resource/register/index.vue index 6838aa9..f66fd33 100644 --- a/src/views/disRevenue/resource/register/index.vue +++ b/src/views/disRevenue/resource/register/index.vue @@ -11,6 +11,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 重置 @@ -68,8 +124,9 @@ ipAddress: { label: `IP地址`, minWidth: '200', visible: true }, resourcePort: { label: `端口`, slotName: 'tempPort', minWidth: '80', visible: true }, protocol: { label: `协议`, minWidth: '80', slotName: 'tempProtocol', visible: true }, - registrationStatus: { label: `注册状态`, slotName: 'tempStatus', minWidth: '80', visible: true }, - onlineStatus: { label: `在线状态`, slotName: 'tempOnlineStatus', minWidth: '80', visible: true } + registrationStatus: { label: `Agent注册状态`, slotName: 'tempStatus', minWidth: '120', visible: true }, + onlineStatus: { label: `Agent在线状态`, slotName: 'tempOnlineStatus', minWidth: '120', visible: true }, + switchStatus: { label: `交换机在线状态`, slotName: 'tempOnlineStatus', minWidth: '120', visible: true } }, config: { searcherForm: [ @@ -154,11 +211,15 @@ }); break; case 'unenroll': - rowData['registrationStatus'] = '0'; - updateregisterType(rowData).then(res => { - this.$modal.msgSuccess("取消注册成功!"); - this.getList(); - }); + let content = '

资源进行取消注册操作

' + + '

相关的服务器收益或者交换机带宽收益记录中将不在统计相关信息,拓扑中也会将相关的连接删除

'; + this.$modal.confirm(content).then(() => { + rowData['registrationStatus'] = '0'; + updateregisterType(rowData).then(res => { + this.$modal.msgSuccess("取消注册成功!"); + this.getList(); + }); + }).catch(() => {}); break; case 'export': // let dataList = [];