获取字典表格选择器值回显文本方法 key 修改成与后台一致

This commit is contained in:
shih
2026-03-25 11:54:56 +08:00
parent eeb6f27d47
commit c5ff4c263f
4 changed files with 8 additions and 8 deletions

View File

@@ -118,7 +118,7 @@ const getTableData = async () => {
})
if (userIds.length) {
const dicRes = await DicApi.getDicTableText({
lideeYunji_dictLabel: encryptAES(JSON.stringify([{ userIdList: [...new Set(userIds)] }]))
lideeYunJi_dictLabel: encryptAES(JSON.stringify([{ userIdList: [...new Set(userIds)] }]))
})
if (dicRes?.userList) {
dicRes.userList.forEach((item) => (userObj[item.id] = item.nickname))

View File

@@ -624,7 +624,7 @@ export const formDataFormatting = (formOption, formData, formType) => {
}
if (dicApiData.length) {
DicApi.getDicTableText({
lideeYunji_dictLabel: encryptAES(JSON.stringify(dicApiData))
lideeYunJi_dictLabel: encryptAES(JSON.stringify(dicApiData))
}).then(dicData => {
const dictData = {
userList: { dicKey: 'userSelect', label: 'nickname' },

View File

@@ -24,7 +24,7 @@ export const setUserAndDeptName = (params) => {
userList: { dicKey: 'userSelect', label: 'nickname' },
deptList: { dicKey: 'deptSelect', label: 'name' }
}
getDicTableText({ lideeYunji_dictLabel: encryptAES(JSON.stringify(dictLabel)) }).then(
getDicTableText({ lideeYunJi_dictLabel: encryptAES(JSON.stringify(dictLabel)) }).then(
(dicData) => {
for (const key in dicData) {
const dicObj = {}

View File

@@ -886,7 +886,7 @@ export const tableFormatting = (data, column, otherData: any = {}) => {
})
//查询回显文本
const dicApiData: any = { lideeYunji_dictLabel: [] }
const dicApiData: any = { lideeYunJi_dictLabel: [] }
if (dicTableData.keyList.length) {
const dicTableApiData: Array<string> = []
dicTableData.keyList.forEach(key => {
@@ -899,17 +899,17 @@ export const tableFormatting = (data, column, otherData: any = {}) => {
dicTableData[key].dataList = [...new Set(dicTableData[key].dataList)].filter((id: string) => !lowStore.dicObj[key] ? true : !lowStore.dicObj[key][id])
if (dicTableData[key].dataList.length) dicTableApiData.push(dicTableData[key])
})
dicApiData.lideeYunji_dictLabel.push(...dicTableApiData)
dicApiData.lideeYunJi_dictLabel.push(...dicTableApiData)
}
for (const key in userAndDeptControl.typeKey) {
const abbr = userAndDeptControl.typeKey[key]
userAndDeptControl[`${abbr}Ids`] = userAndDeptControl[`${abbr}Ids`].filter(id => {
return /^(\d+)$/.test(id + '')
})
if (userAndDeptControl[`${abbr}Ids`].length) dicApiData.lideeYunji_dictLabel.push({ [`${abbr}IdList`]: [...new Set(userAndDeptControl[`${abbr}Ids`])] })
if (userAndDeptControl[`${abbr}Ids`].length) dicApiData.lideeYunJi_dictLabel.push({ [`${abbr}IdList`]: [...new Set(userAndDeptControl[`${abbr}Ids`])] })
}
if (dicApiData.lideeYunji_dictLabel.length) {
dicApiData.lideeYunji_dictLabel = encryptAES(JSON.stringify(dicApiData.lideeYunji_dictLabel))
if (dicApiData.lideeYunJi_dictLabel.length) {
dicApiData.lideeYunJi_dictLabel = encryptAES(JSON.stringify(dicApiData.lideeYunJi_dictLabel))
const dictData = {
userList: { dicKey: 'userSelect', label: 'nickname', value: 'id' },
deptList: { dicKey: 'deptSelect', label: 'name', value: 'id' }