chunk-2d22652a.50aa216b.js 1.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22652a"],{e7bd:function(e,t,l){"use strict";l.r(t);var n=function(){var e=this,t=e._self._c;return t("el-cascader",{attrs:{options:e.options,props:{multiple:!0},separator:":",clearable:"",filterable:""},on:{change:e.onChange},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}})},a=[],s=(l("f16c"),l("45d2"),l("4e1c"),l("8160"),l("9052"),{props:{value:[String,Number,Array],props:Object,on:Object},data(){return{options:[],newValue:[]}},watch:{value(){this.parse()}},created(){let e=[],t=[];const l=e=>{for(let n in e){let{permission:a}=e[n];a?t=[...t,Object.values(a)].flat():l(e[n])}};l(this.$service),t.filter(e=>e.includes(":")).map(e=>e.split(":")).forEach(t=>{const l=(e,n)=>{let a=t[e],s=n.findIndex(e=>e.label==a);if(s>=0)l(e+1,n[s].children);else{let s=e==t.length-1;n.push({label:a,value:a,children:s?null:[]}),s||l(e+1,n[n.length-1].children||[])}};l(0,e)}),this.options=e},mounted(){this.parse()},methods:{parse(){this.newValue=this.value?this.value.split(",").map(e=>e.split(":")):[]},onChange(e){this.$emit("input",e.map(e=>e.join(":")).join(","))}}}),i=s,o=l("1805"),r=Object(o["a"])(i,n,a,!1,null,"04676ca6",null);t["default"]=r.exports}}]);