@xysfe/admin-menu 2.4.0-beta.5 → 2.4.0-beta.7
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/dist/index.common.js +32 -9
- package/dist/index.common.js.map +1 -1
- package/dist/index.umd.js +32 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +2 -2
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -10823,7 +10823,7 @@ module.exports = DESCRIPTORS ? function (object, key, value) {
|
|
|
10823
10823
|
/***/ "9224":
|
|
10824
10824
|
/***/ (function(module) {
|
|
10825
10825
|
|
|
10826
|
-
module.exports = JSON.parse("{\"a\":\"2.4.0-beta.
|
|
10826
|
+
module.exports = JSON.parse("{\"a\":\"2.4.0-beta.7\"}");
|
|
10827
10827
|
|
|
10828
10828
|
/***/ }),
|
|
10829
10829
|
|
|
@@ -19739,7 +19739,7 @@ var state_createStore = function createStore() {
|
|
|
19739
19739
|
var getMenusByModule = function getMenusByModule() {
|
|
19740
19740
|
var module = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
19741
19741
|
var menuModule = module.filter(function (module) {
|
|
19742
|
-
return [1, 2].includes(Number(module.type));
|
|
19742
|
+
return [1, 2].includes(Number(module.type)) && ~~module.permit;
|
|
19743
19743
|
});
|
|
19744
19744
|
var menus = treeMenu(menuModule);
|
|
19745
19745
|
return menus;
|
|
@@ -19898,10 +19898,35 @@ var state_createStore = function createStore() {
|
|
|
19898
19898
|
return parseInt(item.wxDepartmentid) === parseInt(id);
|
|
19899
19899
|
}) !== -1;
|
|
19900
19900
|
};
|
|
19901
|
+
var createAuthDirective = function createAuthDirective() {
|
|
19902
|
+
return {
|
|
19903
|
+
name: 'auth',
|
|
19904
|
+
bind: function bind(el, _ref2) {
|
|
19905
|
+
var value = _ref2.value;
|
|
19906
|
+
if (el.style.display) {
|
|
19907
|
+
// 缓存本身的display
|
|
19908
|
+
el.dataset.display = el.style.display;
|
|
19909
|
+
}
|
|
19910
|
+
el.style.display = 'none';
|
|
19911
|
+
var isHas = auth(value);
|
|
19912
|
+
if (!isHas) {
|
|
19913
|
+
el.parentNode && el.parentNode.removeChild(el);
|
|
19914
|
+
} else {
|
|
19915
|
+
if (el.dataset.display) {
|
|
19916
|
+
// 还原原来的display
|
|
19917
|
+
el.style.display = el.dataset.display;
|
|
19918
|
+
} else {
|
|
19919
|
+
el.style.display = '';
|
|
19920
|
+
}
|
|
19921
|
+
}
|
|
19922
|
+
}
|
|
19923
|
+
};
|
|
19924
|
+
};
|
|
19901
19925
|
return {
|
|
19902
19926
|
handleRoute: handleRoute,
|
|
19903
19927
|
auth: auth,
|
|
19904
|
-
isInDepartment: isInDepartment
|
|
19928
|
+
isInDepartment: isInDepartment,
|
|
19929
|
+
createAuthDirective: createAuthDirective
|
|
19905
19930
|
};
|
|
19906
19931
|
});
|
|
19907
19932
|
// CONCATENATED MODULE: ./src/store/index.js
|
|
@@ -19916,7 +19941,6 @@ var common = __webpack_require__("7dd0");
|
|
|
19916
19941
|
|
|
19917
19942
|
|
|
19918
19943
|
|
|
19919
|
-
// import authDirective from './util/authDirective'
|
|
19920
19944
|
|
|
19921
19945
|
var baseOptions = {
|
|
19922
19946
|
router: null,
|
|
@@ -19933,18 +19957,17 @@ function usePlugin() {
|
|
|
19933
19957
|
var _usePermit = store_permit(options),
|
|
19934
19958
|
auth = _usePermit.auth,
|
|
19935
19959
|
handleRoute = _usePermit.handleRoute,
|
|
19936
|
-
isInDepartment = _usePermit.isInDepartment
|
|
19937
|
-
|
|
19938
|
-
|
|
19960
|
+
isInDepartment = _usePermit.isInDepartment,
|
|
19961
|
+
createAuthDirective = _usePermit.createAuthDirective;
|
|
19962
|
+
var authDirective = createAuthDirective();
|
|
19939
19963
|
Container.install = function (Vue) {
|
|
19940
19964
|
handleRoute();
|
|
19941
19965
|
Vue.component(Container.name, Container);
|
|
19942
|
-
|
|
19966
|
+
Vue.directive(authDirective.name, authDirective);
|
|
19943
19967
|
Vue.prototype.$auth = auth;
|
|
19944
19968
|
Vue.prototype.$isInDepartment = isInDepartment;
|
|
19945
19969
|
};
|
|
19946
19970
|
return {
|
|
19947
|
-
state: state,
|
|
19948
19971
|
AdminContainer: Container,
|
|
19949
19972
|
auth: auth,
|
|
19950
19973
|
isInDepartment: isInDepartment
|