mooho-base-admin-plus 2.4.35 → 2.4.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.4.35",
4
+ "version": "2.4.36",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
package/src/index.js CHANGED
@@ -36,26 +36,26 @@ import router, { initRouter } from './router';
36
36
  //import { getHeaderName, getMenuSider, getSiderSubmenu } from './libs/system';
37
37
 
38
38
  // 组件
39
- import Copyright from './components/copyright/index.vue';
40
- import Link from './components/link/index.vue';
41
- import RichEditor from './components/richEditor/index.vue';
42
- import DialogSelect from './components/input/dialog-select.vue';
43
- import ItemSelect from './components/input/item-select.vue';
44
- import AttachmentUpload from './components/upload/upload-attachment.vue';
45
- import ImageUpload from './components/upload/upload-image.vue';
46
- import FileUpload from './components/upload/file-upload.vue';
47
- import ViewForm from './components/view/view-form.vue';
48
- import ViewTable from './components/view/view-table.vue';
49
- import ViewChart from './components/view/view-chart.vue';
50
- import ModalForm from './components/view/modal-form.vue';
51
- import ModalTable from './components/view/modal-table.vue';
52
- import FormSetting from './components/view/form-setting.vue';
53
- import FormSettingLayout from './components/view/form-setting-layout.vue';
54
- import TableSetting from './components/view/table-setting.vue';
55
- import ModalFormFilter from './components/view/modal-form-filter.vue';
56
- import ModalFormSort from './components/view/modal-form-sort.vue';
57
- import Shortcut from './components/home/shortcut.vue';
58
- import NoticeList from './components/home/notice-list.vue';
39
+ // import Copyright from './components/copyright/index.vue';
40
+ // import Link from './components/link/index.vue';
41
+ // import RichEditor from './components/richEditor/index.vue';
42
+ // import DialogSelect from './components/input/dialog-select.vue';
43
+ // import ItemSelect from './components/input/item-select.vue';
44
+ // import AttachmentUpload from './components/upload/upload-attachment.vue';
45
+ // import ImageUpload from './components/upload/upload-image.vue';
46
+ // import FileUpload from './components/upload/file-upload.vue';
47
+ // import ViewForm from './components/view/view-form.vue';
48
+ // import ViewTable from './components/view/view-table.vue';
49
+ // import ViewChart from './components/view/view-chart.vue';
50
+ // import ModalForm from './components/view/modal-form.vue';
51
+ // import ModalTable from './components/view/modal-table.vue';
52
+ // import FormSetting from './components/view/form-setting.vue';
53
+ // import FormSettingLayout from './components/view/form-setting-layout.vue';
54
+ // import TableSetting from './components/view/table-setting.vue';
55
+ // import ModalFormFilter from './components/view/modal-form-filter.vue';
56
+ // import ModalFormSort from './components/view/modal-form-sort.vue';
57
+ // import Shortcut from './components/home/shortcut.vue';
58
+ // import NoticeList from './components/home/notice-list.vue';
59
59
 
60
60
  // API
61
61
  import modelApi from './api/model';
@@ -88,29 +88,6 @@ import * as echarts from 'echarts';
88
88
  import request from './libs/request';
89
89
  import util from './libs/util';
90
90
 
91
- const components = {
92
- Copyright,
93
- RichEditor,
94
- DialogSelect,
95
- ItemSelect,
96
- AttachmentUpload,
97
- ImageUpload,
98
- FileUpload,
99
- ViewForm,
100
- ViewTable,
101
- ViewChart,
102
- ModalForm,
103
- ModalTable,
104
- FormSetting,
105
- FormSettingLayout,
106
- TableSetting,
107
- ModalFormFilter,
108
- ModalFormSort,
109
- Shortcut,
110
- NoticeList,
111
- iLink: Link
112
- };
113
-
114
91
  const install = function (app) {
115
92
  if (install.installed) return;
116
93
 
@@ -158,7 +135,21 @@ Object.keys(files).forEach(key => {
158
135
  pages[key.replace(/(\.\/pages\/)/g, '')] = files[key].default;
159
136
  });
160
137
 
161
- const created = async (app, routes, files) => {
138
+ // 基础组件
139
+ const componentFiles = import.meta.globEager('./components/**/*.vue');
140
+ const components = {};
141
+
142
+ Object.keys(componentFiles).forEach(key => {
143
+ components[
144
+ key
145
+ .replace(/(\.\/pages\/)/g, '')
146
+ .split('/')
147
+ .pop()
148
+ .split('.')[0]
149
+ ] = componentFiles[key].default;
150
+ });
151
+
152
+ const created = async (app, routes, files, componentFiles) => {
162
153
  app.use(API);
163
154
 
164
155
  if (window) {
@@ -169,6 +160,25 @@ const created = async (app, routes, files) => {
169
160
  window.$app.$Notice = app.config.globalProperties.$Notice;
170
161
  }
171
162
 
163
+ // 覆盖组件
164
+ if (componentFiles) {
165
+ Object.keys(componentFiles).forEach(key => {
166
+ components[
167
+ key
168
+ .replace(/(\.\/pages\/)/g, '')
169
+ .split('/')
170
+ .pop()
171
+ .split('.')[0]
172
+ ] = componentFiles[key].default;
173
+ });
174
+ }
175
+
176
+ // 注册组件
177
+ Object.keys(components).forEach(key => {
178
+ app.component(key, components[key]);
179
+ });
180
+
181
+ // 页面
172
182
  Object.keys(files).forEach(key => {
173
183
  pages[key.replace(/(\.\/pages\/)/g, '')] = files[key].default;
174
184
  });