reven: 还愿网元配置
This commit is contained in:
@@ -4,20 +4,19 @@ import {
|
|||||||
editNeConfigData,
|
editNeConfigData,
|
||||||
} from '@/api/ne/neConfig';
|
} from '@/api/ne/neConfig';
|
||||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||||
import { Modal, message } from 'ant-design-vue/es';
|
import { Modal,message } from 'ant-design-vue/es';
|
||||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||||
import { reactive, watch } from 'vue';
|
import { reactive, watch } from 'vue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置array类型
|
* 参数配置array类型
|
||||||
* @param param 父级传入 { t, treeState, neTypeSelect, neIdSelect, fnActiveConfigNode, ruleVerification, modalState, fnModalCancel}
|
* @param param 父级传入 { t, treeState, neTypeSelect, fnActiveConfigNode, ruleVerification, modalState, fnModalCancel}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export default function useConfigArray({
|
export default function useConfigArray({
|
||||||
t,
|
t,
|
||||||
treeState,
|
treeState,
|
||||||
neTypeSelect,
|
neTypeSelect,
|
||||||
neIdSelect,
|
|
||||||
fnActiveConfigNode,
|
fnActiveConfigNode,
|
||||||
ruleVerification,
|
ruleVerification,
|
||||||
modalState,
|
modalState,
|
||||||
@@ -131,61 +130,29 @@ export default function useConfigArray({
|
|||||||
data[key] = from[key]['value'];
|
data[key] = from[key]['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 发送
|
||||||
const reqArr = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
for (const neId of neIdSelect.value) {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neId,
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc: loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc: loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
Promise.allSettled(reqArr)
|
editNeConfigData({
|
||||||
.then(resArr => {
|
neType: neTypeSelect.value[0],
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
neId: neTypeSelect.value[1],
|
||||||
if (rejected) {
|
paramName: treeState.selectNode.paramName,
|
||||||
message.warning({
|
paramData: data,
|
||||||
content: t('views.ne.neConfig.updateItemErr'),
|
loc: loc,
|
||||||
duration: 3,
|
})
|
||||||
});
|
.then(res => {
|
||||||
} else {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('views.ne.neConfig.updateItem', {
|
content: t('views.ne.neConfig.updateItem', {
|
||||||
num: modalState.title,
|
num: modalState.title,
|
||||||
}),
|
}),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.ne.neConfig.updateItemErr'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -205,65 +172,28 @@ export default function useConfigArray({
|
|||||||
num: title,
|
num: title,
|
||||||
}),
|
}),
|
||||||
onOk() {
|
onOk() {
|
||||||
// 请求
|
delNeConfigData({
|
||||||
const reqArr = [];
|
neType: neTypeSelect.value[0],
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
neId: neTypeSelect.value[1],
|
||||||
for (const neId of neIdSelect.value) {
|
paramName: treeState.selectNode.paramName,
|
||||||
reqArr.push(
|
loc: loc,
|
||||||
delNeConfigData({
|
}).then(res => {
|
||||||
neType: neTypeSelect.value[0],
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
neId: neId,
|
message.success({
|
||||||
paramName: treeState.selectNode.paramName,
|
content: t('views.ne.neConfig.delItemOk', {
|
||||||
loc: loc,
|
num: title,
|
||||||
})
|
}),
|
||||||
);
|
duration: 2,
|
||||||
}
|
});
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
delNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
loc: loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
|
||||||
Promise.allSettled(reqArr)
|
|
||||||
.then(resArr => {
|
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
|
||||||
if (rejected) {
|
|
||||||
message.error({
|
|
||||||
content: `${rejected.reason}`,
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.success({
|
|
||||||
content: t('views.ne.neConfig.delItemOk', {
|
|
||||||
num: title,
|
|
||||||
}),
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hide();
|
|
||||||
arrayEditClose();
|
arrayEditClose();
|
||||||
});
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -334,61 +264,29 @@ export default function useConfigArray({
|
|||||||
data[key] = from[key]['value'];
|
data[key] = from[key]['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 发送
|
||||||
const reqArr = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
for (const neId of neIdSelect.value) {
|
|
||||||
reqArr.push(
|
|
||||||
addNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neId,
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc: `${from['index']['value']}`,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
addNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc: `${from['index']['value']}`,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
Promise.allSettled(reqArr)
|
addNeConfigData({
|
||||||
.then(resArr => {
|
neType: neTypeSelect.value[0],
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
neId: neTypeSelect.value[1],
|
||||||
if (rejected) {
|
paramName: treeState.selectNode.paramName,
|
||||||
message.warning({
|
paramData: data,
|
||||||
content: t('views.ne.neConfig.addItemErr'),
|
loc: `${from['index']['value']}`,
|
||||||
duration: 3,
|
})
|
||||||
});
|
.then(res => {
|
||||||
} else {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('views.ne.neConfig.addItemOk', {
|
content: t('views.ne.neConfig.addItemOk', {
|
||||||
num: modalState.title,
|
num: modalState.title,
|
||||||
}),
|
}),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.ne.neConfig.addItemErr'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -10,14 +10,13 @@ import { nextTick, reactive } from 'vue';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数配置array类型的嵌套array
|
* 参数配置array类型的嵌套array
|
||||||
* @param param 父级传入 { t, treeState, neTypeSelect, neIdSelect, fnActiveConfigNode, ruleVerification, modalState, arrayState, arrayInitEdit, arrayInitAdd, arrayEditClose}
|
* @param param 父级传入 { t, treeState, neTypeSelect, fnActiveConfigNode, ruleVerification, modalState, arrayState, arrayInitEdit, arrayInitAdd, arrayEditClose}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export default function useConfigArrayChild({
|
export default function useConfigArrayChild({
|
||||||
t,
|
t,
|
||||||
treeState,
|
treeState,
|
||||||
neTypeSelect,
|
neTypeSelect,
|
||||||
neIdSelect,
|
|
||||||
fnActiveConfigNode,
|
fnActiveConfigNode,
|
||||||
ruleVerification,
|
ruleVerification,
|
||||||
modalState,
|
modalState,
|
||||||
@@ -199,61 +198,29 @@ export default function useConfigArrayChild({
|
|||||||
data[key] = from[key]['value'];
|
data[key] = from[key]['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 发送
|
||||||
const reqArr = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
for (const neId of neIdSelect.value) {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neId,
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
Promise.allSettled(reqArr)
|
editNeConfigData({
|
||||||
.then(resArr => {
|
neType: neTypeSelect.value[0],
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
neId: neTypeSelect.value[1],
|
||||||
if (rejected) {
|
paramName: treeState.selectNode.paramName,
|
||||||
message.warning({
|
paramData: data,
|
||||||
content: t('views.ne.neConfig.updateItemErr'),
|
loc,
|
||||||
duration: 3,
|
})
|
||||||
});
|
.then(res => {
|
||||||
} else {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('views.ne.neConfig.updateItem', {
|
content: t('views.ne.neConfig.updateItem', {
|
||||||
num: modalState.title,
|
num: modalState.title,
|
||||||
}),
|
}),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.ne.neConfig.updateItemErr'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -274,65 +241,28 @@ export default function useConfigArrayChild({
|
|||||||
num: title,
|
num: title,
|
||||||
}),
|
}),
|
||||||
onOk() {
|
onOk() {
|
||||||
// 请求
|
delNeConfigData({
|
||||||
const reqArr = [];
|
neType: neTypeSelect.value[0],
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
neId: neTypeSelect.value[1],
|
||||||
for (const neId of neIdSelect.value) {
|
paramName: treeState.selectNode.paramName,
|
||||||
reqArr.push(
|
loc,
|
||||||
delNeConfigData({
|
}).then(res => {
|
||||||
neType: neTypeSelect.value[0],
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
neId: neId,
|
message.success({
|
||||||
paramName: treeState.selectNode.paramName,
|
content: t('views.ne.neConfig.delItemOk', {
|
||||||
loc,
|
num: title,
|
||||||
})
|
}),
|
||||||
);
|
duration: 2,
|
||||||
}
|
});
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
delNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
|
||||||
Promise.allSettled(reqArr)
|
|
||||||
.then(resArr => {
|
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
|
||||||
if (rejected) {
|
|
||||||
message.error({
|
|
||||||
content: `${rejected.reason}`,
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.success({
|
|
||||||
content: t('views.ne.neConfig.delItemOk', {
|
|
||||||
num: title,
|
|
||||||
}),
|
|
||||||
duration: 2,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hide();
|
|
||||||
arrayEditClose();
|
arrayEditClose();
|
||||||
});
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.error({
|
||||||
|
content: `${res.msg}`,
|
||||||
|
duration: 2,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -379,61 +309,29 @@ export default function useConfigArrayChild({
|
|||||||
data[key] = from[key]['value'];
|
data[key] = from[key]['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 发送
|
||||||
const reqArr = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
for (const neId of neIdSelect.value) {
|
|
||||||
reqArr.push(
|
|
||||||
addNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neId,
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
addNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: data,
|
|
||||||
loc,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
arrayEditClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
Promise.allSettled(reqArr)
|
addNeConfigData({
|
||||||
.then(resArr => {
|
neType: neTypeSelect.value[0],
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
neId: neTypeSelect.value[1],
|
||||||
if (rejected) {
|
paramName: treeState.selectNode.paramName,
|
||||||
message.warning({
|
paramData: data,
|
||||||
content: t('views.ne.neConfig.addItemErr'),
|
loc,
|
||||||
duration: 3,
|
})
|
||||||
});
|
.then(res => {
|
||||||
} else {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('views.ne.neConfig.addItemOk', {
|
content: t('views.ne.neConfig.addItemOk', {
|
||||||
num: modalState.title,
|
num: modalState.title,
|
||||||
}),
|
}),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
fnActiveConfigNode('#');
|
fnActiveConfigNode('#');
|
||||||
|
} else {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.ne.neConfig.addItemErr'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ import { reactive, toRaw } from 'vue';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* list类型参数处理
|
* list类型参数处理
|
||||||
* @param param 父级传入 {t, treeState, neTypeSelect, neIdSelect, ruleVerification}
|
* @param param 父级传入 {t, treeState, neTypeSelect, ruleVerification}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export default function useConfigList({
|
export default function useConfigList({
|
||||||
t,
|
t,
|
||||||
treeState,
|
treeState,
|
||||||
neTypeSelect,
|
neTypeSelect,
|
||||||
neIdSelect,
|
|
||||||
ruleVerification,
|
ruleVerification,
|
||||||
}: any) {
|
}: any) {
|
||||||
/**单列表状态类型 */
|
/**单列表状态类型 */
|
||||||
@@ -84,64 +83,25 @@ export default function useConfigList({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求
|
// 发送
|
||||||
const reqArr = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
for (const neId of neIdSelect.value) {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neId,
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: {
|
|
||||||
[from['name']]: from['value'],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
reqArr.push(
|
|
||||||
editNeConfigData({
|
|
||||||
neType: neTypeSelect.value[0],
|
|
||||||
neId: neTypeSelect.value[1],
|
|
||||||
paramName: treeState.selectNode.paramName,
|
|
||||||
paramData: {
|
|
||||||
[from['name']]: from['value'],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// 无请求提示
|
|
||||||
if (reqArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neIdSyncPleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
listState.confirmLoading = false;
|
|
||||||
listState.editRecord = {};
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
listState.confirmLoading = true;
|
listState.confirmLoading = true;
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
Promise.allSettled(reqArr)
|
editNeConfigData({
|
||||||
.then(resArr => {
|
neType: neTypeSelect.value[0],
|
||||||
const rejected = resArr.find(res => res.status === 'rejected');
|
neId: neTypeSelect.value[1],
|
||||||
if (rejected) {
|
paramName: treeState.selectNode.paramName,
|
||||||
message.warning({
|
paramData: {
|
||||||
content: t('views.ne.neConfig.updateValueErr'),
|
[from['name']]: from['value'],
|
||||||
duration: 3,
|
},
|
||||||
});
|
})
|
||||||
} else {
|
.then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
message.success({
|
message.success({
|
||||||
content: t('views.ne.neConfig.updateValue', {
|
content: t('views.ne.neConfig.updateValue', {
|
||||||
num: from['display'],
|
num: from['display'],
|
||||||
}),
|
}),
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
const fulfilled = resArr.find(res => res.status === 'fulfilled');
|
|
||||||
if (fulfilled) {
|
|
||||||
// 改变表格数据
|
// 改变表格数据
|
||||||
const item = listState.data.find(
|
const item = listState.data.find(
|
||||||
(item: Record<string, any>) => from['name'] === item['name']
|
(item: Record<string, any>) => from['name'] === item['name']
|
||||||
@@ -149,6 +109,11 @@ export default function useConfigList({
|
|||||||
if (item) {
|
if (item) {
|
||||||
Object.assign(item, listState.editRecord);
|
Object.assign(item, listState.editRecord);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.ne.neConfig.updateValueErr'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted, toRaw, watch, computed } from 'vue';
|
import { reactive, ref, onMounted, toRaw, watch } from 'vue';
|
||||||
import { PageContainer } from 'antdv-pro-layout';
|
import { PageContainer } from 'antdv-pro-layout';
|
||||||
import { ProModal } from 'antdv-pro-modal';
|
import { ProModal } from 'antdv-pro-modal';
|
||||||
import { message, TreeSelect, type TreeSelectProps } from 'ant-design-vue/es';
|
import { message } from 'ant-design-vue/es';
|
||||||
import { DataNode } from 'ant-design-vue/es/tree';
|
import { DataNode } from 'ant-design-vue/es/tree';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
|
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
|
||||||
@@ -19,104 +19,11 @@ const { ruleVerification, smfByUPFIdLoadData, smfByUPFIdOptions } = useOptions({
|
|||||||
t,
|
t,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**网元类型 type,[](type,id) */
|
/**网元类型_多neId */
|
||||||
let neCascaderOptions = ref<Record<string, any>[]>([]);
|
let neCascaderOptions = ref<Record<string, any>[]>([]);
|
||||||
/**网元类型 [](label,value,children) */
|
|
||||||
let neSelectTreeDate = ref<TreeSelectProps['treeData']>([]);
|
|
||||||
/**网元类型选择 type,id */
|
/**网元类型选择 type,id */
|
||||||
let neTypeSelect = ref<string[]>(['', '']);
|
let neTypeSelect = ref<string[]>(['', '']);
|
||||||
/**网元类型选择 id */
|
|
||||||
let neIdSelect = ref<string[]>([]);
|
|
||||||
let neTypeSelectStatus = ref(true);
|
|
||||||
/**网元类型neType选择 */
|
|
||||||
async function fnSelectNeType(_: any, info: any) {
|
|
||||||
if (!info) return;
|
|
||||||
await fnGetNeConfig(info.value);
|
|
||||||
if (treeState.data.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: `${t('views.ne.neConfig.noConfigData')}`,
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
treeState.selectLoading = true;
|
|
||||||
neIdSelect.value = [];
|
|
||||||
neSelectTreeDate.value = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
neTypeSelect.value[0] = info.value;
|
|
||||||
neTypeSelect.value[1] = 'SYNC';
|
|
||||||
treeState.selectLoading = true;
|
|
||||||
neTypeSelectStatus.value = true;
|
|
||||||
neIdSelect.value = [];
|
|
||||||
neSelectTreeDate.value = [];
|
|
||||||
// 构建可选树形数据
|
|
||||||
if (Array.isArray(info.children) && info.children.length > 0) {
|
|
||||||
const neArr = info.children.concat();
|
|
||||||
for (let index = 0; index < neArr.length; index++) {
|
|
||||||
const v = neArr[index];
|
|
||||||
const ne = {
|
|
||||||
label: v.neName,
|
|
||||||
value: v.neId,
|
|
||||||
disabled: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
// 检查下级网元是否可用
|
|
||||||
const res = await getNeConfigData({
|
|
||||||
neType: v.neType,
|
|
||||||
neId: v.neId,
|
|
||||||
paramName: `${treeState.data[0].key}`,
|
|
||||||
});
|
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
|
||||||
ne.disabled = !res.data.length;
|
|
||||||
} else {
|
|
||||||
ne.disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加到树形数据
|
|
||||||
const root = neSelectTreeDate.value?.find(s => s.label === v.province);
|
|
||||||
if (root && Array.isArray(root.children)) {
|
|
||||||
root.children.push(ne);
|
|
||||||
} else {
|
|
||||||
neSelectTreeDate.value?.push({
|
|
||||||
label: v.province,
|
|
||||||
value: 'SYNC_' + v.province,
|
|
||||||
children: [ne],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const key = 'SYNC_' + v.province;
|
|
||||||
// 初始区域
|
|
||||||
if (neIdSelect.value.length === 0) {
|
|
||||||
neTypeSelect.value[1] = key;
|
|
||||||
}
|
|
||||||
// 同区域内添加
|
|
||||||
if (neTypeSelect.value[1] === key) {
|
|
||||||
neIdSelect.value.push(v.neId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fnActiveConfigNode(treeState.data[0].key);
|
|
||||||
neTypeSelectStatus.value = false;
|
|
||||||
}
|
|
||||||
/**网元类型neId选择 */
|
|
||||||
function fnSelectNeId(_: any, info: any) {
|
|
||||||
if (info.children && Array.isArray(info.children)) {
|
|
||||||
const okArr = info.children.filter((item: any) => !item.disabled);
|
|
||||||
if (Array.isArray(okArr) && okArr.length === 0) {
|
|
||||||
message.warning({
|
|
||||||
content: `${t('views.ne.neConfig.noConfigdDisabled')}`,
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
neIdSelect.value = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
neTypeSelect.value[1] = info.value;
|
|
||||||
neIdSelect.value = okArr.map((item: any) => item.value);
|
|
||||||
} else {
|
|
||||||
neTypeSelect.value[1] = info.value;
|
|
||||||
}
|
|
||||||
fnActiveConfigNode(treeState.data[0].key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**左侧导航是否可收起 */
|
/**左侧导航是否可收起 */
|
||||||
let collapsible = ref<boolean>(true);
|
let collapsible = ref<boolean>(true);
|
||||||
@@ -142,7 +49,6 @@ type TreeStateType = {
|
|||||||
paramType: string;
|
paramType: string;
|
||||||
paramPerms: string[];
|
paramPerms: string[];
|
||||||
paramData: Record<string, any>[];
|
paramData: Record<string, any>[];
|
||||||
visible: string;
|
|
||||||
};
|
};
|
||||||
/**选择 loading */
|
/**选择 loading */
|
||||||
selectLoading: boolean;
|
selectLoading: boolean;
|
||||||
@@ -157,7 +63,6 @@ let treeState: TreeStateType = reactive({
|
|||||||
paramType: '',
|
paramType: '',
|
||||||
paramPerms: [],
|
paramPerms: [],
|
||||||
paramData: [],
|
paramData: [],
|
||||||
visible: 'public',
|
|
||||||
// 树形节点需要有
|
// 树形节点需要有
|
||||||
title: '',
|
title: '',
|
||||||
key: '',
|
key: '',
|
||||||
@@ -195,134 +100,22 @@ function fnActiveConfigNode(key: string | number) {
|
|||||||
}
|
}
|
||||||
treeState.selectNode = JSON.parse(JSON.stringify(param));
|
treeState.selectNode = JSON.parse(JSON.stringify(param));
|
||||||
|
|
||||||
let neId = neTypeSelect.value[1];
|
|
||||||
// 无neId时取首个可连接的
|
|
||||||
if (neId.startsWith('SYNC')) {
|
|
||||||
const oneNeId = neIdSelect.value[0];
|
|
||||||
if (oneNeId) {
|
|
||||||
neId = oneNeId;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取网元端的配置数据
|
// 获取网元端的配置数据
|
||||||
fnGetNeConfigData(neTypeSelect.value[0], neId, key);
|
getNeConfigData({
|
||||||
}
|
neType: neTypeSelect.value[0],
|
||||||
|
neId: neTypeSelect.value[1],
|
||||||
/**
|
paramName: key,
|
||||||
* 查询配置可选属性值列表
|
}).then(res => {
|
||||||
* neTypeSelect.value[0]
|
|
||||||
*/
|
|
||||||
async function fnGetNeConfig(neType: string) {
|
|
||||||
if (!neType) {
|
|
||||||
message.warning({
|
|
||||||
content: t('views.ne.neConfig.neTypePleace'),
|
|
||||||
duration: 3,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
treeState.loading = true;
|
|
||||||
// 获取数据
|
|
||||||
const res = await getAllNeConfig(neType);
|
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
|
||||||
const arr = [];
|
|
||||||
for (const v of res.data) {
|
|
||||||
const item = JSON.parse(JSON.stringify(v));
|
|
||||||
// 规则项
|
|
||||||
let paramData: Record<string, string>[] = [];
|
|
||||||
for (let index = 0; index < item.paramData.length; index++) {
|
|
||||||
const element = item.paramData[index];
|
|
||||||
if (!element['visible']) {
|
|
||||||
element['visible'] = 'public';
|
|
||||||
}
|
|
||||||
paramData.push(element);
|
|
||||||
}
|
|
||||||
// 权限控制
|
|
||||||
let paramPerms: string[] = [];
|
|
||||||
if (item.paramPerms) {
|
|
||||||
paramPerms = item.paramPerms.split(',');
|
|
||||||
} else {
|
|
||||||
paramPerms = ['post', 'put', 'delete'];
|
|
||||||
}
|
|
||||||
arr.push({
|
|
||||||
children: undefined,
|
|
||||||
title: item.paramDisplay,
|
|
||||||
key: item.paramName,
|
|
||||||
paramName: item.paramName,
|
|
||||||
paramDisplay: item.paramDisplay,
|
|
||||||
paramType: item.paramType,
|
|
||||||
paramPerms: paramPerms,
|
|
||||||
paramData: paramData,
|
|
||||||
visible: item.visible,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
treeState.data = arr;
|
|
||||||
treeState.loading = false;
|
|
||||||
} else {
|
|
||||||
treeState.data = [];
|
|
||||||
neTypeSelectStatus.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**过滤可见项 */
|
|
||||||
const treeStateData = computed(() => {
|
|
||||||
// 公共
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
return treeState.data.filter(item => item.visible === 'public');
|
|
||||||
}
|
|
||||||
// 具体网元
|
|
||||||
const arr: DataNode[] = [];
|
|
||||||
for (const item of treeState.data) {
|
|
||||||
if (item.visible === 'self') {
|
|
||||||
arr.push(item);
|
|
||||||
} else if (item.paramType === 'list') {
|
|
||||||
for (let index = 0; index < item.paramData.length; index++) {
|
|
||||||
const element = item.paramData[index];
|
|
||||||
if (element['visible'] === 'self') {
|
|
||||||
arr.push(item);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询配置属性值数据
|
|
||||||
* paramName = treeState.data[0].key
|
|
||||||
*/
|
|
||||||
function fnGetNeConfigData(
|
|
||||||
neType: string,
|
|
||||||
neId: string,
|
|
||||||
paramName: string | number
|
|
||||||
) {
|
|
||||||
const param = treeState.selectNode;
|
|
||||||
// 获取网元端的配置数据
|
|
||||||
getNeConfigData({ neType, neId, paramName }).then(res => {
|
|
||||||
// 数据处理
|
|
||||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
const ruleArr: Record<string, any>[] = JSON.parse(
|
const ruleArr = param.paramData;
|
||||||
JSON.stringify(param.paramData)
|
|
||||||
);
|
|
||||||
const dataArr = res.data;
|
const dataArr = res.data;
|
||||||
if (param.paramType === 'list') {
|
if (param.paramType === 'list') {
|
||||||
// 过滤可见规则项
|
|
||||||
let ruleArrFilter: Record<string, any>[] = [];
|
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
|
||||||
ruleArrFilter = ruleArr.filter(item => item['visible'] === 'public');
|
|
||||||
} else {
|
|
||||||
ruleArrFilter = ruleArr.filter(item => item['visible'] === 'self');
|
|
||||||
}
|
|
||||||
// 列表项数据
|
// 列表项数据
|
||||||
const dataList = [];
|
const dataList = [];
|
||||||
for (const item of dataArr) {
|
for (const item of dataArr) {
|
||||||
for (const key in item) {
|
for (const key in item) {
|
||||||
// 规则为准
|
// 规则为准
|
||||||
for (const rule of ruleArrFilter) {
|
for (const rule of ruleArr) {
|
||||||
// 取到对应规则key设置值
|
|
||||||
if (rule['name'] === key) {
|
if (rule['name'] === key) {
|
||||||
const ruleItem = Object.assign(rule, {
|
const ruleItem = Object.assign(rule, {
|
||||||
optional: 'true',
|
optional: 'true',
|
||||||
@@ -397,19 +190,64 @@ function fnGetNeConfigData(
|
|||||||
tablePagination.current = 1;
|
tablePagination.current = 1;
|
||||||
arrayEditClose();
|
arrayEditClose();
|
||||||
}
|
}
|
||||||
// 有数据关闭loading
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
treeState.selectLoading = false;
|
treeState.selectLoading = false;
|
||||||
}, 300);
|
}, 300);
|
||||||
} else {
|
} else {
|
||||||
message.warning({
|
message.warning({
|
||||||
content: `${param.paramDisplay} ${t('views.ne.neConfig.noConfigData')}`,
|
content: `${param.paramDisplay} ${t(
|
||||||
|
'views.configManage.configParamForm.noConfigData'
|
||||||
|
)}`,
|
||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**查询配置可选属性值列表 */
|
||||||
|
function fnGetNeConfig() {
|
||||||
|
const neType = neTypeSelect.value[0];
|
||||||
|
if (!neType) {
|
||||||
|
message.warning({
|
||||||
|
content: t('views.configManage.configParamForm.neTypePleace'),
|
||||||
|
duration: 3,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
treeState.loading = true;
|
||||||
|
// 获取数据
|
||||||
|
getAllNeConfig(neType).then(res => {
|
||||||
|
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||||
|
const arr = [];
|
||||||
|
for (const item of res.data) {
|
||||||
|
let paramPerms: string[] = [];
|
||||||
|
if (item.paramPerms) {
|
||||||
|
paramPerms = item.paramPerms.split(',');
|
||||||
|
} else {
|
||||||
|
paramPerms = ['post', 'put', 'delete'];
|
||||||
|
}
|
||||||
|
arr.push({
|
||||||
|
...item,
|
||||||
|
children: undefined,
|
||||||
|
title: item.paramDisplay,
|
||||||
|
key: item.paramName,
|
||||||
|
paramPerms,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
treeState.data = arr;
|
||||||
|
treeState.loading = false;
|
||||||
|
// 取首个tag
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
const item = JSON.parse(JSON.stringify(treeState.data[0]));
|
||||||
|
treeState.selectNode = item;
|
||||||
|
treeState.selectLoading = false;
|
||||||
|
fnActiveConfigNode(item.key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**对话框对象信息状态类型 */
|
/**对话框对象信息状态类型 */
|
||||||
type ModalStateType = {
|
type ModalStateType = {
|
||||||
/**添加框是否显示 */
|
/**添加框是否显示 */
|
||||||
@@ -477,18 +315,13 @@ watch(
|
|||||||
val => {
|
val => {
|
||||||
// SMF需要选择配置的UPF id
|
// SMF需要选择配置的UPF id
|
||||||
if (val && neTypeSelect.value[0] === 'SMF') {
|
if (val && neTypeSelect.value[0] === 'SMF') {
|
||||||
if (neTypeSelect.value[1].startsWith('SYNC')) {
|
smfByUPFIdLoadData(neTypeSelect.value[1]);
|
||||||
smfByUPFIdLoadData(neTypeSelect.value[1]);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
smfByUPFIdLoadData(neTypeSelect.value[1]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const { tablePagination, listState, listEdit, listEditClose, listEditOk } =
|
const { tablePagination, listState, listEdit, listEditClose, listEditOk } =
|
||||||
useConfigList({ t, treeState, neTypeSelect, neIdSelect, ruleVerification });
|
useConfigList({ t, treeState, neTypeSelect, ruleVerification });
|
||||||
|
|
||||||
const {
|
const {
|
||||||
arrayState,
|
arrayState,
|
||||||
@@ -504,7 +337,6 @@ const {
|
|||||||
t,
|
t,
|
||||||
treeState,
|
treeState,
|
||||||
neTypeSelect,
|
neTypeSelect,
|
||||||
neIdSelect,
|
|
||||||
fnActiveConfigNode,
|
fnActiveConfigNode,
|
||||||
ruleVerification,
|
ruleVerification,
|
||||||
modalState,
|
modalState,
|
||||||
@@ -523,7 +355,6 @@ const {
|
|||||||
t,
|
t,
|
||||||
treeState,
|
treeState,
|
||||||
neTypeSelect,
|
neTypeSelect,
|
||||||
neIdSelect,
|
|
||||||
fnActiveConfigNode,
|
fnActiveConfigNode,
|
||||||
ruleVerification,
|
ruleVerification,
|
||||||
modalState,
|
modalState,
|
||||||
@@ -554,14 +385,13 @@ onMounted(() => {
|
|||||||
// 默认选择AMF
|
// 默认选择AMF
|
||||||
const item = neCascaderOptions.value.find(s => s.value === 'AMF');
|
const item = neCascaderOptions.value.find(s => s.value === 'AMF');
|
||||||
if (item && item.children) {
|
if (item && item.children) {
|
||||||
fnSelectNeType(null, item);
|
const info = item.children[0];
|
||||||
// const info = item.children[0];
|
neTypeSelect.value = [info.neType, info.neId];
|
||||||
// neTypeSelect.value = [info.neType, info.neId];
|
|
||||||
} else {
|
} else {
|
||||||
fnSelectNeType(null, neCascaderOptions.value[0]);
|
const info = neCascaderOptions.value[0].children[0];
|
||||||
// const info = neCascaderOptions.value[0].children[0];
|
neTypeSelect.value = [info.neType, info.neId];
|
||||||
// neTypeSelect.value = [info.neType, info.neId];
|
|
||||||
}
|
}
|
||||||
|
fnGetNeConfig();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.warning({
|
message.warning({
|
||||||
@@ -586,43 +416,20 @@ onMounted(() => {
|
|||||||
<!-- 网元类型 -->
|
<!-- 网元类型 -->
|
||||||
<a-card size="small" :bordered="false" :loading="treeState.loading">
|
<a-card size="small" :bordered="false" :loading="treeState.loading">
|
||||||
<template #title>
|
<template #title>
|
||||||
{{ t('views.ne.neConfig.treeTitle') }}
|
{{ t('views.configManage.configParamForm.treeTitle') }}
|
||||||
</template>
|
</template>
|
||||||
<a-form layout="vertical" autocomplete="off">
|
<a-form layout="vertical" autocomplete="off">
|
||||||
<a-form-item name="neTypeSelect ">
|
<a-form-item name="neId ">
|
||||||
<a-input-group compact>
|
<a-cascader
|
||||||
<a-select
|
v-model:value="neTypeSelect"
|
||||||
:disabled="neTypeSelectStatus"
|
:options="neCascaderOptions"
|
||||||
:value="neTypeSelect[0]"
|
:allow-clear="false"
|
||||||
:options="neCascaderOptions"
|
@change="fnGetNeConfig"
|
||||||
:allow-clear="false"
|
/>
|
||||||
@change="fnSelectNeType"
|
|
||||||
style="width: 40%"
|
|
||||||
>
|
|
||||||
</a-select>
|
|
||||||
<a-tree-select
|
|
||||||
v-model:value="neTypeSelect[1]"
|
|
||||||
:status="neIdSelect.length === 0 ? 'warning' : ''"
|
|
||||||
:disabled="treeState.selectLoading"
|
|
||||||
:tree-data="neSelectTreeDate"
|
|
||||||
:maxTagCount="1"
|
|
||||||
:show-search="true"
|
|
||||||
:allow-clear="false"
|
|
||||||
:tree-default-expand-all="true"
|
|
||||||
:tree-checkable="false"
|
|
||||||
:show-checked-strategy="TreeSelect.SHOW_PARENT"
|
|
||||||
placement="bottomRight"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
style="width: 60%"
|
|
||||||
@select="fnSelectNeId"
|
|
||||||
>
|
|
||||||
</a-tree-select>
|
|
||||||
</a-input-group>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item name="treeStateData">
|
<a-form-item name="listeningPort">
|
||||||
<a-tree
|
<a-tree
|
||||||
:disabled="neTypeSelectStatus"
|
:tree-data="treeState.data"
|
||||||
:tree-data="treeStateData"
|
|
||||||
:selected-keys="[treeState.selectNode.paramName]"
|
:selected-keys="[treeState.selectNode.paramName]"
|
||||||
@select="fnSelectConfigNode"
|
@select="fnSelectConfigNode"
|
||||||
>
|
>
|
||||||
@@ -654,12 +461,12 @@ onMounted(() => {
|
|||||||
{{ treeState.selectNode.paramDisplay }}
|
{{ treeState.selectNode.paramDisplay }}
|
||||||
</a-typography-text>
|
</a-typography-text>
|
||||||
<a-typography-text type="danger" v-else>
|
<a-typography-text type="danger" v-else>
|
||||||
{{ t('views.ne.neConfig.treeSelectTip') }}
|
{{ t('views.configManage.configParamForm.treeSelectTip') }}
|
||||||
</a-typography-text>
|
</a-typography-text>
|
||||||
</template>
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-space :size="8" align="center" v-show="!treeState.selectLoading">
|
<a-space :size="8" align="center" v-show="!treeState.selectLoading">
|
||||||
<a-tooltip placement="topRight">
|
<a-tooltip>
|
||||||
<template #title>{{ t('common.reloadText') }}</template>
|
<template #title>{{ t('common.reloadText') }}</template>
|
||||||
<a-button
|
<a-button
|
||||||
type="default"
|
type="default"
|
||||||
@@ -742,9 +549,10 @@ onMounted(() => {
|
|||||||
<template #title> {{ t('common.ok') }} </template>
|
<template #title> {{ t('common.ok') }} </template>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="
|
:title="
|
||||||
t('views.ne.neConfig.editOkTip', {
|
t(
|
||||||
num: record['display'],
|
'views.configManage.configParamForm.editOkTip',
|
||||||
})
|
{ num: record['display'] }
|
||||||
|
)
|
||||||
"
|
"
|
||||||
placement="topRight"
|
placement="topRight"
|
||||||
:disabled="listState.confirmLoading"
|
:disabled="listState.confirmLoading"
|
||||||
@@ -802,7 +610,7 @@ onMounted(() => {
|
|||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
<!-- array类型 -->
|
<!-- array类型 -->
|
||||||
<template v-else-if="treeState.selectNode.paramType === 'array'">
|
<template v-if="treeState.selectNode.paramType === 'array'">
|
||||||
<a-table
|
<a-table
|
||||||
class="table"
|
class="table"
|
||||||
row-key="index"
|
row-key="index"
|
||||||
@@ -881,7 +689,9 @@ onMounted(() => {
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template #icon><BarsOutlined /></template>
|
<template #icon><BarsOutlined /></template>
|
||||||
{{ t('views.ne.neConfig.arrayMore') }}
|
{{
|
||||||
|
t('views.configManage.configParamForm.arrayMore')
|
||||||
|
}}
|
||||||
</a-button>
|
</a-button>
|
||||||
<!--特殊字段拓展显示-->
|
<!--特殊字段拓展显示-->
|
||||||
<span
|
<span
|
||||||
@@ -982,7 +792,11 @@ onMounted(() => {
|
|||||||
<template v-if="text.array">
|
<template v-if="text.array">
|
||||||
<a-button type="default" size="small">
|
<a-button type="default" size="small">
|
||||||
<template #icon><BarsOutlined /></template>
|
<template #icon><BarsOutlined /></template>
|
||||||
{{ t('views.ne.neConfig.arrayMore') }}
|
{{
|
||||||
|
t(
|
||||||
|
'views.configManage.configParamForm.arrayMore'
|
||||||
|
)
|
||||||
|
}}
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -1002,10 +816,6 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else>
|
|
||||||
<a-alert type="warning" show-icon message="No Data" />
|
|
||||||
</template>
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
Reference in New Issue
Block a user