ref: v3变更,,完成整合,同步v2.2508.4 -250902
This commit is contained in:
@@ -5,12 +5,11 @@ import { message, Form, Modal } from 'ant-design-vue/es';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { NE_TYPE_LIST } from '@/constants/ne-constants';
|
||||
import { regExpIPv4, regExpIPv6 } from '@/utils/regular-utils';
|
||||
import { addNeInfo, updateNeInfo } from '@/api/ne/neInfo';
|
||||
import { addNeInfo, updateNeInfo, getNeInfo } from '@/api/ne/neInfo';
|
||||
import { neHostAuthorizedRSA, testNeHost } from '@/api/ne/neHost';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { currentCoreUid } from '@/hooks/useCoreUid';
|
||||
import { getNeInfoByNF } from '@/api/ne/neAction';
|
||||
const { getDict } = useDictStore();
|
||||
const { t } = useI18n();
|
||||
const emit = defineEmits(['ok', 'cancel', 'update:open']);
|
||||
@@ -19,18 +18,14 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
coreUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neUid: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
neType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
/**字典数据 */
|
||||
@@ -210,8 +205,8 @@ function modalStateFromEqualIPV4AndIPV6(
|
||||
* @param coreUid 核心网ID
|
||||
* @param neUid 网元ID
|
||||
*/
|
||||
function fnModalVisibleByEdit(coreUid: string, neUid: string) {
|
||||
if (!coreUid || !neUid) {
|
||||
function fnModalVisibleByEdit(coreUid: string, id: number) {
|
||||
if (!coreUid || !id) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = t('views.ne.neInfo.addTitle');
|
||||
modalState.openByEdit = true;
|
||||
@@ -219,7 +214,7 @@ function fnModalVisibleByEdit(coreUid: string, neUid: string) {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getNeInfoByNF(coreUid, neUid).then(res => {
|
||||
getNeInfo(coreUid, id).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -334,7 +329,7 @@ function fnNeIPChange(e: any) {
|
||||
watch(
|
||||
() => props.open,
|
||||
val => {
|
||||
if (val) fnModalVisibleByEdit(props.coreUid, props.neUid);
|
||||
if (val) fnModalVisibleByEdit(props.coreUid, props.id);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -99,6 +99,12 @@ let tableState: TabeStateType = reactive({
|
||||
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: t('views.ne.common.neUid'),
|
||||
dataIndex: 'neUid',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.ne.common.neType'),
|
||||
dataIndex: 'neType',
|
||||
@@ -192,7 +198,7 @@ type ModalStateType = {
|
||||
/**新增框或修改框是否显示 */
|
||||
openByEdit: boolean;
|
||||
/**新增框或修改框ID */
|
||||
/**网元修改框 */
|
||||
id: number;
|
||||
coreUid: string;
|
||||
neUid: string;
|
||||
neType: string;
|
||||
@@ -205,6 +211,7 @@ let modalState: ModalStateType = reactive({
|
||||
openByBackConf: false,
|
||||
openByOAM: false,
|
||||
openByEdit: false,
|
||||
id: 0,
|
||||
coreUid: '',
|
||||
neUid: '',
|
||||
neType: '',
|
||||
@@ -217,10 +224,12 @@ let modalState: ModalStateType = reactive({
|
||||
*/
|
||||
function fnModalVisibleByEdit(row?: Record<string, any>) {
|
||||
if (!row) {
|
||||
modalState.id = 0;
|
||||
modalState.coreUid = '';
|
||||
modalState.neUid = '';
|
||||
modalState.neType = '';
|
||||
} else {
|
||||
modalState.id = row.id;
|
||||
modalState.coreUid = row.coreUid;
|
||||
modalState.neUid = row.neUid;
|
||||
modalState.neType = row.neType;
|
||||
@@ -295,7 +304,6 @@ function fnRecordDelete(id: string) {
|
||||
let msg = t('views.ne.neInfo.delTip');
|
||||
if (id === '0') {
|
||||
msg = `${msg} ...${tableState.selectedRowKeys.length}`;
|
||||
id = tableState.selectedRowKeys.join(',');
|
||||
}
|
||||
|
||||
Modal.confirm({
|
||||
@@ -743,8 +751,7 @@ onMounted(() => {
|
||||
<EditModal
|
||||
v-model:open="modalState.openByEdit"
|
||||
:core-uid="modalState.coreUid"
|
||||
:ne-uid="modalState.neUid"
|
||||
:ne-type="modalState.neType"
|
||||
:id="modalState.id"
|
||||
@ok="fnModalEditOk"
|
||||
@cancel="fnModalEditCancel"
|
||||
></EditModal>
|
||||
|
||||
Reference in New Issue
Block a user