15 changed files with 5444 additions and 4211 deletions
File diff suppressed because it is too large
@ -0,0 +1,14 @@ |
|||
import { request } from '../axios'; |
|||
import { getCookie } from '@/utils'; |
|||
// 获取cookie
|
|||
const shuili = getCookie('Admin-Token'); |
|||
// 获取字典列表
|
|||
export function getDicts(dictType: string) { |
|||
return request({ |
|||
url: `/system/dict/data/type/${dictType}`, |
|||
method: "get", |
|||
headers: { |
|||
shuili: 'water ' + shuili |
|||
} |
|||
}); |
|||
} |
@ -0,0 +1,15 @@ |
|||
// 获取字典的dictLabel
|
|||
export const getDictLabel = (dictData: {dictLabel: string; dictValue: string}[], key: string) => { |
|||
if(dictData?.length && key){ |
|||
let resStr = '' |
|||
let keyArr = key.split(',') |
|||
for (let i = 0; i < keyArr.length; i++) { |
|||
const element = dictData.find(item => item.dictValue === keyArr[i]) |
|||
if(element){ |
|||
resStr += element.dictLabel + ',' |
|||
} |
|||
} |
|||
return resStr.slice(0, -1) |
|||
} |
|||
return '-' |
|||
} |
File diff suppressed because it is too large
Loading…
Reference in new issue