@varonervar/components
Version:
> 基于[Element-UI](https://element.eleme.cn/#/zh-CN/component/quickstart) 封装常用组件,部分组件参考[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
1,861 lines (1,604 loc) • 49.8 kB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/dist/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 26);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
function normalizeComponent(
scriptExports,
render,
staticRenderFns,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */,
shadowMode /* vue-cli only */
) {
// Vue.extend constructor export interop
var options =
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
// render functions
if (render) {
options.render = render
options.staticRenderFns = staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 'data-v-' + scopeId
}
var hook
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = shadowMode
? function () {
injectStyles.call(
this,
(options.functional ? this.parent : this).$root.$options.shadowRoot
)
}
: injectStyles
}
if (hook) {
if (options.functional) {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functional component in vue file
var originalRender = options.render
options.render = function renderWithStyleInjection(h, context) {
hook.call(context)
return originalRender(h, context)
}
} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
}
}
return {
exports: scriptExports,
options: options
}
}
/***/ }),
/***/ 1:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export typeCheck */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isExternal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return deepClone; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isFalse; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return changeRuleItems; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return editFormDateIsRange; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return editFormatIsArr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ajaxDataDispose; });
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__);
/**
* 检测数据类型
* @param {any} target 目标数据
*/
const typeCheck = target => Object.prototype.toString.call(target).slice(8, -1);
/**
* @param {string} path
* @returns {Boolean}
*/
function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path);
}
/**
* This is just a simple version of deep copy
* Has a lot of edge cases bug
* If you want to use a perfect deep copy, use lodash's _.cloneDeep
* @param {Object} source 源对象
* @returns {Object} 克隆对象
*/
function deepClone(source) {
if (!['Array', 'Object'].includes(typeCheck(source))) {
return source;
}
const targetObj = source.constructor();
Object.keys(source).forEach(keys => {
if (['Array', 'Object'].includes(typeCheck(source[keys]))) {
targetObj[keys] = deepClone(source[keys]);
} else {
targetObj[keys] = source[keys];
}
});
return targetObj;
} // 判断值是否不存在, 提交数据时,存在值为false或0的情况
const isFalse = data => {
return data == null || data === '';
}; // 业务函数:检查组件的rule用change还是blur
function changeRuleItems(type) {
return ['radio', 'select', 'datePicker', 'checkbox', 'cascader', 'timePicker'].includes(type);
} // 业务函数:检查时间是不是范围选择
function editFormDateIsRange(item) {
return item.template === 'datePicker' && ['daterange', 'datetimerange'].includes(item.type);
} // 业务函数:检查编辑组件的是否初始赋值数组
function editFormatIsArr(item) {
// 如果有指定是数组,则返回数组
if (item.valIsArr) return true;
const selectMul = item.template === 'select' && item.bind && item.bind.multiple;
const dateMul = editFormDateIsRange(item);
const timeMul = item.template === 'timePicker' && item.isRange;
return ['checkbox', 'cascader'].includes(item.template) || selectMul || dateMul || timeMul;
} // 业务函数:json数据处理, condition与form
function ajaxDataDispose(DATA) {
if (typeCheck(DATA) !== 'Object') return DATA;
const result = {};
Object.keys(DATA).forEach(key => {
if (key.includes(',')) {
const data = DATA[key] || [];
key.split(',').forEach((k, i) => {
result[k] = data[i];
});
} else {
result[key] = DATA[key];
}
});
return result;
}
/***/ }),
/***/ 17:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/ham-burger/body/index.vue?vue&type=template&id=63afec0b&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{
staticClass: "wl-hamburger",
staticStyle: { padding: "0 15px" },
on: { click: _vm.toggleClick },
},
[
_c(
"svg",
{
staticClass: "wl-hamburger__svg",
class: { "is-active": _vm.isActive },
attrs: {
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg",
width: "64",
height: "64",
},
},
[
_c("path", {
attrs: {
d: "M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z",
},
}),
]
),
]
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/ham-burger/body/index.vue?vue&type=template&id=63afec0b&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/ham-burger/body/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var bodyvue_type_script_lang_js_ = ({
name: 'HamBurger',
props: {
isActive: {
type: Boolean,
default: false
}
},
methods: {
toggleClick() {
this.$emit('toggleClick');
}
}
});
// CONCATENATED MODULE: ./packages/ham-burger/body/index.vue?vue&type=script&lang=js&
/* harmony default export */ var ham_burger_bodyvue_type_script_lang_js_ = (bodyvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./packages/ham-burger/body/index.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
ham_burger_bodyvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var body = (component.exports);
// CONCATENATED MODULE: ./packages/ham-burger/index.js
/* istanbul ignore next */
body.install = function install(Vue) {
Vue.component(body.name, body);
};
/* harmony default export */ var ham_burger = __webpack_exports__["default"] = (body);
/***/ }),
/***/ 18:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/svg-icon/body/index.vue?vue&type=template&id=cd051460&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _vm.isExternal
? _c(
"div",
_vm._g(
{
staticClass: "svg-external-icon wl-svg-icon",
style: _vm.styleExternalIcon,
},
_vm.$listeners
)
)
: _c(
"svg",
_vm._g(
{ class: _vm.svgClass, attrs: { "aria-hidden": "true" } },
_vm.$listeners
),
[_c("use", { attrs: { "xlink:href": _vm.iconName } })]
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/svg-icon/body/index.vue?vue&type=template&id=cd051460&
// EXTERNAL MODULE: ./src/utils/index.js
var utils = __webpack_require__(1);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/svg-icon/body/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage
/* harmony default export */ var bodyvue_type_script_lang_js_ = ({
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true
},
className: {
type: String,
default: ''
},
size: {
type: String,
default: '20px'
}
},
computed: {
isExternal(_ref) {
let {
iconClass
} = _ref;
return Object(utils["d" /* default */])(iconClass);
},
iconName(_ref2) {
let {
iconClass
} = _ref2;
return "#icon-".concat(iconClass);
},
svgClass(_ref3) {
let {
className
} = _ref3;
if (className) {
return "svg-icon ".concat(className);
}
return 'svg-icon';
},
styleExternalIcon(_ref4) {
let {
iconClass,
size
} = _ref4;
return {
fontSize: size,
mask: "url(".concat(iconClass, ") no-repeat 50% 50%"),
'-webkit-mask': "url(".concat(iconClass, ") no-repeat 50% 50%")
};
}
}
});
// CONCATENATED MODULE: ./packages/svg-icon/body/index.vue?vue&type=script&lang=js&
/* harmony default export */ var svg_icon_bodyvue_type_script_lang_js_ = (bodyvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./packages/svg-icon/body/index.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
svg_icon_bodyvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var body = (component.exports);
// CONCATENATED MODULE: ./packages/svg-icon/index.js
/* istanbul ignore next */
body.install = function install(Vue) {
Vue.component(body.name, body);
};
/* harmony default export */ var svg_icon = __webpack_exports__["default"] = (body);
/***/ }),
/***/ 19:
/***/ (function(module, exports) {
module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABC1BMVEUoKCgAAAApKSkrKysoKCgpKSkpKSkpKSknJycpKSn6+vrAwMDy8vInJycqKiopKSkkJCT9/f3r6+s5OTkoKCgoKCgoKCgqKionJyf4+Pji4uLf39+jo6MwMDDn5+fZ2dmwsLCKiop6enpqampgYGBTU1NLS0v19fXQ0NDMzMy7u7u0tLSVlZWDg4N9fX1xcXFCQkI1NTWOjo7u7u7b29vW1tbIyMi4uLilpaWPj4/T09PKyspaWlpMTEw5OTkuLi61tbWbm5vS0tLGxsbe3t6rq6uoqKiZmZmNjY3b29uGhoZ0dHTPz8/U1NRNTU3AwMDIyMjExMSsrKygoKCpqamYmJhcXFyIiIj////zQ87XAAAAWHRSTlPbANsUq4o+1qg3/vP8z49jB/77CcvAmmhh/fr47tz69/Dq5+Xj4eD99vXy8ezp6Obf3Vr7+Pf08u7q5+Li4N3cp2L29PLv7+zq6enm5eDg1tLOo5NoJRkPTY4kdQAAAnlJREFUSMeVl2dz4jAQhvcsMNgxvfdQQ4eQ3pPrvRf//19yvuHi7GtkCZ5vnvEz0qx2Vyt6JiVnlqKRQj4Wyxci0ZKZk/8lk0U5HiMgFi+LrWSraJAEo2hpZStOocQtpSySpCQpwmUzQRoSZpicMkiLkZLK6ShtRTS9KYsIbUlEBOU0uBo7HZADex50zkdVp5LJVJzqqN4ZBHaOcooYjVnLDdCaNYiR4rLJ43yddSVkr3nMzSdZ8POd264Ue87PW/gyz6s+uGD3ea49yhbfUM0NpUYM67/Ma6HrKujyKlnLFjH2VPJeYGlPLvJdH6jkAy4X/8nC4OFyldzwdYQnl4kxV8sdYpQ9GVrHVC1PCUJGOeh1r9Tya+iKOTIJg61kTByTSvA9Urp4Vp6KtXiyg+yp2ARqO8ieWoDv5g6yp+bhu7qD7Kl4Kz3fRY6h3D9Sy8eHIMO2l46rocbtPARs39VS5wGDo8rq5SY/KkiSik7Fko5Ceh7r5RZPTyiMtl5u88KAkjTGOvfMgJLEZtC7eBNuXrztYTPANuRhhIY8axBQXjdAoK4+YmyAXusFPmfkbmZAQNFv+pzzsIURy79uOA1pXVbvCIj7Fx3SszdduxdcmF2xQLcSdCtdQpJwuQM3LXRPBoQkBI4VyGKY8cM8XFAAw8SBZoPb07X74pY2SClGKWgN+5IhUD/ETUCGIU49Pi5nZ02/eYzbS3CFanC965wGU3T4/hAG17CRudGW1pUzbcDILB3WF0xFjj7AsC55JkxcBZONZwKyugp3Lx+0T6PVF0dm2p9+bvUo+/3jygmY7+5/qR5lSG71/dvHl45tO7XLr/cPf+R//QU4ErN5XnO4vQAAAABJRU5ErkJggg=="
/***/ }),
/***/ 26:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/index.vue?vue&type=template&id=54d12e50&
var render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{ staticClass: "wl-layout flex", class: _vm.classObj },
[
_c(
"aside",
{
staticClass: "wl-layout__aside",
style: { width: _vm.siderBarWidth + "px" },
},
[
_c(
"ZSidebar",
_vm._b(
{
staticClass: "wl-layout__sidebar-container",
attrs: {
isMinScreen: _vm.isMinScreen,
isCollapse: _vm.isCollapse,
},
},
"ZSidebar",
_vm.$props,
false
)
),
],
1
),
_c(
"div",
{ staticClass: "wl-layout__main-container flex1" },
[
_c(
"header",
{ staticClass: "wl-layout__header" },
[
_c(
"ZNavbar",
_vm._b(
{
attrs: { isCollapse: _vm.isCollapse },
on: { toggleClick: _vm.toggleSideBar, logout: _vm.logout },
},
"ZNavbar",
_vm.$props,
false
)
),
],
1
),
_c("app-main"),
],
1
),
_c("el-backtop", {
attrs: { target: ".wl-layout--app-main", right: 30, bottom: 30 },
}),
],
1
)
}
var staticRenderFns = []
render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/index.vue?vue&type=template&id=54d12e50&
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/AppMain.vue?vue&type=template&id=9859bb1a&
var AppMainvue_type_template_id_9859bb1a_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"section",
{ staticClass: "wl-layout--app-main" },
[
_c(
"transition",
{ attrs: { name: "fade-transform", mode: "out-in" } },
[
_c("keep-alive", [
_c("div", { staticClass: "wl-layout--wrapper" }, [
_c(
"div",
{ staticClass: "wl-layout--wrapper__div" },
[_c("router-view", { key: _vm.key })],
1
),
]),
]),
],
1
),
],
1
)
}
var AppMainvue_type_template_id_9859bb1a_staticRenderFns = []
AppMainvue_type_template_id_9859bb1a_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/AppMain.vue?vue&type=template&id=9859bb1a&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/AppMain.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var AppMainvue_type_script_lang_js_ = ({
name: 'AppMain',
computed: {
key() {
return this.$route.path;
}
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/AppMain.vue?vue&type=script&lang=js&
/* harmony default export */ var components_AppMainvue_type_script_lang_js_ = (AppMainvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/AppMain.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
components_AppMainvue_type_script_lang_js_,
AppMainvue_type_template_id_9859bb1a_render,
AppMainvue_type_template_id_9859bb1a_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var AppMain = (component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Navbar.vue?vue&type=template&id=06d0b2e4&
var Navbarvue_type_template_id_06d0b2e4_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "wl-navbar flex-sb-c" }, [
_c(
"div",
{ staticClass: "flex-align-center" },
[
_c(
"HamBurger",
_vm._g({ attrs: { "is-active": !_vm.isCollapse } }, _vm.$listeners)
),
_c("BreadCrumb"),
],
1
),
_c(
"div",
{ staticClass: "wl-navbar--right-menu flex-align-center" },
[
_c(
"el-avatar",
{
staticClass: "wl-navbar--avatar",
attrs: { size: 30, src: _vm.avatar },
},
[_c("img", { attrs: { src: _vm.avatarImg } })]
),
_c("span", [_vm._v(_vm._s(_vm.userName || "未登录"))]),
_c("i", {
staticClass: "el-icon-switch-button wl-navbar--logout",
attrs: { title: "退出" },
on: {
click: function ($event) {
return _vm.$emit("logout")
},
},
}),
],
1
),
])
}
var Navbarvue_type_template_id_06d0b2e4_staticRenderFns = []
Navbarvue_type_template_id_06d0b2e4_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Navbar.vue?vue&type=template&id=06d0b2e4&
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Breadcrumb/index.vue?vue&type=template&id=57121802&
var Breadcrumbvue_type_template_id_57121802_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"el-breadcrumb",
{
staticClass: "wlz-app-breadcrumb",
attrs: { "separator-class": "el-icon-arrow-right" },
},
[
_c(
"transition-group",
{ attrs: { name: "breadcrumb" } },
[
_vm._l(_vm.levelList, function (item, index) {
return [
item.title
? _c(
"el-breadcrumb-item",
{ key: item.path, staticClass: "bold" },
[
_c(
"span",
{
class: {
"no-redirect": index === _vm.levelList.length - 1,
},
},
[
_vm._v(
"\n " + _vm._s(item.title) + "\n "
),
]
),
]
)
: _vm._e(),
]
}),
],
2
),
],
1
)
}
var Breadcrumbvue_type_template_id_57121802_staticRenderFns = []
Breadcrumbvue_type_template_id_57121802_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Breadcrumb/index.vue?vue&type=template&id=57121802&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Breadcrumb/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Breadcrumbvue_type_script_lang_js_ = ({
name: 'BreadCrumb',
computed: {
levelList(_ref) {
let {
$route
} = _ref;
return $route.meta && $route.meta.matched || [];
}
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Breadcrumb/index.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Breadcrumbvue_type_script_lang_js_ = (Breadcrumbvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Breadcrumb/index.vue
/* normalize component */
var Breadcrumb_component = Object(componentNormalizer["a" /* default */])(
components_Breadcrumbvue_type_script_lang_js_,
Breadcrumbvue_type_template_id_57121802_render,
Breadcrumbvue_type_template_id_57121802_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Breadcrumb = (Breadcrumb_component.exports);
// EXTERNAL MODULE: ./packages/ham-burger/index.js + 5 modules
var ham_burger = __webpack_require__(17);
// EXTERNAL MODULE: ./packages/wlm-layout/body/components/avatar.png
var avatar = __webpack_require__(19);
var avatar_default = /*#__PURE__*/__webpack_require__.n(avatar);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Navbar.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Navbarvue_type_script_lang_js_ = ({
name: 'MenuNavbar',
inheritAttrs: false,
props: {
avatar: String,
userName: String,
// 是否收缩
isCollapse: {
type: Boolean,
default: false
}
},
data() {
return {
avatarImg: avatar_default.a
};
},
components: {
BreadCrumb: Breadcrumb,
HamBurger: ham_burger["default"]
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Navbar.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Navbarvue_type_script_lang_js_ = (Navbarvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Navbar.vue
/* normalize component */
var Navbar_component = Object(componentNormalizer["a" /* default */])(
components_Navbarvue_type_script_lang_js_,
Navbarvue_type_template_id_06d0b2e4_render,
Navbarvue_type_template_id_06d0b2e4_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Navbar = (Navbar_component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/index.vue?vue&type=template&id=5e3d30b2&
var Sidebarvue_type_template_id_5e3d30b2_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
[
_vm.showLogo
? _c("logo", {
attrs: {
collapse: _vm.isCollapse,
title: _vm.title,
logo: _vm.logo,
},
})
: _vm._e(),
_c(
"el-menu",
{
attrs: {
"default-active": _vm.activeMenu,
collapse: _vm.isCollapse,
"background-color": _vm.variables.menubg,
"text-color": _vm.variables.menutext,
"unique-opened": true,
"active-text-color": _vm.variables.menuActiveText,
"collapse-transition": false,
mode: "vertical",
},
},
_vm._l(_vm.menuList, function (route) {
return _c("sidebar-item", {
key: route.path,
attrs: {
"is-collapse": _vm.isCollapse,
root: true,
isCollapse: _vm.isCollapse,
isMinScreen: _vm.isMinScreen,
item: route,
},
})
}),
1
),
],
1
)
}
var Sidebarvue_type_template_id_5e3d30b2_staticRenderFns = []
Sidebarvue_type_template_id_5e3d30b2_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/index.vue?vue&type=template&id=5e3d30b2&
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/Logo.vue?vue&type=template&id=53d363a0&
var Logovue_type_template_id_53d363a0_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c(
"div",
{
staticClass: "okd-sidebar-logo-container",
class: { collapse: _vm.collapse },
},
[
_c(
"transition",
{ attrs: { name: "sidebarLogoFade" } },
[
_vm.collapse
? _c(
"router-link",
{
key: "collapse",
staticClass: "sidebar-logo-link",
attrs: { to: "/" },
},
[
_vm.logo
? _c("el-image", {
staticStyle: { width: "20px", height: "20px" },
attrs: { src: _vm.logo },
})
: _c("h1", { staticClass: "sidebar-title" }, [
_vm._v(_vm._s(_vm.title.slice(0, 2))),
]),
],
1
)
: _c(
"router-link",
{
key: "expand",
staticClass: "sidebar-logo-link flex-center",
attrs: { to: "/" },
},
[
_vm.logo
? _c("el-image", {
staticStyle: {
width: "20px",
height: "20px",
"margin-right": "10px",
},
attrs: { src: _vm.logo },
})
: _vm._e(),
_c("h1", { staticClass: "sidebar-title" }, [
_vm._v(_vm._s(_vm.title)),
]),
],
1
),
],
1
),
],
1
)
}
var Logovue_type_template_id_53d363a0_staticRenderFns = []
Logovue_type_template_id_53d363a0_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Logo.vue?vue&type=template&id=53d363a0&
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/Logo.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Logovue_type_script_lang_js_ = ({
name: 'SidebarLogo',
props: {
title: String,
logo: String,
collapse: {
type: Boolean,
required: true
}
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Logo.vue?vue&type=script&lang=js&
/* harmony default export */ var Sidebar_Logovue_type_script_lang_js_ = (Logovue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Logo.vue
/* normalize component */
var Logo_component = Object(componentNormalizer["a" /* default */])(
Sidebar_Logovue_type_script_lang_js_,
Logovue_type_template_id_53d363a0_render,
Logovue_type_template_id_53d363a0_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Logo = (Logo_component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/SidebarItem.vue?vue&type=template&id=4dc008ba&
var SidebarItemvue_type_template_id_4dc008ba_render = function () {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return !_vm.item.hidden
? _c(
"div",
[
!_vm.item.children
? [
_vm.item.meta
? _c(
"app-link",
{ attrs: { to: _vm.item.path } },
[
_c(
"el-menu-item",
{ attrs: { index: _vm.item.path } },
[
_vm.root && _vm.isCollapse
? _c("span", [
_vm._v(_vm._s(_vm.title.slice(0, 2))),
])
: _vm._e(),
_c("MenuItem", {
attrs: {
title: _vm.title,
icon: !_vm.isCollapse ? _vm.item.meta.icon : "",
},
}),
],
1
),
],
1
)
: _vm._e(),
]
: _c(
"el-submenu",
{
ref: "subMenu",
attrs: { index: _vm.item.path, "popper-append-to-body": "" },
scopedSlots: _vm._u(
[
{
key: "title",
fn: function () {
return [
_vm.root && _vm.isCollapse
? _c(
"span",
{
staticClass: "zz-just-first",
attrs: { slot: "title" },
slot: "title",
},
[_vm._v(_vm._s(_vm.title.slice(0, 2)))]
)
: _c("MenuItem", {
attrs: {
title: _vm.title,
icon: !_vm.isCollapse
? _vm.item.meta.icon
: "",
},
}),
]
},
proxy: true,
},
],
null,
false,
246311981
),
},
_vm._l(_vm.item.children, function (child) {
return _c("sidebar-item", {
key: child.path,
attrs: { root: false, item: child },
})
}),
1
),
],
2
)
: _vm._e()
}
var SidebarItemvue_type_template_id_4dc008ba_staticRenderFns = []
SidebarItemvue_type_template_id_4dc008ba_render._withStripped = true
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/SidebarItem.vue?vue&type=template&id=4dc008ba&
// EXTERNAL MODULE: ./packages/svg-icon/index.js + 5 modules
var svg_icon = __webpack_require__(18);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/Item.vue?vue&type=script&lang=js&
/* harmony default export */ var Itemvue_type_script_lang_js_ = ({
name: 'MenuItem',
functional: true,
props: {
icon: {
type: String,
default: ''
},
title: {
type: String,
default: ''
}
},
components: {
SvgIcon: svg_icon["default"]
},
render(h, context) {
const {
title,
icon
} = context.props;
const vnodes = [];
if (icon) {
vnodes.push(h("svg-icon", {
"attrs": {
"icon-class": icon
},
"style": "margin-right:10px;"
}));
}
if (title) {
vnodes.push(h("span", {
"slot": "title"
}, [title]));
}
return vnodes;
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Item.vue?vue&type=script&lang=js&
/* harmony default export */ var Sidebar_Itemvue_type_script_lang_js_ = (Itemvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Item.vue
var Item_render, Item_staticRenderFns
/* normalize component */
var Item_component = Object(componentNormalizer["a" /* default */])(
Sidebar_Itemvue_type_script_lang_js_,
Item_render,
Item_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Item = (Item_component.exports);
// EXTERNAL MODULE: ./src/utils/index.js
var utils = __webpack_require__(1);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/Link.vue?vue&type=script&lang=js&
/* harmony default export */ var Linkvue_type_script_lang_js_ = ({
name: 'MenuLink',
props: {
to: {
type: String,
required: true
}
},
render(h) {
if (Object(utils["d" /* default */])(this.to)) {
return h('a', {
attrs: {
target: '_blank',
rel: 'noopener',
href: this.to
}
}, this.$slots.default);
}
return h('router-link', {
props: {
to: this.to
}
}, this.$slots.default);
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Link.vue?vue&type=script&lang=js&
/* harmony default export */ var Sidebar_Linkvue_type_script_lang_js_ = (Linkvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/Link.vue
var Link_render, Link_staticRenderFns
/* normalize component */
var Link_component = Object(componentNormalizer["a" /* default */])(
Sidebar_Linkvue_type_script_lang_js_,
Link_render,
Link_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Link = (Link_component.exports);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/FixiOSBug.js
/* harmony default export */ var FixiOSBug = ({
mounted() {
// In order to fix the click on menu on the ios device will trigger the mouseleave bug
// https://github.com/PanJiaChen/vue-element-admin/issues/1135
this.fixBugIniOS();
},
methods: {
fixBugIniOS() {
const $subMenu = this.$refs.subMenu;
if ($subMenu) {
const {
handleMouseleave
} = $subMenu;
$subMenu.handleMouseleave = e => {
if (this.isMinScreen) {
return;
}
handleMouseleave(e);
};
}
}
}
});
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/SidebarItem.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var SidebarItemvue_type_script_lang_js_ = ({
name: 'SidebarItem',
mixins: [FixiOSBug],
props: {
// route object
item: {
type: Object,
required: true
},
root: {
type: Boolean,
default: false
},
// 是否收缩
isCollapse: {
type: Boolean,
default: false
},
// 是否是小屏幕
isMinScreen: {
type: Boolean,
default: false
}
},
computed: {
title(_ref) {
let {
item: {
meta: {
title,
alias
}
}
} = _ref;
return alias || title;
}
},
components: {
MenuItem: Item,
AppLink: Link
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/SidebarItem.vue?vue&type=script&lang=js&
/* harmony default export */ var Sidebar_SidebarItemvue_type_script_lang_js_ = (SidebarItemvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/SidebarItem.vue
/* normalize component */
var SidebarItem_component = Object(componentNormalizer["a" /* default */])(
Sidebar_SidebarItemvue_type_script_lang_js_,
SidebarItemvue_type_template_id_4dc008ba_render,
SidebarItemvue_type_template_id_4dc008ba_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var SidebarItem = (SidebarItem_component.exports);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/components/Sidebar/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Sidebarvue_type_script_lang_js_ = ({
name: 'menuS',
inheritAttrs: false,
props: {
// 左侧菜单渲染
menuList: {
type: Array,
default() {
return [];
}
},
// 完整的路由数据
routesList: {
type: Array,
default() {
return [];
}
},
// 样式变量
variables: {
type: Object,
default() {
return {};
}
},
// 是否显示logo
showLogo: {
type: Boolean,
default: true
},
// 是否收缩
isCollapse: {
type: Boolean,
default: false
},
// 是否是小屏幕
isMinScreen: {
type: Boolean,
default: false
},
title: String,
logo: String
},
data() {
return {
routesCache: {}
};
},
methods: {
findMenuItem(pathStr) {
if (!pathStr) return null;
if (this.routesCache[pathStr]) {
return this.routesCache[pathStr];
}
const pathArr = (pathStr || '').split(',');
let result = null;
const max = pathArr.length - 1;
if (max < 0) return result;
const fn = (arr, ind) => {
const T = pathArr[ind];
if (!T) return true; // 没有数据就停了
const res = arr.some(v => {
if (v.meta && v.meta.title === T) {
result = v;
let isFind = false;
if (v.children) {
isFind = fn(v.children, ind += 1);
}
return isFind;
}
return false;
});
return res;
};
fn(this.routesList, 0);
this.routesCache[pathStr] = result;
return result;
}
},
computed: {
activeMenu(_ref) {
let {
$route: {
meta: {
highlight
} = {},
path
}
} = _ref;
// if set path, the sidebar will highlight the path you set
if (highlight) {
const menuItem = this.findMenuItem(highlight);
return menuItem.path;
}
return path;
}
},
components: {
SidebarItem: SidebarItem,
Logo: Logo
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/index.vue?vue&type=script&lang=js&
/* harmony default export */ var components_Sidebarvue_type_script_lang_js_ = (Sidebarvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/Sidebar/index.vue
/* normalize component */
var Sidebar_component = Object(componentNormalizer["a" /* default */])(
components_Sidebarvue_type_script_lang_js_,
Sidebarvue_type_template_id_5e3d30b2_render,
Sidebarvue_type_template_id_5e3d30b2_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var Sidebar = (Sidebar_component.exports);
// CONCATENATED MODULE: ./packages/wlm-layout/body/components/index.js
// CONCATENATED MODULE: ./packages/wlm-layout/body/props.js
/* harmony default export */ var props = ({
// 菜单数组
menuList: {
type: Array,
default() {
return [];
}
},
// 完整路由
routesList: {
type: Array,
default() {
return [];
}
},
// 样式变量
variables: {
type: Object,
default() {
return {};
}
},
// 是否展示logo
showLogo: {
type: Boolean,
default: true
},
avatar: String,
userName: String,
title: String,
logo: String
});
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/wlm-layout/body/index.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
const MIN_SCREEN = 992;
/* harmony default export */ var bodyvue_type_script_lang_js_ = ({
name: 'WlmLayout',
props: props,
data() {
return {
isMinScreen: false,
isCollapse: false
};
},
methods: {
initHandler() {
this.modifiedSomeInfo();
let timer = null;
const resizeHandler = () => {
clearTimeout(timer);
timer = setTimeout(() => {
if (!document.hidden) {
this.modifiedSomeInfo();
}
}, 200);
};
window.addEventListener('resize', resizeHandler);
this.$once('hook:beforeDestroy', () => {
window.removeEventListener('resize', resizeHandler);
});
},
modifiedSomeInfo() {
// 小屏收缩侧边栏
this.isMinScreen = this.$_isMinScreen();
if (this.isMinScreen) {
this.isCollapse = true;
}
},
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_isMinScreen() {
const IS_PC = /macintosh|window|windowswechat/.test(navigator.userAgent.toLowerCase()); // 桌面端
const rect = document.body.getBoundingClientRect();
return rect.width - 1 < MIN_SCREEN || !IS_PC;
},
toggleSideBar() {
this.isCollapse = !this.isCollapse;
},
logout() {
this.$confirm('确认要退出当前账号吗?').then(() => {
this.$emit('loginOut');
}).catch(() => {});
}
},
mounted() {
this.initHandler();
},
computed: {
siderBarWidth() {
return !this.isCollapse ? 210 : 64;
},
classObj() {
return {
hideSidebar: this.isCollapse,
openSidebar: !this.isCollapse,
isMinScreen: this.isMinScreen
};
}
},
watch: {
$route() {
// 切换路由,如果是小屏幕的,需要关闭侧边栏
if (this.$_isMinScreen() && !this.isCollapse) {
this.isCollapse = true;
}
}
},
components: {
AppMain: AppMain,
ZNavbar: Navbar,
ZSidebar: Sidebar
}
});
// CONCATENATED MODULE: ./packages/wlm-layout/body/index.vue?vue&type=script&lang=js&
/* harmony default export */ var wlm_layout_bodyvue_type_script_lang_js_ = (bodyvue_type_script_lang_js_);
// CONCATENATED MODULE: ./packages/wlm-layout/body/index.vue
/* normalize component */
var body_component = Object(componentNormalizer["a" /* default */])(
wlm_layout_bodyvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var body = (body_component.exports);
// CONCATENATED MODULE: ./packages/wlm-layout/index.js
/* istanbul ignore next */
body.install = function install(Vue) {
Vue.component(body.name, body);
};
/* harmony default export */ var wlm_layout = __webpack_exports__["default"] = (body);
/***/ }),
/***/ 3:
/***/ (function(module, exports) {
module.exports = require("core-js/modules/es.array.includes.js");
/***/ })
/******/ });