module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},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="59d6")}({"59d6":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"checkTag"},[e.showAllPick&&e.flag?n("span",{staticClass:"el-tag noColor",on:{click:e.pickAll}},[e._v("全选")]):e._e(),e.showAllPick&&!e.flag?n("span",{staticClass:"el-tag noColor",on:{click:e.pickNone}},[e._v("全不选")]):e._e(),e._l(e.list,(function(t){return[t.check?n("el-tag",{key:t[e.mapper.value],attrs:{size:e.size,"disable-transitions":!0,closable:!e.readonly},on:{close:function(n){return e.remove(t)}}},[e._v(" "+e._s(t[e.mapper.label])+" ")]):e.readonly?e._e():n("span",{key:t[e.mapper.value],staticClass:"el-tag noColor",on:{click:function(n){return e.pick(t)}}},[e._v(" "+e._s(t[e.mapper.label])+" ")])]}))],2)},s=[],r={name:"checkTag",data(){return{list:[],flag:!0}},props:{value:{type:[Array,String],default(){return[]}},readonly:{type:Boolean,default:!1},size:{type:String,default:"small"},options:Array,showAllPick:{type:Boolean,default:!1},multiple:{type:Boolean,default:!0},mapper:{type:Object,default(){return{label:"label",value:"value",children:"children"}}}},watch:{value:{deep:!0,immediate:!0,handler(){this.init()}}},computed:{check(){return this.list.filter(e=>e.check)}},methods:{init(){this.list=this.options,this.list.map(e=>{this.value.indexOf(e[this.mapper.value])>=0?this.$set(e,"check",!0):this.$set(e,"check",!1)})},pickAll(){this.list.map(e=>{this.$set(e,"check",!0)}),this.flag=!this.flag,this.$emit("change",this.check),this.setValue()},pickNone(){this.list.map(e=>{this.$set(e,"check",!1)}),this.flag=!this.flag,this.$emit("change",this.check),this.setValue()},pick(e){this.multiple?(this.$set(e,"check",!0),this.$emit("change",this.check)):(this.check.map(e=>{e.check=!1}),this.$set(e,"check",!0),this.$emit("change",this.check)),this.setValue()},remove(e){this.$set(e,"check",!1),this.$emit("change",this.check),this.setValue()},setValue(){const e=[];this.check.map(t=>{e.push(t[this.mapper.value])}),this.$emit("input",e)}}},a=r,l=(n("7719"),n("cba8")),c=Object(l["a"])(a,i,s,!1,null,"6b051dd4",null),o=c.exports;o.install=function(e){e.component("SCheckTag",o)};t["default"]=o},7719:function(e,t,n){"use strict";n("8f1a")},"8f1a":function(e,t,n){},cba8:function(e,t,n){"use strict";function i(e,t,n,i,s,r,a,l){var c,o="function"===typeof e?e.options:e;if(t&&(o.render=t,o.staticRenderFns=n,o._compiled=!0),i&&(o.functional=!0),r&&(o._scopeId="data-v-"+r),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},o._ssrRegister=c):s&&(c=l?function(){s.call(this,(o.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(o.functional){o._injectStyles=c;var u=o.render;o.render=function(e,t){return c.call(t),u(e,t)}}else{var h=o.beforeCreate;o.beforeCreate=h?[].concat(h,c):[c]}return{exports:e,options:o}}n.d(t,"a",(function(){return i}))}});