text: (function(e){function t(t){for(var n,l,o=t[0],r=t[1],c=t[2],d=0,m=[];d<o.length;d++)l=o[d],Object.prototype.hasOwnProperty.call(i,l)&&i[l]&&m.push(i[l][0]),i[l]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);u&&u(t);while(m.length)m.shift()();return s.push.apply(s,c||[]),a()}function a(){for(var e,t=0;t<s.length;t++){for(var a=s[t],n=!0,o=1;o<a.length;o++){var r=a[o];0!==i[r]&&(n=!1)}n&&(s.splice(t--,1),e=l(l.s=a[0]))}return e}var n={},i={app:0},s=[];function l(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,l),a.l=!0,a.exports}l.m=e,l.c=n,l.d=function(e,t,a){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(l.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(a,n,function(t){return e[t]}.bind(null,n));return a},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="https://cdn.jsdelivr.net/gh/lin09/dist/oos/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],r=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var u=r;s.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"122b":function(e,t,a){"use strict";a("2efb")},"18d9":function(e,t){e.exports=VueQuillEditor},"2efb":function(e,t,a){},"35e4":function(e,t,a){"use strict";a("e3df")},"38b6":function(e,t,a){"use strict";a("7b3b")},"4e72":function(e,t){e.exports=antd},5632:function(e,t,a){},"56d7":function(e,t,a){"use strict";a.r(t);a("9175"),a("14da"),a("07c3"),a("2ed6");var n=a("8bbf"),i=a.n(n),s=a("4e72"),l=a.n(s),o=a("18d9"),r=a.n(o),c=a("b57f"),u=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[a("router-view")],1)},d=[],m=(a("7faf"),a("8b4d")),p={},h=Object(m["a"])(p,u,d,!1,null,null,null),f=h.exports,b=a("e1a2");Object(b["a"])("/service-worker.js",{ready:function(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered:function(){console.log("Service worker has been registered.")},cached:function(){console.log("Content has been cached for offline use.")},updatefound:function(){console.log("New content is downloading.")},updated:function(){console.log("New content is available; please refresh.")},offline:function(){console.log("No internet connection found. App is running in offline mode.")},error:function(e){console.error("Error during service worker registration:",e)}});a("6b91"),a("085c");var g=a("1d7b"),v=a("60bb"),y=a.n(v),_=a("6389"),O=a.n(_),j=(a("7978"),a("4ecd"),a("9f18"),location.hostname.replace(/.+?([a-z]+\.cn)$/,"$1")),w=1*(location.pathname.match(/^\/?(\d+)/)||[])[1],S={OSS:"oss.".concat(j),OOS:"oos.".concat(j),FILE:"file.".concat(j)};Object.freeze(S);var x={ACCOUNT_API:"".concat(location.protocol,"//account-api.").concat(S.OOS),ACCOUNT_FRONTEND:"".concat(location.protocol,"//account.").concat(S.OOS),SYSTEM_API:"".concat(location.protocol,"//system-api.").concat(S.OOS),OSS:"".concat(location.protocol,"//").concat(S.OSS),FILE:"".concat(location.protocol,"//").concat(S.FILE),CDN:"https://cdn.jsdelivr.net/gh/lin09/files"};Object.freeze(x);var k=a("a2c5"),E=a.n(k),C=y.a.cloneDeep(E.a),T=(a("128b"),function(e){var t=e.image,a=e.width,n=e.height,i=e.quality;return new Promise((function(e){var s=document.createElement("canvas"),l=s.getContext("2d");s.width=a,s.height=n,l.drawImage(t,0,0,a,n),s.toBlob(e,"image/webp",i||.85)}))}),$=function(e){return new Promise((function(t,a){var n=new Image;n.addEventListener("load",(function(){t(n)})),n.addEventListener("error",a),n.src=e}))},D=function(e){return new Promise((function(t,a){var n=new FileReader;n.addEventListener("load",(function(){t(n.result)})),n.addEventListener("error",a),n.readAsDataURL(e)}))},L=function(e){var t=e.file,a=e.width,n=e.height,i=e.quality;return new Promise((function(e){D(t).then((function(t){$(t).then((function(t){a||(a=t.width>1200?1200:t.width),n||(n=t.height/(t.width/a)),T({image:t,width:a,height:n,quality:i}).then(e)}))}))}))},N=function(e,t){y.a.isObject(t)&&(t=JSON.stringify(t)),localStorage.setItem(e,t)},B=function(e){var t=localStorage.getItem(e);try{t=JSON.parse(t)}catch(a){}return t},F=(a("8bd3"),function(e){return new Promise((function(t,a){var n=new FileReader;n.readAsArrayBuffer(e),n.onload=function(){return t(C.MD5(C.lib.WordArray.create(n.result)).toString())},n.onerror=function(e){return a(e)}}))}),I=function(e){return C.MD5("tn0Zc7YrEFmLp56o"+e+"0n9M1KrAQ84t6lsH").toString()},P="",A=function(e){return C.MD5(e).toString()},R=function(e){P=e},q=function(e,t){return A(e+P+t)},M=a("cebe"),z=a.n(M),V=a("c32d"),U=a.n(V),K="account_token",J="system_token_",G=function(e){var t={};try{t=JSON.parse(atob((e+"").replace(/(.+)\..+/,"$1")))}catch(a){window.console.error(a)}return t},H=function(e){return G(e).exp>U()().unix()+1800},W=function(){var e=localStorage.getItem(K);return e&&H(e)?e:""},Q=function(e){return!(!e||!H(e))&&(localStorage.setItem(K,e),!0)},Y=function(){var e=W();return e?G(e).id:0},Z=function(){return localStorage.removeItem(K)},X=function(e){var t=G(e);return!!(t.exp&&t.uid&&t.sid)&&t.exp>U()().unix()+1800},ee=function(e){var t=localStorage.getItem("".concat(J).concat(e));return t&&X(t)?t:""},te=function(e){var t=ee(e);return t?G(t).uid:0},ae=function(e,t){return!!X(t)&&(localStorage.setItem("".concat(J).concat(e),t),!0)},ne=function(e){return localStorage.removeItem("".concat(J).concat(e))},ie=function e(t){ne(w),!e.showed&&s["Modal"].error({title:t,onOk:function(){window.location.replace(x.ACCOUNT_FRONTEND)}}),e.showed=!0},se=function(e){var t=z.a.create(e);return t.interceptors.request.use((function(e){return!1!==e.useAuth&&(e.headers.auth=e.headers.auth||ee(w)),e}),(function(e){return s["notification"].error({message:e.message}),Promise.reject(e)})),t.interceptors.response.use((function(e){return e.data}),(function(e){if(401===y.a.get(e,"response.status")&&ee(w))ne(w),window.location.reload();else{var t=B("language_base_"+w)||{};if(!1!==e.config.showError){var a=y.a.get(e,"response.data")||"";a=a.replace(/\n|\r$/,""),"system_stopped"===a?ie(t.system_stopped||"System stopped"):s["notification"].error({message:y.a.get(e,"response.status")||e.message,description:t[a]||a})}}return Promise.reject(e)})),t},le=function(e){var t=e.length;y.a.forOwn(sessionStorage,(function(e){t+=e.length})),t>4194304&&sessionStorage.clear()},oe=function(e,t){y.a.isObject(t)&&(t=JSON.stringify(t)),le(t),sessionStorage.setItem(e,t)},re=function(e){var t=sessionStorage.getItem(e);try{t=JSON.parse(t)}catch(a){}return t},ce=se({baseURL:x.SYSTEM_API}),ue=se({baseURL:x.ACCOUNT_API}),de=se({baseURL:x.OSS,useAuth:!1}),me=(a("7914"),a("989f"),function(e){return delete e.sync,"q-".concat(e.table.name,"-").concat(C.MD5(JSON.stringify(Object(g["a"])(Object(g["a"])({},e),{},{SID:w}))).toString())}),pe={},he=function(e,t,a){return new Promise((function(n,i){var s=a.sync,l=me(a);if(!s){var o=re(l);if(!y.a.isEmpty(o))return n(o)}var r=pe[l];r||(pe[l]=e.post("/query/".concat(t),a).then((function(e){return oe(l,e),e})),r=pe[l]),r.then(n).catch(i).finally((function(){delete pe[l]}))}))},fe=he,be=function(e){var t=e.auth,a=e.sid;return ce.post("/login",{h:q(t,a),sid:a},{headers:{auth:t}})},ge=function(e){return fe(ce,"all",e)},ve=function(e){return fe(ce,"list",e)},ye=function(e){return ce.post("/save",e).then((function(t){return y.a.forOwn(sessionStorage,(function(t,a){var n=new RegExp("^q-".concat(e.table.name,"-"));n.test(a)&&sessionStorage.removeItem(a)})),t}))},_e=function(e){return de.get("/exist/"+e)},Oe=function(){return encodeURIComponent(window.location.href.replace(/(\?|&)auth=.+$/,""))},je=function(){window.location.replace("".concat(x.ACCOUNT_FRONTEND,"/login?redirect=").concat(Oe()))},we=function(){Z(),ne(w),window.location.replace("".concat(x.ACCOUNT_FRONTEND,"/logout?redirect=").concat(Oe()))},Se=document.getElementById("loading"),xe=function(e){y.a.set(Se,"style.display",!1!==e?"flex":"none")};xe(!1);var ke=function(e,t){xe();var a=(1*localStorage.getItem("try_to_login_num")||0)+1;if(a>2)return localStorage.setItem("try_to_login_num",0),void we();localStorage.setItem("try_to_login_num",a),be({auth:e,sid:w}).then((function(e){ae(w,e)?t():s["Modal"].error({title:"error",content:"Token error"})})).catch((function(e){var t=B("language_base_"+w)||{},a=y.a.get(e,"response.data")||"";a=a.replace(/\n|\r$/,""),s["Modal"].error({title:y.a.get(e,"response.status")||e.message,content:t[a]||a,onOk:function(){ne(w),window.location.replace(x.ACCOUNT_FRONTEND)}})})).finally((function(){xe(!1)}))},Ee=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-config-provider",{attrs:{locale:e.locale}},[a("a-layout",{staticStyle:{"min-height":"100vh"}},[e.miniSider?[a("a-drawer",{attrs:{placement:"left",closable:!1,visible:e.visibleSiderDrawer,width:200,bodyStyle:{display:"flex",padding:0,minHeight:"100vh"}},on:{close:function(t){e.visibleSiderDrawer=!1}}},[a("Sider",{attrs:{collapsible:!1}})],1)]:a("Sider",{on:{collapse:function(t){return e.visiblePageTitle=t}}}),a("a-layout",[a("Header",{attrs:{mini:e.miniSider},scopedSlots:e._u([{key:"title",fn:function(){return[a("span",{staticClass:"ant-page-header-heading-title"},[e._v(e._s(e.pageTitle))])]},proxy:!0}])},[a("a",{directives:[{name:"show",rawName:"v-show",value:e.miniSider,expression:"miniSider"}],staticClass:"sider-unfold",on:{click:function(t){t.preventDefault(),e.visibleSiderDrawer=!0}}},[a("a-icon",{attrs:{type:"menu-unfold"}})],1)]),a("a-layout-content",[a("router-view"),a("a-back-top")],1),a("a-layout-footer",{staticStyle:{"text-align":"center"}},[e._v(" OOS v."+e._s(e.APP_VERSION)+" ©2020 Created by "),a("a",{attrs:{href:"//"+e.DOMAIN,target:"_blank"}},[e._v(" "+e._s(e.DOMAIN)+" ")])])],1)],2)],1)},Ce=[],Te=(a("f2a0"),a("5880")),$e=a.n(Te),De=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-layout-header",{style:{padding:e.mini&&"0 10px",background:"#fff"}},[a("a-row",{staticStyle:{height:"100%"},attrs:{type:"flex",align:"middle",justify:"space-between"}},[a("a-row",{attrs:{type:"flex",align:"middle"}},[e._t("default"),a("span",{staticClass:"ant-page-header-heading-title"},[e._v(e._s(e.system.name))]),e._t("title")],2),a("a-row",{attrs:{type:"flex",align:"middle"}},[a("LocaleSelect"),a("UserMenu"),a("Fullscreen")],1)],1)],1)},Le=[],Ne=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-dropdown",{attrs:{placement:"bottomCenter"}},[a("a-button",{attrs:{type:"link",icon:"global"}},[e._v(" "+e._s(e.locale.selected.native_name||"language")+" ")]),a("a-menu",{staticStyle:{"overflow-y":"auto","max-height":"80vh"},attrs:{slot:"overlay"},slot:"overlay"},[a("a-menu-item",{directives:[{name:"show",rawName:"v-show",value:e.locale.all.loading,expression:"locale.all.loading"}]},[a("a-spin")],1),e._l(e.locale.all.data,(function(t,n){return a("a-menu-item",{key:n},[a("a",{on:{click:function(a){return a.preventDefault(),e.select(t)}}},[e._v(e._s(t.native_name))])])}))],2)],1)},Be=[],Fe={computed:Object(g["a"])({},Object(Te["mapState"])({locale:function(e){return e.locale}})),watch:{"locale.selected":function(){this.handleGetLanguage()}},created:function(){this.getLocale(),this.handleGetLanguage()},methods:Object(g["a"])(Object(g["a"])(Object(g["a"])(Object(g["a"])(Object(g["a"])(Object(g["a"])(Object(g["a"])({},Object(Te["mapMutations"])("locale",{select:"select"})),Object(Te["mapActions"])("locale",{getLocale:"getAll"})),Object(Te["mapActions"])("languageBase",{getLanguageBase:"get"})),Object(Te["mapActions"])("languageTable",{getLanguageTable:"get"})),Object(Te["mapActions"])("languageTableColumn",{getLanguageTableColumn:"get"})),Object(Te["mapActions"])("languageMenuGroup",{getLanguageMenuGroup:"get"})),{},{handleGetLanguage:function(){var e=this.locale.selected.id?this.locale.selected.id:50;this.getLanguageBase(e),this.getLanguageTable(e),this.getLanguageTableColumn(e),this.getLanguageMenuGroup(e)}})},Ie=Fe,Pe=Object(m["a"])(Ie,Ne,Be,!1,null,null,null),Ae=Pe.exports,Re=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-dropdown",{attrs:{placement:"bottomCenter"}},[a("a",{staticClass:"ant-dropdown-link",staticStyle:{margin:"0 20px","line-height":"32px"}},[a("User",{attrs:{value:e.id}})],1),a("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[a("a-menu-item",[a("a",{staticStyle:{padding:"8px 40px"},attrs:{href:e._f("accountF")("/")}},[a("a-icon",{attrs:{type:"appstore"}}),e._v(" "+e._s(e.languageBase.my_system)+" ")],1)]),a("a-menu-item",[a("a",{staticStyle:{padding:"8px 40px"},attrs:{href:e._f("accountF")("/user")}},[a("a-icon",{attrs:{type:"user"}}),e._v(" "+e._s(e.languageBase.personal_center)+" ")],1)]),a("a-menu-item",[a("a",{staticStyle:{padding:"8px 40px"},attrs:{href:e._f("accountF")("/loginList")}},[a("a-icon",{attrs:{type:"login"}}),e._v(" "+e._s(e.languageBase.login_logs)+" ")],1)]),a("a-menu-divider"),a("a-menu-item",[a("a-button",{attrs:{block:"",type:"link",icon:"logout",size:"small"},on:{click:e.logout}},[e._v(" "+e._s(e.languageBase.logout)+" ")])],1)],1)],1)},qe=[],Me=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-row",{staticStyle:{"flex-wrap":"nowrap"},attrs:{type:"flex",align:"middle"}},[a("Avatar",{attrs:{value:e.detail.avatar,params:e.params}}),e.detail.id?a("span",{staticStyle:{"margin-left":"8px"}},[e._v(" "+e._s(e.detail.name||"uid("+e.detail.id+")")+" ")]):e._e()],1)},ze=[],Ve=(a("98f2"),a("82b7"),a("5f5c"),a("a23b")),Ue=function(e){return fe(ue,"all",e)},Ke=function(e){return fe(ue,"list",e)},Je=function e(t){var a=t.id;return new Promise((function(t,n){if(!a)return t();var i=function(){return t(e.users[a])};if(e.users[a])return i();clearTimeout(e.timeout),e.ids=y.a.uniq([].concat(Object(Ve["a"])(e.ids),[a])),e.resolves=[].concat(Object(Ve["a"])(e.resolves),[i]),e.rejects=[].concat(Object(Ve["a"])(e.rejects),[n]),e.timeout=setTimeout((function(){var t=e.ids,a=e.resolves,n=e.rejects;e.ids=[],e.resolves=[],e.rejects=[],Ue({table:{name:"user",no_default_field:!0,fields:["id","avatar","name"],filters:[[["id","IN",t]]]}}).then((function(t){var n=t.data;y.a.forEach(n,(function(t){e.users[t.id]=t})),y.a.forEach(a,(function(e){return e()}))})).catch((function(e){y.a.forEach(n,(function(t){return t(e)}))}))}),500)}))};Je.ids=[],Je.users={},Je.resolves=[],Je.rejects=[];var Ge,He,We,Qe,Ye,Ze,Xe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",[e.value?a("a-avatar",{attrs:{src:e._f("cdn")(e.value),size:e.params.size}}):a("a-avatar",{attrs:{icon:"user",size:e.params.size}})],1)},et=[],tt={name:"data-show-avatar",props:{value:String,params:{type:Object,default:function(){return{}}}}},at=tt,nt=Object(m["a"])(at,Xe,et,!1,null,null,null),it=nt.exports,st={name:"data-show-user",components:{Avatar:it},props:{value:Number,params:{type:Object,default:function(){return{}}}},data:function(){return{detail:{}}},created:function(){var e=this;this.value&&Je({id:this.value}).then((function(t){e.detail=t}))}},lt=st,ot=Object(m["a"])(lt,Me,ze,!1,null,null,null),rt=ot.exports,ct={components:{User:rt},data:function(){return{id:Y()}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values}})),methods:{logout:function(){we()}}},ut=ct,dt=Object(m["a"])(ut,Re,qe,!1,null,null,null),mt=dt.exports,pt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-icon",{style:{fontSize:e.size,cursor:"pointer"},attrs:{type:e.isFullscreen?"fullscreen-exit":"fullscreen"},on:{click:e.toggleFullscreen}})},ht=[],ft={props:{size:{type:String,default:"32px"},el:{type:Element,default:function(){return document.documentElement}}},data:function(){return{isFullscreen:!1}},methods:{toggleFullscreen:function(){this.isFullscreen?document.exitFullscreen():this.el.requestFullscreen()}},mounted:function(){var e=this;document.addEventListener("fullscreenchange",(function(){e.isFullscreen=document.fullscreenElement}))}},bt=ft,gt=Object(m["a"])(bt,pt,ht,!1,null,null,null),vt=gt.exports,yt={props:{mini:Boolean},components:{LocaleSelect:Ae,UserMenu:mt,Fullscreen:vt},computed:Object(g["a"])({},Object(Te["mapState"])({system:function(e){return e.user_system.detail.data}}))},_t=yt,Ot=Object(m["a"])(_t,De,Le,!1,null,null,null),jt=Ot.exports,wt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a-layout-sider",{attrs:{collapsible:e.collapsible},on:{collapse:e.handleCollapse},model:{value:e.collapsed,callback:function(t){e.collapsed=t},expression:"collapsed"}},[n("a-row",{staticStyle:{height:"64px","flex-flow":"nowrap"},attrs:{type:"flex",align:"middle",justify:"center"}},[n("img",{staticStyle:{height:"50px"},attrs:{alt:"OOS logo",src:a("9b19a")}}),n("h3",{staticClass:"logo-text"},[e._v(" OOS ")])]),e.menus.length?n("a-menu",{attrs:{theme:"dark","default-selected-keys":e.selectedKeys,"default-open-keys":e.openKeys,mode:"inline"}},[e._l(e.menus,(function(t){return[t.children?n("a-sub-menu",{key:t.name},[n("span",{attrs:{slot:"title"},slot:"title"},[n("a-icon",{attrs:{type:t.icon||"menu"}}),n("span",[e._v(e._s(t.title))])],1),e._l(t.children,(function(t){return[n("a-menu-item",{key:t.name},[n("router-link",{staticClass:"menu-link",attrs:{to:{name:"list",params:{tableName:t.name}},title:t.title}},[n("a-icon",{attrs:{type:t.icon||"table"}}),n("span",[e._v(e._s(t.title))])],1)],1)]}))],2):n("a-menu-item",{key:t.name},[n("router-link",{staticClass:"menu-link",attrs:{to:{name:"list",params:{tableName:t.name}},title:t.title}},[n("a-icon",{attrs:{type:t.icon||"table"}}),n("span",[e._v(e._s(t.title))])],1)],1)]}))],2):e._e()],1)},St=[],xt=(a("9939"),a("d08f"),a("cc03"),a("e166"),{props:{collapsible:{type:Boolean,default:!0}},data:function(){return{uid:Y(),collapsed:!!this.collapsible&&(document.body.offsetWidth<992&&document.body.offsetWidth>768),selectedKeys:[],openKeys:[]}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageTable:function(e){return e.languageTable.values},languageMenuGroup:function(e){return e.languageMenuGroup.values},permission:function(e){return e.permission.values},permissionLoading:function(e){return e.permission.loading},tables:function(e){return e.table.all.data},system:function(e){return e.user_system.detail.data}})),{},{menus:function(){var e=this;if(this.permissionLoading||y.a.isEmpty(this.system)||y.a.isEmpty(this.tables)||this.system.user.id!==this.uid&&y.a.isEmpty(this.permission))return[];var t=y.a.filter(this.tables,(function(t){return!y.a.isEmpty(y.a.get(e.permission,"".concat(t.id,".list")))||e.system.user.id===e.uid&&"member"===t.name})),a=y.a.map(t,(function(t){return Object(g["a"])(Object(g["a"])({},y.a.pick(t,["name","icon","menu_group"])),{},{title:e.languageTable[t.name]||t.name})})),n=y.a.groupBy(a,"menu_group.id");return[].concat(Object(Ve["a"])(n.null||[]),Object(Ve["a"])(y.a.map(y.a.omit(n,["null"]),(function(t){return Object(g["a"])(Object(g["a"])({},y.a.pick(t[0].menu_group,["name","icon"])),{},{title:e.languageMenuGroup[t[0].menu_group.name]||t[0].menu_group.name,children:t})}))))}}),watch:{"$route.name":function(e){this.selectedKeys=[e],"list"===e&&(this.selectedKeys=[this.$route.params.tableName])},"$route.params.tableName":function(e){"list"===this.$route.name&&(this.selectedKeys=[e])},menus:function(){if(!y.a.isEmpty(this.menus)&&y.a.isEmpty(this.selectedKeys)){var e,t=this.$route,a=t.path,n=t.name,i=t.params,s=i.tableName;"list"!==n&&"/"!==a&&(s=n),s&&(e=y.a.find(this.menus,(function(e){return e.children?-1!==y.a.findIndex(e.children,(function(e){return e.name===s})):e.name===s}))),y.a.isEmpty(e)&&(e=this.menus[0],s=e.children?e.children[0].name:e.name),e.children&&(this.openKeys=[e.name]),this.selectedKeys=[s],("list"===n&&i.tableName!==s||"list"!==n&&n!==s)&&this.$router.replace({name:"list",params:{tableName:s}})}}},created:function(){this.fetchPermission(),this.getAllTable()},mounted:function(){this.handleCollapse()},methods:Object(g["a"])(Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("permission",{fetchPermission:"fetch"})),Object(Te["mapActions"])("table",{getAllTable:"getAll"})),{},{handleCollapse:function(){this.$emit("collapse",this.collapsed)}})}),kt=xt,Et=(a("122b"),Object(m["a"])(kt,wt,St,!1,null,null,null)),Ct=Et.exports,Tt={name:"Main",components:{Header:jt,Sider:Ct},data:function(){var e=document.body.offsetWidth<=768;return{DOMAIN:j,APP_VERSION:"0.1.2-beta",locale:y.a.cloneDeep(window.antd.locales.zh_CN),visibleSiderDrawer:!0,miniSider:e,visiblePageTitle:e}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({localeCode:function(e){return e.locale.selected.code},languageBase:function(e){return e.languageBase.values},languageTable:function(e){return e.languageTable.values},system:function(e){return e.user_system.detail.data}})),{},{pageTitle:function(){if(!this.visiblePageTitle)return"";var e=this.$route.name;return e="list"===e?this.languageTable[this.$route.params.tableName]||this.$route.params.tableName:this.languageTable[e]||this.languageBase[e]||e,"- "+e}}),watch:{localeCode:function(){this.handleLocale()},$route:function(){this.visibleSiderDrawer=!1}},created:function(){this.getSystemDetail(),this.handleLocale()},mounted:function(){var e=this;setTimeout((function(){e.visibleSiderDrawer=!1}),1e3)},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("user_system",{getSystemDetail:"getDetail"})),{},{handleLocale:function(){this.localeCode&&(this.locale=y.a.cloneDeep(window.antd.locales[this.localeCode]||window.antd.locales.zh_CN),U.a.locale(this.locale.locale))}}),metaInfo:function(){return{htmlAttrs:{lang:this.locale.locale},title:this.system.name&&"/"!==this.$route.path?"".concat(this.languageTable[this.$route.params.tableName]||this.languageTable[this.$route.name]||this.$route.params.tableName||this.$route.name," - ").concat(this.system.name):this.$route.name}}},$t=Tt,Dt=(a("38b6"),Object(m["a"])($t,Ee,Ce,!1,null,null,null)),Lt=Dt.exports,Nt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-result",{attrs:{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."},scopedSlots:e._u([{key:"extra",fn:function(){return[a("a-button",{attrs:{type:"primary"}},[a("router-link",{attrs:{to:"/"}},[e._v("back home")])],1)]},proxy:!0}])})},Bt=[],Ft={metaInfo:{title:"404"}},It=Ft,Pt=Object(m["a"])(It,Nt,Bt,!1,null,null,null),At=Pt.exports,Rt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("Edit",{attrs:{permission:e.permission,tableName:e.$route.params.tableName,id:1*e.$route.query.id,visible:!!e.$route.query.showEdit},on:{close:e.closeEdit}}),a("Detail",{attrs:{permission:e.permission,tableName:e.$route.params.tableName},on:{close:e.closeEdit,edit:function(t){return e.showEdit({id:1*e.$route.query.id})}}}),e.showOperation?a("RolePermission",{ref:"rolePermission"}):e._e(),e.showOperation?a("MemberPermission",{ref:"memberPermission"}):e._e(),a("a-card",{staticStyle:{margin:"16px 24px"},attrs:{bordered:!1}},[e.permission.list?a("Table",{attrs:{storeModule:"list",tableName:e.$route.params.tableName,permission:e.permission},on:{"show-edit":e.showEdit,"show-detail":e.showDetail},scopedSlots:e._u([e.showOperation?{key:"operation",fn:function(t){var n=t.record;return[a("a-button",{attrs:{icon:"safety",size:"small"},on:{click:function(t){return e.showPermission(n)}}},[e._v(" "+e._s(e.languageBase.permission)+" ")])]}}:null],null,!0)}):e._e()],1)],1)},qt=[],Mt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e.permission.search?a("Filters",{attrs:{tableName:e.tableName||e.storeModule,field:e.permission.search,loading:e.list.loading},on:{submit:e.handleFilters}}):e._e(),a("a-modal",{attrs:{width:e.richTextWidth,footer:null},model:{value:e.richTextVisible,callback:function(t){e.richTextVisible=t},expression:"richTextVisible"}},[a("DataShow",{attrs:{componentName:"richText",value:e.richTextContent}})],1),a("a-modal",{attrs:{footer:null},model:{value:e.fileListVisible,callback:function(t){e.fileListVisible=t},expression:"fileListVisible"}},[a("DataShow",{attrs:{componentName:"upload",value:e.filesJson}})],1),a("TableBase",{attrs:{tableName:e.tableName||e.storeModule,columns:e.columnInfo.columns,list:e.list,create:1===e.permission.create,edit:e.editEnabled,detail:!!e.permission.detail,del:1===e.permission.del,stateDisabled:e.stateDisabled,delDisabled:e.delDisabled},on:{change:e.handleChange,"state-change":e.handleChangeItem,delete:e.handleDelete,"show-edit":function(t){return e.$emit("show-edit",t)},"show-detail":function(t){return e.$emit("show-detail",t)}},scopedSlots:e._u([e._l(e.columnInfo.switchs,(function(t){return{key:"switch-"+t.key,fn:function(n){var i=n.text,s=n.record;return[a("a-switch",{key:t.key,attrs:{"checked-children":e.languageBase.opened,"un-checked-children":e.languageBase.closed,checked:!!i,disabled:t.disabled,loading:s.saveLoading},on:{change:function(a){var n;return e.handleChangeItem((n={id:s.id},n[t.key]=!i,n))}}})]}}})),e._l(e.dataShows,(function(e,t){return{key:t,fn:function(n){var i=n.text;return[a("DataShow",{key:t,staticStyle:{"font-size":"14px"},attrs:{componentName:e.componentName,value:i,params:e.params}})]}}})),{key:"richText",fn:function(t){var n=t.text;return[n?a("a-icon",{style:{fontSize:"20px",color:"#185ABD"},attrs:{type:"file-word"},on:{click:function(t){return e.showRichTextModal(n)}}}):a("span",[e._v("-")])]}},{key:"fileList",fn:function(t){var n=t.text;return[n&&"null"!==n?a("a-icon",{style:{fontSize:"20px"},attrs:{type:"paper-clip"},on:{click:function(t){return e.showFileListModal(n)}}}):a("span",[e._v("-")])]}},e._l(e.$scopedSlots,(function(t,n){return{key:n,fn:function(t){var i=t.text,s=t.record,l=t.index;return[a("span",{key:n},[e._t(n,null,{text:i,record:s,index:l})],2)]}}}))],null,!0)})],1)},zt=[],Vt=(a("174c"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-form-model",e._b({staticClass:"filter-form",on:{submit:function(t){return t.preventDefault(),e.handleSubmit(t)}}},"a-form-model",{labelCol:{span:7},wrapperCol:{span:17}},!1),[e._l(e.filterItemsChunk,(function(t,n){return[a("a-row",{directives:[{name:"show",rawName:"v-show",value:0===n||e.expand,expression:"index === 0 || expand"}],key:n,attrs:{gutter:24}},e._l(t,(function(t){return a("a-col",{key:t.key,attrs:{md:24,lg:12,xxl:8}},["state"===t.key?a("a-form-model-item",{attrs:{label:t.label}},[a("a-select",{attrs:{placeholder:e.languageBase.please_select,allowClear:""},model:{value:e.formData[t.key],callback:function(a){e.$set(e.formData,t.key,a)},expression:"formData[item.key]"}},[a("a-select-option",{attrs:{value:1}},[e._v(" "+e._s(e.languageBase.enable)+" ")]),a("a-select-option",{attrs:{value:0}},[e._v(" "+e._s(e.languageBase.disable)+" ")])],1)],1):a("a-form-model-item",{attrs:{label:t.label}},["switch"===t.component?[a("a-select",{attrs:{placeholder:e.languageBase.please_select,allowClear:""},model:{value:e.formData[t.key],callback:function(a){e.$set(e.formData,t.key,a)},expression:"formData[item.key]"}},[a("a-select-option",{attrs:{value:1}},[e._v(" "+e._s(e.languageBase.opened)+" ")]),a("a-select-option",{attrs:{value:0}},[e._v(" "+e._s(e.languageBase.closed)+" ")])],1)]:t.component?[a("DataEntry",{attrs:{componentName:t.component,params:t.params},model:{value:e.formData[t.key],callback:function(a){e.$set(e.formData,t.key,a)},expression:"formData[item.key]"}})]:a("a-input",{attrs:{allowClear:""},model:{value:e.formData[t.key],callback:function(a){e.$set(e.formData,t.key,a)},expression:"formData[item.key]"}})],2)],1)})),1)]})),a("a-row",{staticStyle:{"margin-bottom":"24px"},attrs:{type:"flex",align:"middle",justify:"end"}},[a("a-button",{attrs:{type:"primary","html-type":"submit",icon:"search",loading:e.loading}},[e._v(" "+e._s(e.languageBase.search)+" ")]),a("a-button",{style:{marginLeft:"8px"},on:{click:e.handleReset}},[e._v(" "+e._s(e.languageBase.reset)+" ")]),a("a",{directives:[{name:"show",rawName:"v-show",value:e.filterItemsChunk.length>1,expression:"filterItemsChunk.length > 1"}],style:{marginLeft:"8px"},on:{click:function(t){e.expand=!e.expand}}},[e._v(" "+e._s(e.languageBase.collapse)+" "),a("a-icon",{attrs:{type:e.expand?"up":"down"}})],1)],1)],2)}),Ut=[],Kt=(a("a29d"),a("1df4")),Jt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-input",{attrs:{allowClear:!0,"auto-focus":e.params.autoFocus,disabled:e.params.disabled,placeholder:e.languageBase.please_input},on:{blur:function(t){return e.$emit("blur",e.val)}},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Gt=[],Ht={name:"data-entry-input",props:{value:String,params:{type:Object,default:function(){return{}}}},data:function(){return{val:this.value}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values}})),watch:{value:function(e,t){e!==t&&(this.val=e)},val:function(e,t){e!==t&&this.$emit("input",e)}}},Wt=Ht,Qt=Object(m["a"])(Wt,Jt,Gt,!1,null,null,null),Yt=Qt.exports,Zt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-input-number",{staticStyle:{width:"100%"},attrs:{precision:e.params.precision,step:e.params.step,min:e.params.min,max:e.params.max,placeholder:e.languageBase.please_input,"auto-focus":e.params.autoFocus},on:{blur:function(t){return e.$emit("blur",e.val)}},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Xt=[],ea={name:"data-entry-inputNumber",props:{value:Number,params:Object},data:function(){return{val:this.value}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values}})),watch:{value:function(e,t){e!==t&&(this.val=e)},val:function(e,t){e!==t&&this.$emit("input",e)}}},ta=ea,aa=Object(m["a"])(ta,Zt,Xt,!1,null,null,null),na=aa.exports,ia=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-switch",{attrs:{"checked-children":e.params.checkedChildren,"un-checked-children":e.params.unCheckedChildren,disabled:e.params.disabled,"auto-focus":e.params.autoFocus},on:{blur:function(t){return e.$emit("blur",e.val)}},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},sa=[],la={name:"data-entry-switch",props:{value:[Boolean,Number],params:{type:Object,default:function(){return{}}}},data:function(){return{val:!1===!this.value}},watch:{value:function(e){this.val=e},val:function(e){this.$emit("input",e)}}},oa=la,ra=Object(m["a"])(oa,ia,sa,!1,null,null,null),ca=ra.exports,ua=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-textarea",{attrs:{"auto-size":e.params.autoSize,"auto-focus":e.params.autoFocus,disabled:e.params.disabled,placeholder:e.languageBase.please_input},on:{blur:function(t){return e.$emit("blur",e.val)}},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},da=[],ma={name:"data-entry-textarea",props:{value:String,params:Object},data:function(){return{val:this.value}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values}})),watch:{value:function(e,t){e!==t&&(this.val=e)},val:function(e,t){e!==t&&this.$emit("input",e)}}},pa=ma,ha=Object(m["a"])(pa,ua,da,!1,null,null,null),fa=ha.exports,ba=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",{on:{click:e.initList}},[a("a-select",{staticStyle:{width:"100%"},attrs:{"allow-clear":"","show-search":"","default-active-first-option":!1,"filter-option":!1,loading:e.fetching,placeholder:e.languageBase.please_select,"auto-focus":e.params.autoFocus,disabled:e.params.disabled},on:{search:e.handleSearch,popupScroll:e.popupScroll},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}},[e._l(e.list.data,(function(t,n){return a("a-select-option",{key:n,attrs:{value:t.id}},[e._v(" "+e._s(t[e.column.name])+" ")])})),e.fetching?a("a-select-option",{attrs:{value:"fetching",disabled:""}},[a("a-spin",{attrs:{size:"small"}})],1):e._e()],2)],1)},ga=[],va={name:"data-entry-radioSelect",props:{value:[Number,String],params:Object},data:function(){return this.handleSearch=y.a.debounce(this.handleSearch,500),{val:this.value,fetching:!1,list:{data:[]}}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")}})),{},{column:function(){return this.allTableColumn[this.params.table_column_id]},selected:function(){return y.a.find(this.list.data,{id:this.val})}}),watch:{value:function(e){e!==this.val&&(this.val=e,void 0!==e&&(this.list.data=Object(Ve["a"])(this.params.options)))},val:function(e){void 0===e&&(this.initList.initialized=!1),e!==this.value&&(this.$emit("input",e),this.$emit("change",e,this.selected))},params:function(e,t){y.a.isEqual(e,t)||(this.val=void 0,this.initList.initialized=!1)},selected:function(e){this.$emit("selected",e)}},mounted:function(){this.params.options&&(this.list.data=Object(Ve["a"])(this.params.options))},methods:{fetchList:function(e){var t=this;this.fetching=!0,this.initList.initialized=!0,this.fetchList.params=e,ve(e).then((function(a){e===t.fetchList.params&&(1===a.current?t.list=Object(g["a"])(Object(g["a"])({},a),{},{pages:y.a.ceil(a.total/a.pageSize)}):t.list=Object(g["a"])(Object(g["a"])({},t.list),{},{current:a.current,data:[].concat(Object(Ve["a"])(t.list.data),Object(Ve["a"])(a.data))}))})).finally((function(){e===t.fetchList.params&&(t.fetching=!1)}))},handleParams:function(e){var t={current:1,table:{name:this.column.table.name,no_default_field:!0,fields:["id",this.column.name],order_by:[[this.column.name,"ASC"]],filters:[[["state","=",1]]]}};return e&&t.table.filters[0].push([this.column.name,"LIKE","%".concat(e,"%")]),"role"===this.column.table.name&&t.table.filters[0].push(["id",">",2]),t},handleSearch:function(e){this.fetchList(this.handleParams(e))},initList:function(){this.val||this.initList.initialized||this.params.disabled||(this.list={data:[]},this.initList.initialized=!0,this.fetchList(this.handleParams()))},popupScroll:function(e){if(!this.fetching){var t=e.target,a=t.scrollTop,n=t.clientHeight,i=t.scrollHeight;a+n+1>i&&this.list.pages>this.list.current&&this.fetchList(Object(g["a"])(Object(g["a"])({},this.fetchList.params),{},{current:this.list.current+1}))}}}},ya=va,_a=Object(m["a"])(ya,ba,ga,!1,null,null,null),Oa=_a.exports,ja=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",{on:{click:e.initList}},[a("a-select",{staticStyle:{width:"100%"},attrs:{"allow-clear":"","show-search":"",mode:"multiple","default-active-first-option":!1,"filter-option":!1,loading:e.fetching,placeholder:e.languageBase.please_select},on:{select:e.select,deselect:e.deselect,search:e.handleSearch,popupScroll:e.popupScroll},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}},[e._l(e.list.data,(function(t,n){return a("a-select-option",{key:n,attrs:{value:t.id}},[e._v(" "+e._s(t[e.column.name])+" ")])})),e.fetching?a("a-select-option",{attrs:{value:"fetching",disabled:""}},[a("a-spin",{attrs:{size:"small"}})],1):e._e()],2)],1)},wa=[],Sa={name:"data-entry-multipleSelect",props:{value:Array,params:Object},data:function(){return this.handleSearch=y.a.debounce(this.handleSearch,500),{val:this.value,fetching:!0,list:{data:[]},selected:[]}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},allTableRelated:function(e){return y.a.keyBy(e.table_related.all.data,"id")}})),{},{column:function(){if(y.a.isEmpty(this.allTableRelated))return{};var e=this.allTableRelated[this.params.table_related_id],t=e["t".concat(this.params.index,"_column")].id;return this.allTableColumn[t]}}),watch:{value:function(e){y.a.isEqual(e,this.val)||(this.val=e)},val:function(e){y.a.isEqual(e,this.value)||this.$emit("input",e),y.a.isEmpty(e)&&(this.selected=[])}},mounted:function(){var e=this;y.a.isEmpty(this.allTableRelated)?this.getTableRelated().then((function(){e.fetching=!1})):this.fetching=!1,this.params.options&&(this.list.data=Object(Ve["a"])(this.params.options),this.selected=Object(Ve["a"])(this.params.options))},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("table_related",{getTableRelated:"getAll"})),{},{select:function(e){this.selected.push(y.a.find(this.list.data,{id:e}))},deselect:function(e){y.a.pullAllBy(this.selected,[{id:e}],"id")},fetchList:function(e){var t=this;this.fetching=!0,this.fetchList.params=e,1===e.current&&(this.list={data:[]}),ve(e).then((function(a){e===t.fetchList.params&&(1===a.current?t.list=Object(g["a"])(Object(g["a"])({},a),{},{pages:y.a.ceil(a.total/a.pageSize)}):t.list=Object(g["a"])(Object(g["a"])({},t.list),{},{current:a.current,data:[].concat(Object(Ve["a"])(t.list.data),Object(Ve["a"])(a.data))}))})).finally((function(){e===t.fetchList.params&&(t.fetching=!1)}))},handleParams:function(e){var t={current:1,table:{name:this.column.table.name,no_default_field:!0,fields:["id",this.column.name],order_by:[[this.column.name,"ASC"]],filters:[[["state","=",1]]]}};return e&&(t.table.filters=[[["state","=",1],[this.column.name,"LIKE","%".concat(e,"%")]]]),t},handleSearch:function(e){!y.a.isEmpty(this.column)&&this.fetchList(this.handleParams(e))},initList:function(){!this.fetching&&y.a.isEmpty(this.val)&&!this.initList.initialized&&!this.params.disabled&&this.fetchList(this.handleParams())},popupScroll:function(e){if(!this.fetching){var t=e.target,a=t.scrollTop,n=t.clientHeight,i=t.scrollHeight;a+n+1>i&&this.list.pages>this.list.current&&this.fetchList(Object(g["a"])(Object(g["a"])({},this.fetchList.params),{},{current:this.list.current+1}))}}})},xa=Sa,ka=Object(m["a"])(xa,ja,wa,!1,null,null,null),Ea=ka.exports,Ca=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-checkbox-group",{attrs:{options:e.options},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Ta=[],$a={name:"data-entry-checkbox",props:{value:Array,params:Object},data:function(){return{val:this.value,options:[]}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},allTableRelated:function(e){return y.a.keyBy(e.table_related.all.data,"id")}})),{},{column:function(){if(y.a.isEmpty(this.allTableRelated))return{};var e=this.allTableRelated[this.params.table_related_id],t=e["t".concat(this.params.index,"_column")].id;return this.allTableColumn[t]},selected:function(){var e=this;return y.a.map(this.val,(function(t){return Object(Kt["a"])({id:t},e.column.name,y.a.find(e.options,{value:t}).label)}))}}),watch:{val:function(e,t){y.a.isEqual(e,t)||this.$emit("input",e)}},mounted:function(){y.a.isEmpty(this.allTableRelated)?this.getTableRelated().then(this.getOptions):this.getOptions()},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("table_related",{getTableRelated:"getAll"})),{},{getOptions:function(){var e=this;ge({table:{name:this.column.table.name,no_default_field:!0,fields:["id",this.column.name],filters:[[["state","=",1]]]}}).then((function(t){var a=t.data;e.options=y.a.map(a,(function(t){return{label:t[e.column.name],value:t.id}}))}))}})},Da=$a,La=Object(m["a"])(Da,Ca,Ta,!1,null,null,null),Na=La.exports,Ba=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-cascader",{staticStyle:{width:"100%"},attrs:{"change-on-select":"","field-names":e.fieldNames,options:e.options,"load-data":e.loadData,placeholder:e.languageBase.please_input,popupVisible:e.popupVisible},on:{click:function(t){e.popupVisible=!0},change:e.change,blur:function(t){e.popupVisible=!1},popupVisibleChange:e.popupVisibleChange},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Fa=[],Ia={name:"data-entry-cascader",props:{value:[String,Number],params:Object},data:function(){return{val:[],options:[],popupVisible:!1}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")}})),{},{column:function(){return this.allTableColumn[this.params.table_column_id]||{}},fieldNames:function(){return{label:this.column.name||"lable",value:"id",children:"children"}}}),watch:{column:function(e,t){!y.a.isEqual(e,t)&&this.init()}},created:function(){this.init()},methods:{init:function(){var e=this;!y.a.isEmpty(this.column)&&this.value&&0===this.options.length&&this.getOptions().then((function(t){var a=y.a.map(e.params.options,(function(t){return Object(g["a"])(Object(g["a"])({},t),{},{disabled:e.getDisabled(t.id),isLeaf:!1,init:!1})})),n=y.a.find(a,{id:e.value}),i=[n.id];while(n&&n.pid&&-1===y.a.indexOf(i,n.pid))n=y.a.find(a,{id:n.pid}),i=[n.id].concat(Object(Ve["a"])(i));var s=y.a.find(a,{pid:i[0]});s&&(n=y.a.find(t,{id:i[0]}),n.children=[s],n.init=!1,y.a.forEach(i,(function(e){n=y.a.find(a,{id:e}),s=y.a.find(a,{pid:e}),s&&(n.children=[s],n.init=!1)}))),e.options=t,e.val=i}))},getOptions:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=["state","=","1"],n=[[a,["pid","=",t]]];return t||(n=[].concat(Object(Ve["a"])(n),[[a,["pid","IS",null]]])),ge({table:{name:this.column.table.name,no_default_field:!0,fields:["id",this.column.name],order_by:[[this.column.name,"ASC"]],filters:n}}).then((function(t){var a=t.data;return y.a.map(a,(function(t){return Object(g["a"])(Object(g["a"])({},t),{},{disabled:e.getDisabled(t.id),isLeaf:!1})}))}))},popupVisibleChange:function(e){var t=this;e&&0===this.options.length&&this.getOptions().then((function(e){t.options=e}))},loadData:function(e){var t=this,a=y.a.last(e);a.loading||(a.loading=!0,a.init=!0,this.getOptions(a.id).then((function(e){y.a.isEmpty(e)?(a.isLeaf=!0,t.popupVisible=!1):a.children=e})).finally((function(){a.loading=!1,t.options=Object(Ve["a"])(t.options)})))},change:function(e,t){var a=y.a.last(t);a&&(a.isLeaf?this.popupVisible=!1:!1===a.init&&this.loadData(t)),this.$emit("input",y.a.last(e))},getDisabled:function(e){return this.params.tableName===this.column.table.name&&this.params.id===e}}},Pa=Ia,Aa=Object(m["a"])(Pa,Ba,Fa,!1,null,null,null),Ra=Aa.exports,qa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-radio-group",{attrs:{options:e.options,"auto-focus":e.params.autoFocus,disabled:e.params.disabled},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Ma=[],za={name:"data-entry-radio",props:{value:[Number,String],params:Object},data:function(){return{options:[],val:this.value}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")}})),{},{column:function(){return this.allTableColumn[this.params.table_column_id]},selected:function(){var e=y.a.find(this.options,{value:this.val});return e&&Object(Kt["a"])({id:e.value},this.column.name,e.label)}}),watch:{value:function(e,t){e!==t&&(this.val=e)},val:function(e,t){e!==t&&this.$emit("input",e)}},mounted:function(){this.getOptions()},methods:{getOptions:function(){var e=this;y.a.isEmpty(this.column)||ge({table:{name:this.column.table.name,no_default_field:!0,fields:["id",this.params.table_column_id]}}).then((function(t){var a=t.data;e.options=y.a.map(a,(function(t){return{label:t[e.column.name],value:t.id}}))}))}}},Va=za,Ua=Object(m["a"])(Va,qa,Ma,!1,null,null,null),Ka=Ua.exports,Ja=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-rate",{attrs:{"allow-half":e.params.half,"auto-focus":e.params.autoFocus},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Ga=[],Ha={name:"data-entry-rate",props:{value:Number,params:Object},data:function(){return{val:this.value}},watch:{value:function(e,t){e!==t&&(this.val=e)},val:function(e,t){e!==t&&this.$emit("input",e)}}},Wa=Ha,Qa=Object(m["a"])(Wa,Ja,Ga,!1,null,null,null),Ya=Qa.exports,Za=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-date-picker",{attrs:{format:e.params.format,showTime:e.showTime},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},Xa=[],en={name:"data-entry-datePicker",props:{value:Number,params:Object},data:function(){return{val:this.toMoment(this.value)}},computed:{showTime:function(){return/lll|LLL|H|h|m|s/.test(this.params.format)}},watch:{value:function(e,t){e!==t&&(this.val=this.toMoment(e))},val:function(e,t){e=this.toUnix(e),t=this.toUnix(t),e!==t&&this.$emit("input",e)}},methods:{toMoment:function(e){return e>0?U.a.unix(e):void 0},toUnix:function(e){return e?e.unix():void 0}}},tn=en,an=Object(m["a"])(tn,Za,Xa,!1,null,null,null),nn=an.exports,sn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{height:"104px"}},[a("a-upload",{attrs:{"list-type":"picture-card",accept:"image/jpeg, image/jpg, image/png, image/webp",action:e.action,"file-list":e.fileList,"before-upload":e.beforeUpload,data:e.handleData},on:{change:e.handleChange,preview:function(t){e.previewVisible=!0}}},[e.fileList.length?e._e():a("div",[a("a-icon",{attrs:{type:"plus"}}),a("div",{staticClass:"ant-upload-text"},[e._v(" "+e._s(e.params.width)+" x "+e._s(e.params.height)+" ")])],1)]),a("a-modal",{attrs:{visible:e.previewVisible,footer:null,width:e.params.width+48},on:{cancel:function(t){e.previewVisible=!1}}},[a("img",{staticStyle:{width:"100%"},attrs:{src:e.previewImage}})])],1)},ln=[],on=function(e){return new Promise((function(t,a){e.size>1<<20?t(Object(g["a"])(Object(g["a"])({},e),{},{status:"error",name:e.name+" - 文件大小不能超过1M"})):F(e).then((function(n){_e(n).then((function(a){a&&(e.status="done"),e.hash=n,t(e)})).catch(a)})).catch(a)}))},rn=function(e){return new Promise((function(t,a){L(e).then((function(e){e.size>1<<20?a(new Error("图片不能大于1MB")):F(e).then((function(n){_e(n).then((function(a){a&&(e.status="done"),e.hash=n,t(e)})).catch(a)})).catch(a)})).catch(a)}))},cn={name:"data-entry-image",props:{value:String,params:Object},data:function(){var e=[];return this.value&&(e[0]={url:this.$options.filters.cdn(this.value),status:"done",uid:this.value,name:this.value+".webp"}),{action:"".concat(x.OSS,"/upload"),fileList:e,previewVisible:!1}},computed:{previewImage:function(){return y.a.get(this.fileList,"[0].url")}},methods:{beforeUpload:function(e){var t=this;if(!/^image\/(jpeg|jpg|png|webp)$/.test(e.type))return this.$message.error("只能上传jpg、jpg、png、webp格式图片"),!1;var a=e.uid,n=e.name;return new Promise((function(i,s){rn(Object(g["a"])(Object(g["a"])({},t.params),{},{file:e})).then((function(e){D(e).then((function(l){if(e.url=l,e.uid=a,e.name=n,"done"===e.status)return t.fileList=[e],t.$emit("input",e.hash),s();i(e)})).catch(s)})).catch(s)}))},handleData:function(e){return{h:e.hash,s:I(e.hash).toString()}},handleChange:function(e){var t=e.file,a=e.fileList;this.fileList=a,"done"===t.status&&this.$emit("input",t.hash)}}},un=cn,dn=Object(m["a"])(un,sn,ln,!1,null,null,null),mn=dn.exports,pn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("a-upload",{attrs:{multiple:"","list-type":"picture-card",accept:"image/jpeg, image/jpg, image/png, image/webp",action:e.action,"file-list":e.fileList,"before-upload":e.beforeUpload,data:e.handleData},on:{change:e.handleChange,preview:e.handlePreview}},[a("a-icon",{attrs:{type:"plus"}}),a("div",{staticClass:"ant-upload-text"},[e._v(" "+e._s(e.params.width)+" x "+e._s(e.params.height)+" ")])],1),a("a-modal",{attrs:{visible:e.previewVisible,footer:null,width:e.params.width+48},on:{cancel:function(t){e.previewVisible=!1}}},[a("img",{staticStyle:{width:"100%"},attrs:{src:e.previewImage}})])],1)},hn=[],fn={name:"data-entry-images",props:{value:String,params:Object},data:function(){var e=this,t=[];if(this.value){var a=[];try{a=JSON.parse(this.value),a=y.a.filter(a,(function(e){return!!e}))}catch(n){}t=y.a.map(a,(function(t){return{hash:t,url:e.$options.filters.cdn(t),status:"done",uid:t,name:t+".webp"}}))}return{action:"".concat(x.OSS,"/upload"),fileList:t,previewVisible:!1,previewImage:""}},watch:{fileList:function(e){this.$emit("input",JSON.stringify(y.a.map(e,(function(e){return e.hash}))))}},methods:{beforeUpload:function(e){var t=this;if(!/^image\/(jpeg|jpg|png|webp)$/.test(e.type))return this.$message.error("只能上传jpg、jpg、png、webp格式图片"),!1;var a=e.uid,n=e.name;return new Promise((function(i,s){rn(Object(g["a"])(Object(g["a"])({},t.params),{},{file:e})).then((function(e){D(e).then((function(l){if(e.url=l,e.uid=a,e.name=n,"done"===e.status)return t.fileList.push(e),t.fileList=y.a.uniqBy(t.fileList,"hash"),s();i(e)})).catch(s)})).catch(s)}))},handleData:function(e){return{h:e.hash,s:I(e.hash).toString()}},handleChange:function(e){var t=e.fileList;this.fileList=y.a.uniqBy(t,"hash")},handlePreview:function(e){this.previewImage=e.url,this.previewVisible=!0}}},bn=fn,gn=Object(m["a"])(bn,pn,hn,!1,null,null,null),vn=gn.exports,yn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-range-picker",{staticStyle:{"min-width":"100%"},attrs:{format:e.params.format,showTime:e.showTime},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}})},_n=[],On={name:"data-entry-rangePicker",props:{value:Array,params:Object},data:function(){return{val:y.a.map(this.value,U.a.unix)}},computed:{showTime:function(){return/lll|LLL|H|h|m|s/.test(this.params.format)}},watch:{val:function(e,t){e=this.toUnix(e),t=this.toUnix(t),!y.a.isEqual(e,t)&&this.$emit("input",e)},value:function(e,t){y.a.isEqual(e,t)||y.a.isEqual(e,this.toUnix(this.val))||(this.val=y.a.map(e,U.a.unix))}},methods:{toUnix:function(e){var t=this;return y.a.map(e,(function(e,a){return t.showTime?e.unix():0===a?e.hour(0).minute(0).second(0).unix():e.hour(23).minute(59).second(59).unix()}))}}},jn=On,wn=Object(m["a"])(jn,yn,_n,!1,null,null,null),Sn=wn.exports,xn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-upload",{attrs:{multiple:"",action:e.action,"before-upload":e.beforeUpload,data:e.handleData,"file-list":e.fileList},on:{change:e.handleChange}},[a("a-button",{attrs:{icon:"upload"}},[e._v("上传")])],1)},kn=[],En={name:"data-entry-upload",props:{value:String},data:function(){var e=this,t=[];try{t=y.a.map(JSON.parse(this.value),(function(t){return Object(g["a"])(Object(g["a"])({},t),{},{url:e.getUrl(t),uid:t.hash,status:"done"})}))}catch(a){}return{action:"".concat(x.OSS,"/upload"),fileList:t}},watch:{fileList:function(e){e=y.a.uniqBy(e,"hash"),e=y.a.map(e,(function(e){return y.a.pick(e,["name","hash"])})),this.$emit("input",JSON.stringify(e))}},methods:{beforeUpload:function(e){var t=this;return on(e).then((function(e){return e.status?(-1===y.a.findIndex(t.fileList,{hash:e.hash})?(e.url=t.getUrl(e),t.fileList=[].concat(Object(Ve["a"])(t.fileList),[e])):t.$message.info({content:"".concat(e.name," 已选择")}),Promise.reject()):e}))},handleData:function(e){return{h:e.hash,s:I(e.hash).toString(),private:"1"}},handleChange:function(e){var t=this,a=e.fileList;a=y.a.map(a,(function(e){return e.response&&!e.url&&(e.url=t.getUrl(e)),e})),this.fileList=y.a.uniqBy(a,"hash")},getUrl:function(e){return this.$options.filters.file(e)}}},Cn=En,Tn=Object(m["a"])(Cn,xn,kn,!1,null,null,null),$n=Tn.exports,Dn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-upload",{attrs:{action:e.action,"show-upload-list":!1,"before-upload":e.beforeUpload,data:e.handleData,accept:"image/jpeg, image/jpg, image/png, image/webp"},on:{change:e.handleChange}},[a("a-avatar",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],attrs:{size:100,icon:"loading"}}),e.loading?e._e():[e.src?a("a-avatar",{attrs:{size:100,src:e.src}}):e.value?a("a-avatar",{attrs:{size:100,src:e._f("cdn")(e.value)}}):a("a-avatar",{attrs:{size:100,icon:"user"}})]],2)},Ln=[],Nn={name:"data-entry-avatar",props:{value:String},data:function(){return{action:"".concat(x.OSS,"/upload"),loading:!1,src:""}},methods:{beforeUpload:function(e){var t=this;return-1===["image/jpeg","image/jpg","image/png","image/webp"].indexOf(e.type)?(this.$message.error("只能上传jpg、jpg、png、webp格式图片"),!1):new Promise((function(a,n){rn({file:e,width:100,height:100}).then((function(e){D(e).then((function(i){if(t.src=i,"done"===e.status)return t.$emit("input",e.hash),n();a(e)})).catch(n)})).catch(n)}))},handleData:function(e){return{h:e.hash,s:I(e.hash).toString()}},handleChange:function(e){var t=e.file;"done"===t.status&&this.$emit("input",t.hash),this.loading="uploading"===t.status}}},Bn=Nn,Fn=Object(m["a"])(Bn,Dn,Ln,!1,null,null,null),In=Fn.exports,Pn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"rich-text",class:{"zh-cn":50===e.selectedLocale.id}},[a("span",{ref:"fullscreenQl",staticClass:"ql-formats"},[e.showFullscreen?a("Fullscreen",{staticStyle:{display:"inline-block","vertical-align":"middle"},attrs:{el:e.$el,size:"16px"}}):e._e()],1),a("quill-editor",{ref:"editor",attrs:{options:{placeholder:e.languageBase.please_input}},on:{change:function(t){return e.onEditorChange(t)},blur:function(t){return e.$emit("blur",e.content)}},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}}),a("UploadImage",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],ref:"uploadImage",attrs:{multiple:""}})],1)},An=[],Rn=(a("a3cf"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-upload",{staticClass:"image-upload",attrs:{action:e.action,multiple:e.multiple,"show-upload-list":e.showUploadList,"before-upload":e.beforeUpload,data:e.handleData,accept:"image/jpeg, image/jpg, image/png, image/webp"},on:{change:e.handleChange}})}),qn=[],Mn={name:"data-entry-uploadImage",props:{value:String,width:Number,height:Number,showUploadList:Boolean,multiple:Boolean},data:function(){return{action:"".concat(x.OSS,"/upload")}},methods:{click:function(e){this.click.callback=e,this.$el.getElementsByTagName("input")[0].click()},beforeUpload:function(e){var t=this;return-1===["image/jpeg","image/jpg","image/png","image/webp"].indexOf(e.type)?(this.$message.error("只能上传jpg、jpg、png、webp格式图片"),!1):rn({file:e}).then((function(e){return"done"===e.status?(t.click.callback&&t.click.callback(e),Promise.reject()):e}))},handleData:function(e){return{h:e.hash,s:I(e.hash).toString()}},handleChange:function(e){var t=e.file;"done"===t.status&&this.click.callback&&this.click.callback(t)}}},zn=Mn,Vn=Object(m["a"])(zn,Rn,qn,!1,null,null,null),Un=Vn.exports,Kn={name:"data-entry-richText",components:{Fullscreen:vt,UploadImage:Un},props:{value:{type:String}},data:function(){var e,t=this;if(this.value){var a=document.createElement("div");a.innerHTML=this.value;var n=a.getElementsByTagName("img");y.a.forEach(n,(function(e){e.src=t.$options.filters.cdn(e.dataset.hash)})),e=a.innerHTML}return{content:e,showFullscreen:!1}},computed:Object(g["a"])({},Object(Te["mapState"])({selectedLocale:function(e){return e.locale.selected},languageBase:function(e){return e.languageBase.values}})),watch:{selectedLocale:function(e){var t=e.id;this.$refs.editor.quill.theme.tooltip.root.querySelector("input[data-video]").dataset.video=50===t?"嵌入网址":"Embed URL"}},mounted:function(){var e=this.$refs.editor.quill,t=e.theme.tooltip.root;e.getModule("toolbar").addHandler("image",this.imageHandler),t.querySelector("input[data-link]").dataset.link=location.origin,t.querySelector("input[data-video]").dataset.video=50===this.selectedLocale.id?"嵌入网址":"Embed URL",this.$el.querySelector(".ql-toolbar").appendChild(this.$refs.fullscreenQl),this.showFullscreen=!0},methods:{onEditorChange:function(e){var t=e.html,a=document.createElement("div");a.innerHTML=t;var n=a.getElementsByTagName("img");y.a.forEach(n,(function(e){e.dataset.hash=e.src.replace(/.+\/(.{2})\/(.{2})\/(.{28})$/,"$1$2$3"),e.removeAttribute("src")})),this.$emit("input",a.innerHTML)},imageHandler:function(){var e=this,t=this.$refs.editor.quill,a=t.getSelection();this.$refs.uploadImage.click((function(n){var i=n.arrayBuffer?e.$options.filters.cdn(n.hash):e.$options.filters.oss(n.hash);t.insertEmbed(a.index,"image",i),++a.index,t.setSelection(a)}))}}},Jn=Kn,Gn=(a("aed4"),Object(m["a"])(Jn,Pn,An,!1,null,null,null)),Hn=Gn.exports,Wn=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",{on:{click:e.initList}},[a("a-select",{staticStyle:{width:"100%"},attrs:{"allow-clear":"","show-search":"",mode:"multiple","default-active-first-option":!1,"filter-option":!1,loading:e.fetching,placeholder:e.languageBase.please_select},on:{search:e.handleSearch,popupScroll:e.popupScroll},model:{value:e.val,callback:function(t){e.val=t},expression:"val"}},[e._l(e.list.data,(function(t,n){return a("a-select-option",{key:n,attrs:{value:t.id}},[t.avatar?a("a-avatar",{attrs:{src:e._f("cdn")(t.avatar),size:"small"}}):e._e(),e._v(" "+e._s(t.name||"uid("+t.id+")")+" ")],1)})),e.fetching?a("a-select-option",{attrs:{value:"fetching",disabled:""}},[a("a-spin",{attrs:{size:"small"}})],1):e._e()],2)],1)},Qn=[],Yn={name:"data-entry-user",props:{value:Array,params:Object},data:function(){return this.handleSearch=y.a.debounce(this.handleSearch,500),{val:this.value,fetching:!1,list:{data:[]}}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values}})),watch:{value:function(e){y.a.isEqual(e,this.val)||(this.val=e)},val:function(e){y.a.isEqual(e,this.value)||this.$emit("input",e)}},methods:{fetchList:function(e){var t=this;this.fetching=!0,this.fetchList.params=e,1===e.current&&(this.list={data:[]}),Ke(e).then((function(a){e===t.fetchList.params&&(1===a.current?t.list=Object(g["a"])(Object(g["a"])({},a),{},{pages:y.a.ceil(a.total/a.pageSize)}):t.list=Object(g["a"])(Object(g["a"])({},t.list),{},{current:a.current,data:[].concat(Object(Ve["a"])(t.list.data),Object(Ve["a"])(a.data))}))})).finally((function(){e===t.fetchList.params&&(t.fetching=!1)}))},handleParams:function(e){var t={current:1,table:{name:"user",no_default_field:!0,fields:["id","name","avatar"],order_by:[["name","ASC"]],filters:[[["state","=",1]]]}};if(e){var a=["name","LIKE","%".concat(e,"%")];t.table.filters=[[["state","=",1],a]]}return this.params.filters&&(t.table.filters[0]=[].concat(Object(Ve["a"])(t.table.filters[0]),Object(Ve["a"])(this.params.filters))),t},handleSearch:function(e){this.fetchList(this.handleParams(e))},initList:function(){this.params.filters&&this.fetchList(this.handleParams())},popupScroll:function(e){if(!this.fetching){var t=e.target,a=t.scrollTop,n=t.clientHeight,i=t.scrollHeight;a+n+1>i&&this.list.pages>this.list.current&&this.fetchList(Object(g["a"])(Object(g["a"])({},this.fetchList.params),{},{current:this.list.current+1}))}}}},Zn=Yn,Xn=Object(m["a"])(Zn,Wn,Qn,!1,null,null,null),ei=Xn.exports,ti=(Ge={},Object(Kt["a"])(Ge,Yt.name,Yt),Object(Kt["a"])(Ge,na.name,na),Object(Kt["a"])(Ge,ca.name,ca),Object(Kt["a"])(Ge,fa.name,fa),Object(Kt["a"])(Ge,Oa.name,Oa),Object(Kt["a"])(Ge,Ea.name,Ea),Object(Kt["a"])(Ge,Na.name,Na),Object(Kt["a"])(Ge,Ra.name,Ra),Object(Kt["a"])(Ge,Ka.name,Ka),Object(Kt["a"])(Ge,Ya.name,Ya),Object(Kt["a"])(Ge,nn.name,nn),Object(Kt["a"])(Ge,mn.name,mn),Object(Kt["a"])(Ge,vn.name,vn),Object(Kt["a"])(Ge,Sn.name,Sn),Object(Kt["a"])(Ge,$n.name,$n),Object(Kt["a"])(Ge,In.name,In),Object(Kt["a"])(Ge,Hn.name,Hn),Object(Kt["a"])(Ge,ei.name,ei),Ge),ai={props:{value:[String,Number,Boolean,Array,Object],componentName:String,params:Object},data:function(){return{val:void 0}},watch:{value:function(){this.formatVal()},componentName:function(){this.formatVal()}},created:function(){this.formatVal()},render:function(e){var t=this;return this.componentName?e(ti["data-entry-"+this.componentName],{props:{value:this.val,params:this.params},on:{input:function(e){t.$emit("input",e),t.$emit("change",e)},blur:function(e){t.$emit("blur",e)}}}):e()},methods:{formatVal:function(){var e=this.value,t={}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase();/^(input|textarea|upload|avatar)$/.test(this.componentName)&&"string"!==t?e="":/^(inputNumber|radioSelect|radio|rate|datePicker|year|monthPicker)$/.test(this.componentName)&&"number"!==t?e=void 0:/^(multipleSelect|checkbox)$/.test(this.componentName)&&"array"!==t&&(e=[]),this.val=e}}},ni=ai,ii=Object(m["a"])(ni,He,We,!1,null,null,null),si=ii.exports,li={components:{DataEntry:si},props:{loading:Boolean,tableName:String,field:{type:Object,default:function(){}}},data:function(){return{expand:!1,formData:{},LBDTC_RE:/^(name|state|created_at|updated_at|comment|created_by_uid|updated_by_uid)$/}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTableColumn:function(e){return e.languageTableColumn.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},allDataTyep:function(e){return y.a.keyBy(e.data_type.all.data,"id")}})),{},{filterItems:function(){var e=this;if(y.a.isEmpty(this.field)||y.a.isEmpty(this.languageTableColumn)||y.a.isEmpty(this.allTableColumn)||y.a.isEmpty(this.allDataTyep))return[];var t=[],a={component:"user",params:{filters:[["systems","=",w]]},operator:"IN"};return y.a.forEach(this.field.fields,(function(n){var i=e.allTableColumn[n];if(i){var s=y.a.pick(e.allDataTyep[i.data_type.id],["component","params"]);"member"===i.table.name&&"uid"===i.name?s.component="user":"datePicker"===s.component?s.component="rangePicker":"radio"===s.component?s.component="radioSelect":"checkbox"===s.component?s.component="multipleSelect":/^(textarea|richText)$/.test(s.component)&&(s.component="input"),s.operator="input"===s.component?"LIKE":"=","user"===s.component?s=a:"multipleSelect"===s.component&&(s.operator="IN"),t.push(Object(g["a"])(Object(g["a"])({},s),{},{key:i.name,label:e.handleLabel(i.name)}))}})),y.a.forEach(this.field.defaultFields,(function(n){var i={component:"",params:{},operator:"="};/^(created_at|updated_at)$/.test(n)?(i.component="rangePicker",i.params={format:"LLL"}):/^(created|updated)_by_uid$/.test(n)?i=a:"id"===n&&(i.component="inputNumber",i.params={precision:0,min:1,max:99999999}),t.push(Object(g["a"])(Object(g["a"])({},i),{},{key:n,label:e.handleLabel(n)}))})),t},allFilterItem:function(){return y.a.keyBy(this.filterItems,"key")},filterItemsChunk:function(){return this.filterItems.length<=6?[this.filterItems]:[y.a.slice(this.filterItems,0,6),y.a.slice(this.filterItems,6)]}}),watch:{tableName:function(){this.formData={},this.expand=!1}},methods:{handleLabel:function(e){var t=this.languageTableColumn["".concat(this.tableName,".").concat(e)];return!t&&this.LBDTC_RE.test(e)&&(t=this.languageBase[e]),t||e},handleSubmit:function(){var e=this,t=[];y.a.forEach(this.formData,(function(a,n){if(!(void 0===a||null===a||""===a||y.a.isArray(a)&&y.a.isEmpty(a))){var i=e.createFilte(n,a);i[0]===n?t.push(i):t=[].concat(Object(Ve["a"])(t),Object(Ve["a"])(i))}})),this.$emit("submit",t)},createFilte:function(e,t){var a=this.allFilterItem[e],n=a.operator,i=a.component;return"rangePicker"===i?[[e,">=",t[0]],[e,"<=",t[1]]]:("LIKE"===n&&(t="%".concat(t,"%")),[e,n||"=",t])},handleReset:function(){this.formData={},this.$emit("submit")}}},oi=li,ri=(a("60da"),Object(m["a"])(oi,Vt,Ut,!1,null,null,null)),ci=ri.exports,ui=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-table",{staticClass:"table-base",attrs:{columns:e.tableColumns,"data-source":e.list.data,loading:e.list.loading,pagination:e.pagination,scroll:{x:!0},rowKey:"id",bordered:""},on:{change:e.handleChange},scopedSlots:e._u([e.$scopedSlots.title?null:{key:"title",fn:function(){return[e.$scopedSlots.title?e._e():a("a-row",{attrs:{type:"flex",justify:"space-between",align:"middle"}},[a("div",[e._v(e._s(e.languageTable[e.tableName]||e.tableName))]),e.create?a("a-button",{attrs:{type:"primary",icon:"plus",title:e.languageBase.create},on:{click:function(t){return e.$emit("show-edit")}}}):e._e()],1)]},proxy:!0},e.$scopedSlots.state?null:{key:"state",fn:function(t,n){return[a("a-switch",{attrs:{"checked-children":e.languageBase.enable,"un-checked-children":e.languageBase.disable,disabled:e.getStateDisabled(n),checked:!!t,loading:n.saveLoading},on:{change:function(a){return e.$emit("state-change",{id:n.id,state:!t})}}})]}},e.$scopedSlots.unix?null:{key:"unix",fn:function(t){return[e._v(" "+e._s(e._f("unixFormat")(t))+" ")]}},e._l(e.$scopedSlots,(function(t,n){return{key:n,fn:function(t,i,s){return["operation"!==n?a("span",{key:n},[e._t(n,null,{text:t,record:i,index:s})],2):e._e()]}}})),e.edit||e.del||e.$scopedSlots.operation?{key:"operation",fn:function(t,n,i){return[a("a-space",[e.detail?a("a-button",{attrs:{icon:"eye",size:"small",title:e.languageBase.detail},on:{click:function(t){return e.$emit("show-detail",n)}}}):e._e(),e.edit?a("a-button",{attrs:{type:"primary",icon:"edit",size:"small",disabled:1===n.auth,title:e.languageBase.edit},on:{click:function(t){return e.$emit("show-edit",n)}}}):e._e(),e.del?a("a-popconfirm",{key:"delete",attrs:{disabled:e.getDelDisabled(n),title:e.languageBase.sure_delete},on:{confirm:function(t){return e.$emit("delete",n)}}},[a("a-button",{attrs:{type:"danger",icon:"delete",size:"small",disabled:e.getDelDisabled(n),title:e.languageBase.delete}})],1):e._e(),e._t("operation",null,{text:t,record:n,index:i})],2)]}}:null],null,!0)})},di=[],mi=(a("16e7"),{props:{columns:Array,list:Object,tableName:String,create:Boolean,detail:Boolean,edit:Boolean,del:Boolean,stateDisabled:Function,delDisabled:Function},data:function(){return{LBDTC_RE:/^(name|state|created_at|updated_at|comment|icon|created_by_uid|updated_by_uid|operation|show)$/}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTable:function(e){return e.languageTable.values},languageTableColumn:function(e){return e.languageTableColumn.values},loading:function(e){return e.languageBase.all.loading||e.languageTable.all.loading||e.languageTableColumn.all.loading}})),{},{pagination:function(){var e=this;return this.list.pagination&&Object(g["a"])(Object(g["a"])({},this.list.pagination),{},{showTotal:function(t){return y.a.template(e.languageBase.total_template)({total:t})}})},tableColumns:function(){var e=this;if(this.loading||this.list.loading)return[];var t=y.a.map(this.columns,(function(e){return Object(g["a"])(Object(g["a"])({},e),{},{key:e.key||e.dataIndex})}));return!y.a.find(t,{key:"operation"})&&(this.edit||this.del||this.$scopedSlots.operation)&&t.push({key:"operation",scopedSlots:{customRender:"operation"}}),y.a.map(t,(function(t){var a;return a=/\./.test(t.key)?e.getLTableColumnTitle.apply(e,Object(Ve["a"])(t.key.split("."))):e.languageTableColumn["".concat(e.tableName,".").concat(t.key)],!a&&e.LBDTC_RE.test(t.key)&&(a=e.languageBase[t.key]),Object(g["a"])(Object(g["a"])({},t),{},{title:a||t.title||t.key})}))}}),methods:{getLTableColumnTitle:function(e,t){var a=this.languageTable[e],n=this.languageTableColumn["".concat(e,".").concat(t)];return a&&n?"".concat(a," - ").concat(n):""},handleChange:function(e,t,a){this.$emit("change",e,t,a)},getStateDisabled:function(e){return this.stateDisabled&&this.stateDisabled(e)},getDelDisabled:function(e){return this.delDisabled&&this.delDisabled(e)}}}),pi=mi,hi=(a("35e4"),Object(m["a"])(pi,ui,di,!1,null,null,null)),fi=hi.exports,bi=(a("3ea8"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.value?a("div",{staticStyle:{height:"104px"}},[a("a-upload",{attrs:{disabled:"","list-type":"picture-card","file-list":e.fileList},on:{preview:function(t){e.previewVisible=!0}}}),a("a-modal",{attrs:{visible:e.previewVisible,footer:null,width:e.params.width+48},on:{cancel:function(t){e.previewVisible=!1}}},[a("img",{staticStyle:{width:"100%"},attrs:{src:e._f("cdn")(e.value)}})])],1):e._e()}),gi=[],vi={name:"data-show-image",props:{value:String,params:Object},data:function(){return{previewVisible:!1}},computed:{fileList:function(){return[{url:this.$options.filters.cdn(this.value),status:"done",uid:this.value,name:this.value+".webp"}]}}},yi=vi,_i=Object(m["a"])(yi,bi,gi,!1,null,null,null),Oi=_i.exports,ji=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-rate",{attrs:{value:e.value,"allow-half":"",disabled:""}})},wi=[],Si={name:"data-show-rate",props:{value:Number}},xi=Si,ki=Object(m["a"])(xi,ji,wi,!1,null,null,null),Ei=ki.exports,Ci=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-switch",{attrs:{disabled:""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})},Ti=[],$i={name:"data-show-switch",props:{value:Boolean}},Di=$i,Li=Object(m["a"])(Di,Ci,Ti,!1,null,null,null),Ni=Li.exports,Bi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-upload",{attrs:{disabled:"","file-list":e.fileList}})},Fi=[],Ii={name:"data-show-upload",props:{value:String},data:function(){return{fileList:[]}},watch:{value:function(){this.handleList()}},mounted:function(){this.handleList()},methods:{handleList:function(){var e=this;try{this.fileList=y.a.map(JSON.parse(this.value),(function(t){return Object(g["a"])(Object(g["a"])({},t),{},{url:e.getUrl(t),uid:"".concat(e._uid,"-").concat(t.hash),status:"done"})}))}catch(t){this.fileList=[]}},getUrl:function(e){return this.$options.filters.file(e)}}},Pi=Ii,Ai=Object(m["a"])(Pi,Bi,Fi,!1,null,null,null),Ri=Ai.exports,qi=(Qe={},Object(Kt["a"])(Qe,it.name,it),Object(Kt["a"])(Qe,Oi.name,Oi),Object(Kt["a"])(Qe,Ei.name,Ei),Object(Kt["a"])(Qe,Ni.name,Ni),Object(Kt["a"])(Qe,Ri.name,Ri),Object(Kt["a"])(Qe,rt.name,rt),Qe),Mi={props:{value:[String,Number,Boolean,Array,Object],componentName:String,params:{type:Object,default:function(){return{}}}},data:function(){return{val:void 0}},watch:{value:function(e,t){!y.a.isEqual(e,t)&&this.formatVal()}},created:function(){this.formatVal()},render:function(e){var t=this;return/^(avatar|user|switch|rate|upload|image)$/.test(this.componentName)?e(qi["data-show-"+this.componentName],{props:{value:this.val,params:this.params}}):"richText"===this.componentName?e("div",{domProps:{innerHTML:this.val}}):"textarea"===this.componentName?e("div",{style:{whiteSpace:"pre-wrap"}},this.val):(y.a.isArray(this.val)?this.val=y.a.join(y.a.map(this.val,(function(e){return y.a.values(y.a.omit(e,["elm","id","isRootInsert"]))[0]})),", "):y.a.isObject(this.val)&&y.a.forOwn(this.val,(function(e,a){if("id"!==a)return t.val=e,!1})),e("span",{},this.val))},methods:{formatVal:function(){var e=this,t=this.value;if(/^(input|textarea|upload|avatar)$/.test(this.componentName)&&!y.a.isString(t))t="";else if(/^(inputNumber|rate|year|monthPicker)$/.test(this.componentName)&&!y.a.isNumber(t))t=void 0;else if(/^(multipleSelect|checkbox)$/.test(this.componentName)&&!y.a.isArray(t))t=[];else if("richText"===this.componentName)y.a.isString(t)?(t=t.replace(/<img data-hash="([a-z0-9]{32})">/g,(function(t,a){return t.replace('data-hash="'.concat(a),'src="'.concat(e.$options.filters.cdn(a)))})),t='<div class="ql-snow"><div class="ql-editor">'.concat(t,"</div></div>")):t="";else if("datePicker"===this.componentName)t=this.$options.filters.unixFormat(t,this.params.format);else if("cascader"===this.componentName&&t){var a=this.params,n=a.columnName,i=a.options,s=[t],l=y.a.find(i,{id:t});if(l){t=l[n];while(l&&l.pid&&-1===y.a.indexOf(s,l.pid))s.push(l.pid),l=y.a.find(i,{id:l.pid}),t="".concat(l[n]," / ").concat(t)}}else"switch"===this.componentName&&(t=!!t);this.val=t}}},zi=Mi,Vi=Object(m["a"])(zi,Ye,Ze,!1,null,null,null),Ui=Vi.exports,Ki={components:{Filters:ci,TableBase:fi,DataShow:Ui},props:{storeModule:String,tableName:String,permission:Object,filters:Object},data:function(){return{uid:Y(),richTextVisible:!1,richTextContent:"",richTextWidth:document.body.offsetWidth<768?document.body.offsetWidth:768,fileListVisible:!1,filesJson:"",dataShows:{dataShowDefault:{},dataShowUser:{componentName:"user",params:{size:"small"}},dataShowAvatar:{componentName:"avatar",params:{size:"small"}},dataShowRate:{componentName:"rate"}},detaultColumns:{id:{dataIndex:"id",sorter:!0},created_at:{dataIndex:"created_at",scopedSlots:{customRender:"unix"},sorter:!0},updated_at:{dataIndex:"updated_at",scopedSlots:{customRender:"unix"},sorter:!0},state:{dataIndex:"state",scopedSlots:{customRender:"state"},sorter:!0},created_by_uid:{dataIndex:"created_by_uid",scopedSlots:{customRender:"dataShowUser"}},updated_by_uid:{dataIndex:"updated_by_uid",scopedSlots:{customRender:"dataShowUser"}}}}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},dataTypes:function(e){return y.a.keyBy(e.data_type.all.data,"id")},list:function(e){return e[this.storeModule].list}})),{},{tableColumns:function(){return y.a.keyBy(y.a.filter(this.allTableColumn,{table:{name:this.tableName}}),"name")},getListActionName:function(){return this.storeModule+"/getList"},saveActionName:function(){return this.storeModule+"/save"},visibleFilters:function(){return!y.a.isEmpty(this.filters)},params:function(){var e=this;if(!y.a.isEmpty(this.permission.list)&&!y.a.isEmpty(this.allTableColumn)){var t=[].concat(Object(Ve["a"])(this.permission.list.defaultFields||[]),Object(Ve["a"])(y.a.filter(this.permission.list.fields,(function(t){return e.allTableColumn[t]}))));return y.a.isEmpty(t)?void 0:{table:{name:this.tableName,no_default_field:!0,fields:y.a.uniq([].concat(Object(Ve["a"])(t),["id"]))}}}},columnInfo:function(){var e=this;if(y.a.isEmpty(this.permission.list)||y.a.isEmpty(this.allTableColumn)||y.a.isEmpty(this.dataTypes))return[];var t=[],a=[];return y.a.forEach(this.permission.list.fields,(function(n){var i=e.allTableColumn[n];if(i){var s=!1,l={customRender:"dataShowDefault"},o=e.dataTypes[i.data_type.id],r=o.component,c=o.params;/^(switch|input|inputNumber|rate|datePicker)$/.test(r)&&(s=!0),"member"===e.tableName&&"uid"===i.name?l.customRender="dataShowUser":"switch"===r?(l.customRender="switch-".concat(i.name),a.push({key:i.name,disabled:-1===y.a.indexOf(y.a.get(e.permission.update,"fields"),i.id)})):"avatar"===r?l.customRender="dataShowAvatar":"rate"===r?l.customRender="dataShowRate":/^(datePicker|image)$/.test(r)?(l.customRender="dataShow-".concat(i.name),e.dataShows[l.customRender]={componentName:r,params:c}):"richText"===r?l.customRender="richText":"upload"===r&&(l.customRender="fileList"),t.push({dataIndex:i.name,scopedSlots:l,sorter:s})}})),y.a.forEach(this.permission.list.defaultFields,(function(a){var n=e.detaultColumns[a];"id"!==a?t.push(n):t.unshift(n)})),{columns:t,switchs:a}},editEnabled:function(){return!y.a.isEmpty(this.permission.update)&&(!this.permission.update.fields||1!==this.permission.update.fields.length||!/^(role|member)$/.test(this.tableName)||this.permission.update.fields[0]!==this.tableColumns.permission.id)}}),watch:{tableName:function(){this.handleFilters.filters=[]},params:function(e,t){!y.a.isEmpty(e)&&!y.a.isEqual(e,t)&&this.getList({current:1,pageSize:10})}},created:function(){this.getAllDataType(),this.getList({current:1,pageSize:10})},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("data_type",{getAllDataType:"getAll"})),{},{handleSave:function(e){return this.$store.dispatch(this.saveActionName,{tableName:this.tableName,record:e})},handleChangeItem:function(e){var t=this;this.handleSave(e).then((function(){t.$notification.success({message:t.languageBase.save,description:t.languageBase.successful}),t.$emit("save",e)}))},handleDelete:function(e){var t=this;this.handleSave({id:e.id,deleted_at:1}).then((function(){t.$notification.success({message:t.languageBase.delete,description:t.languageBase.successful}),t.$emit("delete",e)}))},getList:function(e){var t=this;if(e=y.a.mergeWith(y.a.cloneDeep(this.params),e),y.a.isEmpty(y.a.get(e,"table.order_by"))&&y.a.set(e,"table.order_by",[["id","DESC"]]),!y.a.isEmpty(this.handleFilters.filters)){var a=y.a.get(e,"table.filters");y.a.isEmpty(a)?y.a.set(e,"table.filters[0]",this.handleFilters.filters):y.a.forEach(a,(function(a,n){y.a.set(e,"table.filters[".concat(n,"]"),[].concat(Object(Ve["a"])(a),Object(Ve["a"])(t.handleFilters.filters)))}))}this.$store.dispatch(this.getListActionName,e)},handleChange:function(e,t,a){var n=y.a.pick(e,["current","pageSize"]);!y.a.isEmpty(a)&&a.order&&(n.table={order_by:[[a.field,"ascend"===a.order?"ASC":"DESC"]]}),this.getList(n)},handleFilters:function(e){this.handleFilters.filters=e,this.getList({current:1,pageSize:10})},stateDisabled:function(e){var t=e.id,a=e.uid;return-1===y.a.indexOf(y.a.get(this.permission.update,"defaultFields"),"state")||"member"===this.tableName&&(1===t||a===this.uid)},delDisabled:function(e){var t=e.id,a=e.uid;return 1!==this.permission.del||"member"===this.tableName&&(1===t||a===this.uid)||"role"===this.tableName&&t<3},showRichTextModal:function(e){this.richTextVisible=!0,this.richTextContent=e},showFileListModal:function(e){this.fileListVisible=!0,this.filesJson=e}})},Ji=Ki,Gi=Object(m["a"])(Ji,Mt,zt,!1,null,null,null),Hi=Gi.exports,Wi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-drawer",{attrs:{title:e.isEdit?e.languageBase.edit:e.languageBase.create,maskClosable:!1,visible:e.visible,width:e.width,headerStyle:{textAlign:"center"}},on:{close:e.close}},[e.isEdit?[e.permission.update?e.loading||e.detail.data.id?e._e():a("p",[e._v(" "+e._s(e.languageBase.record_not_exist)+" ")]):a("p",[e._v("没有权限")])]:e._e(),a("a-spin",{directives:[{name:"show",rawName:"v-show",value:e.loading&&!e.submitLoding,expression:"loading && !submitLoding"}]}),e.visibleForm?a("a-form-model",{ref:"ruleForm",attrs:{model:e.formData,rules:e.rules},on:{submit:e.handleSubmit},nativeOn:{submit:function(e){e.preventDefault()}}},[e._l(e.tableColumnGroup,(function(t,n){return[a("a-row",{key:n,attrs:{type:"flex",justify:"space-between"}},[e._l(t.columns,(function(n){return[e.showItem(n.name)?a("a-col",{key:n.id,attrs:{span:t.span}},[e.disabledItem(n.name)?a("a-form-model-item",{attrs:{label:e.getLabel(n.name)}},[a("DataShow",{attrs:{value:e.detail.data[n.name],"component-name":n.data_type.component,params:n.data_type.params}})],1):a("a-form-model-item",{attrs:{prop:n.name,label:e.getLabel(n.name)}},[a("DataEntry",{ref:"data-entry-"+n.name,refInFor:!0,attrs:{"component-name":n.data_type.component,params:Object.assign({},e.formDataDataType[n.name].params,{autoFocus:e.autoFocus()})},model:{value:e.formData[n.name],callback:function(t){e.$set(e.formData,n.name,t)},expression:"formData[column.name]"}})],1)],1):e._e()]}))],2)]})),e.isEdit?[a("a-row",{attrs:{type:"flex",justify:"space-between"}},[e.showItem("id")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:"id"}},[e._v(" "+e._s(e.detail.data.id)+" ")])],1):e._e(),e.showItem("state")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:e.languageBase.state}},[a("DataEntry",{attrs:{"component-name":"switch",params:{checkedChildren:e.languageBase.enable,unCheckedChildren:e.languageBase.disable,disabled:e.disabledItem("state")}},model:{value:e.formData.state,callback:function(t){e.$set(e.formData,"state",t)},expression:"formData.state"}})],1)],1):e._e()],1),a("a-row",{attrs:{type:"flex",justify:"space-between"}},[e.showItem("created_at")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:e.languageBase.created_at}},[e._v(" "+e._s(e._f("unixFormat")(e.detail.data.created_at))+" ")])],1):e._e(),e.showItem("updated_at")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:e.languageBase.updated_at}},[e._v(" "+e._s(e._f("unixFormat")(e.detail.data.updated_at))+" ")])],1):e._e()],1),a("a-row",{attrs:{type:"flex",justify:"space-between"}},[e.showItem("created_by_uid")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:e.languageBase.created_by_uid}},[a("DataShow",{attrs:{"component-name":"user",value:e.detail.data.created_by_uid,params:{size:"small"}}})],1)],1):e._e(),e.showItem("updated_by_uid")?a("a-col",{attrs:{span:11}},[a("a-form-model-item",{attrs:{label:e.languageBase.updated_by_uid}},[a("DataShow",{attrs:{"component-name":"user",value:e.detail.data.updated_by_uid,params:{size:"small"}}})],1)],1):e._e()],1)]:[a("a-form-model-item",{attrs:{label:e.languageBase.state}},[a("DataEntry",{attrs:{"component-name":"switch",params:{checkedChildren:e.languageBase.enable,unCheckedChildren:e.languageBase.disable}},model:{value:e.formData.state,callback:function(t){e.$set(e.formData,"state",t)},expression:"formData.state"}})],1)],a("a-form-model-item",[a("a-button",{attrs:{block:"",type:"primary","html-type":"submit",loading:e.submitLoding}},[e._v(" "+e._s(e.languageBase.confirm)+" ")])],1)],2):e._e()],2)},Qi=[],Yi={props:{visible:Boolean,width:{type:[String,Number],default:document.body.offsetWidth<768?document.body.offsetWidth:768},tableName:String,permission:Object,id:Number},components:{DataEntry:si,DataShow:Ui},data:function(){var e=this;return{uid:Y(),submitLoding:!1,formData:{},oldFormData:{},formDataDataType:{},inputRequired:{required:!0,validator:function(t,a,n){""===a||void 0===a||null===a||y.a.isNaN(a)?n(e.languageBase.please_input):n()}},LBTC_RE:/^(name|comment)$/}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTableColumn:function(e){return e.languageTableColumn.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},dataTypes:function(e){return y.a.keyBy(e.data_type.all.data,"id")},detail:function(e){return e.list.detail},loading:function(e){return e.languageBase.all.loading||e.languageTableColumn.all.loading||e.table_column.all.loading||e.data_type.all.loading||e.list.detail.loading}})),{},{isEdit:function(){return this.id>0},detailFields:function(){var e=this;if(y.a.isEmpty(this.permission)||y.a.isEmpty(this.allTableColumn))return[];var t=[];return y.a.forEach(y.a.get(this.permission,"detail.fields"),(function(a){var n=y.a.get(e.allTableColumn,"".concat(a,".name"));n&&t.push(n)})),y.a.forEach(y.a.get(this.permission,"detail.defaultFields"),(function(e){t.push(e)})),t},tableColumns:function(){var e=this;if(y.a.isEmpty(this.allTableColumn)||y.a.isEmpty(this.dataTypes))return[];var t=y.a.filter(this.allTableColumn,(function(t){return t.table.name===e.tableName&&(!/^(role|member)$/.test(e.tableName)||"permission"!==t.name)}));return t=y.a.map(t,(function(t){return Object(g["a"])(Object(g["a"])({},t),{},{data_type:Object(g["a"])(Object(g["a"])({},t.data_type),y.a.pick(e.dataTypes[t.data_type.id],["component","params"]))})})),y.a.orderBy(t,["index"])},tableColumnFromName:function(){return y.a.keyBy(this.tableColumns,"name")},tableColumnGroup:function(){if(y.a.isEmpty(this.tableColumns))return[];var e=y.a.groupBy(this.tableColumns,(function(e){return e.index?y.a.floor(e.index):e.index}));return[].concat(Object(Ve["a"])(y.a.map(y.a.pickBy(e,(function(e,t){return"null"!==t})),(function(e){return{columns:e,span:e.length>1?y.a.floor(24/e.length)-1:24}}))),Object(Ve["a"])(y.a.map(e.null,(function(e){return{columns:[e],span:24}}))))},rules:function(){var e=this;if(y.a.isEmpty(this.tableColumns))return{};var t={},a=y.a.template(this.languageBase.character_template);return y.a.forEach(this.tableColumns,(function(n){if(!/^(switch)$/.test(n.data_type.component)&&(t[n.name]=[],!n.null&&t[n.name].push(e.inputRequired),!/^(upload|images)$/.test(n.data_type.component))){var i="string",s=a(n);/^(radio|radioSelect|inputNumber|rate|datePicker|cascader)$/.test(n.data_type.component)?(i="number",s="".concat(n.min," ~ ").concat(n.max)):/^(multipleSelect|checkbox)$/.test(n.data_type.component)&&(i="array",s="".concat(n.min," ~ ").concat(n.max)),t[n.name].push({type:i,min:n.min,max:n.max,message:s,trigger:"blur"})}})),t},createFormData:function(){if(y.a.isEmpty(this.tableColumns))return{};var e={state:!1};return y.a.forEach(this.tableColumns,(function(t){var a=t.default||void 0;/^(inputNumber|radio|radioSelect|rate)$/.test(t.data_type.component)&&a?a*=1:"switch"===t.data_type.component&&(a=1*t.default===1),e[t.name]=a})),e},editFormDataKeys:function(){var e=this;if(y.a.isEmpty(this.permission)||y.a.isEmpty(this.allTableColumn)||y.a.isEmpty(this.detailFields))return[];var t=Object(Ve["a"])(y.a.get(this.permission,"update.defaultFields")||[]);return y.a.forEach(y.a.get(this.permission,"update.fields"),(function(a){var n=y.a.get(e.allTableColumn,"".concat(a,".name"));n&&-1!==y.a.indexOf(e.detailFields,n)&&t.push(n)})),t},visibleForm:function(){return this.visible&&!y.a.isEmpty(this.formData)&&(this.submitLoding||!this.loading)}}),watch:{visible:function(){this.initFormData()},createFormData:function(e,t){!this.isEdit&&!y.a.isEqual(e,t)&&this.initFormData()},editFormDataKeys:function(e,t){this.isEdit&&!y.a.isEqual(e,t)&&this.initFormData()},tableColumnFromName:function(e,t){!y.a.isEqual(e,t)&&this.initFormData()}},mounted:function(){this.initFormData()},methods:Object(g["a"])(Object(g["a"])(Object(g["a"])({},Object(Te["mapMutations"])("list",{setItem:"setItem"})),Object(Te["mapActions"])("list",{getDetail:"getDetail",save:"save"})),{},{initFormData:function(){var e=this;!this.visible||this.isEdit&&y.a.isEmpty(this.editFormDataKeys)||!this.isEdit&&y.a.isEmpty(this.createFormData)||y.a.isEmpty(this.tableColumnFromName)||(this.autoFocus.have=!1,this.isEdit?(this.formData={},this.getDetail({table:{name:this.tableName,no_default_field:!0,fields:this.detailFields,filters:[[["id","=",this.id]]]}}).then((function(){y.a.isEmpty(e.detail.data)||(e.oldFormData={},y.a.forEach(e.editFormDataKeys,(function(t){var a=e.getDataType(t),n=a.component;if("state"===t||"switch"===n)e.oldFormData[t]=!!e.detail.data[t];else if("radioSelect"===n)e.oldFormData[t]=e.detail.data[t].id||void 0,e.oldFormData[t]&&(a.params.options=[e.detail.data[t]]);else if("radio"===n)e.oldFormData[t]=e.detail.data[t].id||void 0;else if(/^(multipleSelect|checkbox)$/.test(n))e.oldFormData[t]=y.a.map(e.detail.data[t],(function(e){return e.id}))||void 0,e.oldFormData[t]&&(a.params.options=e.detail.data[t]);else if("cascader"===n){e.oldFormData[t]=e.detail.data[t];var i=e.allTableColumn[a.params.table_column_id];a.params.tableName=e.tableName,a.params.id=e.id,a.params.options=y.a.get(e.detail.extraData,"cascader_".concat(i.table.name))}else e.oldFormData[t]=e.detail.data[t];e.formDataDataType[t]=a})),e.formData=Object(g["a"])({},e.oldFormData))}))):(this.formData=Object(g["a"])({},this.createFormData),y.a.forEach(this.formData,(function(t,a){e.formDataDataType[a]=e.getDataType(a)}))))},close:function(){var e=this;this.detail.data.id?this.$confirm({title:"您确定要关闭吗？",content:"编辑内容未保存",onOk:function(){e.$emit("close")}}):this.$emit("close")},handleSubmit:function(){var e=this;this.submitLoding||this.$refs.ruleForm.validate((function(t){if(t){var a=e.formData;if(e.id){if(a=y.a.pickBy(a,(function(t,a){return t!==e.oldFormData[a]})),y.a.isEmpty(a))return void e.$emit("close");a.id=e.id}a.id&&y.a.forEach(y.a.filter(e.tableColumns,(function(e){return y.a.has(a,e.name)&&void 0===a[e.name]})),(function(e){e.null&&(a[e.name]=null)})),e.submitLoding=!0,e.save({tableName:e.tableName,record:a}).then((function(){if(e.$notification.success({message:e.languageBase.save,comment:e.languageBase.successful}),a.id){var t={};y.a.forEach(a,(function(a,n){(y.a.isObject(e.detail.data[n])||y.a.isArray(a))&&(t[n]=e.$refs["data-entry-".concat(n)][0].$children[0].selected)})),y.a.isEmpty(t)||(t.id=a.id,e.setItem(t))}e.$emit("close")})).finally((function(){e.submitLoding=!1}))}}))},getDataType:function(e){var t=y.a.get(this.tableColumnFromName,"".concat(e,".data_type"))||{};return Object(g["a"])(Object(g["a"])({},t),{},{params:Object(g["a"])({},t.params)})},showItem:function(e){return!this.isEdit||y.a.has(this.detail.data,e)},disabledItem:function(e){return!!this.isEdit&&("state"===e&&"member"===this.tableName&&(1===this.detail.data.id||this.detail.data.uid===this.uid)||-1===y.a.indexOf(this.editFormDataKeys,e))},autoFocus:function(){return!this.autoFocus.have&&(this.autoFocus.have=!0,this.autoFocus.have)},getLabel:function(e){var t=this.languageTableColumn["".concat(this.tableName,".").concat(e)];return t||this.LBTC_RE.test(e)&&this.languageBase[e]||e}})},Zi=Yi,Xi=Object(m["a"])(Zi,Wi,Qi,!1,null,null,null),es=Xi.exports,ts=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-modal",{attrs:{visible:e.visible,width:e.width,title:e.languageBase.detail,"ok-text":e.languageBase.edit,footer:e.permission.update?void 0:null},on:{cancel:function(t){return e.$emit("close")},ok:function(t){return e.$emit("edit")}}},[a("a-skeleton",{directives:[{name:"show",rawName:"v-show",value:e.detail.loading||!e.showDetail,expression:"detail.loading || !showDetail"}],attrs:{active:""}}),e.showDetail?a("a-descriptions",{attrs:{column:e.column,bordered:""}},e._l(e.items,(function(t){return a("a-descriptions-item",{key:t.key,attrs:{label:e.getLabel(t.key),span:t.span}},[a("DataShow",{attrs:{value:e.detail.data[t.key],"component-name":t.componentName,params:t.params}})],1)})),1):e._e()],1)},as=[],ns={components:{DataShow:Ui},props:{permission:Object,tableName:String},data:function(){return{width:document.body.offsetWidth<992?document.body.offsetWidth:992,LBTC_RE:/^(name|comment|id|state|created_at|updated_at|created_by_uid|updated_by_uid)$/}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTableColumn:function(e){return e.languageTableColumn.values},allTableColumn:function(e){return y.a.keyBy(e.table_column.all.data,"id")},dataTypes:function(e){return y.a.keyBy(e.data_type.all.data,"id")},detail:function(e){return e.list.detail}})),{},{id:function(){return 1*this.$route.query.id},visible:function(){return this.$route.query.id&&!!this.$route.query.showDetail},showDetail:function(){return!y.a.isEmpty(this.detail.data)},tableColumns:function(){var e=this;if(y.a.isEmpty(this.permission)||y.a.isEmpty(this.allTableColumn))return[];var t=[];return y.a.forEach(y.a.get(this.permission,"detail.fields"),(function(a){e.allTableColumn[a]&&t.push(e.allTableColumn[a])})),y.a.orderBy(t,["index"])},fields:function(){return y.a.isEmpty(this.tableColumns)?[]:y.a.uniq(["id"].concat(Object(Ve["a"])(y.a.map(this.tableColumns,(function(e){return e.name}))),Object(Ve["a"])(y.a.get(this.permission,"detail.defaultFields")||[])))},tableColumnGroup:function(){return y.a.groupBy(this.tableColumns,(function(e){return e.index?y.a.floor(e.index):e.index}))},column:function(){var e=1;return y.a.forEach(y.a.uniq([2].concat(Object(Ve["a"])(y.a.map(this.tableColumnGroup,(function(e){return e.length}))))),(function(t){e*=t})),e},items:function(){var e=this;if(y.a.isEmpty(this.tableColumnGroup)||y.a.isEmpty(this.detail.data))return[];var t=[];y.a.forEach(this.tableColumnGroup,(function(a,n){var i="null"===n?e.column:e.column/a.length;y.a.forEach(a,(function(a){var n=e.dataTypes[a.data_type.id]||{},s=Object(g["a"])({},n.params);if("cascader"===n.component){var l=e.allTableColumn[s.table_column_id];s.columnName=l.name,s.options=y.a.get(e.detail.extraData,"cascader_".concat(l.table.name))}t.push({key:a.name,span:i,componentName:n.component,params:s})}))}));var a=y.a.get(this.permission,"detail.defaultFields"),n=this.column/2;return y.a.indexOf(a,"id")>-1&&t.push({key:"id",span:y.a.indexOf(a,"state")>-1?n:this.column}),y.a.indexOf(a,"state")>-1&&t.push({key:"state",span:y.a.indexOf(a,"id")>-1?n:this.column,componentName:"switch"}),y.a.indexOf(a,"created_at")>-1&&t.push({key:"created_at",span:y.a.indexOf(a,"updated_at")>-1?n:this.column,componentName:"datePicker"}),y.a.indexOf(a,"updated_at")>-1&&t.push({key:"updated_at",span:y.a.indexOf(a,"created_at")>-1?n:this.column,componentName:"datePicker"}),y.a.indexOf(a,"created_by_uid")>-1&&t.push({key:"created_by_uid",span:y.a.indexOf(a,"updated_by_uid")>-1?n:this.column,componentName:"user"}),y.a.indexOf(a,"updated_by_uid")>-1&&t.push({key:"updated_by_uid",span:y.a.indexOf(a,"created_by_uid")>-1?n:this.column,componentName:"user"}),t}}),watch:{visible:function(){this.fetchDetail()},fields:function(){this.fetchDetail()}},mounted:function(){this.fetchDetail()},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("list",{getDetail:"getDetail"})),{},{fetchDetail:function(){!this.visible||y.a.isEmpty(this.fields)||this.tableName===this.fetchDetail.tableName&&this.id===this.detail.data.id||(this.fetchDetail.tableName=this.tableName,this.getDetail({table:{name:this.tableName,no_default_field:!0,fields:this.fields,filters:[[["id","=",this.id]]]}}))},getLabel:function(e){var t=this.languageTableColumn["".concat(this.tableName,".").concat(e)];return t||this.LBTC_RE.test(e)&&this.languageBase[e]||e}})},is=ns,ss=Object(m["a"])(is,ts,as,!1,null,null,null),ls=ss.exports,os=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-drawer",{attrs:{title:e.title,maskClosable:!1,visible:e.visible,width:e.width,headerStyle:{textAlign:"center"}},on:{close:e.close}},[a("a-spin",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}]}),e.loading?e._e():a("a-form-model",{on:{submit:e.handleSubmit},nativeOn:{submit:function(e){e.preventDefault()}}},[a("a-form-model-item",[a("PermissionTree",{ref:"permissionTree",attrs:{permission:e.rolePermission,"difference-permission":e.memberPermission}})],1),a("a-form-model-item",[a("a-button",{attrs:{block:"",type:"primary","html-type":"submit",loading:e.submitLoding}},[e._v(" "+e._s(e.languageBase.confirm)+" ")])],1)],1)],1)},rs=[],cs=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",[e.loading?a("a-spin"):a("a-tree",{attrs:{checkable:"","tree-data":e.treeData},model:{value:e.checkedKeys,callback:function(t){e.checkedKeys=t},expression:"checkedKeys"}})],1)},us=[],ds=a("ac9e"),ms={name:"PermissionTree",props:{value:Array,permission:String,differencePermission:String},data:function(){return{checkedKeys:[],roleCheckedKeys:[],oldCheckedKeys:[]}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTable:function(e){return e.languageTable.values},languageTableColumn:function(e){return e.languageTableColumn.values},languageMenuGroup:function(e){return e.languageMenuGroup.values},tables:function(e){return y.a.filter(e.table.all.data,(function(e){return e.id>10}))},tableColumns:function(e){return e.table_column.all.data},dataTypes:function(e){return y.a.keyBy(e.data_type.all.data,"id")},loading:function(e){return e.languageBase.all.loading||e.languageTable.all.loading||e.languageTableColumn.all.loading||e.languageMenuGroup.all.loading}})),{},{treeData:function(){var e=this;if(this.loading||y.a.isEmpty(this.tableColumns))return[];var t=y.a.map(this.tables,(function(t){var a=y.a.map(y.a.filter(e.tableColumns,{table:{id:t.id}}),(function(a){return Object(g["a"])(Object(g["a"])({},a),{},{title:e.languageTableColumn["".concat(t.name,".").concat(a.name)]||e.languageBase[a.name]||a.name})})),n=[{key:"".concat(t.id,"-create"),title:e.languageBase.create,isLeaf:!0},{key:"".concat(t.id,"-del"),title:e.languageBase.delete,isLeaf:!0},{key:"".concat(t.id,"-own"),title:e.languageBase.query_only_own,isLeaf:!0},e.getTypeChildren("detail",t,a),e.getTypeChildren("update",t,a),e.getTypeChildren("list",t,a),e.getTypeChildren("search",t,a)];return/^(member|role)$/.test(t.name)&&n.push({key:"".concat(t.id,"-permission"),title:e.languageBase.permission,isLeaf:!0}),{name:t.name,key:t.id,title:e.languageTable[t.name]||t.name,menu_group:t.menu_group,children:n}})),a=y.a.groupBy(t,"menu_group.id");return[].concat(Object(Ve["a"])(a.null||[]),Object(Ve["a"])(y.a.map(y.a.omit(a,["null"]),(function(t){return{key:"menu_group-".concat(t[0].menu_group.id),title:e.languageMenuGroup[t[0].menu_group.name]||t[0].menu_group.name,children:t}}))))}}),watch:{checkedKeys:function(){this.$emit("input",this.checkedKeys)},permission:function(){this.handlePermission()},differencePermission:function(){this.handlePermission()},treeData:function(){this.handlePermission()}},mounted:function(){this.handlePermission()},methods:{getTypeChildren:function(e,t,a){var n=this;/^(member|role)$/.test(t.name)&&(a=y.a.filter(a,(function(e){return"permission"!==e.name}))),"search"===e&&(a=y.a.filter(a,(function(e){return!/^(avatar|upload|image|images)$/.test(n.dataTypes[e.data_type.id].component)}))),"member"===t.name&&"update"===e&&(a=y.a.filter(a,(function(e){return"uid"!==e.name})));var i="".concat(t.id,"-").concat(e),s={key:i,title:this.languageBase[e],children:[].concat(Object(Ve["a"])(y.a.map(a,(function(e){return{key:"".concat(i,"-").concat(e.id),title:e.title,isLeaf:!0}}))),[this.getDefaultField(i,"state")])};return"update"!==e&&(s.children=[].concat(Object(Ve["a"])(s.children),[this.getDefaultField(i,"id"),this.getDefaultField(i,"created_at"),this.getDefaultField(i,"updated_at"),this.getDefaultField(i,"created_by_uid"),this.getDefaultField(i,"updated_by_uid")])),s},getDefaultField:function(e,t){return{key:"".concat(e,"-").concat(t),title:this.languageBase[t]||t,isLeaf:!0}},handlePermission:function(){this.roleCheckedKeys=this.permissionToCheckedKeys(this.permission),this.checkedKeys=Object(Ve["a"])(this.roleCheckedKeys);try{var e=JSON.parse(this.differencePermission),t=this.permissionToCheckedKeys(e.disabled),a=this.permissionToCheckedKeys(e.enabled);this.checkedKeys=y.a.uniq([].concat(Object(Ve["a"])(y.a.difference(this.checkedKeys,t)),Object(Ve["a"])(a))),this.oldCheckedKeys=Object(Ve["a"])(this.checkedKeys)}catch(n){}},permissionToCheckedKeys:function(e){var t=[];try{y.a.isString(e)&&(e=JSON.parse(e))}catch(a){e={}}return y.a.forEach(e,(function(e,a){y.a.forEach(e,(function(e,n){n="".concat(a,"-").concat(n),1===e||e.checked&&y.a.isEmpty(e.fields)&&y.a.isEmpty(e.defaultFields)?t.push(n):t=[].concat(Object(Ve["a"])(t),Object(Ve["a"])(y.a.map(e.defaultFields,(function(e){return"".concat(n,"-").concat(e)}))),Object(Ve["a"])(y.a.map(e.fields,(function(e){return"".concat(n,"-").concat(e)}))))}))})),t},checkedKeysToPermission:function(e){var t={};return y.a.forEach(e,(function(e){if(/^[0-9]+-/.test(e)){var a=y.a.split(e,"-"),n=Object(ds["a"])(a,3),i=n[0],s=n[1],l=n[2];i*=1,t[i]=Object(g["a"])({},t[i]),/^(create|del|permission|own)$/.test(s)?t[i][s]=1:l&&(t[i][s]=Object(g["a"])({},t[i][s]),/^[0-9]+$/.test(l)?t[i][s].fields=[].concat(Object(Ve["a"])(t[i][s].fields||[]),[1*l]):t[i][s].defaultFields=[].concat(Object(Ve["a"])(t[i][s].defaultFields||[]),[l]))}})),y.a.omitBy(t,y.a.isEmpty)}}},ps=ms,hs=Object(m["a"])(ps,cs,us,!1,null,null,null),fs=hs.exports,bs={components:{PermissionTree:fs},data:function(){return{visible:!1,title:"",width:document.body.offsetWidth<450?document.body.offsetWidth:450,submitLoding:!1,detail:{},memberPermission:"",rolePermission:"",loading:!0}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTable:function(e){return e.languageTable.values}})),methods:{show:function(e){var t=this;this.detail=e,Je({id:e.uid}).then((function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.title="".concat(t.languageTable.member," - ").concat(a.name||"uid("+e.uid+")"," - ").concat(t.languageBase.permission)})),this.loading=!0,this.visible=!0,ge({table:{name:"member",no_default_field:!0,fields:["permission"],filters:[[["id","=",e.id]]]},left_join_tables:[{name:"role",no_default_field:!0,fields:["permission"],on:["id","member","role"],ons:[["state","=",1]]}]}).then((function(e){var a=e.data;t.memberPermission=y.a.get(a,"[0].permission"),t.rolePermission=y.a.get(a,"[0].role.permission"),t.loading=!1}))},close:function(){this.visible=!1},handleSubmit:function(){var e=this,t=this.$refs.permissionTree,a=t.checkedKeys,n=t.oldCheckedKeys,i=t.roleCheckedKeys,s=t.checkedKeysToPermission;if(y.a.isEmpty(y.a.omitBy(y.a.xor(a,n),(function(e){return/\d+-(detail|update|list|search)$/.test(e)}))))this.close();else{var l=y.a.difference(i,a),o=y.a.difference(a,i),r=y.a.omitBy({disabled:s(l),enabled:s(o)},y.a.isEmpty);ye({table:{name:"member"},rows:[{id:this.detail.id,permission:y.a.isEmpty(r)?null:JSON.stringify(r)}]}).then((function(){e.$notification.success({message:e.languageBase.save,comment:e.languageBase.successful}),e.close()}))}}}},gs=bs,vs=Object(m["a"])(gs,os,rs,!1,null,null,null),ys=vs.exports,_s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-drawer",{attrs:{title:e.title,maskClosable:!1,visible:e.visible,width:e.width,headerStyle:{textAlign:"center"}},on:{close:e.close}},[a("a-spin",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}]}),e.loading?e._e():a("a-form-model",{on:{submit:e.handleSubmit},nativeOn:{submit:function(e){e.preventDefault()}}},[a("a-form-model-item",[a("PermissionTree",{ref:"permissionTree",attrs:{permission:e.detail.permission}})],1),a("a-form-model-item",[a("a-button",{attrs:{block:"",type:"primary","html-type":"submit",loading:e.submitLoding}},[e._v(" "+e._s(e.languageBase.confirm)+" ")])],1)],1)],1)},Os=[],js={components:{PermissionTree:fs},data:function(){return{visible:!1,title:"",width:document.body.offsetWidth<450?document.body.offsetWidth:450,submitLoding:!1,detail:{},loading:!0}},computed:Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},languageTable:function(e){return e.languageTable.values}})),methods:{show:function(e){var t=this;this.detail=e,this.title="".concat(this.languageTable.role," - ").concat(e.name," - ").concat(this.languageBase.permission),this.visible=!0,this.loading=!0,ge({table:{name:"role",no_default_field:!0,fields:["permission"],filters:[[["id","=",e.id]]]}}).then((function(e){var a=e.data;t.detail.permission=a[0].permission,t.loading=!1}))},close:function(){this.visible=!1},handleSubmit:function(){var e=this,t=this.$refs.permissionTree,a=t.checkedKeys,n=t.roleCheckedKeys,i=t.checkedKeysToPermission;y.a.isEmpty(y.a.omitBy(y.a.xor(a,n),(function(e){return/\d+-(detail|update|list|search)$/.test(e)})))?this.close():ye({table:{name:"role"},rows:[{id:this.detail.id,permission:y.a.isEmpty(a)?null:JSON.stringify(i(a))}]}).then((function(){e.$notification.success({message:e.languageBase.save,comment:e.languageBase.successful}),y.a.forOwn(sessionStorage,(function(e,t){var a=new RegExp("^q-member-");a.test(t)&&sessionStorage.removeItem(t)})),e.close()}))}}},ws=js,Ss=Object(m["a"])(ws,_s,Os,!1,null,null,null),xs=Ss.exports,ks={name:"ListPage",components:{Table:Hi,Edit:es,Detail:ls,MemberPermission:ys,RolePermission:xs},data:function(){return{uid:Y()}},computed:Object(g["a"])(Object(g["a"])({},Object(Te["mapState"])({languageBase:function(e){return e.languageBase.values},permissionLoading:function(e){return e.permission.loading},permissions:function(e){return e.permission.values},tables:function(e){return y.a.keyBy(e.table.all.data,"name")},allTableColumn:function(e){return e.table_column.all.data},system:function(e){return e.user_system.detail.data}})),{},{tableColumns:function(){return y.a.keyBy(y.a.filter(this.allTableColumn,{table:{name:this.$route.params.tableName}}),"name")},permission:function(){if(this.permissionLoading||y.a.isEmpty(this.tables)||y.a.isEmpty(this.system)||y.a.isEmpty(this.tableColumns))return{};var e=this.$route.params.tableName,t=this.system.user.id===this.uid&&"member"===e;if(y.a.isEmpty(this.permissions)&&!t)return{};var a=this.tables[e];if(!a)return{};var n=this.permissions[a.id];return t&&(n=Object(g["a"])(Object(g["a"])({},n),{},{list:Object(g["a"])(Object(g["a"])({},y.a.get(n,"list")),{},{fields:y.a.uniq([].concat(Object(Ve["a"])(y.a.get(n,"list.fields")||[]),[this.tableColumns.uid.id]))})})),n.update&&n.detail?(n.update.fields=y.a.intersection(n.update.fields,n.detail.fields),n.update.defaultFields=y.a.intersection(n.update.defaultFields,n.detail.defaultFields),n.update=y.a.omitBy(n.update,y.a.isEmpty),y.a.isEmpty(n.update)&&(n=y.a.omit(n,["update"]))):n=y.a.omit(n,["update"]),n||{}},showOperation:function(){return!y.a.isEmpty(this.system)&&((1===this.permission.permission||this.system.user.id===this.uid)&&/^(member|role)$/.test(this.$route.params.tableName))}}),created:function(){this.getAllTableColumn()},methods:Object(g["a"])(Object(g["a"])({},Object(Te["mapActions"])("table_column",{getAllTableColumn:"getAll"})),{},{showEdit:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id;"member"!==this.$route.params.tableName||t?this.$router.push({name:this.$route.name,params:this.$route.params,query:{id:t,showEdit:1}}):this.$message.info({content:"邀请成员功能待发开中"})},showDetail:function(e){var t=e.id;this.$router.push({name:this.$route.name,params:this.$route.params,query:{id:t,showDetail:1}})},closeEdit:function(){this.$router.push({name:this.$route.name,params:this.$route.params})},showPermission:function(e){var t=this.$route.params.tableName;"member"===t?this.$refs.memberPermission.show(e):"role"===t&&this.$refs.rolePermission.show(e)}})},Es=ks,Cs=Object(m["a"])(Es,Rt,qt,!1,null,null,null),Ts=Cs.exports;!w&&window.location.replace(x.ACCOUNT_FRONTEND),i.a.use(O.a);var $s=new O.a({mode:"history",base:"/".concat(w),routes:[{path:"/",name:"Main",component:Lt,children:[{path:"/:tableName/list",name:"list",component:Ts}]},{name:"404",path:"*",component:At}]});$s.beforeEach((function(e,t,a){var n=te(w);if(e.query.auth){if(e.query.auth!==W()&&localStorage.setItem("try_to_login_num",0),Q(e.query.auth)&&n){var i=G(e.query.auth),s=i.id;s&&n!==s&&ne(w)}$s.replace(y.a.pick(Object(g["a"])(Object(g["a"])({},e),{},{query:y.a.omit(e.query,["auth"])}),["name","params","query"]))}else if(n)a();else{var l=W();l?ke(l,a):je()}}));var Ds=$s,Ls=a("3d46"),Ns=a("f404"),Bs=(a("0f83"),a("f1f0")),Fs=function(e,t){return y.a.isArray(e)?e.concat(t):void 0},Is={params:{},data:[],loading:!1},Ps={params:{},data:[],pagination:{},loading:!1},As={params:{},data:{},loading:!1},Rs=function(e,t){var a=t.type,n=t.loading;e[a].loading=n},qs=function(e,t){e.all.loading=t},Ms=function(e,t){e.list.loading=t},zs=function(e,t){e.detail.loading=t},Vs=function(e,t){var a=t.type,n=t.data,i=t.pageSize,s=t.current,l=t.total,o=t.params,r=t.extraData;e[a].params=o,e[a].extraData=r,/^(list|all)$/.test(a)?(e[a].data=y.a.map(n,(function(e){return Object(g["a"])(Object(g["a"])({},e),{},{saveLoading:!1,deleteLoading:!1})})),"list"===a&&s&&(e.list.pagination={pageSize:i,total:1===s?l:e.list.pagination.total,current:s,showSizeChanger:!0})):e.detail.data=n[0]||{}},Us=function(e,t){t.id&&y.a.forEach(["all","list"],(function(a){if(e[a]){var n=y.a.findIndex(e[a].data,{id:t.id});if(n>-1){var i=e[a].data[n];y.a.forEach(t,(function(e,a){y.a.isObject(i[a])&&y.a.isNumber(e)&&(t[a]=Object(g["a"])(Object(g["a"])({},i[a]),{},{id:e}))})),e[a].data[n]=Object(g["a"])(Object(g["a"])({},e[a].data[n]),y.a.cloneDeep(t)),e[a].data=y.a.filter(e[a].data,(function(e){return!e.deleted_at}))}}}))},Ks=function(e){return function(t,a){var n=t.commit,i=a.type,s=a.params;return n("setLoading",{type:i,loading:!0}),n("setData",{type:i,data:[],params:{}}),e[i].api(y.a.mergeWith(y.a.cloneDeep(e[i].params),y.a.cloneDeep(s),Fs)).then(function(){var t=Object(Bs["a"])(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.t0=e[i].beforeSet,!t.t0){t.next=4;break}return t.next=4,e[i].beforeSet(a);case 4:return n("setData",Object(g["a"])(Object(g["a"])({},a),{},{type:i,params:y.a.cloneDeep(s)})),t.abrupt("return",a);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).finally((function(){n("setLoading",{type:i,loading:!1})}))}},Js=function(e){return function(t,a){var n=t.dispatch;return n("getData",{type:e,params:a})}},Gs=function(e){var t=e.api;return function(e,a){var n=e.commit,i=e.state,s=e.dispatch,l=a.tableName,o=a.record;return n("setItem",{id:o.id,saveLoading:!0}),i.detail&&n("setDetailLoading",!0),t({table:{name:l},rows:[Object(g["a"])({},o)]}).then((function(){o.id?n("setItem",Object(g["a"])(Object(g["a"])({},o),{},{updated_at:U()().unix(),saveLoading:!1})):i.list&&!y.a.isEmpty(i.list.params)&&s("getList",Object(g["a"])(Object(g["a"])({},i.list.params),{},{current:1,sync:1}))})).catch((function(e){return n("setItem",{id:o.id,saveLoading:!1}),Promise.reject(e)})).finally((function(){i.detail&&n("setDetailLoading",!1)}))}},Hs=function(){function e(t){var a=t.all,n=t.list,i=t.detail,s=t.save;Object(Ls["a"])(this,e),this.state=this.createState({all:a,list:n,detail:i}),this.mutations=this.createMutations({all:a,list:n,detail:i}),this.actions=this.createActions({all:a,list:n,detail:i,save:s})}return Object(Ns["a"])(e,[{key:"createState",value:function(e){var t=e.all,a=e.list,n=e.detail,i={};return t&&(i.all=y.a.cloneDeep(Is)),a&&(i.list=y.a.cloneDeep(Ps)),n&&(i.detail=y.a.cloneDeep(As)),i}},{key:"createMutations",value:function(e){var t=e.all,a=e.list,n=e.detail,i={};return(t||a||n)&&(i.setLoading=Rs,i.setData=Vs,t&&(i.setAllLoading=qs),a&&(i.setListLoading=Ms),n&&(i.setDetailLoading=zs),(t||a)&&(i.setItem=Us)),i}},{key:"createActions",value:function(e){var t=e.all,a=e.list,n=e.detail,i=e.save,s={};return(t||a||n)&&(s.getData=Ks({all:t,list:a,detail:n}),t&&(s.getAll=Js("all")),a&&(s.getList=Js("list")),n&&(s.getDetail=Js("detail"))),i&&(s.save=Gs(i)),s}}]),e}(),Ws="data_type",Qs=new Hs({all:{api:ge,params:{table:{name:Ws,no_default_field:!0,fields:["id","component","params"],filters:[[["state","=",1]]]}},beforeSet:function(e){var t=e.data;y.a.forEach(t,(function(e){try{e.params=JSON.parse(e.params)}catch(t){e.params={}}}))}}}),Ys=Object(g["a"])({namespaced:!0},Qs),Zs="language_base",Xs=new Hs({all:{api:ge,params:{table:{name:Zs,no_default_field:!0,fields:["key","native_name"]}}}});Xs.state=Object(g["a"])(Object(g["a"])({},Xs.state),{},{values:{create:"Create",search:"Search"}}),Xs.mutations=Object(g["a"])(Object(g["a"])({},Xs.mutations),{},{setValues:function(e,t){N("language_base_"+w,t),e.values=Object(g["a"])(Object(g["a"])({},e.values),t)}}),Xs.actions=Object(g["a"])(Object(g["a"])({},Xs.actions),{},{get:function(e,t){var a=e.commit,n=e.dispatch;n("getAll",{table:{filters:[[["locale","=",t]]]}}).then((function(e){var t=e.data,n={};y.a.forEach(t,(function(e){n[e.key]=e.native_name})),a("setValues",n)}))}});var el=Object(g["a"])({namespaced:!0},Xs),tl="language_menu_group",al=new Hs({all:{api:ge,params:{table:{name:tl,no_default_field:!0,fields:["menu_group","native_name"]}}}});al.state=Object(g["a"])(Object(g["a"])({},al.state),{},{values:{}}),al.mutations=Object(g["a"])(Object(g["a"])({},al.mutations),{},{setValues:function(e,t){e.values=t}}),al.actions=Object(g["a"])(Object(g["a"])({},al.actions),{},{get:function(e,t){var a=e.commit,n=e.dispatch;n("getAll",{table:{filters:[[["locale","=",t]]]}}).then((function(e){var t=e.data,n={};y.a.forEach(t,(function(e){n[e.menu_group.name]=e.native_name})),a("setValues",n)}))}});var nl=Object(g["a"])({namespaced:!0},al),il="language_table",sl=new Hs({all:{api:ge,params:{table:{name:il,no_default_field:!0,fields:["table","native_name"]}}}});sl.state=Object(g["a"])(Object(g["a"])({},sl.state),{},{values:{}}),sl.mutations=Object(g["a"])(Object(g["a"])({},sl.mutations),{},{setValues:function(e,t){e.values=t}}),sl.actions=Object(g["a"])(Object(g["a"])({},sl.actions),{},{get:function(e,t){var a=e.commit,n=e.dispatch;n("getAll",{table:{filters:[[["locale","=",t],["table",">",8]]]}}).then((function(e){var t=e.data,n={};y.a.forEach(t,(function(e){n[e.table.name]=e.native_name})),a("setValues",n)}))}});var ll=Object(g["a"])({namespaced:!0},sl),ol="language_table_column",rl=new Hs({all:{api:ge,params:{table:{name:ol,no_default_field:!0,fields:["native_name"]},left_join_tables:[{name:"table_column",no_default_field:!0,fields:["name"],on:["id","language_table_column","table_column"]},{name:"table",no_default_field:!0,fields:["name"],on:["id","table_column","table"]}]}}});rl.state=Object(g["a"])(Object(g["a"])({},rl.state),{},{values:{}}),rl.mutations=Object(g["a"])(Object(g["a"])({},rl.mutations),{},{setValues:function(e,t){e.values=t}}),rl.actions=Object(g["a"])(Object(g["a"])({},rl.actions),{},{get:function(e,t){var a=e.commit,n=e.dispatch;n("getAll",{table:{filters:[[["locale","=",t]]]}}).then((function(e){var t=e.data,n={};y.a.forEach(t,(function(e){n["".concat(e.table.name,".").concat(e.table_column.name)]=e.native_name})),a("setValues",n)}))}});var cl=Object(g["a"])({namespaced:!0},rl),ul=new Hs({list:{api:ve},detail:{api:ge},save:{api:ye}}),dl=Object(g["a"])({namespaced:!0},ul),ml="locale",pl=new Hs({all:{api:ge,params:{table:{name:ml,no_default_field:!0,fields:["id","code","native_name"],filters:[[["state","=",1]]]}}}}),hl="locale_".concat(w);pl.state.selected=B(hl)||{id:50,code:"zh_CN",native_name:"简体中文"},pl.mutations.select=function(e,t){t=y.a.pick(t,["id","code","native_name"]),t.id!==e.selected.id&&(e.selected=t,N(hl,t))};var fl=Object(g["a"])({namespaced:!0},pl),bl="member",gl={loading:!0,values:{}},vl={setValues:function(e,t){e.loading=!1,e.values=t}},yl={fetch:function(e){var t=e.commit;return ce.post("/query/all",{table:{name:bl,no_default_field:!0,fields:["permission","state"],filters:[[["uid","=",Y()]]]},left_join_tables:[{name:"role",no_default_field:!0,fields:["permission"],on:["id",bl,"role"],ons:[["state","=",1]]}]}).then((function(e){var a=e.data,n=a[0];if(n)if(n.state){var i=fs.methods,l=i.permissionToCheckedKeys,o=i.checkedKeysToPermission,r=l(y.a.get(n,"role.permission"));try{var c=JSON.parse(n.permission),u=l(c.disabled),d=l(c.enabled);r=y.a.uniq([].concat(Object(Ve["a"])(y.a.difference(r,u)),Object(Ve["a"])(d)))}catch(h){}var m=o(r);y.a.forEach(m,(function(e,t){e.update&&e.detail?(e.update.fields=y.a.intersection(e.update.fields,e.detail.fields),e.update.defaultFields=y.a.intersection(e.update.defaultFields,e.detail.defaultFields)):m[t]=y.a.omit(e,["update"]),e.own&&y.a.forEach(["detail","list","search"],(function(t){y.a.get(e,"".concat(t,".defaultFields"))&&y.a.pull(e[t].defaultFields,"created_by_uid","updated_by_uid")}))})),t("setValues",m)}else{var p=B("language_base_"+w)||{};s["Modal"].error({title:p.account_disabled||"你的账号已禁用。",onOk:function(){window.location.replace(x.ACCOUNT_FRONTEND)}})}}))}},_l={namespaced:!0,state:gl,mutations:vl,actions:yl},Ol="table_column",jl=new Hs({all:{api:ge,params:{table:{name:Ol,no_default_field:!0,fields:["id","name","table","data_type","max","min","null","default","index"],filters:[[["state","=",1],["table",">",9]]]}}}}),wl=Object(g["a"])({namespaced:!0},jl),Sl="table_related",xl=new Hs({all:{api:ge,params:{table:{name:Sl,no_default_field:!0,fields:["id","t1_column","t2_column"],filters:[[["state","=",1]]]}}}}),kl=Object(g["a"])({namespaced:!0},xl),El="table",Cl=new Hs({all:{api:ge,params:{table:{name:El,no_default_field:!0,fields:["id","name","icon"],filters:[[["id",">",9],["state","=",1]]]},left_join_tables:[{name:"menu_group",no_default_field:!0,fields:["id","name","icon"],on:["id",El,"menu_group"]}]}}}),Tl=Object(g["a"])({namespaced:!0},Cl),$l="user_system",Dl=new Hs({detail:{api:Ue,params:{table:{name:$l,no_default_field:!0,fields:["id","name","user"],filters:[[["id","=",w]]]}}}}),Ll=Object(g["a"])({namespaced:!0},Dl);i.a.use($e.a);var Nl=new $e.a.Store({state:{},mutations:{},actions:{},modules:{data_type:Ys,languageBase:el,languageMenuGroup:nl,languageTable:ll,languageTableColumn:cl,list:dl,locale:fl,permission:_l,table_column:wl,table_related:kl,table:Tl,user_system:Ll}});y.a.forEach({unixFormat:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LLL";return e>0?U.a.unix(e).format(t):"-"},accountF:function(e){return x.ACCOUNT_FRONTEND+e},file:function(e){return"".concat(x.FILE,"/").concat(e.hash,"?name=").concat(encodeURIComponent(e.name))},oss:function(e){return"".concat(x.OSS,"/").concat(e.replace(/^(.{2})(.{2})/,"$1/$2/"))},cdn:function(e){return"".concat(x.CDN,"/").concat(e.replace(/^(.{2})(.{2})/,"$1/$2/"))}},(function(e,t){i.a.filter(t,(function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),i=1;i<a;i++)n[i-1]=arguments[i];return e.apply(void 0,[t].concat(n))}))})),R("RpYB7QW6OcGjEPas"),i.a.config.productionTip=!1,i.a.use(l.a),i.a.use(r.a),i.a.use(c["a"]),s["notification"].config({top:"70px"}),new i.a({router:Ds,store:Nl,render:function(e){return e(f)}}).$mount("#app")},5880:function(e,t){e.exports=Vuex},"5bd4":function(e,t,a){},"60bb":function(e,t){e.exports=_},"60da":function(e,t,a){"use strict";a("5bd4")},6389:function(e,t){e.exports=VueRouter},"7b3b":function(e,t,a){},"7faf":function(e,t,a){"use strict";a("5632")},"8bbf":function(e,t){e.exports=Vue},"9b19a":function(e,t,a){e.exports=a.p+"img/logo.037289f5.svg"},a2c5:function(e,t){e.exports=CryptoJS},a7cb:function(e,t,a){},aed4:function(e,t,a){"use strict";a("a7cb")},c32d:function(e,t){e.exports=moment},cebe:function(e,t){e.exports=axios},e3df:function(e,t,a){}});
  //# sourceMappingURL=app.fae7755d.js.map