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