UNPKG

license-plate-vue

Version:

license-plate vue h5

1,126 lines (957 loc) 40.1 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define("license-plate", [], factory); else if(typeof exports === 'object') exports["license-plate"] = factory(); else root["license-plate"] = factory(); })((typeof self !== 'undefined' ? self : this), function() { return /******/ (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 = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "fd77"); /******/ }) /************************************************************************/ /******/ ({ /***/ "3db1": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("a1a8"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".pop-container[data-v-66c90be1]{width:100%;max-height:80vh;overflow-x:hidden}.pop-wrap[data-v-66c90be1]{position:relative;width:100%;box-sizing:border-box}.pop-wrap .ipt-wrap[data-v-66c90be1]{padding:4vw;background-color:#fff;margin-bottom:2vw;border-radius:10px}.pop-wrap .ipt-wrap .ipt-list[data-v-66c90be1]{display:flex;align-items:center;justify-content:space-between}.pop-wrap .ipt-wrap .ipt-list>div[data-v-66c90be1]{flex:none}.pop-wrap .ipt-wrap .ipt-list .ipt-num[data-v-66c90be1]{display:flex;justify-content:center;align-items:center;width:9.2vw;height:11vw;border-radius:5px;font-size:5vw;color:#000;line-height:12vw;box-sizing:border-box;border:1px solid #9094a8}.pop-wrap .ipt-wrap .ipt-list .ipt-num.active[data-v-66c90be1]{border-color:#4c88ff}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num[data-v-66c90be1]{border-style:solid;border-color:#9094a8}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num .addition-preview[data-v-66c90be1]{position:relative;display:flex;align-items:center;flex-direction:column;color:#9094a8;white-space:nowrap}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num .addition-preview span[data-v-66c90be1]{transform:scale(.5);font-size:5vw;line-height:5vw}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num.active[data-v-66c90be1]{border-color:#22b938}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num.active .addition-preview[data-v-66c90be1]{position:relative;display:flex;align-items:center;flex-direction:column;color:#22b938;white-space:nowrap}.pop-wrap .ipt-wrap .ipt-list .ipt-num.addition-num.active .addition-preview span[data-v-66c90be1]{transform:scale(.5);font-size:5vw;line-height:5vw}.pop-wrap .ipt-wrap .ipt-list .ipt-split[data-v-66c90be1]{width:2vw;height:2vw;background:#b3b3b3;border-radius:100%}.pop-wrap .confirm-wrap[data-v-66c90be1]{margin:6vw 0}.pop-wrap .confirm-wrap .confirm-btn[data-v-66c90be1]{display:block;width:100%;display:flex;align-items:center;justify-content:center;padding:3vw;font-size:16px;background-color:#22b938;color:#fff;box-sizing:border-box;border-width:0;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:0;outline:none;-webkit-appearance:none;border-radius:10px}.pop-wrap .confirm-wrap .confirm-btn[data-v-66c90be1]:disabled{background-color:rgba(34,185,56,.5)}.pop-wrap .keyboard-container[data-v-66c90be1]{min-height:26vh}.pop-wrap .keyborad-wrap[data-v-66c90be1]{padding:1.2vw 0;flex-wrap:wrap;border-radius:10px;background-color:#f1f1f1}.pop-wrap .keyborad-wrap[data-v-66c90be1],.pop-wrap .keyborad-wrap>div[data-v-66c90be1]{display:flex;align-items:center;justify-content:center}.pop-wrap .keyborad-wrap>div[data-v-66c90be1]{position:relative;flex:none;margin:1vw .5vw;color:#111;width:8vw;height:10vw;font-size:5vw;background-color:#fff;box-shadow:.2vw .3vw 0 0 rgba(0,0,0,.25);border-radius:.8vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:box-shadow .3s}.pop-wrap .keyborad-wrap>div.disabled[data-v-66c90be1]{color:#e1e0e0}.pop-wrap .keyborad-wrap>div[data-v-66c90be1]:active{box-shadow:inset .2vw .3vw 0 0 rgba(0,0,0,.25)}.pop-wrap .keyborad-wrap>div:active .del-img[data-v-66c90be1],.pop-wrap .keyborad-wrap>div:active span[data-v-66c90be1]{transform:translate(1px,1px)}.pop-wrap .keyborad-wrap>div.disabled[data-v-66c90be1]:active{box-shadow:.2vw .3vw 0 0 rgba(0,0,0,.25)}.pop-wrap .keyborad-wrap>div.disabled:active .del-img[data-v-66c90be1],.pop-wrap .keyborad-wrap>div.disabled:active span[data-v-66c90be1]{transform:translate(0)}.pop-wrap .keyborad-wrap>div.del[data-v-66c90be1]{width:14vw;height:10vw;background:#d5d5d5}.pop-wrap .keyborad-wrap>div.del .del-img[data-v-66c90be1]{width:7vw;height:5vw}.pop-wrap .keyborad-wrap>div.del .del-img img[data-v-66c90be1]{display:block;width:100%;height:100%}.pop-wrap .keyborad-wrap>div .addtion-list[data-v-66c90be1]{position:absolute;top:0;right:100%;transform:translateX(-.5vw);display:flex;align-items:center}.pop-wrap .keyborad-wrap>div .addtion-list>div[data-v-66c90be1]{position:relative;flex:none;display:flex;align-items:center;justify-content:center;margin:1vw .5vw;color:#111;width:8vw;height:10vw;font-size:5vw;background-color:#fff;box-shadow:.2vw .3vw 0 0 rgba(0,0,0,.25);border-radius:.8vw;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-top:0}.pop-wrap .keyborad-wrap>div .addtion-list>div.disabled[data-v-66c90be1]{color:#e1e0e0}", ""]); // Exports module.exports = exports; /***/ }), /***/ "5925": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ addStylesClient; }); // CONCATENATED MODULE: ./node_modules/_vue-style-loader@4.1.3@vue-style-loader/lib/listToStyles.js /** * Translates the list format produced by css-loader into something * easier to manipulate. */ function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles } // CONCATENATED MODULE: ./node_modules/_vue-style-loader@4.1.3@vue-style-loader/lib/addStylesClient.js /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } /* type StyleObject = { id: number; parts: Array<StyleObjectPart> } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} var options = null var ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> // tags it will allow on a page var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()) function addStylesClient (parentId, list, _isProduction, _options) { isProduction = _isProduction options = _options || {} var styles = listToStyles(parentId, list) addStylesToDom(styles) return function update (newList) { var mayRemove = [] for (var i = 0; i < styles.length; i++) { var item = styles[i] var domStyle = stylesInDom[item.id] domStyle.refs-- mayRemove.push(domStyle) } if (newList) { styles = listToStyles(parentId, newList) addStylesToDom(styles) } else { styles = [] } for (var i = 0; i < mayRemove.length; i++) { var domStyle = mayRemove[i] if (domStyle.refs === 0) { for (var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j]() } delete stylesInDom[domStyle.id] } } } } function addStylesToDom (styles /* Array<StyleObject> */) { for (var i = 0; i < styles.length; i++) { var item = styles[i] var domStyle = stylesInDom[item.id] if (domStyle) { domStyle.refs++ for (var j = 0; j < domStyle.parts.length; j++) { domStyle.parts[j](item.parts[j]) } for (; j < item.parts.length; j++) { domStyle.parts.push(addStyle(item.parts[j])) } if (domStyle.parts.length > item.parts.length) { domStyle.parts.length = item.parts.length } } else { var parts = [] for (var j = 0; j < item.parts.length; j++) { parts.push(addStyle(item.parts[j])) } stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts } } } } function createStyleElement () { var styleElement = document.createElement('style') styleElement.type = 'text/css' head.appendChild(styleElement) return styleElement } function addStyle (obj /* StyleObjectPart */) { var update, remove var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]') if (styleElement) { if (isProduction) { // has SSR styles and in production mode. // simply do nothing. return noop } else { // has SSR styles but in dev mode. // for some reason Chrome can't handle source map in server-rendered // style tags - source maps in <style> only works if the style tag is // created and inserted dynamically. So we remove the server rendered // styles and inject new ones. styleElement.parentNode.removeChild(styleElement) } } if (isOldIE) { // use singleton mode for IE9. var styleIndex = singletonCounter++ styleElement = singletonElement || (singletonElement = createStyleElement()) update = applyToSingletonTag.bind(null, styleElement, styleIndex, false) remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true) } else { // use multi-style-tag mode in all other cases styleElement = createStyleElement() update = applyToTag.bind(null, styleElement) remove = function () { styleElement.parentNode.removeChild(styleElement) } } update(obj) return function updateStyle (newObj /* StyleObjectPart */) { if (newObj) { if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { return } update(obj = newObj) } else { remove() } } } var replaceText = (function () { var textStore = [] return function (index, replacement) { textStore[index] = replacement return textStore.filter(Boolean).join('\n') } })() function applyToSingletonTag (styleElement, index, remove, obj) { var css = remove ? '' : obj.css if (styleElement.styleSheet) { styleElement.styleSheet.cssText = replaceText(index, css) } else { var cssNode = document.createTextNode(css) var childNodes = styleElement.childNodes if (childNodes[index]) styleElement.removeChild(childNodes[index]) if (childNodes.length) { styleElement.insertBefore(cssNode, childNodes[index]) } else { styleElement.appendChild(cssNode) } } } function applyToTag (styleElement, obj) { var css = obj.css var media = obj.media var sourceMap = obj.sourceMap if (media) { styleElement.setAttribute('media', media) } if (options.ssrId) { styleElement.setAttribute(ssrIdKey, obj.id) } if (sourceMap) { // https://developer.chrome.com/devtools/docs/javascript-debugging // this makes source maps inside style tags work properly in Chrome css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */' // http://stackoverflow.com/a/26603875 css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */' } if (styleElement.styleSheet) { styleElement.styleSheet.cssText = css } else { while (styleElement.firstChild) { styleElement.removeChild(styleElement.firstChild) } styleElement.appendChild(document.createTextNode(css)) } } /***/ }), /***/ "98b1": /***/ (function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a <style> tag // load the styles var content = __webpack_require__("3db1"); if(content.__esModule) content = content.default; if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM var add = __webpack_require__("5925").default var update = add("9b1d564e", content, true, {"sourceMap":false,"shadowMode":false}); /***/ }), /***/ "a1a8": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader // eslint-disable-next-line func-names module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return "@media ".concat(item[2], " {").concat(content, "}"); } return content; }).join(''); }; // import a list of modules into the list // eslint-disable-next-line func-names list.i = function (modules, mediaQuery, dedupe) { if (typeof modules === 'string') { // eslint-disable-next-line no-param-reassign modules = [[null, modules, '']]; } var alreadyImportedModules = {}; if (dedupe) { for (var i = 0; i < this.length; i++) { // eslint-disable-next-line prefer-destructuring var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } } for (var _i = 0; _i < modules.length; _i++) { var item = [].concat(modules[_i]); if (dedupe && alreadyImportedModules[item[0]]) { // eslint-disable-next-line no-continue continue; } if (mediaQuery) { if (!item[2]) { item[2] = mediaQuery; } else { item[2] = "".concat(mediaQuery, " and ").concat(item[2]); } } list.push(item); } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */"); }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); return "/*# ".concat(data, " */"); } /***/ }), /***/ "d34e": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _node_modules_vue_style_loader_4_1_3_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_3_6_0_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_9_8_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_8_0_2_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_4_1_0_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_9_8_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_66c90be1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("98b1"); /* harmony import */ var _node_modules_vue_style_loader_4_1_3_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_3_6_0_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_9_8_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_8_0_2_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_4_1_0_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_9_8_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_66c90be1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_4_1_3_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_3_6_0_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_15_9_8_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_postcss_loader_3_0_0_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_8_0_2_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_4_1_0_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_15_9_8_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_66c90be1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__); /* unused harmony reexport * */ /***/ }), /***/ "e67d": /***/ (function(module, exports) { // document.currentScript polyfill by Adam Miller // MIT license (function(document){ var currentScript = "currentScript", scripts = document.getElementsByTagName('script'); // Live NodeList collection // If browser needs currentScript polyfill, add get currentScript() to the document object if (!(currentScript in document)) { Object.defineProperty(document, currentScript, { get: function(){ // IE 6-10 supports script readyState // IE 10+ support stack trace try { throw new Error(); } catch (err) { // Find the second match for the "at" string to get file src url from stack. // Specifically works with the format of stack traces in IE. var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1]; // For all scripts on the page, if src matches or if ready state is interactive, return the script tag for(i in scripts){ if(scripts[i].src == res || scripts[i].readyState == "interactive"){ return scripts[i]; } } // If no match, return null return null; } } }); } })(document); /***/ }), /***/ "fd77": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "licensePlateVue", function() { return /* reexport */ src; }); // CONCATENATED MODULE: ./node_modules/_@vue_cli-service@4.2.3@@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. if (typeof window !== 'undefined') { if (true) { __webpack_require__("e67d") } var i if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) { __webpack_require__.p = i[1] // eslint-disable-line } } // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); // CONCATENATED MODULE: ./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"212dcb00-vue-loader-template"}!./node_modules/_vue-loader@15.9.8@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./src/index.vue?vue&type=template&id=66c90be1&scoped=true& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"pop-container"},[_c('div',{staticClass:"pop-wrap"},[_c('div',{staticClass:"ipt-wrap"},[_c('div',{staticClass:"ipt-list"},_vm._l((_vm.inputAreaList),function(item){return _c('div',{key:item.index,class:[ item.index === -1 ? 'ipt-split' : 'ipt-num', _vm.activeIndex === item.index ? ' active' : '', item.index === 7 ? ' addition-num' : '' ],on:{"click":function($event){return _vm.handleChooseIpt(item.index)}}},[(_vm.plateNum[item.index])?_c('div',[_vm._v(_vm._s(_vm.plateNum[item.index]))]):_vm._e(),( _vm.isNewEnergy && item.index === 7 && (_vm.plateNum[7] === ' ' || !_vm.plateNum[7]) )?_c('div',{staticClass:"addition-preview"},[_c('span',[_vm._v("新能源")])]):_vm._e()])}),0)]),(_vm.showKeyboard)?_c('div',{staticClass:"keyboard-container"},[_c('div',{staticClass:"keyborad-wrap"},[_vm._l((_vm.iptKeyList),function(item){return _c('div',{key:item.key,class:[item.disabled ? 'disabled' : ''],on:{"click":function($event){return _vm.handleInput(item.key, item.disabled)}}},[_c('span',[_vm._v(_vm._s(item.key))]),(_vm.showAdditionList && item.key === '字')?_c('div',{staticClass:"addtion-list"},_vm._l((_vm.additionKeyList),function(item){return _c('div',{key:item,on:{"click":function($event){return _vm.handleInput(item)}}},[_vm._v(" "+_vm._s(item)+" ")])}),0):_vm._e()])}),_c('div',{staticClass:"gray-key del",attrs:{"data-key":"del"},on:{"click":_vm.handleRemove}},[_vm._m(0)])],2)]):_vm._e(),(_vm.isSave)?_c('div',{staticClass:"confirm-wrap"},[_c('button',{staticClass:"confirm-btn",attrs:{"type":"button","disabled":!_vm.canSubmit},on:{"click":_vm.confirm}},[_vm._v(" 保存 ")])]):_vm._e()])])} var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"del-img"},[_c('img',{attrs:{"src":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAqBAMAAAAUtoW9AAAAMFBMVEVHcEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlTPQ5AAAAD3RSTlMA6y8RB7yol87aIURf9oCspPo+AAABKElEQVQ4y42UsU4CQRCGL2AwgcSCWJocV9jTYWJDQ2KrsT8KShIo6C14AAoeAC1tfAWoeQMqnsECkETzy+wwewsHf5hiZ7Pf/bO3szMbRWZfzwhs0W1GmTWWOLS7jJUnOLaBhx85hk0g3M7DXR57wGw//wyjOKvEuNVZcZIFMZviVycPQP8YlrBW4SgvjCrYOv8EtHOwiD9xV6lFeNH1+7qMgIwtoKNbf9fEFeKhhzvhSo+YoiouwcrDEvCq4RKItBDrNw72TLhf1k8UXnuhrpvQwTf81A0KMKHAG2CYHW5HTChwGgid1IQCU4zDvCQwocAl3i+FNCz7IXoUlgSaPpp4emX0smmZHJpCX2CnoNT02dLkRU3bgTcSbUHevLTt+YNBn5qTj9Q/+cdgxoiYpkoAAAAASUVORK5CYII="}})])}] // CONCATENATED MODULE: ./src/index.vue?vue&type=template&id=66c90be1&scoped=true& // CONCATENATED MODULE: ./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!./node_modules/_babel-loader@8.2.4@babel-loader/lib!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.8@vue-loader/lib??vue-loader-options!./src/index.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // const ProvinceList = '京津沪渝晋蒙吉黑苏浙皖闽赣鲁豫鄂湘粤桂琼川云藏青宁新港澳台甘辽冀贵陕'.split(''); const NumberList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; const LetterList = 'QWERTYUIOPASDFGHJKLZXCVBNM'.split(''); const AdditionKeyList = '学挂警'.split(''); // 可选中文字符(倒数第二位) /** 标识输入框的位数 * @param type {number} 键盘类型 * 1:省份输入。键盘:省份简称。 * 2:区号输入。键盘:数字+字母。数字和I不可选 * 3:序号选择。键盘:数字+字母。I、O不可选 * 4:特殊位数。键盘:数字+字母+特殊字符('字'切换显示'学挂警'按钮)。I、O不可选 * 5:新能源标识位。键盘:数字+字母。I、O不可选 */ const InputAreaList = [{ index: 0, type: 1 }, { index: 1, type: 2 }, { index: -1 }, // 分割点,例如:川A·12345 { index: 2, type: 3 }, { index: 3, type: 3 }, { index: 4, type: 3 }, { index: 5, type: 3 }, { index: 6, type: 4 }, { index: 7, type: 5 }]; /* harmony default export */ var lib_vue_loader_options_srcvue_type_script_lang_js_ = ({ name: 'license-plate-vue', props: { value: { type: String, default: '' }, limitProvince: { type: String, default: '' }, // 限制省份列表, 不用间隔 limitCity: { type: String, default: '' }, // 限制城市列表, 不用间隔 checkKeyBoardMap: Function, // 更新键盘时,验证按键列表的数据,return iptKeyList // 是否需要保存按钮 isSave: { type: Boolean, default: true }, // 是否需要新能源位 isNewEnergy: { type: Boolean, default: true } }, data() { return { plateNum: '', canSubmit: false, showKeyboard: false, iptKeyList: [], activeIndex: -1, // 输入进程,不同的进程显示不同的键盘布局和功能.输入第一位字符为0,第二位字符为1 inputAreaList: InputAreaList, additionKeyList: AdditionKeyList, showAdditionList: false }; }, mounted() {}, methods: { confirm() { const plateNum = this.plateNum.replace(/\s*/g, ''); this.$emit('confirm', { plateNum, plateNumFor: plateNum.slice(0, 2) + '·' + plateNum.slice(2), isNewEnergy: plateNum.length === 8, isProvincialCity: plateNum[1] === 'A', province: plateNum[0] }); }, /** * 替换字符串中某个下标上字符的的内容 * @param {string} str 被替换的字符串 * @param {number} index 替换的下标 * @param {string} key 替换的字符 */ replaceIndexChar(str, index, key) { return str.slice(0, index) + (key !== undefined ? key : ' ') + str.slice(index + 1); }, /** 删除按钮 */ handleRemove() { const process = this.activeIndex; let plateNum = this.plateNum; // 如果位置上有值先删除 if (plateNum[process] && plateNum[process] !== ' ') { plateNum = this.replaceIndexChar(plateNum, process); this.plateNum = plateNum; return; } if (process === 7) { return; } //位置上没有值,光标回到上一个输入框,并删除上一个输入框的值 const index = process - 1 > -1 ? process - 1 : 0; plateNum = this.replaceIndexChar(plateNum, index); this.plateNum = plateNum; this.activeIndex = index; }, /** 用户输入 */ handleInput(key, disabled) { if (disabled) { return; } // 输入第7位字符时(倒数第二位),点击‘字’切换显示‘学挂警’字符按钮 if (key === '字') { this.showAdditionList = !this.showAdditionList; return; } const process = this.activeIndex; let plateNum = this.plateNum; plateNum = this.replaceIndexChar(plateNum, process, key); let activeIndex = process === 7 ? 7 : process + 1 > 6 ? 6 : plateNum[process + 1] && plateNum[process + 1] !== ' ' ? process : process + 1; this.plateNum = plateNum; this.activeIndex = activeIndex; }, /** 选择输入框 */ handleChooseIpt(_index) { const index = _index; if (!this.plateNum[index - 1 > -1 ? index - 1 : 0]) { return; } this.showKeyboard = true; this.activeIndex = Number(index); }, // 验证省份是否合法 checkProvinceDisabled(str) { const keyboardList = ProvinceList; let limitProvince = this.limitProvince.split(''); limitProvince = limitProvince.length > 0 ? limitProvince : keyboardList; return limitProvince.findIndex(i => i === str) === -1; }, checkCityDisabled(str) { const keyboardList = NumberList.concat(LetterList); let limitCity = this.limitCity.split(''); limitCity = limitCity.length > 0 ? limitCity : keyboardList; return typeof str === 'number' || str === 'I' || limitCity.findIndex(i => i === str) === -1; }, // 根据activeIndex的值(输入进程)来判断键盘的布局和按键禁用 getKeyBoardList() { const process = this.activeIndex; if (process < 0) { return; } const keyboardType = InputAreaList.find(e => e.index === process).type; this.showKeyboard = !!keyboardType; /** 第1位 省份选择 只有省份简称列表可选 */ if (keyboardType === 1) { return { iptKeyList: ProvinceList.map(e => ({ key: e, disabled: this.checkProvinceDisabled(e) })) }; } /** 第2位 区号选择 英文字母+数字 数字和I不可选 */ if (keyboardType === 2) { return { iptKeyList: NumberList.concat(LetterList).map(e => ({ key: e, disabled: this.checkCityDisabled(e) })) }; } /** 第3-6位 序号选择 英文字母+数字 I、O不可选 */ if (keyboardType === 3) { return { iptKeyList: NumberList.concat(LetterList).map(e => ({ key: e, disabled: e === 'I' || e === 'O' })) }; } /** 第7位 序号选择 英文字母+数字+特殊字符切换('学挂警') I、O不可选 */ if (keyboardType === 4) { let iptKeyList = NumberList.concat(LetterList); // 第三排最后一个字符插入'字',点击之后弹出'学挂警'三个可选字符按钮 iptKeyList.splice(29, 0, '字'); return { iptKeyList: iptKeyList.map(e => ({ key: e, disabled: e === 'I' || e === 'O' })), showAdditionList: false }; } /** 第8位 新能源车最后一位选择 英文字母+数字 I、O不可选 */ if (keyboardType === 5) { return { iptKeyList: NumberList.concat(LetterList).map(e => ({ key: e, disabled: e === 'I' || e === 'O' })) }; } } }, watch: { activeIndex: function () { let { iptKeyList, showAdditionList } = this.getKeyBoardList(); if (this.checkKeyBoardMap) { iptKeyList = this.checkKeyBoardMap(iptKeyList, this.plateNum, this.activeIndex); } this.iptKeyList = iptKeyList; this.showAdditionList = !!showAdditionList; }, plateNum: { handler() { const plateNum = this.plateNum; this.$emit('input', plateNum); this.$emit('change', plateNum); this.canSubmit = !/\S+\s+\S+/.test(plateNum) && plateNum.replace(/\s*/g, '').length >= 7 || plateNum.replace(/\s*/g, '').length == 0; }, immediate: true }, value: { handler(n, o) { let plateNum = n; // 目前只做前两位校验,如果不合法,置为空 if (plateNum[0] && this.checkProvinceDisabled(plateNum[0])) { plateNum = ''; } if (plateNum[1] && this.checkCityDisabled(plateNum[1])) { plateNum = plateNum[0]; } plateNum = plateNum.replace(/(·|\s*)/g, '').toUpperCase(); if (!this.isNewEnergy && plateNum.length === 7) { plateNum = plateNum.substring(0, 6); } this.plateNum = plateNum; // 只有第一次进入才会设置聚焦框 if (!o) { this.activeIndex = !plateNum.length ? 0 : plateNum.length > 7 ? 7 : plateNum.length === 7 ? 6 : plateNum.length; } }, immediate: true } } }); // CONCATENATED MODULE: ./src/index.vue?vue&type=script&lang=js& /* harmony default export */ var srcvue_type_script_lang_js_ = (lib_vue_loader_options_srcvue_type_script_lang_js_); // EXTERNAL MODULE: ./src/index.vue?vue&type=style&index=0&id=66c90be1&lang=scss&scoped=true& var srcvue_type_style_index_0_id_66c90be1_lang_scss_scoped_true_ = __webpack_require__("d34e"); // CONCATENATED MODULE: ./node_modules/_vue-loader@15.9.8@vue-loader/lib/runtime/componentNormalizer.js /* 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 } } // CONCATENATED MODULE: ./src/index.vue /* normalize component */ var component = normalizeComponent( srcvue_type_script_lang_js_, render, staticRenderFns, false, null, "66c90be1", null ) /* harmony default export */ var src = (component.exports); // CONCATENATED MODULE: ./src/main.js const install = Vue => { if (install.installed) { return; } Vue.component(src.name, src); }; if (typeof window !== 'undefined' && window.Vue) { install(window.Vue); } src.install = install; /* harmony default export */ var main = (src); // CONCATENATED MODULE: ./node_modules/_@vue_cli-service@4.2.3@@vue/cli-service/lib/commands/build/entry-lib.js /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (main); /***/ }) /******/ }); }); //# sourceMappingURL=license-plate-vue.common.js.map