优化多个字典数据查询
This commit is contained in:
parent
f7edb87207
commit
f5fbcb54d7
@ -158,7 +158,7 @@ $end
|
||||
$end
|
||||
];
|
||||
$if(index > 0)
|
||||
this.getMoreDicts(dictParams).then((response) => {
|
||||
this.getDicts(dictParams).then((response) => {
|
||||
response.data.forEach((element) => {
|
||||
this[element.columnName] = element.list;
|
||||
});
|
||||
|
||||
@ -19,19 +19,18 @@ export function getData(dictCode) {
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts(dictType) {
|
||||
return request({
|
||||
url: '/system/dict/data/type/' + dictType,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据多个字典类型查询字典数据信息
|
||||
export function getMoreDicts(dictType) {
|
||||
return request({
|
||||
url: '/system/dict/data/types',
|
||||
data: dictType ,
|
||||
method: 'post'
|
||||
})
|
||||
if (typeof (dictType) === "object") {
|
||||
return request({
|
||||
url: '/system/dict/data/types',
|
||||
data: dictType,
|
||||
method: 'post'
|
||||
})
|
||||
} else {
|
||||
return request({
|
||||
url: '/system/dict/data/type/' + dictType,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 新增字典数据
|
||||
|
||||
@ -14,7 +14,7 @@ import permission from './directive/permission'
|
||||
|
||||
import './assets/icons' // icon
|
||||
import './permission' // permission control
|
||||
import { getDicts, getMoreDicts} from "@/api/system/dict/data";
|
||||
import { getDicts} from "@/api/system/dict/data";
|
||||
import { getConfigKey } from "@/api/system/config";
|
||||
import { parseTime, resetForm, addDateRange, addDateRange2, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
|
||||
//分页组件
|
||||
@ -34,7 +34,6 @@ import UploadFile from '@/components/FileUpload/index';
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getMoreDicts = getMoreDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.resetForm = resetForm
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user