style: 修复样式

This commit is contained in:
TsMask
2024-11-23 15:16:52 +08:00
parent f310ae4f38
commit cb510d9fdb
11 changed files with 259 additions and 122 deletions

View File

@@ -353,6 +353,7 @@ function fnRecordBack(row?: Record<string, any>) {
});
}
result.then((res: any) => {
fnGetList();
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.operateOk'),

View File

@@ -4,9 +4,8 @@ import {
editPtNeConfigData,
} from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Modal } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import message from 'ant-design-vue/lib/message';
import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { reactive, watch } from 'vue';
/**
@@ -66,6 +65,22 @@ export default function useConfigArray({
row[v.name] = Object.assign({}, v);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(row, 'upfId')) {
const v = row.upfId.value;
if (typeof v === 'string') {
if (v === '') {
row.upfId.value = [];
} else if (v.includes(';')) {
row.upfId.value = v.split(';');
} else if (v.includes(',')) {
row.upfId.value = v.split(',');
} else {
row.upfId.value = [v];
}
}
}
modalState.from = row;
modalState.type = 'arrayEdit';
modalState.title = `${treeState.selectNode.paramDisplay} ${from.title}`;
@@ -85,6 +100,16 @@ export default function useConfigArray({
/**多列表编辑确认 */
function arrayEditOk(from: Record<string, any>) {
const loc = `${from['index']['value']}`;
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(from, 'upfId')) {
const v = from.upfId.value;
if (Array.isArray(v)) {
from.upfId.value = v.join(';');
}
}
// 遍历提取属性和值
let data: Record<string, any> = {};
for (const key in from) {
@@ -110,12 +135,12 @@ export default function useConfigArray({
neType: treeState.neType,
paramName: treeState.selectNode.paramName,
paramData: data,
loc: `${from['index']['value']}`,
loc: loc,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateItem', {
content: t('views.ne.neConfig.updateItem', {
num: modalState.title,
}),
duration: 3,
@@ -123,7 +148,7 @@ export default function useConfigArray({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.updateItemErr'),
content: t('views.ne.neConfig.updateItemErr'),
duration: 3,
});
}
@@ -141,7 +166,7 @@ export default function useConfigArray({
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.configParamForm.delItemTip', {
content: t('views.ne.neConfig.delItemTip', {
num: title,
}),
onOk() {
@@ -152,7 +177,7 @@ export default function useConfigArray({
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
content: t('views.ne.neConfig.delItemOk', {
num: title,
}),
duration: 2,
@@ -183,6 +208,22 @@ export default function useConfigArray({
row[v.name] = Object.assign({}, v);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(row, 'upfId')) {
const v = row.upfId.value;
if (typeof v === 'string') {
if (v === '') {
row.upfId.value = [];
} else if (v.includes(';')) {
row.upfId.value = v.split(';');
} else if (v.includes(',')) {
row.upfId.value = v.split(',');
} else {
row.upfId.value = [v];
}
}
}
modalState.from = row;
modalState.type = 'arrayAdd';
modalState.title = `${treeState.selectNode.paramDisplay} ${from.title}`;
@@ -193,6 +234,14 @@ export default function useConfigArray({
/**多列表新增单行确认 */
function arrayAddOk(from: Record<string, any>) {
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(from, 'upfId')) {
const v = from.upfId.value;
if (Array.isArray(v)) {
from.upfId.value = v.join(';');
}
}
// 遍历提取属性和值
let data: Record<string, any> = {};
for (const key in from) {
@@ -223,7 +272,7 @@ export default function useConfigArray({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.addItemOk', {
content: t('views.ne.neConfig.addItemOk', {
num: modalState.title,
}),
duration: 3,
@@ -231,7 +280,7 @@ export default function useConfigArray({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.addItemErr'),
content: t('views.ne.neConfig.addItemErr'),
duration: 3,
});
}
@@ -316,6 +365,22 @@ export default function useConfigArray({
if ('bool' === row.type) {
row.value = Boolean(row.value);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && row.name === 'upfId') {
const v = row.value;
if (typeof v === 'string') {
if (v === '') {
row.value = [];
} else if (v.includes(';')) {
row.value = v.split(';');
} else if (v.includes(',')) {
row.value = v.split(',');
} else {
row.value = [v];
}
}
}
}
return ruleFrom;
}

View File

@@ -4,9 +4,8 @@ import {
editPtNeConfigData,
} from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Modal } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import message from 'ant-design-vue/lib/message';
import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { nextTick, reactive } from 'vue';
/**
@@ -16,7 +15,7 @@ import { nextTick, reactive } from 'vue';
*/
export default function useConfigArrayChild({
t,
treeState,
treeState,
fnActiveConfigNode,
ruleVerification,
modalState,
@@ -209,7 +208,7 @@ export default function useConfigArrayChild({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateItem', {
content: t('views.ne.neConfig.updateItem', {
num: modalState.title,
}),
duration: 3,
@@ -217,7 +216,7 @@ export default function useConfigArrayChild({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.updateItemErr'),
content: t('views.ne.neConfig.updateItemErr'),
duration: 3,
});
}
@@ -236,7 +235,7 @@ export default function useConfigArrayChild({
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.configParamForm.delItemTip', {
content: t('views.ne.neConfig.delItemTip', {
num: title,
}),
onOk() {
@@ -247,7 +246,7 @@ export default function useConfigArrayChild({
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
content: t('views.ne.neConfig.delItemOk', {
num: title,
}),
duration: 2,
@@ -318,7 +317,7 @@ export default function useConfigArrayChild({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.addItemOk', {
content: t('views.ne.neConfig.addItemOk', {
num: modalState.title,
}),
duration: 3,
@@ -326,7 +325,7 @@ export default function useConfigArrayChild({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.addItemErr'),
content: t('views.ne.neConfig.addItemErr'),
duration: 3,
});
}

View File

@@ -1,7 +1,7 @@
import { editPtNeConfigData } from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { SizeType } from 'ant-design-vue/es/config-provider';
import message from 'ant-design-vue/es/message';
import { message } from 'ant-design-vue/es';
import { reactive, toRaw } from 'vue';
/**
@@ -48,6 +48,13 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
/**单列表编辑 */
function listEdit(row: Record<string, any>) {
if (
listState.confirmLoading ||
['read-only', 'read', 'ro'].includes(row.access)
) {
return;
}
listState.editRecord = Object.assign({}, row);
}
@@ -84,7 +91,7 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateValue', {
content: t('views.ne.neConfig.updateValue', {
num: from['display'],
}),
duration: 3,
@@ -98,7 +105,7 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
}
} else {
message.warning({
content: t('views.configManage.configParamForm.updateValueErr'),
content: t('views.ne.neConfig.updateValueErr'),
duration: 3,
});
}

View File

@@ -37,7 +37,7 @@ export default function useOptions({ t }: any) {
if (valueInt < minInt || valueInt > maxInt) {
return [
false,
t('views.configManage.configParamForm.requireInt', {
t('views.ne.neConfig.requireInt', {
display,
filter,
}),
@@ -49,7 +49,7 @@ export default function useOptions({ t }: any) {
if (!regExpIPv4.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireIpv4', { display }),
t('views.ne.neConfig.requireIpv4', { display }),
];
}
break;
@@ -57,7 +57,7 @@ export default function useOptions({ t }: any) {
if (!regExpIPv6.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireIpv6', { display }),
t('views.ne.neConfig.requireIpv6', { display }),
];
}
break;
@@ -73,7 +73,7 @@ export default function useOptions({ t }: any) {
if (!Object.keys(filterJson).includes(`${value}`)) {
return [
false,
t('views.configManage.configParamForm.requireEnum', { display }),
t('views.ne.neConfig.requireEnum', { display }),
];
}
}
@@ -92,7 +92,7 @@ export default function useOptions({ t }: any) {
if (!Object.values(filterJson).includes(`${value}`)) {
return [
false,
t('views.configManage.configParamForm.requireBool', { display }),
t('views.ne.neConfig.requireBool', { display }),
];
}
}
@@ -110,7 +110,7 @@ export default function useOptions({ t }: any) {
if (!rule.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -125,7 +125,7 @@ export default function useOptions({ t }: any) {
if (!validURL(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -145,7 +145,7 @@ export default function useOptions({ t }: any) {
if (!regex.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -159,24 +159,24 @@ export default function useOptions({ t }: any) {
default:
return [
false,
t('views.configManage.configParamForm.requireUn', { display }),
t('views.ne.neConfig.requireUn', { display }),
];
}
return result;
}
/**upfId可选择 */
const SMFByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
const smfByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
/**加载smf配置的upfId */
function getConfigSMFByUPFIds(neId: string) {
function smfByUPFIdLoadData(neId: string) {
getNeConfigData({
neType: 'SMF',
neId: neId,
paramName: 'upfConfig',
}).then(res => {
SMFByUPFIdOptions.value = [];
smfByUPFIdOptions.value = [];
for (const s of res.data) {
SMFByUPFIdOptions.value.push({
smfByUPFIdOptions.value.push({
value: s.id,
label: s.id,
});
@@ -186,7 +186,7 @@ export default function useOptions({ t }: any) {
return {
ruleVerification,
getConfigSMFByUPFIds,
SMFByUPFIdOptions,
smfByUPFIdLoadData,
smfByUPFIdOptions,
};
}

View File

@@ -1,15 +1,8 @@
<script setup lang="ts">
import {
reactive,
ref,
onMounted,
toRaw,
watch,
defineAsyncComponent,
} from 'vue';
import { reactive, ref, onMounted, toRaw, watch, defineAsyncComponent } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import { message, Modal } from 'ant-design-vue';
import { message, Modal } from 'ant-design-vue/es';
import { DataNode } from 'ant-design-vue/es/tree';
import useI18n from '@/hooks/useI18n';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
@@ -26,12 +19,12 @@ import {
ptContrastAsDefault,
ptExport,
} from '@/api/pt/neConfig';
import { isSystemAdmin, hasRoles } from '@/plugins/auth-user';
import { isSystemAdmin, hasRoles } from '@/plugins/auth-user';const neInfoStore = useNeInfoStore();
import saveAs from 'file-saver';
const neInfoStore = useNeInfoStore();
const { t } = useI18n();
const { ruleVerification, getConfigSMFByUPFIds, SMFByUPFIdOptions } =
useOptions({ t });
const { ruleVerification, smfByUPFIdLoadData, smfByUPFIdOptions } = useOptions({
t,
});
/**网元参数 */
let neSelectOptions = ref<Record<string, any>[]>([]);
@@ -93,7 +86,7 @@ function fnSelectConfigNode(_: any, info: any) {
fnActiveConfigNode(key);
}
/**标签点击监听 */
/**列表项点击监听 */
function fnActiveConfigNode(key: string | number) {
listState.data = [];
arrayState.data = [];
@@ -150,6 +143,7 @@ function fnActiveConfigNode(key: string | number) {
}
}
listState.data = dataList;
tablePagination.current = 1;
listEditClose();
}
if (param.paramType === 'array') {
@@ -208,7 +202,7 @@ function fnActiveConfigNode(key: string | number) {
width: 100,
});
arrayState.columns = columns;
tablePagination.current = 1;
arrayEditClose();
}
setTimeout(() => {
@@ -336,7 +330,7 @@ watch(
val => {
// SMF需要选择配置的UPF id
if (val && treeState.neType === 'SMF') {
getConfigSMFByUPFIds('001');
smfByUPFIdLoadData('001');
}
}
);
@@ -662,7 +656,7 @@ onMounted(() => {
<a-card
size="small"
:bordered="false"
:body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:loading="treeState.selectLoading"
>
<template #title>
@@ -814,7 +808,7 @@ onMounted(() => {
:disabled="listState.confirmLoading"
>
<template #icon>
<CheckOutlined style="color: #52c41a" />
<CheckOutlined />
</template>
</a-button>
</a-popconfirm>
@@ -828,7 +822,7 @@ onMounted(() => {
@click.prevent="listEditClose()"
>
<template #icon>
<CloseOutlined style="color: #eb2f96" />
<CloseOutlined />
</template>
</a-button>
</a-tooltip>
@@ -840,7 +834,7 @@ onMounted(() => {
@dblclick="listEdit(record)"
>
<template v-if="record['type'] === 'enum'">
{{ JSON.parse(record['filter'])[text] }}
{{ JSON.parse(record['filter'])[text] || '&nbsp;' }}
</template>
<template v-else>{{ `${text}` || '&nbsp;' }}</template>
<EditOutlined
@@ -1080,7 +1074,7 @@ onMounted(() => {
:drag="true"
:width="800"
:destroyOnClose="true"
:body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:keyboard="false"
:mask-closable="false"
:open="modalState.open"
@@ -1124,8 +1118,11 @@ onMounted(() => {
modalState.from[item.name]['name'] === 'upfId'
"
v-model:value="modalState.from[item.name]['value']"
:options="SMFByUPFIdOptions"
:options="smfByUPFIdOptions"
:disabled="['read-only', 'read', 'ro'].includes(item.access)"
:token-separators="[',', ';']"
mode="multiple"
:max-tag-count="5"
:allow-clear="true"
style="width: 100%"
>
@@ -1228,7 +1225,7 @@ onMounted(() => {
}
&__text-wrapper {
font-size: 16px;
color: #333;
color: inherit;
}
&__text-wrapper:hover &__icon {
display: inline-block;

View File

@@ -4,9 +4,8 @@ import {
editPtNeConfigData,
} from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Modal } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import message from 'ant-design-vue/lib/message';
import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { reactive, watch } from 'vue';
/**
@@ -66,6 +65,22 @@ export default function useConfigArray({
row[v.name] = Object.assign({}, v);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(row, 'upfId')) {
const v = row.upfId.value;
if (typeof v === 'string') {
if (v === '') {
row.upfId.value = [];
} else if (v.includes(';')) {
row.upfId.value = v.split(';');
} else if (v.includes(',')) {
row.upfId.value = v.split(',');
} else {
row.upfId.value = [v];
}
}
}
modalState.from = row;
modalState.type = 'arrayEdit';
modalState.title = `${treeState.selectNode.paramDisplay} ${from.title}`;
@@ -85,6 +100,16 @@ export default function useConfigArray({
/**多列表编辑确认 */
function arrayEditOk(from: Record<string, any>) {
const loc = `${from['index']['value']}`;
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(from, 'upfId')) {
const v = from.upfId.value;
if (Array.isArray(v)) {
from.upfId.value = v.join(';');
}
}
// 遍历提取属性和值
let data: Record<string, any> = {};
for (const key in from) {
@@ -110,12 +135,12 @@ export default function useConfigArray({
neType: treeState.neType,
paramName: treeState.selectNode.paramName,
paramData: data,
loc: `${from['index']['value']}`,
loc: loc,
})
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateItem', {
content: t('views.ne.neConfig.updateItem', {
num: modalState.title,
}),
duration: 3,
@@ -123,7 +148,7 @@ export default function useConfigArray({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.updateItemErr'),
content: t('views.ne.neConfig.updateItemErr'),
duration: 3,
});
}
@@ -141,7 +166,7 @@ export default function useConfigArray({
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.configParamForm.delItemTip', {
content: t('views.ne.neConfig.delItemTip', {
num: title,
}),
onOk() {
@@ -152,7 +177,7 @@ export default function useConfigArray({
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
content: t('views.ne.neConfig.delItemOk', {
num: title,
}),
duration: 2,
@@ -183,6 +208,22 @@ export default function useConfigArray({
row[v.name] = Object.assign({}, v);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(row, 'upfId')) {
const v = row.upfId.value;
if (typeof v === 'string') {
if (v === '') {
row.upfId.value = [];
} else if (v.includes(';')) {
row.upfId.value = v.split(';');
} else if (v.includes(',')) {
row.upfId.value = v.split(',');
} else {
row.upfId.value = [v];
}
}
}
modalState.from = row;
modalState.type = 'arrayAdd';
modalState.title = `${treeState.selectNode.paramDisplay} ${from.title}`;
@@ -193,6 +234,14 @@ export default function useConfigArray({
/**多列表新增单行确认 */
function arrayAddOk(from: Record<string, any>) {
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && Reflect.has(from, 'upfId')) {
const v = from.upfId.value;
if (Array.isArray(v)) {
from.upfId.value = v.join(';');
}
}
// 遍历提取属性和值
let data: Record<string, any> = {};
for (const key in from) {
@@ -223,7 +272,7 @@ export default function useConfigArray({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.addItemOk', {
content: t('views.ne.neConfig.addItemOk', {
num: modalState.title,
}),
duration: 3,
@@ -231,7 +280,7 @@ export default function useConfigArray({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.addItemErr'),
content: t('views.ne.neConfig.addItemErr'),
duration: 3,
});
}
@@ -316,6 +365,22 @@ export default function useConfigArray({
if ('bool' === row.type) {
row.value = Boolean(row.value);
}
// 特殊SMF-upfid选择
if (treeState.neType === 'SMF' && row.name === 'upfId') {
const v = row.value;
if (typeof v === 'string') {
if (v === '') {
row.value = [];
} else if (v.includes(';')) {
row.value = v.split(';');
} else if (v.includes(',')) {
row.value = v.split(',');
} else {
row.value = [v];
}
}
}
}
return ruleFrom;
}

View File

@@ -4,9 +4,8 @@ import {
editPtNeConfigData,
} from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { Modal } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import message from 'ant-design-vue/lib/message';
import { Modal, message } from 'ant-design-vue/es';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { nextTick, reactive } from 'vue';
/**
@@ -16,7 +15,7 @@ import { nextTick, reactive } from 'vue';
*/
export default function useConfigArrayChild({
t,
treeState,
treeState,
fnActiveConfigNode,
ruleVerification,
modalState,
@@ -209,7 +208,7 @@ export default function useConfigArrayChild({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateItem', {
content: t('views.ne.neConfig.updateItem', {
num: modalState.title,
}),
duration: 3,
@@ -217,7 +216,7 @@ export default function useConfigArrayChild({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.updateItemErr'),
content: t('views.ne.neConfig.updateItemErr'),
duration: 3,
});
}
@@ -236,7 +235,7 @@ export default function useConfigArrayChild({
Modal.confirm({
title: t('common.tipTitle'),
content: t('views.configManage.configParamForm.delItemTip', {
content: t('views.ne.neConfig.delItemTip', {
num: title,
}),
onOk() {
@@ -247,7 +246,7 @@ export default function useConfigArrayChild({
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
content: t('views.ne.neConfig.delItemOk', {
num: title,
}),
duration: 2,
@@ -318,7 +317,7 @@ export default function useConfigArrayChild({
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.addItemOk', {
content: t('views.ne.neConfig.addItemOk', {
num: modalState.title,
}),
duration: 3,
@@ -326,7 +325,7 @@ export default function useConfigArrayChild({
fnActiveConfigNode('#');
} else {
message.warning({
content: t('views.configManage.configParamForm.addItemErr'),
content: t('views.ne.neConfig.addItemErr'),
duration: 3,
});
}

View File

@@ -1,7 +1,7 @@
import { editPtNeConfigData } from '@/api/pt/neConfig';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { SizeType } from 'ant-design-vue/es/config-provider';
import message from 'ant-design-vue/es/message';
import { message } from 'ant-design-vue/es';
import { reactive, toRaw } from 'vue';
/**
@@ -48,6 +48,13 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
/**单列表编辑 */
function listEdit(row: Record<string, any>) {
if (
listState.confirmLoading ||
['read-only', 'read', 'ro'].includes(row.access)
) {
return;
}
listState.editRecord = Object.assign({}, row);
}
@@ -84,7 +91,7 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.updateValue', {
content: t('views.ne.neConfig.updateValue', {
num: from['display'],
}),
duration: 3,
@@ -98,7 +105,7 @@ export default function useConfigList({ t, treeState, ruleVerification }: any) {
}
} else {
message.warning({
content: t('views.configManage.configParamForm.updateValueErr'),
content: t('views.ne.neConfig.updateValueErr'),
duration: 3,
});
}

View File

@@ -37,7 +37,7 @@ export default function useOptions({ t }: any) {
if (valueInt < minInt || valueInt > maxInt) {
return [
false,
t('views.configManage.configParamForm.requireInt', {
t('views.ne.neConfig.requireInt', {
display,
filter,
}),
@@ -49,7 +49,7 @@ export default function useOptions({ t }: any) {
if (!regExpIPv4.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireIpv4', { display }),
t('views.ne.neConfig.requireIpv4', { display }),
];
}
break;
@@ -57,7 +57,7 @@ export default function useOptions({ t }: any) {
if (!regExpIPv6.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireIpv6', { display }),
t('views.ne.neConfig.requireIpv6', { display }),
];
}
break;
@@ -73,7 +73,7 @@ export default function useOptions({ t }: any) {
if (!Object.keys(filterJson).includes(`${value}`)) {
return [
false,
t('views.configManage.configParamForm.requireEnum', { display }),
t('views.ne.neConfig.requireEnum', { display }),
];
}
}
@@ -92,7 +92,7 @@ export default function useOptions({ t }: any) {
if (!Object.values(filterJson).includes(`${value}`)) {
return [
false,
t('views.configManage.configParamForm.requireBool', { display }),
t('views.ne.neConfig.requireBool', { display }),
];
}
}
@@ -110,7 +110,7 @@ export default function useOptions({ t }: any) {
if (!rule.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -125,7 +125,7 @@ export default function useOptions({ t }: any) {
if (!validURL(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -145,7 +145,7 @@ export default function useOptions({ t }: any) {
if (!regex.test(value)) {
return [
false,
t('views.configManage.configParamForm.requireString', {
t('views.ne.neConfig.requireString', {
display,
}),
];
@@ -159,24 +159,24 @@ export default function useOptions({ t }: any) {
default:
return [
false,
t('views.configManage.configParamForm.requireUn', { display }),
t('views.ne.neConfig.requireUn', { display }),
];
}
return result;
}
/**upfId可选择 */
const SMFByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
const smfByUPFIdOptions = ref<{ value: string; label: string }[]>([]);
/**加载smf配置的upfId */
function getConfigSMFByUPFIds(neId: string) {
function smfByUPFIdLoadData(neId: string) {
getNeConfigData({
neType: 'SMF',
neId: neId,
paramName: 'upfConfig',
}).then(res => {
SMFByUPFIdOptions.value = [];
smfByUPFIdOptions.value = [];
for (const s of res.data) {
SMFByUPFIdOptions.value.push({
smfByUPFIdOptions.value.push({
value: s.id,
label: s.id,
});
@@ -186,7 +186,7 @@ export default function useOptions({ t }: any) {
return {
ruleVerification,
getConfigSMFByUPFIds,
SMFByUPFIdOptions,
smfByUPFIdLoadData,
smfByUPFIdOptions,
};
}

View File

@@ -1,15 +1,8 @@
<script setup lang="ts">
import {
reactive,
ref,
onMounted,
toRaw,
watch,
defineAsyncComponent,
} from 'vue';
import { reactive, ref, onMounted, toRaw, watch, defineAsyncComponent } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { ProModal } from 'antdv-pro-modal';
import { message, Modal } from 'ant-design-vue';
import { message, Modal } from 'ant-design-vue/es';
import { DataNode } from 'ant-design-vue/es/tree';
import useI18n from '@/hooks/useI18n';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
@@ -26,12 +19,12 @@ import {
ptContrastAsDefault,
ptExport,
} from '@/api/pt/neConfig';
import { isSystemAdmin, hasRoles } from '@/plugins/auth-user';
import { isSystemAdmin, hasRoles } from '@/plugins/auth-user';const neInfoStore = useNeInfoStore();
import saveAs from 'file-saver';
const neInfoStore = useNeInfoStore();
const { t } = useI18n();
const { ruleVerification, getConfigSMFByUPFIds, SMFByUPFIdOptions } =
useOptions({ t });
const { ruleVerification, smfByUPFIdLoadData, smfByUPFIdOptions } = useOptions({
t,
});
/**网元参数 */
let neSelectOptions = ref<Record<string, any>[]>([]);
@@ -93,7 +86,7 @@ function fnSelectConfigNode(_: any, info: any) {
fnActiveConfigNode(key);
}
/**标签点击监听 */
/**列表项点击监听 */
function fnActiveConfigNode(key: string | number) {
listState.data = [];
arrayState.data = [];
@@ -150,6 +143,7 @@ function fnActiveConfigNode(key: string | number) {
}
}
listState.data = dataList;
tablePagination.current = 1;
listEditClose();
}
if (param.paramType === 'array') {
@@ -208,7 +202,7 @@ function fnActiveConfigNode(key: string | number) {
width: 100,
});
arrayState.columns = columns;
tablePagination.current = 1;
arrayEditClose();
}
setTimeout(() => {
@@ -336,7 +330,7 @@ watch(
val => {
// SMF需要选择配置的UPF id
if (val && treeState.neType === 'SMF') {
getConfigSMFByUPFIds('001');
smfByUPFIdLoadData('001');
}
}
);
@@ -662,7 +656,7 @@ onMounted(() => {
<a-card
size="small"
:bordered="false"
:body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:loading="treeState.selectLoading"
>
<template #title>
@@ -814,7 +808,7 @@ onMounted(() => {
:disabled="listState.confirmLoading"
>
<template #icon>
<CheckOutlined style="color: #52c41a" />
<CheckOutlined />
</template>
</a-button>
</a-popconfirm>
@@ -828,7 +822,7 @@ onMounted(() => {
@click.prevent="listEditClose()"
>
<template #icon>
<CloseOutlined style="color: #eb2f96" />
<CloseOutlined />
</template>
</a-button>
</a-tooltip>
@@ -840,7 +834,7 @@ onMounted(() => {
@dblclick="listEdit(record)"
>
<template v-if="record['type'] === 'enum'">
{{ JSON.parse(record['filter'])[text] }}
{{ JSON.parse(record['filter'])[text] || '&nbsp;' }}
</template>
<template v-else>{{ `${text}` || '&nbsp;' }}</template>
<EditOutlined
@@ -1080,7 +1074,7 @@ onMounted(() => {
:drag="true"
:width="800"
:destroyOnClose="true"
:body-style="{ maxHeight: '650px', 'overflow-y': 'auto' }"
:body-style="{ maxHeight: '600px', 'overflow-y': 'auto' }"
:keyboard="false"
:mask-closable="false"
:open="modalState.open"
@@ -1124,8 +1118,11 @@ onMounted(() => {
modalState.from[item.name]['name'] === 'upfId'
"
v-model:value="modalState.from[item.name]['value']"
:options="SMFByUPFIdOptions"
:options="smfByUPFIdOptions"
:disabled="['read-only', 'read', 'ro'].includes(item.access)"
:token-separators="[',', ';']"
mode="multiple"
:max-tag-count="5"
:allow-clear="true"
style="width: 100%"
>
@@ -1228,7 +1225,7 @@ onMounted(() => {
}
&__text-wrapper {
font-size: 16px;
color: #333;
color: inherit;
}
&__text-wrapper:hover &__icon {
display: inline-block;