@kordar/easyui-tpl 2.0.3 → 2.0.4

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.
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function B(){return E||(E=1,"production"!==process.env.NODE_ENV&&function(){var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator;var h=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=h.ReactDebugCurrentFrame,i=r.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var y;function b(e){return e.displayName||"Context"}function j(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case s:return"Suspense";case u:return"SuspenseList"}if("object"===x(e))switch(e.$$typeof){case l:return b(e)+".Consumer";case a:return b(e._context)+".Provider";case c:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:j(e.type)||"Memo";case f:var p=e,m=p._payload,h=p._init;try{return j(h(m))}catch(e){return null}}return null}y=Symbol.for("react.module.reference");var C,k,w,S,T,F,R,A=Object.assign,D=0;function E(){}E.__reactDisabledLog=!0;var _,B=h.ReactCurrentDispatcher;function L(e,t,n){if(void 0===_)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);_=r&&r[1]||""}return"\n"+_+e}var N,G=!1,O="function"==typeof WeakMap?WeakMap:Map;function I(e,t){if(!e||G)return"";var n,r=N.get(e);if(void 0!==r)return r;G=!0;var i,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=B.current,B.current=null,function(){if(0===D){C=console.log,k=console.info,w=console.warn,S=console.error,T=console.group,F=console.groupCollapsed,R=console.groupEnd;var e={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"===("undefined"==typeof Reflect?"undefined":x(Reflect))&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var l=t.stack.split("\n"),c=n.stack.split("\n"),s=l.length-1,u=c.length-1;s>=1&&u>=0&&l[s]!==c[u];)u--;for(;s>=1&&u>=0;s--,u--)if(l[s]!==c[u]){if(1!==s||1!==u)do{if(s--,--u<0||l[s]!==c[u]){var d="\n"+l[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&N.set(e,d),d}}while(s>=1&&u>=0);break}}}finally{G=!1,B.current=i,function(){if(0===--D){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:C}),info:A({},e,{value:k}),warn:A({},e,{value:w}),error:A({},e,{value:S}),group:A({},e,{value:T}),groupCollapsed:A({},e,{value:F}),groupEnd:A({},e,{value:R})})}D<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=o}var f=e?e.displayName||e.name:"",p=f?L(f):"";return"function"==typeof e&&N.set(e,p),p}function M(e,t,n){if(null==e)return"";if("function"==typeof e)return I(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return L(e);switch(e){case s:return L("Suspense");case u:return L("SuspenseList")}if("object"===x(e))switch(e.$$typeof){case c:return I(e.render,!1);case d:return M(e.type,t,n);case f:var i=e,o=i._payload,a=i._init;try{return M(a(o),t,n)}catch(e){}}return""}N=new O;var U=Object.prototype.hasOwnProperty,$={},W=h.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);W.setExtraStackFrame(n)}else W.setExtraStackFrame(null)}var z=Array.isArray;function q(e){return z(e)}function H(e){return""+e}function K(e){if(function(e){try{return H(e),!1}catch(e){return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),H(e)}var Y,X,Q=h.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,n,r,i,o){var a,l={},c=null,s=null;for(a in void 0!==r&&(K(r),c=""+r),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(K(n.key),c=""+n.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(n)&&(s=n.ref,function(e){"string"==typeof e.ref&&Q.current}(n)),n)U.call(n,a)&&!J.hasOwnProperty(a)&&(l[a]=n[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)void 0===l[a]&&(l[a]=u[a])}if(c||s){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){Y||(Y=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,d),s&&function(e,t){var n=function(){X||(X=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,d)}return function(e,n,r,i,o,a,l){var c={$$typeof:t,type:e,key:n,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,o,i,Q.current,l)}var ee,te=h.ReactCurrentOwner,ne=h.ReactDebugCurrentFrame;function re(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);ne.setExtraStackFrame(n)}else ne.setExtraStackFrame(null)}function ie(e){return"object"===x(e)&&null!==e&&e.$$typeof===t}function oe(){if(te.current){var e=j(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var ae={};function le(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=oe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ae[n]){ae[n]=!0;var r="";e&&e._owner&&e._owner!==te.current&&(r=" It was passed a child from "+j(e._owner.type)+"."),re(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),re(null)}}}function ce(e,t){if("object"===x(e))if(q(e))for(var n=0;n<e.length;n++){var r=e[n];ie(r)&&le(r,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!==x(e))return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,a=i.call(e);!(o=a.next()).done;)ie(o.value)&&le(o.value,t)}}function se(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!==x(n)||n.$$typeof!==c&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=j(n);!function(e,t,n,r,i){var o=Function.call.bind(U);for(var a in e)if(o(e,a)){var l=void 0;try{if("function"!=typeof e[a]){var c=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+x(e[a])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}l=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(V(i),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,x(l)),V(null)),l instanceof Error&&!(l.message in $)&&($[l.message]=!0,V(i),g("Failed %s type: %s",n,l.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!ee){ee=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",j(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ue={};function de(e,n,m,h,v,b){var C=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===o||e===i||e===s||e===u||e===p||"object"===x(e)&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===y||void 0!==e.getModuleId)}(e);if(!C){var k="";(void 0===e||"object"===x(e)&&null!==e&&0===Object.keys(e).length)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w;k+=oe(),null===e?w="null":q(e)?w="array":void 0!==e&&e.$$typeof===t?(w="<"+(j(e.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):w=x(e),g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,k)}var S=Z(e,n,m,v,b);if(null==S)return S;if(C){var T=n.children;if(void 0!==T)if(h)if(q(T)){for(var F=0;F<T.length;F++)ce(T[F],e);Object.freeze&&Object.freeze(T)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ce(T,e)}if(U.call(n,"key")){var R=j(e),A=Object.keys(n).filter(function(e){return"key"!==e}),D=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!ue[R+D])g('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',D,R,A.length>0?"{"+A.join(": ..., ")+": ...}":"{}",R),ue[R+D]=!0}return e===r?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){re(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),re(null);break}}null!==e.ref&&(re(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}(S):se(S),S}var fe=function(e,t,n){return de(e,t,n,!1)},pe=function(e,t,n){return de(e,t,n,!0)};P.Fragment=r,P.jsx=fe,P.jsxs=pe}()),P}var L=(_||(_=1,"production"===process.env.NODE_ENV?A.exports=function(){if(g)return D;g=1;var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var l,c={},s=null,u=null;for(l in void 0!==a&&(s=""+a),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,l)&&!o.hasOwnProperty(l)&&(c[l]=n[l]);if(e&&e.defaultProps)for(l in n=e.defaultProps)void 0===c[l]&&(c[l]=n[l]);return{$$typeof:t,type:e,key:s,ref:u,props:c,_owner:i.current}}return D.Fragment=n,D.jsx=a,D.jsxs=a,D}():A.exports=B()),A.exports);var N,G=function(e){var t=e.text,n=e.children,r=e.position,i=void 0===r?"bottom":r,o=e.trigger,a=void 0===o?"hover":o,l=e.delay,c=void 0===l?50:l,s=e.maxWidth,d=void 0===s?250:s,f=e.theme,m=void 0===f?"dark":f,h=e.followMouse,x=void 0!==h&&h,g=e.autoFlip,y=void 0===g||g,j=function(){var e=v.useRef(null),t=p(v.useState(!1),2),n=t[0],r=t[1];return v.useEffect(function(){var t=e.current;if(t){var n=function(){return r(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),C=p(j,2),k=C[0],w=C[1],S=p(v.useState(!1),2),T=S[0],F=S[1],R=p(v.useState({top:0,left:0}),2),A=R[0],D=R[1],E=p(v.useState(i),2),_=E[0],P=E[1],B=v.useRef(0),N=function(e){if(k.current){var t=k.current.getBoundingClientRect(),n=y?function(e,t){var n=e.top,r=window.innerHeight-e.bottom,i=e.left,o=window.innerWidth-e.right;return"top"===t&&n<80?"bottom":"bottom"===t&&r<80?"top":"left"===t&&i<120?"right":"right"===t&&o<120?"left":t}(t,i):i;P(n);var r=0,o=0;if(x&&e)r=e.clientY+12,o=e.clientX+12;else switch(n){case"top":r=t.top+window.scrollY-8,o=t.left+t.width/2+window.scrollX;break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+t.width/2+window.scrollX;break;case"left":r=t.top+t.height/2+window.scrollY,o=t.left+window.scrollX-8;break;case"right":r=t.top+t.height/2+window.scrollY,o=t.right+window.scrollX+8}D({top:r,left:o})}},G=function(e){B.current=window.setTimeout(function(){N(e),F(!0)},c)},O=function(){clearTimeout(B.current),F(!1)},I={};"hover"===a&&(I.onMouseEnter=w?G:void 0,I.onMouseLeave=w?O:void 0,x&&(I.onMouseMove=N)),"click"===a&&(I.onClick=function(){return F(!T)}),"focus"===a&&(I.onFocus=w?G:void 0,I.onBlur=w?O:void 0);var M=T&&w?b.createPortal(L.jsxs("div",{className:"easyui-tooltip easyui-tooltip-".concat(m),style:{top:A.top,left:A.left,maxWidth:d,transform:function(){switch(_){case"top":return"translate(-50%, -100%)";case"bottom":return"translate(-50%, 0)";case"left":return"translate(-100%, -50%)";case"right":return"translate(0, -50%)"}}()},children:[t,L.jsx("div",{className:"easyui-tooltip-arrow",style:function(){switch(_){case"top":return{bottom:-4,left:"50%",transform:"translateX(-50%) rotate(45deg)"};case"bottom":return{top:-4,left:"50%",transform:"translateX(-50%) rotate(45deg)"};case"left":return{right:-4,top:"50%",transform:"translateY(-50%) rotate(45deg)"};case"right":return{left:-4,top:"50%",transform:"translateY(-50%) rotate(45deg)"}}}()})]}),document.body):null;return L.jsxs(L.Fragment,{children:[L.jsx("div",u(u({ref:k,className:"easyui-tooltip-trigger"},I),{},{style:{width:"100%"},children:n})),M]})},O=function(e){var t=e.value;return t?L.jsx(G,{text:t,position:"bottom",children:L.jsx("span",{children:t})}):""},I=function(e){return e.value.replace("T"," ").replace("Z","")},M=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",i=y.get(e,t,[]);for(var o in i){var a=i[o];if(a.value==n)return a.label}return r};function U(){return N}new k.MenuService;var $={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 W(e){return $[e]}var V=function(){return c(function e(){a(this,e)},[{key:"result",value:function(e,t,n,r,i,o){200===e&&i&&i(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),i=r?"resource/".concat(e,"/list?").concat(r):"resource/".concat(e,"/list");return U().post(i,n)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(l=o(n().m(function e(t){var r,i,o,a,l,c,s,u=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},i=u.length>2?u[2]:void 0,e.n=1,U().post("resource/".concat(t,"/list"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,s=o.count,this.result(a,l,c,s,i);case 2:return e.a(2)}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(i=o(n().m(function e(t){var r,i,o,a,l,c,s=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},i=s.length>2?s[2]:void 0,e.n=1,U().post("resource/".concat(t,"/configs"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);case 2:return e.a(2)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"edit",value:function(e,t){return U().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(r=o(n().m(function e(t,r,i){var o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post("resource/".concat(t,"/edit"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);case 2:return e.a(2)}},e,this)})),function(e,t,n){return r.apply(this,arguments)})},{key:"add",value:function(e,t){return U().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return U().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=o(n().m(function e(t,r,i,o){var a,l,c,s,u,d,f,p;return n().w(function(e){for(;;)switch(e.n){case 0:if(r!==j.FormDataType.CREATE){e.n=2;break}return e.n=1,this.add(t,i);case 1:a=e.v,l=a.code,c=a.message,s=a.data,this.result(l,c,s,0,o),e.n=4;break;case 2:if(r!==j.FormDataType.UPDATE){e.n=4;break}return e.n=3,this.update(t,i);case 3:u=e.v,d=u.code,f=u.message,p=u.data,this.result(d,f,p,0,o);case 4:return e.a(2)}},e,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return U().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=o(n().m(function e(t,r,i){var o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post("resource/".concat(t,"/delete"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);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 U().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 U().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),i=document.createElement("a");i.setAttribute("download",n+".xlsx"),i.href=r,document.body.appendChild(i),i.click(),document.body.removeChild(i)})}}]);var e,t,r,i,l}(),z=new V,q=function(e){return[{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},H=function(e,t){return function(n){var r=n.fn,i=n.params,o=n.success,a=n.error;w.$confirm(C.tt("confirm_del_title","Message"),null!=t?t:C.tt("confirm_del_msg","Message"),function(){r(i).then(function(t){var n=t.code;t.message,t.data;200===n?(o&&o(),e.refresh(),w.$toast.success(C.tt("del_success","Message"))):a&&a()})})}},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){w.$confirm(C.tt("confirm_del_title","Message"),null!=t?t:C.tt("confirm_del_msg","Message"),function(){z.delResult(e.name(),n,function(){e.refresh(),w.$toast.success(C.tt("del_success","Message"))}).then()})}};function Y(e){return Object.entries(e).map(function(e){var t=p(e,2),n=t[0],r=t[1];return"".concat(r[0],"(").concat(n,")")}).join(",")}function X(e){var n,r=[],i=new Map,o=t(e);try{for(o.s();!(n=o.n()).done;){var a,l=n.value,c="",s=l.name,u=y.trim(s,"/").split("/");u.length<=2?c=u[0]:u.length>2&&(c=u[0]+"/"+u[1]);var d=i.get(c);null==d&&(d=[]);var f=null!==(a=l.description)&&void 0!==a?a:"";d.push({id:s,text:f+"["+s+"]"}),i.set(c,d)}}catch(e){o.e(e)}finally{o.f()}return i.forEach(function(e,t){r.push({text:t,children:e})}),r}function Q(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var i=Q(e.children,t,n);i>0&&(i===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function J(e){var n,r=[],i=new Map,o=t(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,l="",c=a.description,s=void 0,u=y.trim(c,":").split(":");u.length<=2?l=u[0]:u.length>2&&(l=u[0]+":"+u[1]),u.length>=2&&(s=u[1]);var d=i.get(l);null==d&&(d=[]);var f=a.name;d.push({id:f,text:null!=s?s:f}),i.set(l,d)}}catch(e){o.e(e)}finally{o.f()}return i.forEach(function(e,t){r.push({text:t,children:e})}),r}var Z=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},ee=new(function(){return c(function e(){a(this,e)},[{key:"roles",value:function(){return U().post(W("rbacRoles"))}},{key:"addRole",value:function(e){return U().post(W("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return U().post(W("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return U().post(W("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return U().post(W("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return U().post(W("rbacPermissions"))}},{key:"addPermission",value:function(e){return U().post(W("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return U().post(W("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return U().post(W("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return U().post(W("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return U().post(W("rbacRules"))}},{key:"addRule",value:function(e){return U().post(W("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return U().post(W("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return U().get(W("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return U().post(W("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return U().get(W("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return U().post(W("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return U().post(W("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return U().get(W("rbacGetPermissionsByUser"),{id:e})}}])}()),te=new(function(){return c(function e(){a(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U().post(W("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U().post(W("adminResetPassword"),e)}},{key:"menus",value:function(){return U().post(W("menus"),{})}},{key:"info",value:function(e){return U().post(W("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),ne=new(function(){return c(function e(){a(this,e)},[{key:"initialize",value:function(){return U().post(W("initialize"))}},{key:"getLugData",value:function(e){return U().post(W("langData"),{locale:e})}}])}());function re(e){var t,r=S.useAppDispatch(),i=T.useNavigate(),a=null===(t=S.useAppSelector)||void 0===t?void 0:t.call(S,function(e){return e.app.sidebarCollapsed}),l=S.useAppSelector(function(e){return e.layout}),c=l.tabs,s=l.choices,u=l.choiceId,d=p(v.useState(),2),f=d[0],m=d[1],h=p(v.useState(),2),x=h[0],g=h[1],y=p(v.useState([]),2),b=y[0],j=y[1],C=p(v.useState([]),2),k=C[0],F=C[1],R=v.useMemo(function(){var t;return e.init(w.setSideMenuState(b,s)),m(e.tabs),a?e.menus():[{id:0,text:"",state:"open",children:e.menusById(x||s[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[b,a,x]),A=v.useMemo(function(){return e.init(w.setSideMenuState(b,s)),e.menus()},[b,a]),D=v.useMemo(function(){for(var t=[],n=0;n<k.length;n++){var r=k[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==u,type:2})}for(var i=0;i<c.length;i++){var o=e.getItemById(c[i]);o&&t.push({id:o.id,path:o.path,closable:!0,title:o.text,selected:o.id==u,type:1})}return t},[b,c,u]);return v.useLayoutEffect(function(){o(n().m(function e(){var t,r,i,o,a;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,te.menus();case 1:return t=e.v,r=t.data,j(r.sidebar),F(r.welcome),i=S.Admin.info(),o=i.id,e.n=2,ee.getPermissionsByUser(o);case 2:a=e.v,S.Admin.loadPermissions(a.data);case 3:return e.a(2)}},e)}))()},[]),{collapsed:a,menuList:R,menuAll:A,onMenuSelection:function(t){if(t){var n=e.searchPathIndex(t.id);r(S.sidebarChoice({id:t.id,choices:n})),i({pathname:t.path})}},menuArea:f,setMenuAreaId:g,choiceId:u,menuTabList:D,onTabClosed:function(t){var n=t.props.id,o=D.findIndex(function(e){return e.id==n}),a=void 0;if(-1!==o&&(a=o===D.length-1?D[o-1]:D[o+1]),r(S.removeTab({id:n})),a){var l=e.searchPathIndex(a.id);r(S.sidebarChoice({id:a.id,choices:l})),i({pathname:a.path})}else r(S.saveChoice({choices:[]}))},onTabSelected:function(t){var n=e.searchPathIndex(t.id);r(S.sidebarChoice({id:t.id,choices:n})),i({pathname:t.path})}}}function ie(){var e={location:T.useLocation(),history:S.useAppSelector(function(e){return e.app.historyLocation}),isGuest:function(){return S.Admin.isGuest()},saveHistoryLocation:function(e){return S.App.saveHistoryLocation(e)}};return F.useAppRedirect(e)}function oe(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=F.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:S.Admin.can,OrCan:S.Admin.orCan,Permissions:S.Admin.permissions}),o=S.useAppSelector(function(e){return e.user.version}),a=p(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),l=a[0],c=a[1];return F.useLocalTable({value:l,setValue:c,config:e,checkaccess:i,dependency:r,version:o})}function ae(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=F.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:S.Admin.can,OrCan:S.Admin.orCan,Permissions:S.Admin.permissions}),o=S.useAppSelector(function(e){return e.user.version}),a=p(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),l=a[0],c=a[1];return F.useTable({value:l,setValue:c,config:e,checkaccess:i,dependency:r,version:o})}var le=function(e){var t=e.ctxState,n=e.ctx;return L.jsx(R.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})},ce=function(e){return function(t){return function(n){var r=p(v.useState({}),2),i=r[0],o=r[1],a=p(v.useState({}),2),l=a[0],c=a[1],s=p(v.useState(0),2),d=s[0],f=s[1],m=w.useLocale().locale;return v.useEffect(function(){var t=C.getResourceBundle(m,"Page",e.name);document.title=y.get(t,"title",C.tt("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;c(t||{}),f(d+1)})},[m]),L.jsx(v.Fragment,{children:L.jsx(t,u(u({},n),{},{pageConfig:i,fetchConfig:l,fetchVersion:d}))})}}},se=v.createContext({pageConfig:{},fetchConfig:{}}),ue=function(e){var t=e.ctx,r=e.record,i=e.pageConfig,a=(e.fetchConfig,e.close),l=p(v.useState(),2),c=l[0],s=l[1],u=p(v.useState([]),2),d=u[0],f=u[1],m=v.useRef(null),h=p(v.useState([]),2),x=h[0],g=h[1],y=p(v.useState([]),2),b=y[0],j=y[1],k=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",T),S()},[]);var S=function(){var e=o(n().m(function e(){var t,i,o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ee.roles();case 1:return t=e.v,i=J(t.data||[]),o=[],e.n=2,ee.permissions();case 2:a=e.v,l=X(a.data||[]),c=[],ee.getPermissionsByUser(r.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?b.push(e.name):d.push(e.name)}),Q(l,r,c),s(l),c.forEach(function(e){m.current.checkNode(e)})}}),ee.getRolesByUser(r.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?b.push(e.name):d.push(e.name)}),Q(i,r,o),g(i),o.forEach(function(e){k.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){ee.assignItemToUser({id:r.id,roles:b,permissions:d}).then(function(e){200===e.code&&(w.$toast.success(C.tparam(i,"assign_success","assign permission successfully!")),a())})};return L.jsxs(R.Layout,{style:{width:800,height:500},children:[L.jsx(R.LayoutPanel,{region:"west",style:{width:220},children:L.jsx(R.Panel,{bodyStyle:{padding:"10px",height:"100%"},children:L.jsx(R.Tree,{selectLeafOnly:!0,checkbox:!0,data:x,ref:k,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),j(t)}}})})}),L.jsx(R.LayoutPanel,{region:"center",style:{height:"100%"},children:L.jsx(R.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return L.jsx(R.TextBox,{style:{width:"100%"},placeholder:"Searching...",onChange:function(e){m.current.doFilter(e)}},"assign-permission")},children:L.jsx(R.Tree,{selectLeafOnly:!0,checkbox:!0,data:c,ref:m,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}})})}),L.jsx(R.LayoutPanel,{region:"south",children:L.jsxs("div",{className:"dialog-button",children:[L.jsxs(R.LinkButton,{style:{width:80},onClick:T,children:[" ",C.tparam(i,"submit.text","Submit")," "]}),L.jsxs(R.LinkButton,{style:{width:80},onClick:a,children:[" ",C.tparam(i,"close.text","Close")," "]})]})})]})},de=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(se),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(ue,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},fe=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),r=e.pageConfig,i=e.fetchConfig,o=e.close,a=(e.refs,p(F.useFormMData(n).toArray(),2)),l=a[0],c=(a[1],v.useRef(null));v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){c.current.validate(function(e){if(null==e){var n={username:l.username,phone:l.phone,password:"123456",name:l.name,type:parseInt(l.type)};te.register(n).then(function(e){200===e.code&&(w.$toast.success(C.tt("save success","Message")),t.refresh(),o())})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"username",label:C.tfield(r,"username.label","Username")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"username.placeholder",""),value:l.username})}),L.jsx(R.FormField,{name:"name",label:C.tfield(r,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"phone",label:C.tfield(r,"phone.label","Phone")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"phone.placeholder",""),value:l.phone})}),L.jsx(R.FormField,{name:"type",label:C.tfield(r,"type.label","Type")+":",children:L.jsx(R.ComboBox,{placeholder:C.tfield(r,"yp.placeholder",""),data:Z(i,"admin-type"),value:l.type})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.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",children:C.tparam(r,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==o?void 0:o()},iconCls:"icon-cancel",children:C.tparam(r,"cancel.text","Cancel")})]})]})},pe=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(se),o=i.ctx,a=i.ctxState,l=i.pageConfig,c=i.fetchConfig,s=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(fe,u(u({className:"f-full",ctx:o,ctxState:a,pageConfig:l,fetchConfig:c},n),{},{close:r,refs:s}))})},me=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={username:"",phone:"",status:"",type:""},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",labelWidth:"auto",model:a,labelPosition:"before",children:[L.jsx(R.FormField,{name:"username",label:C.tfield(n,"username.label","Username"),children:L.jsx(R.TextBox,{value:a.username})}),L.jsx(R.FormField,{name:"phone",label:C.tfield(n,"phone.label","Phone"),children:L.jsx(R.TextBox,{value:a.phone})}),L.jsx(R.FormField,{name:"status",label:C.tfield(n,"status.label","Status"),children:L.jsx(R.ComboBox,{data:Z(r,"admin-state"),value:a.status})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"admin-type"),value:a.type})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:a.username,type:"LIKE",filter_empty:!0},{key:"phone",value:a.phone,type:"LIKE",filter_empty:!0},{key:"status",value:a.status,type:"EQ",filter_empty:!0},{key:"type",value:a.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(i),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},he=w.withCheckGrid(R.DataGrid),xe=function(){var e=v.useContext(se),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=(e.version,p(v.useState(0),2)),l=a[0],c=a[1];return v.useEffect(function(){c(l+1)},[n]),L.jsx(L.Fragment,{children:L.jsxs(he,{toolbar:function(){var e={record:{username:"",password:""},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(me,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"id",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:50,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,i=e.originalValue,o=n.props.field;if(console.log(t,n,i),t[o]!==i){var a=null==r?void 0:r.name();z.edit(a,{conditions:[{key:"id",value:t.id}],editor:[{key:o,value:t[o],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?w.$toast.success(C.tt("save_success","Message")):w.$toast.error(n),null==r||r.refresh()})}},children:[L.jsx(R.GridColumn,{field:"id",title:C.tfield(t,"id.label","UserId"),width:"50px"}),L.jsx(R.GridColumn,{field:"username",title:C.tfield(t,"username.label","Username"),width:"80px"}),L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"80px",editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.TextBox,{value:t.name})}}),L.jsx(R.GridColumn,{field:"phone",title:C.tfield(t,"phone.label","Phone"),width:"120px",editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.TextBox,{value:t.phone})}}),L.jsx(R.GridColumn,{field:"status",title:C.tfield(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return M(n,"admin-state",t)},editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.ComboBox,{data:Z(n,"admin-state"),value:t.status+""})}}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return M(n,"admin-type",t)},editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.ComboBox,{data:Z(n,"admin-type"),value:t.type+""})}}),L.jsx(R.GridColumn,{field:"version",title:C.tfield(t,"version.label","Version"),width:"60px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"150px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"150px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"100px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return j.FormDataType.UPDATE,"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.username),L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"assign",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:r,record:n,title:"".concat(C.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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:"100px"})})})]},l)})},ge="admin",ve=[{type:j.CheckAccessEleType.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(e(q(ge))),ye=ce({name:"Admin",fetchConfig:function(){return z.configs(ge)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:ge,fetch:function(e){return z.list(ge,e)},checkAccessItems:ve,defaultPageSize:30});r.ctx.registerEvent("remove",K(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),L.jsx(se.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:i,assigndlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(pe,u({},i)),L.jsx(de,u({},o)),L.jsx(xe,{})]})})}),be=v.createContext({pageConfig:{},fetchConfig:{}}),je=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=e.fetchConfig,a=e.close,l=e.refs,c=p(F.useFormMData(r).toArray(),2),s=c[0],u=c[1],d=v.useRef(null),f=v.useMemo(function(){var e;return new k.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:C.tparam(i,"none_parent","None Parent"),children:[]})},[t.config.data]);v.useEffect(function(){t.setMethod("submitForm",m),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;u({router_name:t.name,url:t.url}),y.invoke(l,"routerlistdlg.close")})},[]);var m=function(){d.current.validate(function(e){if(null==e){var i={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===j.FormDataType.UPDATE&&i.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),a()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:d,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"title",label:C.tfield(i,"title.label","Title")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"title.placeholder",""),value:s.title})}),L.jsx(R.FormField,{name:"router_name",label:C.tfield(i,"router_name.label","Router Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"router_name.placeholder",""),value:s.router_name,addonRight:function(){var e={title:C.tparam(i,"router_title","Router List")};return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return y.invoke(l,"routerlistdlg.open",e)}})})}})}),L.jsx(R.FormField,{name:"icon",label:C.tfield(i,"icon.label","Icon")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"icon.placeholder",""),value:s.icon})}),L.jsx(R.FormField,{name:"active",label:C.tfield(i,"active.label","Status")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"switch-state"),name:"switch-state",value:s.active,onChange:function(e,t){u({active:e})}})}),L.jsx(R.FormField,{name:"type",label:C.tfield(i,"type.label","Type")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"setting-type"),name:"setting-type",value:s.type,onChange:function(e,t){u({type:e})}})}),L.jsx(R.FormField,{name:"position",label:C.tfield(i,"position.label","Position")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"setting-position"),name:"setting-position",value:s.position,onChange:function(e,t){u({position:e})}})}),L.jsx(R.FormField,{name:"sort",label:C.tfield(i,"sort.label","Sort")+":",children:L.jsx(R.NumberBox,{placeholder:C.tfield(i,"sort.placeholder",""),value:s.sort})}),L.jsx(R.FormField,{name:"pid",label:C.tfield(i,"pid.label","Pid")+":",children:L.jsx(R.ComboTree,{placeholder:C.tfield(i,"pid.placeholder",""),editable:!0,data:f,value:s.pid,onChange:function(e){return u({pid:e})}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:m,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:a,children:C.tparam(i,"close.text","Close")})]})]})},Ce=v.createContext({pageConfig:{},fetchConfig:{}}),ke=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=e.fetchConfig,a=e.close,l=(e.refs,p(F.useFormMData(r).toArray(),2)),c=l[0],s=l[1],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){if(null==e){var i={object:{name:c.name,url:c.url,type:c.type,data:c.data},conditions:[]};n===j.FormDataType.UPDATE&&(i.conditions.push({key:"name",value:r.name}),i.conditions.push({key:"type",value:r.type})),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),a()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:c.name})}),L.jsx(R.FormField,{name:"url",label:C.tfield(i,"url.label","Url")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"url.placeholder",""),value:c.url})}),L.jsx(R.FormField,{name:"type",label:C.tfield(i,"type.label","Type")+":",children:L.jsx(w.RadioGroupBox,{name:"router-type",value:c.type,options:Z(o,"router-type"),onChange:function(e,t){s({type:e})}})}),L.jsx(R.FormField,{name:"data",label:C.tfield(i,"data.label","Data")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"data.placeholder",""),value:c.data})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:d,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:a,children:C.tparam(i,"close.text","Close")})]})]})},we=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ce),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(ke,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))})},Se=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={name:"",type:""},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:a,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:a.name})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"router-type"),value:a.type})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:a.name,type:"LIKE"},{key:"type",value:a.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(u({},i)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},Te=function(e){var t=e.selectedRow,n=e.scene,r=v.useContext(Ce),i=r.pageConfig,o=r.fetchConfig,a=r.ctx,l=r.ctxState,c=r.refs,s=p(v.useState(0),2),u=s[0],d=s[1],f=function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(Se,{ctx:a,pageConfig:i,fetchConfig:o})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()},children:C.tparam(i,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:a,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(c,"formDataRefDlg.open",{type:j.FormDataType.CREATE,ctx:a,record:{name:""},title:C.tparam(i,"add.text","Create Router")})},children:C.tparam(i,"add.text","Add")})})]})]})},m=function(e){e.value;var t=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:a,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(c,"formDataRefDlg.open",{ctx:a,record:t,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(i,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:a,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==a?void 0:a.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(){d(u+1)},[o]),"setting"===n?L.jsxs(R.DataGrid,{toolbar:f,data:(null==l?void 0:l.data)||[],loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,onCellDblClick:t,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(i,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(i,"type.label","URL"),align:"center",render:O}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(i,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(o,"router-type",t)}}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"120px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:m,width:"120px"})})})]},u):L.jsxs(R.DataGrid,{toolbar:f,data:(null==l?void 0:l.data)||[],loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(i,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(i,"url.label","URL"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(i,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(o,"router-type",t)}}),L.jsx(R.GridColumn,{field:"data",title:C.tfield(i,"data.label","Data")}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(i,"create_time.label","CreateTime"),width:"180px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(i,"update_time.label","UpdateTime"),width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"120px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:m,width:"120px"})})})]},u)},Fe="router",Re=[{type:j.CheckAccessEleType.AND,value:["/resource/router/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/router/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/router/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/router/edit"],key:"edit"}],Ae=ce({name:"Router",fetchConfig:function(){return z.configs(Fe)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,i=e.scene,o=ae({name:Fe,fetch:function(e){return z.list(Fe,e)},checkAccessItems:Re,defaultPageSize:20});v.useEffect(function(){o.ctx.search()},[o.version]),o.ctx.registerEvent("remove",K(o.ctx));var a=w.useRefDialog();return L.jsx(Ce.Provider,{value:{ctx:o.ctx,ctxState:o.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:o.ctx,ctxState:o.ctxState})},children:[L.jsx(we,u({},a)),L.jsx(Te,{selectedRow:r,scene:i})]})})}),De=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(be),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(je,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))})},Ee=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(be).ctx);return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800},children:L.jsx("div",{className:"f-full",style:{paddingTop:"8px"},children:L.jsx(Ae,{selectedRow:function(e){var t,n=e.row,i=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:i})},scene:"setting"})})})},_e=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={position:void 0,active:void 0,title:"",type:void 0},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:a,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"title",label:C.tfield(n,"title.label","Title"),children:L.jsx(R.TextBox,{value:a.title})}),L.jsx(R.FormField,{name:"active",label:C.tfield(n,"active.label","Active"),children:L.jsx(R.ComboBox,{data:Z(r,"switch-state"),value:a.active})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"setting-type"),value:a.type})}),L.jsx(R.FormField,{name:"position",label:C.tfield(n,"position.label","Position"),children:L.jsx(R.ComboBox,{data:Z(r,"setting-position"),value:a.position})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:a.position,type:"="},{key:"type",value:a.type,type:"="},{key:"active",value:a.active,type:"="},{key:"title",value:a.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(u({},i)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},Pe=function(e){var t=e.pageVersion,n=v.useContext(be),r=n.pageConfig,i=n.fetchConfig,o=n.ctx,a=n.ctxState,l=n.refs;return L.jsxs(R.TreeGrid,{toolbar:function(){return function(e,t,n,r){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(_e,{ctx:n,pageConfig:e,fetchConfig:t})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()},children:C.tparam(e,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:n,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(r,"formdlg.open",{type:j.FormDataType.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:C.tparam(e,"add.text","Create Setting")})},children:C.tparam(e,"add.text","Add")})})]})]})}(r,i,o,l)},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",treeField:"title",children:[L.jsx(R.GridColumn,{field:"title",title:C.tfield(r,"title.label","Title"),width:"220px"}),L.jsx(R.GridColumn,{field:"icon",title:C.tfield(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return L.jsx("span",{className:"iconfont "+t})}}),L.jsx(R.GridColumn,{field:"active",title:C.tfield(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return M(i,"switch-state",t)}}),L.jsx(R.GridColumn,{field:"position",title:C.tfield(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return M(i,"setting-position",t)}}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(i,"setting-type",t)}}),L.jsx(R.GridColumn,{field:"router_name",title:C.tfield(r,"router_name.label","RouterName"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(r,"url.label","URL"),align:"left",width:"300px"}),L.jsx(R.GridColumn,{field:"sort",title:C.tfield(r,"sort.label","Sort"),align:"left",width:"80px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(r,"create_time.label","CreateTime"),width:"180px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(r,"update_time.label","UpdateTime"),width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:o,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:o,record:t,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:o,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==o?void 0:o.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},"tree-table-"+t)},Be="setting",Le=[{type:j.CheckAccessEleType.AND,value:["/resource/setting/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/edit"],key:"edit"}],Ne=ce({name:"Setting",fetchConfig:function(){return z.configs(Be)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,i=oe({name:Be,fetch:function(e){return z.list(Be,e)},checkAccessItems:Le,defaultPageSize:10,isTreeData:!0});i.ctx.registerEvent("remove",K(i.ctx));var o=w.useRefDialog(),a=w.useRefDialog();return v.useEffect(function(){i.ctx.search()},[]),L.jsx(be.Provider,{value:{ctx:i.ctx,ctxState:i.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:o,routerlistdlg:a}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:i.ctx,ctxState:i.ctxState})},children:[L.jsx(De,u({},o)),L.jsx(Ee,u({},a)),L.jsx(Pe,{pageVersion:r})]})})}),Ge=new(function(){return c(function e(){a(this,e)},[{key:"captcha",value:function(){return U().post(W("loginCaptcha"))}},{key:"login",value:(e=o(n().m(function e(t,r,i){var o,a,l;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post(W("loginSubmit"),t);case 1:o=e.v,a=o.code,l=o.data,200===a?r(l,a):i(l,a);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return U().post(W("loginConfig"))}}]);var e}()),Oe=function(e){var t=e.pageConfig,n=e.rules,r=S.useAppDispatch(),i=p(v.useState({username:"",captcha:"",password:"",code:"",token:""}),2),o=i[0],a=i[1],l=ie(),c=function(){Ge.captcha().then(function(e){var t=e.data;a(u(u({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return v.useEffect(function(){c(),l.autoRedirect()},[]),L.jsxs(R.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},children:[L.jsx(R.FormField,{name:"username",children:L.jsx(R.TextBox,{iconCls:"iconfont "+y.get(t.fields,"username.icon","icon-username"),placeholder:y.get(t.fields,"username.placeholder","username..."),value:o.username})}),L.jsx(R.FormField,{name:"password",children:L.jsx(R.PasswordBox,{iconCls:"iconfont "+y.get(t.fields,"password.icon","icon-password"),placeholder:y.get(t.fields,"password.placeholder","password..."),value:o.password})}),L.jsx(R.FormField,{name:"code",children:L.jsx(R.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 L.jsx("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:c})}})}),L.jsx(R.FormField,{children:L.jsx(R.LinkButton,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Ge.login(e,function(e){r(S.login({token:e.token,info:e.user,error:function(){w.$toast.error(y.get(t.params,"tips.loginError"))}})),l.autoRedirect()},function(){c()})},btnCls:"login_btn",children:y.get(t.params,"submit.text","Sign In")})})]})},Ie=function(){var e=w.useLocale(!0),t=e.localeOptions,n=e.changeLocale;return L.jsx(R.MenuButton,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return L.jsx(R.Menu,{children:Object.keys(t).map(function(e,n){return L.jsx(R.MenuItem,{text:t[e],value:e},n)})})},onMenuItemClick:n})},Me=ce({name:"Login",fetchConfig:Ge.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,i=e.rules;return L.jsxs("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{},children:[L.jsx(Ie,{}),L.jsxs("div",{className:"login layui-anim layui-anim-up",children:[L.jsx("h1",{children:null!==(t=r.title)&&void 0!==t?t:n.title}),L.jsx(Oe,{pageConfig:n,fetchConfig:r,rules:i})]})]})}),Ue=v.createContext({pageConfig:{},fetchConfig:{}}),$e=function(t){var r=t.ctx,i=(t.type,t.record),a=t.pageConfig,l=(t.fetchConfig,t.close),c=p(v.useState(),2),s=c[0],u=c[1],d=p(v.useState([]),2),f=d[0],m=d[1],h=v.useRef(null),x=p(v.useState([]),2),g=x[0],y=x[1],b=p(v.useState([]),2),j=b[0],k=b[1],S=v.useRef(null);v.useEffect(function(){null==r||r.setMethod("onSubmit",F),T()},[]);var T=function(){var e=o(n().m(function e(){var t,r,o,a,l,c,s,d,p,m;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ee.roles();case 1:return t=e.v,r=J(t.data||[]),o=[],e.n=2,ee.permissions();case 2:return a=e.v,l=X(a.data||[]),c=[],e.n=3,ee.getChildren({name:i.name});case 3:s=e.v,d=s.code,p=s.data,200===d&&(m=new Set,p&&p.forEach(function(e){m.add(e.name),1==e.item_type?j.push(e.name):f.push(e.name)}),Q(l,m,c),u(l),c.forEach(function(e){h.current.checkNode(e)}),Q(r,m,o),y(r),o.forEach(function(e){S.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){ee.addPermissionChildren({name:i.name,children:[].concat(e(f),e(j))}).then(function(e){200===e.code&&(w.$toast.success(C.tparam(a,"assign_success","assign permission successfully!")),l())})};return L.jsxs(R.Layout,{style:{width:800,height:500},children:[L.jsx(R.LayoutPanel,{region:"west",style:{width:220},children:L.jsx(R.Panel,{bodyStyle:{padding:"10px",height:"100%"},children:L.jsx(R.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)}),k(t)}}})})}),L.jsx(R.LayoutPanel,{region:"center",style:{height:"100%"},children:L.jsx(R.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return L.jsx(R.TextBox,{style:{width:"100%"},placeholder:"Searching...",onChange:function(e){h.current.doFilter(e)}},"assign-permission")},children:L.jsx(R.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)}),m(t)}}})})}),L.jsx(R.LayoutPanel,{region:"south",children:L.jsxs("div",{className:"dialog-button",children:[L.jsxs(R.LinkButton,{style:{width:80},onClick:F,children:[" ",C.tparam(a,"submit.text","Submit")," "]}),L.jsxs(R.LinkButton,{style:{width:80},onClick:l,children:[" ",C.tparam(a,"close.text","Close")," "]})]})})]})},We=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ue),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx($e,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},Ve=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=p(F.useFormData(r).toArray(),2),l=a[0],c=(a[1],p(F.useFormData(r).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){null==e?(n===j.FormDataType.CREATE&&ee.addRole(l).then(function(e){var n=e.code;e.data;200==n&&(w.$toast.success(C.tt("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===j.FormDataType.UPDATE&&ee.updateRole({source_name:c.name,target_name:l.name,description:l.description,rule_name:l.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(w.$toast.success(C.tt("update_role_success","Message","update role successfully!")),t.refresh(),o())})):w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:s,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(i,"description.label","Description")+":",children:L.jsx(R.TextBox,{multiline:!0,placeholder:C.tfield(i,"description.placeholder",""),value:l.description,style:{height:"80px",padding:"5px 2px"}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:u,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o,children:C.tparam(i,"close.text","Close")})]})]})},ze=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ue),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(Ve,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},qe=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(n,"description.label","Description"),children:L.jsx(R.TextBox,{value:o.description})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},He=w.withCheckGrid(R.DataGrid),Ke=function(){var e=v.useContext(Ue),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=e.version;return L.jsxs(He,{toolbar:function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(qe,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){y.invoke(o,"formdlg.open",{type:j.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:C.tparam(t,"add.text","Create Role")})},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"batch-delete",children:L.jsx(R.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?w.$toast.error(C.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ee.batchDeleteRole,params:{names:r.tableSlectionValue()}})},children:C.tparam(t,"batch_remove.text","Batch Remove")})})]})]})},data:(null==i?void 0:i.data)||[],loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"name",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:50,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"220px"}),L.jsx(R.GridColumn,{field:"rule_name",title:C.tfield(t,"rule_name.label","RuleName"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"description",title:C.tfield(t,"description.label","Description"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"180px",render:I,sortable:!0}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:I}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"100px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"assign-permission",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:r,record:n,title:"".concat(C.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})}),L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formdlg.open",{ctx:r,record:n,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ee.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},a)},Ye=[{type:j.CheckAccessEleType.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:j.CheckAccessEleType.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:j.CheckAccessEleType.AND,value:["/rbac/add-role"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/rbac/update-role"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/rbac/delete-role"],key:"delete"}],Xe=ce({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:"roles",fetch:function(e){return ee.roles()},checkAccessItems:Ye,defaultPageSize:30,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",H(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return L.jsx(Ue.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:i,assigndlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(ze,u({},i)),L.jsx(We,u({},o)),L.jsx(Ke,{})]})})}),Qe=v.createContext({pageConfig:{},fetchConfig:{}}),Je=function(e){var t=e.ctx,n=(e.type,e.record),r=e.pageConfig,i=(e.fetchConfig,e.close),o=p(F.useFormData(n).toArray(),1)[0];v.useEffect(function(){null==t||t.setMethod("onSubmit",a)},[]);var a=function(){var e={resource:o.resource,name:o.name};ee.fastAddPermission(e).then(function(e){200===e.code&&(w.$toast.success(C.tt("save_success","Message","Save Success!")),t.refresh(),i())})};return L.jsxs(R.Form,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"resource",label:C.tfield(r,"fast_add_resource.label","Resource")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"fast_add_resource.placeholder",""),value:o.resource})}),L.jsx(R.FormField,{name:"name",label:C.tfield(r,"fast_add_name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"fast_add_name.placeholder",""),value:o.name})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:a,children:C.tparam(r,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:i,children:C.tparam(r,"close.text","Close")})]})]})},Ze=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Qe),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(Je,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},et=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=p(v.useState(r),2),l=a[0],c=(a[1],p(F.useFormData(r).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){null==e?(n===j.FormDataType.CREATE&&ee.addPermission(l).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===j.FormDataType.UPDATE&&ee.updatePermission({source_name:c.name,target_name:l.name,description:l.description,rule_name:l.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:s,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(i,"description.label","Description")+":",children:L.jsx(R.TextBox,{multiline:!0,placeholder:C.tfield(i,"description.placeholder",""),value:l.description,style:{height:"80px",padding:"5px 2px"}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:u,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o,children:C.tparam(i,"close.text","Close")})]})]})},tt=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Qe),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0,children:L.jsx(et,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},nt=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(n,"description.label","Description"),children:L.jsx(R.TextBox,{value:o.description})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},rt=w.withCheckGrid(R.DataGrid),it=function(){var e=v.useContext(Qe),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=e.version;return L.jsxs(rt,{toolbar:function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(nt,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){y.invoke(o,"formdlg.open",{type:j.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:C.tparam(t,"add.text","Create Role")})},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"batch-delete",children:L.jsx(R.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?w.$toast.error(C.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ee.batchDeletePermission,params:{names:r.tableSlectionValue()}})},children:C.tparam(t,"batch_remove.text","Batch Remove")})}),L.jsx(w.Access,{ctx:r,point:"fast-add-permission",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){y.invoke(o,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:C.tparam(t,"fast_add.text","Fast Add")})},children:C.tparam(t,"fast_add.text","Fast Add")})})]})]})},data:(null==i?void 0:i.data)||[],idField:"name",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,lazy:!0,ckWidth:50,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"rule_name",title:C.tfield(t,"rule_name.label","RuleName"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"description",title:C.tfield(t,"description.label","Description"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"180px",render:O,sortable:!0}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:O,sortable:!0}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formdlg.open",{ctx:r,record:n,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ee.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},a)},ot=[{type:j.CheckAccessEleType.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:j.CheckAccessEleType.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:j.CheckAccessEleType.AND,value:["/rbac/add-permission"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/rbac/update-permission"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/rbac/delete-permission"],key:"delete"}],at=ce({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=oe({name:"permissions",fetch:function(e){return ee.permissions()},checkAccessItems:ot,defaultPageSize:50,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]);var i=w.useRefDialog(),o=w.useRefDialog();return r.ctx.registerEvent("remove",H(r.ctx)),L.jsx(Qe.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:i,fastadddlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(tt,u({},i)),L.jsx(Ze,u({},o)),L.jsx(it,{})]})})}),lt=v.createContext({pageConfig:{},fetchConfig:{}}),ct=v.createContext({pageConfig:{},fetchConfig:{}}),st=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{label:"",value:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"label",label:C.tfield(n,"label.label","Label"),children:L.jsx(R.TextBox,{value:o.label})}),L.jsx(R.FormField,{name:"value",label:C.tfield(n,"value.label","Value"),children:L.jsx(R.TextBox,{value:o.value})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},ut=function(){var e=v.useContext(ct),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs;return L.jsx(L.Fragment,{children:L.jsxs(R.DataGrid,{toolbar:function(){var e={record:{data:"",label:"",value:"",sort:0},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(st,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,children:[L.jsx(R.GridColumn,{field:"label",title:C.tfield(t,"label.label","Label"),width:"160px"}),L.jsx(R.GridColumn,{field:"value",title:C.tfield(t,"value.label","Value"),align:"center",width:"180px"}),L.jsx(R.GridColumn,{field:"sort",title:C.tfield(t,"sort.label","Sort"),align:"center",width:"80px"}),L.jsx(R.GridColumn,{field:"data",title:C.tfield(t,"data.label","Data"),align:"center",width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,i=(e.rowIndex,{record:n,ctx:r,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formDataRefDlg.open",i)},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"})})})]})})},dt=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=e.refs,l=p(F.useFormData(r).toArray(),1)[0],c=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",function(e){return s(e)})},[]);var s=function(e){c.current.validate(function(i){if(null==i){var a={object:{id:parseInt(l.id),label:l.label,sign:e,value:l.value,data:l.data,sort:parseInt(l.sort)},conditions:[]};n===j.FormDataType.UPDATE&&a.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,a,function(){w.$toast.success(C.tt("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else w.$toast.error(Y(i))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"label",label:C.tfield(i,"label.label","Label")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"label.placeholder",""),value:l.label})}),L.jsx(R.FormField,{name:"value",label:C.tfield(i,"value.label","Value")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"value.placeholder",""),value:l.value})}),L.jsx(R.FormField,{name:"sort",label:C.tfield(i,"sort.label","Sort")+":",children:L.jsx(R.NumberBox,{placeholder:C.tfield(i,"sort.placeholder",""),value:l.sort||0})}),L.jsx(R.FormField,{name:"data",label:C.tfield(i,"data.label","Data")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"data.placeholder",""),value:l.data,addonRight:function(){return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=a.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}})})}})})]})},ft=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(ct),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsxs(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:[L.jsx("div",{className:"f-full",children:L.jsx(dt,u(u({ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))}),L.jsxs("div",{className:"dialog-button",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:function(){var e;return null==o||null===(e=o.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy",children:C.tparam(a,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon",children:C.tparam(a,"cancel.text","Cancel")})]})]})},pt="dict-item",mt=q(pt),ht=ce({name:"DictItem",fetchConfig:function(){return z.configs(pt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,i=ae({name:pt,fetch:function(e){return z.list(pt,e)},checkAccessItems:mt,fixedConditions:[{key:"sign",value:r}]},r);i.ctx.registerEvent("remove",K(i.ctx));var o=w.useRefDialog({sign:r});return v.useEffect(function(){i.ctx.search()},[]),L.jsx(ct.Provider,{value:{ctx:i.ctx,ctxState:i.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:i.ctx,ctxState:i.ctxState})},children:[L.jsx(ft,u({},o)),L.jsx(ut,{})]})})}),xt=function(e){var t=e.ctx,n=(e.ctxState,e.type),r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=e.refs,l=p(F.useFormData(r).toArray(),1)[0],c=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){c.current.validate(function(e){if(null==e){var i={object:{id:parseInt(l.id),name:l.name,sign:l.sign,remark:l.remark},conditions:[]};n===j.FormDataType.UPDATE&&i.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),o()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"sign",label:C.tfield(i,"sign.label","Sign")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"sign.placeholder",""),disabled:n===j.FormDataType.UPDATE,value:l.sign})}),L.jsx(R.FormField,{name:"remark",label:C.tfield(i,"remark.label","Remark")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"remark.placeholder",""),value:l.remark,addonRight:function(){return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=a.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}})})}})})]})},gt=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(lt));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800},children:L.jsx("div",{className:"f-full",style:{paddingTop:"8px"},children:L.jsx(ht,u({},n))})})},vt=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(lt),o=i.ctx,a=i.ctxState,l=i.pageConfig,c=i.fetchConfig,s=i.refs;return L.jsxs(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:[L.jsx("div",{className:"f-full",children:L.jsx(xt,u(u({ctx:o,ctxState:a,pageConfig:l,fetchConfig:c},n),{},{close:r,refs:s}))}),L.jsxs("div",{className:"dialog-button",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:function(){var e;return null==o||null===(e=o.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy",children:C.tparam(l,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon",children:C.tparam(l,"cancel.text","Cancel")})]})]})},yt=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",sign:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"sign",label:C.tfield(n,"sign.label","Sign"),children:L.jsx(R.TextBox,{value:o.sign})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(r),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},bt=w.withCheckGrid(R.DataGrid),jt=function(){var e=v.useContext(lt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs;return L.jsx(L.Fragment,{children:L.jsxs(bt,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(yt,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"}]}):w.$toast.error(C.tt("checkbox_no_empty","Message"))},children:C.tparam(t,"batch_remove.text","Batch Remove")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"id",ckWidth:50,selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"160px",render:O}),L.jsx(R.GridColumn,{field:"sign",title:C.tfield(t,"sign.label","Sign"),width:"150px",render:O}),L.jsx(R.GridColumn,{field:"remark",title:C.tfield(t,"remark.label","Remark"),width:"180px",render:O}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"120px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"120px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"150px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,i=(e.rowIndex,{record:n,ctx:r,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),a={sign:n.sign,title:C.tparam(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"items",children:L.jsx(R.Tooltip,{content:C.tparam(t,"item_list.text","Dict Item"),position:"top",children:L.jsx(R.LinkButton,{onClick:function(){return y.invoke(o,"dictItemDataRefDlg.open",a)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"})})}),L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formDataRefDlg.open",i)},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"})})})]})})},Ct="dict",kt=[{type:j.CheckAccessEleType.AND,value:["/resource/dict-item/list"],key:"items"}].concat(e(q(Ct))),wt=ce({name:"Dict",fetchConfig:function(){return z.configs(Ct)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:Ct,fetch:function(e){return z.list(Ct,e)},checkAccessItems:kt});r.ctx.registerEvent("remove",K(r.ctx)),r.ctx.registerEvent("batchRemove",K(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),L.jsx(lt.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:i,dictItemDataRefDlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(vt,u({},i)),L.jsx(gt,u({},o)),L.jsx(jt,{})]})})}),St=function(e){var t=p(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 L.jsx("h2",{children:"developing......"})},Tt=v.createContext({}),Ft=function(){var e=w.useTheme(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,S.useAppSelector(function(e){return e.app.theme})),i=v.useRef(null);return v.useEffect(function(){},[]),L.jsxs(L.Fragment,{children:[L.jsx(w.DrawerPanel,{width:"300px",placement:"right",ref:i,children:L.jsx(R.Panel,{style:{width:"300px",height:"100%"},title:C.tt("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"},children:n.map(function(e,n){return L.jsxs("div",{children:[L.jsx(R.RadioButton,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),L.jsx(R.Label,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"},children:C.tt("themes."+e.key,"Setting",e.name)})]},n)})})}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){i.current.toggle()}})]})},Rt=function(){var e=S.useAppSelector(function(e){return e.user.info}),t=S.useAppDispatch(),n=T.useNavigate();return L.jsx(R.MenuButton,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return L.jsx(R.Menu,{noline:!0,children:L.jsx(R.MenuItem,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"})})},onMenuItemClick:function(e){if("exit"==e){var r=C.tt("confirm_logout","Message");w.$confirm("",r,function(){S.Admin.logout(function(){t(S.clearLayoutData()),t(S.saveHistoryLocation({pathname:"/",hash:"",search:""})),n("/login")})})}}})},At=new k.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}}),Dt={border:!1,plain:!0,scrollable:!0,narrow:!1},Et={border:!1,animate:!0,multiple:!0,showCollapsedText:!1};exports.AdminView=ye,exports.AppLayoutContext=Tt,exports.BaseLayout=function(e){T.useNavigate(),S.useAppSelector(function(e){return e.user.info});var t={dispatch:S.useAppDispatch(),useAppSelector:S.useAppSelector},n=re(At),r=n.collapsed,i=n.menuList,o=n.choiceId,a=n.onMenuSelection,l=n.menuArea,c=n.setMenuAreaId,s=n.menuTabList,d=n.onTabClosed,f=n.onTabSelected;return L.jsx(Tt.Provider,{value:t,children:L.jsxs(w.FullBodyLayout,u(u({menus:i,title:C.tt("title","App","Admin"),collapsed:r,sidebarCfg:u(u({},Et),{},{onItemClick:a}),selection:R.treeHelper.findNode(i,"id",o),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,S.setSidebarCollapsed(e))},slots:{barLeft:L.jsx(function(){return L.jsx(v.Fragment,{children:!r&&(null==l?void 0:l.map(function(e,t){return L.jsx(R.LinkButton,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,onClick:function(){return c(e.id)},children:e.text},e.id)}))})},{}),barRight:L.jsx(function(){return L.jsxs(v.Fragment,{children:[L.jsx(Rt,{}),L.jsx(Ie,{}),L.jsx(Ft,{})]})},{}),footer:L.jsx(function(){return L.jsx(v.Fragment,{children:e.footer})},{})},onSideMenuSelection:function(){}},e),{},{children:[L.jsx(function(){return L.jsx(w.TabsPanel,{onTabSelect:f,tabsCfg:Dt,onTabClosed:d,data:s})},{}),L.jsx("div",{className:"admin-tabs-panel-body",children:L.jsx(T.Outlet,{})})]}))})},exports.DictView=wt,exports.HomeView=function(){return L.jsx("h1",{children:"Home!!!!!!!"})},exports.Lazy=function(e){return L.jsx(v.Suspense,{fallback:L.jsx(L.Fragment,{children:"..."}),children:e})},exports.LocaleBarItem=Ie,exports.LoginView=Me,exports.NotFoundView=function(){return L.jsx("h1",{children:"404!!!!!!!"})},exports.PaginationPanel=le,exports.PermissionsView=at,exports.RolesView=Xe,exports.RouterView=Ae,exports.ScreenDesign=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return v.useRef(null),L.jsx(w.DefaultPanel,{mode:"cover",children:L.jsxs(R.Layout,{style:{width:"100%",height:"100%"},children:[L.jsx(R.LayoutPanel,{region:"north",style:{height:50},children:"North Region"}),L.jsx(R.LayoutPanel,{region:"south",style:{height:50},children:"South Region"}),L.jsx(R.LayoutPanel,{region:"west",style:{width:240},children:L.jsx("div",{style:{},children:"West Region"})}),L.jsx(R.LayoutPanel,{region:"east",style:{width:240},children:L.jsx("div",{style:{},children:"East Region"})}),L.jsx(R.LayoutPanel,{region:"center",style:{width:"100%",height:"100%"},children:L.jsx(St,{})})]})})},exports.SettingBarItem=Ft,exports.SettingView=Ne,exports.Tooltip=G,exports.adminService=te,exports.configService=ne,exports.convertToText=Y,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=Z,exports.install=function(e){var t,n,r;n=e.request,N||(N=n),r=null!==(t=e.apis)&&void 0!==t?t:{},$=u(u({},$),r)},exports.permissionTree=X,exports.queryPermissionTress=Q,exports.rbacService=ee,exports.removeEventFn=H,exports.renderDateTime02=I,exports.renderFetchConfigValue=M,exports.renderText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?L.jsx("span",{className:"iconfont "+t,children:e}):L.jsx("span",{children:e})},exports.renderTooltip=O,exports.renderType=function(){return L.jsx("div",{children:"Type"})},exports.resourceAccessItems=q,exports.resourceRemoveEvent=K,exports.resourceService=z,exports.roleTree=J,exports.useAppRedirect=ie,exports.useAppStarter=function(){var e=w.useLocale().locale,t=p(v.useState(),2),n=t[0],r=t[1],i=ie();return v.useEffect(function(){C.setLanguage(e,function(){r(C.getActivePkg())}),i.autoRedirect()},[]),v.useEffect(function(){r(C.getActivePkg())},[e]),{easyuiLangPkg:n}},exports.useLocalTable=oe,exports.useMenuAndTabData=re,exports.useTable=ae,exports.withDocHoc=ce;
10
+ */function B(){return E||(E=1,"production"!==process.env.NODE_ENV&&function(){var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator;var h=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];!function(e,t,n){var r=h.ReactDebugCurrentFrame,i=r.getStackAddendum();""!==i&&(t+="%s",n=n.concat([i]));var o=n.map(function(e){return String(e)});o.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,o)}("error",e,n)}var y;function b(e){return e.displayName||"Context"}function j(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case s:return"Suspense";case u:return"SuspenseList"}if("object"===x(e))switch(e.$$typeof){case l:return b(e)+".Consumer";case a:return b(e._context)+".Provider";case c:return function(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||"";return""!==i?n+"("+i+")":n}(e,e.render,"ForwardRef");case d:var t=e.displayName||null;return null!==t?t:j(e.type)||"Memo";case f:var p=e,m=p._payload,h=p._init;try{return j(h(m))}catch(e){return null}}return null}y=Symbol.for("react.module.reference");var C,k,w,S,T,F,R,A=Object.assign,D=0;function E(){}E.__reactDisabledLog=!0;var _,B=h.ReactCurrentDispatcher;function L(e,t,n){if(void 0===_)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);_=r&&r[1]||""}return"\n"+_+e}var N,G=!1,O="function"==typeof WeakMap?WeakMap:Map;function I(e,t){if(!e||G)return"";var n,r=N.get(e);if(void 0!==r)return r;G=!0;var i,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=B.current,B.current=null,function(){if(0===D){C=console.log,k=console.info,w=console.warn,S=console.error,T=console.group,F=console.groupCollapsed,R=console.groupEnd;var e={configurable:!0,enumerable:!0,value:E,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}();try{if(t){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),"object"===("undefined"==typeof Reflect?"undefined":x(Reflect))&&Reflect.construct){try{Reflect.construct(a,[])}catch(e){n=e}Reflect.construct(e,[],a)}else{try{a.call()}catch(e){n=e}e.call(a.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var l=t.stack.split("\n"),c=n.stack.split("\n"),s=l.length-1,u=c.length-1;s>=1&&u>=0&&l[s]!==c[u];)u--;for(;s>=1&&u>=0;s--,u--)if(l[s]!==c[u]){if(1!==s||1!==u)do{if(s--,--u<0||l[s]!==c[u]){var d="\n"+l[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&N.set(e,d),d}}while(s>=1&&u>=0);break}}}finally{G=!1,B.current=i,function(){if(0===--D){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},e,{value:C}),info:A({},e,{value:k}),warn:A({},e,{value:w}),error:A({},e,{value:S}),group:A({},e,{value:T}),groupCollapsed:A({},e,{value:F}),groupEnd:A({},e,{value:R})})}D<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=o}var f=e?e.displayName||e.name:"",p=f?L(f):"";return"function"==typeof e&&N.set(e,p),p}function M(e,t,n){if(null==e)return"";if("function"==typeof e)return I(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if("string"==typeof e)return L(e);switch(e){case s:return L("Suspense");case u:return L("SuspenseList")}if("object"===x(e))switch(e.$$typeof){case c:return I(e.render,!1);case d:return M(e.type,t,n);case f:var i=e,o=i._payload,a=i._init;try{return M(a(o),t,n)}catch(e){}}return""}N=new O;var U=Object.prototype.hasOwnProperty,$={},W=h.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);W.setExtraStackFrame(n)}else W.setExtraStackFrame(null)}var z=Array.isArray;function q(e){return z(e)}function H(e){return""+e}function K(e){if(function(e){try{return H(e),!1}catch(e){return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),H(e)}var Y,X,Q=h.ReactCurrentOwner,J={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,n,r,i,o){var a,l={},c=null,s=null;for(a in void 0!==r&&(K(r),c=""+r),function(e){if(U.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(K(n.key),c=""+n.key),function(e){if(U.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(n)&&(s=n.ref,function(e){"string"==typeof e.ref&&Q.current}(n)),n)U.call(n,a)&&!J.hasOwnProperty(a)&&(l[a]=n[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)void 0===l[a]&&(l[a]=u[a])}if(c||s){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;c&&function(e,t){var n=function(){Y||(Y=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(l,d),s&&function(e,t){var n=function(){X||(X=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(l,d)}return function(e,n,r,i,o,a,l){var c={$$typeof:t,type:e,key:n,ref:r,props:l,_owner:a,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}(e,c,s,o,i,Q.current,l)}var ee,te=h.ReactCurrentOwner,ne=h.ReactDebugCurrentFrame;function re(e){if(e){var t=e._owner,n=M(e.type,e._source,t?t.type:null);ne.setExtraStackFrame(n)}else ne.setExtraStackFrame(null)}function ie(e){return"object"===x(e)&&null!==e&&e.$$typeof===t}function oe(){if(te.current){var e=j(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var ae={};function le(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=oe();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ae[n]){ae[n]=!0;var r="";e&&e._owner&&e._owner!==te.current&&(r=" It was passed a child from "+j(e._owner.type)+"."),re(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,r),re(null)}}}function ce(e,t){if("object"===x(e))if(q(e))for(var n=0;n<e.length;n++){var r=e[n];ie(r)&&le(r,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!==x(e))return null;var t=m&&e[m]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var o,a=i.call(e);!(o=a.next()).done;)ie(o.value)&&le(o.value,t)}}function se(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!==x(n)||n.$$typeof!==c&&n.$$typeof!==d)return;t=n.propTypes}if(t){var r=j(n);!function(e,t,n,r,i){var o=Function.call.bind(U);for(var a in e)if(o(e,a)){var l=void 0;try{if("function"!=typeof e[a]){var c=Error((r||"React class")+": "+n+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+x(e[a])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}l=e[a](t,a,r,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){l=e}!l||l instanceof Error||(V(i),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,a,x(l)),V(null)),l instanceof Error&&!(l.message in $)&&($[l.message]=!0,V(i),g("Failed %s type: %s",n,l.message),V(null))}}(t,e.props,"prop",r,e)}else if(void 0!==n.PropTypes&&!ee){ee=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",j(n)||"Unknown")}"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var ue={};function de(e,n,m,h,v,b){var C=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===o||e===i||e===s||e===u||e===p||"object"===x(e)&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===y||void 0!==e.getModuleId)}(e);if(!C){var k="";(void 0===e||"object"===x(e)&&null!==e&&0===Object.keys(e).length)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w;k+=oe(),null===e?w="null":q(e)?w="array":void 0!==e&&e.$$typeof===t?(w="<"+(j(e.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):w=x(e),g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,k)}var S=Z(e,n,m,v,b);if(null==S)return S;if(C){var T=n.children;if(void 0!==T)if(h)if(q(T)){for(var F=0;F<T.length;F++)ce(T[F],e);Object.freeze&&Object.freeze(T)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ce(T,e)}if(U.call(n,"key")){var R=j(e),A=Object.keys(n).filter(function(e){return"key"!==e}),D=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!ue[R+D])g('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',D,R,A.length>0?"{"+A.join(": ..., ")+": ...}":"{}",R),ue[R+D]=!0}return e===r?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){re(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r),re(null);break}}null!==e.ref&&(re(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),re(null))}(S):se(S),S}var fe=function(e,t,n){return de(e,t,n,!1)},pe=function(e,t,n){return de(e,t,n,!0)};P.Fragment=r,P.jsx=fe,P.jsxs=pe}()),P}var L=(_||(_=1,"production"===process.env.NODE_ENV?A.exports=function(){if(g)return D;g=1;var e=v,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var l,c={},s=null,u=null;for(l in void 0!==a&&(s=""+a),void 0!==n.key&&(s=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,l)&&!o.hasOwnProperty(l)&&(c[l]=n[l]);if(e&&e.defaultProps)for(l in n=e.defaultProps)void 0===c[l]&&(c[l]=n[l]);return{$$typeof:t,type:e,key:s,ref:u,props:c,_owner:i.current}}return D.Fragment=n,D.jsx=a,D.jsxs=a,D}():A.exports=B()),A.exports);var N,G=function(e){var t=e.text,n=e.children,r=e.position,i=void 0===r?"bottom":r,o=e.trigger,a=void 0===o?"hover":o,l=e.delay,c=void 0===l?50:l,s=e.maxWidth,d=void 0===s?250:s,f=e.theme,m=void 0===f?"dark":f,h=e.followMouse,x=void 0!==h&&h,g=e.autoFlip,y=void 0===g||g,j=function(){var e=v.useRef(null),t=p(v.useState(!1),2),n=t[0],r=t[1];return v.useEffect(function(){var t=e.current;if(t){var n=function(){return r(t.scrollWidth>t.clientWidth)};return n(),window.addEventListener("resize",n),function(){return window.removeEventListener("resize",n)}}},[]),[e,n]}(),C=p(j,2),k=C[0],w=C[1],S=p(v.useState(!1),2),T=S[0],F=S[1],R=p(v.useState({top:0,left:0}),2),A=R[0],D=R[1],E=p(v.useState(i),2),_=E[0],P=E[1],B=v.useRef(0),N=function(e){if(k.current){var t=k.current.getBoundingClientRect(),n=y?function(e,t){var n=e.top,r=window.innerHeight-e.bottom,i=e.left,o=window.innerWidth-e.right;return"top"===t&&n<80?"bottom":"bottom"===t&&r<80?"top":"left"===t&&i<120?"right":"right"===t&&o<120?"left":t}(t,i):i;P(n);var r=0,o=0;if(x&&e)r=e.clientY+12,o=e.clientX+12;else switch(n){case"top":r=t.top+window.scrollY-8,o=t.left+t.width/2+window.scrollX;break;case"bottom":r=t.bottom+window.scrollY+8,o=t.left+t.width/2+window.scrollX;break;case"left":r=t.top+t.height/2+window.scrollY,o=t.left+window.scrollX-8;break;case"right":r=t.top+t.height/2+window.scrollY,o=t.right+window.scrollX+8}D({top:r,left:o})}},G=function(e){B.current=window.setTimeout(function(){N(e),F(!0)},c)},O=function(){clearTimeout(B.current),F(!1)},I={};"hover"===a&&(I.onMouseEnter=w?G:void 0,I.onMouseLeave=w?O:void 0,x&&(I.onMouseMove=N)),"click"===a&&(I.onClick=function(){return F(!T)}),"focus"===a&&(I.onFocus=w?G:void 0,I.onBlur=w?O:void 0);var M=T&&w?b.createPortal(L.jsxs("div",{className:"easyui-tooltip easyui-tooltip-".concat(m),style:{top:A.top,left:A.left,maxWidth:d,transform:function(){switch(_){case"top":return"translate(-50%, -100%)";case"bottom":return"translate(-50%, 0)";case"left":return"translate(-100%, -50%)";case"right":return"translate(0, -50%)"}}()},children:[t,L.jsx("div",{className:"easyui-tooltip-arrow",style:function(){switch(_){case"top":return{bottom:-4,left:"50%",transform:"translateX(-50%) rotate(45deg)"};case"bottom":return{top:-4,left:"50%",transform:"translateX(-50%) rotate(45deg)"};case"left":return{right:-4,top:"50%",transform:"translateY(-50%) rotate(45deg)"};case"right":return{left:-4,top:"50%",transform:"translateY(-50%) rotate(45deg)"}}}()})]}),document.body):null;return L.jsxs(L.Fragment,{children:[L.jsx("div",u(u({ref:k,className:"easyui-tooltip-trigger"},I),{},{style:{width:"100%"},children:n})),M]})},O=function(e){var t=e.value;return t?L.jsx(G,{text:t,position:"bottom",children:L.jsx("span",{children:t})}):""},I=function(e){return e.value.replace("T"," ").replace("Z","")},M=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",i=y.get(e,t,[]);for(var o in i){var a=i[o];if(a.value==n)return a.label}return r};function U(){return N}new k.MenuService;var $={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 W(e){return $[e]}var V=function(){return c(function e(){a(this,e)},[{key:"result",value:function(e,t,n,r,i,o){200===e&&i&&i(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),i=r?"resource/".concat(e,"/list?").concat(r):"resource/".concat(e,"/list");return U().post(i,n)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(l=o(n().m(function e(t){var r,i,o,a,l,c,s,u=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:{},i=u.length>2?u[2]:void 0,e.n=1,U().post("resource/".concat(t,"/list"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,s=o.count,this.result(a,l,c,s,i);case 2:return e.a(2)}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(i=o(n().m(function e(t){var r,i,o,a,l,c,s=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},i=s.length>2?s[2]:void 0,e.n=1,U().post("resource/".concat(t,"/configs"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);case 2:return e.a(2)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"edit",value:function(e,t){return U().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(r=o(n().m(function e(t,r,i){var o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post("resource/".concat(t,"/edit"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);case 2:return e.a(2)}},e,this)})),function(e,t,n){return r.apply(this,arguments)})},{key:"add",value:function(e,t){return U().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return U().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=o(n().m(function e(t,r,i,o){var a,l,c,s,u,d,f,p;return n().w(function(e){for(;;)switch(e.n){case 0:if(r!==j.FormDataType.CREATE){e.n=2;break}return e.n=1,this.add(t,i);case 1:a=e.v,l=a.code,c=a.message,s=a.data,this.result(l,c,s,0,o),e.n=4;break;case 2:if(r!==j.FormDataType.UPDATE){e.n=4;break}return e.n=3,this.update(t,i);case 3:u=e.v,d=u.code,f=u.message,p=u.data,this.result(d,f,p,0,o);case 4:return e.a(2)}},e,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return U().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=o(n().m(function e(t,r,i){var o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post("resource/".concat(t,"/delete"),r);case 1:o=e.v,a=o.code,l=o.message,c=o.data,this.result(a,l,c,0,i);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 U().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 U().post("resource/".concat(e,"/download"),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,{responseType:"blob"}).then(function(e){var t=new Blob([e.data],{type:"application/octet-stream"}),r=URL.createObjectURL(t),i=document.createElement("a");i.href=r,i.download=n+".xlsx",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)})}}]);var e,t,r,i,l}(),z=new V,q=function(e){return[{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/edit"],key:"edit"},{type:j.CheckAccessEleType.AND,value:["/resource/"+e+"/download"],key:"output"}]},H=function(e,t){return function(n){var r=n.fn,i=n.params,o=n.success,a=n.error;w.$confirm(C.tt("confirm_del_title","Message"),null!=t?t:C.tt("confirm_del_msg","Message"),function(){r(i).then(function(t){var n=t.code;t.message,t.data;200===n?(o&&o(),e.refresh(),w.$toast.success(C.tt("del_success","Message"))):a&&a()})})}},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return function(n){w.$confirm(C.tt("confirm_del_title","Message"),null!=t?t:C.tt("confirm_del_msg","Message"),function(){z.delResult(e.name(),n,function(){e.refresh(),w.$toast.success(C.tt("del_success","Message"))}).then()})}};function Y(e){return Object.entries(e).map(function(e){var t=p(e,2),n=t[0],r=t[1];return"".concat(r[0],"(").concat(n,")")}).join(",")}function X(e){var n,r=[],i=new Map,o=t(e);try{for(o.s();!(n=o.n()).done;){var a,l=n.value,c="",s=l.name,u=y.trim(s,"/").split("/");u.length<=2?c=u[0]:u.length>2&&(c=u[0]+"/"+u[1]);var d=i.get(c);null==d&&(d=[]);var f=null!==(a=l.description)&&void 0!==a?a:"";d.push({id:s,text:f+"["+s+"]"}),i.set(c,d)}}catch(e){o.e(e)}finally{o.f()}return i.forEach(function(e,t){r.push({text:t,children:e})}),r}function Q(e,t,n){var r=0;return e.forEach(function(e){if(e.children&&e.children.length>0){var i=Q(e.children,t,n);i>0&&(i===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)}),r}function J(e){var n,r=[],i=new Map,o=t(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,l="",c=a.description,s=void 0,u=y.trim(c,":").split(":");u.length<=2?l=u[0]:u.length>2&&(l=u[0]+":"+u[1]),u.length>=2&&(s=u[1]);var d=i.get(l);null==d&&(d=[]);var f=a.name;d.push({id:f,text:null!=s?s:f}),i.set(l,d)}}catch(e){o.e(e)}finally{o.f()}return i.forEach(function(e,t){r.push({text:t,children:e})}),r}var Z=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},ee=new(function(){return c(function e(){a(this,e)},[{key:"roles",value:function(){return U().post(W("rbacRoles"))}},{key:"addRole",value:function(e){return U().post(W("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return U().post(W("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return U().post(W("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return U().post(W("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return U().post(W("rbacPermissions"))}},{key:"addPermission",value:function(e){return U().post(W("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return U().post(W("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return U().post(W("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return U().post(W("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return U().post(W("rbacRules"))}},{key:"addRule",value:function(e){return U().post(W("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return U().post(W("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return U().get(W("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return U().post(W("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return U().get(W("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return U().post(W("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return U().post(W("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return U().get(W("rbacGetPermissionsByUser"),{id:e})}}])}()),te=new(function(){return c(function e(){a(this,e)},[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U().post(W("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return U().post(W("adminResetPassword"),e)}},{key:"menus",value:function(){return U().post(W("menus"),{})}},{key:"info",value:function(e){return U().post(W("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),ne=new(function(){return c(function e(){a(this,e)},[{key:"initialize",value:function(){return U().post(W("initialize"))}},{key:"getLugData",value:function(e){return U().post(W("langData"),{locale:e})}}])}());function re(e){var t,r=S.useAppDispatch(),i=T.useNavigate(),a=null===(t=S.useAppSelector)||void 0===t?void 0:t.call(S,function(e){return e.app.sidebarCollapsed}),l=S.useAppSelector(function(e){return e.layout}),c=l.tabs,s=l.choices,u=l.choiceId,d=p(v.useState(),2),f=d[0],m=d[1],h=p(v.useState(),2),x=h[0],g=h[1],y=p(v.useState([]),2),b=y[0],j=y[1],C=p(v.useState([]),2),k=C[0],F=C[1],R=v.useMemo(function(){var t;return e.init(w.setSideMenuState(b,s)),m(e.tabs),a?e.menus():[{id:0,text:"",state:"open",children:e.menusById(x||s[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]},[b,a,x]),A=v.useMemo(function(){return e.init(w.setSideMenuState(b,s)),e.menus()},[b,a]),D=v.useMemo(function(){for(var t=[],n=0;n<k.length;n++){var r=k[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==u,type:2})}for(var i=0;i<c.length;i++){var o=e.getItemById(c[i]);o&&t.push({id:o.id,path:o.path,closable:!0,title:o.text,selected:o.id==u,type:1})}return t},[b,c,u]);return v.useLayoutEffect(function(){o(n().m(function e(){var t,r,i,o,a;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,te.menus();case 1:return t=e.v,r=t.data,j(r.sidebar),F(r.welcome),i=S.Admin.info(),o=i.id,e.n=2,ee.getPermissionsByUser(o);case 2:a=e.v,S.Admin.loadPermissions(a.data);case 3:return e.a(2)}},e)}))()},[]),{collapsed:a,menuList:R,menuAll:A,onMenuSelection:function(t){if(t){var n=e.searchPathIndex(t.id);r(S.sidebarChoice({id:t.id,choices:n})),i({pathname:t.path})}},menuArea:f,setMenuAreaId:g,choiceId:u,menuTabList:D,onTabClosed:function(t){var n=t.props.id,o=D.findIndex(function(e){return e.id==n}),a=void 0;if(-1!==o&&(a=o===D.length-1?D[o-1]:D[o+1]),r(S.removeTab({id:n})),a){var l=e.searchPathIndex(a.id);r(S.sidebarChoice({id:a.id,choices:l})),i({pathname:a.path})}else r(S.saveChoice({choices:[]}))},onTabSelected:function(t){var n=e.searchPathIndex(t.id);r(S.sidebarChoice({id:t.id,choices:n})),i({pathname:t.path})}}}function ie(){var e={location:T.useLocation(),history:S.useAppSelector(function(e){return e.app.historyLocation}),isGuest:function(){return S.Admin.isGuest()},saveHistoryLocation:function(e){return S.App.saveHistoryLocation(e)}};return F.useAppRedirect(e)}function oe(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=F.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:S.Admin.can,OrCan:S.Admin.orCan,Permissions:S.Admin.permissions}),o=S.useAppSelector(function(e){return e.user.version}),a=p(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),l=a[0],c=a[1];return F.useLocalTable({value:l,setValue:c,config:e,checkaccess:i,dependency:r,version:o})}function ae(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=F.useCheckAccess(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:S.Admin.can,OrCan:S.Admin.orCan,Permissions:S.Admin.permissions}),o=S.useAppSelector(function(e){return e.user.version}),a=p(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),l=a[0],c=a[1];return F.useTable({value:l,setValue:c,config:e,checkaccess:i,dependency:r,version:o})}var le=function(e){var t=e.ctxState,n=e.ctx;return L.jsx(R.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})},ce=function(e){return function(t){return function(n){var r=p(v.useState({}),2),i=r[0],o=r[1],a=p(v.useState({}),2),l=a[0],c=a[1],s=p(v.useState(0),2),d=s[0],f=s[1],m=w.useLocale().locale;return v.useEffect(function(){var t=C.getResourceBundle(m,"Page",e.name);document.title=y.get(t,"title",C.tt("title","App")),o(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then(function(e){var t=e.data;c(t||{}),f(d+1)})},[m]),L.jsx(v.Fragment,{children:L.jsx(t,u(u({},n),{},{pageConfig:i,fetchConfig:l,fetchVersion:d}))})}}},se=v.createContext({pageConfig:{},fetchConfig:{}}),ue=function(e){var t=e.ctx,r=e.record,i=e.pageConfig,a=(e.fetchConfig,e.close),l=p(v.useState(),2),c=l[0],s=l[1],u=p(v.useState([]),2),d=u[0],f=u[1],m=v.useRef(null),h=p(v.useState([]),2),x=h[0],g=h[1],y=p(v.useState([]),2),b=y[0],j=y[1],k=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",T),S()},[]);var S=function(){var e=o(n().m(function e(){var t,i,o,a,l,c;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ee.roles();case 1:return t=e.v,i=J(t.data||[]),o=[],e.n=2,ee.permissions();case 2:a=e.v,l=X(a.data||[]),c=[],ee.getPermissionsByUser(r.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?b.push(e.name):d.push(e.name)}),Q(l,r,c),s(l),c.forEach(function(e){m.current.checkNode(e)})}}),ee.getRolesByUser(r.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?b.push(e.name):d.push(e.name)}),Q(i,r,o),g(i),o.forEach(function(e){k.current.checkNode(e)})}});case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),T=function(){ee.assignItemToUser({id:r.id,roles:b,permissions:d}).then(function(e){200===e.code&&(w.$toast.success(C.tparam(i,"assign_success","assign permission successfully!")),a())})};return L.jsxs(R.Layout,{style:{width:800,height:500},children:[L.jsx(R.LayoutPanel,{region:"west",style:{width:220},children:L.jsx(R.Panel,{bodyStyle:{padding:"10px",height:"100%"},children:L.jsx(R.Tree,{selectLeafOnly:!0,checkbox:!0,data:x,ref:k,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),j(t)}}})})}),L.jsx(R.LayoutPanel,{region:"center",style:{height:"100%"},children:L.jsx(R.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return L.jsx(R.TextBox,{style:{width:"100%"},placeholder:"Searching...",onChange:function(e){m.current.doFilter(e)}},"assign-permission")},children:L.jsx(R.Tree,{selectLeafOnly:!0,checkbox:!0,data:c,ref:m,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach(function(e){e.id&&t.push(e.id)}),f(t)}}})})}),L.jsx(R.LayoutPanel,{region:"south",children:L.jsxs("div",{className:"dialog-button",children:[L.jsxs(R.LinkButton,{style:{width:80},onClick:T,children:[" ",C.tparam(i,"submit.text","Submit")," "]}),L.jsxs(R.LinkButton,{style:{width:80},onClick:a,children:[" ",C.tparam(i,"close.text","Close")," "]})]})})]})},de=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(se),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(ue,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},fe=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),r=e.pageConfig,i=e.fetchConfig,o=e.close,a=(e.refs,p(F.useFormMData(n).toArray(),2)),l=a[0],c=(a[1],v.useRef(null));v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){c.current.validate(function(e){if(null==e){var n={username:l.username,phone:l.phone,password:"123456",name:l.name,type:parseInt(l.type)};te.register(n).then(function(e){200===e.code&&(w.$toast.success(C.tt("save success","Message")),t.refresh(),o())})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"username",label:C.tfield(r,"username.label","Username")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"username.placeholder",""),value:l.username})}),L.jsx(R.FormField,{name:"name",label:C.tfield(r,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"phone",label:C.tfield(r,"phone.label","Phone")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"phone.placeholder",""),value:l.phone})}),L.jsx(R.FormField,{name:"type",label:C.tfield(r,"type.label","Type")+":",children:L.jsx(R.ComboBox,{placeholder:C.tfield(r,"yp.placeholder",""),data:Z(i,"admin-type"),value:l.type})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.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",children:C.tparam(r,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==o?void 0:o()},iconCls:"icon-cancel",children:C.tparam(r,"cancel.text","Cancel")})]})]})},pe=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(se),o=i.ctx,a=i.ctxState,l=i.pageConfig,c=i.fetchConfig,s=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(fe,u(u({className:"f-full",ctx:o,ctxState:a,pageConfig:l,fetchConfig:c},n),{},{close:r,refs:s}))})},me=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={username:"",phone:"",status:"",type:""},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",labelWidth:"auto",model:a,labelPosition:"before",children:[L.jsx(R.FormField,{name:"username",label:C.tfield(n,"username.label","Username"),children:L.jsx(R.TextBox,{value:a.username})}),L.jsx(R.FormField,{name:"phone",label:C.tfield(n,"phone.label","Phone"),children:L.jsx(R.TextBox,{value:a.phone})}),L.jsx(R.FormField,{name:"status",label:C.tfield(n,"status.label","Status"),children:L.jsx(R.ComboBox,{data:Z(r,"admin-state"),value:a.status})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"admin-type"),value:a.type})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:a.username,type:"LIKE",filter_empty:!0},{key:"phone",value:a.phone,type:"LIKE",filter_empty:!0},{key:"status",value:a.status,type:"EQ",filter_empty:!0},{key:"type",value:a.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(i),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},he=w.withCheckGrid(R.DataGrid),xe=function(){var e=v.useContext(se),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=(e.version,p(v.useState(0),2)),l=a[0],c=a[1];return v.useEffect(function(){c(l+1)},[n]),L.jsx(L.Fragment,{children:L.jsxs(he,{toolbar:function(){var e={record:{username:"",password:""},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(me,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"id",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:50,editMode:"cell",dblclickToEdit:!0,onEditEnd:function(e){var t=e.row,n=e.column,i=e.originalValue,o=n.props.field;if(console.log(t,n,i),t[o]!==i){var a=null==r?void 0:r.name();z.edit(a,{conditions:[{key:"id",value:t.id}],editor:[{key:o,value:t[o],type:"SETVAL"}]}).then(function(e){var t=e.code,n=e.message;200===t?w.$toast.success(C.tt("save_success","Message")):w.$toast.error(n),null==r||r.refresh()})}},children:[L.jsx(R.GridColumn,{field:"id",title:C.tfield(t,"id.label","UserId"),width:"50px"}),L.jsx(R.GridColumn,{field:"username",title:C.tfield(t,"username.label","Username"),width:"80px"}),L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"80px",editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.TextBox,{value:t.name})}}),L.jsx(R.GridColumn,{field:"phone",title:C.tfield(t,"phone.label","Phone"),width:"120px",editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.TextBox,{value:t.phone})}}),L.jsx(R.GridColumn,{field:"status",title:C.tfield(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return M(n,"admin-state",t)},editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.ComboBox,{data:Z(n,"admin-state"),value:t.status+""})}}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return M(n,"admin-type",t)},editable:null==r?void 0:r.can("update"),editor:function(e){var t=e.row;return L.jsx(R.ComboBox,{data:Z(n,"admin-type"),value:t.type+""})}}),L.jsx(R.GridColumn,{field:"version",title:C.tfield(t,"version.label","Version"),width:"60px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"150px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"150px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"100px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return j.FormDataType.UPDATE,"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.username),L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"assign",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:r,record:n,title:"".concat(C.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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:"100px"})})})]},l)})},ge="admin",ve=[{type:j.CheckAccessEleType.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(e(q(ge))),ye=ce({name:"Admin",fetchConfig:function(){return z.configs(ge)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:ge,fetch:function(e){return z.list(ge,e)},checkAccessItems:ve,defaultPageSize:30});r.ctx.registerEvent("remove",K(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),L.jsx(se.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:i,assigndlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(pe,u({},i)),L.jsx(de,u({},o)),L.jsx(xe,{})]})})}),be=v.createContext({pageConfig:{},fetchConfig:{}}),je=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=e.fetchConfig,a=e.close,l=e.refs,c=p(F.useFormMData(r).toArray(),2),s=c[0],u=c[1],d=v.useRef(null),f=v.useMemo(function(){var e;return new k.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:C.tparam(i,"none_parent","None Parent"),children:[]})},[t.config.data]);v.useEffect(function(){t.setMethod("submitForm",m),t.setMethod("setRouterNameValue",function(e){var t=e.row;e.column;u({router_name:t.name,url:t.url}),y.invoke(l,"routerlistdlg.close")})},[]);var m=function(){d.current.validate(function(e){if(null==e){var i={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===j.FormDataType.UPDATE&&i.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),a()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:d,model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"title",label:C.tfield(i,"title.label","Title")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"title.placeholder",""),value:s.title})}),L.jsx(R.FormField,{name:"router_name",label:C.tfield(i,"router_name.label","Router Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"router_name.placeholder",""),value:s.router_name,addonRight:function(){var e={title:C.tparam(i,"router_title","Router List")};return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return y.invoke(l,"routerlistdlg.open",e)}})})}})}),L.jsx(R.FormField,{name:"icon",label:C.tfield(i,"icon.label","Icon")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"icon.placeholder",""),value:s.icon})}),L.jsx(R.FormField,{name:"active",label:C.tfield(i,"active.label","Status")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"switch-state"),name:"switch-state",value:s.active,onChange:function(e,t){u({active:e})}})}),L.jsx(R.FormField,{name:"type",label:C.tfield(i,"type.label","Type")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"setting-type"),name:"setting-type",value:s.type,onChange:function(e,t){u({type:e})}})}),L.jsx(R.FormField,{name:"position",label:C.tfield(i,"position.label","Position")+":",children:L.jsx(w.RadioGroupBox,{options:Z(o,"setting-position"),name:"setting-position",value:s.position,onChange:function(e,t){u({position:e})}})}),L.jsx(R.FormField,{name:"sort",label:C.tfield(i,"sort.label","Sort")+":",children:L.jsx(R.NumberBox,{placeholder:C.tfield(i,"sort.placeholder",""),value:s.sort})}),L.jsx(R.FormField,{name:"pid",label:C.tfield(i,"pid.label","Pid")+":",children:L.jsx(R.ComboTree,{placeholder:C.tfield(i,"pid.placeholder",""),editable:!0,data:f,value:s.pid,onChange:function(e){return u({pid:e})}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:m,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:a,children:C.tparam(i,"close.text","Close")})]})]})},Ce=v.createContext({pageConfig:{},fetchConfig:{}}),ke=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=e.fetchConfig,a=e.close,l=(e.refs,p(F.useFormMData(r).toArray(),2)),c=l[0],s=l[1],u=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",d)},[]);var d=function(){u.current.validate(function(e){if(null==e){var i={object:{name:c.name,url:c.url,type:c.type,data:c.data},conditions:[]};n===j.FormDataType.UPDATE&&(i.conditions.push({key:"name",value:r.name}),i.conditions.push({key:"type",value:r.type})),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),a()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:u,model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:c.name})}),L.jsx(R.FormField,{name:"url",label:C.tfield(i,"url.label","Url")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"url.placeholder",""),value:c.url})}),L.jsx(R.FormField,{name:"type",label:C.tfield(i,"type.label","Type")+":",children:L.jsx(w.RadioGroupBox,{name:"router-type",value:c.type,options:Z(o,"router-type"),onChange:function(e,t){s({type:e})}})}),L.jsx(R.FormField,{name:"data",label:C.tfield(i,"data.label","Data")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"data.placeholder",""),value:c.data})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:d,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:a,children:C.tparam(i,"close.text","Close")})]})]})},we=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ce),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(ke,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))})},Se=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={name:"",type:""},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:a,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:a.name})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"router-type"),value:a.type})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:a.name,type:"LIKE"},{key:"type",value:a.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(u({},i)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},Te=function(e){var t=e.selectedRow,n=e.scene,r=v.useContext(Ce),i=r.pageConfig,o=r.fetchConfig,a=r.ctx,l=r.ctxState,c=r.refs,s=p(v.useState(0),2),u=s[0],d=s[1],f=function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(Se,{ctx:a,pageConfig:i,fetchConfig:o})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==a?void 0:a.refresh()},children:C.tparam(i,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:a,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(c,"formDataRefDlg.open",{type:j.FormDataType.CREATE,ctx:a,record:{name:""},title:C.tparam(i,"add.text","Create Router")})},children:C.tparam(i,"add.text","Add")})})]})]})},m=function(e){e.value;var t=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:a,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(c,"formDataRefDlg.open",{ctx:a,record:t,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(i,"update.text","Update: {#name}")).replace("{#name}",t.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:a,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==a?void 0:a.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(){d(u+1)},[o]),"setting"===n?L.jsxs(R.DataGrid,{toolbar:f,data:(null==l?void 0:l.data)||[],loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,onCellDblClick:t,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(i,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(i,"type.label","URL"),align:"center",render:O}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(i,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(o,"router-type",t)}}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"120px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:m,width:"120px"})})})]},u):L.jsxs(R.DataGrid,{toolbar:f,data:(null==l?void 0:l.data)||[],loading:null==l?void 0:l.loading,style:null==l?void 0:l.style,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(i,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(i,"url.label","URL"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(i,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(o,"router-type",t)}}),L.jsx(R.GridColumn,{field:"data",title:C.tfield(i,"data.label","Data")}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(i,"create_time.label","CreateTime"),width:"180px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(i,"update_time.label","UpdateTime"),width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"120px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:m,width:"120px"})})})]},u)},Fe="router",Re=[{type:j.CheckAccessEleType.AND,value:["/resource/router/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/router/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/router/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/router/edit"],key:"edit"}],Ae=ce({name:"Router",fetchConfig:function(){return z.configs(Fe)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,i=e.scene,o=ae({name:Fe,fetch:function(e){return z.list(Fe,e)},checkAccessItems:Re,defaultPageSize:20});v.useEffect(function(){o.ctx.search()},[o.version]),o.ctx.registerEvent("remove",K(o.ctx));var a=w.useRefDialog();return L.jsx(Ce.Provider,{value:{ctx:o.ctx,ctxState:o.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:o.ctx,ctxState:o.ctxState})},children:[L.jsx(we,u({},a)),L.jsx(Te,{selectedRow:r,scene:i})]})})}),De=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(be),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(je,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))})},Ee=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(be).ctx);return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800},children:L.jsx("div",{className:"f-full",style:{paddingTop:"8px"},children:L.jsx(Ae,{selectedRow:function(e){var t,n=e.row,i=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:i})},scene:"setting"})})})},_e=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,i={position:void 0,active:void 0,title:"",type:void 0},o=p(v.useState(i),2),a=o[0],l=o[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:a,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"title",label:C.tfield(n,"title.label","Title"),children:L.jsx(R.TextBox,{value:a.title})}),L.jsx(R.FormField,{name:"active",label:C.tfield(n,"active.label","Active"),children:L.jsx(R.ComboBox,{data:Z(r,"switch-state"),value:a.active})}),L.jsx(R.FormField,{name:"type",label:C.tfield(n,"type.label","Type"),children:L.jsx(R.ComboBox,{data:Z(r,"setting-type"),value:a.type})}),L.jsx(R.FormField,{name:"position",label:C.tfield(n,"position.label","Position"),children:L.jsx(R.ComboBox,{data:Z(r,"setting-position"),value:a.position})}),L.jsxs(R.FormField,{children:[L.jsx(R.LinkButton,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:a.position,type:"="},{key:"type",value:a.type,type:"="},{key:"active",value:a.active,type:"="},{key:"title",value:a.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){l(u({},i)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},Pe=function(e){var t=e.pageVersion,n=v.useContext(be),r=n.pageConfig,i=n.fetchConfig,o=n.ctx,a=n.ctxState,l=n.refs;return L.jsxs(R.TreeGrid,{toolbar:function(){return function(e,t,n,r){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(_e,{ctx:n,pageConfig:e,fetchConfig:t})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()},children:C.tparam(e,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:n,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(r,"formdlg.open",{type:j.FormDataType.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:C.tparam(e,"add.text","Create Setting")})},children:C.tparam(e,"add.text","Add")})})]})]})}(r,i,o,l)},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",treeField:"title",children:[L.jsx(R.GridColumn,{field:"title",title:C.tfield(r,"title.label","Title"),width:"220px"}),L.jsx(R.GridColumn,{field:"icon",title:C.tfield(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return L.jsx("span",{className:"iconfont "+t})}}),L.jsx(R.GridColumn,{field:"active",title:C.tfield(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return M(i,"switch-state",t)}}),L.jsx(R.GridColumn,{field:"position",title:C.tfield(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return M(i,"setting-position",t)}}),L.jsx(R.GridColumn,{field:"type",title:C.tfield(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return M(i,"setting-type",t)}}),L.jsx(R.GridColumn,{field:"router_name",title:C.tfield(r,"router_name.label","RouterName"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"url",title:C.tfield(r,"url.label","URL"),align:"left",width:"300px"}),L.jsx(R.GridColumn,{field:"sort",title:C.tfield(r,"sort.label","Sort"),align:"left",width:"80px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(r,"create_time.label","CreateTime"),width:"180px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(r,"update_time.label","UpdateTime"),width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:o,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(l,"formdlg.open",{ctx:o,record:t,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:o,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==o?void 0:o.publish("remove",{conditions:[{key:"id",value:t.id}]})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},"tree-table-"+t)},Be="setting",Le=[{type:j.CheckAccessEleType.AND,value:["/resource/setting/add"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/update"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/delete"],key:"delete"},{type:j.CheckAccessEleType.AND,value:["/resource/setting/edit"],key:"edit"}],Ne=ce({name:"Setting",fetchConfig:function(){return z.configs(Be)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,i=oe({name:Be,fetch:function(e){return z.list(Be,e)},checkAccessItems:Le,defaultPageSize:10,isTreeData:!0});i.ctx.registerEvent("remove",K(i.ctx));var o=w.useRefDialog(),a=w.useRefDialog();return v.useEffect(function(){i.ctx.search()},[]),L.jsx(be.Provider,{value:{ctx:i.ctx,ctxState:i.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:o,routerlistdlg:a}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:i.ctx,ctxState:i.ctxState})},children:[L.jsx(De,u({},o)),L.jsx(Ee,u({},a)),L.jsx(Pe,{pageVersion:r})]})})}),Ge=new(function(){return c(function e(){a(this,e)},[{key:"captcha",value:function(){return U().post(W("loginCaptcha"))}},{key:"login",value:(e=o(n().m(function e(t,r,i){var o,a,l;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,U().post(W("loginSubmit"),t);case 1:o=e.v,a=o.code,l=o.data,200===a?r(l,a):i(l,a);case 2:return e.a(2)}},e)})),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return U().post(W("loginConfig"))}}]);var e}()),Oe=function(e){var t=e.pageConfig,n=e.rules,r=S.useAppDispatch(),i=p(v.useState({username:"",captcha:"",password:"",code:"",token:""}),2),o=i[0],a=i[1],l=ie(),c=function(){Ge.captcha().then(function(e){var t=e.data;a(u(u({},o),{},{captcha:t.base64,token:t.token,code:""}))})};return v.useEffect(function(){c(),l.autoRedirect()},[]),L.jsxs(R.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},children:[L.jsx(R.FormField,{name:"username",children:L.jsx(R.TextBox,{iconCls:"iconfont "+y.get(t.fields,"username.icon","icon-username"),placeholder:y.get(t.fields,"username.placeholder","username..."),value:o.username})}),L.jsx(R.FormField,{name:"password",children:L.jsx(R.PasswordBox,{iconCls:"iconfont "+y.get(t.fields,"password.icon","icon-password"),placeholder:y.get(t.fields,"password.placeholder","password..."),value:o.password})}),L.jsx(R.FormField,{name:"code",children:L.jsx(R.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 L.jsx("img",{src:o.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:c})}})}),L.jsx(R.FormField,{children:L.jsx(R.LinkButton,{onClick:function(){var e={code:o.code,username:o.username,password:o.password,token:o.token};Ge.login(e,function(e){r(S.login({token:e.token,info:e.user,error:function(){w.$toast.error(y.get(t.params,"tips.loginError"))}})),l.autoRedirect()},function(){c()})},btnCls:"login_btn",children:y.get(t.params,"submit.text","Sign In")})})]})},Ie=function(){var e=w.useLocale(!0),t=e.localeOptions,n=e.changeLocale;return L.jsx(R.MenuButton,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return L.jsx(R.Menu,{children:Object.keys(t).map(function(e,n){return L.jsx(R.MenuItem,{text:t[e],value:e},n)})})},onMenuItemClick:n})},Me=ce({name:"Login",fetchConfig:Ge.configs})(function(e){var t,n=e.pageConfig,r=e.fetchConfig,i=e.rules;return L.jsxs("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{},children:[L.jsx(Ie,{}),L.jsxs("div",{className:"login layui-anim layui-anim-up",children:[L.jsx("h1",{children:null!==(t=r.title)&&void 0!==t?t:n.title}),L.jsx(Oe,{pageConfig:n,fetchConfig:r,rules:i})]})]})}),Ue=v.createContext({pageConfig:{},fetchConfig:{}}),$e=function(t){var r=t.ctx,i=(t.type,t.record),a=t.pageConfig,l=(t.fetchConfig,t.close),c=p(v.useState(),2),s=c[0],u=c[1],d=p(v.useState([]),2),f=d[0],m=d[1],h=v.useRef(null),x=p(v.useState([]),2),g=x[0],y=x[1],b=p(v.useState([]),2),j=b[0],k=b[1],S=v.useRef(null);v.useEffect(function(){null==r||r.setMethod("onSubmit",F),T()},[]);var T=function(){var e=o(n().m(function e(){var t,r,o,a,l,c,s,d,p,m;return n().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ee.roles();case 1:return t=e.v,r=J(t.data||[]),o=[],e.n=2,ee.permissions();case 2:return a=e.v,l=X(a.data||[]),c=[],e.n=3,ee.getChildren({name:i.name});case 3:s=e.v,d=s.code,p=s.data,200===d&&(m=new Set,p&&p.forEach(function(e){m.add(e.name),1==e.item_type?j.push(e.name):f.push(e.name)}),Q(l,m,c),u(l),c.forEach(function(e){h.current.checkNode(e)}),Q(r,m,o),y(r),o.forEach(function(e){S.current.checkNode(e)}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),F=function(){ee.addPermissionChildren({name:i.name,children:[].concat(e(f),e(j))}).then(function(e){200===e.code&&(w.$toast.success(C.tparam(a,"assign_success","assign permission successfully!")),l())})};return L.jsxs(R.Layout,{style:{width:800,height:500},children:[L.jsx(R.LayoutPanel,{region:"west",style:{width:220},children:L.jsx(R.Panel,{bodyStyle:{padding:"10px",height:"100%"},children:L.jsx(R.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)}),k(t)}}})})}),L.jsx(R.LayoutPanel,{region:"center",style:{height:"100%"},children:L.jsx(R.Panel,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return L.jsx(R.TextBox,{style:{width:"100%"},placeholder:"Searching...",onChange:function(e){h.current.doFilter(e)}},"assign-permission")},children:L.jsx(R.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)}),m(t)}}})})}),L.jsx(R.LayoutPanel,{region:"south",children:L.jsxs("div",{className:"dialog-button",children:[L.jsxs(R.LinkButton,{style:{width:80},onClick:F,children:[" ",C.tparam(a,"submit.text","Submit")," "]}),L.jsxs(R.LinkButton,{style:{width:80},onClick:l,children:[" ",C.tparam(a,"close.text","Close")," "]})]})})]})},We=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ue),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx($e,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},Ve=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=p(F.useFormData(r).toArray(),2),l=a[0],c=(a[1],p(F.useFormData(r).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){null==e?(n===j.FormDataType.CREATE&&ee.addRole(l).then(function(e){var n=e.code;e.data;200==n&&(w.$toast.success(C.tt("add_role_success","Message","add role successfully!")),t.refresh(),o())}),n===j.FormDataType.UPDATE&&ee.updateRole({source_name:c.name,target_name:l.name,description:l.description,rule_name:l.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(w.$toast.success(C.tt("update_role_success","Message","update role successfully!")),t.refresh(),o())})):w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:s,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(i,"description.label","Description")+":",children:L.jsx(R.TextBox,{multiline:!0,placeholder:C.tfield(i,"description.placeholder",""),value:l.description,style:{height:"80px",padding:"5px 2px"}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:u,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o,children:C.tparam(i,"close.text","Close")})]})]})},ze=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Ue),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(Ve,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},qe=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(n,"description.label","Description"),children:L.jsx(R.TextBox,{value:o.description})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},He=w.withCheckGrid(R.DataGrid),Ke=function(){var e=v.useContext(Ue),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=e.version;return L.jsxs(He,{toolbar:function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(qe,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){y.invoke(o,"formdlg.open",{type:j.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:C.tparam(t,"add.text","Create Role")})},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"batch-delete",children:L.jsx(R.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?w.$toast.error(C.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ee.batchDeleteRole,params:{names:r.tableSlectionValue()}})},children:C.tparam(t,"batch_remove.text","Batch Remove")})})]})]})},data:(null==i?void 0:i.data)||[],loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"name",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:50,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"220px"}),L.jsx(R.GridColumn,{field:"rule_name",title:C.tfield(t,"rule_name.label","RuleName"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"description",title:C.tfield(t,"description.label","Description"),align:"left",render:O,width:"180px"}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"180px",render:I,sortable:!0}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:I}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"100px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"assign-permission",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"assigndlg.open",{ctx:r,record:n,title:"".concat(C.tparam(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})}),L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formdlg.open",{ctx:r,record:n,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ee.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},a)},Ye=[{type:j.CheckAccessEleType.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:j.CheckAccessEleType.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:j.CheckAccessEleType.AND,value:["/rbac/add-role"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/rbac/update-role"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/rbac/delete-role"],key:"delete"}],Xe=ce({name:"Roles"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:"roles",fetch:function(e){return ee.roles()},checkAccessItems:Ye,defaultPageSize:30,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]),r.ctx.registerEvent("remove",H(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return L.jsx(Ue.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:i,assigndlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(ze,u({},i)),L.jsx(We,u({},o)),L.jsx(Ke,{})]})})}),Qe=v.createContext({pageConfig:{},fetchConfig:{}}),Je=function(e){var t=e.ctx,n=(e.type,e.record),r=e.pageConfig,i=(e.fetchConfig,e.close),o=p(F.useFormData(n).toArray(),1)[0];v.useEffect(function(){null==t||t.setMethod("onSubmit",a)},[]);var a=function(){var e={resource:o.resource,name:o.name};ee.fastAddPermission(e).then(function(e){200===e.code&&(w.$toast.success(C.tt("save_success","Message","Save Success!")),t.refresh(),i())})};return L.jsxs(R.Form,{model:o,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"resource",label:C.tfield(r,"fast_add_resource.label","Resource")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"fast_add_resource.placeholder",""),value:o.resource})}),L.jsx(R.FormField,{name:"name",label:C.tfield(r,"fast_add_name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(r,"fast_add_name.placeholder",""),value:o.name})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:a,children:C.tparam(r,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:i,children:C.tparam(r,"close.text","Close")})]})]})},Ze=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Qe),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:L.jsx(Je,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},et=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=p(v.useState(r),2),l=a[0],c=(a[1],p(F.useFormData(r).toArray(),1)[0]),s=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",u)},[]);var u=function(){s.current.validate(function(e){null==e?(n===j.FormDataType.CREATE&&ee.addPermission(l).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())}),n===j.FormDataType.UPDATE&&ee.updatePermission({source_name:c.name,target_name:l.name,description:l.description,rule_name:l.ruleName}).then(function(e){var n=e.code;e.data;200==n&&(t.refresh(),o())})):w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:s,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(i,"description.label","Description")+":",children:L.jsx(R.TextBox,{multiline:!0,placeholder:C.tfield(i,"description.placeholder",""),value:l.description,style:{height:"80px",padding:"5px 2px"}})}),L.jsxs("div",{className:"admin-form-submit",children:[L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-save",onClick:u,children:C.tparam(i,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},iconCls:"icon-cancel",onClick:o,children:C.tparam(i,"close.text","Close")})]})]})},tt=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(Qe),o=i.ctx,a=i.pageConfig,l=i.fetchConfig;i.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0,children:L.jsx(et,u(u({className:"f-full",ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r}))})},nt=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"description",label:C.tfield(n,"description.label","Description"),children:L.jsx(R.TextBox,{value:o.description})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},rt=w.withCheckGrid(R.DataGrid),it=function(){var e=v.useContext(Qe),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs,a=e.version;return L.jsxs(rt,{toolbar:function(){return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(nt,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){y.invoke(o,"formdlg.open",{type:j.FormDataType.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:C.tparam(t,"add.text","Create Role")})},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"batch-delete",children:L.jsx(R.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?w.$toast.error(C.tt("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ee.batchDeletePermission,params:{names:r.tableSlectionValue()}})},children:C.tparam(t,"batch_remove.text","Batch Remove")})}),L.jsx(w.Access,{ctx:r,point:"fast-add-permission",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){y.invoke(o,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:C.tparam(t,"fast_add.text","Fast Add")})},children:C.tparam(t,"fast_add.text","Fast Add")})})]})]})},data:(null==i?void 0:i.data)||[],idField:"name",selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,lazy:!0,ckWidth:50,children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),render:O}),L.jsx(R.GridColumn,{field:"rule_name",title:C.tfield(t,"rule_name.label","RuleName"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"description",title:C.tfield(t,"description.label","Description"),align:"left",render:O}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"180px",render:O,sortable:!0}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"180px",render:O,sortable:!0}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formdlg.open",{ctx:r,record:n,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.LinkButton,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ee.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})})]})},width:"80px"})})})]},a)},ot=[{type:j.CheckAccessEleType.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:j.CheckAccessEleType.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:j.CheckAccessEleType.AND,value:["/rbac/add-permission"],key:"add"},{type:j.CheckAccessEleType.AND,value:["/rbac/update-permission"],key:"update"},{type:j.CheckAccessEleType.AND,value:["/rbac/delete-permission"],key:"delete"}],at=ce({name:"Permissions"})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=oe({name:"permissions",fetch:function(e){return ee.permissions()},checkAccessItems:ot,defaultPageSize:50,selectionValue:function(e){return e.name}});v.useEffect(function(){r.ctx.search()},[r.version]);var i=w.useRefDialog(),o=w.useRefDialog();return r.ctx.registerEvent("remove",H(r.ctx)),L.jsx(Qe.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:i,fastadddlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(tt,u({},i)),L.jsx(Ze,u({},o)),L.jsx(it,{})]})})}),lt=v.createContext({pageConfig:{},fetchConfig:{}}),ct=v.createContext({pageConfig:{},fetchConfig:{}}),st=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{label:"",value:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",model:o,labelWidth:"auto",labelPosition:"before",children:[L.jsx(R.FormField,{name:"label",label:C.tfield(n,"label.label","Label"),children:L.jsx(R.TextBox,{value:o.label})}),L.jsx(R.FormField,{name:"value",label:C.tfield(n,"value.label","Value"),children:L.jsx(R.TextBox,{value:o.value})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(u({},r)),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},ut=function(){var e=v.useContext(ct),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs;return L.jsx(L.Fragment,{children:L.jsxs(R.DataGrid,{toolbar:function(){var e={record:{data:"",label:"",value:"",sort:0},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(st,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,children:[L.jsx(R.GridColumn,{field:"label",title:C.tfield(t,"label.label","Label"),width:"160px"}),L.jsx(R.GridColumn,{field:"value",title:C.tfield(t,"value.label","Value"),align:"center",width:"180px"}),L.jsx(R.GridColumn,{field:"sort",title:C.tfield(t,"sort.label","Sort"),align:"center",width:"80px"}),L.jsx(R.GridColumn,{field:"data",title:C.tfield(t,"data.label","Data"),align:"center",width:"180px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"80px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,i=(e.rowIndex,{record:n,ctx:r,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formDataRefDlg.open",i)},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"})})})]})})},dt=function(e){var t=e.ctx,n=e.type,r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=e.refs,l=p(F.useFormData(r).toArray(),1)[0],c=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",function(e){return s(e)})},[]);var s=function(e){c.current.validate(function(i){if(null==i){var a={object:{id:parseInt(l.id),label:l.label,sign:e,value:l.value,data:l.data,sort:parseInt(l.sort)},conditions:[]};n===j.FormDataType.UPDATE&&a.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,a,function(){w.$toast.success(C.tt("save_success","Message")),null==t||t.refresh(),o()}).then(function(e){})}else w.$toast.error(Y(i))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"label",label:C.tfield(i,"label.label","Label")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"label.placeholder",""),value:l.label})}),L.jsx(R.FormField,{name:"value",label:C.tfield(i,"value.label","Value")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"value.placeholder",""),value:l.value})}),L.jsx(R.FormField,{name:"sort",label:C.tfield(i,"sort.label","Sort")+":",children:L.jsx(R.NumberBox,{placeholder:C.tfield(i,"sort.placeholder",""),value:l.sort||0})}),L.jsx(R.FormField,{name:"data",label:C.tfield(i,"data.label","Data")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"data.placeholder",""),value:l.data,addonRight:function(){return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=a.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}})})}})})]})},ft=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(ct),o=i.ctx,a=i.pageConfig,l=i.fetchConfig,c=i.refs;return L.jsxs(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:[L.jsx("div",{className:"f-full",children:L.jsx(dt,u(u({ctx:o,pageConfig:a,fetchConfig:l},n),{},{close:r,refs:c}))}),L.jsxs("div",{className:"dialog-button",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:function(){var e;return null==o||null===(e=o.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy",children:C.tparam(a,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon",children:C.tparam(a,"cancel.text","Cancel")})]})]})},pt="dict-item",mt=q(pt),ht=ce({name:"DictItem",fetchConfig:function(){return z.configs(pt)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,i=ae({name:pt,fetch:function(e){return z.list(pt,e)},checkAccessItems:mt,fixedConditions:[{key:"sign",value:r}]},r);i.ctx.registerEvent("remove",K(i.ctx));var o=w.useRefDialog({sign:r});return v.useEffect(function(){i.ctx.search()},[]),L.jsx(ct.Provider,{value:{ctx:i.ctx,ctxState:i.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:i.ctx,ctxState:i.ctxState})},children:[L.jsx(ft,u({},o)),L.jsx(ut,{})]})})}),xt=function(e){var t=e.ctx,n=(e.ctxState,e.type),r=e.record,i=e.pageConfig,o=(e.fetchConfig,e.close),a=e.refs,l=p(F.useFormData(r).toArray(),1)[0],c=v.useRef(null);v.useEffect(function(){null==t||t.setMethod("onSubmit",s)},[]);var s=function(){c.current.validate(function(e){if(null==e){var i={object:{id:parseInt(l.id),name:l.name,sign:l.sign,remark:l.remark},conditions:[]};n===j.FormDataType.UPDATE&&i.conditions.push({key:"id",value:r.id}),z.saveResult(null==t?void 0:t.name(),n,i,function(){w.$toast.success(C.tt("save_success","Message")),t.refresh(),o()}).then(function(e){})}else w.$toast.error(Y(e))})};return L.jsxs(R.Form,{ref:c,model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"},children:[L.jsx(R.FormField,{name:"name",label:C.tfield(i,"name.label","Name")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"name.placeholder",""),value:l.name})}),L.jsx(R.FormField,{name:"sign",label:C.tfield(i,"sign.label","Sign")+":",children:L.jsx(R.TextBox,{placeholder:C.tfield(i,"sign.placeholder",""),disabled:n===j.FormDataType.UPDATE,value:l.sign})}),L.jsx(R.FormField,{name:"remark",label:C.tfield(i,"remark.label","Remark")+":",children:L.jsx(R.TextBox,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:C.tfield(i,"remark.placeholder",""),value:l.remark,addonRight:function(){return L.jsx("span",{style:{paddingLeft:"8px"},children:L.jsx("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=a.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}})})}})})]})},gt=function(e){var t=e.value,n=e.props,r=(e.close,v.useContext(lt));r.ctx,r.pageConfig,r.fetchConfig,r.refs;return L.jsx(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800},children:L.jsx("div",{className:"f-full",style:{paddingTop:"8px"},children:L.jsx(ht,u({},n))})})},vt=function(e){var t=e.value,n=e.props,r=e.close,i=v.useContext(lt),o=i.ctx,a=i.ctxState,l=i.pageConfig,c=i.fetchConfig,s=i.refs;return L.jsxs(R.Dialog,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,children:[L.jsx("div",{className:"f-full",children:L.jsx(xt,u(u({ctx:o,ctxState:a,pageConfig:l,fetchConfig:c},n),{},{close:r,refs:s}))}),L.jsxs("div",{className:"dialog-button",children:[L.jsx(R.LinkButton,{style:{width:80},onClick:function(){var e;return null==o||null===(e=o.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy",children:C.tparam(l,"submit.text","Submit")}),L.jsx(R.LinkButton,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon",children:C.tparam(l,"cancel.text","Cancel")})]})]})},yt=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",sign:""}),i=p(v.useState(r),2),o=i[0],a=i[1];return L.jsxs(R.Form,{className:"admin-search-panel",labelWidth:"auto",model:o,labelPosition:"before",children:[L.jsx(R.FormField,{name:"name",label:C.tfield(n,"name.label","Name"),children:L.jsx(R.TextBox,{value:o.name})}),L.jsx(R.FormField,{name:"sign",label:C.tfield(n,"sign.label","Sign"),children:L.jsx(R.TextBox,{value:o.sign})}),L.jsxs(R.FormField,{children:[L.jsx(R.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"},children:C.tparam(n,"search.text","Search")}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){a(r),null==t||t.reset()},children:C.tparam(n,"reset.text","Reset")})]})]})},bt=w.withCheckGrid(R.DataGrid),jt=function(){var e=v.useContext(lt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,i=e.ctxState,o=e.refs;return L.jsx(L.Fragment,{children:L.jsxs(bt,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:j.FormDataType.CREATE,ctx:r,title:C.tparam(t,"add.text","Create Dict")};return L.jsxs(v.Fragment,{children:[L.jsx("div",{children:L.jsx(yt,{ctx:r,pageConfig:t,fetchConfig:n})}),L.jsxs("div",{style:{padding:4},children:[L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()},children:C.tparam(t,"refresh.text","Refresh")}),L.jsx(w.Access,{ctx:r,point:"add",children:L.jsx(R.LinkButton,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return y.invoke(o,"formDataRefDlg.open",e)},children:C.tparam(t,"add.text","Add")})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"}]}):w.$toast.error(C.tt("checkbox_no_empty","Message"))},children:C.tparam(t,"batch_remove.text","Batch Remove")})})]})]})},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"id",ckWidth:50,selection:null==i?void 0:i.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},children:[L.jsx(R.GridColumn,{field:"name",title:C.tfield(t,"name.label","Name"),width:"160px",render:O}),L.jsx(R.GridColumn,{field:"sign",title:C.tfield(t,"sign.label","Sign"),width:"150px",render:O}),L.jsx(R.GridColumn,{field:"remark",title:C.tfield(t,"remark.label","Remark"),width:"180px",render:O}),L.jsx(R.GridColumn,{field:"create_time",title:C.tfield(t,"create_time.label","CreateTime"),width:"120px"}),L.jsx(R.GridColumn,{field:"update_time",title:C.tfield(t,"update_time.label","UpdateTime"),width:"120px"}),L.jsx(R.GridColumnGroup,{frozen:!0,align:"right",width:"150px",children:L.jsx(R.GridHeaderRow,{children:L.jsx(R.GridColumn,{align:"center",render:function(e){e.value;var n=e.row,i=(e.rowIndex,{record:n,ctx:r,type:j.FormDataType.UPDATE,title:"".concat(C.tparam(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),a={sign:n.sign,title:C.tparam(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return L.jsxs(L.Fragment,{children:[L.jsx(w.Access,{ctx:r,point:"items",children:L.jsx(R.Tooltip,{content:C.tparam(t,"item_list.text","Dict Item"),position:"top",children:L.jsx(R.LinkButton,{onClick:function(){return y.invoke(o,"dictItemDataRefDlg.open",a)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"})})}),L.jsx(w.Access,{ctx:r,point:"update",children:L.jsx(R.LinkButton,{plain:!0,onClick:function(){return y.invoke(o,"formDataRefDlg.open",i)},iconCls:"iconfont icon-edit color-dark-green"})}),L.jsx(w.Access,{ctx:r,point:"delete",children:L.jsx(R.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"})})})]})})},Ct="dict",kt=[{type:j.CheckAccessEleType.AND,value:["/resource/dict-item/list"],key:"items"}].concat(e(q(Ct))),wt=ce({name:"Dict",fetchConfig:function(){return z.configs(Ct)}})(function(e){var t=e.pageConfig,n=e.fetchConfig,r=ae({name:Ct,fetch:function(e){return z.list(Ct,e)},checkAccessItems:kt});r.ctx.registerEvent("remove",K(r.ctx)),r.ctx.registerEvent("batchRemove",K(r.ctx));var i=w.useRefDialog(),o=w.useRefDialog();return v.useEffect(function(){r.ctx.search()},[r.version]),L.jsx(lt.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:i,dictItemDataRefDlg:o}},children:L.jsxs(w.DefaultPanel,{mode:"cover",footer:function(){return L.jsx(le,{ctx:r.ctx,ctxState:r.ctxState})},children:[L.jsx(vt,u({},i)),L.jsx(gt,u({},o)),L.jsx(jt,{})]})})}),St=function(e){var t=p(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 L.jsx("h2",{children:"developing......"})},Tt=v.createContext({}),Ft=function(){var e=w.useTheme(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,S.useAppSelector(function(e){return e.app.theme})),i=v.useRef(null);return v.useEffect(function(){},[]),L.jsxs(L.Fragment,{children:[L.jsx(w.DrawerPanel,{width:"300px",placement:"right",ref:i,children:L.jsx(R.Panel,{style:{width:"300px",height:"100%"},title:C.tt("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"},children:n.map(function(e,n){return L.jsxs("div",{children:[L.jsx(R.RadioButton,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),L.jsx(R.Label,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"},children:C.tt("themes."+e.key,"Setting",e.name)})]},n)})})}),L.jsx(R.LinkButton,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){i.current.toggle()}})]})},Rt=function(){var e=S.useAppSelector(function(e){return e.user.info}),t=S.useAppDispatch(),n=T.useNavigate();return L.jsx(R.MenuButton,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return L.jsx(R.Menu,{noline:!0,children:L.jsx(R.MenuItem,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"})})},onMenuItemClick:function(e){if("exit"==e){var r=C.tt("confirm_logout","Message");w.$confirm("",r,function(){S.Admin.logout(function(){t(S.clearLayoutData()),t(S.saveHistoryLocation({pathname:"/",hash:"",search:""})),n("/login")})})}}})},At=new k.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}}),Dt={border:!1,plain:!0,scrollable:!0,narrow:!1},Et={border:!1,animate:!0,multiple:!0,showCollapsedText:!1};exports.AdminView=ye,exports.AppLayoutContext=Tt,exports.BaseLayout=function(e){T.useNavigate(),S.useAppSelector(function(e){return e.user.info});var t={dispatch:S.useAppDispatch(),useAppSelector:S.useAppSelector},n=re(At),r=n.collapsed,i=n.menuList,o=n.choiceId,a=n.onMenuSelection,l=n.menuArea,c=n.setMenuAreaId,s=n.menuTabList,d=n.onTabClosed,f=n.onTabSelected;return L.jsx(Tt.Provider,{value:t,children:L.jsxs(w.FullBodyLayout,u(u({menus:i,title:C.tt("title","App","Admin"),collapsed:r,sidebarCfg:u(u({},Et),{},{onItemClick:a}),selection:R.treeHelper.findNode(i,"id",o),toggle:function(e){var n;return null===(n=t.dispatch)||void 0===n?void 0:n.call(t,S.setSidebarCollapsed(e))},slots:{barLeft:L.jsx(function(){return L.jsx(v.Fragment,{children:!r&&(null==l?void 0:l.map(function(e,t){return L.jsx(R.LinkButton,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,onClick:function(){return c(e.id)},children:e.text},e.id)}))})},{}),barRight:L.jsx(function(){return L.jsxs(v.Fragment,{children:[L.jsx(Rt,{}),L.jsx(Ie,{}),L.jsx(Ft,{})]})},{}),footer:L.jsx(function(){return L.jsx(v.Fragment,{children:e.footer})},{})},onSideMenuSelection:function(){}},e),{},{children:[L.jsx(function(){return L.jsx(w.TabsPanel,{onTabSelect:f,tabsCfg:Dt,onTabClosed:d,data:s})},{}),L.jsx("div",{className:"admin-tabs-panel-body",children:L.jsx(T.Outlet,{})})]}))})},exports.DictView=wt,exports.HomeView=function(){return L.jsx("h1",{children:"Home!!!!!!!"})},exports.Lazy=function(e){return L.jsx(v.Suspense,{fallback:L.jsx(L.Fragment,{children:"..."}),children:e})},exports.LocaleBarItem=Ie,exports.LoginView=Me,exports.NotFoundView=function(){return L.jsx("h1",{children:"404!!!!!!!"})},exports.PaginationPanel=le,exports.PermissionsView=at,exports.RolesView=Xe,exports.RouterView=Ae,exports.ScreenDesign=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return v.useRef(null),L.jsx(w.DefaultPanel,{mode:"cover",children:L.jsxs(R.Layout,{style:{width:"100%",height:"100%"},children:[L.jsx(R.LayoutPanel,{region:"north",style:{height:50},children:"North Region"}),L.jsx(R.LayoutPanel,{region:"south",style:{height:50},children:"South Region"}),L.jsx(R.LayoutPanel,{region:"west",style:{width:240},children:L.jsx("div",{style:{},children:"West Region"})}),L.jsx(R.LayoutPanel,{region:"east",style:{width:240},children:L.jsx("div",{style:{},children:"East Region"})}),L.jsx(R.LayoutPanel,{region:"center",style:{width:"100%",height:"100%"},children:L.jsx(St,{})})]})})},exports.SettingBarItem=Ft,exports.SettingView=Ne,exports.Tooltip=G,exports.adminService=te,exports.configService=ne,exports.convertToText=Y,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=Z,exports.install=function(e){var t,n,r;n=e.request,N||(N=n),r=null!==(t=e.apis)&&void 0!==t?t:{},$=u(u({},$),r)},exports.permissionTree=X,exports.queryPermissionTress=Q,exports.rbacService=ee,exports.removeEventFn=H,exports.renderDateTime02=I,exports.renderFetchConfigValue=M,exports.renderText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?L.jsx("span",{className:"iconfont "+t,children:e}):L.jsx("span",{children:e})},exports.renderTooltip=O,exports.renderType=function(){return L.jsx("div",{children:"Type"})},exports.resourceAccessItems=q,exports.resourceRemoveEvent=K,exports.resourceService=z,exports.roleTree=J,exports.useAppRedirect=ie,exports.useAppStarter=function(){var e=w.useLocale().locale,t=p(v.useState(),2),n=t[0],r=t[1],i=ie();return v.useEffect(function(){C.setLanguage(e,function(){r(C.getActivePkg())}),i.autoRedirect()},[]),v.useEffect(function(){r(C.getActivePkg())},[e]),{easyuiLangPkg:n}},exports.useLocalTable=oe,exports.useMenuAndTabData=re,exports.useTable=ae,exports.withDocHoc=ce;
11
11
  //# sourceMappingURL=index.umd.cjs.map