From a8854b4e71e38f851d8d140485a06c88891bc873 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 14 Nov 2023 17:14:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=AB=96=E5=90=91=E5=BD=A2=E5=BC=8F/?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/configManage/configParam.ts | 24 +- src/i18n/locales/en-US.ts | 25 +- src/i18n/locales/zh-CN.ts | 27 +- .../configManage/configParamForm/index.vue | 1718 ++++++++++ .../configParamTree copy/index.vue | 2932 ----------------- 5 files changed, 1774 insertions(+), 2952 deletions(-) create mode 100644 src/views/configManage/configParamForm/index.vue delete mode 100644 src/views/configManage/configParamTree copy/index.vue diff --git a/src/api/configManage/configParam.ts b/src/api/configManage/configParam.ts index d885f021..3a69d7e3 100644 --- a/src/api/configManage/configParam.ts +++ b/src/api/configManage/configParam.ts @@ -260,33 +260,27 @@ export async function getParamConfigInfoTable( } /** - * 查询配置参数标签栏对应信息-树结构处理 + * 查询配置参数标签栏对应信息-表单结构处理 * @param neType 网元类型 * @param topTag * @param neId * @returns object */ -export async function getParamConfigInfoTree( +export async function getParamConfigInfoForm( neType: string, topTag: string, neId: string ) { const { wrRule, dataArr } = await getParamConfigInfo(neType, topTag, neId); - type TreeNodeType = { - title: string; - key: string; - record: Record[]; - }; - // 拼装数据 const result = { code: RESULT_CODE_SUCCESS, msg: RESULT_MSG_SUCCESS, data: { type: 'list' as 'list' | 'array', - data: [] as TreeNodeType[], - recordRule: {}, + data: [] as Record[], + dataRule: {}, }, }; @@ -298,7 +292,7 @@ export async function getParamConfigInfoTree( // 列表项数据 const dataList = []; for (const item of dataArr) { - for (const key of Object.keys(item)) { + for (const key in item) { // 规则为准 for (const rule of ruleArr) { if (rule['name'] === key) { @@ -322,7 +316,7 @@ export async function getParamConfigInfoTree( for (const item of dataArr) { const index = item['index']; let record: Record[] = []; - for (const key of Object.keys(item)) { + for (const key in item) { // 规则为准 for (const rule of ruleArr) { if (rule['name'] === key) { @@ -339,11 +333,7 @@ export async function getParamConfigInfoTree( result.data.data = dataArray; // 无数据时,用于新增 - let dataRule: Record = {}; - for (const rule of ruleArr) { - dataRule[rule.name] = rule; - } - result.data.recordRule = dataRule; + result.data.dataRule = { title: `Index-0`, key: 0, record : [ruleArr]} ; } return result; } diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 9cdd566a..f9f18916 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -427,7 +427,30 @@ export default { editSure:'Are you sure you want to update this attribute value? ', arraryEdit:'Are you sure to submit the record whose updated Index is [{value}]? ', addSure:'Are you sure to submit the new record of Index: [{value}]? ' - } + }, + configParamForm: { + neType: 'NE Type', + neTypePleace: "Please select the network element type", + noConfigData: "No data on configuration items", + updateValue: "The value of the {num} attribute was modified successfully.", + updateValueErr: "Attribute value modification failure", + updateItem: "Modify Index to {num}.", + updateItemErr: "Record modification failure", + delItemOk: "Deleting Index as {num} succeeded", + addItemOk: "Add Index as {num} Record Succeeded", + addItemErr: "Record addition failure", + requireUn: "{display} input value is of unknown type", + requireString: "The {display} parameter value does not make sense.", + requireInt: "{display} Parameter value not in reasonable range {filter}", + requireIpv4: "{display} not a legitimate IPV4 address", + requireIpv6: "{display} Not a legitimate IPV6 address.", + requireEnum: "{display} is not a reasonable enumeration value.", + requireBool: "{display} is not a reasonable boolean value.", + editOkTip: "Confirm updating the value of this {num} attribute?", + updateItemTip: "Confirm updating the data item with Index [{num}]?", + delItemTip: "Confirm deleting the data item with Index [{num}]?", + arrayMore: "commence", + }, }, neUser: { auth: { diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 584062b3..c966ddb0 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -426,8 +426,31 @@ export default { post:'提交', editSure:'确认更新该属性值吗?', arraryEdit:'确认提交更新 Index 为 【{value}】 的记录吗?', - addSure:'确认提交新增 Index :【{value}】 的记录吗?' - } + addSure:'确认提交新增 Index :【{value}】 的记录吗?', + }, + configParamForm: { + neType: "网元类型", + neTypePleace: "请选择网元类型", + noConfigData: "暂无配置项数据", + updateValue: "{num} 属性值修改成功", + updateValueErr: "属性值修改失败", + updateItem: "修改 Index 为 {num} 记录成功", + updateItemErr: "记录修改失败", + delItemOk: "删除 Index 为 {num} 记录成功", + addItemOk: "新增 Index 为 {num} 记录成功", + addItemErr: "记录新增失败", + requireUn: "{display} 输入值是未知类型", + requireString: "{display} 参数值不合理", + requireInt: "{display} 参数值不在合理范围 {filter}", + requireIpv4: "{display} 不是合法的IPV4地址", + requireIpv6: "{display} 不是合法的IPV6地址", + requireEnum: "{display} 不是合理的枚举值", + requireBool: "{display} 不是合理的布尔类型的值", + editOkTip: "确认更新该{num}属性值吗?", + updateItemTip: "确认更新Index为 【{num}】 的数据项?", + delItemTip: "确认删除Index为 【{num}】 的数据项?", + arrayMore: "展开", + }, }, neUser: { auth: { diff --git a/src/views/configManage/configParamForm/index.vue b/src/views/configManage/configParamForm/index.vue new file mode 100644 index 00000000..ffed2960 --- /dev/null +++ b/src/views/configManage/configParamForm/index.vue @@ -0,0 +1,1718 @@ + + + + + diff --git a/src/views/configManage/configParamTree copy/index.vue b/src/views/configManage/configParamTree copy/index.vue deleted file mode 100644 index aeb27d58..00000000 --- a/src/views/configManage/configParamTree copy/index.vue +++ /dev/null @@ -1,2932 +0,0 @@ - - - - -