This commit is contained in:
ln1778 2024-06-20 16:35:31 +08:00
parent 69e9f881da
commit c3126a8ec1
4 changed files with 10 additions and 22 deletions

View File

@ -426,11 +426,4 @@ export function batch_repair_ack(data) {
data
})
}
export function getDicts(dictType) {
return request({
url: '/api/sysdict/get_dict',
method: 'post',
data: {dict_code:Array.isArray(dictType)?dictType:[dictType]}
})
}

View File

@ -1,8 +1,7 @@
import Vue from 'vue'
import { mergeRecursive } from "./../utils/ruoyi";
import DictMeta from './DictMeta'
import DictData from './DictData'
import { getDicts as getDicts } from './../api/InventoryManagement';
import DictMeta from './DictMeta';
import DictData from './DictData';
import request from './../utils/request';
@ -176,15 +175,17 @@ export default class Dict {
return this.loadDict(this, dictMeta,this.apiurl)
}
getRequest(options) {
console.log(this.apiurl,"getRequest")
return request({
url: this.apiurl||"/api/sysdict/get_dict",
method: 'post',
data: {dict_code:Array.isArray(options)?options:[options]}
});
}
loadDict(dict, dictMeta,apiurl) {
loadDict(dict, dictMeta) {
console.log(this.apiurl,"getRequest")
return request({
url: apiurl||"/api/sysdict/get_dict",
url: this.apiurl||"/api/sysdict/get_dict",
method: 'post',
data: {dict_code:Array.isArray(dictMeta)?options:[dictMeta]}
}).then(response => {

View File

@ -14,9 +14,7 @@ import Tablepagination from "./commontable/tablepagination.vue";
import Tabletabs from "./commontable/tabletabs.vue";
import Configuration from "./commontable/configuration/index.vue";
import commont from "./commont";
import DataDict from './dict'
//查询字典的方法(获取数据的接口)
import { getDicts as getDicts } from './api/InventoryManagement';
import DataDict from './dict';
const componentarr = [
appTitle,
@ -48,11 +46,7 @@ const install = function (Vue) {
'*': {
//labelField 和 valueField 是用于指定数据字典项中标签和值的字段名
labelField: 'dictLabel',
valueField: 'dictValue',
//这个函数用来请求数据字典的数据,调用 getDicts() 函数,并使用传入的 dictMeta.type 来获取相应类型的数据字典
// request(dictMeta) {
// return getDicts(dictMeta.type).then(res => res.datas)
// },
valueField: 'dictValue',
},
},
})

View File

@ -1,6 +1,6 @@
{
"name": "erp-element-ui",
"version": "1.0.46",
"version": "1.0.47",
"description": "",
"main": "index.js",
"scripts": {