mooho-base-admin-plus 0.1.7 → 0.1.8

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": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "dotnetVersion": "1.3.97",
7
7
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 自动配置各类语言包
3
3
  * */
4
- import { merge } from 'lodash';
4
+ import * as lodash from 'lodash';
5
5
  import Setting from '../setting';
6
6
  //import { I18nList } from '../api/i18n';
7
7
 
@@ -95,7 +95,7 @@ export async function loadRemoteLocaleMessages(i18n) {
95
95
  const nativeMessages = loadNativeLocaleMessages();
96
96
  //const remoteMessages = await I18nList();
97
97
  const remoteMessages = [];
98
- const messages = merge({}, nativeMessages, remoteMessages);
98
+ const messages = lodash.merge({}, nativeMessages, remoteMessages);
99
99
  Object.keys(messages).forEach(key => {
100
100
  i18n.global.setLocaleMessage(key, messages[key]);
101
101
  });
@@ -19,7 +19,7 @@
19
19
  import iMenuHeadTitle from '../menu-head/title.vue';
20
20
  import { on, off } from 'view-ui-plus/src/utils/dom';
21
21
  import { findComponentUpward, getStyle } from 'view-ui-plus/src/utils/assist';
22
- import { throttle } from 'lodash';
22
+ import * as lodash from 'lodash';
23
23
  import Setting from '../../../setting';
24
24
 
25
25
  export default {
@@ -110,7 +110,7 @@
110
110
  }
111
111
  },
112
112
  mounted() {
113
- this.handleResize = throttle(this.handleCheckWidth, 100, { leading: false });
113
+ this.handleResize = lodash.throttle(this.handleCheckWidth, 100, { leading: false });
114
114
  on(window, 'resize', this.handleResize);
115
115
  this.handleGetWidth();
116
116
  this.handleCheckWidth();
@@ -50,7 +50,7 @@
50
50
 
51
51
  import { getAllSiderMenu } from '../../../libs/system';
52
52
 
53
- import { cloneDeep } from 'lodash';
53
+ import * as lodash from 'lodash';
54
54
  import random from '../../../libs/random_str';
55
55
 
56
56
  export default {
@@ -173,7 +173,7 @@
173
173
  }
174
174
  },
175
175
  handleDragDrop(name, newName, a, b) {
176
- let opened = cloneDeep(this.opened);
176
+ let opened = lodash.cloneDeep(this.opened);
177
177
  opened.splice(b, 1, ...opened.splice(a, 1, opened[b]));
178
178
  this.updateOpened({ opened });
179
179
  },
@@ -2,7 +2,7 @@
2
2
  * 系统内置方法集,正常情况下您不应该修改或移除此文件
3
3
  * */
4
4
 
5
- import { cloneDeep } from 'lodash';
5
+ import * as lodash from 'lodash';
6
6
  import Setting from '../../setting';
7
7
 
8
8
  /**
@@ -139,7 +139,7 @@ function flattenSiderMenu(menuList, newList) {
139
139
  menuList.forEach(menu => {
140
140
  let newMenu = {};
141
141
  for (let i in menu) {
142
- if (i !== 'children') newMenu[i] = cloneDeep(menu[i]);
142
+ if (i !== 'children') newMenu[i] = lodash.cloneDeep(menu[i]);
143
143
  }
144
144
  newList.push(newMenu);
145
145
  menu.children && flattenSiderMenu(menu.children, newList);
@@ -4,7 +4,7 @@
4
4
  * */
5
5
  import util from '../../../../libs/util';
6
6
  import router from '../../../../router';
7
- import { cloneDeep } from 'lodash';
7
+ import * as lodash from 'lodash';
8
8
 
9
9
  /**
10
10
  * @description 检查路径是否存在 不存在的话初始化
@@ -64,7 +64,7 @@ export default {
64
64
  get(context, { dbName = 'database', path = '', defaultValue = '', user = false }) {
65
65
  return new Promise(resolve => {
66
66
  resolve(
67
- cloneDeep(
67
+ lodash.cloneDeep(
68
68
  util.db
69
69
  .get(
70
70
  pathInit({
@@ -175,7 +175,7 @@ export default {
175
175
  path: `$page.${router.app.$route[basis]}.$data`,
176
176
  user,
177
177
  validator: () => false,
178
- defaultValue: cloneDeep(instance.$data)
178
+ defaultValue: lodash.cloneDeep(instance.$data)
179
179
  })
180
180
  )
181
181
  );
@@ -191,14 +191,14 @@ export default {
191
191
  pageGet(context, { instance, basis = 'fullPath', user = false }) {
192
192
  return new Promise(resolve => {
193
193
  resolve(
194
- cloneDeep(
194
+ lodash.cloneDeep(
195
195
  util.db
196
196
  .get(
197
197
  pathInit({
198
198
  dbName: 'database',
199
199
  path: `$page.${router.app.$route[basis]}.$data`,
200
200
  user,
201
- defaultValue: cloneDeep(instance.$data)
201
+ defaultValue: lodash.cloneDeep(instance.$data)
202
202
  })
203
203
  )
204
204
  .value()
@@ -1,5 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
- import { get } from 'lodash';
2
+ import * as lodash from 'lodash';
3
3
  import util from '../../../../libs/util';
4
4
 
5
5
  export default {
@@ -50,7 +50,7 @@ export default {
50
50
  // 当前的 token
51
51
  token: util.cookies.get('token'),
52
52
  // 当前地址
53
- url: get(window, 'location.href', ''),
53
+ url: lodash.get(window, 'location.href', ''),
54
54
  // 用户设置
55
55
  ...meta
56
56
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 菜单
3
3
  * */
4
- import { cloneDeep } from 'lodash';
4
+ import * as lodash from 'lodash';
5
5
  import {
6
6
  includeArray,
7
7
  setNativeMenuSider,
@@ -25,7 +25,7 @@ function filterMenu(menuList, access, lastList) {
25
25
  if (!menuAccess || includeArray(menuAccess, access)) {
26
26
  let newMenu = {};
27
27
  for (let i in menu) {
28
- if (i !== 'children') newMenu[i] = cloneDeep(menu[i]);
28
+ if (i !== 'children') newMenu[i] = lodash.cloneDeep(menu[i]);
29
29
  }
30
30
  if (menu.children && menu.children.length) newMenu.children = [];
31
31
 
@@ -214,7 +214,7 @@ export default {
214
214
  * @description 新增或修改某个侧边菜单的徽标
215
215
  * */
216
216
  setSiderMenuBadge(state, { path, badge }) {
217
- const siderMenuBadge = cloneDeep(state.siderMenuBadge);
217
+ const siderMenuBadge = lodash.cloneDeep(state.siderMenuBadge);
218
218
  const menuIndex = siderMenuBadge.findIndex(item => item.path === path);
219
219
  if (menuIndex >= 0) {
220
220
  siderMenuBadge[menuIndex] = badge;
@@ -240,7 +240,7 @@ export default {
240
240
  * @description 新增或修改某个顶栏菜单的徽标
241
241
  * */
242
242
  setHeaderMenuBadge(state, { path, badge }) {
243
- const headerMenuBadge = cloneDeep(state.headerMenuBadge);
243
+ const headerMenuBadge = lodash.cloneDeep(state.headerMenuBadge);
244
244
  const menuIndex = headerMenuBadge.findIndex(item => item.path === path);
245
245
  if (menuIndex >= 0) {
246
246
  headerMenuBadge[menuIndex] = badge;
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * 多标签页
3
3
  * */
4
- import { get, cloneDeep } from 'lodash';
4
+ import * as lodash from 'lodash';
5
5
  import router from '../../../../router';
6
6
  import Setting from '../../../../setting';
7
7
  import menuSider from '../../../../menu/sider';
8
8
  import { getAllSiderMenu, includeArray } from '../../../../libs/system';
9
9
 
10
10
  // 判定是否需要缓存
11
- const isKeepAlive = data => get(data, 'meta.cache', false);
11
+ const isKeepAlive = data => lodash.get(data, 'meta.cache', false);
12
12
 
13
13
  export default {
14
14
  namespaced: true,
@@ -75,7 +75,7 @@ export default {
75
75
  if (find && find.auth) {
76
76
  const userInfo = rootState.admin.user.info;
77
77
  // @权限
78
- const access = cloneDeep(userInfo.access);
78
+ const access = lodash.cloneDeep(userInfo.access);
79
79
  // 给 access 强制加一个 hidden 的权限,否则菜单隐藏后,Tabs 页签会不显示该页签
80
80
  access.push('hidden');
81
81
  // 如果用户当前的权限,不是该 menu 对应的 权限,则过滤这个 Tab