diff --git a/src/api/configManage/license.ts b/src/api/configManage/license.ts index a8e73882..6189f7e2 100644 --- a/src/api/configManage/license.ts +++ b/src/api/configManage/license.ts @@ -1,216 +1,71 @@ -import { - RESULT_CODE_ERROR, - RESULT_CODE_SUCCESS, - RESULT_MSG_ERROR, - } from '@/constants/result-constants'; - import { request } from '@/plugins/http-fetch'; - import { parseObjLineToHump } from '@/utils/parse-utils'; - - /** - * 查询软件列表 - * @param query 查询参数 - * @returns object - */ - export async function listLicense(query: Record) { - let totalSQL = 'select count(id) as total from ne_license '; - let rowsSQL = ' select * from ne_license '; - - // 查询 - let querySQL = 'where 1=1'; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - - // 分页 - const pageNum = query.pageNum - 1; - const limtSql = ` order by created_at desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_license`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_license']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } - } - }); - return data; - } - return result; - } - +import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import { request } from '@/plugins/http-fetch'; +import { parseObjLineToHump } from '@/utils/parse-utils'; - - /** - * 获取软件信息文件 - * @param menuId 网元ID - * @returns object - */ - export async function downloadNeSoftware(data: Record) { - return await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`, - method: 'get', - responseType: 'blob', - }); +/** + * 查询软件列表 + * @param query 查询参数 + * @returns object + */ +export async function listLicense(query: Record) { + let totalSQL = 'select count(id) as total from ne_license '; + let rowsSQL = ' select * from ne_license '; + + // 查询 + let querySQL = 'where 1=1'; + if (query.neType) { + querySQL += ` and ne_type like '%${query.neType}%' `; } - - /** - * 上传文件 - * @param data 表单数据对象 - * @returns object - */ - export function uploadLicense(data: FormData) { - return request({ - url: `/api/rest/systemManagement/v1/elementType/${data.get('nfType')}/objectType/license?neId=${data.get('nfId')}`, - method: 'post', - data, - dataType: 'form-data', - }); - } - - /** - * 下发文件 - * @param data 数据对象 - * @returns object - */ - export async function sendNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'post', - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } - } - return result; - } - - /** - * 激活文件 - * @param data 数据对象 - * @returns object - */ - export async function runNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'put', - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } - } - return result; - } - - /** - * 回退文件 - * @param data 数据对象 - * @returns object - */ - export async function backNeSoftware(data: Record) { - const result = await request({ - url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'patch', - }); - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS && result.data.data) { - let rows = result.data.data.affectedRows; - if (rows) { - delete result.data; - return result; - } else { - return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR }; - } - } - return result; - } - - /** - * 查询版本列表 - * @param query 查询参数 - * @returns object - */ - export async function listNeVersion(query: Record) { - let totalSQL = 'select count(id) as total from ne_version '; - let rowsSQL = 'select * from ne_version '; - - // 查询 - let querySQL = 'where 1=1'; - if (query.neType) { - querySQL += ` and ne_type like '%${query.neType}%' `; - } - if (query.status) { - querySQL += ` and status = '${query.status}' `; - } - if (query.beginTime && query.endTime) { - querySQL += ` and update_time BETWEEN '${query.beginTime}' AND '${query.endTime}' `; - } - - // 分页 - const pageNum = query.pageNum - 1; - const limtSql = ` order by update_time desc limit ${pageNum},${query.pageSize} `; - - // 发起请求 - const result = await request({ - url: `/api/rest/databaseManagement/v1/select/omc_db/ne_version`, - method: 'get', - params: { - totalSQL: totalSQL + querySQL, - rowsSQL: rowsSQL + querySQL + limtSql, - }, - }); - - // 解析数据 - if (result.code === RESULT_CODE_SUCCESS) { - const data: DataList = { - total: 0, - rows: [], - code: result.code, - msg: result.msg, - }; - result.data.data.forEach((item: any) => { - const itemData = item['ne_version']; - if (Array.isArray(itemData)) { - if (itemData.length === 1 && itemData[0]['total'] >= 0) { - data.total = itemData[0]['total']; - } else { - data.rows = itemData.map(v => parseObjLineToHump(v)); - } + + // 分页 + const pageNum = query.pageNum - 1; + const limtSql = ` order by created_at desc limit ${pageNum},${query.pageSize} `; + + // 发起请求 + const result = await request({ + url: `/api/rest/databaseManagement/v1/select/omc_db/ne_license`, + method: 'get', + params: { + totalSQL: totalSQL + querySQL, + rowsSQL: rowsSQL + querySQL + limtSql, + }, + }); + + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS) { + const data: DataList = { + total: 0, + rows: [], + code: result.code, + msg: result.msg, + }; + result.data.data.forEach((item: any) => { + const itemData = item['ne_license']; + if (Array.isArray(itemData)) { + if (itemData.length === 1 && itemData[0]['total'] >= 0) { + data.total = itemData[0]['total']; + } else { + data.rows = itemData.map(v => parseObjLineToHump(v)); } - }); - return data; - } - return result; + } + }); + return data; } - \ No newline at end of file + return result; +} + +/** + * 上传文件 + * @param data 表单数据对象 + * @returns object + */ +export function uploadLicense(data: FormData) { + return request({ + url: `/api/rest/systemManagement/v1/elementType/${data.get( + 'nfType' + )}/objectType/license?neId=${data.get('nfId')}`, + method: 'post', + data, + dataType: 'form-data', + }); +} diff --git a/src/api/configManage/softwareManage.ts b/src/api/configManage/softwareManage.ts index c5d1e238..ac374ba7 100644 --- a/src/api/configManage/softwareManage.ts +++ b/src/api/configManage/softwareManage.ts @@ -145,7 +145,7 @@ export async function runNeSoftware(data: Record) { export async function backNeSoftware(data: Record) { const result = await request({ url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`, - method: 'patch', + method: 'PATCH', timeout: 60 * 1000, }); // 解析数据 diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index c5d9f7f9..4de5bbf2 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -13,6 +13,7 @@ import useLayoutStore from '@/store/modules/layout'; import useRouterStore from '@/store/modules/router'; import useTabsStore from '@/store/modules/tabs'; import useAlarmStore from '@/store/modules/alarm'; +import useAppStore from '@/store/modules/app'; import { useRouter } from 'vue-router'; import { MENU_PATH_INLINE } from '@/constants/menu-constants'; const { proConfig, waterMarkContent } = useLayoutStore(); @@ -24,6 +25,7 @@ import { parseDateToStr } from '@/utils/date-utils'; const { t } = useI18n(); const routerStore = useRouterStore(); const tabsStore = useTabsStore(); +const appStore = useAppStore(); const router = useRouter(); /**菜单面板 */ @@ -121,7 +123,7 @@ tabsStore.clear(); // onMounted(() => { fnGetServerTime(); - useAlarmStore().fnGetActiveAlarmInfo() + useAlarmStore().fnGetActiveAlarmInfo(); }); // ==== 服务器时间显示 start @@ -166,7 +168,7 @@ document.addEventListener('visibilitychange', function () { if (document.visibilityState == 'visible') { //切换到该页面时执行 fnGetServerTime(); - useAlarmStore().fnGetActiveAlarmInfo() + useAlarmStore().fnGetActiveAlarmInfo(); } }); // ==== 服务器时间显示 end @@ -236,15 +238,14 @@ document.addEventListener('visibilitychange', function () { @@ -267,8 +268,22 @@ document.addEventListener('visibilitychange', function () { width: 180px; } -.footer-time { - color: #00000075; - transition: all 0.3s; +.footer { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + z-index: 16; + margin: 0px; + padding: 4px 16px; + width: auto; + background: #fff; + box-shadow: 0 1px 4px #0015291f; + transition: background 0.3s, width 0.2s; + + &-time { + color: #00000085; + transition: all 0.3s; + } } diff --git a/src/plugins/http-fetch.ts b/src/plugins/http-fetch.ts index df6a9a05..9b933c77 100644 --- a/src/plugins/http-fetch.ts +++ b/src/plugins/http-fetch.ts @@ -53,7 +53,7 @@ type OptionsType = { /**请求地址 */ url: string; /**请求方法 */ - method: 'get' | 'post' | 'put' | 'delete' | 'patch'; + method: 'get' | 'post' | 'put' | 'delete' | 'PATCH'; /**请求头 */ headers?: HeadersInit; /**地址栏参数 */ diff --git a/src/router/index.ts b/src/router/index.ts index d0ce850c..0fa0c483 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -40,104 +40,6 @@ const constantRoutes: RouteRecordRaw[] = [ meta: { title: '首页', icon: 'icon-pcduan' }, component: () => import('@/views/index.vue'), }, - { - path: '/dome1', - name: 'Dome1', - meta: { title: '示例一', icon: 'icon-ios', hideInMenu: true }, - component: () => import('@/views/dome/dome1.vue'), - }, - { - path: '/dome2', - name: 'Dome2', - meta: { title: '示例二', icon: 'icon-anzhuo', hideInMenu: true }, - component: () => import('@/views/dome/dome2.vue'), - }, - { - path: '/dome3', - name: 'Dome3', - meta: { title: '示例三', icon: 'icon-qunzhu', hideInMenu: true }, - component: () => import('@/views/dome/dome3.vue'), - }, - { - path: '/domes', - name: 'Domes', - meta: { - title: '示例目录', - icon: 'icon-zhizuoliucheng', - hideInMenu: true, - }, - component: BlankLayout, - redirect: () => ({ name: 'PageInfo' }), - children: [ - { - path: 'page-info', - name: 'PageInfo', - meta: { title: '页面信息', icon: 'icon-huifu' }, - component: () => import('../views/domes/page-info.vue'), - }, - { - path: 'page-typography', - name: 'PageTypography', - meta: { title: '文本信息', icon: 'icon-huizhiguize' }, - component: () => import('../views/domes/page-typography.vue'), - }, - { - path: 'dynamic-match/:id(\\d+)', - name: 'DynamicMatch', - // 路由 path 默认参数再 meta.params 里 - meta: { title: '动态参数页面', params: { id: 1 }, cache: true }, - component: () => import('../views/domes/dynamic-match.vue'), - }, - { - path: 'disabled', - name: 'Disabled', - meta: { title: '禁止点击', disabled: true }, - component: () => {}, - }, - { - path: 'https://github.com/TsMask', - name: 'BlankGithubTsMask', - meta: { - title: 'TsMask-打开新窗', - icon: 'icon-github', - target: '_blank', - }, - component: () => {}, - }, - { - path: encode('https://www.antdv.com/components/comment-cn'), - name: 'HttpsAntDesignVue', - meta: { - title: 'Antdv-内嵌窗口', - icon: 'icon-morentouxiang', - target: null, - }, - component: LinkLayout, - }, - ], - }, - { - path: 'https://github.com/', - name: 'BlankGithub', - meta: { - title: 'Github-打开新窗', - icon: 'icon-github', - target: '_blank', - hideInMenu: true, - }, - component: () => {}, - }, - { - path: 'https://3x.antdv.com/components/comment-cn?sdf=12321&id=12&sdnf', - name: 'SelfAnt Design Vue', - meta: { - title: 'Antdv-当前窗口', - icon: 'icon-morentouxiang', - target: '_self', - hideInMenu: true, - }, - component: LinkLayout, - }, { path: '/account', name: 'Account', diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts index eb6d7b2a..367b1768 100644 --- a/src/store/modules/app.ts +++ b/src/store/modules/app.ts @@ -8,6 +8,8 @@ type AppStore = { appCode: string; /**应用版本 */ appVersion: string; + /**应用版权声明 */ + copyright: string; }; const useAppStore = defineStore('app', { @@ -15,6 +17,7 @@ const useAppStore = defineStore('app', { appName: import.meta.env.VITE_APP_NAME, appCode: import.meta.env.VITE_APP_CODE, appVersion: import.meta.env.VITE_APP_VERSION, + copyright: 'Copyright ©2023 For AGrand 千通科技', }), actions: { /**设置网页标题 */ @@ -25,6 +28,10 @@ const useAppStore = defineStore('app', { document.title = this.appName; } }, + /**设置版权声明 */ + setCopyright(text: string) { + this.copyright = text; + }, }, }); diff --git a/src/views/configManage/backupManage/index.vue b/src/views/configManage/backupManage/index.vue index 0cdd4c71..2006327b 100644 --- a/src/views/configManage/backupManage/index.vue +++ b/src/views/configManage/backupManage/index.vue @@ -1,5 +1,4 @@