erp-el-element/index.js

72 lines
2.3 KiB
JavaScript
Raw Normal View History

2024-05-06 14:57:20 +08:00
import appTitle from "./CommonInput/app-title.vue";
import Composite from "./CommonInput/Composite.vue";
import Compound from "./CommonInput/Compound.vue";
import ErpEchart from "./CommonInput/ErpEchart.vue";
import MoreClass from "./CommonInput/MoreClass.vue";
import MoreScreen from "./CommonInput/MoreScreen.vue";
import selectbtn from "./CommonInput/selectbtn.vue";
import TimingModule from "./CommonInput/TimingModule.vue";
2024-05-07 11:30:13 +08:00
import Options from "./commontable/options";
import Table from "./commontable/erpTable.vue";
import XyTable from "./commontable/xyTable.vue";
import YsTable from "./commontable/ysTable.vue";
import Tablepagination from "./commontable/tablepagination.vue";
import Tabletabs from "./commontable/tabletabs.vue";
2024-05-07 14:41:13 +08:00
import Configuration from "./commontable/configuration/index.vue";
2024-06-20 10:01:29 +08:00
import commont from "./commont";
2024-06-20 14:42:44 +08:00
import DataDict from './dict'
//查询字典的方法(获取数据的接口)
import { getDicts as getDicts } from './api/InventoryManagement';
2024-05-06 14:57:20 +08:00
const componentarr = [
appTitle,
Composite,
Compound,
ErpEchart,
MoreClass,
MoreScreen,
selectbtn,
TimingModule,
2024-05-07 11:30:13 +08:00
Options,
Table,
XyTable,
YsTable,
Tablepagination,
2024-05-07 14:41:13 +08:00
Tabletabs,
Configuration
2024-05-06 14:57:20 +08:00
];
const install = function (Vue) {
// 判断是否安装
if (install.installed) return;
install.installed = true;
// 遍历并注册全局组件
2024-06-20 14:42:44 +08:00
Vue.use(DataDict, {
//数据字典元信息
metas: {
//'*'表示这是一个通用配置,适用于所有数据字典
'*': {
//labelField 和 valueField 是用于指定数据字典项中标签和值的字段名
labelField: 'dictLabel',
valueField: 'dictValue',
//这个函数用来请求数据字典的数据,调用 getDicts() 函数,并使用传入的 dictMeta.type 来获取相应类型的数据字典
2024-06-20 15:06:31 +08:00
// request(dictMeta) {
// return getDicts(dictMeta.type).then(res => res.datas)
// },
2024-06-20 14:42:44 +08:00
},
},
})
2024-05-06 14:57:20 +08:00
componentarr.forEach((component) => Vue.component(component.name, component));
2024-06-20 10:01:29 +08:00
commont.forEach((f)=>Vue.prototype[Object.keys(f)[0]]=Object.values(f)[0])
2024-05-06 14:57:20 +08:00
};
// 判断是否是直接引入文件如果Vue是全局对象自动安装插件
if (typeof window !== "undefined" && window.Vue) {
install(window.Vue);
}
export default {
install,
2024-06-20 14:42:44 +08:00
...componentarr,
2024-05-06 15:09:08 +08:00
}