mooho-base-admin-plus 2.0.27 → 2.0.28

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.
@@ -6987,36 +6987,6 @@ const util$8 = {
6987
6987
  cookies: cookies$2,
6988
6988
  db: db$1
6989
6989
  };
6990
- function tTitle$1(title = "") {
6991
- const $t = window ? window.$app.$t : null;
6992
- if ($t) {
6993
- if (title.indexOf("$t:") === 0) {
6994
- return $t(title.split("$t:")[1]);
6995
- } else {
6996
- return title;
6997
- }
6998
- } else {
6999
- return title;
7000
- }
7001
- }
7002
- util$8.title = function({ title, count: count2 }) {
7003
- title = tTitle$1(title);
7004
- let fullTitle;
7005
- if (Setting.titleSuffix === false || Setting.titleSuffix === "") {
7006
- fullTitle = title ? `${title}` : "";
7007
- } else {
7008
- fullTitle = title ? `${title} - ${Setting.titleSuffix}` : Setting.titleSuffix;
7009
- }
7010
- if (count2)
7011
- fullTitle = `(${count2}\u6761\u6D88\u606F)${fullTitle}`;
7012
- window.document.title = fullTitle;
7013
- };
7014
- function requestAnimation(task) {
7015
- if ("requestAnimationFrame" in window) {
7016
- return window.requestAnimationFrame(task);
7017
- }
7018
- setTimeout(task, 16);
7019
- }
7020
6990
  /*!
7021
6991
  * vue-router v4.1.6
7022
6992
  * (c) 2022 Eduardo San Martin Morote
@@ -14828,9 +14798,6 @@ var cache$1 = {
14828
14798
  state.caches[type] = [];
14829
14799
  try {
14830
14800
  let res2 = await modelApi.query(type, {});
14831
- state.caches = {
14832
- ...state.caches
14833
- };
14834
14801
  state.caches[type] = res2.data;
14835
14802
  } catch (err) {
14836
14803
  delete state.caches[type];
@@ -14843,9 +14810,6 @@ var cache$1 = {
14843
14810
  state.dicts[type] = {};
14844
14811
  try {
14845
14812
  let res2 = await modelApi.query("Dict", { type });
14846
- state.dicts = {
14847
- ...state.dicts
14848
- };
14849
14813
  res2.data.forEach((item) => {
14850
14814
  state.dicts[type][item.id] = item.displayName;
14851
14815
  });
@@ -14860,9 +14824,6 @@ var cache$1 = {
14860
14824
  state.enums[type] = {};
14861
14825
  try {
14862
14826
  let res2 = await enumApi.query(type);
14863
- state.enums = {
14864
- ...state.enums
14865
- };
14866
14827
  res2.forEach((item) => {
14867
14828
  state.enums[type][item.id] = item.name;
14868
14829
  });
@@ -14874,13 +14835,10 @@ var cache$1 = {
14874
14835
  },
14875
14836
  async loadUserName({ state }, id) {
14876
14837
  if (id && !(id in state.userNames)) {
14877
- state.userNames[id] = {};
14838
+ state.userNames[id] = "-";
14878
14839
  try {
14879
14840
  let res2 = await userlApi.get(id);
14880
14841
  if (res2) {
14881
- state.userNames = {
14882
- ...state.userNames
14883
- };
14884
14842
  state.userNames[id] = res2.name;
14885
14843
  }
14886
14844
  } catch (err) {
@@ -21521,9 +21479,7 @@ var i18n = {
21521
21479
  } else {
21522
21480
  state.locale = locale2;
21523
21481
  vm.$i18n.locale = locale2;
21524
- util$8.title({
21525
- title: vm.$route.meta.title
21526
- });
21482
+ window.document.title = window.$app.$t(vm.$route.meta.title) + " - " + Setting.info.title;
21527
21483
  }
21528
21484
  },
21529
21485
  async load({ state }, app) {
@@ -22046,23 +22002,6 @@ var permissionApi = {
22046
22002
  saveAs(blob, "Permission-" + format$3(new Date(), "yyyyMMddHHmmss") + ".pms");
22047
22003
  }
22048
22004
  };
22049
- function filterMenu(menuList, access, lastList) {
22050
- menuList.forEach((menu2) => {
22051
- let menuAccess = menu2.auth;
22052
- if (!menuAccess || includeArray(menuAccess, access)) {
22053
- let newMenu = {};
22054
- for (let i3 in menu2) {
22055
- if (i3 !== "children")
22056
- newMenu[i3] = lodash$1.exports.cloneDeep(menu2[i3]);
22057
- }
22058
- if (menu2.children && menu2.children.length)
22059
- newMenu.children = [];
22060
- lastList.push(newMenu);
22061
- menu2.children && filterMenu(menu2.children, access, newMenu.children);
22062
- }
22063
- });
22064
- return lastList;
22065
- }
22066
22005
  function convertMenu(source2) {
22067
22006
  if (!source2) {
22068
22007
  return null;
@@ -22095,8 +22034,8 @@ var menu = {
22095
22034
  userPermissions: null
22096
22035
  },
22097
22036
  getters: {
22098
- filterSider(state, getters, rootState) {
22099
- return filterMenu(state.sider, [], []);
22037
+ filterSider(state) {
22038
+ return state.sider;
22100
22039
  },
22101
22040
  filterHeader(state, getters, rootState) {
22102
22041
  const userInfo = rootState.admin.user.info;
@@ -22287,7 +22226,7 @@ var menuSider = [
22287
22226
  dashboard,
22288
22227
  {
22289
22228
  path: "/i18n",
22290
- title: "$t:menu.i18n",
22229
+ title: "menu.i18n",
22291
22230
  header: "home",
22292
22231
  custom: "i-icon-demo i-icon-demo-i18n"
22293
22232
  }
@@ -22732,63 +22671,32 @@ var store = createStore({
22732
22671
  }
22733
22672
  });
22734
22673
  var dynamic = {
22735
- async init(router2, pages2, layout2) {
22674
+ async init(router2, pages2) {
22736
22675
  let res2 = await permissionApi.queryRouter();
22737
- res2.forEach((permission2) => {
22738
- if (permission2.isCustomPage) {
22739
- permission2.url += "?id=" + permission2.customPageID;
22740
- if (permission2.customPage.customPageTemplate) {
22741
- permission2.templateUrl = "template/" + permission2.customPage.customPageTemplate.substr(0, 1).toLowerCase() + permission2.customPage.customPageTemplate.substr(1) + ".vue";
22742
- }
22743
- }
22744
- });
22745
- let allPer = res2;
22746
- let topPer = allPer.filter((p) => p.parentID == null);
22747
- let routes = [
22748
- {
22749
- path: "/:pathMatch(.*)",
22750
- name: "404",
22751
- meta: {
22752
- title: "404"
22753
- },
22754
- component: () => {
22755
- return new Promise((resolve) => {
22756
- resolve(pages2["system/error/404.vue"]);
22757
- });
22758
- }
22759
- },
22760
- {
22761
- path: "/",
22762
- redirect: {
22763
- name: "login"
22764
- },
22765
- component: layout2,
22766
- children: []
22767
- }
22768
- ];
22769
- for (let i3 = 0; i3 < topPer.length; i3++) {
22770
- if (!(topPer[i3].templateUrl || "").trim()) {
22771
- topPer[i3] = PermissionDeep(topPer[i3], allPer);
22772
- } else {
22773
- let parent = routes.find((element) => {
22774
- return element.path === "/";
22775
- });
22776
- let item = topPer[i3];
22777
- let url = item.url.split("?")[0];
22778
- let data2 = {};
22779
- if (item.url.split("?").length > 1) {
22676
+ const root = router2.getRoutes().find((item) => item.path == "/");
22677
+ res2.forEach((item) => {
22678
+ var _a2;
22679
+ if (item.isCustomPage) {
22680
+ item.url += "?id=" + item.customPageID;
22681
+ if (item.customPage.customPageTemplate) {
22682
+ item.templateUrl = "template/" + item.customPage.customPageTemplate.substr(0, 1).toLowerCase() + item.customPage.customPageTemplate.substr(1) + ".vue";
22683
+ }
22684
+ }
22685
+ if (!!(item.templateUrl || "").trim()) {
22686
+ const path = ((_a2 = item.url) == null ? void 0 : _a2.split("?")[0]) || "";
22687
+ const name = path.replace(/\//g, "-");
22688
+ const data2 = {};
22689
+ if (item.url && item.url.split("?").length > 1) {
22780
22690
  item.url.split("?")[1].split("&").forEach((item2) => {
22781
22691
  if (item2.split("=").length > 1 && item2.split("=")[0].length > 0) {
22782
22692
  data2[item2.split("=")[0]] = item2.split("=")[1];
22783
22693
  }
22784
22694
  });
22785
22695
  }
22786
- let node = {
22787
- id: item.id,
22788
- path: url.split("/").pop(),
22789
- name: url.replace(/\//g, "-"),
22696
+ const child = {
22697
+ path,
22698
+ name,
22790
22699
  meta: {
22791
- auth: false,
22792
22700
  title: getNameI18n(item),
22793
22701
  description: getDescI18n(item),
22794
22702
  data: data2,
@@ -22800,95 +22708,25 @@ var dynamic = {
22800
22708
  });
22801
22709
  }
22802
22710
  };
22803
- parent.children.push(node);
22711
+ root.children.push(child);
22804
22712
  }
22805
- }
22806
- buildPermission(pages2, topPer, routes, layout2, null);
22807
- routes.forEach((route) => {
22808
- router2.addRoute(route);
22809
22713
  });
22810
- return routes;
22811
- }
22812
- };
22813
- function buildPermission(pages2, perArry, routes, layout2, parent) {
22814
- perArry.forEach((item) => {
22815
- let node;
22816
- if (item.parentID == null) {
22817
- if (!(item.templateUrl || "").trim()) {
22818
- node = {
22819
- id: item.id,
22820
- pId: item.parentID,
22821
- path: "/" + item.url.split("/").pop(),
22822
- name: item.url.replace("app.", "").replace(/\./g, "-"),
22823
- meta: {
22824
- auth: false
22825
- },
22826
- component: layout2
22827
- };
22828
- routes.push(node);
22829
- }
22830
- } else {
22831
- let url = item.url.split("?")[0];
22832
- let data2 = {};
22833
- if (item.url.split("?").length > 1) {
22834
- item.url.split("?")[1].split("&").forEach((item2) => {
22835
- if (item2.split("=").length > 1 && item2.split("=")[0].length > 0) {
22836
- data2[item2.split("=")[0]] = item2.split("=")[1];
22837
- }
22714
+ router2.removeRoute("root");
22715
+ router2.addRoute(root);
22716
+ router2.addRoute({
22717
+ path: "/:pathMatch(.*)",
22718
+ name: "404",
22719
+ meta: {
22720
+ title: "404"
22721
+ },
22722
+ component: () => {
22723
+ return new Promise((resolve) => {
22724
+ resolve(pages2["system/error/404.vue"]);
22838
22725
  });
22839
22726
  }
22840
- node = {
22841
- id: item.id,
22842
- pId: item.parentID,
22843
- path: url.split("/").pop(),
22844
- name: url.replace(/\//g, "-"),
22845
- meta: {
22846
- auth: false,
22847
- title: getNameI18n(item),
22848
- description: getDescI18n(item),
22849
- data: data2,
22850
- cache: true
22851
- },
22852
- component: () => {
22853
- return new Promise((resolve) => {
22854
- resolve(pages2[item.templateUrl]);
22855
- });
22856
- }
22857
- };
22858
- if (parent == null) {
22859
- parent = routes.find((p) => p.id == item.parentID);
22860
- }
22861
- if (parent != void 0) {
22862
- if (parent.children == null) {
22863
- parent.children = [];
22864
- }
22865
- if (parent.pId != null) {
22866
- let backup = parent;
22867
- parent = routes.find((p) => p.id == parent.pId);
22868
- node.path = url.split("/").splice(1).join("/");
22869
- parent.children.push(node);
22870
- parent = backup;
22871
- } else {
22872
- parent.children.push(node);
22873
- }
22874
- }
22875
- }
22876
- if (item.sonPer != null) {
22877
- buildPermission(pages2, item.sonPer, routes, layout2, node);
22878
- }
22879
- });
22880
- return routes;
22881
- }
22882
- function PermissionDeep(per, perArry) {
22883
- let sonPerArry = perArry.filter((p) => p.parentID == per.id);
22884
- if (sonPerArry.length > 0) {
22885
- per["sonPer"] = sonPerArry;
22886
- for (let i3 = 0; i3 < sonPerArry.length; i3++) {
22887
- sonPerArry[i3] = PermissionDeep(sonPerArry[i3], perArry);
22888
- }
22727
+ });
22889
22728
  }
22890
- return per;
22891
- }
22729
+ };
22892
22730
  function getNameI18n(item) {
22893
22731
  if (Setting.layout.showI18n) {
22894
22732
  let key = "Permission_" + item.url.split("?")[0];
@@ -22931,9 +22769,8 @@ const initRouter = (pages2, layout2, routes) => {
22931
22769
  ViewUIPlus.LoadingBar.start();
22932
22770
  }
22933
22771
  if (!inited) {
22934
- let dynamicRoutes = await dynamic.init(router, pages2, layout2);
22935
- let frameInRoutes = router.getRoutes();
22936
- store.commit("admin/page/init", [...frameInRoutes, ...dynamicRoutes]);
22772
+ await dynamic.init(router, pages2);
22773
+ store.commit("admin/page/init", router.getRoutes());
22937
22774
  inited = true;
22938
22775
  next({
22939
22776
  ...to,
@@ -22963,9 +22800,7 @@ const initRouter = (pages2, layout2, routes) => {
22963
22800
  if (!("meta" in to) || to.meta && !("tabs" in to.meta) || to.meta && to.meta.tabs) {
22964
22801
  store.dispatch("admin/page/open", to);
22965
22802
  }
22966
- util$8.title({
22967
- title: to.meta.title
22968
- });
22803
+ window.document.title = window.$app.$t(to.meta.title) + " - " + Setting.info.title;
22969
22804
  window.scrollTo(0, 0);
22970
22805
  });
22971
22806
  };
@@ -52874,20 +52709,9 @@ var tabHide = {
52874
52709
  });
52875
52710
  }
52876
52711
  };
52877
- var tTitle = {
52878
- methods: {
52879
- tTitle(title) {
52880
- if (title && title.indexOf("$t:") === 0) {
52881
- return this.$t(title.split("$t:")[1]);
52882
- } else {
52883
- return title;
52884
- }
52885
- }
52886
- }
52887
- };
52888
52712
  const _sfc_main$k = {
52889
52713
  name: "iMenuHeadTitle",
52890
- mixins: [tTitle],
52714
+ mixins: [],
52891
52715
  props: {
52892
52716
  item: {
52893
52717
  type: Object,
@@ -52938,7 +52762,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
52938
52762
  src: $props.item.img
52939
52763
  }, null, 8, _hoisted_3$7)) : createCommentVNode("v-if", true)
52940
52764
  ])) : createCommentVNode("v-if", true),
52941
- createElementVNode("span", _hoisted_4$2, toDisplayString$1(_ctx.tTitle($props.item.title)), 1),
52765
+ createElementVNode("span", _hoisted_4$2, toDisplayString$1(_ctx.$t($props.item.title)), 1),
52942
52766
  $props.badge && $options.badgeData ? (openBlock(), createBlock(_component_Badge, mergeProps({
52943
52767
  key: 1,
52944
52768
  class: "i-layout-menu-head-badge"
@@ -53330,7 +53154,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
53330
53154
  default: withCtx(() => [
53331
53155
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.menu.children, (item, index2) => {
53332
53156
  return openBlock(), createElementBlock(Fragment, { key: index2 }, [
53333
- item.children === void 0 || !item.children.length ? (openBlock(), createBlock(_component_i_menu_side_item, {
53157
+ item.children == null || !item.children.length ? (openBlock(), createBlock(_component_i_menu_side_item, {
53334
53158
  key: 0,
53335
53159
  menu: item
53336
53160
  }, null, 8, ["menu"])) : (openBlock(), createBlock(_component_i_menu_side_submenu, {
@@ -53587,7 +53411,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
53587
53411
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filterSider, (item, index2) => {
53588
53412
  return openBlock(), createElementBlock(Fragment, null, [
53589
53413
  !_ctx.menuCollapse ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
53590
- item.children === void 0 || !item.children.length ? (openBlock(), createBlock(_component_i_menu_side_item, {
53414
+ item.children == null || !item.children.length ? (openBlock(), createBlock(_component_i_menu_side_item, {
53591
53415
  menu: item,
53592
53416
  key: index2
53593
53417
  }, null, 8, ["menu"])) : (openBlock(), createBlock(_component_i_menu_side_submenu, {
@@ -53595,7 +53419,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
53595
53419
  key: "submenu" + index2
53596
53420
  }, null, 8, ["menu"]))
53597
53421
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
53598
- item.children === void 0 || !item.children.length ? (openBlock(), createBlock(_component_Tooltip, {
53422
+ item.children == null || !item.children.length ? (openBlock(), createBlock(_component_Tooltip, {
53599
53423
  content: _ctx.layout.showI18n ? _ctx.$t("Permission_" + item.code) : item.title,
53600
53424
  placement: "right",
53601
53425
  key: index2,
@@ -55133,7 +54957,7 @@ function random$1(len2 = 32) {
55133
54957
  }
55134
54958
  const _sfc_main$2 = {
55135
54959
  name: "iTabs",
55136
- mixins: [tTitle],
54960
+ mixins: [],
55137
54961
  emits: ["on-reload"],
55138
54962
  computed: {
55139
54963
  ...mapState("admin/page", ["opened", "current"]),
@@ -55169,7 +54993,7 @@ const _sfc_main$2 = {
55169
54993
  methods: {
55170
54994
  ...mapActions("admin/page", ["close", "closeLeft", "closeRight", "closeOther", "closeAll", "updateOpened"]),
55171
54995
  tabLabel(h4, page2) {
55172
- const title = h4("span", this.tTitle(page2.meta ? page2.meta.title : "\u672A\u547D\u540D") || "\u672A\u547D\u540D");
54996
+ const title = h4("span", this.$t(page2.meta ? page2.meta.title : "\u672A\u547D\u540D") || "\u672A\u547D\u540D");
55173
54997
  let slot = [];
55174
54998
  if (this.showTabsIcon) {
55175
54999
  const fullPathWithoutQuery = page2.fullPath.indexOf("?") >= 0 ? page2.fullPath.split("?")[0] : page2.fullPath;
@@ -55561,7 +55385,7 @@ const _sfc_main = {
55561
55385
  const scrollTop = document.body.scrollTop + document.documentElement.scrollTop;
55562
55386
  if (!this.ticking) {
55563
55387
  this.ticking = true;
55564
- requestAnimation(() => {
55388
+ requestAnimationFrame(() => {
55565
55389
  if (this.oldScrollTop > scrollTop) {
55566
55390
  this.headerVisible = true;
55567
55391
  } else if (scrollTop > 300 && this.headerVisible) {
@@ -58556,11 +58380,11 @@ var Storage = function() {
58556
58380
  return Storage2;
58557
58381
  }();
58558
58382
  var Storage$1 = Storage;
58559
- var requestAnimationFrame;
58560
- requestAnimationFrame = env$1.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) {
58383
+ var requestAnimationFrame$1;
58384
+ requestAnimationFrame$1 = env$1.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) {
58561
58385
  return setTimeout(func, 16);
58562
58386
  };
58563
- var requestAnimationFrame$1 = requestAnimationFrame;
58387
+ var requestAnimationFrame$2 = requestAnimationFrame$1;
58564
58388
  var easingFuncs = {
58565
58389
  linear: function(k3) {
58566
58390
  return k3;
@@ -60637,11 +60461,11 @@ var Animation = function(_super) {
60637
60461
  this._running = true;
60638
60462
  function step() {
60639
60463
  if (self2._running) {
60640
- requestAnimationFrame$1(step);
60464
+ requestAnimationFrame$2(step);
60641
60465
  !self2._paused && self2.update();
60642
60466
  }
60643
60467
  }
60644
- requestAnimationFrame$1(step);
60468
+ requestAnimationFrame$2(step);
60645
60469
  };
60646
60470
  Animation2.prototype.start = function() {
60647
60471
  if (this._running) {
@@ -86686,7 +86510,7 @@ var CanvasPainter = function() {
86686
86510
  }
86687
86511
  if (!finished) {
86688
86512
  var self_1 = this;
86689
- requestAnimationFrame$1(function() {
86513
+ requestAnimationFrame$2(function() {
86690
86514
  self_1._paintList(list, prevList, paintAll, redrawId);
86691
86515
  });
86692
86516
  } else {