From 59e0b5774ee2451ea8b4a03ea2e622e6f475a53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=B7=E5=86=89=E5=86=89?= Date: Mon, 13 Oct 2025 18:42:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=BC=80=E5=8F=91=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E7=AE=A1=E7=90=86=E3=80=81=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=AE=A1=E7=90=86=E3=80=81=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E7=AE=A1=E7=90=86=202=E3=80=81=E8=81=94?= =?UTF-8?q?=E8=B0=83=E4=B8=9A=E5=8A=A1=E8=84=9A=E6=9C=AC=E7=AE=A1=E7=90=86?= =?UTF-8?q?=203=E3=80=81=E9=A6=96=E9=A1=B5top5=E5=9B=BE=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A5=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/disRevenue/earnManage.js | 96 +++++++++ src/components/table/index.vue | 2 +- src/plugins/modal.js | 4 +- src/router/index.js | 86 ++++++-- .../businessIdent/businessIdent.vue | 188 +++++++++++++++++ .../earnManage/businessIdent/details.vue | 77 +++++++ .../businessIssued/businessIssued.vue | 196 ++++++++++++++++++ .../earnManage/businessIssued/details.vue | 120 +++++++++++ .../businessScript/businessScript.vue | 160 ++++++++++++++ .../earnManage/businessScript/details.vue | 92 ++++++++ src/views/index.vue | 86 +++++++- src/views/login.vue | 8 +- 12 files changed, 1089 insertions(+), 26 deletions(-) create mode 100644 src/views/earnManage/businessIdent/businessIdent.vue create mode 100644 src/views/earnManage/businessIdent/details.vue create mode 100644 src/views/earnManage/businessIssued/businessIssued.vue create mode 100644 src/views/earnManage/businessIssued/details.vue create mode 100644 src/views/earnManage/businessScript/businessScript.vue create mode 100644 src/views/earnManage/businessScript/details.vue diff --git a/src/api/disRevenue/earnManage.js b/src/api/disRevenue/earnManage.js index bbbbc2a..6d28ca6 100644 --- a/src/api/disRevenue/earnManage.js +++ b/src/api/disRevenue/earnManage.js @@ -244,3 +244,99 @@ export function updateRecord(data) { data: data }) } + +/** ------------------业务脚本管理------------------- */ +// 查询列表 +export function listBusScript(data) { + return request({ + url: '/system/businessScript/list', + method: 'post', + data: data + }) +} + +// 查询详细 +export function getBusScript(Id) { + return request({ + url: '/system/businessScript/' + Id, + method: 'get' + }) +} + +// 新增 +export function addBusScript(data) { + return request({ + url: '/system/businessScript', + method: 'post', + data: data + }) +} + +// 修改 +export function updateBusScript(data) { + return request({ + url: '/system/businessScript', + method: 'put', + data: data + }) +} + +// 脚本名称 +export function getAllBusScriptName(data) { + return request({ + url: '/system/businessScript/getAllScriptName', + method: 'get' + }) +} + +// 删除 +export function delBusScript(roleId) { + return request({ + url: '/system/businessScript/' + roleId, + method: 'delete' + }) +} + +/** ------------------业务下发管理------------------- */ +// 查询列表 +export function listBusDeploy(data) { + return request({ + url: '/system/businessDeploy/list', + method: 'post', + data: data + }) +} + +// 查询详细 +export function getBusDeploy(Id) { + return request({ + url: '/system/businessDeploy/' + Id, + method: 'get' + }) +} + +// 新增 +export function addBusDeploy(data) { + return request({ + url: '/system/businessDeploy', + method: 'post', + data: data + }) +} + +// 修改 +export function updateBusDeploy(data) { + return request({ + url: '/system/businessDeploy', + method: 'put', + data: data + }) +} + +// 删除 +export function delBusDeploy(roleId) { + return request({ + url: '/system/businessDeploy/' + roleId, + method: 'delete' + }) +} diff --git a/src/components/table/index.vue b/src/components/table/index.vue index fa542b7..0567f39 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -62,7 +62,7 @@ diff --git a/src/plugins/modal.js b/src/plugins/modal.js index 8c9fa50..58ec0a1 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -52,9 +52,9 @@ export default { Notification.warning(content) }, // 确认窗体 - confirm(content) { + confirm(content, titles) { return MessageBox.confirm(content, "系统提示", { - confirmButtonText: '确定', + confirmButtonText: titles && titles.submitTitle ? titles.submitTitle : '确定', cancelButtonText: '取消', dangerouslyUseHTMLString: true, type: "warning", diff --git a/src/router/index.js b/src/router/index.js index b5da809..da7d51c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -62,19 +62,19 @@ export const constantRoutes = [ component: () => import('@/views/error/401'), hidden: true }, - { - path: '', - component: Layout, - redirect: 'index', - children: [ - { - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { title: '首页', icon: 'dashboard', affix: true } - } - ] - }, + // { + // path: '', + // component: Layout, + // redirect: 'index', + // children: [ + // { + // path: 'index', + // component: () => import('@/views/index'), + // name: 'Index', + // meta: { title: '首页', icon: 'dashboard', affix: true } + // } + // ] + // }, { path: '/user', component: Layout, @@ -98,6 +98,19 @@ export const constantRoutes = [ // 动态路由,基于用户权限动态去加载 export const dynamicRoutes = [ + { + path: '/index', + component: Layout, + redirect: 'index', + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true } + } + ] + }, { path: '/system/user-auth', component: Layout, @@ -212,6 +225,51 @@ export const dynamicRoutes = [ } ] }, + // 业务标识管理 + { + path: '/earnManage/businessIdent/details', + component: Layout, + hidden: true, + permissions: ['earnManage:businessIdent:details'], + children: [ + { + path: 'index', + component: () => import('@/views/earnManage/businessIdent/details'), + name: 'BusinessIdentDetails', + meta: { title: '业务标识信息', noCache: true ,activeMenu: '/earnManage/businessIdent' } + } + ] + }, + // 业务脚本管理 + { + path: '/earnManage/businessScript/details', + component: Layout, + hidden: true, + permissions: ['earnManage:businessScript:details'], + children: [ + { + path: ':id?', + component: () => import('@/views/earnManage/businessScript/details'), + name: 'BusinessScriptDetails', + meta: { title: '业务脚本信息', noCache: true ,activeMenu: '/earnManage/businessScript' } + } + ] + }, + // 业务下发管理 + { + path: '/earnManage/businessIssued/details', + component: Layout, + hidden: true, + permissions: ['earnManage:businessIssued:details'], + children: [ + { + path: ':id?', + component: () => import('@/views/earnManage/businessIssued/details'), + name: 'BusinessIssuedDetails', + meta: { title: '业务脚本信息', noCache: true ,activeMenu: '/earnManage/businessIssued' } + } + ] + }, // 业务管理 { path: '/earnManage/business/details', @@ -253,7 +311,7 @@ export const dynamicRoutes = [ path: 'index/:id?', component: () => import('@/views/resource/switchRegister/handle'), name: 'SwitchRegisterEdit', - meta: { title: '交换机注册信息', activeMenu: '/resource/switchRegister' } + meta: { title: '交换机管理信息', activeMenu: '/resource/switchRegister' } } ] }, diff --git a/src/views/earnManage/businessIdent/businessIdent.vue b/src/views/earnManage/businessIdent/businessIdent.vue new file mode 100644 index 0000000..95d40f9 --- /dev/null +++ b/src/views/earnManage/businessIdent/businessIdent.vue @@ -0,0 +1,188 @@ + + + + diff --git a/src/views/earnManage/businessIdent/details.vue b/src/views/earnManage/businessIdent/details.vue new file mode 100644 index 0000000..3add7ab --- /dev/null +++ b/src/views/earnManage/businessIdent/details.vue @@ -0,0 +1,77 @@ + + + + diff --git a/src/views/earnManage/businessIssued/businessIssued.vue b/src/views/earnManage/businessIssued/businessIssued.vue new file mode 100644 index 0000000..ed5d6b0 --- /dev/null +++ b/src/views/earnManage/businessIssued/businessIssued.vue @@ -0,0 +1,196 @@ + + + + diff --git a/src/views/earnManage/businessIssued/details.vue b/src/views/earnManage/businessIssued/details.vue new file mode 100644 index 0000000..9cecd6f --- /dev/null +++ b/src/views/earnManage/businessIssued/details.vue @@ -0,0 +1,120 @@ + + + + diff --git a/src/views/earnManage/businessScript/businessScript.vue b/src/views/earnManage/businessScript/businessScript.vue new file mode 100644 index 0000000..bd53417 --- /dev/null +++ b/src/views/earnManage/businessScript/businessScript.vue @@ -0,0 +1,160 @@ + + + + diff --git a/src/views/earnManage/businessScript/details.vue b/src/views/earnManage/businessScript/details.vue new file mode 100644 index 0000000..ee6705b --- /dev/null +++ b/src/views/earnManage/businessScript/details.vue @@ -0,0 +1,92 @@ + + + + diff --git a/src/views/index.vue b/src/views/index.vue index 968bdab..a6c6129 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -237,14 +237,88 @@ export default { countDeviceNumTop5().then(res => { let lineXData = []; let dataList = []; - res && res.data.forEach(item => { - lineXData.push(item.businessName); - dataList.push(item.total); - }); - this.lineDataParams['lineXData'] = lineXData; - this.lineDataParams['data'] = dataList; + if (res && res.data) { + let newArr = res.data; + if (res.data && res.data.length < 5) { + newArr = this.sortedNum(res.data); + } + newArr.forEach(item => { + lineXData.push(item.businessName); + dataList.push(item.total); + }); + this.lineDataParams['lineXData'] = lineXData; + this.lineDataParams['data'] = dataList; + } }); }, + sortedNum(data){ + // 提取value并转换为数字,同时保存name映射 + const valueMap = new Map(); // 存储 {value: name} + const values = []; + + for (const item of data) { + const value = parseInt(item.total, 10); + // 校验value有效性 + if (isNaN(value) || value <= 0) { + return "错误:所有value必须是大于0的数字"; + } + // 校验重复value + if (valueMap.has(value)) { + return "错误:输入数组不能包含重复的value"; + } + valueMap.set(value, item.businessName); + values.push(value); + } + + // 对输入value排序(降序) + const sortedInputs = [...values].sort((a, b) => b - a); + + // 生成目标value序列(包含所有输入值的5个递减正数) + let targetValues = []; + let start = sortedInputs[0]; + while (true) { + const candidate = new Set(); + // 先加入所有输入值 + sortedInputs.forEach(v => candidate.add(v)); + // 从start开始向下补充,直到有5个值 + let current = start; + while (candidate.size < 5) { + if (current <= 0) break; + candidate.add(current); + current--; + } + // 转换为数组并排序(降序) + const arr = [...candidate].sort((a, b) => b - a); + if (arr.length === 5 && arr.every(v => v > 0)) { + targetValues = arr; + break; + } + start++; // 若当前start无法生成有效序列,增大start重试 + } + + // 生成每个value对应的name + const result = []; + for (const val of targetValues) { + if (valueMap.has(val)) { + // 已有value,使用原name + result.push({ businessName: valueMap.get(val), total: val.toString() }); + } else { + // 补充的value,寻找对应的name前缀 + // 找到小于当前val的最大输入value + const closestSmaller = sortedInputs.find(v => v < val); + if (closestSmaller !== undefined) { + const prefix = valueMap.get(closestSmaller); + result.push({ businessName: `${prefix}${val}`, total: val.toString() }); + } else { + // 若所有输入值都大于当前val(极端情况),用最大输入值的name + const maxInput = sortedInputs[0]; + const prefix = valueMap.get(maxInput); + result.push({ businessName: `${prefix}${val}`, total: val.toString() }); + } + } + } + return result; + }, serverTableList() { listBandWidth(this.serQueryParams).then(response => { this.serTableList = response.rows; diff --git a/src/views/login.vue b/src/views/login.vue index bedeb64..5188f3e 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -73,8 +73,8 @@ export default { title: process.env.VUE_APP_TITLE, codeUrl: "", loginForm: { - username: "admin", - password: "admin456", + username: "", + password: "", rememberMe: false, code: "", uuid: "" @@ -142,7 +142,9 @@ export default { Cookies.remove('rememberMe') } this.$store.dispatch("Login", this.loginForm).then(() => { - this.$router.push({ path: this.redirect || "/" }).catch(()=>{}) + // 默认指向知识库页面 + this.$router.push('/problemRecord').catch(()=>{}) + // this.$router.push({ path: this.redirect || "/" }).catch(()=>{}) }).catch(() => { this.loading = false if (this.captchaEnabled) {