This commit is contained in:
2023-11-17 11:33:50 +08:00
13 changed files with 137 additions and 76 deletions

View File

@@ -323,6 +323,7 @@ export default {
mac:'NE MAC address', mac:'NE MAC address',
macTip:'Able to locate the physical address (MAC) of the network element', macTip:'Able to locate the physical address (MAC) of the network element',
port:'Port', port:'Port',
portTip:'Maximum range 0~65535',
pvflag:'PV Flag', pvflag:'PV Flag',
pnf:'Physical Network Element', pnf:'Physical Network Element',
vnf:'Virtual Network Element', vnf:'Virtual Network Element',

View File

@@ -323,6 +323,7 @@ export default {
mac:'网元物理地址', mac:'网元物理地址',
macTip:'能够定位网元的物理地址(MAC)', macTip:'能够定位网元的物理地址(MAC)',
port:'端口', port:'端口',
portTip:'最大范围0~65535',
pvflag:'网元虚拟化标识', pvflag:'网元虚拟化标识',
pnf:'物理网元', pnf:'物理网元',
vnf:'虚拟网元', vnf:'虚拟网元',

View File

@@ -118,8 +118,9 @@ const router = createRouter({
/**全局路由-后置守卫 */ /**全局路由-后置守卫 */
router.afterEach((to, from, failure) => { router.afterEach((to, from, failure) => {
NProgress.done(); NProgress.done();
const title = to.meta?.title
// 设置标题 // 设置标题
if (to.meta?.title) { if (!failure && title) {
useAppStore().setTitle(to.meta.title); useAppStore().setTitle(to.meta.title);
} }
}); });
@@ -132,7 +133,7 @@ router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start();
const token = getToken(); const token = getToken();
// 获取系统配置信息 // 获取系统配置信息
const appStore = useAppStore(); const appStore =useAppStore()
if (!appStore.loginBackground) { if (!appStore.loginBackground) {
appStore.fnSysConf(); appStore.fnSysConf();
} }

View File

@@ -101,7 +101,7 @@ const useAppStore = defineStore('app', {
actions: { actions: {
/**设置网页标题 */ /**设置网页标题 */
setTitle(title?: string) { setTitle(title?: string) {
if (title) { if (title && title.indexOf('router.') === -1) {
document.title = `${title} - ${this.appName}`; document.title = `${title} - ${this.appName}`;
} else { } else {
document.title = this.appName; document.title = this.appName;

View File

@@ -6,7 +6,11 @@ import { reactive, ref, onMounted } from 'vue';
import { parseDateToStr } from '@/utils/date-utils'; import { parseDateToStr } from '@/utils/date-utils';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { useRoute } from 'vue-router';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
const appStore = useAppStore();
const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
/**加载状态 */ /**加载状态 */
@@ -71,7 +75,19 @@ function fnGetProfile() {
}); });
} }
/**
* 国际化翻译转换
*/
function fnLocale() {
let title = route.meta.title as string;
if (title.indexOf('router.') !== -1) {
title = t(title);
}
appStore.setTitle(title);
}
onMounted(() => { onMounted(() => {
fnLocale();
// 获取信息 // 获取信息
fnGetProfile(); fnGetProfile();
}); });

View File

@@ -1,14 +1,36 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { onActivated, ref } from 'vue';
import { PageContainer } from '@ant-design-vue/pro-layout'; import { PageContainer } from '@ant-design-vue/pro-layout';
import BaseInfo from './components/base-info.vue'; import BaseInfo from './components/base-info.vue';
import ResetPasswd from './components/reset-passwd.vue'; import ResetPasswd from './components/reset-passwd.vue';
import StyleLayout from './components/style-layout.vue'; import StyleLayout from './components/style-layout.vue';
import { useRoute } from 'vue-router';
import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
const appStore = useAppStore();
const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
/**Tab标签激活 */ /**Tab标签激活 */
let activeKey = ref<string>('base-info'); let activeKey = ref<string>('base-info');
/**
* 国际化翻译转换
*/
function fnLocale() {
let title = route.meta.title as string;
if (title.indexOf('router.') !== -1) {
title = t(title);
}
appStore.setTitle(title);
}
onActivated(() => {
// 调用时机为首次挂载
// 以及每次从缓存中被重新插入时
fnLocale();
})
</script> </script>
<template> <template>
@@ -18,10 +40,16 @@ let activeKey = ref<string>('base-info');
<a-tab-pane key="base-info" :tab="t('views.account.settings.baseInfo')"> <a-tab-pane key="base-info" :tab="t('views.account.settings.baseInfo')">
<BaseInfo></BaseInfo> <BaseInfo></BaseInfo>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="reset-passwd" :tab="t('views.account.settings.resetPasswd')"> <a-tab-pane
key="reset-passwd"
:tab="t('views.account.settings.resetPasswd')"
>
<ResetPasswd></ResetPasswd> <ResetPasswd></ResetPasswd>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="style-layout" :tab="t('views.account.settings.styleLayout')"> <a-tab-pane
key="style-layout"
:tab="t('views.account.settings.styleLayout')"
>
<StyleLayout></StyleLayout> <StyleLayout></StyleLayout>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>

View File

@@ -1383,18 +1383,17 @@ onMounted(() => {
</a-select> </a-select>
</div> </div>
<template v-if="item.array"> <template v-else-if="item.array">
<span v-if="arrayState.newIndex === -1">-</span>
<a-button <a-button
type="link" type="default"
size="small" size="small"
@click.prevent="arrayChildExpand(data.key, item)" @click.prevent="arrayChildExpand(data.key, item)"
v-else
> >
<template #icon><BarsOutlined /></template>
{{ {{
arrayState.newIndex === -1 t('views.configManage.configParamForm.arrayMore')
? '-'
: t(
'views.configManage.configParamForm.arrayMore'
)
}} }}
</a-button> </a-button>
<!--特殊字段拓展显示--> <!--特殊字段拓展显示-->
@@ -1414,6 +1413,7 @@ onMounted(() => {
#extra #extra
v-if=" v-if="
Array.isArray(item.array) && Array.isArray(item.array) &&
arrayChildState.loc.startsWith(data.key) &&
item.display === arrayChildState.title item.display === arrayChildState.title
" "
> >
@@ -1613,19 +1613,25 @@ onMounted(() => {
</a-select> </a-select>
</div> </div>
<a-button <template v-else-if="item.array">
type="link" <span v-if="arrayChildState.newIndex === -1">
size="small" -
v-else-if="item.array" </span>
> <a-button
{{ type="default"
arrayChildState.newIndex === -1 size="small"
? '-' v-else
: t( >
'views.configManage.configParamForm.arrayMore' <template #icon>
) <BarsOutlined />
}} </template>
</a-button> {{
t(
'views.configManage.configParamForm.arrayMore'
)
}}
</a-button>
</template>
<div v-else> <div v-else>
{{ `${item.value || '&nbsp;'}` }} {{ `${item.value || '&nbsp;'}` }}

View File

@@ -119,7 +119,6 @@ function fnActiveConfigNode(key: string | number) {
}); });
arrayState.columns = columns; arrayState.columns = columns;
arrayState.collapseActiveKey = [];
arrayEditClose(); arrayEditClose();
} }
} else { } else {
@@ -273,8 +272,6 @@ function listEditOk() {
/**多列列表状态类型 */ /**多列列表状态类型 */
type ArrayStateType = { type ArrayStateType = {
/**面板激活项 */
collapseActiveKey: string[];
/**紧凑型 */ /**紧凑型 */
size: SizeType; size: SizeType;
/**多列嵌套记录字段 */ /**多列嵌套记录字段 */
@@ -288,26 +285,16 @@ type ArrayStateType = {
data: Record<string, any>[]; data: Record<string, any>[];
/**多列记录规则 */ /**多列记录规则 */
dataRule: Record<string, any>; dataRule: Record<string, any>;
/**新增行记录Index 编辑-1/新增>=0 */
newIndex: number;
/**编辑行Key值 */
editKey: number | string;
/**编辑行记录 */
editRecord: Record<string, any>;
}; };
/**多列列表状态 */ /**多列列表状态 */
let arrayState: ArrayStateType = reactive({ let arrayState: ArrayStateType = reactive({
collapseActiveKey: [],
size: 'middle', size: 'middle',
columns: [], columns: [],
columnsData: [], columnsData: [],
arrayChildExpandKeys: [], arrayChildExpandKeys: [],
data: [], data: [],
dataRule: {}, dataRule: {},
newIndex: -2,
editKey: -1,
editRecord: {},
}); });
/**多列表编辑 */ /**多列表编辑 */
@@ -504,8 +491,6 @@ type ArrayChildStateType = {
title: string; title: string;
/**层级index */ /**层级index */
loc: string; loc: string;
/**面板激活项 */
collapseActiveKey: string[];
/**紧凑型 */ /**紧凑型 */
size: SizeType; size: SizeType;
/**多列嵌套记录字段 */ /**多列嵌套记录字段 */
@@ -517,27 +502,17 @@ type ArrayChildStateType = {
data: Record<string, any>[]; data: Record<string, any>[];
/**多列嵌套记录规则 */ /**多列嵌套记录规则 */
dataRule: Record<string, any>; dataRule: Record<string, any>;
/**新增嵌套行记录Index 编辑-1/新增>=0 */
newIndex: number;
/**编辑嵌套行Key值 */
editKey: number | string;
/**编辑嵌套行记录 */
editRecord: Record<string, any>;
}; };
/**表格状态 */ /**表格状态 */
let arrayChildState: ArrayChildStateType = reactive({ let arrayChildState: ArrayChildStateType = reactive({
title: '', title: '',
loc: '', loc: '',
collapseActiveKey: [],
size: 'middle', size: 'middle',
columns: [], columns: [],
columnsData: [], columnsData: [],
data: [], data: [],
dataRule: {}, dataRule: {},
newIndex: -2,
editKey: -1,
editRecord: {},
}); });
/**多列表展开嵌套行 */ /**多列表展开嵌套行 */
@@ -625,11 +600,8 @@ function arrayChildExpand(
arrayState.arrayChildExpandKeys = [indexRow]; arrayState.arrayChildExpandKeys = [indexRow];
arrayChildState.loc = `${loc}/${from['name']}`; arrayChildState.loc = `${loc}/${from['name']}`;
arrayChildState.newIndex = -3;
// 设置展开列表标题 // 设置展开列表标题
arrayChildState.title = `${from['display']}`; arrayChildState.title = `${from['display']}`;
// 关闭默认展开
arrayChildState.collapseActiveKey = [];
} }
/**多列表展开嵌套行 */ /**多列表展开嵌套行 */
@@ -1357,12 +1329,13 @@ onMounted(() => {
<div class="editable-cell"> <div class="editable-cell">
<template v-if="text.array"> <template v-if="text.array">
<a-button <a-button
type="link" type="default"
size="small" size="small"
@click.prevent=" @click.prevent="
arrayChildExpand(record['index'], text) arrayChildExpand(record['index'], text)
" "
> >
<template #icon><BarsOutlined /></template>
{{ {{
t('views.configManage.configParamForm.arrayMore') t('views.configManage.configParamForm.arrayMore')
}} }}
@@ -1437,11 +1410,16 @@ onMounted(() => {
{{ text.comment }} {{ text.comment }}
</template> </template>
<div class="editable-cell"> <div class="editable-cell">
<a-button type="link" size="small" v-if="text.array"> <template v-if="text.array">
{{ <a-button type="default" size="small">
t('views.configManage.configParamForm.arrayMore') <template #icon><BarsOutlined /></template>
}} {{
</a-button> t(
'views.configManage.configParamForm.arrayMore'
)
}}
</a-button>
</template>
<div v-else> <div v-else>
{{ `${text.value || '&nbsp;'}` }} {{ `${text.value || '&nbsp;'}` }}

View File

@@ -450,9 +450,9 @@ function fnModalCancel() {
*/ */
function fnRecordDelete(row: Record<string, any>) { function fnRecordDelete(row: Record<string, any>) {
message.success({ message.success({
content: t('common.msgSuccess', { msg: t('common.deleteText') }), content: t('common.msgSuccess', { msg: t('common.deleteText') }),
duration: 2, duration: 2,
}); });
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.configManage.neManage.delSure', { msg: row.neName }), content: t('views.configManage.neManage.delSure', { msg: row.neName }),
@@ -904,7 +904,10 @@ onMounted(() => {
<pause-outlined /> <pause-outlined />
{{ t('views.configManage.neManage.stop') }} {{ t('views.configManage.neManage.stop') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="reload" v-if="!['OMC','PCF','IMS'].includes(record.neType)"> <a-menu-item
key="reload"
v-if="!['OMC', 'PCF', 'IMS'].includes(record.neType)"
>
<SyncOutlined /> <SyncOutlined />
{{ t('views.configManage.neManage.reload') }} {{ t('views.configManage.neManage.reload') }}
</a-menu-item> </a-menu-item>
@@ -1030,7 +1033,9 @@ onMounted(() => {
<a-input v-model:value="modalState.from.port" allow-clear> <a-input v-model:value="modalState.from.port" allow-clear>
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <div>最大范围0~65535</div> </template> <template #title>
<div>{{ t('views.configManage.neManage.portTip') }}</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" /> <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip> </a-tooltip>
</template> </template>

View File

@@ -12,7 +12,12 @@ import * as echarts from 'echarts/core';
import { TitleComponent, LegendComponent } from 'echarts/components'; import { TitleComponent, LegendComponent } from 'echarts/components';
import { PieChart } from 'echarts/charts'; import { PieChart } from 'echarts/charts';
import { LabelLayout } from 'echarts/features'; import { LabelLayout } from 'echarts/features';
import { useRoute } from 'vue-router';
import useAppStore from '@/store/modules/app';
const appStore = useAppStore();
const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
echarts.use([ echarts.use([
TooltipComponent, TooltipComponent,
GaugeChart, GaugeChart,
@@ -370,7 +375,20 @@ function rowClick(record: any, index: any) {
}; };
} }
let timer: any; let timer: any;
/**
* 国际化翻译转换
*/
function fnLocale( ) {
let title = route.meta.title as string;
if (title.indexOf('router.') !== -1) {
title = t(title);
}
appStore.setTitle(title);
}
onMounted(() => { onMounted(() => {
fnLocale()
fnGetList(); fnGetList();
timer = setInterval(fnGetList, 10000); // 每隔10秒执行一次 timer = setInterval(fnGetList, 10000); // 每隔10秒执行一次
}); });

View File

@@ -104,17 +104,17 @@ let tableColumns: ColumnsType = [
{ {
title: t('views.system.config.configName'), title: t('views.system.config.configName'),
dataIndex: 'configName', dataIndex: 'configName',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.config.configKey'), title: t('views.system.config.configKey'),
dataIndex: 'configKey', dataIndex: 'configKey',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.config.configValue'), title: t('views.system.config.configValue'),
dataIndex: 'configValue', dataIndex: 'configValue',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.config.configType'), title: t('views.system.config.configType'),

View File

@@ -96,7 +96,7 @@ let tableColumns: ColumnsType = [
{ {
title: t('views.system.menu.menuName'), title: t('views.system.menu.menuName'),
dataIndex: 'menuName', dataIndex: 'menuName',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.menu.menuId'), title: t('views.system.menu.menuId'),
@@ -117,12 +117,12 @@ let tableColumns: ColumnsType = [
{ {
title: t('views.system.menu.perId'), title: t('views.system.menu.perId'),
dataIndex: 'perms', dataIndex: 'perms',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.menu.formLoc'), title: t('views.system.menu.formLoc'),
dataIndex: 'component', dataIndex: 'component',
align: 'center', align: 'left',
}, },
{ {
title: t('views.system.menu.status'), title: t('views.system.menu.status'),
@@ -687,8 +687,11 @@ onMounted(() => {
<template #icon><DeleteOutlined /></template> <template #icon><DeleteOutlined /></template>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
<a-tooltip v-if="record.menuType !== MENU_TYPE_BUTTON"> <a-tooltip
<template #title>{{t('views.system.menu.addSon')}}</template> placement="topLeft"
v-if="record.menuType !== MENU_TYPE_BUTTON"
>
<template #title>{{ t('views.system.menu.addSon') }}</template>
<a-button <a-button
type="link" type="link"
@click.prevent=" @click.prevent="
@@ -1129,7 +1132,7 @@ onMounted(() => {
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
<div> <div>
{{t('views.system.menu.perms')}} {{ t('views.system.menu.perms') }}
</div> </div>
</template> </template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" /> <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />

View File

@@ -2,6 +2,7 @@
import { Modal, message } from 'ant-design-vue/lib'; import { Modal, message } from 'ant-design-vue/lib';
import { FileType } from 'ant-design-vue/lib/upload/interface'; import { FileType } from 'ant-design-vue/lib/upload/interface';
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
import IconFont from '@/components/IconFont/index.vue';
import { onMounted, reactive } from 'vue'; import { onMounted, reactive } from 'vue';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
@@ -175,7 +176,10 @@ onMounted(() => {
{{ appStore.appName }} {{ appStore.appName }}
</h1> </h1>
</div> </div>
<div class="header-menu">Menu</div> <div class="header-menu">
<IconFont type="icon-pcduan" style="margin-right: 10px"></IconFont>
{{ t('router.index') }}
</div>
</div> </div>
<a-form layout="vertical" v-if="state.edite"> <a-form layout="vertical" v-if="state.edite">
@@ -291,7 +295,7 @@ onMounted(() => {
&-menu { &-menu {
width: 90px; width: 90px;
line-height: 45px; line-height: 40px;
color: #ffffff; color: #ffffff;
align-self: center; align-self: center;
text-align: center; text-align: center;