You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
12 KiB
2 lines
12 KiB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.treeSelect=t():e.treeSelect=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){e.exports=!n(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(14),i=(r=o)&&r.__esModule?r:{default:r};t.default=(0,i.default)({template:"#tree-select",name:"el-tree-select",props:{props:{type:Object,default:function(){return{value:"id",label:"title",children:"children"}}},options:{type:Array,default:function(){return[]}},value:{type:Number,default:function(){return null}},clearable:{type:Boolean,default:function(){return!0}},accordion:{type:Boolean,default:function(){return!1}}},watch:{value:function(e,t){this.valueId=e,this.initHandle()},options:{handler:function(e,t){console.log(this.valueId,e),this.initHandle()},immediate:!0,deep:!0}},data:function(){return{valueId:this.value,valueTitle:"",defaultExpandedKey:[]}},mounted:function(){this.initHandle()},methods:{initHandle:function(){if(this.valueId){if(!this.$refs.selectTree.getNode(this.valueId))return;this.valueTitle=this.$refs.selectTree.getNode(this.valueId).data[this.props.label],this.$refs.selectTree.setCurrentKey(this.valueId),this.defaultExpandedKey=[this.valueId]}this.initScroll()},initScroll:function(){this.$nextTick(function(){var e=document.querySelectorAll(".el-scrollbar .el-select-dropdown__wrap")[0],t=document.querySelectorAll(".el-scrollbar .el-scrollbar__bar");e.style.cssText="margin: 0px; max-height: none; overflow: hidden;",t.forEach(function(e){return e.style.width=0})})},handleNodeClick:function(e){this.$emit("input",e[this.props.value]),this.$emit("change",{node:e,dom:this.$refs.tsSselect}),this.$refs.tsSselect.blur(),this.defaultExpandedKey=[]},clearHandle:function(){this.valueTitle="",this.valueId=null,this.defaultExpandedKey=[],this.clearSelected(),this.$emit("input",null),this.$emit("change",null)},clearSelected:function(){document.querySelectorAll("#tree-option .el-tree-node").forEach(function(e){return e.classList.remove("is-current")})}}},"watch",{value:function(){this.valueId=this.value,0===this.value&&(this.valueTitle="顶级菜单"),this.initHandle()}})},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(22),o=n(23),i=n(25),a=Object.defineProperty;t.f=n(0)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n.n(r);for(var i in r)"default"!==i&&function(e){n.d(t,e,function(){return r[e]})}(i);var a=n(28),u=!1;var l=function(e){u||n(8)},c=n(13)(o.a,a.a,!1,l,"data-v-24dbbcae",null);c.options.__file="src/components/tree.vue",t.default=c.exports},function(e,t,n){var r=n(9);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(11)("682353eb",r,!1,{})},function(e,t,n){(e.exports=n(10)(void 0)).push([e.i,"\n.el-scrollbar .el-scrollbar__view .el-select-dropdown__item[data-v-24dbbcae] {\r\n height: auto;\r\n max-height: 274px;\r\n padding: 0;\r\n overflow: hidden;\r\n overflow-y: auto;\n}\n.el-select-dropdown__item.selected[data-v-24dbbcae] {\r\n font-weight: normal;\n}\nul li[data-v-24dbbcae] .el-tree .el-tree-node__content {\r\n height: auto;\r\n padding: 0 20px;\n}\n.el-tree-node__label[data-v-24dbbcae] {\r\n font-weight: normal;\n}\n.el-tree[data-v-24dbbcae] .is-current .el-tree-node__label {\r\n color: #409eff;\r\n font-weight: 700;\n}\n.el-tree[data-v-24dbbcae] .is-current .el-tree-node__children .el-tree-node__label {\r\n color: #606266;\r\n font-weight: normal;\n}\r\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+new Buffer(JSON.stringify(a)).toString("base64")+" */"),i=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(i).concat([o]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)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.");var o=n(12),i={},a=r&&(document.head||document.getElementsByTagName("head")[0]),u=null,l=0,c=!1,s=function(){},f=null,d="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e){for(var t=0;t<e.length;t++){var n=e[t],r=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(y(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o<n.parts.length;o++)a.push(y(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:a}}}}function v(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function y(e){var t,n,r=document.querySelector("style["+d+'~="'+e.id+'"]');if(r){if(c)return s;r.parentNode.removeChild(r)}if(p){var o=l++;r=u||(u=v()),t=_.bind(null,r,o,!1),n=_.bind(null,r,o,!0)}else r=v(),t=function(e,t){var n=t.css,r=t.media,o=t.sourceMap;r&&e.setAttribute("media",r);f.ssrId&&e.setAttribute(d,t.id);o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}e.exports=function(e,t,n,r){c=n,f=r||{};var a=o(e,t);return h(a),function(t){for(var n=[],r=0;r<a.length;r++){var u=a[r];(l=i[u.id]).refs--,n.push(l)}t?h(a=o(e,t)):a=[];for(r=0;r<n.length;r++){var l;if(0===(l=n[r]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete i[l.id]}}}};var b,m=(b=[],function(e,t){return b[e]=t,b.filter(Boolean).join("\n")});function _(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=i[0],u={id:e+":"+o,css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(u):n.push(r[a]={id:a,parts:[u]})}return n}},function(e,t){e.exports=function(e,t,n,r,o,i){var a,u=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(a=e,u=e.default);var c,s="function"==typeof u?u.options:u;if(t&&(s.render=t.render,s.staticRenderFns=t.staticRenderFns,s._compiled=!0),n&&(s.functional=!0),o&&(s._scopeId=o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},s._ssrRegister=c):r&&(c=r),c){var f=s.functional,d=f?s.render:s.beforeCreate;f?(s._injectStyles=c,s.render=function(e,t){return c.call(t),d(e,t)}):s.beforeCreate=d?[].concat(d,c):[c]}return{esModule:a,exports:u,options:s}}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(15),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){e.exports={default:n(16),__esModule:!0}},function(e,t,n){n(17);var r=n(4).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(18);r(r.S+r.F*!n(0),"Object",{defineProperty:n(5).f})},function(e,t,n){var r=n(3),o=n(4),i=n(19),a=n(21),u=n(27),l=function(e,t,n){var c,s,f,d=e&l.F,p=e&l.G,h=e&l.S,v=e&l.P,y=e&l.B,b=e&l.W,m=p?o:o[t]||(o[t]={}),_=m.prototype,g=p?r:h?r[t]:(r[t]||{}).prototype;for(c in p&&(n=t),n)(s=!d&&g&&void 0!==g[c])&&u(m,c)||(f=s?g[c]:n[c],m[c]=p&&"function"!=typeof g[c]?n[c]:y&&s?i(f,r):b&&g[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?i(Function.call,f):f,v&&((m.virtual||(m.virtual={}))[c]=f,e&l.R&&_&&!_[c]&&a(_,c,f)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){var r=n(20);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(5),o=n(26);e.exports=n(0)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(1);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(0)&&!n(6)(function(){return 7!=Object.defineProperty(n(24)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),o=n(3).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(1);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"selecttree"}},[n("el-select",{ref:"tsSselect",attrs:{value:e.valueTitle,clearable:e.clearable},on:{clear:e.clearHandle}},[n("el-option",{staticClass:"options",attrs:{value:e.valueTitle,label:e.valueTitle}},[n("el-tree",{ref:"selectTree",attrs:{id:"tree-option","default-expand-all":"","expand-on-click-node":!1,accordion:e.accordion,data:e.options,props:e.props,"node-key":e.props.value,"default-expanded-keys":e.defaultExpandedKey},on:{"node-click":e.handleNodeClick}})],1)],1)],1)};r._withStripped=!0;var o={render:r,staticRenderFns:[]};t.a=o}]).default}); |
|
Vue.component('tree-select', treeSelect) |