UNPKG

@varonervar/components

Version:

> 基于[Element-UI](https://element.eleme.cn/#/zh-CN/component/quickstart) 封装常用组件,部分组件参考[vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)

638 lines (581 loc) 19.1 kB
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ /******/ /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0, resolves = []; /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ resolves.push(installedChunks[chunkId][0]); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ for(moduleId in moreModules) { /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { /******/ modules[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(parentJsonpFunction) parentJsonpFunction(data); /******/ /******/ while(resolves.length) { /******/ resolves.shift()(); /******/ } /******/ /******/ }; /******/ /******/ /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // Promise = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ 10: 0 /******/ }; /******/ /******/ /******/ /******/ // script path function /******/ function jsonpScriptSrc(chunkId) { /******/ return __webpack_require__.p + "" + chunkId + ".js" /******/ } /******/ /******/ // 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; /******/ } /******/ /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __webpack_require__.e = function requireEnsure(chunkId) { /******/ var promises = []; /******/ /******/ /******/ // JSONP chunk loading for javascript /******/ /******/ var installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) { // 0 means "already installed". /******/ /******/ // a Promise means "currently loading". /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { /******/ // setup Promise in chunk cache /******/ var promise = new Promise(function(resolve, reject) { /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; /******/ }); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading /******/ var script = document.createElement('script'); /******/ var onScriptComplete; /******/ /******/ script.charset = 'utf-8'; /******/ script.timeout = 120; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } /******/ script.src = jsonpScriptSrc(chunkId); /******/ /******/ // create error before stack unwound to get useful stacktrace later /******/ var error = new Error(); /******/ onScriptComplete = function (event) { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; /******/ clearTimeout(timeout); /******/ var chunk = installedChunks[chunkId]; /******/ if(chunk !== 0) { /******/ if(chunk) { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.name = 'ChunkLoadError'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ chunk[1](error); /******/ } /******/ installedChunks[chunkId] = undefined; /******/ } /******/ }; /******/ var timeout = setTimeout(function(){ /******/ onScriptComplete({ type: 'timeout', target: script }); /******/ }, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ document.head.appendChild(script); /******/ } /******/ } /******/ return Promise.all(promises); /******/ }; /******/ /******/ // 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/"; /******/ /******/ // on error function for async loading /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ /******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; /******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); /******/ jsonpArray.push = webpackJsonpCallback; /******/ jsonpArray = jsonpArray.slice(); /******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); /******/ var parentJsonpFunction = oldJsonpFunction; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 20); /******/ }) /************************************************************************/ /******/ ({ /***/ 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 } } /***/ }), /***/ 10: /***/ (function(module, exports) { module.exports = require("dayjs"); /***/ }), /***/ 13: /***/ (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/z-object-show/body/index.vue?vue&type=template&id=0f12df6e& var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "wl-objectshow flex" }, [ _vm._l(_vm.showData, function (value, key) { return _c( "p", { key: key, staticClass: "wl-objectshow__p" }, [ _c( "el-tag", { staticClass: "mr-5", attrs: { size: "small", type: "primary" }, }, [_vm._v(_vm._s(key))] ), typeof value === "object" ? [ Object.keys(value || {}).length ? _c( "el-button", { attrs: { size: "mini" }, on: { click: function ($event) { _vm.btnHandler( Array.isArray(value) ? "subList" : "subData", key, value ) }, }, }, [_vm._v("查看详情")] ) : _c("span", [_vm._v("null")]), ] : [ _c("span", [ _vm._v(_vm._s(_vm.isFalse(value) ? "null" : value)), ]), ], ], 2 ) }), _c( "el-dialog", { attrs: { visible: _vm.dialogVisible, "close-on-click-modal": false, title: _vm.dialogTitle, "append-to-body": true, top: "50px", width: "80vw", }, on: { "update:visible": function ($event) { _vm.dialogVisible = $event }, }, }, [ _vm.dialogVisible ? [ _vm.isObjectData ? _c("ZObjectShow", { attrs: { data: _vm.subData } }) : _c("ZarrayShow", { attrs: { list: _vm.subList } }), ] : _vm._e(), _c( "footer", { staticClass: "dialog-footer text-right" }, [ _c( "el-button", { attrs: { size: "small" }, on: { click: function ($event) { _vm.dialogVisible = false }, }, }, [_vm._v("关 闭")] ), ], 1 ), ], 2 ), ], 2 ) } var staticRenderFns = [] render._withStripped = true // CONCATENATED MODULE: ./packages/z-object-show/body/index.vue?vue&type=template&id=0f12df6e& // EXTERNAL MODULE: external "core-js/modules/es.array.includes.js" var es_array_includes_js_ = __webpack_require__(3); // EXTERNAL MODULE: external "dayjs" var external_dayjs_ = __webpack_require__(10); var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_); // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--0!./node_modules/vue-loader/lib??vue-loader-options!./packages/z-object-show/body/index.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ var bodyvue_type_script_lang_js_ = ({ name: 'ZObjectShow', inheritAttrs: false, props: { data: { type: Object, required: true }, config: { type: Array, default() { return []; } } }, data() { return { dialogVisible: false, // 弹窗显隐 dialogTitle: '', // 弹窗title isObjectData: true, // 弹窗内容是否是对象 subData: {}, // 弹窗数据object subList: [] // 弹窗数据array }; }, methods: { dateFormat(arr, _ref) { let { format = 'YYYY-MM-DD HH:mm:ss', flag = '-' } = _ref; try { if (arr.some(v => !v)) return null; return arr.map(t => external_dayjs_default()(new Date(t)).format(format)).join(flag); } catch (error) { return null; } }, btnHandler(flag, key, data) { this.dialogTitle = "".concat(key, "\u8BE6\u60C5"); this[flag] = data; this.isObjectData = flag === 'subData'; this.dialogVisible = true; }, isFalse(value) { return value == null || value === ''; } }, computed: { showData(_ref2) { let { data, config, dateFormat } = _ref2; const result = {}; const keyarr = []; // 再config里的数据,进行 config.forEach(v => { if (v.value && v.label) { // 如果是枚举数据 if (v.template === 'enumer' && v.enumer) { result[v.label] = v.enumer[data[v.value]]; keyarr.push(v.value); } else if (v.template === 'time') { // 如股是时间数据 const arr = v.value.split(','); result[v.label] = dateFormat(arr.map(it => data[it]), { format: v.format, flag: v.connectFlag }); keyarr.push(...arr); } else { // 其他的中文 result[v.label] = data[v.value]; keyarr.push(v.value); } } }); // 剩余没在config数组里的数据 Object.keys(data).forEach(key => { // 处理过的数据就不添加了 if (!keyarr.includes(key)) { result[key] = data[key]; } }); return result; } }, components: { ZarrayShow: () => __webpack_require__.e(/* import() */ 16).then(__webpack_require__.bind(null, 30)) } }); // CONCATENATED MODULE: ./packages/z-object-show/body/index.vue?vue&type=script&lang=js& /* harmony default export */ var z_object_show_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/z-object-show/body/index.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( z_object_show_bodyvue_type_script_lang_js_, render, staticRenderFns, false, null, null, null ) /* harmony default export */ var body = __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 20: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _body_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* istanbul ignore next */ _body_index__WEBPACK_IMPORTED_MODULE_0__["default"].install = function install(Vue) { Vue.component(_body_index__WEBPACK_IMPORTED_MODULE_0__["default"].name, _body_index__WEBPACK_IMPORTED_MODULE_0__["default"]); }; /* harmony default export */ __webpack_exports__["default"] = (_body_index__WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ 3: /***/ (function(module, exports) { module.exports = require("core-js/modules/es.array.includes.js"); /***/ }) /******/ });