diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt index 0c637b2..c643c81 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplVue.txt @@ -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; }); diff --git a/ZR.Vue/src/api/system/dict/data.js b/ZR.Vue/src/api/system/dict/data.js index fb9dfc0..0351dd6 100644 --- a/ZR.Vue/src/api/system/dict/data.js +++ b/ZR.Vue/src/api/system/dict/data.js @@ -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' + }) + } } // 新增字典数据 diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 4816400..9ccbc54 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -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