@kordar/easyui-tpl 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return i}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,a,l){var o=r&&r.prototype instanceof s?r:s,u=Object.create(o.prototype);return i(u,"_invoke",function(n,r,a){var l,o,i,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,o=0,i=e,m.n=n,c}};function f(n,r){for(o=n,i=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,l=u[t],f=m.p,p=l[2];n>3?(a=p===r)&&(i=l[(o=l[4])?5:(o=3,3)],l[4]=l[5]=e):l[0]<=f&&((a=n<2&&f<l[1])?(o=0,m.v=r,m.n=l[1]):f<p&&(a=n<3||l[0]>r||r>p)&&(l[4]=n,l[5]=r,m.n=p,o=0))}if(a||n>1)return c;throw d=!0,r}return function(a,u,p){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),o=u,i=p;(t=o<2?e:i)||!d;){l||(o?o<3?(o>1&&(m.n=-1),f(o,i)):m.n=i:m.v=i);try{if(s=2,l){if(o||(a="next"),t=l[a]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,o<2&&(o=0)}else 1===o&&(t=l.return)&&t.call(l),o<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),o=1);l=e}else if((t=(d=m.n<0)?i:n.call(r,m))!==c)break}catch(t){l=e,o=1,i=t}finally{s=1}}return{value:t,done:d}}}(n,a,l),!0),u}var c={};function s(){}function u(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),f=d.prototype=s.prototype=Object.create(m);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,i(f,"constructor",d),i(d,"constructor",u),u.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:l,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function l(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},i(e,t,n,r)}function c(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function o(e){c(l,r,a,o,i,"next",e)}function i(e){c(l,r,a,o,i,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}import v,{useState as E,useMemo as y,useLayoutEffect as b,useEffect as x,useContext as C,useRef as k}from"react";import{get as w,trim as S,invoke as R}from"lodash-es";import{Tooltip as A,Pagination as N,Dialog as _,Layout as D,LayoutPanel as P,Panel as T,Tree as I,TextBox as U,LinkButton as M,Form as O,FormField as L,ComboBox as j,DataGrid as F,GridColumn as V,GridColumnGroup as z,GridHeaderRow as W,TreeGrid as B,NumberBox as q,ComboTree as G,PasswordBox as K,MenuButton as H,Menu as Q,MenuItem as X,RadioButton as Y,Label as Z,treeHelper as $}from"rc-easyui";import{FormDataType as J,CheckAccessEleType as ee}from"@kordar-lib/base";import{tt as te,setLanguage as ne,getActivePkg as re,getResourceBundle as ae,tparam as le,tfield as oe}from"@kordar-lib/i18n";import{MenuService as ie,SelectionTree as ce,TabMenuService as se}from"@kordar-lib/menus";import{$confirm as ue,$toast as de,setSideMenuState as me,useLocale as fe,withCheckGrid as pe,Access as he,useRefDialog as ge,DefaultPanel as ve,RadioGroupBox as Ee,useTheme as ye,DrawerPanel as be,FullBodyLayout as xe,TabsPanel as Ce}from"@kordar/easyui";import{useAppDispatch as ke,useAppSelector as we,sidebarChoice as Se,removeTab as Re,saveChoice as Ae,App as Ne,Admin as _e,login as De,setSidebarCollapsed as Pe}from"@kordar-lib/reducers";import{useNavigate as Te,useLocation as Ie,Outlet as Ue}from"react-router-dom";import{useAppRedirect as Me,useCheckAccess as Oe,useLocalTable as Le,useTable as je,useFormData as Fe,useFormMData as Ve}from"@kordar-components/react";import{createPortal as ze}from"react-dom";function We(e){return v.createElement(v.Suspense,{fallback:v.createElement(v.Fragment,null,"...")},e)}var Be,qe=function(e){var t=e.value;return t?v.createElement(A,{content:t,position:"top"},v.createElement("div",{className:"yp-text-ellipsis"},t)):""},Ge=function(){return v.createElement("div",null,"Type")},Ke=function(e){return e.value.replace("T"," ").replace("Z","")},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?v.createElement("span",{className:"iconfont "+t},e):v.createElement("span",null,e)},Qe=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",a=w(e,t,[]);for(var l in a){var o=a[l];if(o.value==n)return o.label}return r};function Xe(){return Be}new ie;var Ye={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function Ze(e){return Ye[e]}var $e=function(){return m(function e(){u(this,e)},[{key:"result",value:function(e,t,n,r,a,l){200===e&&a&&a(n,r)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(a=s(o().m(function e(t){var n,r,a,l,i,c,s,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.n=1,Xe().post("resource/".concat(t,"/list"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,s=a.count,this.result(l,i,c,s,r);case 2:return e.a(2)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=s(o().m(function e(t){var n,r,a,l,i,c,s=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,e.n=1,Xe().post("resource/".concat(t,"/configs"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return Xe().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=s(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post("resource/".concat(t,"/edit"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return Xe().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return Xe().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=s(o().m(function e(t,n,r,a){var l,i,c,s,u,d,m,f;return o().w(function(e){for(;;)switch(e.n){case 0:if(n!==J.CREATE){e.n=2;break}return e.n=1,this.add(t,r);case 1:l=e.v,i=l.code,c=l.message,s=l.data,this.result(i,c,s,0,a),e.n=4;break;case 2:if(n!==J.UPDATE){e.n=4;break}return e.n=3,this.update(t,r);case 3:u=e.v,d=u.code,m=u.message,f=u.data,this.result(d,m,f,0,a);case 4:return e.a(2)}},e,this)})),function(e,n,r,a){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return Xe().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=s(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post("resource/".concat(t,"/delete"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return Xe().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then(function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),a=document.createElement("a");a.setAttribute("download",n+".xlsx"),a.href=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)})}}]);var e,t,n,r,a}(),Je=new $e,et=function(e){return[{type:ee.AND,value:["/resource/"+e+"/add"],key:"add"},{type:ee.AND,value:["/resource/"+e+"/update"],key:"update"},{type:ee.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:ee.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},tt=function(e,t){return function(n){var r=n.fn,a=n.params,l=n.success,o=n.error;ue(te("confirm_del_title","Message"),null!=t?t:te("confirm_del_msg","Message"),function(){r(a).then(function(t){var n=t.code;t.message,t.data;200===n?(l&&l(),e.refresh(),de.success(te("del_success","Message"))):o&&o()})})}},nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){ue(te("confirm_del_title","Message"),null!=t?t:te("confirm_del_msg","Message"),function(){Je.delResult(e.name(),n,function(){e.refresh(),de.success(te("del_success","Message"))}).then()})}};function rt(e){return Object.entries(e).map(function(e){var t=r(e,2),n=t[0],a=t[1];return"".concat(a[0],"(").concat(n,")")}).join(",")}function at(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o,i=t.value,c="",s=i.name,u=S(s,"/").split("/");u.length<=2?c=u[0]:u.length>2&&(c=u[0]+"/"+u[1]);var d=a.get(c);null==d&&(d=[]);var m=null!==(o=i.description)&&void 0!==o?o:"";d.push({id:s,text:m+"["+s+"]"}),a.set(c,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}function lt(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var a=lt(e.children,t,n);a>0&&(a===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function ot(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o=t.value,i="",c=o.description,s=void 0,u=S(c,":").split(":");u.length<=2?i=u[0]:u.length>2&&(i=u[0]+":"+u[1]),u.length>=2&&(s=u[1]);var d=a.get(i);null==d&&(d=[]);var m=o.name;d.push({id:m,text:null!=s?s:m}),a.set(i,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}var it=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},ct=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},st=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach(function(e){return n.push({value:e.value,text:e.label})}):Object.keys(r).forEach(function(e,t){return n.push({value:e,text:r[e]})}),n},ut=new(function(){return m(function e(){u(this,e)},[{key:"roles",value:function(){return Xe().post(Ze("rbacRoles"))}},{key:"addRole",value:function(e){return Xe().post(Ze("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return Xe().post(Ze("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return Xe().post(Ze("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return Xe().post(Ze("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return Xe().post(Ze("rbacPermissions"))}},{key:"addPermission",value:function(e){return Xe().post(Ze("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return Xe().post(Ze("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return Xe().post(Ze("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return Xe().post(Ze("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return Xe().post(Ze("rbacRules"))}},{key:"addRule",value:function(e){return Xe().post(Ze("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return Xe().post(Ze("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return Xe().get(Ze("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return Xe().post(Ze("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return Xe().get(Ze("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return Xe().post(Ze("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return Xe().post(Ze("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return Xe().get(Ze("rbacGetPermissionsByUser"),{id:e})}}])}()),dt=new(function(){return m(function e(){u(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xe().post(Ze("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xe().post(Ze("adminResetPassword"),e)}},{key:"menus",value:function(){return Xe().post(Ze("menus"),{})}},{key:"info",value:function(e){return Xe().post(Ze("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),mt=new(function(){return m(function e(){u(this,e)},[{key:"initialize",value:function(){return Xe().post(Ze("initialize"))}},{key:"getLugData",value:function(e){return Xe().post(Ze("langData"),{locale:e})}}])}());function ft(e){var t=ke(),n=Te(),a=null==we?void 0:we(function(e){return e.app.sidebarCollapsed}),l=we(function(e){return e.layout}),i=l.tabs,c=l.choices,u=l.choiceId,d=r(E(),2),m=d[0],f=d[1],p=r(E(),2),h=p[0],g=p[1],v=r(E([]),2),x=v[0],C=v[1],k=r(E([]),2),w=k[0],S=k[1],R=y(function(){var t;return e.init(me(x,c)),f(e.tabs),a?e.menus():[{id:0,text:"",state:"open",children:e.menusById(h||c[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[x,a,h]),A=y(function(){return e.init(me(x,c)),e.menus()},[x,a]),N=y(function(){for(var t=[],n=0;n<w.length;n++){var r=w[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==u,type:2})}for(var a=0;a<i.length;a++){var l=e.getItemById(i[a]);l&&t.push({id:l.id,path:l.path,closable:!0,title:l.text,selected:l.id==u,type:1})}return t},[x,i,u]);return b(function(){s(o().m(function e(){var t,n;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,dt.menus();case 1:t=e.v,n=t.data,C(n.sidebar),S(n.welcome);case 2:return e.a(2)}},e)}))()},[]),{collapsed:a,menuList:R,menuAll:A,onMenuSelection:function(r){if(r){var a=e.searchPathIndex(r.id);t(Se({id:r.id,choices:a})),n({pathname:r.path})}},menuArea:m,setMenuAreaId:g,choiceId:u,menuTabList:N,onTabClosed:function(n){var r=n.props.id;t(Re({id:r}));var a=e.searchPathIndex(u);t(Ae({choices:a}))},onTabSelected:function(r){var a=e.searchPathIndex(r.id);t(Se({id:r.id,choices:a})),n({pathname:r.path})}}}function pt(){var e={location:Ie(),history:we(function(e){return e.app.historyLocation}),isGuest:function(){return _e.isGuest()},saveHistoryLocation:function(e){return Ne.saveHistoryLocation(e)}};return Me(e)}function ht(){var e=fe().locale,t=r(E(),2),n=t[0],a=t[1],l=pt();return x(function(){ne(e,function(){a(re())}),l.autoRedirect()},[]),x(function(){a(re())},[e]),{easyuiLangPkg:n}}function gt(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=Oe(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:_e.can,OrCan:_e.orCan,Permissions:_e.permissions}),o=we(function(e){return e.user.version}),i=r(E({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return Le({value:c,setValue:s,config:e,checkaccess:l,dependency:a,version:o})}function vt(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=Oe(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:_e.can,OrCan:_e.orCan,Permissions:_e.permissions}),o=we(function(e){return e.user.version}),i=r(E({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return je({value:c,setValue:s,config:e,checkaccess:l,dependency:a,version:o})}var Et=function(e){var t=e.ctxState,n=e.ctx;return v.createElement(N,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},yt=function(e){return function(t){return function(n){var a=r(E({}),2),l=a[0],o=a[1],i=r(E({}),2),c=i[0],s=i[1],u=r(E(0),2),d=u[0],m=u[1],f=fe().locale;return x(function(){var t=ae(f,"Page",e.name);document.title=w(t,"title",te("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;s(t||{}),m(d+1)})},[f]),v.createElement(v.Fragment,null,v.createElement(t,p(p({},n),{},{pageConfig:l,fetchConfig:c,fetchVersion:d})))}}},bt=v.createContext({pageConfig:{},fetchConfig:{}}),xt=function(e){var t=e.ctx,n=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=r(E(),2),c=i[0],u=i[1],d=r(E([]),2),m=d[0],f=d[1],p=k(null),h=r(E([]),2),g=h[0],y=h[1],b=r(E([]),2),C=b[0],w=b[1],S=k(null);x(function(){null==t||t.setMethod("onSubmit",A),R()},[]);var R=function(){var e=s(o().m(function e(){var t,r,a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ut.roles();case 1:return t=e.v,r=ot(t.data||[]),a=[],e.n=2,ut.permissions();case 2:l=e.v,i=at(l.data||[]),c=[],ut.getPermissionsByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach(function(e){r.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),lt(i,r,c),u(i),c.forEach(function(e){p.current.checkNode(e)})}}),ut.getRolesByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var l=new Set;n&&n.forEach(function(e){l.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),lt(r,l,a),y(r),a.forEach(function(e){S.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),A=function(){ut.assignItemToUser({id:n.id,roles:C,permissions:m}).then(function(e){200===e.code&&(de.success(le(a,"assign_success","assign permission successfully!")),l())})};return v.createElement(D,{style:{width:800,height:500}},v.createElement(P,{region:"west",style:{width:220}},v.createElement(T,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:g,ref:S,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),w(t)}}}))),v.createElement(P,{region:"center",style:{height:"100%"}},v.createElement(T,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(U,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:c,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}}))),v.createElement(P,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:A}," ",le(a,"submit.text","Submit")," "),v.createElement(M,{style:{width:80},onClick:l}," ",le(a,"close.text","Close")," "))))},Ct=function(e){var t=e.value,n=e.props,r=e.close,a=C(bt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(xt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},kt=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=(e.refs,r(Fe(n).toArray(),1)[0]),i=k(null);x(function(){null==t||t.setMethod("onSubmit",c)},[]);var c=function(){i.current.validate(function(e){if(null==e){var n={username:o.username,phone:o.phone,password:"123456"};dt.register(n).then(function(e){200===e.code&&(de.success(te("save success","Message")),t.refresh(),l())})}else de.error(rt(e))})};return v.createElement(O,{ref:i,model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"username",label:oe(a,"username.label","Username")+":"},v.createElement(U,{placeholder:oe(a,"username.placeholder",""),value:o.username})),v.createElement(L,{name:"phone",label:oe(a,"phone.label","Phone")+":"},v.createElement(U,{placeholder:oe(a,"phone.placeholder",""),value:o.phone})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},le(a,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==l?void 0:l()},iconCls:"icon-cancel"},le(a,"cancel.text","Cancel"))))},wt=function(e){var t=e.value,n=e.props,r=e.close,a=C(bt),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(kt,p(p({className:"f-full",ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s})))},St=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={username:"",phone:"",status:"",type:""},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",labelWidth:"auto",model:i,labelPosition:"before"},v.createElement(L,{name:"username",label:oe(n,"username.label","Username")},v.createElement(U,{value:i.username})),v.createElement(L,{name:"phone",label:oe(n,"phone.label","Phone")},v.createElement(U,{value:i.phone})),v.createElement(L,{name:"status",label:oe(n,"status.label","Status")},v.createElement(j,{data:st(a,"admin-state"),value:i.status})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"admin-type"),value:i.type})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:i.username,type:"LIKE",filter_empty:!0},{key:"phone",value:i.phone,type:"LIKE",filter_empty:!0},{key:"status",value:i.status,type:"EQ",filter_empty:!0},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(l),null==t||t.reset()}},le(n,"reset.text","Reset"))))},Rt=pe(F),At=function(){var e=C(bt),t=e.pageConfig,n=e.fetchConfig,a=e.ctx,l=e.ctxState,o=e.refs,i=(e.version,r(E(0),2)),c=i[0],s=i[1];return x(function(){s(c+1)},[n]),v.createElement(v.Fragment,null,v.createElement(Rt,{toolbar:function(){var e={record:{username:"",password:""},type:J.CREATE,ctx:a,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(St,{ctx:a,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:a,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(o,"formDataRefDlg.open",e)}},le(t,"add.text","Add")))))},data:null==l?void 0:l.data,loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,idField:"id",selection:null==l?void 0:l.selectionValues,onSelectionChange:function(e){return null==a?void 0:a.tableSelectionChange(e)},ckWidth:20,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,r=e.originalValue,l=n.props.field;if(console.log(t,n,r),t[l]!==r){var o=null==a?void 0:a.name();Je.edit(o,{conditions:[{key:"id",value:t.id}],editor:[{key:l,value:t[l],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?de.success(te("save_success","Message")):de.error(n),null==a||a.refresh()})}},key:c},v.createElement(V,{field:"id",title:oe(t,"id.label","UserId"),width:"50px"}),v.createElement(V,{field:"username",title:oe(t,"username.label","Username"),width:"80px"}),v.createElement(V,{field:"phone",title:oe(t,"phone.label","Phone"),width:"60px",editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(U,{value:t.phone})}}),v.createElement(V,{field:"status",title:oe(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return Qe(n,"admin-state",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(j,{data:st(n,"admin-state"),value:t.status+""})}}),v.createElement(V,{field:"type",title:oe(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return Qe(n,"admin-type",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(j,{data:st(n,"admin-type"),value:t.type+""})}}),v.createElement(V,{field:"version",title:oe(t,"version.label","Version"),width:"60px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"75px"}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"75px"}),v.createElement(z,{frozen:!0,align:"right",width:"100px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return J.UPDATE,"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.username),v.createElement(v.Fragment,null,v.createElement(he,{ctx:a,point:"assign"},v.createElement(M,{plain:!0,onClick:function(){return R(o,"assigndlg.open",{ctx:a,record:n,title:"".concat(le(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),v.createElement(he,{ctx:a,point:"delete"},v.createElement(M,{onClick:function(){return null==a?void 0:a.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"100px"})))))},Nt="admin",_t=[{type:ee.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(t(et(Nt))),Dt=yt({name:"Admin",fetchConfig:function(){return Je.configs(Nt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:Nt,fetch:function(e){return Je.list(Nt,e)},checkAccessItems:_t,defaultPageSize:30});r.ctx.registerEvent("remove",nt(r.ctx));var a=ge(),l=ge();return x(function(){r.ctx.search()},[r.version]),v.createElement(bt.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,assigndlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(wt,p({},a)),v.createElement(Ct,p({},l)),v.createElement(At,null)))}),Pt=function(){return v.createElement("h1",null,"Home!!!!!!!")},Tt=v.createContext({pageConfig:{},fetchConfig:{}}),It=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={position:void 0,active:void 0,title:"",type:void 0},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"title",label:oe(n,"title.label","Title")},v.createElement(U,{value:i.title})),v.createElement(L,{name:"active",label:oe(n,"active.label","Active")},v.createElement(j,{data:st(a,"switch-state"),value:i.active})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"setting-type"),value:i.type})),v.createElement(L,{name:"position",label:oe(n,"position.label","Position")},v.createElement(j,{data:st(a,"setting-position"),value:i.position})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:i.position,type:"="},{key:"type",value:i.type,type:"="},{key:"active",value:i.active,type:"="},{key:"title",value:i.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},Ut=function(e){var t=e.pageVersion,n=C(Tt),r=n.pageConfig,a=n.fetchConfig,l=n.ctx,o=n.ctxState,i=n.refs;return v.createElement(B,{toolbar:function(){return function(e,t,n,r){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(It,{ctx:n,pageConfig:e,fetchConfig:t})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},le(e,"refresh.text","Refresh")),v.createElement(he,{ctx:n,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(r,"formdlg.open",{type:J.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:le(e,"add.text","Create Setting")})}},le(e,"add.text","Add")))))}(r,a,l,i)},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",treeField:"title",key:"tree-table-"+t},v.createElement(V,{field:"title",title:oe(r,"title.label","Title"),width:"220px"}),v.createElement(V,{field:"icon",title:oe(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return v.createElement("span",{className:"iconfont "+t})}}),v.createElement(V,{field:"active",title:oe(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return Qe(a,"switch-state",t)}}),v.createElement(V,{field:"position",title:oe(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return Qe(a,"setting-position",t)}}),v.createElement(V,{field:"type",title:oe(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Qe(a,"setting-type",t)}}),v.createElement(V,{field:"router_name",title:oe(r,"router_name.label","RouterName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"url",title:oe(r,"url.label","URL"),align:"left",width:"300px"}),v.createElement(V,{field:"sort",title:oe(r,"sort.label","Sort"),align:"left",width:"80px"}),v.createElement(V,{field:"create_time",title:oe(r,"create_time.label","CreateTime"),width:"180px"}),v.createElement(V,{field:"update_time",title:oe(r,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(z,{frozen:!0,align:"right",width:"80px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:l,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(i,"formdlg.open",{ctx:l,record:t,type:J.UPDATE,title:"".concat(le(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:l,point:"delete"},v.createElement(M,{onClick:function(){return null==l?void 0:l.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Mt=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=e.refs,s=r(Ve(a).toArray(),2),u=s[0],d=s[1],m=k(null),f=y(function(){var e;return new ce(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,function(e){return{id:e.id,text:e.title,children:[]}},{id:0,text:le(l,"none_parent","None Parent"),children:[]})},[t.config.data]);x(function(){t.setMethod("submitForm",p),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;d({router_name:t.name,url:t.url}),R(c,"routerlistdlg.close")})},[]);var p=function(){m.current.validate(function(e){if(null==e){var r={object:{id:parseInt(u.id),title:u.title,router_name:u.router_name,icon:u.icon,active:parseInt(u.active),position:parseInt(u.position),type:parseInt(u.type),sort:parseInt(u.sort),pid:parseInt(u.pid),url:u.url},conditions:[]};n===J.UPDATE&&r.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),i()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:m,model:u,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"title",label:oe(l,"title.label","Title")+":"},v.createElement(U,{placeholder:oe(l,"title.placeholder",""),value:u.title})),v.createElement(L,{name:"router_name",label:oe(l,"router_name.label","Router Name")+":"},v.createElement(U,{placeholder:oe(l,"router_name.placeholder",""),value:u.router_name,addonRight:function(){var e={title:le(l,"router_title","Router List")};return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return R(c,"routerlistdlg.open",e)}}))}})),v.createElement(L,{name:"icon",label:oe(l,"icon.label","Icon")+":"},v.createElement(U,{placeholder:oe(l,"icon.placeholder",""),value:u.icon})),v.createElement(L,{name:"active",label:oe(l,"active.label","Status")+":"},v.createElement(Ee,{options:st(o,"switch-state"),name:"switch-state",value:u.active,onChange:function(e,t){d({active:e})}})),v.createElement(L,{name:"type",label:oe(l,"type.label","Type")+":"},v.createElement(Ee,{options:st(o,"setting-type"),name:"setting-type",value:u.type,onChange:function(e,t){d({type:e})}})),v.createElement(L,{name:"position",label:oe(l,"position.label","Position")+":"},v.createElement(Ee,{options:st(o,"setting-position"),name:"setting-position",value:u.position,onChange:function(e,t){d({position:e})}})),v.createElement(L,{name:"sort",label:oe(l,"sort.label","Sort")+":"},v.createElement(q,{placeholder:oe(l,"sort.placeholder",""),value:u.sort})),v.createElement(L,{name:"pid",label:oe(l,"pid.label","Pid")+":"},v.createElement(G,{placeholder:oe(l,"pid.placeholder",""),editable:!0,data:f,value:u.pid,onChange:function(e){return d({pid:e})}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:p},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:i},le(l,"close.text","Close"))))},Ot=v.createContext({pageConfig:{},fetchConfig:{}}),Lt=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={name:"",type:""},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:i.name})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"router-type"),value:i.type})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},jt=function(e){var t=e.selectedRow,n=e.scene,a=C(Ot),l=a.pageConfig,o=a.fetchConfig,i=a.ctx,c=a.ctxState,s=a.refs,u=r(E(0),2),d=u[0],m=u[1],f=function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Lt,{ctx:i,pageConfig:l,fetchConfig:o})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},le(l,"refresh.text","Refresh")),v.createElement(he,{ctx:i,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(s,"formDataRefDlg.open",{type:J.CREATE,ctx:i,record:{name:""},title:le(l,"add.text","Create Router")})}},le(l,"add.text","Add")))))},p=function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:i,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(s,"formDataRefDlg.open",{ctx:i,record:t,type:J.UPDATE,title:"".concat(le(l,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:i,point:"delete"},v.createElement(M,{onClick:function(){return null==i?void 0:i.publish("remove",{conditions:[{key:"name",value:t.name},{key:"type",value:t.type}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))};return x(function(){m(d+1)},[o]),"setting"===n?v.createElement(F,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},v.createElement(V,{field:"name",title:oe(l,"name.label","Name"),render:qe}),v.createElement(V,{field:"url",title:oe(l,"type.label","URL"),align:"center",render:qe}),v.createElement(V,{field:"type",title:oe(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Qe(o,"router-type",t)}}),v.createElement(z,{frozen:!0,align:"right",width:"120px"},v.createElement(W,null,v.createElement(V,{align:"center",render:p,width:"120px"})))):v.createElement(F,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},v.createElement(V,{field:"name",title:oe(l,"name.label","Name"),render:qe}),v.createElement(V,{field:"url",title:oe(l,"url.label","URL"),align:"center",render:qe}),v.createElement(V,{field:"type",title:oe(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Qe(o,"router-type",t)}}),v.createElement(V,{field:"data",title:oe(l,"data.label","Data")}),v.createElement(V,{field:"create_time",title:oe(l,"create_time.label","CreateTime"),width:"180px"}),v.createElement(V,{field:"update_time",title:oe(l,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(z,{frozen:!0,align:"right",width:"120px"},v.createElement(W,null,v.createElement(V,{align:"center",render:p,width:"120px"}))))},Ft=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=(e.refs,r(Ve(a).toArray(),2)),s=c[0],u=c[1],d=k(null);x(function(){null==t||t.setMethod("onSubmit",m)},[]);var m=function(){d.current.validate(function(e){if(null==e){var r={object:{name:s.name,url:s.url,type:s.type,data:s.data},conditions:[]};n===J.UPDATE&&(r.conditions.push({key:"name",value:a.name}),r.conditions.push({key:"type",value:a.type})),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),i()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:d,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:s.name})),v.createElement(L,{name:"url",label:oe(l,"url.label","Url")+":"},v.createElement(U,{placeholder:oe(l,"url.placeholder",""),value:s.url})),v.createElement(L,{name:"type",label:oe(l,"type.label","Type")+":"},v.createElement(Ee,{name:"router-type",value:s.type,options:st(o,"router-type"),onChange:function(e,t){u({type:e})}})),v.createElement(L,{name:"data",label:oe(l,"data.label","Data")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"data.placeholder",""),value:s.data})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:m},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:i},le(l,"close.text","Close"))))},Vt=function(e){var t=e.value,n=e.props,r=e.close,a=C(Ot),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Ft,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},zt="router",Wt=[{type:ee.AND,value:["/resource/router/add"],key:"add"},{type:ee.AND,value:["/resource/router/update"],key:"update"},{type:ee.AND,value:["/resource/router/delete"],key:"delete"},{type:ee.AND,value:["/resource/router/edit"],key:"edit"}],Bt=yt({name:"Router",fetchConfig:function(){return Je.configs(zt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,a=e.scene,l=vt({name:zt,fetch:function(e){return Je.list(zt,e)},checkAccessItems:Wt,defaultPageSize:20});x(function(){l.ctx.search()},[l.version]),l.ctx.registerEvent("remove",nt(l.ctx));var o=ge();return v.createElement(Ot.Provider,{value:{ctx:l.ctx,ctxState:l.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:l.ctx,ctxState:l.ctxState})}},v.createElement(Vt,p({},o)),v.createElement(jt,{selectedRow:r,scene:a})))}),qt=function(e){var t=e.value,n=e.props,r=e.close,a=C(Tt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Mt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},Gt=function(e){var t=e.value,n=e.props,r=(e.close,C(Tt).ctx);return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Bt,{selectedRow:function(e){var t,n=e.row,a=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:a})},scene:"setting"})))},Kt="setting",Ht=[{type:ee.AND,value:["/resource/setting/add"],key:"add"},{type:ee.AND,value:["/resource/setting/update"],key:"update"},{type:ee.AND,value:["/resource/setting/delete"],key:"delete"},{type:ee.AND,value:["/resource/setting/edit"],key:"edit"}],Qt=yt({name:"Setting",fetchConfig:function(){return Je.configs(Kt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,a=gt({name:Kt,fetch:function(e){return Je.list(Kt,e)},checkAccessItems:Ht,defaultPageSize:10,isTreeData:!0});a.ctx.registerEvent("remove",nt(a.ctx));var l=ge(),o=ge();return x(function(){a.ctx.search()},[]),v.createElement(Tt.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:l,routerlistdlg:o}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(qt,p({},l)),v.createElement(Gt,p({},o)),v.createElement(Ut,{pageVersion:r})))}),Xt=new(function(){return m(function e(){u(this,e)},[{key:"captcha",value:function(){return Xe().post(Ze("loginCaptcha"))}},{key:"login",value:(e=s(o().m(function e(t,n,r){var a,l,i;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post(Ze("loginSubmit"),t);case 1:a=e.v,l=a.code,i=a.data,200===l?n(i,l):r(i,l);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return Xe().post(Ze("loginConfig"))}}]);var e}()),Yt=function(e){var t=e.pageConfig,n=e.rules,a=ke(),l=r(E({username:"",captcha:"",password:"",code:"",token:""}),2),o=l[0],i=l[1],c=pt(),s=function(){Xt.captcha().then(function(e){var t=e.data;i(p(p({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return x(function(){s(),c.autoRedirect()},[]),v.createElement(O,{model:o,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},v.createElement(L,{name:"username"},v.createElement(U,{iconCls:"iconfont "+w(t.fields,"username.icon","icon-username"),placeholder:w(t.fields,"username.placeholder","username..."),value:o.username})),v.createElement(L,{name:"password"},v.createElement(K,{iconCls:"iconfont "+w(t.fields,"password.icon","icon-password"),placeholder:w(t.fields,"password.placeholder","password..."),value:o.password})),v.createElement(L,{name:"code"},v.createElement(U,{iconCls:"iconfont "+w(t.fields,"code.icon","icon-captcha"),placeholder:w(t.fields,"code.placeholder","verification code..."),value:o.code,addonRight:function(){return v.createElement("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:s})}})),v.createElement(L,null,v.createElement(M,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Xt.login(e,function(e){a(De({token:e.token,info:e.user,error:function(){de.error(w(t.params,"tips.loginError"))}})),c.autoRedirect()},function(){s()})},btnCls:"login_btn"},w(t.params,"submit.text","Sign In"))))},Zt=function(){var e=fe(!0),t=e.localeOptions,n=e.changeLocale;return v.createElement(H,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return v.createElement(Q,null,Object.keys(t).map(function(e,n){return v.createElement(X,{text:t[e],key:n,value:e})}))},onMenuItemClick:n})},$t=yt({name:"Login",fetchConfig:Xt.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,a=e.rules;return v.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},v.createElement(Zt,null),v.createElement("div",{className:"login layui-anim layui-anim-up"},v.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),v.createElement(Yt,{pageConfig:n,fetchConfig:r,rules:a})))}),Jt=v.createContext({pageConfig:{},fetchConfig:{}}),en=function(e){var n=e.ctx,a=(e.type,e.record),l=e.pageConfig,i=(e.fetchConfig,e.close),c=r(E(),2),u=c[0],d=c[1],m=r(E([]),2),f=m[0],p=m[1],h=k(null),g=r(E([]),2),y=g[0],b=g[1],C=r(E([]),2),w=C[0],S=C[1],R=k(null);x(function(){null==n||n.setMethod("onSubmit",N),A()},[]);var A=function(){var e=s(o().m(function e(){var t,n,r,l,i,c,s,u,m,p;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ut.roles();case 1:return t=e.v,n=ot(t.data||[]),r=[],e.n=2,ut.permissions();case 2:return l=e.v,i=at(l.data||[]),c=[],e.n=3,ut.getChildren({name:a.name});case 3:s=e.v,u=s.code,m=s.data,200===u&&(p=new Set,m&&m.forEach(function(e){p.add(e.name),1==e.item_type?w.push(e.name):f.push(e.name)}),lt(i,p,c),d(i),c.forEach(function(e){h.current.checkNode(e)}),lt(n,p,r),b(n),r.forEach(function(e){R.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),N=function(){ut.addPermissionChildren({name:a.name,children:[].concat(t(f),t(w))}).then(function(e){200===e.code&&(de.success(le(l,"assign_success","assign permission successfully!")),i())})};return v.createElement(D,{style:{width:800,height:500}},v.createElement(P,{region:"west",style:{width:220}},v.createElement(T,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:y,ref:R,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),S(t)}}}))),v.createElement(P,{region:"center",style:{height:"100%"}},v.createElement(T,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(U,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:u,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),p(t)}}}))),v.createElement(P,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:N}," ",le(l,"submit.text","Submit")," "),v.createElement(M,{style:{width:80},onClick:i}," ",le(l,"close.text","Close")," "))))},tn=function(e){var t=e.value,n=e.props,r=e.close,a=C(Jt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(en,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},nn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"description",label:oe(n,"description.label","Description")},v.createElement(U,{value:o.description})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},rn=pe(F),an=function(){var e=C(Jt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(rn,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(nn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){R(l,"formdlg.open",{type:J.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:le(t,"add.text","Create Role")})}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"batch-delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?de.error(te("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ut.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},le(t,"batch_remove.text","Batch Remove")))))},data:(null==a?void 0:a.data)||[],loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:o},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"220px"}),v.createElement(V,{field:"rule_name",title:oe(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"description",title:oe(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"180px",render:Ke}),v.createElement(z,{frozen:!0,align:"right",width:"100px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"assign-permission"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(le(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formdlg.open",{ctx:r,record:n,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ut.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},ln=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(Fe(a).toArray(),2),c=i[0],s=(i[1],r(Fe(a).toArray(),1)[0]),u=k(null);x(function(){t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){null==e?(n===J.CREATE&&ut.addRole(c).then(function(e){var n=e.code;e.data;200==n&&(de.success(te("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===J.UPDATE&&ut.updateRole({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(de.success(te("update_role_success","Message","update role successfully!")),t.refresh(),o())})):de.error(rt(e))})};return v.createElement(O,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"description",label:oe(l,"description.label","Description")+":"},v.createElement(U,{multiline:!0,placeholder:oe(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:d},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:o},le(l,"close.text","Close"))))},on=function(e){var t=e.value,n=e.props,r=e.close,a=C(Jt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ln,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},cn=[{type:ee.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:ee.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:ee.AND,value:["/rbac/add-role"],key:"add"},{type:ee.AND,value:["/rbac/update-role"],key:"update"},{type:ee.AND,value:["/rbac/delete-role"],key:"delete"}],sn=yt({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:"roles",fetch:function(e){return ut.roles()},checkAccessItems:cn,defaultPageSize:30,selectionValue:function(e){return e.name}});x(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",tt(r.ctx));var a=ge(),l=ge();return v.createElement(Jt.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,assigndlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(on,p({},a)),v.createElement(tn,p({},l)),v.createElement(an,null)))}),un=v.createContext({pageConfig:{},fetchConfig:{}}),dn=function(e){var t=e.ctx,n=(e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=r(Fe(n).toArray(),1)[0];x(function(){null==t||t.setMethod("onSubmit",i)},[]);var i=function(){var e={resource:o.resource,name:o.name};ut.fastAddPermission(e).then(function(e){200===e.code&&(de.success(te("save_success","Message","Save Success!")),t.refresh(),l())})};return v.createElement(O,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"resource",label:oe(a,"fast_add_resource.label","Resource")+":"},v.createElement(U,{placeholder:oe(a,"fast_add_resource.placeholder",""),value:o.resource})),v.createElement(L,{name:"name",label:oe(a,"fast_add_name.label","Name")+":"},v.createElement(U,{placeholder:oe(a,"fast_add_name.placeholder",""),value:o.name})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:i},le(a,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:l},le(a,"close.text","Close"))))},mn=function(e){var t=e.value,n=e.props,r=e.close,a=C(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(dn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},fn=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(E(a),2),c=i[0],s=(i[1],r(Fe(a).toArray(),1)[0]),u=k(null);x(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){null==e?(n===J.CREATE&&ut.addPermission(c).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===J.UPDATE&&ut.updatePermission({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):de.error(rt(e))})};return v.createElement(O,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"description",label:oe(l,"description.label","Description")+":"},v.createElement(U,{multiline:!0,placeholder:oe(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:d},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:o},le(l,"close.text","Close"))))},pn=function(e){var t=e.value,n=e.props,r=e.close,a=C(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},v.createElement(fn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},hn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"description",label:oe(n,"description.label","Description")},v.createElement(U,{value:o.description})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},gn=pe(F),vn=function(){var e=C(un),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(gn,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(hn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){R(l,"formdlg.open",{type:J.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:le(t,"add.text","Create Role")})}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"batch-delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?de.error(te("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ut.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},le(t,"batch_remove.text","Batch Remove"))),v.createElement(he,{ctx:r,point:"fast-add-permission"},v.createElement(M,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){R(l,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:le(t,"fast_add.text","Fast Add")})}},le(t,"fast_add.text","Fast Add")))))},data:(null==a?void 0:a.data)||[],idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,lazy:!0,key:o},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"220px"}),v.createElement(V,{field:"rule_name",title:oe(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"description",title:oe(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(z,{frozen:!0,align:"right",width:"80px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formdlg.open",{ctx:r,record:n,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ut.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},En=[{type:ee.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:ee.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:ee.AND,value:["/rbac/add-permission"],key:"add"},{type:ee.AND,value:["/rbac/update-permission"],key:"update"},{type:ee.AND,value:["/rbac/delete-permission"],key:"delete"}],yn=yt({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=gt({name:"permissions",fetch:function(e){return ut.permissions()},checkAccessItems:En,defaultPageSize:50,selectionValue:function(e){return e.name}});x(function(){r.ctx.search()},[r.version]);var a=ge(),l=ge();return r.ctx.registerEvent("remove",tt(r.ctx)),v.createElement(un.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,fastadddlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(pn,p({},a)),v.createElement(mn,p({},l)),v.createElement(vn,null)))}),bn=v.createContext({pageConfig:{},fetchConfig:{}}),xn=v.createContext({pageConfig:{},fetchConfig:{}}),Cn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{label:"",value:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"label",label:oe(n,"label.label","Label")},v.createElement(U,{value:o.label})),v.createElement(L,{name:"value",label:oe(n,"value.label","Value")},v.createElement(U,{value:o.value})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:o.label,type:"LIKE",filter_empty:!0},{key:"value",value:o.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},kn=function(){var e=C(xn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(F,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:J.CREATE,ctx:r,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Cn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(l,"formDataRefDlg.open",e)}},le(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style},v.createElement(V,{field:"label",title:oe(t,"label.label","Label"),width:"160px"}),v.createElement(V,{field:"value",title:oe(t,"value.label","Value"),align:"center",width:"180px"}),v.createElement(V,{field:"data",title:oe(t,"data.label","Data"),align:"center",width:"180px"}),v.createElement(z,{frozen:!0,align:"right",width:"80px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}],data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},wn=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(Fe(a).toArray(),1)[0],s=k(null);x(function(){null==t||t.setMethod("onSubmit",function(e){return u(e)})},[]);var u=function(e){s.current.validate(function(r){if(null==r){var l={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===J.UPDATE&&l.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,l,function(){de.success(te("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else de.error(rt(r))})};return v.createElement(O,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"label",label:oe(l,"label.label","Label")+":"},v.createElement(U,{placeholder:oe(l,"label.placeholder",""),value:c.label})),v.createElement(L,{name:"value",label:oe(l,"value.label","Value")+":"},v.createElement(U,{placeholder:oe(l,"value.placeholder",""),value:c.value})),v.createElement(L,{name:"data",label:oe(l,"data.label","Data")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"data.placeholder",""),value:c.data,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Sn=function(e){var t=e.value,n=e.props,r=e.close,a=C(xn),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(wn,p(p({ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c}))),v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},le(o,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},le(o,"cancel.text","Cancel"))))},Rn="dict-item",An=et(Rn),Nn=yt({name:"DictItem",fetchConfig:function(){return Je.configs(Rn)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,a=vt({name:Rn,fetch:function(e){return Je.list(Rn,e)},checkAccessItems:An,fixedConditions:[{key:"sign",value:r}]},r);a.ctx.registerEvent("remove",nt(a.ctx));var l=ge({sign:r});return x(function(){a.ctx.search()},[]),v.createElement(xn.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(Sn,p({},l)),v.createElement(kn,null)))}),_n=function(e){var t=e.ctx,n=(e.ctxState,e.type),a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(Fe(a).toArray(),1)[0],s=k(null);x(function(){null==t||t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){if(null==e){var r={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===J.UPDATE&&r.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),o()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"sign",label:oe(l,"sign.label","Sign")+":"},v.createElement(U,{placeholder:oe(l,"sign.placeholder",""),disabled:n===J.UPDATE,value:c.sign})),v.createElement(L,{name:"remark",label:oe(l,"remark.label","Remark")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"remark.placeholder",""),value:c.remark,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Dn=function(e){var t=e.value,n=e.props,r=(e.close,C(bn));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Nn,p({},n))))},Pn=function(e){var t=e.value,n=e.props,r=e.close,a=C(bn),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(_n,p(p({ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s}))),v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},le(i,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},le(i,"cancel.text","Cancel"))))},Tn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",sign:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"sign",label:oe(n,"sign.label","Sign")},v.createElement(U,{value:o.sign})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE",filter_empty:!0},{key:"sign",value:o.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(a),null==t||t.reset()}},le(n,"reset.text","Reset"))))},In=pe(F),Un=function(){var e=C(bn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(In,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:J.CREATE,ctx:r,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Tn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(l,"formDataRefDlg.open",e)}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&e.length>0?null==r||r.publish("batchRemove",{conditions:[{key:"id",value:r.tableSlectionValue(),type:"IN"}]}):de.error(te("checkbox_no_empty","Message"))}},le(t,"batch_remove.text","Batch Remove")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"160px"}),v.createElement(V,{field:"sign",title:oe(t,"sign.label","Sign"),width:"150px"}),v.createElement(V,{field:"remark",title:oe(t,"remark.label","Remark"),width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"120px"}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"120px"}),v.createElement(z,{frozen:!0,align:"right",width:"150px"},v.createElement(W,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),o={sign:n.sign,title:le(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"items"},v.createElement(A,{content:le(t,"item_list.text","Dict Item"),position:"top"},v.createElement(M,{onClick:function(){return R(l,"dictItemDataRefDlg.open",o)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},Mn="dict",On=[{type:ee.AND,value:["/resource/dict-item/list"],key:"items"}].concat(t(et(Mn))),Ln=yt({name:"Dict",fetchConfig:function(){return Je.configs(Mn)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:Mn,fetch:function(e){return Je.list(Mn,e)},checkAccessItems:On});r.ctx.registerEvent("remove",nt(r.ctx)),r.ctx.registerEvent("batchRemove",nt(r.ctx));var a=ge(),l=ge();return x(function(){r.ctx.search()},[r.version]),v.createElement(bn.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,dictItemDataRefDlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(Pn,p({},a)),v.createElement(Dn,p({},l)),v.createElement(Un,null)))}),jn=function(){return v.createElement("h1",null,"404!!!!!!!")},Fn=function(e){var t=r(E([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),2);t[0],t[1];return v.createElement("h2",null,"developing......")},Vn=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return k(null),v.createElement(ve,{mode:"cover"},v.createElement(D,{style:{width:"100%",height:"100%"}},v.createElement(P,{region:"north",style:{height:50}},"North Region"),v.createElement(P,{region:"south",style:{height:50}},"South Region"),v.createElement(P,{region:"west",style:{width:240}},v.createElement("div",{style:{}},"West Region")),v.createElement(P,{region:"east",style:{width:240}},v.createElement("div",{style:{}},"East Region")),v.createElement(P,{region:"center",style:{width:"100%",height:"100%"}},v.createElement(Fn,null))))},zn=v.createContext({}),Wn=function(){var e=ye(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,we(function(e){return e.app.theme})),a=k(null);return x(function(){},[]),v.createElement(v.Fragment,null,v.createElement(be,{width:"300px",placement:"right",ref:a},v.createElement(T,{style:{width:"300px",height:"100%"},title:te("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map(function(e,n){return v.createElement("div",{key:n},v.createElement(Y,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),v.createElement(Z,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},te("themes."+e.key,"Setting",e.name)))}))),v.createElement(M,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){a.current.toggle()}}))},Bn=function(){var e=we(function(e){return e.user.info}),t=Te();return v.createElement(H,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return v.createElement(Q,{noline:!0},v.createElement(X,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=te("confirm_logout","Message");ue("",n,function(){_e.logout(function(){t("/login")})})}}})},qn=new se(0,function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}}),Gn={border:!1,plain:!0,scrollable:!0,narrow:!1},Kn={border:!1,animate:!0,multiple:!0,showCollapsedText:!1},Hn=function(e){Te(),we(function(e){return e.user.info});var t={dispatch:ke(),useAppSelector:we},n=ft(qn),r=n.collapsed,a=n.menuList,l=n.choiceId,o=n.onMenuSelection,i=n.menuArea,c=n.setMenuAreaId,s=n.menuTabList,u=n.onTabClosed,d=n.onTabSelected,m=function(){return v.createElement(v.Fragment,null,!r&&(null==i?void 0:i.map(function(e,t){return v.createElement(M,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return c(e.id)}},e.text)})))},f=function(){return v.createElement(v.Fragment,null,v.createElement(Bn,null),v.createElement(Zt,null),v.createElement(Wn,null))},h=function(){return v.createElement(v.Fragment,null,e.footer)},g=function(){return v.createElement(Ce,{onTabSelect:d,tabsCfg:Gn,onTabClosed:u,data:s})};return v.createElement(zn.Provider,{value:t},v.createElement(xe,p({menus:a,title:te("title","App","Admin"),collapsed:r,sidebarCfg:p(p({},Kn),{},{onItemClick:o}),selection:$.findNode(a,"id",l),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,Pe(e))},slots:{barLeft:v.createElement(m,null),barRight:v.createElement(f,null),footer:v.createElement(h,null)},onSideMenuSelection:function(){}},e),v.createElement(g,null),v.createElement("div",{className:"admin-tabs-panel-body"},v.createElement(Ue,null))))};var Qn=function(e){var t=e.text,n=e.position,a=void 0===n?"top":n,l=e.maxWidth,o=void 0===l?400:l,i=function(){var e=k(null),t=r(E(!1),2),n=t[0],a=t[1];return x(function(){var t=e.current;if(t){var n=function(){a(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),c=r(i,2),s=c[0],u=c[1],d=r(E(!1),2),m=d[0],f=d[1],p=r(E({top:0,left:0,width:0,height:0}),2),h=p[0],g=p[1],y=v.createElement("div",{ref:s,className:"easyui-cell",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:function(){if(s.current){var e=s.current.getBoundingClientRect();g({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}),f(!0)}},onMouseLeave:function(){return f(!1)}},t);return u?v.createElement(v.Fragment,null,y,m&&ze(v.createElement("div",{className:"easyui-tooltip-content easyui-tooltip-".concat(a),style:{maxWidth:o,position:"absolute",zIndex:9999,top:"top"===a?h.top-6:h.top+h.height+6,left:h.left,pointerEvents:"none"}},v.createElement("pre",{style:{whiteSpace:"pre-wrap",margin:0}},t)),document.body)):y};function Xn(e){var t,n,r;n=e.request,Be||(Be=n),r=null!==(t=e.apis)&&void 0!==t?t:{},Ye=p(p({},Ye),r)}export{Dt as AdminView,zn as AppLayoutContext,Hn as BaseLayout,Ln as DictView,Pt as HomeView,We as Lazy,Zt as LocaleBarItem,$t as LoginView,jn as NotFoundView,Et as PaginationPanel,yn as PermissionsView,sn as RolesView,Bt as RouterView,Vn as ScreenDesign,Wn as SettingBarItem,Qt as SettingView,Qn as Tooltip,dt as adminService,mt as configService,rt as convertToText,it as ctxPageValue,ct as ctxPageValueOptions,st as fetchConfigOptions,Xn as install,at as permissionTree,lt as queryPermissionTress,ut as rbacService,tt as removeEventFn,Ke as renderDateTime02,Qe as renderFetchConfigValue,He as renderText,qe as renderTooltip,Ge as renderType,et as resourceAccessItems,nt as resourceRemoveEvent,Je as resourceService,ot as roleTree,pt as useAppRedirect,ht as useAppStarter,gt as useLocalTable,ft as useMenuAndTabData,vt as useTable,yt as withDocHoc};
|
|
1
|
+
function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return i}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,a,l){var o=r&&r.prototype instanceof s?r:s,u=Object.create(o.prototype);return i(u,"_invoke",function(n,r,a){var l,o,i,s=0,u=a||[],d=!1,m={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,o=0,i=e,m.n=n,c}};function f(n,r){for(o=n,i=r,t=0;!d&&s&&!a&&t<u.length;t++){var a,l=u[t],f=m.p,p=l[2];n>3?(a=p===r)&&(i=l[(o=l[4])?5:(o=3,3)],l[4]=l[5]=e):l[0]<=f&&((a=n<2&&f<l[1])?(o=0,m.v=r,m.n=l[1]):f<p&&(a=n<3||l[0]>r||r>p)&&(l[4]=n,l[5]=r,m.n=p,o=0))}if(a||n>1)return c;throw d=!0,r}return function(a,u,p){if(s>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),o=u,i=p;(t=o<2?e:i)||!d;){l||(o?o<3?(o>1&&(m.n=-1),f(o,i)):m.n=i:m.v=i);try{if(s=2,l){if(o||(a="next"),t=l[a]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,o<2&&(o=0)}else 1===o&&(t=l.return)&&t.call(l),o<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),o=1);l=e}else if((t=(d=m.n<0)?i:n.call(r,m))!==c)break}catch(t){l=e,o=1,i=t}finally{s=1}}return{value:t,done:d}}}(n,a,l),!0),u}var c={};function s(){}function u(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),f=d.prototype=s.prototype=Object.create(m);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,i(f,"constructor",d),i(d,"constructor",u),u.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:l,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function l(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},i(e,t,n,r)}function c(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function o(e){c(l,r,a,o,i,"next",e)}function i(e){c(l,r,a,o,i,"throw",e)}o(void 0)})}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}import v,{useState as E,useMemo as y,useLayoutEffect as b,useEffect as x,useContext as C,useRef as k}from"react";import{get as w,trim as S,invoke as R}from"lodash-es";import{Tooltip as A,Pagination as N,Dialog as _,Layout as P,LayoutPanel as D,Panel as T,Tree as I,TextBox as U,LinkButton as M,Form as O,FormField as L,ComboBox as j,DataGrid as F,GridColumn as V,GridColumnGroup as W,GridHeaderRow as z,TreeGrid as B,NumberBox as q,ComboTree as G,PasswordBox as K,MenuButton as Q,Menu as H,MenuItem as X,RadioButton as Y,Label as Z,treeHelper as $}from"rc-easyui";import{FormDataType as J,CheckAccessEleType as ee}from"@kordar-lib/base";import{tt as te,setLanguage as ne,getActivePkg as re,getResourceBundle as ae,tparam as le,tfield as oe}from"@kordar-lib/i18n";import{MenuService as ie,SelectionTree as ce,TabMenuService as se}from"@kordar-lib/menus";import{$confirm as ue,$toast as de,setSideMenuState as me,useLocale as fe,withCheckGrid as pe,Access as he,useRefDialog as ge,DefaultPanel as ve,RadioGroupBox as Ee,useTheme as ye,DrawerPanel as be,FullBodyLayout as xe,TabsPanel as Ce}from"@kordar/easyui";import{useAppDispatch as ke,useAppSelector as we,Admin as Se,sidebarChoice as Re,removeTab as Ae,saveChoice as Ne,App as _e,login as Pe,setSidebarCollapsed as De}from"@kordar-lib/reducers";import{useNavigate as Te,useLocation as Ie,Outlet as Ue}from"react-router-dom";import{useAppRedirect as Me,useCheckAccess as Oe,useLocalTable as Le,useTable as je,useFormData as Fe,useFormMData as Ve}from"@kordar-components/react";import{createPortal as We}from"react-dom";function ze(e){return v.createElement(v.Suspense,{fallback:v.createElement(v.Fragment,null,"...")},e)}var Be,qe=function(e){var t=e.value;return t?v.createElement(A,{content:t,position:"top"},v.createElement("div",{className:"yp-text-ellipsis"},t)):""},Ge=function(){return v.createElement("div",null,"Type")},Ke=function(e){return e.value.replace("T"," ").replace("Z","")},Qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?v.createElement("span",{className:"iconfont "+t},e):v.createElement("span",null,e)},He=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",a=w(e,t,[]);for(var l in a){var o=a[l];if(o.value==n)return o.label}return r};function Xe(){return Be}new ie;var Ye={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function Ze(e){return Ye[e]}var $e=function(){return m(function e(){u(this,e)},[{key:"result",value:function(e,t,n,r,a,l){200===e&&a&&a(n,r)}},{key:"buildQueryString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).filter(function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]}).map(function(t){var n=e[t];return Array.isArray(n)?n.map(function(e){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))}).join("&"):"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(n))}).join("&")}},{key:"listWithQuery",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.buildQueryString(t),a=r?"resource/".concat(e,"/list?").concat(r):"resource/".concat(e,"/list");return Xe().post(a,n)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(a=s(o().m(function e(t){var n,r,a,l,i,c,s,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.n=1,Xe().post("resource/".concat(t,"/list"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,s=a.count,this.result(l,i,c,s,r);case 2:return e.a(2)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=s(o().m(function e(t){var n,r,a,l,i,c,s=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,e.n=1,Xe().post("resource/".concat(t,"/configs"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return Xe().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=s(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post("resource/".concat(t,"/edit"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return Xe().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return Xe().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=s(o().m(function e(t,n,r,a){var l,i,c,s,u,d,m,f;return o().w(function(e){for(;;)switch(e.n){case 0:if(n!==J.CREATE){e.n=2;break}return e.n=1,this.add(t,r);case 1:l=e.v,i=l.code,c=l.message,s=l.data,this.result(i,c,s,0,a),e.n=4;break;case 2:if(n!==J.UPDATE){e.n=4;break}return e.n=3,this.update(t,r);case 3:u=e.v,d=u.code,m=u.message,f=u.data,this.result(d,m,f,0,a);case 4:return e.a(2)}},e,this)})),function(e,n,r,a){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return Xe().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=s(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post("resource/".concat(t,"/delete"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Xe().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return Xe().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then(function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),a=document.createElement("a");a.setAttribute("download",n+".xlsx"),a.href=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)})}}]);var e,t,n,r,a}(),Je=new $e,et=function(e){return[{type:ee.AND,value:["/resource/"+e+"/add"],key:"add"},{type:ee.AND,value:["/resource/"+e+"/update"],key:"update"},{type:ee.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:ee.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},tt=function(e,t){return function(n){var r=n.fn,a=n.params,l=n.success,o=n.error;ue(te("confirm_del_title","Message"),null!=t?t:te("confirm_del_msg","Message"),function(){r(a).then(function(t){var n=t.code;t.message,t.data;200===n?(l&&l(),e.refresh(),de.success(te("del_success","Message"))):o&&o()})})}},nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){ue(te("confirm_del_title","Message"),null!=t?t:te("confirm_del_msg","Message"),function(){Je.delResult(e.name(),n,function(){e.refresh(),de.success(te("del_success","Message"))}).then()})}};function rt(e){return Object.entries(e).map(function(e){var t=r(e,2),n=t[0],a=t[1];return"".concat(a[0],"(").concat(n,")")}).join(",")}function at(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o,i=t.value,c="",s=i.name,u=S(s,"/").split("/");u.length<=2?c=u[0]:u.length>2&&(c=u[0]+"/"+u[1]);var d=a.get(c);null==d&&(d=[]);var m=null!==(o=i.description)&&void 0!==o?o:"";d.push({id:s,text:m+"["+s+"]"}),a.set(c,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}function lt(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var a=lt(e.children,t,n);a>0&&(a===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function ot(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o=t.value,i="",c=o.description,s=void 0,u=S(c,":").split(":");u.length<=2?i=u[0]:u.length>2&&(i=u[0]+":"+u[1]),u.length>=2&&(s=u[1]);var d=a.get(i);null==d&&(d=[]);var m=o.name;d.push({id:m,text:null!=s?s:m}),a.set(i,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}var it=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},ct=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},st=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach(function(e){return n.push({value:e.value,text:e.label})}):Object.keys(r).forEach(function(e,t){return n.push({value:e,text:r[e]})}),n},ut=new(function(){return m(function e(){u(this,e)},[{key:"roles",value:function(){return Xe().post(Ze("rbacRoles"))}},{key:"addRole",value:function(e){return Xe().post(Ze("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return Xe().post(Ze("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return Xe().post(Ze("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return Xe().post(Ze("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return Xe().post(Ze("rbacPermissions"))}},{key:"addPermission",value:function(e){return Xe().post(Ze("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return Xe().post(Ze("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return Xe().post(Ze("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return Xe().post(Ze("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return Xe().post(Ze("rbacRules"))}},{key:"addRule",value:function(e){return Xe().post(Ze("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return Xe().post(Ze("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return Xe().get(Ze("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return Xe().post(Ze("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return Xe().get(Ze("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return Xe().post(Ze("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return Xe().post(Ze("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return Xe().get(Ze("rbacGetPermissionsByUser"),{id:e})}}])}()),dt=new(function(){return m(function e(){u(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xe().post(Ze("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Xe().post(Ze("adminResetPassword"),e)}},{key:"menus",value:function(){return Xe().post(Ze("menus"),{})}},{key:"info",value:function(e){return Xe().post(Ze("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),mt=new(function(){return m(function e(){u(this,e)},[{key:"initialize",value:function(){return Xe().post(Ze("initialize"))}},{key:"getLugData",value:function(e){return Xe().post(Ze("langData"),{locale:e})}}])}());function ft(e){var t=ke(),n=Te(),a=null==we?void 0:we(function(e){return e.app.sidebarCollapsed}),l=we(function(e){return e.layout}),i=l.tabs,c=l.choices,u=l.choiceId,d=r(E(),2),m=d[0],f=d[1],p=r(E(),2),h=p[0],g=p[1],v=r(E([]),2),x=v[0],C=v[1],k=r(E([]),2),w=k[0],S=k[1],R=y(function(){var t;return e.init(me(x,c)),f(e.tabs),a?e.menus():[{id:0,text:"",state:"open",children:e.menusById(h||c[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[x,a,h]),A=y(function(){return e.init(me(x,c)),e.menus()},[x,a]),N=y(function(){for(var t=[],n=0;n<w.length;n++){var r=w[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==u,type:2})}for(var a=0;a<i.length;a++){var l=e.getItemById(i[a]);l&&t.push({id:l.id,path:l.path,closable:!0,title:l.text,selected:l.id==u,type:1})}return t},[x,i,u]);return b(function(){s(o().m(function e(){var t,n,r,a,l;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,dt.menus();case 1:return t=e.v,n=t.data,C(n.sidebar),S(n.welcome),r=Se.info(),a=r.id,e.n=2,ut.getPermissionsByUser(a);case 2:l=e.v,Se.loadPermissions(l.data);case 3:return e.a(2)}},e)}))()},[]),{collapsed:a,menuList:R,menuAll:A,onMenuSelection:function(r){if(r){var a=e.searchPathIndex(r.id);t(Re({id:r.id,choices:a})),n({pathname:r.path})}},menuArea:m,setMenuAreaId:g,choiceId:u,menuTabList:N,onTabClosed:function(n){var r=n.props.id;t(Ae({id:r}));var a=e.searchPathIndex(u);t(Ne({choices:a}))},onTabSelected:function(r){var a=e.searchPathIndex(r.id);t(Re({id:r.id,choices:a})),n({pathname:r.path})}}}function pt(){var e={location:Ie(),history:we(function(e){return e.app.historyLocation}),isGuest:function(){return Se.isGuest()},saveHistoryLocation:function(e){return _e.saveHistoryLocation(e)}};return Me(e)}function ht(){var e=fe().locale,t=r(E(),2),n=t[0],a=t[1],l=pt();return x(function(){ne(e,function(){a(re())}),l.autoRedirect()},[]),x(function(){a(re())},[e]),{easyuiLangPkg:n}}function gt(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=Oe(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:Se.can,OrCan:Se.orCan,Permissions:Se.permissions}),o=we(function(e){return e.user.version}),i=r(E({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return Le({value:c,setValue:s,config:e,checkaccess:l,dependency:a,version:o})}function vt(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=Oe(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:Se.can,OrCan:Se.orCan,Permissions:Se.permissions}),o=we(function(e){return e.user.version}),i=r(E({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return je({value:c,setValue:s,config:e,checkaccess:l,dependency:a,version:o})}var Et=function(e){var t=e.ctxState,n=e.ctx;return v.createElement(N,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},yt=function(e){return function(t){return function(n){var a=r(E({}),2),l=a[0],o=a[1],i=r(E({}),2),c=i[0],s=i[1],u=r(E(0),2),d=u[0],m=u[1],f=fe().locale;return x(function(){var t=ae(f,"Page",e.name);document.title=w(t,"title",te("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;s(t||{}),m(d+1)})},[f]),v.createElement(v.Fragment,null,v.createElement(t,p(p({},n),{},{pageConfig:l,fetchConfig:c,fetchVersion:d})))}}},bt=v.createContext({pageConfig:{},fetchConfig:{}}),xt=function(e){var t=e.ctx,n=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=r(E(),2),c=i[0],u=i[1],d=r(E([]),2),m=d[0],f=d[1],p=k(null),h=r(E([]),2),g=h[0],y=h[1],b=r(E([]),2),C=b[0],w=b[1],S=k(null);x(function(){null==t||t.setMethod("onSubmit",A),R()},[]);var R=function(){var e=s(o().m(function e(){var t,r,a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ut.roles();case 1:return t=e.v,r=ot(t.data||[]),a=[],e.n=2,ut.permissions();case 2:l=e.v,i=at(l.data||[]),c=[],ut.getPermissionsByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach(function(e){r.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),lt(i,r,c),u(i),c.forEach(function(e){p.current.checkNode(e)})}}),ut.getRolesByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var l=new Set;n&&n.forEach(function(e){l.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),lt(r,l,a),y(r),a.forEach(function(e){S.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),A=function(){ut.assignItemToUser({id:n.id,roles:C,permissions:m}).then(function(e){200===e.code&&(de.success(le(a,"assign_success","assign permission successfully!")),l())})};return v.createElement(P,{style:{width:800,height:500}},v.createElement(D,{region:"west",style:{width:220}},v.createElement(T,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:g,ref:S,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),w(t)}}}))),v.createElement(D,{region:"center",style:{height:"100%"}},v.createElement(T,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(U,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:c,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}}))),v.createElement(D,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:A}," ",le(a,"submit.text","Submit")," "),v.createElement(M,{style:{width:80},onClick:l}," ",le(a,"close.text","Close")," "))))},Ct=function(e){var t=e.value,n=e.props,r=e.close,a=C(bt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(xt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},kt=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=(e.refs,r(Fe(n).toArray(),1)[0]),i=k(null);x(function(){null==t||t.setMethod("onSubmit",c)},[]);var c=function(){i.current.validate(function(e){if(null==e){var n={username:o.username,phone:o.phone,password:"123456"};dt.register(n).then(function(e){200===e.code&&(de.success(te("save success","Message")),t.refresh(),l())})}else de.error(rt(e))})};return v.createElement(O,{ref:i,model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"username",label:oe(a,"username.label","Username")+":"},v.createElement(U,{placeholder:oe(a,"username.placeholder",""),value:o.username})),v.createElement(L,{name:"phone",label:oe(a,"phone.label","Phone")+":"},v.createElement(U,{placeholder:oe(a,"phone.placeholder",""),value:o.phone})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},le(a,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==l?void 0:l()},iconCls:"icon-cancel"},le(a,"cancel.text","Cancel"))))},wt=function(e){var t=e.value,n=e.props,r=e.close,a=C(bt),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(kt,p(p({className:"f-full",ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s})))},St=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={username:"",phone:"",status:"",type:""},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",labelWidth:"auto",model:i,labelPosition:"before"},v.createElement(L,{name:"username",label:oe(n,"username.label","Username")},v.createElement(U,{value:i.username})),v.createElement(L,{name:"phone",label:oe(n,"phone.label","Phone")},v.createElement(U,{value:i.phone})),v.createElement(L,{name:"status",label:oe(n,"status.label","Status")},v.createElement(j,{data:st(a,"admin-state"),value:i.status})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"admin-type"),value:i.type})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:i.username,type:"LIKE",filter_empty:!0},{key:"phone",value:i.phone,type:"LIKE",filter_empty:!0},{key:"status",value:i.status,type:"EQ",filter_empty:!0},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(l),null==t||t.reset()}},le(n,"reset.text","Reset"))))},Rt=pe(F),At=function(){var e=C(bt),t=e.pageConfig,n=e.fetchConfig,a=e.ctx,l=e.ctxState,o=e.refs,i=(e.version,r(E(0),2)),c=i[0],s=i[1];return x(function(){s(c+1)},[n]),v.createElement(v.Fragment,null,v.createElement(Rt,{toolbar:function(){var e={record:{username:"",password:""},type:J.CREATE,ctx:a,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(St,{ctx:a,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:a,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(o,"formDataRefDlg.open",e)}},le(t,"add.text","Add")))))},data:null==l?void 0:l.data,loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,idField:"id",selection:null==l?void 0:l.selectionValues,onSelectionChange:function(e){return null==a?void 0:a.tableSelectionChange(e)},ckWidth:20,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,r=e.originalValue,l=n.props.field;if(console.log(t,n,r),t[l]!==r){var o=null==a?void 0:a.name();Je.edit(o,{conditions:[{key:"id",value:t.id}],editor:[{key:l,value:t[l],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?de.success(te("save_success","Message")):de.error(n),null==a||a.refresh()})}},key:c},v.createElement(V,{field:"id",title:oe(t,"id.label","UserId"),width:"50px"}),v.createElement(V,{field:"username",title:oe(t,"username.label","Username"),width:"80px"}),v.createElement(V,{field:"phone",title:oe(t,"phone.label","Phone"),width:"60px",editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(U,{value:t.phone})}}),v.createElement(V,{field:"status",title:oe(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return He(n,"admin-state",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(j,{data:st(n,"admin-state"),value:t.status+""})}}),v.createElement(V,{field:"type",title:oe(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return He(n,"admin-type",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(j,{data:st(n,"admin-type"),value:t.type+""})}}),v.createElement(V,{field:"version",title:oe(t,"version.label","Version"),width:"60px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"75px"}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"75px"}),v.createElement(W,{frozen:!0,align:"right",width:"100px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return J.UPDATE,"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.username),v.createElement(v.Fragment,null,v.createElement(he,{ctx:a,point:"assign"},v.createElement(M,{plain:!0,onClick:function(){return R(o,"assigndlg.open",{ctx:a,record:n,title:"".concat(le(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),v.createElement(he,{ctx:a,point:"delete"},v.createElement(M,{onClick:function(){return null==a?void 0:a.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"100px"})))))},Nt="admin",_t=[{type:ee.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(t(et(Nt))),Pt=yt({name:"Admin",fetchConfig:function(){return Je.configs(Nt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:Nt,fetch:function(e){return Je.list(Nt,e)},checkAccessItems:_t,defaultPageSize:30});r.ctx.registerEvent("remove",nt(r.ctx));var a=ge(),l=ge();return x(function(){r.ctx.search()},[r.version]),v.createElement(bt.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,assigndlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(wt,p({},a)),v.createElement(Ct,p({},l)),v.createElement(At,null)))}),Dt=function(){return v.createElement("h1",null,"Home!!!!!!!")},Tt=v.createContext({pageConfig:{},fetchConfig:{}}),It=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={position:void 0,active:void 0,title:"",type:void 0},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"title",label:oe(n,"title.label","Title")},v.createElement(U,{value:i.title})),v.createElement(L,{name:"active",label:oe(n,"active.label","Active")},v.createElement(j,{data:st(a,"switch-state"),value:i.active})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"setting-type"),value:i.type})),v.createElement(L,{name:"position",label:oe(n,"position.label","Position")},v.createElement(j,{data:st(a,"setting-position"),value:i.position})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:i.position,type:"="},{key:"type",value:i.type,type:"="},{key:"active",value:i.active,type:"="},{key:"title",value:i.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},Ut=function(e){var t=e.pageVersion,n=C(Tt),r=n.pageConfig,a=n.fetchConfig,l=n.ctx,o=n.ctxState,i=n.refs;return v.createElement(B,{toolbar:function(){return function(e,t,n,r){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(It,{ctx:n,pageConfig:e,fetchConfig:t})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},le(e,"refresh.text","Refresh")),v.createElement(he,{ctx:n,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(r,"formdlg.open",{type:J.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:le(e,"add.text","Create Setting")})}},le(e,"add.text","Add")))))}(r,a,l,i)},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",treeField:"title",key:"tree-table-"+t},v.createElement(V,{field:"title",title:oe(r,"title.label","Title"),width:"220px"}),v.createElement(V,{field:"icon",title:oe(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return v.createElement("span",{className:"iconfont "+t})}}),v.createElement(V,{field:"active",title:oe(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return He(a,"switch-state",t)}}),v.createElement(V,{field:"position",title:oe(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return He(a,"setting-position",t)}}),v.createElement(V,{field:"type",title:oe(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return He(a,"setting-type",t)}}),v.createElement(V,{field:"router_name",title:oe(r,"router_name.label","RouterName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"url",title:oe(r,"url.label","URL"),align:"left",width:"300px"}),v.createElement(V,{field:"sort",title:oe(r,"sort.label","Sort"),align:"left",width:"80px"}),v.createElement(V,{field:"create_time",title:oe(r,"create_time.label","CreateTime"),width:"180px"}),v.createElement(V,{field:"update_time",title:oe(r,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(W,{frozen:!0,align:"right",width:"80px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:l,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(i,"formdlg.open",{ctx:l,record:t,type:J.UPDATE,title:"".concat(le(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:l,point:"delete"},v.createElement(M,{onClick:function(){return null==l?void 0:l.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Mt=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=e.refs,s=r(Ve(a).toArray(),2),u=s[0],d=s[1],m=k(null),f=y(function(){var e;return new ce(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,function(e){return{id:e.id,text:e.title,children:[]}},{id:0,text:le(l,"none_parent","None Parent"),children:[]})},[t.config.data]);x(function(){t.setMethod("submitForm",p),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;d({router_name:t.name,url:t.url}),R(c,"routerlistdlg.close")})},[]);var p=function(){m.current.validate(function(e){if(null==e){var r={object:{id:parseInt(u.id),title:u.title,router_name:u.router_name,icon:u.icon,active:parseInt(u.active),position:parseInt(u.position),type:parseInt(u.type),sort:parseInt(u.sort),pid:parseInt(u.pid),url:u.url},conditions:[]};n===J.UPDATE&&r.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),i()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:m,model:u,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"title",label:oe(l,"title.label","Title")+":"},v.createElement(U,{placeholder:oe(l,"title.placeholder",""),value:u.title})),v.createElement(L,{name:"router_name",label:oe(l,"router_name.label","Router Name")+":"},v.createElement(U,{placeholder:oe(l,"router_name.placeholder",""),value:u.router_name,addonRight:function(){var e={title:le(l,"router_title","Router List")};return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return R(c,"routerlistdlg.open",e)}}))}})),v.createElement(L,{name:"icon",label:oe(l,"icon.label","Icon")+":"},v.createElement(U,{placeholder:oe(l,"icon.placeholder",""),value:u.icon})),v.createElement(L,{name:"active",label:oe(l,"active.label","Status")+":"},v.createElement(Ee,{options:st(o,"switch-state"),name:"switch-state",value:u.active,onChange:function(e,t){d({active:e})}})),v.createElement(L,{name:"type",label:oe(l,"type.label","Type")+":"},v.createElement(Ee,{options:st(o,"setting-type"),name:"setting-type",value:u.type,onChange:function(e,t){d({type:e})}})),v.createElement(L,{name:"position",label:oe(l,"position.label","Position")+":"},v.createElement(Ee,{options:st(o,"setting-position"),name:"setting-position",value:u.position,onChange:function(e,t){d({position:e})}})),v.createElement(L,{name:"sort",label:oe(l,"sort.label","Sort")+":"},v.createElement(q,{placeholder:oe(l,"sort.placeholder",""),value:u.sort})),v.createElement(L,{name:"pid",label:oe(l,"pid.label","Pid")+":"},v.createElement(G,{placeholder:oe(l,"pid.placeholder",""),editable:!0,data:f,value:u.pid,onChange:function(e){return d({pid:e})}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:p},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:i},le(l,"close.text","Close"))))},Ot=v.createContext({pageConfig:{},fetchConfig:{}}),Lt=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={name:"",type:""},o=r(E(l),2),i=o[0],c=o[1];return v.createElement(O,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:i.name})),v.createElement(L,{name:"type",label:oe(n,"type.label","Type")},v.createElement(j,{data:st(a,"router-type"),value:i.type})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},jt=function(e){var t=e.selectedRow,n=e.scene,a=C(Ot),l=a.pageConfig,o=a.fetchConfig,i=a.ctx,c=a.ctxState,s=a.refs,u=r(E(0),2),d=u[0],m=u[1],f=function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Lt,{ctx:i,pageConfig:l,fetchConfig:o})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},le(l,"refresh.text","Refresh")),v.createElement(he,{ctx:i,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(s,"formDataRefDlg.open",{type:J.CREATE,ctx:i,record:{name:""},title:le(l,"add.text","Create Router")})}},le(l,"add.text","Add")))))},p=function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:i,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(s,"formDataRefDlg.open",{ctx:i,record:t,type:J.UPDATE,title:"".concat(le(l,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:i,point:"delete"},v.createElement(M,{onClick:function(){return null==i?void 0:i.publish("remove",{conditions:[{key:"name",value:t.name},{key:"type",value:t.type}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))};return x(function(){m(d+1)},[o]),"setting"===n?v.createElement(F,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},v.createElement(V,{field:"name",title:oe(l,"name.label","Name"),render:qe}),v.createElement(V,{field:"url",title:oe(l,"type.label","URL"),align:"center",render:qe}),v.createElement(V,{field:"type",title:oe(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return He(o,"router-type",t)}}),v.createElement(W,{frozen:!0,align:"right",width:"120px"},v.createElement(z,null,v.createElement(V,{align:"center",render:p,width:"120px"})))):v.createElement(F,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},v.createElement(V,{field:"name",title:oe(l,"name.label","Name"),render:qe}),v.createElement(V,{field:"url",title:oe(l,"url.label","URL"),align:"center",render:qe}),v.createElement(V,{field:"type",title:oe(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return He(o,"router-type",t)}}),v.createElement(V,{field:"data",title:oe(l,"data.label","Data")}),v.createElement(V,{field:"create_time",title:oe(l,"create_time.label","CreateTime"),width:"180px"}),v.createElement(V,{field:"update_time",title:oe(l,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(W,{frozen:!0,align:"right",width:"120px"},v.createElement(z,null,v.createElement(V,{align:"center",render:p,width:"120px"}))))},Ft=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=(e.refs,r(Ve(a).toArray(),2)),s=c[0],u=c[1],d=k(null);x(function(){null==t||t.setMethod("onSubmit",m)},[]);var m=function(){d.current.validate(function(e){if(null==e){var r={object:{name:s.name,url:s.url,type:s.type,data:s.data},conditions:[]};n===J.UPDATE&&(r.conditions.push({key:"name",value:a.name}),r.conditions.push({key:"type",value:a.type})),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),i()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:d,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:s.name})),v.createElement(L,{name:"url",label:oe(l,"url.label","Url")+":"},v.createElement(U,{placeholder:oe(l,"url.placeholder",""),value:s.url})),v.createElement(L,{name:"type",label:oe(l,"type.label","Type")+":"},v.createElement(Ee,{name:"router-type",value:s.type,options:st(o,"router-type"),onChange:function(e,t){u({type:e})}})),v.createElement(L,{name:"data",label:oe(l,"data.label","Data")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"data.placeholder",""),value:s.data})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},onClick:m},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:i},le(l,"close.text","Close"))))},Vt=function(e){var t=e.value,n=e.props,r=e.close,a=C(Ot),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Ft,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},Wt="router",zt=[{type:ee.AND,value:["/resource/router/add"],key:"add"},{type:ee.AND,value:["/resource/router/update"],key:"update"},{type:ee.AND,value:["/resource/router/delete"],key:"delete"},{type:ee.AND,value:["/resource/router/edit"],key:"edit"}],Bt=yt({name:"Router",fetchConfig:function(){return Je.configs(Wt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,a=e.scene,l=vt({name:Wt,fetch:function(e){return Je.list(Wt,e)},checkAccessItems:zt,defaultPageSize:20});x(function(){l.ctx.search()},[l.version]),l.ctx.registerEvent("remove",nt(l.ctx));var o=ge();return v.createElement(Ot.Provider,{value:{ctx:l.ctx,ctxState:l.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:l.ctx,ctxState:l.ctxState})}},v.createElement(Vt,p({},o)),v.createElement(jt,{selectedRow:r,scene:a})))}),qt=function(e){var t=e.value,n=e.props,r=e.close,a=C(Tt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Mt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},Gt=function(e){var t=e.value,n=e.props,r=(e.close,C(Tt).ctx);return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Bt,{selectedRow:function(e){var t,n=e.row,a=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:a})},scene:"setting"})))},Kt="setting",Qt=[{type:ee.AND,value:["/resource/setting/add"],key:"add"},{type:ee.AND,value:["/resource/setting/update"],key:"update"},{type:ee.AND,value:["/resource/setting/delete"],key:"delete"},{type:ee.AND,value:["/resource/setting/edit"],key:"edit"}],Ht=yt({name:"Setting",fetchConfig:function(){return Je.configs(Kt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,a=gt({name:Kt,fetch:function(e){return Je.list(Kt,e)},checkAccessItems:Qt,defaultPageSize:10,isTreeData:!0});a.ctx.registerEvent("remove",nt(a.ctx));var l=ge(),o=ge();return x(function(){a.ctx.search()},[]),v.createElement(Tt.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:l,routerlistdlg:o}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(qt,p({},l)),v.createElement(Gt,p({},o)),v.createElement(Ut,{pageVersion:r})))}),Xt=new(function(){return m(function e(){u(this,e)},[{key:"captcha",value:function(){return Xe().post(Ze("loginCaptcha"))}},{key:"login",value:(e=s(o().m(function e(t,n,r){var a,l,i;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Xe().post(Ze("loginSubmit"),t);case 1:a=e.v,l=a.code,i=a.data,200===l?n(i,l):r(i,l);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return Xe().post(Ze("loginConfig"))}}]);var e}()),Yt=function(e){var t=e.pageConfig,n=e.rules,a=ke(),l=r(E({username:"",captcha:"",password:"",code:"",token:""}),2),o=l[0],i=l[1],c=pt(),s=function(){Xt.captcha().then(function(e){var t=e.data;i(p(p({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return x(function(){s(),c.autoRedirect()},[]),v.createElement(O,{model:o,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},v.createElement(L,{name:"username"},v.createElement(U,{iconCls:"iconfont "+w(t.fields,"username.icon","icon-username"),placeholder:w(t.fields,"username.placeholder","username..."),value:o.username})),v.createElement(L,{name:"password"},v.createElement(K,{iconCls:"iconfont "+w(t.fields,"password.icon","icon-password"),placeholder:w(t.fields,"password.placeholder","password..."),value:o.password})),v.createElement(L,{name:"code"},v.createElement(U,{iconCls:"iconfont "+w(t.fields,"code.icon","icon-captcha"),placeholder:w(t.fields,"code.placeholder","verification code..."),value:o.code,addonRight:function(){return v.createElement("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:s})}})),v.createElement(L,null,v.createElement(M,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Xt.login(e,function(e){a(Pe({token:e.token,info:e.user,error:function(){de.error(w(t.params,"tips.loginError"))}})),c.autoRedirect()},function(){s()})},btnCls:"login_btn"},w(t.params,"submit.text","Sign In"))))},Zt=function(){var e=fe(!0),t=e.localeOptions,n=e.changeLocale;return v.createElement(Q,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return v.createElement(H,null,Object.keys(t).map(function(e,n){return v.createElement(X,{text:t[e],key:n,value:e})}))},onMenuItemClick:n})},$t=yt({name:"Login",fetchConfig:Xt.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,a=e.rules;return v.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},v.createElement(Zt,null),v.createElement("div",{className:"login layui-anim layui-anim-up"},v.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),v.createElement(Yt,{pageConfig:n,fetchConfig:r,rules:a})))}),Jt=v.createContext({pageConfig:{},fetchConfig:{}}),en=function(e){var n=e.ctx,a=(e.type,e.record),l=e.pageConfig,i=(e.fetchConfig,e.close),c=r(E(),2),u=c[0],d=c[1],m=r(E([]),2),f=m[0],p=m[1],h=k(null),g=r(E([]),2),y=g[0],b=g[1],C=r(E([]),2),w=C[0],S=C[1],R=k(null);x(function(){null==n||n.setMethod("onSubmit",N),A()},[]);var A=function(){var e=s(o().m(function e(){var t,n,r,l,i,c,s,u,m,p;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ut.roles();case 1:return t=e.v,n=ot(t.data||[]),r=[],e.n=2,ut.permissions();case 2:return l=e.v,i=at(l.data||[]),c=[],e.n=3,ut.getChildren({name:a.name});case 3:s=e.v,u=s.code,m=s.data,200===u&&(p=new Set,m&&m.forEach(function(e){p.add(e.name),1==e.item_type?w.push(e.name):f.push(e.name)}),lt(i,p,c),d(i),c.forEach(function(e){h.current.checkNode(e)}),lt(n,p,r),b(n),r.forEach(function(e){R.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),N=function(){ut.addPermissionChildren({name:a.name,children:[].concat(t(f),t(w))}).then(function(e){200===e.code&&(de.success(le(l,"assign_success","assign permission successfully!")),i())})};return v.createElement(P,{style:{width:800,height:500}},v.createElement(D,{region:"west",style:{width:220}},v.createElement(T,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:y,ref:R,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),S(t)}}}))),v.createElement(D,{region:"center",style:{height:"100%"}},v.createElement(T,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(U,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},v.createElement(I,{selectLeafOnly:!0,checkbox:!0,data:u,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),p(t)}}}))),v.createElement(D,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:N}," ",le(l,"submit.text","Submit")," "),v.createElement(M,{style:{width:80},onClick:i}," ",le(l,"close.text","Close")," "))))},tn=function(e){var t=e.value,n=e.props,r=e.close,a=C(Jt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(en,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},nn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"description",label:oe(n,"description.label","Description")},v.createElement(U,{value:o.description})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},rn=pe(F),an=function(){var e=C(Jt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(rn,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(nn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){R(l,"formdlg.open",{type:J.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:le(t,"add.text","Create Role")})}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"batch-delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?de.error(te("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ut.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},le(t,"batch_remove.text","Batch Remove")))))},data:(null==a?void 0:a.data)||[],loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:o},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"220px"}),v.createElement(V,{field:"rule_name",title:oe(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"description",title:oe(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"180px",render:Ke}),v.createElement(W,{frozen:!0,align:"right",width:"100px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"assign-permission"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(le(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formdlg.open",{ctx:r,record:n,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ut.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},ln=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(Fe(a).toArray(),2),c=i[0],s=(i[1],r(Fe(a).toArray(),1)[0]),u=k(null);x(function(){t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){null==e?(n===J.CREATE&&ut.addRole(c).then(function(e){var n=e.code;e.data;200==n&&(de.success(te("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===J.UPDATE&&ut.updateRole({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(de.success(te("update_role_success","Message","update role successfully!")),t.refresh(),o())})):de.error(rt(e))})};return v.createElement(O,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"description",label:oe(l,"description.label","Description")+":"},v.createElement(U,{multiline:!0,placeholder:oe(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:d},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:o},le(l,"close.text","Close"))))},on=function(e){var t=e.value,n=e.props,r=e.close,a=C(Jt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ln,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},cn=[{type:ee.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:ee.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:ee.AND,value:["/rbac/add-role"],key:"add"},{type:ee.AND,value:["/rbac/update-role"],key:"update"},{type:ee.AND,value:["/rbac/delete-role"],key:"delete"}],sn=yt({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:"roles",fetch:function(e){return ut.roles()},checkAccessItems:cn,defaultPageSize:30,selectionValue:function(e){return e.name}});x(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",tt(r.ctx));var a=ge(),l=ge();return v.createElement(Jt.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,assigndlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(on,p({},a)),v.createElement(tn,p({},l)),v.createElement(an,null)))}),un=v.createContext({pageConfig:{},fetchConfig:{}}),dn=function(e){var t=e.ctx,n=(e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=r(Fe(n).toArray(),1)[0];x(function(){null==t||t.setMethod("onSubmit",i)},[]);var i=function(){var e={resource:o.resource,name:o.name};ut.fastAddPermission(e).then(function(e){200===e.code&&(de.success(te("save_success","Message","Save Success!")),t.refresh(),l())})};return v.createElement(O,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"resource",label:oe(a,"fast_add_resource.label","Resource")+":"},v.createElement(U,{placeholder:oe(a,"fast_add_resource.placeholder",""),value:o.resource})),v.createElement(L,{name:"name",label:oe(a,"fast_add_name.label","Name")+":"},v.createElement(U,{placeholder:oe(a,"fast_add_name.placeholder",""),value:o.name})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:i},le(a,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:l},le(a,"close.text","Close"))))},mn=function(e){var t=e.value,n=e.props,r=e.close,a=C(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(dn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},fn=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(E(a),2),c=i[0],s=(i[1],r(Fe(a).toArray(),1)[0]),u=k(null);x(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){null==e?(n===J.CREATE&&ut.addPermission(c).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===J.UPDATE&&ut.updatePermission({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):de.error(rt(e))})};return v.createElement(O,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"description",label:oe(l,"description.label","Description")+":"},v.createElement(U,{multiline:!0,placeholder:oe(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(M,{style:{width:80},iconCls:"icon-save",onClick:d},le(l,"submit.text","Submit")),v.createElement(M,{style:{width:80},iconCls:"icon-cancel",onClick:o},le(l,"close.text","Close"))))},pn=function(e){var t=e.value,n=e.props,r=e.close,a=C(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},v.createElement(fn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},hn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"description",label:oe(n,"description.label","Description")},v.createElement(U,{value:o.description})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},gn=pe(F),vn=function(){var e=C(un),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(gn,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(hn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){R(l,"formdlg.open",{type:J.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:le(t,"add.text","Create Role")})}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"batch-delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?de.error(te("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ut.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},le(t,"batch_remove.text","Batch Remove"))),v.createElement(he,{ctx:r,point:"fast-add-permission"},v.createElement(M,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){R(l,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:le(t,"fast_add.text","Fast Add")})}},le(t,"fast_add.text","Fast Add")))))},data:(null==a?void 0:a.data)||[],idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,lazy:!0,key:o},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"220px"}),v.createElement(V,{field:"rule_name",title:oe(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"description",title:oe(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"180px",render:Ke,sortable:!0}),v.createElement(W,{frozen:!0,align:"right",width:"80px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formdlg.open",{ctx:r,record:n,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ut.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},En=[{type:ee.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:ee.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:ee.AND,value:["/rbac/add-permission"],key:"add"},{type:ee.AND,value:["/rbac/update-permission"],key:"update"},{type:ee.AND,value:["/rbac/delete-permission"],key:"delete"}],yn=yt({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=gt({name:"permissions",fetch:function(e){return ut.permissions()},checkAccessItems:En,defaultPageSize:50,selectionValue:function(e){return e.name}});x(function(){r.ctx.search()},[r.version]);var a=ge(),l=ge();return r.ctx.registerEvent("remove",tt(r.ctx)),v.createElement(un.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,fastadddlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(pn,p({},a)),v.createElement(mn,p({},l)),v.createElement(vn,null)))}),bn=v.createContext({pageConfig:{},fetchConfig:{}}),xn=v.createContext({pageConfig:{},fetchConfig:{}}),Cn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{label:"",value:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(L,{name:"label",label:oe(n,"label.label","Label")},v.createElement(U,{value:o.label})),v.createElement(L,{name:"value",label:oe(n,"value.label","Value")},v.createElement(U,{value:o.value})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:o.label,type:"LIKE",filter_empty:!0},{key:"value",value:o.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},le(n,"reset.text","Reset"))))},kn=function(){var e=C(xn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(F,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:J.CREATE,ctx:r,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Cn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(l,"formDataRefDlg.open",e)}},le(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style},v.createElement(V,{field:"label",title:oe(t,"label.label","Label"),width:"160px"}),v.createElement(V,{field:"value",title:oe(t,"value.label","Value"),align:"center",width:"180px"}),v.createElement(V,{field:"data",title:oe(t,"data.label","Data"),align:"center",width:"180px"}),v.createElement(W,{frozen:!0,align:"right",width:"80px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}],data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},wn=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(Fe(a).toArray(),1)[0],s=k(null);x(function(){null==t||t.setMethod("onSubmit",function(e){return u(e)})},[]);var u=function(e){s.current.validate(function(r){if(null==r){var l={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===J.UPDATE&&l.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,l,function(){de.success(te("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else de.error(rt(r))})};return v.createElement(O,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"label",label:oe(l,"label.label","Label")+":"},v.createElement(U,{placeholder:oe(l,"label.placeholder",""),value:c.label})),v.createElement(L,{name:"value",label:oe(l,"value.label","Value")+":"},v.createElement(U,{placeholder:oe(l,"value.placeholder",""),value:c.value})),v.createElement(L,{name:"data",label:oe(l,"data.label","Data")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"data.placeholder",""),value:c.data,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Sn=function(e){var t=e.value,n=e.props,r=e.close,a=C(xn),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(wn,p(p({ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c}))),v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},le(o,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},le(o,"cancel.text","Cancel"))))},Rn="dict-item",An=et(Rn),Nn=yt({name:"DictItem",fetchConfig:function(){return Je.configs(Rn)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,a=vt({name:Rn,fetch:function(e){return Je.list(Rn,e)},checkAccessItems:An,fixedConditions:[{key:"sign",value:r}]},r);a.ctx.registerEvent("remove",nt(a.ctx));var l=ge({sign:r});return x(function(){a.ctx.search()},[]),v.createElement(xn.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(Sn,p({},l)),v.createElement(kn,null)))}),_n=function(e){var t=e.ctx,n=(e.ctxState,e.type),a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(Fe(a).toArray(),1)[0],s=k(null);x(function(){null==t||t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){if(null==e){var r={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===J.UPDATE&&r.conditions.push({key:"id",value:a.id}),Je.saveResult(null==t?void 0:t.name(),n,r,function(){de.success(te("save_success","Message")),t.refresh(),o()}).then(function(e){})}else de.error(rt(e))})};return v.createElement(O,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(L,{name:"name",label:oe(l,"name.label","Name")+":"},v.createElement(U,{placeholder:oe(l,"name.placeholder",""),value:c.name})),v.createElement(L,{name:"sign",label:oe(l,"sign.label","Sign")+":"},v.createElement(U,{placeholder:oe(l,"sign.placeholder",""),disabled:n===J.UPDATE,value:c.sign})),v.createElement(L,{name:"remark",label:oe(l,"remark.label","Remark")+":"},v.createElement(U,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:oe(l,"remark.placeholder",""),value:c.remark,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Pn=function(e){var t=e.value,n=e.props,r=(e.close,C(bn));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Nn,p({},n))))},Dn=function(e){var t=e.value,n=e.props,r=e.close,a=C(bn),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return v.createElement(_,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(_n,p(p({ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s}))),v.createElement("div",{className:"dialog-button"},v.createElement(M,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},le(i,"submit.text","Submit")),v.createElement(M,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},le(i,"cancel.text","Cancel"))))},Tn=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",sign:""}),l=r(E(a),2),o=l[0],i=l[1];return v.createElement(O,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before"},v.createElement(L,{name:"name",label:oe(n,"name.label","Name")},v.createElement(U,{value:o.name})),v.createElement(L,{name:"sign",label:oe(n,"sign.label","Sign")},v.createElement(U,{value:o.sign})),v.createElement(L,null,v.createElement(M,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE",filter_empty:!0},{key:"sign",value:o.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},le(n,"search.text","Search")),v.createElement(M,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(a),null==t||t.reset()}},le(n,"reset.text","Reset"))))},In=pe(F),Un=function(){var e=C(bn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(In,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:J.CREATE,ctx:r,title:le(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(Tn,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},le(t,"refresh.text","Refresh")),v.createElement(he,{ctx:r,point:"add"},v.createElement(M,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return R(l,"formDataRefDlg.open",e)}},le(t,"add.text","Add"))),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&e.length>0?null==r||r.publish("batchRemove",{conditions:[{key:"id",value:r.tableSlectionValue(),type:"IN"}]}):de.error(te("checkbox_no_empty","Message"))}},le(t,"batch_remove.text","Batch Remove")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},v.createElement(V,{field:"name",title:oe(t,"name.label","Name"),width:"160px"}),v.createElement(V,{field:"sign",title:oe(t,"sign.label","Sign"),width:"150px"}),v.createElement(V,{field:"remark",title:oe(t,"remark.label","Remark"),width:"180px"}),v.createElement(V,{field:"create_time",title:oe(t,"create_time.label","CreateTime"),width:"120px"}),v.createElement(V,{field:"update_time",title:oe(t,"update_time.label","UpdateTime"),width:"120px"}),v.createElement(W,{frozen:!0,align:"right",width:"150px"},v.createElement(z,null,v.createElement(V,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:J.UPDATE,title:"".concat(le(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),o={sign:n.sign,title:le(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return v.createElement(v.Fragment,null,v.createElement(he,{ctx:r,point:"items"},v.createElement(A,{content:le(t,"item_list.text","Dict Item"),position:"top"},v.createElement(M,{onClick:function(){return R(l,"dictItemDataRefDlg.open",o)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),v.createElement(he,{ctx:r,point:"update"},v.createElement(M,{plain:!0,onClick:function(){return R(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(he,{ctx:r,point:"delete"},v.createElement(M,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},Mn="dict",On=[{type:ee.AND,value:["/resource/dict-item/list"],key:"items"}].concat(t(et(Mn))),Ln=yt({name:"Dict",fetchConfig:function(){return Je.configs(Mn)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=vt({name:Mn,fetch:function(e){return Je.list(Mn,e)},checkAccessItems:On});r.ctx.registerEvent("remove",nt(r.ctx)),r.ctx.registerEvent("batchRemove",nt(r.ctx));var a=ge(),l=ge();return x(function(){r.ctx.search()},[r.version]),v.createElement(bn.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,dictItemDataRefDlg:l}}},v.createElement(ve,{mode:"cover",footer:function(){return v.createElement(Et,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(Dn,p({},a)),v.createElement(Pn,p({},l)),v.createElement(Un,null)))}),jn=function(){return v.createElement("h1",null,"404!!!!!!!")},Fn=function(e){var t=r(E([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),2);t[0],t[1];return v.createElement("h2",null,"developing......")},Vn=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return k(null),v.createElement(ve,{mode:"cover"},v.createElement(P,{style:{width:"100%",height:"100%"}},v.createElement(D,{region:"north",style:{height:50}},"North Region"),v.createElement(D,{region:"south",style:{height:50}},"South Region"),v.createElement(D,{region:"west",style:{width:240}},v.createElement("div",{style:{}},"West Region")),v.createElement(D,{region:"east",style:{width:240}},v.createElement("div",{style:{}},"East Region")),v.createElement(D,{region:"center",style:{width:"100%",height:"100%"}},v.createElement(Fn,null))))},Wn=v.createContext({}),zn=function(){var e=ye(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,we(function(e){return e.app.theme})),a=k(null);return x(function(){},[]),v.createElement(v.Fragment,null,v.createElement(be,{width:"300px",placement:"right",ref:a},v.createElement(T,{style:{width:"300px",height:"100%"},title:te("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map(function(e,n){return v.createElement("div",{key:n},v.createElement(Y,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),v.createElement(Z,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},te("themes."+e.key,"Setting",e.name)))}))),v.createElement(M,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){a.current.toggle()}}))},Bn=function(){var e=we(function(e){return e.user.info}),t=Te();return v.createElement(Q,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return v.createElement(H,{noline:!0},v.createElement(X,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=te("confirm_logout","Message");ue("",n,function(){Se.logout(function(){t("/login")})})}}})},qn=new se(0,function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}}),Gn={border:!1,plain:!0,scrollable:!0,narrow:!1},Kn={border:!1,animate:!0,multiple:!0,showCollapsedText:!1},Qn=function(e){Te(),we(function(e){return e.user.info});var t={dispatch:ke(),useAppSelector:we},n=ft(qn),r=n.collapsed,a=n.menuList,l=n.choiceId,o=n.onMenuSelection,i=n.menuArea,c=n.setMenuAreaId,s=n.menuTabList,u=n.onTabClosed,d=n.onTabSelected,m=function(){return v.createElement(v.Fragment,null,!r&&(null==i?void 0:i.map(function(e,t){return v.createElement(M,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return c(e.id)}},e.text)})))},f=function(){return v.createElement(v.Fragment,null,v.createElement(Bn,null),v.createElement(Zt,null),v.createElement(zn,null))},h=function(){return v.createElement(v.Fragment,null,e.footer)},g=function(){return v.createElement(Ce,{onTabSelect:d,tabsCfg:Gn,onTabClosed:u,data:s})};return v.createElement(Wn.Provider,{value:t},v.createElement(xe,p({menus:a,title:te("title","App","Admin"),collapsed:r,sidebarCfg:p(p({},Kn),{},{onItemClick:o}),selection:$.findNode(a,"id",l),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,De(e))},slots:{barLeft:v.createElement(m,null),barRight:v.createElement(f,null),footer:v.createElement(h,null)},onSideMenuSelection:function(){}},e),v.createElement(g,null),v.createElement("div",{className:"admin-tabs-panel-body"},v.createElement(Ue,null))))};var Hn=function(e){var t=e.text,n=e.position,a=void 0===n?"top":n,l=e.maxWidth,o=void 0===l?400:l,i=function(){var e=k(null),t=r(E(!1),2),n=t[0],a=t[1];return x(function(){var t=e.current;if(t){var n=function(){a(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),c=r(i,2),s=c[0],u=c[1],d=r(E(!1),2),m=d[0],f=d[1],p=r(E({top:0,left:0,width:0,height:0}),2),h=p[0],g=p[1],y=v.createElement("div",{ref:s,className:"easyui-cell",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:function(){if(s.current){var e=s.current.getBoundingClientRect();g({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}),f(!0)}},onMouseLeave:function(){return f(!1)}},t);return u?v.createElement(v.Fragment,null,y,m&&We(v.createElement("div",{className:"easyui-tooltip-content easyui-tooltip-".concat(a),style:{maxWidth:o,position:"absolute",zIndex:9999,top:"top"===a?h.top-6:h.top+h.height+6,left:h.left,pointerEvents:"none"}},v.createElement("pre",{style:{whiteSpace:"pre-wrap",margin:0}},t)),document.body)):y};function Xn(e){var t,n,r;n=e.request,Be||(Be=n),r=null!==(t=e.apis)&&void 0!==t?t:{},Ye=p(p({},Ye),r)}export{Pt as AdminView,Wn as AppLayoutContext,Qn as BaseLayout,Ln as DictView,Dt as HomeView,ze as Lazy,Zt as LocaleBarItem,$t as LoginView,jn as NotFoundView,Et as PaginationPanel,yn as PermissionsView,sn as RolesView,Bt as RouterView,Vn as ScreenDesign,zn as SettingBarItem,Ht as SettingView,Hn as Tooltip,dt as adminService,mt as configService,rt as convertToText,it as ctxPageValue,ct as ctxPageValueOptions,st as fetchConfigOptions,Xn as install,at as permissionTree,lt as queryPermissionTress,ut as rbacService,tt as removeEventFn,Ke as renderDateTime02,He as renderFetchConfigValue,Qe as renderText,qe as renderTooltip,Ge as renderType,et as resourceAccessItems,nt as resourceRemoveEvent,Je as resourceService,ot as roleTree,pt as useAppRedirect,ht as useAppStarter,gt as useLocalTable,ft as useMenuAndTabData,vt as useTable,yt as withDocHoc};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,a,l){var o=r&&r.prototype instanceof u?r:u,s=Object.create(o.prototype);return i(s,"_invoke",function(n,r,a){var l,o,i,u=0,s=a||[],d=!1,m={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,o=0,i=e,m.n=n,c}};function f(n,r){for(o=n,i=r,t=0;!d&&u&&!a&&t<s.length;t++){var a,l=s[t],f=m.p,p=l[2];n>3?(a=p===r)&&(i=l[(o=l[4])?5:(o=3,3)],l[4]=l[5]=e):l[0]<=f&&((a=n<2&&f<l[1])?(o=0,m.v=r,m.n=l[1]):f<p&&(a=n<3||l[0]>r||r>p)&&(l[4]=n,l[5]=r,m.n=p,o=0))}if(a||n>1)return c;throw d=!0,r}return function(a,s,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===s&&f(s,p),o=s,i=p;(t=o<2?e:i)||!d;){l||(o?o<3?(o>1&&(m.n=-1),f(o,i)):m.n=i:m.v=i);try{if(u=2,l){if(o||(a="next"),t=l[a]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,o<2&&(o=0)}else 1===o&&(t=l.return)&&t.call(l),o<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),o=1);l=e}else if((t=(d=m.n<0)?i:n.call(r,m))!==c)break}catch(t){l=e,o=1,i=t}finally{u=1}}return{value:t,done:d}}}(n,a,l),!0),s}var c={};function u(){}function s(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),f=d.prototype=u.prototype=Object.create(m);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=d,i(f,"constructor",d),i(d,"constructor",s),s.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:l,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function l(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},i(e,t,n,r)}function c(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function o(e){c(l,r,a,o,i,"next",e)}function i(e){c(l,r,a,o,i,"throw",e)}o(void 0)})}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}var v=require("react"),y=require("lodash-es"),E=require("rc-easyui"),b=require("@kordar-lib/base"),x=require("@kordar-lib/i18n"),C=require("@kordar-lib/menus"),k=require("@kordar/easyui"),w=require("@kordar-lib/reducers"),S=require("react-router-dom"),A=require("@kordar-components/react"),T=require("react-dom");var F,D=function(e){var t=e.value;return t?v.createElement(E.Tooltip,{content:t,position:"top"},v.createElement("div",{className:"yp-text-ellipsis"},t)):""},R=function(e){return e.value.replace("T"," ").replace("Z","")},B=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",a=y.get(e,t,[]);for(var l in a){var o=a[l];if(o.value==n)return o.label}return r};function P(){return F}new C.MenuService;var L={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function N(e){return L[e]}var _=function(){return m(function e(){s(this,e)},[{key:"result",value:function(e,t,n,r,a,l){200===e&&a&&a(n,r)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(a=u(o().m(function e(t){var n,r,a,l,i,c,u,s=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,e.n=1,P().post("resource/".concat(t,"/list"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,u=a.count,this.result(l,i,c,u,r);case 2:return e.a(2)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=u(o().m(function e(t){var n,r,a,l,i,c,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.n=1,P().post("resource/".concat(t,"/configs"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return P().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=u(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post("resource/".concat(t,"/edit"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return P().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return P().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=u(o().m(function e(t,n,r,a){var l,i,c,u,s,d,m,f;return o().w(function(e){for(;;)switch(e.n){case 0:if(n!==b.FormDataType.CREATE){e.n=2;break}return e.n=1,this.add(t,r);case 1:l=e.v,i=l.code,c=l.message,u=l.data,this.result(i,c,u,0,a),e.n=4;break;case 2:if(n!==b.FormDataType.UPDATE){e.n=4;break}return e.n=3,this.update(t,r);case 3:s=e.v,d=s.code,m=s.message,f=s.data,this.result(d,m,f,0,a);case 4:return e.a(2)}},e,this)})),function(e,n,r,a){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return P().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=u(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post("resource/".concat(t,"/delete"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return P().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then(function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),a=document.createElement("a");a.setAttribute("download",n+".xlsx"),a.href=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)})}}]);var e,t,n,r,a}(),G=new _,I=function(e){return[{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},M=function(e,t){return function(n){var r=n.fn,a=n.params,l=n.success,o=n.error;k.$confirm(x.tt("confirm_del_title","Message"),null!=t?t:x.tt("confirm_del_msg","Message"),function(){r(a).then(function(t){var n=t.code;t.message,t.data;200===n?(l&&l(),e.refresh(),k.$toast.success(x.tt("del_success","Message"))):o&&o()})})}},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){k.$confirm(x.tt("confirm_del_title","Message"),null!=t?t:x.tt("confirm_del_msg","Message"),function(){G.delResult(e.name(),n,function(){e.refresh(),k.$toast.success(x.tt("del_success","Message"))}).then()})}};function O(e){return Object.entries(e).map(function(e){var t=r(e,2),n=t[0],a=t[1];return"".concat(a[0],"(").concat(n,")")}).join(",")}function V(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o,i=t.value,c="",u=i.name,s=y.trim(u,"/").split("/");s.length<=2?c=s[0]:s.length>2&&(c=s[0]+"/"+s[1]);var d=a.get(c);null==d&&(d=[]);var m=null!==(o=i.description)&&void 0!==o?o:"";d.push({id:u,text:m+"["+u+"]"}),a.set(c,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}function j(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var a=j(e.children,t,n);a>0&&(a===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function z(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o=t.value,i="",c=o.description,u=void 0,s=y.trim(c,":").split(":");s.length<=2?i=s[0]:s.length>2&&(i=s[0]+":"+s[1]),s.length>=2&&(u=s[1]);var d=a.get(i);null==d&&(d=[]);var m=o.name;d.push({id:m,text:null!=u?u:m}),a.set(i,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}var W=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach(function(e){return n.push({value:e.value,text:e.label})}):Object.keys(r).forEach(function(e,t){return n.push({value:e,text:r[e]})}),n},q=new(function(){return m(function e(){s(this,e)},[{key:"roles",value:function(){return P().post(N("rbacRoles"))}},{key:"addRole",value:function(e){return P().post(N("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return P().post(N("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return P().post(N("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return P().post(N("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return P().post(N("rbacPermissions"))}},{key:"addPermission",value:function(e){return P().post(N("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return P().post(N("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return P().post(N("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return P().post(N("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return P().post(N("rbacRules"))}},{key:"addRule",value:function(e){return P().post(N("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return P().post(N("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return P().get(N("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return P().post(N("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return P().get(N("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return P().post(N("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return P().post(N("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return P().get(N("rbacGetPermissionsByUser"),{id:e})}}])}()),$=new(function(){return m(function e(){s(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return P().post(N("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return P().post(N("adminResetPassword"),e)}},{key:"menus",value:function(){return P().post(N("menus"),{})}},{key:"info",value:function(e){return P().post(N("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),H=new(function(){return m(function e(){s(this,e)},[{key:"initialize",value:function(){return P().post(N("initialize"))}},{key:"getLugData",value:function(e){return P().post(N("langData"),{locale:e})}}])}());function K(e){var t,n=w.useAppDispatch(),a=S.useNavigate(),l=null===(t=w.useAppSelector)||void 0===t?void 0:t.call(w,function(e){return e.app.sidebarCollapsed}),i=w.useAppSelector(function(e){return e.layout}),c=i.tabs,s=i.choices,d=i.choiceId,m=r(v.useState(),2),f=m[0],p=m[1],h=r(v.useState(),2),g=h[0],y=h[1],E=r(v.useState([]),2),b=E[0],x=E[1],C=r(v.useState([]),2),A=C[0],T=C[1],F=v.useMemo(function(){var t;return e.init(k.setSideMenuState(b,s)),p(e.tabs),l?e.menus():[{id:0,text:"",state:"open",children:e.menusById(g||s[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[b,l,g]),D=v.useMemo(function(){return e.init(k.setSideMenuState(b,s)),e.menus()},[b,l]),R=v.useMemo(function(){for(var t=[],n=0;n<A.length;n++){var r=A[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==d,type:2})}for(var a=0;a<c.length;a++){var l=e.getItemById(c[a]);l&&t.push({id:l.id,path:l.path,closable:!0,title:l.text,selected:l.id==d,type:1})}return t},[b,c,d]);return v.useLayoutEffect(function(){u(o().m(function e(){var t,n;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$.menus();case 1:t=e.v,n=t.data,x(n.sidebar),T(n.welcome);case 2:return e.a(2)}},e)}))()},[]),{collapsed:l,menuList:F,menuAll:D,onMenuSelection:function(t){if(t){var r=e.searchPathIndex(t.id);n(w.sidebarChoice({id:t.id,choices:r})),a({pathname:t.path})}},menuArea:f,setMenuAreaId:y,choiceId:d,menuTabList:R,onTabClosed:function(t){var r=t.props.id;n(w.removeTab({id:r}));var a=e.searchPathIndex(d);n(w.saveChoice({choices:a}))},onTabSelected:function(t){var r=e.searchPathIndex(t.id);n(w.sidebarChoice({id:t.id,choices:r})),a({pathname:t.path})}}}function Q(){var e={location:S.useLocation(),history:w.useAppSelector(function(e){return e.app.historyLocation}),isGuest:function(){return w.Admin.isGuest()},saveHistoryLocation:function(e){return w.App.saveHistoryLocation(e)}};return A.useAppRedirect(e)}function X(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=A.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:w.Admin.can,OrCan:w.Admin.orCan,Permissions:w.Admin.permissions}),o=w.useAppSelector(function(e){return e.user.version}),i=r(v.useState({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],u=i[1];return A.useLocalTable({value:c,setValue:u,config:e,checkaccess:l,dependency:a,version:o})}function Y(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=A.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:w.Admin.can,OrCan:w.Admin.orCan,Permissions:w.Admin.permissions}),o=w.useAppSelector(function(e){return e.user.version}),i=r(v.useState({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],u=i[1];return A.useTable({value:c,setValue:u,config:e,checkaccess:l,dependency:a,version:o})}var Z=function(e){var t=e.ctxState,n=e.ctx;return v.createElement(E.Pagination,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},J=function(e){return function(t){return function(n){var a=r(v.useState({}),2),l=a[0],o=a[1],i=r(v.useState({}),2),c=i[0],u=i[1],s=r(v.useState(0),2),d=s[0],m=s[1],f=k.useLocale().locale;return v.useEffect(function(){var t=x.getResourceBundle(f,"Page",e.name);document.title=y.get(t,"title",x.tt("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;u(t||{}),m(d+1)})},[f]),v.createElement(v.Fragment,null,v.createElement(t,p(p({},n),{},{pageConfig:l,fetchConfig:c,fetchVersion:d})))}}},ee=v.createContext({pageConfig:{},fetchConfig:{}}),te=function(e){var t=e.ctx,n=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=r(v.useState(),2),c=i[0],s=i[1],d=r(v.useState([]),2),m=d[0],f=d[1],p=v.useRef(null),h=r(v.useState([]),2),g=h[0],y=h[1],b=r(v.useState([]),2),C=b[0],w=b[1],S=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",T),A()},[]);var A=function(){var e=u(o().m(function e(){var t,r,a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,q.roles();case 1:return t=e.v,r=z(t.data||[]),a=[],e.n=2,q.permissions();case 2:l=e.v,i=V(l.data||[]),c=[],q.getPermissionsByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach(function(e){r.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),j(i,r,c),s(i),c.forEach(function(e){p.current.checkNode(e)})}}),q.getRolesByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var l=new Set;n&&n.forEach(function(e){l.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),j(r,l,a),y(r),a.forEach(function(e){S.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){q.assignItemToUser({id:n.id,roles:C,permissions:m}).then(function(e){200===e.code&&(k.$toast.success(x.tparam(a,"assign_success","assign permission successfully!")),l())})};return v.createElement(E.Layout,{style:{width:800,height:500}},v.createElement(E.LayoutPanel,{region:"west",style:{width:220}},v.createElement(E.Panel,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:g,ref:S,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),w(t)}}}))),v.createElement(E.LayoutPanel,{region:"center",style:{height:"100%"}},v.createElement(E.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(E.TextBox,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:c,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}}))),v.createElement(E.LayoutPanel,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:T}," ",x.tparam(a,"submit.text","Submit")," "),v.createElement(E.LinkButton,{style:{width:80},onClick:l}," ",x.tparam(a,"close.text","Close")," "))))},ne=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(ee),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(te,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},re=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=(e.refs,r(A.useFormData(n).toArray(),1)[0]),i=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",c)},[]);var c=function(){i.current.validate(function(e){if(null==e){var n={username:o.username,phone:o.phone,password:"123456"};$.register(n).then(function(e){200===e.code&&(k.$toast.success(x.tt("save success","Message")),t.refresh(),l())})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:i,model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"username",label:x.tfield(a,"username.label","Username")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"username.placeholder",""),value:o.username})),v.createElement(E.FormField,{name:"phone",label:x.tfield(a,"phone.label","Phone")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"phone.placeholder",""),value:o.phone})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},x.tparam(a,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==l?void 0:l()},iconCls:"icon-cancel"},x.tparam(a,"cancel.text","Cancel"))))},ae=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(ee),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,u=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(re,p(p({className:"f-full",ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:u})))},le=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={username:"",phone:"",status:"",type:""},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",labelWidth:"auto",model:i,labelPosition:"before"},v.createElement(E.FormField,{name:"username",label:x.tfield(n,"username.label","Username")},v.createElement(E.TextBox,{value:i.username})),v.createElement(E.FormField,{name:"phone",label:x.tfield(n,"phone.label","Phone")},v.createElement(E.TextBox,{value:i.phone})),v.createElement(E.FormField,{name:"status",label:x.tfield(n,"status.label","Status")},v.createElement(E.ComboBox,{data:W(a,"admin-state"),value:i.status})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"admin-type"),value:i.type})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:i.username,type:"LIKE",filter_empty:!0},{key:"phone",value:i.phone,type:"LIKE",filter_empty:!0},{key:"status",value:i.status,type:"EQ",filter_empty:!0},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(l),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},oe=k.withCheckGrid(E.DataGrid),ie=function(){var e=v.useContext(ee),t=e.pageConfig,n=e.fetchConfig,a=e.ctx,l=e.ctxState,o=e.refs,i=(e.version,r(v.useState(0),2)),c=i[0],u=i[1];return v.useEffect(function(){u(c+1)},[n]),v.createElement(v.Fragment,null,v.createElement(oe,{toolbar:function(){var e={record:{username:"",password:""},type:b.FormDataType.CREATE,ctx:a,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(le,{ctx:a,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:a,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add")))))},data:null==l?void 0:l.data,loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,idField:"id",selection:null==l?void 0:l.selectionValues,onSelectionChange:function(e){return null==a?void 0:a.tableSelectionChange(e)},ckWidth:20,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,r=e.originalValue,l=n.props.field;if(console.log(t,n,r),t[l]!==r){var o=null==a?void 0:a.name();G.edit(o,{conditions:[{key:"id",value:t.id}],editor:[{key:l,value:t[l],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?k.$toast.success(x.tt("save_success","Message")):k.$toast.error(n),null==a||a.refresh()})}},key:c},v.createElement(E.GridColumn,{field:"id",title:x.tfield(t,"id.label","UserId"),width:"50px"}),v.createElement(E.GridColumn,{field:"username",title:x.tfield(t,"username.label","Username"),width:"80px"}),v.createElement(E.GridColumn,{field:"phone",title:x.tfield(t,"phone.label","Phone"),width:"60px",editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.TextBox,{value:t.phone})}}),v.createElement(E.GridColumn,{field:"status",title:x.tfield(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return B(n,"admin-state",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.ComboBox,{data:W(n,"admin-state"),value:t.status+""})}}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return B(n,"admin-type",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.ComboBox,{data:W(n,"admin-type"),value:t.type+""})}}),v.createElement(E.GridColumn,{field:"version",title:x.tfield(t,"version.label","Version"),width:"60px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"75px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"75px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"100px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return b.FormDataType.UPDATE,"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.username),v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:a,point:"assign"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:a,record:n,title:"".concat(x.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),v.createElement(k.Access,{ctx:a,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==a?void 0:a.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"100px"})))))},ce="admin",ue=[{type:b.CheckAccessEleType.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(t(I(ce))),se=J({name:"Admin",fetchConfig:function(){return G.configs(ce)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:ce,fetch:function(e){return G.list(ce,e)},checkAccessItems:ue,defaultPageSize:30});r.ctx.registerEvent("remove",U(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),v.createElement(ee.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,assigndlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(ae,p({},a)),v.createElement(ne,p({},l)),v.createElement(ie,null)))}),de=v.createContext({pageConfig:{},fetchConfig:{}}),me=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={position:void 0,active:void 0,title:"",type:void 0},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"title",label:x.tfield(n,"title.label","Title")},v.createElement(E.TextBox,{value:i.title})),v.createElement(E.FormField,{name:"active",label:x.tfield(n,"active.label","Active")},v.createElement(E.ComboBox,{data:W(a,"switch-state"),value:i.active})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"setting-type"),value:i.type})),v.createElement(E.FormField,{name:"position",label:x.tfield(n,"position.label","Position")},v.createElement(E.ComboBox,{data:W(a,"setting-position"),value:i.position})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:i.position,type:"="},{key:"type",value:i.type,type:"="},{key:"active",value:i.active,type:"="},{key:"title",value:i.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},fe=function(e){var t=e.pageVersion,n=v.useContext(de),r=n.pageConfig,a=n.fetchConfig,l=n.ctx,o=n.ctxState,i=n.refs;return v.createElement(E.TreeGrid,{toolbar:function(){return function(e,t,n,r){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(me,{ctx:n,pageConfig:e,fetchConfig:t})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},x.tparam(e,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:n,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(r,"formdlg.open",{type:b.FormDataType.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:x.tparam(e,"add.text","Create Setting")})}},x.tparam(e,"add.text","Add")))))}(r,a,l,i)},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",treeField:"title",key:"tree-table-"+t},v.createElement(E.GridColumn,{field:"title",title:x.tfield(r,"title.label","Title"),width:"220px"}),v.createElement(E.GridColumn,{field:"icon",title:x.tfield(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return v.createElement("span",{className:"iconfont "+t})}}),v.createElement(E.GridColumn,{field:"active",title:x.tfield(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return B(a,"switch-state",t)}}),v.createElement(E.GridColumn,{field:"position",title:x.tfield(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return B(a,"setting-position",t)}}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(a,"setting-type",t)}}),v.createElement(E.GridColumn,{field:"router_name",title:x.tfield(r,"router_name.label","RouterName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(r,"url.label","URL"),align:"left",width:"300px"}),v.createElement(E.GridColumn,{field:"sort",title:x.tfield(r,"sort.label","Sort"),align:"left",width:"80px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(r,"create_time.label","CreateTime"),width:"180px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(r,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:l,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(i,"formdlg.open",{ctx:l,record:t,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:l,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==l?void 0:l.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},pe=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=e.refs,u=r(A.useFormMData(a).toArray(),2),s=u[0],d=u[1],m=v.useRef(null),f=v.useMemo(function(){var e;return new C.SelectionTree(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,function(e){return{id:e.id,text:e.title,children:[]}},{id:0,text:x.tparam(l,"none_parent","None Parent"),children:[]})},[t.config.data]);v.useEffect(function(){t.setMethod("submitForm",p),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;d({router_name:t.name,url:t.url}),y.invoke(c,"routerlistdlg.close")})},[]);var p=function(){m.current.validate(function(e){if(null==e){var r={object:{id:parseInt(s.id),title:s.title,router_name:s.router_name,icon:s.icon,active:parseInt(s.active),position:parseInt(s.position),type:parseInt(s.type),sort:parseInt(s.sort),pid:parseInt(s.pid),url:s.url},conditions:[]};n===b.FormDataType.UPDATE&&r.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),i()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:m,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"title",label:x.tfield(l,"title.label","Title")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"title.placeholder",""),value:s.title})),v.createElement(E.FormField,{name:"router_name",label:x.tfield(l,"router_name.label","Router Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"router_name.placeholder",""),value:s.router_name,addonRight:function(){var e={title:x.tparam(l,"router_title","Router List")};return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return y.invoke(c,"routerlistdlg.open",e)}}))}})),v.createElement(E.FormField,{name:"icon",label:x.tfield(l,"icon.label","Icon")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"icon.placeholder",""),value:s.icon})),v.createElement(E.FormField,{name:"active",label:x.tfield(l,"active.label","Status")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"switch-state"),name:"switch-state",value:s.active,onChange:function(e,t){d({active:e})}})),v.createElement(E.FormField,{name:"type",label:x.tfield(l,"type.label","Type")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"setting-type"),name:"setting-type",value:s.type,onChange:function(e,t){d({type:e})}})),v.createElement(E.FormField,{name:"position",label:x.tfield(l,"position.label","Position")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"setting-position"),name:"setting-position",value:s.position,onChange:function(e,t){d({position:e})}})),v.createElement(E.FormField,{name:"sort",label:x.tfield(l,"sort.label","Sort")+":"},v.createElement(E.NumberBox,{placeholder:x.tfield(l,"sort.placeholder",""),value:s.sort})),v.createElement(E.FormField,{name:"pid",label:x.tfield(l,"pid.label","Pid")+":"},v.createElement(E.ComboTree,{placeholder:x.tfield(l,"pid.placeholder",""),editable:!0,data:f,value:s.pid,onChange:function(e){return d({pid:e})}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:p},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:i},x.tparam(l,"close.text","Close"))))},he=v.createContext({pageConfig:{},fetchConfig:{}}),ge=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={name:"",type:""},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:i.name})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"router-type"),value:i.type})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},ve=function(e){var t=e.selectedRow,n=e.scene,a=v.useContext(he),l=a.pageConfig,o=a.fetchConfig,i=a.ctx,c=a.ctxState,u=a.refs,s=r(v.useState(0),2),d=s[0],m=s[1],f=function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(ge,{ctx:i,pageConfig:l,fetchConfig:o})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},x.tparam(l,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:i,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(u,"formDataRefDlg.open",{type:b.FormDataType.CREATE,ctx:i,record:{name:""},title:x.tparam(l,"add.text","Create Router")})}},x.tparam(l,"add.text","Add")))))},p=function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:i,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(u,"formDataRefDlg.open",{ctx:i,record:t,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(l,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:i,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==i?void 0:i.publish("remove",{conditions:[{key:"name",value:t.name},{key:"type",value:t.type}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))};return v.useEffect(function(){m(d+1)},[o]),"setting"===n?v.createElement(E.DataGrid,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},v.createElement(E.GridColumn,{field:"name",title:x.tfield(l,"name.label","Name"),render:D}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(l,"type.label","URL"),align:"center",render:D}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(o,"router-type",t)}}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"120px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:p,width:"120px"})))):v.createElement(E.DataGrid,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},v.createElement(E.GridColumn,{field:"name",title:x.tfield(l,"name.label","Name"),render:D}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(l,"url.label","URL"),align:"center",render:D}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(o,"router-type",t)}}),v.createElement(E.GridColumn,{field:"data",title:x.tfield(l,"data.label","Data")}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(l,"create_time.label","CreateTime"),width:"180px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(l,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"120px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:p,width:"120px"}))))},ye=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=(e.refs,r(A.useFormMData(a).toArray(),2)),u=c[0],s=c[1],d=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",m)},[]);var m=function(){d.current.validate(function(e){if(null==e){var r={object:{name:u.name,url:u.url,type:u.type,data:u.data},conditions:[]};n===b.FormDataType.UPDATE&&(r.conditions.push({key:"name",value:a.name}),r.conditions.push({key:"type",value:a.type})),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),i()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:d,model:u,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:u.name})),v.createElement(E.FormField,{name:"url",label:x.tfield(l,"url.label","Url")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"url.placeholder",""),value:u.url})),v.createElement(E.FormField,{name:"type",label:x.tfield(l,"type.label","Type")+":"},v.createElement(k.RadioGroupBox,{name:"router-type",value:u.type,options:W(o,"router-type"),onChange:function(e,t){s({type:e})}})),v.createElement(E.FormField,{name:"data",label:x.tfield(l,"data.label","Data")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"data.placeholder",""),value:u.data})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:m},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:i},x.tparam(l,"close.text","Close"))))},Ee=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(he),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ye,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},be="router",xe=[{type:b.CheckAccessEleType.AND,value:["/resource/router/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/router/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/router/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/router/edit"],key:"edit"}],Ce=J({name:"Router",fetchConfig:function(){return G.configs(be)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,a=e.scene,l=Y({name:be,fetch:function(e){return G.list(be,e)},checkAccessItems:xe,defaultPageSize:20});v.useEffect(function(){l.ctx.search()},[l.version]),l.ctx.registerEvent("remove",U(l.ctx));var o=k.useRefDialog();return v.createElement(he.Provider,{value:{ctx:l.ctx,ctxState:l.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:l.ctx,ctxState:l.ctxState})}},v.createElement(Ee,p({},o)),v.createElement(ve,{selectedRow:r,scene:a})))}),ke=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(de),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(pe,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},we=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(de).ctx);return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Ce,{selectedRow:function(e){var t,n=e.row,a=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:a})},scene:"setting"})))},Se="setting",Ae=[{type:b.CheckAccessEleType.AND,value:["/resource/setting/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/edit"],key:"edit"}],Te=J({name:"Setting",fetchConfig:function(){return G.configs(Se)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,a=X({name:Se,fetch:function(e){return G.list(Se,e)},checkAccessItems:Ae,defaultPageSize:10,isTreeData:!0});a.ctx.registerEvent("remove",U(a.ctx));var l=k.useRefDialog(),o=k.useRefDialog();return v.useEffect(function(){a.ctx.search()},[]),v.createElement(de.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:l,routerlistdlg:o}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(ke,p({},l)),v.createElement(we,p({},o)),v.createElement(fe,{pageVersion:r})))}),Fe=new(function(){return m(function e(){s(this,e)},[{key:"captcha",value:function(){return P().post(N("loginCaptcha"))}},{key:"login",value:(e=u(o().m(function e(t,n,r){var a,l,i;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post(N("loginSubmit"),t);case 1:a=e.v,l=a.code,i=a.data,200===l?n(i,l):r(i,l);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return P().post(N("loginConfig"))}}]);var e}()),De=function(e){var t=e.pageConfig,n=e.rules,a=w.useAppDispatch(),l=r(v.useState({username:"",captcha:"",password:"",code:"",token:""}),2),o=l[0],i=l[1],c=Q(),u=function(){Fe.captcha().then(function(e){var t=e.data;i(p(p({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return v.useEffect(function(){u(),c.autoRedirect()},[]),v.createElement(E.Form,{model:o,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},v.createElement(E.FormField,{name:"username"},v.createElement(E.TextBox,{iconCls:"iconfont "+y.get(t.fields,"username.icon","icon-username"),placeholder:y.get(t.fields,"username.placeholder","username..."),value:o.username})),v.createElement(E.FormField,{name:"password"},v.createElement(E.PasswordBox,{iconCls:"iconfont "+y.get(t.fields,"password.icon","icon-password"),placeholder:y.get(t.fields,"password.placeholder","password..."),value:o.password})),v.createElement(E.FormField,{name:"code"},v.createElement(E.TextBox,{iconCls:"iconfont "+y.get(t.fields,"code.icon","icon-captcha"),placeholder:y.get(t.fields,"code.placeholder","verification code..."),value:o.code,addonRight:function(){return v.createElement("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:u})}})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Fe.login(e,function(e){a(w.login({token:e.token,info:e.user,error:function(){k.$toast.error(y.get(t.params,"tips.loginError"))}})),c.autoRedirect()},function(){u()})},btnCls:"login_btn"},y.get(t.params,"submit.text","Sign In"))))},Re=function(){var e=k.useLocale(!0),t=e.localeOptions,n=e.changeLocale;return v.createElement(E.MenuButton,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return v.createElement(E.Menu,null,Object.keys(t).map(function(e,n){return v.createElement(E.MenuItem,{text:t[e],key:n,value:e})}))},onMenuItemClick:n})},Be=J({name:"Login",fetchConfig:Fe.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,a=e.rules;return v.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},v.createElement(Re,null),v.createElement("div",{className:"login layui-anim layui-anim-up"},v.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),v.createElement(De,{pageConfig:n,fetchConfig:r,rules:a})))}),Pe=v.createContext({pageConfig:{},fetchConfig:{}}),Le=function(e){var n=e.ctx,a=(e.type,e.record),l=e.pageConfig,i=(e.fetchConfig,e.close),c=r(v.useState(),2),s=c[0],d=c[1],m=r(v.useState([]),2),f=m[0],p=m[1],h=v.useRef(null),g=r(v.useState([]),2),y=g[0],b=g[1],C=r(v.useState([]),2),w=C[0],S=C[1],A=v.useRef(null);v.useEffect(function(){null==n||n.setMethod("onSubmit",F),T()},[]);var T=function(){var e=u(o().m(function e(){var t,n,r,l,i,c,u,s,m,p;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,q.roles();case 1:return t=e.v,n=z(t.data||[]),r=[],e.n=2,q.permissions();case 2:return l=e.v,i=V(l.data||[]),c=[],e.n=3,q.getChildren({name:a.name});case 3:u=e.v,s=u.code,m=u.data,200===s&&(p=new Set,m&&m.forEach(function(e){p.add(e.name),1==e.item_type?w.push(e.name):f.push(e.name)}),j(i,p,c),d(i),c.forEach(function(e){h.current.checkNode(e)}),j(n,p,r),b(n),r.forEach(function(e){A.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){q.addPermissionChildren({name:a.name,children:[].concat(t(f),t(w))}).then(function(e){200===e.code&&(k.$toast.success(x.tparam(l,"assign_success","assign permission successfully!")),i())})};return v.createElement(E.Layout,{style:{width:800,height:500}},v.createElement(E.LayoutPanel,{region:"west",style:{width:220}},v.createElement(E.Panel,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:y,ref:A,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),S(t)}}}))),v.createElement(E.LayoutPanel,{region:"center",style:{height:"100%"}},v.createElement(E.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(E.TextBox,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:s,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),p(t)}}}))),v.createElement(E.LayoutPanel,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:F}," ",x.tparam(l,"submit.text","Submit")," "),v.createElement(E.LinkButton,{style:{width:80},onClick:i}," ",x.tparam(l,"close.text","Close")," "))))},Ne=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Pe),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Le,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},_e=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(n,"description.label","Description")},v.createElement(E.TextBox,{value:o.description})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},Ge=k.withCheckGrid(E.DataGrid),Ie=function(){var e=v.useContext(Pe),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(Ge,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(_e,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){y.invoke(l,"formdlg.open",{type:b.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:x.tparam(t,"add.text","Create Role")})}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"batch-delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?k.$toast.error(x.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:q.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},x.tparam(t,"batch_remove.text","Batch Remove")))))},data:(null==a?void 0:a.data)||[],loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:o},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"220px"}),v.createElement(E.GridColumn,{field:"rule_name",title:x.tfield(t,"rule_name.label","RuleName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"description",title:x.tfield(t,"description.label","Description"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:R}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"100px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"assign-permission"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(x.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:r,record:n,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:q.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Me=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(A.useFormData(a).toArray(),2),c=i[0],u=(i[1],r(A.useFormData(a).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){t.setMethod("onSubmit",d)},[]);var d=function(){s.current.validate(function(e){null==e?(n===b.FormDataType.CREATE&&q.addRole(c).then(function(e){var n=e.code;e.data;200==n&&(k.$toast.success(x.tt("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===b.FormDataType.UPDATE&&q.updateRole({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(k.$toast.success(x.tt("update_role_success","Message","update role successfully!")),t.refresh(),o())})):k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(l,"description.label","Description")+":"},v.createElement(E.TextBox,{multiline:!0,placeholder:x.tfield(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:d},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o},x.tparam(l,"close.text","Close"))))},Ue=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Pe),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Me,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},Oe=[{type:b.CheckAccessEleType.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:b.CheckAccessEleType.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:b.CheckAccessEleType.AND,value:["/rbac/add-role"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/rbac/update-role"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/rbac/delete-role"],key:"delete"}],Ve=J({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:"roles",fetch:function(e){return q.roles()},checkAccessItems:Oe,defaultPageSize:30,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",M(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.createElement(Pe.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,assigndlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(Ue,p({},a)),v.createElement(Ne,p({},l)),v.createElement(Ie,null)))}),je=v.createContext({pageConfig:{},fetchConfig:{}}),ze=function(e){var t=e.ctx,n=(e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=r(A.useFormData(n).toArray(),1)[0];v.useEffect(function(){null==t||t.setMethod("onSubmit",i)},[]);var i=function(){var e={resource:o.resource,name:o.name};q.fastAddPermission(e).then(function(e){200===e.code&&(k.$toast.success(x.tt("save_success","Message","Save Success!")),t.refresh(),l())})};return v.createElement(E.Form,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"resource",label:x.tfield(a,"fast_add_resource.label","Resource")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"fast_add_resource.placeholder",""),value:o.resource})),v.createElement(E.FormField,{name:"name",label:x.tfield(a,"fast_add_name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"fast_add_name.placeholder",""),value:o.name})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:i},x.tparam(a,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:l},x.tparam(a,"close.text","Close"))))},We=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(je),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ze,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},qe=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(v.useState(a),2),c=i[0],u=(i[1],r(A.useFormData(a).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){s.current.validate(function(e){null==e?(n===b.FormDataType.CREATE&&q.addPermission(c).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===b.FormDataType.UPDATE&&q.updatePermission({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(l,"description.label","Description")+":"},v.createElement(E.TextBox,{multiline:!0,placeholder:x.tfield(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:d},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o},x.tparam(l,"close.text","Close"))))},$e=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(je),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},v.createElement(qe,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},He=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(n,"description.label","Description")},v.createElement(E.TextBox,{value:o.description})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},Ke=k.withCheckGrid(E.DataGrid),Qe=function(){var e=v.useContext(je),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(Ke,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(He,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){y.invoke(l,"formdlg.open",{type:b.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:x.tparam(t,"add.text","Create Role")})}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"batch-delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?k.$toast.error(x.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:q.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},x.tparam(t,"batch_remove.text","Batch Remove"))),v.createElement(k.Access,{ctx:r,point:"fast-add-permission"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){y.invoke(l,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:x.tparam(t,"fast_add.text","Fast Add")})}},x.tparam(t,"fast_add.text","Fast Add")))))},data:(null==a?void 0:a.data)||[],idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,lazy:!0,key:o},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"220px"}),v.createElement(E.GridColumn,{field:"rule_name",title:x.tfield(t,"rule_name.label","RuleName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"description",title:x.tfield(t,"description.label","Description"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:r,record:n,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:q.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Xe=[{type:b.CheckAccessEleType.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:b.CheckAccessEleType.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:b.CheckAccessEleType.AND,value:["/rbac/add-permission"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/rbac/update-permission"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/rbac/delete-permission"],key:"delete"}],Ye=J({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=X({name:"permissions",fetch:function(e){return q.permissions()},checkAccessItems:Xe,defaultPageSize:50,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]);var a=k.useRefDialog(),l=k.useRefDialog();return r.ctx.registerEvent("remove",M(r.ctx)),v.createElement(je.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,fastadddlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement($e,p({},a)),v.createElement(We,p({},l)),v.createElement(Qe,null)))}),Ze=v.createContext({pageConfig:{},fetchConfig:{}}),Je=v.createContext({pageConfig:{},fetchConfig:{}}),et=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{label:"",value:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"label",label:x.tfield(n,"label.label","Label")},v.createElement(E.TextBox,{value:o.label})),v.createElement(E.FormField,{name:"value",label:x.tfield(n,"value.label","Value")},v.createElement(E.TextBox,{value:o.value})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:o.label,type:"LIKE",filter_empty:!0},{key:"value",value:o.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},tt=function(){var e=v.useContext(Je),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(E.DataGrid,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:b.FormDataType.CREATE,ctx:r,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(et,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(l,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style},v.createElement(E.GridColumn,{field:"label",title:x.tfield(t,"label.label","Label"),width:"160px"}),v.createElement(E.GridColumn,{field:"value",title:x.tfield(t,"value.label","Value"),align:"center",width:"180px"}),v.createElement(E.GridColumn,{field:"data",title:x.tfield(t,"data.label","Data"),align:"center",width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}],data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},nt=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(A.useFormData(a).toArray(),1)[0],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",function(e){return s(e)})},[]);var s=function(e){u.current.validate(function(r){if(null==r){var l={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===b.FormDataType.UPDATE&&l.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,l,function(){k.$toast.success(x.tt("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else k.$toast.error(O(r))})};return v.createElement(E.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"label",label:x.tfield(l,"label.label","Label")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"label.placeholder",""),value:c.label})),v.createElement(E.FormField,{name:"value",label:x.tfield(l,"value.label","Value")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"value.placeholder",""),value:c.value})),v.createElement(E.FormField,{name:"data",label:x.tfield(l,"data.label","Data")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"data.placeholder",""),value:c.data,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},rt=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Je),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(nt,p(p({ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c}))),v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},x.tparam(o,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},x.tparam(o,"cancel.text","Cancel"))))},at="dict-item",lt=I(at),ot=J({name:"DictItem",fetchConfig:function(){return G.configs(at)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,a=Y({name:at,fetch:function(e){return G.list(at,e)},checkAccessItems:lt,fixedConditions:[{key:"sign",value:r}]},r);a.ctx.registerEvent("remove",U(a.ctx));var l=k.useRefDialog({sign:r});return v.useEffect(function(){a.ctx.search()},[]),v.createElement(Je.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(rt,p({},l)),v.createElement(tt,null)))}),it=function(e){var t=e.ctx,n=(e.ctxState,e.type),a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(A.useFormData(a).toArray(),1)[0],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){u.current.validate(function(e){if(null==e){var r={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===b.FormDataType.UPDATE&&r.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),o()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"sign",label:x.tfield(l,"sign.label","Sign")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"sign.placeholder",""),disabled:n===b.FormDataType.UPDATE,value:c.sign})),v.createElement(E.FormField,{name:"remark",label:x.tfield(l,"remark.label","Remark")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"remark.placeholder",""),value:c.remark,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},ct=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(Ze));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(ot,p({},n))))},ut=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Ze),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,u=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(it,p(p({ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:u}))),v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},x.tparam(i,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},x.tparam(i,"cancel.text","Cancel"))))},st=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",sign:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"sign",label:x.tfield(n,"sign.label","Sign")},v.createElement(E.TextBox,{value:o.sign})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE",filter_empty:!0},{key:"sign",value:o.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(a),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},dt=k.withCheckGrid(E.DataGrid),mt=function(){var e=v.useContext(Ze),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(dt,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:b.FormDataType.CREATE,ctx:r,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(st,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(l,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&e.length>0?null==r||r.publish("batchRemove",{conditions:[{key:"id",value:r.tableSlectionValue(),type:"IN"}]}):k.$toast.error(x.tt("checkbox_no_empty","Message"))}},x.tparam(t,"batch_remove.text","Batch Remove")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"160px"}),v.createElement(E.GridColumn,{field:"sign",title:x.tfield(t,"sign.label","Sign"),width:"150px"}),v.createElement(E.GridColumn,{field:"remark",title:x.tfield(t,"remark.label","Remark"),width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"120px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"120px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"150px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),o={sign:n.sign,title:x.tparam(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"items"},v.createElement(E.Tooltip,{content:x.tparam(t,"item_list.text","Dict Item"),position:"top"},v.createElement(E.LinkButton,{onClick:function(){return y.invoke(l,"dictItemDataRefDlg.open",o)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},ft="dict",pt=[{type:b.CheckAccessEleType.AND,value:["/resource/dict-item/list"],key:"items"}].concat(t(I(ft))),ht=J({name:"Dict",fetchConfig:function(){return G.configs(ft)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:ft,fetch:function(e){return G.list(ft,e)},checkAccessItems:pt});r.ctx.registerEvent("remove",U(r.ctx)),r.ctx.registerEvent("batchRemove",U(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),v.createElement(Ze.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,dictItemDataRefDlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(ut,p({},a)),v.createElement(ct,p({},l)),v.createElement(mt,null)))}),gt=function(e){var t=r(v.useState([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),2);t[0],t[1];return v.createElement("h2",null,"developing......")},vt=v.createContext({}),yt=function(){var e=k.useTheme(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,w.useAppSelector(function(e){return e.app.theme})),a=v.useRef(null);return v.useEffect(function(){},[]),v.createElement(v.Fragment,null,v.createElement(k.DrawerPanel,{width:"300px",placement:"right",ref:a},v.createElement(E.Panel,{style:{width:"300px",height:"100%"},title:x.tt("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map(function(e,n){return v.createElement("div",{key:n},v.createElement(E.RadioButton,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),v.createElement(E.Label,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},x.tt("themes."+e.key,"Setting",e.name)))}))),v.createElement(E.LinkButton,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){a.current.toggle()}}))},Et=function(){var e=w.useAppSelector(function(e){return e.user.info}),t=S.useNavigate();return v.createElement(E.MenuButton,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return v.createElement(E.Menu,{noline:!0},v.createElement(E.MenuItem,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=x.tt("confirm_logout","Message");k.$confirm("",n,function(){w.Admin.logout(function(){t("/login")})})}}})},bt=new C.TabMenuService(0,function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}}),xt={border:!1,plain:!0,scrollable:!0,narrow:!1},Ct={border:!1,animate:!0,multiple:!0,showCollapsedText:!1};exports.AdminView=se,exports.AppLayoutContext=vt,exports.BaseLayout=function(e){S.useNavigate(),w.useAppSelector(function(e){return e.user.info});var t={dispatch:w.useAppDispatch(),useAppSelector:w.useAppSelector},n=K(bt),r=n.collapsed,a=n.menuList,l=n.choiceId,o=n.onMenuSelection,i=n.menuArea,c=n.setMenuAreaId,u=n.menuTabList,s=n.onTabClosed,d=n.onTabSelected;return v.createElement(vt.Provider,{value:t},v.createElement(k.FullBodyLayout,p({menus:a,title:x.tt("title","App","Admin"),collapsed:r,sidebarCfg:p(p({},Ct),{},{onItemClick:o}),selection:E.treeHelper.findNode(a,"id",l),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,w.setSidebarCollapsed(e))},slots:{barLeft:v.createElement(function(){return v.createElement(v.Fragment,null,!r&&(null==i?void 0:i.map(function(e,t){return v.createElement(E.LinkButton,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return c(e.id)}},e.text)})))},null),barRight:v.createElement(function(){return v.createElement(v.Fragment,null,v.createElement(Et,null),v.createElement(Re,null),v.createElement(yt,null))},null),footer:v.createElement(function(){return v.createElement(v.Fragment,null,e.footer)},null)},onSideMenuSelection:function(){}},e),v.createElement(function(){return v.createElement(k.TabsPanel,{onTabSelect:d,tabsCfg:xt,onTabClosed:s,data:u})},null),v.createElement("div",{className:"admin-tabs-panel-body"},v.createElement(S.Outlet,null))))},exports.DictView=ht,exports.HomeView=function(){return v.createElement("h1",null,"Home!!!!!!!")},exports.Lazy=function(e){return v.createElement(v.Suspense,{fallback:v.createElement(v.Fragment,null,"...")},e)},exports.LocaleBarItem=Re,exports.LoginView=Be,exports.NotFoundView=function(){return v.createElement("h1",null,"404!!!!!!!")},exports.PaginationPanel=Z,exports.PermissionsView=Ye,exports.RolesView=Ve,exports.RouterView=Ce,exports.ScreenDesign=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return v.useRef(null),v.createElement(k.DefaultPanel,{mode:"cover"},v.createElement(E.Layout,{style:{width:"100%",height:"100%"}},v.createElement(E.LayoutPanel,{region:"north",style:{height:50}},"North Region"),v.createElement(E.LayoutPanel,{region:"south",style:{height:50}},"South Region"),v.createElement(E.LayoutPanel,{region:"west",style:{width:240}},v.createElement("div",{style:{}},"West Region")),v.createElement(E.LayoutPanel,{region:"east",style:{width:240}},v.createElement("div",{style:{}},"East Region")),v.createElement(E.LayoutPanel,{region:"center",style:{width:"100%",height:"100%"}},v.createElement(gt,null))))},exports.SettingBarItem=yt,exports.SettingView=Te,exports.Tooltip=function(e){var t=e.text,n=e.position,a=void 0===n?"top":n,l=e.maxWidth,o=void 0===l?400:l,i=function(){var e=v.useRef(null),t=r(v.useState(!1),2),n=t[0],a=t[1];return v.useEffect(function(){var t=e.current;if(t){var n=function(){a(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),c=r(i,2),u=c[0],s=c[1],d=r(v.useState(!1),2),m=d[0],f=d[1],p=r(v.useState({top:0,left:0,width:0,height:0}),2),h=p[0],g=p[1],y=v.createElement("div",{ref:u,className:"easyui-cell",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:function(){if(u.current){var e=u.current.getBoundingClientRect();g({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}),f(!0)}},onMouseLeave:function(){return f(!1)}},t);return s?v.createElement(v.Fragment,null,y,m&&T.createPortal(v.createElement("div",{className:"easyui-tooltip-content easyui-tooltip-".concat(a),style:{maxWidth:o,position:"absolute",zIndex:9999,top:"top"===a?h.top-6:h.top+h.height+6,left:h.left,pointerEvents:"none"}},v.createElement("pre",{style:{whiteSpace:"pre-wrap",margin:0}},t)),document.body)):y},exports.adminService=$,exports.configService=H,exports.convertToText=O,exports.ctxPageValue=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},exports.ctxPageValueOptions=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},exports.fetchConfigOptions=W,exports.install=function(e){var t,n,r;n=e.request,F||(F=n),r=null!==(t=e.apis)&&void 0!==t?t:{},L=p(p({},L),r)},exports.permissionTree=V,exports.queryPermissionTress=j,exports.rbacService=q,exports.removeEventFn=M,exports.renderDateTime02=R,exports.renderFetchConfigValue=B,exports.renderText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?v.createElement("span",{className:"iconfont "+t},e):v.createElement("span",null,e)},exports.renderTooltip=D,exports.renderType=function(){return v.createElement("div",null,"Type")},exports.resourceAccessItems=I,exports.resourceRemoveEvent=U,exports.resourceService=G,exports.roleTree=z,exports.useAppRedirect=Q,exports.useAppStarter=function(){var e=k.useLocale().locale,t=r(v.useState(),2),n=t[0],a=t[1],l=Q();return v.useEffect(function(){x.setLanguage(e,function(){a(x.getActivePkg())}),l.autoRedirect()},[]),v.useEffect(function(){a(x.getActivePkg())},[e]),{easyuiLangPkg:n}},exports.useLocalTable=X,exports.useMenuAndTabData=K,exports.useTable=Y,exports.withDocHoc=J;
|
|
1
|
+
"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){u=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return i}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,a,l){var o=r&&r.prototype instanceof u?r:u,s=Object.create(o.prototype);return i(s,"_invoke",function(n,r,a){var l,o,i,u=0,s=a||[],d=!1,m={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,o=0,i=e,m.n=n,c}};function f(n,r){for(o=n,i=r,t=0;!d&&u&&!a&&t<s.length;t++){var a,l=s[t],f=m.p,p=l[2];n>3?(a=p===r)&&(i=l[(o=l[4])?5:(o=3,3)],l[4]=l[5]=e):l[0]<=f&&((a=n<2&&f<l[1])?(o=0,m.v=r,m.n=l[1]):f<p&&(a=n<3||l[0]>r||r>p)&&(l[4]=n,l[5]=r,m.n=p,o=0))}if(a||n>1)return c;throw d=!0,r}return function(a,s,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===s&&f(s,p),o=s,i=p;(t=o<2?e:i)||!d;){l||(o?o<3?(o>1&&(m.n=-1),f(o,i)):m.n=i:m.v=i);try{if(u=2,l){if(o||(a="next"),t=l[a]){if(!(t=t.call(l,i)))throw TypeError("iterator result is not an object");if(!t.done)return t;i=t.value,o<2&&(o=0)}else 1===o&&(t=l.return)&&t.call(l),o<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),o=1);l=e}else if((t=(d=m.n<0)?i:n.call(r,m))!==c)break}catch(t){l=e,o=1,i=t}finally{u=1}}return{value:t,done:d}}}(n,a,l),!0),s}var c={};function u(){}function s(){}function d(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),f=d.prototype=u.prototype=Object.create(m);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=d,i(f,"constructor",d),i(d,"constructor",s),s.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:l,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function l(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},i(e,t,n,r)}function c(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function o(e){c(l,r,a,o,i,"next",e)}function i(e){c(l,r,a,o,i,"throw",e)}o(void 0)})}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function m(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}var v=require("react"),y=require("lodash-es"),E=require("rc-easyui"),b=require("@kordar-lib/base"),x=require("@kordar-lib/i18n"),C=require("@kordar-lib/menus"),k=require("@kordar/easyui"),w=require("@kordar-lib/reducers"),S=require("react-router-dom"),A=require("@kordar-components/react"),T=require("react-dom");var F,D=function(e){var t=e.value;return t?v.createElement(E.Tooltip,{content:t,position:"top"},v.createElement("div",{className:"yp-text-ellipsis"},t)):""},R=function(e){return e.value.replace("T"," ").replace("Z","")},B=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",a=y.get(e,t,[]);for(var l in a){var o=a[l];if(o.value==n)return o.label}return r};function P(){return F}new C.MenuService;var L={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function N(e){return L[e]}var _=function(){return m(function e(){s(this,e)},[{key:"result",value:function(e,t,n,r,a,l){200===e&&a&&a(n,r)}},{key:"buildQueryString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).filter(function(t){return void 0!==e[t]&&null!==e[t]&&""!==e[t]}).map(function(t){var n=e[t];return Array.isArray(n)?n.map(function(e){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))}).join("&"):"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(n))}).join("&")}},{key:"listWithQuery",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.buildQueryString(t),a=r?"resource/".concat(e,"/list?").concat(r):"resource/".concat(e,"/list");return P().post(a,n)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(a=u(o().m(function e(t){var n,r,a,l,i,c,u,s=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,e.n=1,P().post("resource/".concat(t,"/list"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,u=a.count,this.result(l,i,c,u,r);case 2:return e.a(2)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=u(o().m(function e(t){var n,r,a,l,i,c,u=arguments;return o().w(function(e){for(;;)switch(e.n){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.n=1,P().post("resource/".concat(t,"/configs"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return P().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=u(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post("resource/".concat(t,"/edit"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return P().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return P().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=u(o().m(function e(t,n,r,a){var l,i,c,u,s,d,m,f;return o().w(function(e){for(;;)switch(e.n){case 0:if(n!==b.FormDataType.CREATE){e.n=2;break}return e.n=1,this.add(t,r);case 1:l=e.v,i=l.code,c=l.message,u=l.data,this.result(i,c,u,0,a),e.n=4;break;case 2:if(n!==b.FormDataType.UPDATE){e.n=4;break}return e.n=3,this.update(t,r);case 3:s=e.v,d=s.code,m=s.message,f=s.data,this.result(d,m,f,0,a);case 4:return e.a(2)}},e,this)})),function(e,n,r,a){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return P().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=u(o().m(function e(t,n,r){var a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post("resource/".concat(t,"/delete"),n);case 1:a=e.v,l=a.code,i=a.message,c=a.data,this.result(l,i,c,0,r);case 2:return e.a(2)}},e,this)})),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return P().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return P().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then(function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),a=document.createElement("a");a.setAttribute("download",n+".xlsx"),a.href=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)})}}]);var e,t,n,r,a}(),G=new _,I=function(e){return[{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},M=function(e,t){return function(n){var r=n.fn,a=n.params,l=n.success,o=n.error;k.$confirm(x.tt("confirm_del_title","Message"),null!=t?t:x.tt("confirm_del_msg","Message"),function(){r(a).then(function(t){var n=t.code;t.message,t.data;200===n?(l&&l(),e.refresh(),k.$toast.success(x.tt("del_success","Message"))):o&&o()})})}},U=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){k.$confirm(x.tt("confirm_del_title","Message"),null!=t?t:x.tt("confirm_del_msg","Message"),function(){G.delResult(e.name(),n,function(){e.refresh(),k.$toast.success(x.tt("del_success","Message"))}).then()})}};function O(e){return Object.entries(e).map(function(e){var t=r(e,2),n=t[0],a=t[1];return"".concat(a[0],"(").concat(n,")")}).join(",")}function j(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o,i=t.value,c="",u=i.name,s=y.trim(u,"/").split("/");s.length<=2?c=s[0]:s.length>2&&(c=s[0]+"/"+s[1]);var d=a.get(c);null==d&&(d=[]);var m=null!==(o=i.description)&&void 0!==o?o:"";d.push({id:u,text:m+"["+u+"]"}),a.set(c,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}function V(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var a=V(e.children,t,n);a>0&&(a===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function z(e){var t,r=[],a=new Map,l=n(e);try{for(l.s();!(t=l.n()).done;){var o=t.value,i="",c=o.description,u=void 0,s=y.trim(c,":").split(":");s.length<=2?i=s[0]:s.length>2&&(i=s[0]+":"+s[1]),s.length>=2&&(u=s[1]);var d=a.get(i);null==d&&(d=[]);var m=o.name;d.push({id:m,text:null!=u?u:m}),a.set(i,d)}}catch(e){l.e(e)}finally{l.f()}return a.forEach(function(e,t){r.push({text:t,children:e})}),r}var W=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach(function(e){return n.push({value:e.value,text:e.label})}):Object.keys(r).forEach(function(e,t){return n.push({value:e,text:r[e]})}),n},q=new(function(){return m(function e(){s(this,e)},[{key:"roles",value:function(){return P().post(N("rbacRoles"))}},{key:"addRole",value:function(e){return P().post(N("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return P().post(N("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return P().post(N("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return P().post(N("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return P().post(N("rbacPermissions"))}},{key:"addPermission",value:function(e){return P().post(N("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return P().post(N("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return P().post(N("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return P().post(N("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return P().post(N("rbacRules"))}},{key:"addRule",value:function(e){return P().post(N("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return P().post(N("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return P().get(N("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return P().post(N("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return P().get(N("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return P().post(N("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return P().post(N("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return P().get(N("rbacGetPermissionsByUser"),{id:e})}}])}()),$=new(function(){return m(function e(){s(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return P().post(N("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return P().post(N("adminResetPassword"),e)}},{key:"menus",value:function(){return P().post(N("menus"),{})}},{key:"info",value:function(e){return P().post(N("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),H=new(function(){return m(function e(){s(this,e)},[{key:"initialize",value:function(){return P().post(N("initialize"))}},{key:"getLugData",value:function(e){return P().post(N("langData"),{locale:e})}}])}());function K(e){var t,n=w.useAppDispatch(),a=S.useNavigate(),l=null===(t=w.useAppSelector)||void 0===t?void 0:t.call(w,function(e){return e.app.sidebarCollapsed}),i=w.useAppSelector(function(e){return e.layout}),c=i.tabs,s=i.choices,d=i.choiceId,m=r(v.useState(),2),f=m[0],p=m[1],h=r(v.useState(),2),g=h[0],y=h[1],E=r(v.useState([]),2),b=E[0],x=E[1],C=r(v.useState([]),2),A=C[0],T=C[1],F=v.useMemo(function(){var t;return e.init(k.setSideMenuState(b,s)),p(e.tabs),l?e.menus():[{id:0,text:"",state:"open",children:e.menusById(g||s[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[b,l,g]),D=v.useMemo(function(){return e.init(k.setSideMenuState(b,s)),e.menus()},[b,l]),R=v.useMemo(function(){for(var t=[],n=0;n<A.length;n++){var r=A[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==d,type:2})}for(var a=0;a<c.length;a++){var l=e.getItemById(c[a]);l&&t.push({id:l.id,path:l.path,closable:!0,title:l.text,selected:l.id==d,type:1})}return t},[b,c,d]);return v.useLayoutEffect(function(){u(o().m(function e(){var t,n,r,a,l;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$.menus();case 1:return t=e.v,n=t.data,x(n.sidebar),T(n.welcome),r=w.Admin.info(),a=r.id,e.n=2,q.getPermissionsByUser(a);case 2:l=e.v,w.Admin.loadPermissions(l.data);case 3:return e.a(2)}},e)}))()},[]),{collapsed:l,menuList:F,menuAll:D,onMenuSelection:function(t){if(t){var r=e.searchPathIndex(t.id);n(w.sidebarChoice({id:t.id,choices:r})),a({pathname:t.path})}},menuArea:f,setMenuAreaId:y,choiceId:d,menuTabList:R,onTabClosed:function(t){var r=t.props.id;n(w.removeTab({id:r}));var a=e.searchPathIndex(d);n(w.saveChoice({choices:a}))},onTabSelected:function(t){var r=e.searchPathIndex(t.id);n(w.sidebarChoice({id:t.id,choices:r})),a({pathname:t.path})}}}function Q(){var e={location:S.useLocation(),history:w.useAppSelector(function(e){return e.app.historyLocation}),isGuest:function(){return w.Admin.isGuest()},saveHistoryLocation:function(e){return w.App.saveHistoryLocation(e)}};return A.useAppRedirect(e)}function X(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=A.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:w.Admin.can,OrCan:w.Admin.orCan,Permissions:w.Admin.permissions}),o=w.useAppSelector(function(e){return e.user.version}),i=r(v.useState({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],u=i[1];return A.useLocalTable({value:c,setValue:u,config:e,checkaccess:l,dependency:a,version:o})}function Y(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=A.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:w.Admin.can,OrCan:w.Admin.orCan,Permissions:w.Admin.permissions}),o=w.useAppSelector(function(e){return e.user.version}),i=r(v.useState({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],u=i[1];return A.useTable({value:c,setValue:u,config:e,checkaccess:l,dependency:a,version:o})}var Z=function(e){var t=e.ctxState,n=e.ctx;return v.createElement(E.Pagination,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},J=function(e){return function(t){return function(n){var a=r(v.useState({}),2),l=a[0],o=a[1],i=r(v.useState({}),2),c=i[0],u=i[1],s=r(v.useState(0),2),d=s[0],m=s[1],f=k.useLocale().locale;return v.useEffect(function(){var t=x.getResourceBundle(f,"Page",e.name);document.title=y.get(t,"title",x.tt("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;u(t||{}),m(d+1)})},[f]),v.createElement(v.Fragment,null,v.createElement(t,p(p({},n),{},{pageConfig:l,fetchConfig:c,fetchVersion:d})))}}},ee=v.createContext({pageConfig:{},fetchConfig:{}}),te=function(e){var t=e.ctx,n=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=r(v.useState(),2),c=i[0],s=i[1],d=r(v.useState([]),2),m=d[0],f=d[1],p=v.useRef(null),h=r(v.useState([]),2),g=h[0],y=h[1],b=r(v.useState([]),2),C=b[0],w=b[1],S=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",T),A()},[]);var A=function(){var e=u(o().m(function e(){var t,r,a,l,i,c;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,q.roles();case 1:return t=e.v,r=z(t.data||[]),a=[],e.n=2,q.permissions();case 2:l=e.v,i=j(l.data||[]),c=[],q.getPermissionsByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach(function(e){r.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),V(i,r,c),s(i),c.forEach(function(e){p.current.checkNode(e)})}}),q.getRolesByUser(n.id).then(function(e){var t=e.code,n=e.data;if(200===t){var l=new Set;n&&n.forEach(function(e){l.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)}),V(r,l,a),y(r),a.forEach(function(e){S.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){q.assignItemToUser({id:n.id,roles:C,permissions:m}).then(function(e){200===e.code&&(k.$toast.success(x.tparam(a,"assign_success","assign permission successfully!")),l())})};return v.createElement(E.Layout,{style:{width:800,height:500}},v.createElement(E.LayoutPanel,{region:"west",style:{width:220}},v.createElement(E.Panel,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:g,ref:S,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),w(t)}}}))),v.createElement(E.LayoutPanel,{region:"center",style:{height:"100%"}},v.createElement(E.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(E.TextBox,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:c,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}}))),v.createElement(E.LayoutPanel,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:T}," ",x.tparam(a,"submit.text","Submit")," "),v.createElement(E.LinkButton,{style:{width:80},onClick:l}," ",x.tparam(a,"close.text","Close")," "))))},ne=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(ee),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(te,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},re=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=(e.refs,r(A.useFormData(n).toArray(),1)[0]),i=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",c)},[]);var c=function(){i.current.validate(function(e){if(null==e){var n={username:o.username,phone:o.phone,password:"123456"};$.register(n).then(function(e){200===e.code&&(k.$toast.success(x.tt("save success","Message")),t.refresh(),l())})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:i,model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"username",label:x.tfield(a,"username.label","Username")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"username.placeholder",""),value:o.username})),v.createElement(E.FormField,{name:"phone",label:x.tfield(a,"phone.label","Phone")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"phone.placeholder",""),value:o.phone})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},x.tparam(a,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==l?void 0:l()},iconCls:"icon-cancel"},x.tparam(a,"cancel.text","Cancel"))))},ae=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(ee),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,u=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(re,p(p({className:"f-full",ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:u})))},le=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={username:"",phone:"",status:"",type:""},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",labelWidth:"auto",model:i,labelPosition:"before"},v.createElement(E.FormField,{name:"username",label:x.tfield(n,"username.label","Username")},v.createElement(E.TextBox,{value:i.username})),v.createElement(E.FormField,{name:"phone",label:x.tfield(n,"phone.label","Phone")},v.createElement(E.TextBox,{value:i.phone})),v.createElement(E.FormField,{name:"status",label:x.tfield(n,"status.label","Status")},v.createElement(E.ComboBox,{data:W(a,"admin-state"),value:i.status})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"admin-type"),value:i.type})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:i.username,type:"LIKE",filter_empty:!0},{key:"phone",value:i.phone,type:"LIKE",filter_empty:!0},{key:"status",value:i.status,type:"EQ",filter_empty:!0},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(l),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},oe=k.withCheckGrid(E.DataGrid),ie=function(){var e=v.useContext(ee),t=e.pageConfig,n=e.fetchConfig,a=e.ctx,l=e.ctxState,o=e.refs,i=(e.version,r(v.useState(0),2)),c=i[0],u=i[1];return v.useEffect(function(){u(c+1)},[n]),v.createElement(v.Fragment,null,v.createElement(oe,{toolbar:function(){var e={record:{username:"",password:""},type:b.FormDataType.CREATE,ctx:a,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(le,{ctx:a,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:a,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add")))))},data:null==l?void 0:l.data,loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,idField:"id",selection:null==l?void 0:l.selectionValues,onSelectionChange:function(e){return null==a?void 0:a.tableSelectionChange(e)},ckWidth:20,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,r=e.originalValue,l=n.props.field;if(console.log(t,n,r),t[l]!==r){var o=null==a?void 0:a.name();G.edit(o,{conditions:[{key:"id",value:t.id}],editor:[{key:l,value:t[l],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?k.$toast.success(x.tt("save_success","Message")):k.$toast.error(n),null==a||a.refresh()})}},key:c},v.createElement(E.GridColumn,{field:"id",title:x.tfield(t,"id.label","UserId"),width:"50px"}),v.createElement(E.GridColumn,{field:"username",title:x.tfield(t,"username.label","Username"),width:"80px"}),v.createElement(E.GridColumn,{field:"phone",title:x.tfield(t,"phone.label","Phone"),width:"60px",editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.TextBox,{value:t.phone})}}),v.createElement(E.GridColumn,{field:"status",title:x.tfield(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return B(n,"admin-state",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.ComboBox,{data:W(n,"admin-state"),value:t.status+""})}}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return B(n,"admin-type",t)},editable:null==a?void 0:a.can("update"),editor:function(e){var t=e.row;return v.createElement(E.ComboBox,{data:W(n,"admin-type"),value:t.type+""})}}),v.createElement(E.GridColumn,{field:"version",title:x.tfield(t,"version.label","Version"),width:"60px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"75px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"75px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"100px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return b.FormDataType.UPDATE,"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.username),v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:a,point:"assign"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:a,record:n,title:"".concat(x.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),v.createElement(k.Access,{ctx:a,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==a?void 0:a.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"100px"})))))},ce="admin",ue=[{type:b.CheckAccessEleType.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(t(I(ce))),se=J({name:"Admin",fetchConfig:function(){return G.configs(ce)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:ce,fetch:function(e){return G.list(ce,e)},checkAccessItems:ue,defaultPageSize:30});r.ctx.registerEvent("remove",U(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),v.createElement(ee.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,assigndlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(ae,p({},a)),v.createElement(ne,p({},l)),v.createElement(ie,null)))}),de=v.createContext({pageConfig:{},fetchConfig:{}}),me=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={position:void 0,active:void 0,title:"",type:void 0},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"title",label:x.tfield(n,"title.label","Title")},v.createElement(E.TextBox,{value:i.title})),v.createElement(E.FormField,{name:"active",label:x.tfield(n,"active.label","Active")},v.createElement(E.ComboBox,{data:W(a,"switch-state"),value:i.active})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"setting-type"),value:i.type})),v.createElement(E.FormField,{name:"position",label:x.tfield(n,"position.label","Position")},v.createElement(E.ComboBox,{data:W(a,"setting-position"),value:i.position})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:i.position,type:"="},{key:"type",value:i.type,type:"="},{key:"active",value:i.active,type:"="},{key:"title",value:i.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},fe=function(e){var t=e.pageVersion,n=v.useContext(de),r=n.pageConfig,a=n.fetchConfig,l=n.ctx,o=n.ctxState,i=n.refs;return v.createElement(E.TreeGrid,{toolbar:function(){return function(e,t,n,r){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(me,{ctx:n,pageConfig:e,fetchConfig:t})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},x.tparam(e,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:n,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(r,"formdlg.open",{type:b.FormDataType.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:x.tparam(e,"add.text","Create Setting")})}},x.tparam(e,"add.text","Add")))))}(r,a,l,i)},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",treeField:"title",key:"tree-table-"+t},v.createElement(E.GridColumn,{field:"title",title:x.tfield(r,"title.label","Title"),width:"220px"}),v.createElement(E.GridColumn,{field:"icon",title:x.tfield(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return v.createElement("span",{className:"iconfont "+t})}}),v.createElement(E.GridColumn,{field:"active",title:x.tfield(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return B(a,"switch-state",t)}}),v.createElement(E.GridColumn,{field:"position",title:x.tfield(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return B(a,"setting-position",t)}}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(a,"setting-type",t)}}),v.createElement(E.GridColumn,{field:"router_name",title:x.tfield(r,"router_name.label","RouterName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(r,"url.label","URL"),align:"left",width:"300px"}),v.createElement(E.GridColumn,{field:"sort",title:x.tfield(r,"sort.label","Sort"),align:"left",width:"80px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(r,"create_time.label","CreateTime"),width:"180px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(r,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:l,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(i,"formdlg.open",{ctx:l,record:t,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:l,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==l?void 0:l.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},pe=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=e.refs,u=r(A.useFormMData(a).toArray(),2),s=u[0],d=u[1],m=v.useRef(null),f=v.useMemo(function(){var e;return new C.SelectionTree(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,function(e){return{id:e.id,text:e.title,children:[]}},{id:0,text:x.tparam(l,"none_parent","None Parent"),children:[]})},[t.config.data]);v.useEffect(function(){t.setMethod("submitForm",p),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;d({router_name:t.name,url:t.url}),y.invoke(c,"routerlistdlg.close")})},[]);var p=function(){m.current.validate(function(e){if(null==e){var r={object:{id:parseInt(s.id),title:s.title,router_name:s.router_name,icon:s.icon,active:parseInt(s.active),position:parseInt(s.position),type:parseInt(s.type),sort:parseInt(s.sort),pid:parseInt(s.pid),url:s.url},conditions:[]};n===b.FormDataType.UPDATE&&r.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),i()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:m,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"title",label:x.tfield(l,"title.label","Title")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"title.placeholder",""),value:s.title})),v.createElement(E.FormField,{name:"router_name",label:x.tfield(l,"router_name.label","Router Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"router_name.placeholder",""),value:s.router_name,addonRight:function(){var e={title:x.tparam(l,"router_title","Router List")};return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return y.invoke(c,"routerlistdlg.open",e)}}))}})),v.createElement(E.FormField,{name:"icon",label:x.tfield(l,"icon.label","Icon")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"icon.placeholder",""),value:s.icon})),v.createElement(E.FormField,{name:"active",label:x.tfield(l,"active.label","Status")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"switch-state"),name:"switch-state",value:s.active,onChange:function(e,t){d({active:e})}})),v.createElement(E.FormField,{name:"type",label:x.tfield(l,"type.label","Type")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"setting-type"),name:"setting-type",value:s.type,onChange:function(e,t){d({type:e})}})),v.createElement(E.FormField,{name:"position",label:x.tfield(l,"position.label","Position")+":"},v.createElement(k.RadioGroupBox,{options:W(o,"setting-position"),name:"setting-position",value:s.position,onChange:function(e,t){d({position:e})}})),v.createElement(E.FormField,{name:"sort",label:x.tfield(l,"sort.label","Sort")+":"},v.createElement(E.NumberBox,{placeholder:x.tfield(l,"sort.placeholder",""),value:s.sort})),v.createElement(E.FormField,{name:"pid",label:x.tfield(l,"pid.label","Pid")+":"},v.createElement(E.ComboTree,{placeholder:x.tfield(l,"pid.placeholder",""),editable:!0,data:f,value:s.pid,onChange:function(e){return d({pid:e})}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:p},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:i},x.tparam(l,"close.text","Close"))))},he=v.createContext({pageConfig:{},fetchConfig:{}}),ge=function(e){var t=e.ctx,n=e.pageConfig,a=e.fetchConfig,l={name:"",type:""},o=r(v.useState(l),2),i=o[0],c=o[1];return v.createElement(E.Form,{className:"admin-search-panel",model:i,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:i.name})),v.createElement(E.FormField,{name:"type",label:x.tfield(n,"type.label","Type")},v.createElement(E.ComboBox,{data:W(a,"router-type"),value:i.type})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},l)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},ve=function(e){var t=e.selectedRow,n=e.scene,a=v.useContext(he),l=a.pageConfig,o=a.fetchConfig,i=a.ctx,c=a.ctxState,u=a.refs,s=r(v.useState(0),2),d=s[0],m=s[1],f=function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(ge,{ctx:i,pageConfig:l,fetchConfig:o})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},x.tparam(l,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:i,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(u,"formDataRefDlg.open",{type:b.FormDataType.CREATE,ctx:i,record:{name:""},title:x.tparam(l,"add.text","Create Router")})}},x.tparam(l,"add.text","Add")))))},p=function(e){e.value;var t=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:i,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(u,"formDataRefDlg.open",{ctx:i,record:t,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(l,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:i,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==i?void 0:i.publish("remove",{conditions:[{key:"name",value:t.name},{key:"type",value:t.type}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))};return v.useEffect(function(){m(d+1)},[o]),"setting"===n?v.createElement(E.DataGrid,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},v.createElement(E.GridColumn,{field:"name",title:x.tfield(l,"name.label","Name"),render:D}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(l,"type.label","URL"),align:"center",render:D}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(o,"router-type",t)}}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"120px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:p,width:"120px"})))):v.createElement(E.DataGrid,{toolbar:f,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},v.createElement(E.GridColumn,{field:"name",title:x.tfield(l,"name.label","Name"),render:D}),v.createElement(E.GridColumn,{field:"url",title:x.tfield(l,"url.label","URL"),align:"center",render:D}),v.createElement(E.GridColumn,{field:"type",title:x.tfield(l,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return B(o,"router-type",t)}}),v.createElement(E.GridColumn,{field:"data",title:x.tfield(l,"data.label","Data")}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(l,"create_time.label","CreateTime"),width:"180px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(l,"update_time.label","UpdateTime"),width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"120px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:p,width:"120px"}))))},ye=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=e.fetchConfig,i=e.close,c=(e.refs,r(A.useFormMData(a).toArray(),2)),u=c[0],s=c[1],d=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",m)},[]);var m=function(){d.current.validate(function(e){if(null==e){var r={object:{name:u.name,url:u.url,type:u.type,data:u.data},conditions:[]};n===b.FormDataType.UPDATE&&(r.conditions.push({key:"name",value:a.name}),r.conditions.push({key:"type",value:a.type})),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),i()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:d,model:u,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:u.name})),v.createElement(E.FormField,{name:"url",label:x.tfield(l,"url.label","Url")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"url.placeholder",""),value:u.url})),v.createElement(E.FormField,{name:"type",label:x.tfield(l,"type.label","Type")+":"},v.createElement(k.RadioGroupBox,{name:"router-type",value:u.type,options:W(o,"router-type"),onChange:function(e,t){s({type:e})}})),v.createElement(E.FormField,{name:"data",label:x.tfield(l,"data.label","Data")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"data.placeholder",""),value:u.data})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},onClick:m},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:i},x.tparam(l,"close.text","Close"))))},Ee=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(he),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ye,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},be="router",xe=[{type:b.CheckAccessEleType.AND,value:["/resource/router/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/router/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/router/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/router/edit"],key:"edit"}],Ce=J({name:"Router",fetchConfig:function(){return G.configs(be)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,a=e.scene,l=Y({name:be,fetch:function(e){return G.list(be,e)},checkAccessItems:xe,defaultPageSize:20});v.useEffect(function(){l.ctx.search()},[l.version]),l.ctx.registerEvent("remove",U(l.ctx));var o=k.useRefDialog();return v.createElement(he.Provider,{value:{ctx:l.ctx,ctxState:l.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:l.ctx,ctxState:l.ctxState})}},v.createElement(Ee,p({},o)),v.createElement(ve,{selectedRow:r,scene:a})))}),ke=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(de),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(pe,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},we=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(de).ctx);return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(Ce,{selectedRow:function(e){var t,n=e.row,a=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:a})},scene:"setting"})))},Se="setting",Ae=[{type:b.CheckAccessEleType.AND,value:["/resource/setting/add"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/update"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/delete"],key:"delete"},{type:b.CheckAccessEleType.AND,value:["/resource/setting/edit"],key:"edit"}],Te=J({name:"Setting",fetchConfig:function(){return G.configs(Se)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,a=X({name:Se,fetch:function(e){return G.list(Se,e)},checkAccessItems:Ae,defaultPageSize:10,isTreeData:!0});a.ctx.registerEvent("remove",U(a.ctx));var l=k.useRefDialog(),o=k.useRefDialog();return v.useEffect(function(){a.ctx.search()},[]),v.createElement(de.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:l,routerlistdlg:o}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(ke,p({},l)),v.createElement(we,p({},o)),v.createElement(fe,{pageVersion:r})))}),Fe=new(function(){return m(function e(){s(this,e)},[{key:"captcha",value:function(){return P().post(N("loginCaptcha"))}},{key:"login",value:(e=u(o().m(function e(t,n,r){var a,l,i;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P().post(N("loginSubmit"),t);case 1:a=e.v,l=a.code,i=a.data,200===l?n(i,l):r(i,l);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return P().post(N("loginConfig"))}}]);var e}()),De=function(e){var t=e.pageConfig,n=e.rules,a=w.useAppDispatch(),l=r(v.useState({username:"",captcha:"",password:"",code:"",token:""}),2),o=l[0],i=l[1],c=Q(),u=function(){Fe.captcha().then(function(e){var t=e.data;i(p(p({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return v.useEffect(function(){u(),c.autoRedirect()},[]),v.createElement(E.Form,{model:o,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},v.createElement(E.FormField,{name:"username"},v.createElement(E.TextBox,{iconCls:"iconfont "+y.get(t.fields,"username.icon","icon-username"),placeholder:y.get(t.fields,"username.placeholder","username..."),value:o.username})),v.createElement(E.FormField,{name:"password"},v.createElement(E.PasswordBox,{iconCls:"iconfont "+y.get(t.fields,"password.icon","icon-password"),placeholder:y.get(t.fields,"password.placeholder","password..."),value:o.password})),v.createElement(E.FormField,{name:"code"},v.createElement(E.TextBox,{iconCls:"iconfont "+y.get(t.fields,"code.icon","icon-captcha"),placeholder:y.get(t.fields,"code.placeholder","verification code..."),value:o.code,addonRight:function(){return v.createElement("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:u})}})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Fe.login(e,function(e){a(w.login({token:e.token,info:e.user,error:function(){k.$toast.error(y.get(t.params,"tips.loginError"))}})),c.autoRedirect()},function(){u()})},btnCls:"login_btn"},y.get(t.params,"submit.text","Sign In"))))},Re=function(){var e=k.useLocale(!0),t=e.localeOptions,n=e.changeLocale;return v.createElement(E.MenuButton,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return v.createElement(E.Menu,null,Object.keys(t).map(function(e,n){return v.createElement(E.MenuItem,{text:t[e],key:n,value:e})}))},onMenuItemClick:n})},Be=J({name:"Login",fetchConfig:Fe.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,a=e.rules;return v.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},v.createElement(Re,null),v.createElement("div",{className:"login layui-anim layui-anim-up"},v.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),v.createElement(De,{pageConfig:n,fetchConfig:r,rules:a})))}),Pe=v.createContext({pageConfig:{},fetchConfig:{}}),Le=function(e){var n=e.ctx,a=(e.type,e.record),l=e.pageConfig,i=(e.fetchConfig,e.close),c=r(v.useState(),2),s=c[0],d=c[1],m=r(v.useState([]),2),f=m[0],p=m[1],h=v.useRef(null),g=r(v.useState([]),2),y=g[0],b=g[1],C=r(v.useState([]),2),w=C[0],S=C[1],A=v.useRef(null);v.useEffect(function(){null==n||n.setMethod("onSubmit",F),T()},[]);var T=function(){var e=u(o().m(function e(){var t,n,r,l,i,c,u,s,m,p;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,q.roles();case 1:return t=e.v,n=z(t.data||[]),r=[],e.n=2,q.permissions();case 2:return l=e.v,i=j(l.data||[]),c=[],e.n=3,q.getChildren({name:a.name});case 3:u=e.v,s=u.code,m=u.data,200===s&&(p=new Set,m&&m.forEach(function(e){p.add(e.name),1==e.item_type?w.push(e.name):f.push(e.name)}),V(i,p,c),d(i),c.forEach(function(e){h.current.checkNode(e)}),V(n,p,r),b(n),r.forEach(function(e){A.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){q.addPermissionChildren({name:a.name,children:[].concat(t(f),t(w))}).then(function(e){200===e.code&&(k.$toast.success(x.tparam(l,"assign_success","assign permission successfully!")),i())})};return v.createElement(E.Layout,{style:{width:800,height:500}},v.createElement(E.LayoutPanel,{region:"west",style:{width:220}},v.createElement(E.Panel,{bodyStyle:{padding:"10px",height:"100%"}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:y,ref:A,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),S(t)}}}))),v.createElement(E.LayoutPanel,{region:"center",style:{height:"100%"}},v.createElement(E.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return v.createElement(E.TextBox,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},v.createElement(E.Tree,{selectLeafOnly:!0,checkbox:!0,data:s,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),p(t)}}}))),v.createElement(E.LayoutPanel,{region:"south"},v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:F}," ",x.tparam(l,"submit.text","Submit")," "),v.createElement(E.LinkButton,{style:{width:80},onClick:i}," ",x.tparam(l,"close.text","Close")," "))))},Ne=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Pe),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Le,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},_e=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(n,"description.label","Description")},v.createElement(E.TextBox,{value:o.description})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},Ge=k.withCheckGrid(E.DataGrid),Ie=function(){var e=v.useContext(Pe),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(Ge,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(_e,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){y.invoke(l,"formdlg.open",{type:b.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:x.tparam(t,"add.text","Create Role")})}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"batch-delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?k.$toast.error(x.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:q.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},x.tparam(t,"batch_remove.text","Batch Remove")))))},data:(null==a?void 0:a.data)||[],loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:o},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"220px"}),v.createElement(E.GridColumn,{field:"rule_name",title:x.tfield(t,"rule_name.label","RuleName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"description",title:x.tfield(t,"description.label","Description"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:R}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"100px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"assign-permission"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(x.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:r,record:n,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:q.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Me=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(A.useFormData(a).toArray(),2),c=i[0],u=(i[1],r(A.useFormData(a).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){t.setMethod("onSubmit",d)},[]);var d=function(){s.current.validate(function(e){null==e?(n===b.FormDataType.CREATE&&q.addRole(c).then(function(e){var n=e.code;e.data;200==n&&(k.$toast.success(x.tt("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===b.FormDataType.UPDATE&&q.updateRole({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(k.$toast.success(x.tt("update_role_success","Message","update role successfully!")),t.refresh(),o())})):k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(l,"description.label","Description")+":"},v.createElement(E.TextBox,{multiline:!0,placeholder:x.tfield(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:d},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o},x.tparam(l,"close.text","Close"))))},Ue=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Pe),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(Me,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},Oe=[{type:b.CheckAccessEleType.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:b.CheckAccessEleType.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:b.CheckAccessEleType.AND,value:["/rbac/add-role"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/rbac/update-role"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/rbac/delete-role"],key:"delete"}],je=J({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:"roles",fetch:function(e){return q.roles()},checkAccessItems:Oe,defaultPageSize:30,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",M(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.createElement(Pe.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,assigndlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(Ue,p({},a)),v.createElement(Ne,p({},l)),v.createElement(Ie,null)))}),Ve=v.createContext({pageConfig:{},fetchConfig:{}}),ze=function(e){var t=e.ctx,n=(e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),o=r(A.useFormData(n).toArray(),1)[0];v.useEffect(function(){null==t||t.setMethod("onSubmit",i)},[]);var i=function(){var e={resource:o.resource,name:o.name};q.fastAddPermission(e).then(function(e){200===e.code&&(k.$toast.success(x.tt("save_success","Message","Save Success!")),t.refresh(),l())})};return v.createElement(E.Form,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"resource",label:x.tfield(a,"fast_add_resource.label","Resource")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"fast_add_resource.placeholder",""),value:o.resource})),v.createElement(E.FormField,{name:"name",label:x.tfield(a,"fast_add_name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(a,"fast_add_name.placeholder",""),value:o.name})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:i},x.tparam(a,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:l},x.tparam(a,"close.text","Close"))))},We=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Ve),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement(ze,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},qe=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=r(v.useState(a),2),c=i[0],u=(i[1],r(A.useFormData(a).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){s.current.validate(function(e){null==e?(n===b.FormDataType.CREATE&&q.addPermission(c).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===b.FormDataType.UPDATE&&q.updatePermission({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:s,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(l,"description.label","Description")+":"},v.createElement(E.TextBox,{multiline:!0,placeholder:x.tfield(l,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),v.createElement("div",{className:"admin-form-submit"},v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:d},x.tparam(l,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o},x.tparam(l,"close.text","Close"))))},$e=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Ve),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},v.createElement(qe,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},He=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",description:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"description",label:x.tfield(n,"description.label","Description")},v.createElement(E.TextBox,{value:o.description})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE"},{key:"description",value:o.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},Ke=k.withCheckGrid(E.DataGrid),Qe=function(){var e=v.useContext(Ve),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return v.createElement(Ke,{toolbar:function(){return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(He,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){y.invoke(l,"formdlg.open",{type:b.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:x.tparam(t,"add.text","Create Role")})}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"batch-delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?k.$toast.error(x.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:q.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},x.tparam(t,"batch_remove.text","Batch Remove"))),v.createElement(k.Access,{ctx:r,point:"fast-add-permission"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){y.invoke(l,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:x.tparam(t,"fast_add.text","Fast Add")})}},x.tparam(t,"fast_add.text","Fast Add")))))},data:(null==a?void 0:a.data)||[],idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,lazy:!0,key:o},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"220px"}),v.createElement(E.GridColumn,{field:"rule_name",title:x.tfield(t,"rule_name.label","RuleName"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"description",title:x.tfield(t,"description.label","Description"),align:"left",render:D,width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:R,sortable:!0}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:r,record:n,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:q.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Xe=[{type:b.CheckAccessEleType.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:b.CheckAccessEleType.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:b.CheckAccessEleType.AND,value:["/rbac/add-permission"],key:"add"},{type:b.CheckAccessEleType.AND,value:["/rbac/update-permission"],key:"update"},{type:b.CheckAccessEleType.AND,value:["/rbac/delete-permission"],key:"delete"}],Ye=J({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=X({name:"permissions",fetch:function(e){return q.permissions()},checkAccessItems:Xe,defaultPageSize:50,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]);var a=k.useRefDialog(),l=k.useRefDialog();return r.ctx.registerEvent("remove",M(r.ctx)),v.createElement(Ve.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,fastadddlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement($e,p({},a)),v.createElement(We,p({},l)),v.createElement(Qe,null)))}),Ze=v.createContext({pageConfig:{},fetchConfig:{}}),Je=v.createContext({pageConfig:{},fetchConfig:{}}),et=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{label:"",value:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before"},v.createElement(E.FormField,{name:"label",label:x.tfield(n,"label.label","Label")},v.createElement(E.TextBox,{value:o.label})),v.createElement(E.FormField,{name:"value",label:x.tfield(n,"value.label","Value")},v.createElement(E.TextBox,{value:o.value})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:o.label,type:"LIKE",filter_empty:!0},{key:"value",value:o.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},a)),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},tt=function(){var e=v.useContext(Je),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(E.DataGrid,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:b.FormDataType.CREATE,ctx:r,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(et,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(l,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style},v.createElement(E.GridColumn,{field:"label",title:x.tfield(t,"label.label","Label"),width:"160px"}),v.createElement(E.GridColumn,{field:"value",title:x.tfield(t,"value.label","Value"),align:"center",width:"180px"}),v.createElement(E.GridColumn,{field:"data",title:x.tfield(t,"data.label","Data"),align:"center",width:"180px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"80px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}],data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},nt=function(e){var t=e.ctx,n=e.type,a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(A.useFormData(a).toArray(),1)[0],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",function(e){return s(e)})},[]);var s=function(e){u.current.validate(function(r){if(null==r){var l={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===b.FormDataType.UPDATE&&l.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,l,function(){k.$toast.success(x.tt("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else k.$toast.error(O(r))})};return v.createElement(E.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"label",label:x.tfield(l,"label.label","Label")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"label.placeholder",""),value:c.label})),v.createElement(E.FormField,{name:"value",label:x.tfield(l,"value.label","Value")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"value.placeholder",""),value:c.value})),v.createElement(E.FormField,{name:"data",label:x.tfield(l,"data.label","Data")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"data.placeholder",""),value:c.data,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},rt=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Je),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(nt,p(p({ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c}))),v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},x.tparam(o,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},x.tparam(o,"cancel.text","Cancel"))))},at="dict-item",lt=I(at),ot=J({name:"DictItem",fetchConfig:function(){return G.configs(at)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,a=Y({name:at,fetch:function(e){return G.list(at,e)},checkAccessItems:lt,fixedConditions:[{key:"sign",value:r}]},r);a.ctx.registerEvent("remove",U(a.ctx));var l=k.useRefDialog({sign:r});return v.useEffect(function(){a.ctx.search()},[]),v.createElement(Je.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:a.ctx,ctxState:a.ctxState})}},v.createElement(rt,p({},l)),v.createElement(tt,null)))}),it=function(e){var t=e.ctx,n=(e.ctxState,e.type),a=e.record,l=e.pageConfig,o=(e.fetchConfig,e.close),i=e.refs,c=r(A.useFormData(a).toArray(),1)[0],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){u.current.validate(function(e){if(null==e){var r={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===b.FormDataType.UPDATE&&r.conditions.push({key:"id",value:a.id}),G.saveResult(null==t?void 0:t.name(),n,r,function(){k.$toast.success(x.tt("save_success","Message")),t.refresh(),o()}).then(function(e){})}else k.$toast.error(O(e))})};return v.createElement(E.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},v.createElement(E.FormField,{name:"name",label:x.tfield(l,"name.label","Name")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"name.placeholder",""),value:c.name})),v.createElement(E.FormField,{name:"sign",label:x.tfield(l,"sign.label","Sign")+":"},v.createElement(E.TextBox,{placeholder:x.tfield(l,"sign.placeholder",""),disabled:n===b.FormDataType.UPDATE,value:c.sign})),v.createElement(E.FormField,{name:"remark",label:x.tfield(l,"remark.label","Remark")+":"},v.createElement(E.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:x.tfield(l,"remark.placeholder",""),value:c.remark,addonRight:function(){return v.createElement("span",{style:{paddingLeft:"8px"}},v.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},ct=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(Ze));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},v.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},v.createElement(ot,p({},n))))},ut=function(e){var t=e.value,n=e.props,r=e.close,a=v.useContext(Ze),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,u=a.refs;return v.createElement(E.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},v.createElement("div",{className:"f-full"},v.createElement(it,p(p({ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:u}))),v.createElement("div",{className:"dialog-button"},v.createElement(E.LinkButton,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},x.tparam(i,"submit.text","Submit")),v.createElement(E.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},x.tparam(i,"cancel.text","Cancel"))))},st=function(e){var t=e.ctx,n=e.pageConfig,a=(e.fetchConfig,{name:"",sign:""}),l=r(v.useState(a),2),o=l[0],i=l[1];return v.createElement(E.Form,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before"},v.createElement(E.FormField,{name:"name",label:x.tfield(n,"name.label","Name")},v.createElement(E.TextBox,{value:o.name})),v.createElement(E.FormField,{name:"sign",label:x.tfield(n,"sign.label","Sign")},v.createElement(E.TextBox,{value:o.sign})),v.createElement(E.FormField,null,v.createElement(E.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:o.name,type:"LIKE",filter_empty:!0},{key:"sign",value:o.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},x.tparam(n,"search.text","Search")),v.createElement(E.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(a),null==t||t.reset()}},x.tparam(n,"reset.text","Reset"))))},dt=k.withCheckGrid(E.DataGrid),mt=function(){var e=v.useContext(Ze),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return v.createElement(v.Fragment,null,v.createElement(dt,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:b.FormDataType.CREATE,ctx:r,title:x.tparam(t,"add.text","Create Dict")};return v.createElement(v.Fragment,null,v.createElement("div",null,v.createElement(st,{ctx:r,pageConfig:t,fetchConfig:n})),v.createElement("div",{style:{padding:4}},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},x.tparam(t,"refresh.text","Refresh")),v.createElement(k.Access,{ctx:r,point:"add"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(l,"formDataRefDlg.open",e)}},x.tparam(t,"add.text","Add"))),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&e.length>0?null==r||r.publish("batchRemove",{conditions:[{key:"id",value:r.tableSlectionValue(),type:"IN"}]}):k.$toast.error(x.tt("checkbox_no_empty","Message"))}},x.tparam(t,"batch_remove.text","Batch Remove")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},v.createElement(E.GridColumn,{field:"name",title:x.tfield(t,"name.label","Name"),width:"160px"}),v.createElement(E.GridColumn,{field:"sign",title:x.tfield(t,"sign.label","Sign"),width:"150px"}),v.createElement(E.GridColumn,{field:"remark",title:x.tfield(t,"remark.label","Remark"),width:"180px"}),v.createElement(E.GridColumn,{field:"create_time",title:x.tfield(t,"create_time.label","CreateTime"),width:"120px"}),v.createElement(E.GridColumn,{field:"update_time",title:x.tfield(t,"update_time.label","UpdateTime"),width:"120px"}),v.createElement(E.GridColumnGroup,{frozen:!0,align:"right",width:"150px"},v.createElement(E.GridHeaderRow,null,v.createElement(E.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:b.FormDataType.UPDATE,title:"".concat(x.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),o={sign:n.sign,title:x.tparam(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return v.createElement(v.Fragment,null,v.createElement(k.Access,{ctx:r,point:"items"},v.createElement(E.Tooltip,{content:x.tparam(t,"item_list.text","Dict Item"),position:"top"},v.createElement(E.LinkButton,{onClick:function(){return y.invoke(l,"dictItemDataRefDlg.open",o)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),v.createElement(k.Access,{ctx:r,point:"update"},v.createElement(E.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),v.createElement(k.Access,{ctx:r,point:"delete"},v.createElement(E.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:[{key:"id",value:n.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},ft="dict",pt=[{type:b.CheckAccessEleType.AND,value:["/resource/dict-item/list"],key:"items"}].concat(t(I(ft))),ht=J({name:"Dict",fetchConfig:function(){return G.configs(ft)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=Y({name:ft,fetch:function(e){return G.list(ft,e)},checkAccessItems:pt});r.ctx.registerEvent("remove",U(r.ctx)),r.ctx.registerEvent("batchRemove",U(r.ctx));var a=k.useRefDialog(),l=k.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),v.createElement(Ze.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,dictItemDataRefDlg:l}}},v.createElement(k.DefaultPanel,{mode:"cover",footer:function(){return v.createElement(Z,{ctx:r.ctx,ctxState:r.ctxState})}},v.createElement(ut,p({},a)),v.createElement(ct,p({},l)),v.createElement(mt,null)))}),gt=function(e){var t=r(v.useState([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),2);t[0],t[1];return v.createElement("h2",null,"developing......")},vt=v.createContext({}),yt=function(){var e=k.useTheme(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,w.useAppSelector(function(e){return e.app.theme})),a=v.useRef(null);return v.useEffect(function(){},[]),v.createElement(v.Fragment,null,v.createElement(k.DrawerPanel,{width:"300px",placement:"right",ref:a},v.createElement(E.Panel,{style:{width:"300px",height:"100%"},title:x.tt("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map(function(e,n){return v.createElement("div",{key:n},v.createElement(E.RadioButton,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),v.createElement(E.Label,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},x.tt("themes."+e.key,"Setting",e.name)))}))),v.createElement(E.LinkButton,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){a.current.toggle()}}))},Et=function(){var e=w.useAppSelector(function(e){return e.user.info}),t=S.useNavigate();return v.createElement(E.MenuButton,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return v.createElement(E.Menu,{noline:!0},v.createElement(E.MenuItem,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=x.tt("confirm_logout","Message");k.$confirm("",n,function(){w.Admin.logout(function(){t("/login")})})}}})},bt=new C.TabMenuService(0,function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}}),xt={border:!1,plain:!0,scrollable:!0,narrow:!1},Ct={border:!1,animate:!0,multiple:!0,showCollapsedText:!1};exports.AdminView=se,exports.AppLayoutContext=vt,exports.BaseLayout=function(e){S.useNavigate(),w.useAppSelector(function(e){return e.user.info});var t={dispatch:w.useAppDispatch(),useAppSelector:w.useAppSelector},n=K(bt),r=n.collapsed,a=n.menuList,l=n.choiceId,o=n.onMenuSelection,i=n.menuArea,c=n.setMenuAreaId,u=n.menuTabList,s=n.onTabClosed,d=n.onTabSelected;return v.createElement(vt.Provider,{value:t},v.createElement(k.FullBodyLayout,p({menus:a,title:x.tt("title","App","Admin"),collapsed:r,sidebarCfg:p(p({},Ct),{},{onItemClick:o}),selection:E.treeHelper.findNode(a,"id",l),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,w.setSidebarCollapsed(e))},slots:{barLeft:v.createElement(function(){return v.createElement(v.Fragment,null,!r&&(null==i?void 0:i.map(function(e,t){return v.createElement(E.LinkButton,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return c(e.id)}},e.text)})))},null),barRight:v.createElement(function(){return v.createElement(v.Fragment,null,v.createElement(Et,null),v.createElement(Re,null),v.createElement(yt,null))},null),footer:v.createElement(function(){return v.createElement(v.Fragment,null,e.footer)},null)},onSideMenuSelection:function(){}},e),v.createElement(function(){return v.createElement(k.TabsPanel,{onTabSelect:d,tabsCfg:xt,onTabClosed:s,data:u})},null),v.createElement("div",{className:"admin-tabs-panel-body"},v.createElement(S.Outlet,null))))},exports.DictView=ht,exports.HomeView=function(){return v.createElement("h1",null,"Home!!!!!!!")},exports.Lazy=function(e){return v.createElement(v.Suspense,{fallback:v.createElement(v.Fragment,null,"...")},e)},exports.LocaleBarItem=Re,exports.LoginView=Be,exports.NotFoundView=function(){return v.createElement("h1",null,"404!!!!!!!")},exports.PaginationPanel=Z,exports.PermissionsView=Ye,exports.RolesView=je,exports.RouterView=Ce,exports.ScreenDesign=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return v.useRef(null),v.createElement(k.DefaultPanel,{mode:"cover"},v.createElement(E.Layout,{style:{width:"100%",height:"100%"}},v.createElement(E.LayoutPanel,{region:"north",style:{height:50}},"North Region"),v.createElement(E.LayoutPanel,{region:"south",style:{height:50}},"South Region"),v.createElement(E.LayoutPanel,{region:"west",style:{width:240}},v.createElement("div",{style:{}},"West Region")),v.createElement(E.LayoutPanel,{region:"east",style:{width:240}},v.createElement("div",{style:{}},"East Region")),v.createElement(E.LayoutPanel,{region:"center",style:{width:"100%",height:"100%"}},v.createElement(gt,null))))},exports.SettingBarItem=yt,exports.SettingView=Te,exports.Tooltip=function(e){var t=e.text,n=e.position,a=void 0===n?"top":n,l=e.maxWidth,o=void 0===l?400:l,i=function(){var e=v.useRef(null),t=r(v.useState(!1),2),n=t[0],a=t[1];return v.useEffect(function(){var t=e.current;if(t){var n=function(){a(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),c=r(i,2),u=c[0],s=c[1],d=r(v.useState(!1),2),m=d[0],f=d[1],p=r(v.useState({top:0,left:0,width:0,height:0}),2),h=p[0],g=p[1],y=v.createElement("div",{ref:u,className:"easyui-cell",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:function(){if(u.current){var e=u.current.getBoundingClientRect();g({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}),f(!0)}},onMouseLeave:function(){return f(!1)}},t);return s?v.createElement(v.Fragment,null,y,m&&T.createPortal(v.createElement("div",{className:"easyui-tooltip-content easyui-tooltip-".concat(a),style:{maxWidth:o,position:"absolute",zIndex:9999,top:"top"===a?h.top-6:h.top+h.height+6,left:h.left,pointerEvents:"none"}},v.createElement("pre",{style:{whiteSpace:"pre-wrap",margin:0}},t)),document.body)):y},exports.adminService=$,exports.configService=H,exports.convertToText=O,exports.ctxPageValue=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},exports.ctxPageValueOptions=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},exports.fetchConfigOptions=W,exports.install=function(e){var t,n,r;n=e.request,F||(F=n),r=null!==(t=e.apis)&&void 0!==t?t:{},L=p(p({},L),r)},exports.permissionTree=j,exports.queryPermissionTress=V,exports.rbacService=q,exports.removeEventFn=M,exports.renderDateTime02=R,exports.renderFetchConfigValue=B,exports.renderText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?v.createElement("span",{className:"iconfont "+t},e):v.createElement("span",null,e)},exports.renderTooltip=D,exports.renderType=function(){return v.createElement("div",null,"Type")},exports.resourceAccessItems=I,exports.resourceRemoveEvent=U,exports.resourceService=G,exports.roleTree=z,exports.useAppRedirect=Q,exports.useAppStarter=function(){var e=k.useLocale().locale,t=r(v.useState(),2),n=t[0],a=t[1],l=Q();return v.useEffect(function(){x.setLanguage(e,function(){a(x.getActivePkg())}),l.autoRedirect()},[]),v.useEffect(function(){a(x.getActivePkg())},[e]),{easyuiLangPkg:n}},exports.useLocalTable=X,exports.useMenuAndTabData=K,exports.useTable=Y,exports.withDocHoc=J;
|
|
@@ -2,6 +2,8 @@ import { EditorBody, FormBody, RemoveBody, SearchBody } from "@kordar-lib/crud";
|
|
|
2
2
|
import { FormDataType } from "@kordar-lib/base";
|
|
3
3
|
declare class ResourceService {
|
|
4
4
|
result(code: any, message: string, data: any, count: number, success: Function, fail?: Function): void;
|
|
5
|
+
private buildQueryString;
|
|
6
|
+
listWithQuery(api: string, query: any, data?: SearchBody): Promise<any>;
|
|
5
7
|
list(api: string, data?: SearchBody): Promise<any>;
|
|
6
8
|
listResult(api: string, req: SearchBody | undefined, success: Function): Promise<void>;
|
|
7
9
|
configs(api: string, data?: any): Promise<any>;
|