字典工具封装增加trim方法容错
This commit is contained in:
@ -56,7 +56,7 @@ const SupplierAnnualResult: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDictList('project_status ').then((res) => {
|
getDictList('project_status').then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setStatusOptions(res.data);
|
setStatusOptions(res.data);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ const SupplierAnnualReview: React.FC = () => {
|
|||||||
// 首次加载获取数据
|
// 首次加载获取数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchReviewList(pagination.current, pagination.pageSize, {});
|
fetchReviewList(pagination.current, pagination.pageSize, {});
|
||||||
getDictList('project_status ').then((res) => {
|
getDictList('project_status').then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setReviewStatus(res.data);
|
setReviewStatus(res.data);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ export async function getDictList(code: string): Promise<DictResponse> {
|
|||||||
const data: string | null = sessionStorage.getItem('dict');
|
const data: string | null = sessionStorage.getItem('dict');
|
||||||
if (data) {
|
if (data) {
|
||||||
const dictData = JSON.parse(data);
|
const dictData = JSON.parse(data);
|
||||||
const codeType = `${code}=supplier_manage_type`;
|
const codeType = `${code.trim()}=supplier_manage_type`;
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
code: 200,
|
code: 200,
|
||||||
data: dictData[codeType],
|
data: dictData[codeType],
|
||||||
|
Reference in New Issue
Block a user