@teamias/pro-layout 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/index.d.ts +0 -1
- package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/index.js +3 -1
- package/dist/markdowns/example1/BasicProLayoutBusiness/index.d.ts +2 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/index.js +85 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Home.d.ts +1 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Home.js +21 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Level1.d.ts +1 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Level1.js +21 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Level2.d.ts +1 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/pages/Level2.js +21 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/testData.d.ts +53 -0
- package/dist/markdowns/example1/BasicProLayoutBusiness/testData.js +82 -0
- package/dist/markdowns/example1/RoleSelectDemo/index.d.ts +3 -0
- package/dist/markdowns/example1/RoleSelectDemo/index.js +151 -0
- package/dist/pro-layout/components/KeepAlive/KeepAliveClass.d.ts +2 -2
- package/dist/pro-layout/components/KeepAlive/index.d.ts +1 -1
- package/dist/pro-layout/components/Login/index.js +5 -5
- package/dist/pro-layout/components/TabsLayout/index.js +5 -12
- package/dist/pro-layout/core/index.js +27 -9
- package/dist/pro-layout/hooks/index.js +6 -1
- package/dist/pro-layout/index.d.ts +8 -1
- package/dist/pro-layout/index.js +30 -2
- package/dist/pro-layout/style/index.js +2 -2
- package/dist/pro-layout/types/index.d.ts +16 -4
- package/dist/pro-layout-business/components/RoleSelect.d.ts +1 -0
- package/dist/pro-layout-business/components/RoleSelect.js +203 -0
- package/dist/pro-layout-business/hooks/use-service.d.ts +36 -0
- package/dist/pro-layout-business/hooks/use-service.js +64 -0
- package/dist/pro-layout-business/index.d.ts +7 -0
- package/dist/pro-layout-business/index.js +81 -0
- package/package.json +1 -1
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Home.d.ts +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Home.js +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Level1.d.ts +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Level1.js +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Level2.d.ts +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/pages/Level2.js +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/testData.d.ts +0 -0
- /package/dist/markdowns/example1/{BasicRexProLayout → BasicProLayout}/testData.js +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./pro-layout";
|
|
1
|
+
export * from "./pro-layout";
|
|
2
|
+
export * from "./pro-layout-business";
|
|
@@ -3,7 +3,6 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import { ProLayoutMemo } from "../../..";
|
|
6
|
-
import 'antd/dist/reset.css';
|
|
7
6
|
import { sleep } from 'radash';
|
|
8
7
|
import { useEffect } from 'react';
|
|
9
8
|
import ReactDom from 'react-dom';
|
|
@@ -16,6 +15,9 @@ var BasicProLayout = function BasicProLayout() {
|
|
|
16
15
|
basename: "/",
|
|
17
16
|
projectId: "demo-project",
|
|
18
17
|
pageComponentMap: pageComponentMap,
|
|
18
|
+
placeholderElement: /*#__PURE__*/_jsx("div", {
|
|
19
|
+
children: "\u5360\u4F4D\u5143\u7D20: \u9875\u9762\u6B63\u5728\u5F00\u53D1\u4E2D..."
|
|
20
|
+
}),
|
|
19
21
|
requestUserInfoMenuData: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
20
22
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
21
23
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { getLocalStorageItem } from "../../../pro-layout/utils";
|
|
6
|
+
import { LOCAL_STORAGE, ProLayoutBusiness } from "../../..";
|
|
7
|
+
import { RexProConfigProvider } from '@teamias/rex-design';
|
|
8
|
+
import { message } from 'antd';
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
|
+
import ReactDom from 'react-dom';
|
|
11
|
+
import { MemoryRouter } from 'react-router-dom';
|
|
12
|
+
import { pageComponentMap } from "./testData";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
var BasicProLayout = function BasicProLayout() {
|
|
15
|
+
return /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
16
|
+
value: {
|
|
17
|
+
apiClient: function () {
|
|
18
|
+
var _apiClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
|
|
19
|
+
var params,
|
|
20
|
+
res,
|
|
21
|
+
data,
|
|
22
|
+
_args = arguments;
|
|
23
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
|
25
|
+
case 0:
|
|
26
|
+
params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
27
|
+
_context.next = 3;
|
|
28
|
+
return fetch('https://dev.spocoo.com/api' + url, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
Authorization: getLocalStorageItem(LOCAL_STORAGE.ACCESS_TOKEN, undefined)
|
|
33
|
+
},
|
|
34
|
+
body: JSON.stringify(Object.assign({}, params, {
|
|
35
|
+
app_id: '2',
|
|
36
|
+
project_id: '2'
|
|
37
|
+
}))
|
|
38
|
+
});
|
|
39
|
+
case 3:
|
|
40
|
+
res = _context.sent;
|
|
41
|
+
_context.next = 6;
|
|
42
|
+
return res.json();
|
|
43
|
+
case 6:
|
|
44
|
+
data = _context.sent;
|
|
45
|
+
if (!(data.code !== 200)) {
|
|
46
|
+
_context.next = 10;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
message.error(data.message || '接口请求错误');
|
|
50
|
+
throw new Error(data.message || '接口请求错误');
|
|
51
|
+
case 10:
|
|
52
|
+
return _context.abrupt("return", data);
|
|
53
|
+
case 11:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
56
|
+
}
|
|
57
|
+
}, _callee);
|
|
58
|
+
}));
|
|
59
|
+
function apiClient(_x) {
|
|
60
|
+
return _apiClient.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
return apiClient;
|
|
63
|
+
}()
|
|
64
|
+
},
|
|
65
|
+
children: /*#__PURE__*/_jsx(MemoryRouter, {
|
|
66
|
+
children: /*#__PURE__*/_jsx(ProLayoutBusiness, {
|
|
67
|
+
basename: "/",
|
|
68
|
+
projectId: "2",
|
|
69
|
+
pageComponentMap: pageComponentMap,
|
|
70
|
+
placeholderElement: /*#__PURE__*/_jsx("div", {
|
|
71
|
+
children: "\u5360\u4F4D\u5143\u7D20: \u9875\u9762\u6B63\u5728\u5F00\u53D1\u4E2D..."
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
export default (function () {
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
var dom = document.getElementById('pro-layout');
|
|
80
|
+
ReactDom.render( /*#__PURE__*/_jsx(BasicProLayout, {}), dom);
|
|
81
|
+
}, []);
|
|
82
|
+
return /*#__PURE__*/_jsx("div", {
|
|
83
|
+
id: "pro-layout"
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Home: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useStateData } from '@teamias/rex-design';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export var Home = function Home() {
|
|
6
|
+
var _useStateData = useStateData(function () {
|
|
7
|
+
return {
|
|
8
|
+
count: 0
|
|
9
|
+
};
|
|
10
|
+
}),
|
|
11
|
+
state = _useStateData.state,
|
|
12
|
+
setState = _useStateData.setState;
|
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: ["\u9996\u9875", /*#__PURE__*/_jsxs(Button, {
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
return setState('count', state.count + 1);
|
|
17
|
+
},
|
|
18
|
+
children: ["Count: ", state.count]
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Level1: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useStateData } from '@teamias/rex-design';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export var Level1 = function Level1() {
|
|
6
|
+
var _useStateData = useStateData(function () {
|
|
7
|
+
return {
|
|
8
|
+
count: 0
|
|
9
|
+
};
|
|
10
|
+
}),
|
|
11
|
+
state = _useStateData.state,
|
|
12
|
+
setState = _useStateData.setState;
|
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: ["\u4E00\u7EA7", /*#__PURE__*/_jsxs(Button, {
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
return setState('count', state.count + 1);
|
|
17
|
+
},
|
|
18
|
+
children: ["Count: ", state.count]
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Level2: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useStateData } from '@teamias/rex-design';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
export var Level2 = function Level2() {
|
|
6
|
+
var _useStateData = useStateData(function () {
|
|
7
|
+
return {
|
|
8
|
+
count: 0
|
|
9
|
+
};
|
|
10
|
+
}),
|
|
11
|
+
state = _useStateData.state,
|
|
12
|
+
setState = _useStateData.setState;
|
|
13
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
14
|
+
children: ["\u4E8C\u7EA7", /*#__PURE__*/_jsxs(Button, {
|
|
15
|
+
onClick: function onClick() {
|
|
16
|
+
return setState('count', state.count + 1);
|
|
17
|
+
},
|
|
18
|
+
children: ["Count: ", state.count]
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const pageComponentMap: {
|
|
2
|
+
'/': {
|
|
3
|
+
element: import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
};
|
|
5
|
+
'/menu/page1': {
|
|
6
|
+
element: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
'/menu/page2': {
|
|
9
|
+
element: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const menuData: ({
|
|
13
|
+
id: string;
|
|
14
|
+
app_id: number;
|
|
15
|
+
title: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
type: 1;
|
|
18
|
+
routing: string;
|
|
19
|
+
component: string;
|
|
20
|
+
pid: string;
|
|
21
|
+
permission: string;
|
|
22
|
+
hidden: 0;
|
|
23
|
+
menu_type: "menu";
|
|
24
|
+
status_text: string;
|
|
25
|
+
children?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
id: string;
|
|
28
|
+
app_id: number;
|
|
29
|
+
title: string;
|
|
30
|
+
icon: string;
|
|
31
|
+
type: 4;
|
|
32
|
+
routing: string;
|
|
33
|
+
component: string;
|
|
34
|
+
pid: string;
|
|
35
|
+
permission: string;
|
|
36
|
+
hidden: 0;
|
|
37
|
+
menu_type: "dir";
|
|
38
|
+
status_text: string;
|
|
39
|
+
children: {
|
|
40
|
+
id: string;
|
|
41
|
+
app_id: number;
|
|
42
|
+
title: string;
|
|
43
|
+
icon: string;
|
|
44
|
+
type: 1;
|
|
45
|
+
routing: string;
|
|
46
|
+
component: string;
|
|
47
|
+
pid: string;
|
|
48
|
+
permission: string;
|
|
49
|
+
hidden: 0;
|
|
50
|
+
menu_type: "menu";
|
|
51
|
+
status_text: string;
|
|
52
|
+
}[];
|
|
53
|
+
})[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Home } from "./pages/Home";
|
|
2
|
+
import { Level1 } from "./pages/Level1";
|
|
3
|
+
import { Level2 } from "./pages/Level2";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var pageComponentMap = {
|
|
6
|
+
'/': {
|
|
7
|
+
element: /*#__PURE__*/_jsx(Home, {})
|
|
8
|
+
},
|
|
9
|
+
'/menu/page1': {
|
|
10
|
+
element: /*#__PURE__*/_jsx(Level1, {})
|
|
11
|
+
},
|
|
12
|
+
'/menu/page2': {
|
|
13
|
+
element: /*#__PURE__*/_jsx(Level2, {})
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export var menuData = [{
|
|
17
|
+
id: '83',
|
|
18
|
+
app_id: 2,
|
|
19
|
+
title: '首页',
|
|
20
|
+
icon: '',
|
|
21
|
+
type: 1,
|
|
22
|
+
routing: '/',
|
|
23
|
+
component: '',
|
|
24
|
+
pid: '82',
|
|
25
|
+
permission: '',
|
|
26
|
+
hidden: 0,
|
|
27
|
+
menu_type: 'menu',
|
|
28
|
+
status_text: ''
|
|
29
|
+
}, {
|
|
30
|
+
id: '81',
|
|
31
|
+
app_id: 2,
|
|
32
|
+
title: '菜单',
|
|
33
|
+
icon: '',
|
|
34
|
+
type: 4,
|
|
35
|
+
routing: '/menu',
|
|
36
|
+
component: '',
|
|
37
|
+
pid: '0',
|
|
38
|
+
permission: '',
|
|
39
|
+
hidden: 0,
|
|
40
|
+
menu_type: 'dir',
|
|
41
|
+
status_text: '',
|
|
42
|
+
children: [{
|
|
43
|
+
id: '831',
|
|
44
|
+
app_id: 2,
|
|
45
|
+
title: '一级',
|
|
46
|
+
icon: '',
|
|
47
|
+
type: 1,
|
|
48
|
+
routing: '/page1',
|
|
49
|
+
component: '',
|
|
50
|
+
pid: '82',
|
|
51
|
+
permission: '',
|
|
52
|
+
hidden: 0,
|
|
53
|
+
menu_type: 'menu',
|
|
54
|
+
status_text: ''
|
|
55
|
+
}, {
|
|
56
|
+
id: '842',
|
|
57
|
+
app_id: 2,
|
|
58
|
+
title: '二级',
|
|
59
|
+
icon: '',
|
|
60
|
+
type: 1,
|
|
61
|
+
routing: '/page2',
|
|
62
|
+
component: '',
|
|
63
|
+
pid: '82',
|
|
64
|
+
permission: '',
|
|
65
|
+
hidden: 0,
|
|
66
|
+
menu_type: 'menu',
|
|
67
|
+
status_text: ''
|
|
68
|
+
}, {
|
|
69
|
+
id: '843',
|
|
70
|
+
app_id: 2,
|
|
71
|
+
title: '低代码页',
|
|
72
|
+
icon: '',
|
|
73
|
+
type: 1,
|
|
74
|
+
routing: '/page3',
|
|
75
|
+
component: '',
|
|
76
|
+
pid: '82',
|
|
77
|
+
permission: '',
|
|
78
|
+
hidden: 0,
|
|
79
|
+
menu_type: 'menu',
|
|
80
|
+
status_text: ''
|
|
81
|
+
}]
|
|
82
|
+
}];
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { RoleSelect } from "../../../pro-layout-business/components/RoleSelect";
|
|
6
|
+
import { LayoutContextProvide } from "../../../pro-layout/context";
|
|
7
|
+
import { RexProConfigProvider } from '@teamias/rex-design';
|
|
8
|
+
import { ConfigProvider, Space } from 'antd';
|
|
9
|
+
import 'antd/dist/reset.css';
|
|
10
|
+
import zhCN from 'antd/locale/zh_CN';
|
|
11
|
+
|
|
12
|
+
// 模拟角色数据
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
var mockRolesData = {
|
|
16
|
+
data: [{
|
|
17
|
+
id: '1',
|
|
18
|
+
title: '技术部',
|
|
19
|
+
childs: [{
|
|
20
|
+
id: 101,
|
|
21
|
+
title: '前端开发工程师'
|
|
22
|
+
}, {
|
|
23
|
+
id: 102,
|
|
24
|
+
title: '后端开发工程师'
|
|
25
|
+
}, {
|
|
26
|
+
id: 103,
|
|
27
|
+
title: '测试工程师'
|
|
28
|
+
}, {
|
|
29
|
+
id: 104,
|
|
30
|
+
title: '架构师'
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
id: '2',
|
|
34
|
+
title: '产品部',
|
|
35
|
+
childs: [{
|
|
36
|
+
id: 201,
|
|
37
|
+
title: '产品经理'
|
|
38
|
+
}, {
|
|
39
|
+
id: 202,
|
|
40
|
+
title: '产品助理'
|
|
41
|
+
}, {
|
|
42
|
+
id: 203,
|
|
43
|
+
title: 'UI设计师'
|
|
44
|
+
}]
|
|
45
|
+
}, {
|
|
46
|
+
id: '3',
|
|
47
|
+
title: '运营部',
|
|
48
|
+
childs: [{
|
|
49
|
+
id: 301,
|
|
50
|
+
title: '运营经理'
|
|
51
|
+
}, {
|
|
52
|
+
id: 302,
|
|
53
|
+
title: '内容运营'
|
|
54
|
+
}, {
|
|
55
|
+
id: 303,
|
|
56
|
+
title: '市场专员'
|
|
57
|
+
}]
|
|
58
|
+
}]
|
|
59
|
+
};
|
|
60
|
+
var RoleSelectDemo = function RoleSelectDemo() {
|
|
61
|
+
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
62
|
+
locale: zhCN,
|
|
63
|
+
children: /*#__PURE__*/_jsx(RexProConfigProvider, {
|
|
64
|
+
value: {
|
|
65
|
+
apiClient: function () {
|
|
66
|
+
var _apiClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
|
|
67
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
if (!url.includes('canjobs')) {
|
|
71
|
+
_context.next = 2;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
return _context.abrupt("return", mockRolesData);
|
|
75
|
+
case 2:
|
|
76
|
+
if (!url.includes('do_job')) {
|
|
77
|
+
_context.next = 4;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
return _context.abrupt("return", {
|
|
81
|
+
code: 200,
|
|
82
|
+
message: '切换成功'
|
|
83
|
+
});
|
|
84
|
+
case 4:
|
|
85
|
+
return _context.abrupt("return", {
|
|
86
|
+
data: null
|
|
87
|
+
});
|
|
88
|
+
case 5:
|
|
89
|
+
case "end":
|
|
90
|
+
return _context.stop();
|
|
91
|
+
}
|
|
92
|
+
}, _callee);
|
|
93
|
+
}));
|
|
94
|
+
function apiClient(_x) {
|
|
95
|
+
return _apiClient.apply(this, arguments);
|
|
96
|
+
}
|
|
97
|
+
return apiClient;
|
|
98
|
+
}()
|
|
99
|
+
},
|
|
100
|
+
children: /*#__PURE__*/_jsx(LayoutContextProvide, {
|
|
101
|
+
basename: "/",
|
|
102
|
+
projectId: "demo",
|
|
103
|
+
userInfo: {
|
|
104
|
+
id: '1',
|
|
105
|
+
username: 'demo-user',
|
|
106
|
+
model_id: '1',
|
|
107
|
+
job_id: 101
|
|
108
|
+
},
|
|
109
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
110
|
+
direction: "vertical",
|
|
111
|
+
size: "large",
|
|
112
|
+
style: {
|
|
113
|
+
padding: 20
|
|
114
|
+
},
|
|
115
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
116
|
+
children: [/*#__PURE__*/_jsx("h4", {
|
|
117
|
+
children: "\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\u5207\u6362\u89D2\u8272\uFF1A"
|
|
118
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
119
|
+
style: {
|
|
120
|
+
display: 'inline-flex',
|
|
121
|
+
padding: '8px 16px',
|
|
122
|
+
background: '#1677ff',
|
|
123
|
+
color: '#fff',
|
|
124
|
+
borderRadius: 4,
|
|
125
|
+
cursor: 'pointer'
|
|
126
|
+
},
|
|
127
|
+
children: /*#__PURE__*/_jsx(RoleSelect, {})
|
|
128
|
+
})]
|
|
129
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
130
|
+
style: {
|
|
131
|
+
color: '#666',
|
|
132
|
+
fontSize: 12
|
|
133
|
+
},
|
|
134
|
+
children: [/*#__PURE__*/_jsx("p", {
|
|
135
|
+
children: "\uD83D\uDCA1 \u63D0\u793A\uFF1A"
|
|
136
|
+
}), /*#__PURE__*/_jsxs("ul", {
|
|
137
|
+
children: [/*#__PURE__*/_jsx("li", {
|
|
138
|
+
children: "\u5DE6\u4FA7\u9009\u62E9\u90E8\u95E8/\u6A21\u578B"
|
|
139
|
+
}), /*#__PURE__*/_jsx("li", {
|
|
140
|
+
children: "\u53F3\u4FA7\u641C\u7D22\u5E76\u9009\u62E9\u5177\u4F53\u89D2\u8272"
|
|
141
|
+
}), /*#__PURE__*/_jsx("li", {
|
|
142
|
+
children: "\u5207\u6362\u89D2\u8272\u4F1A\u5F39\u51FA\u786E\u8BA4\u6846"
|
|
143
|
+
})]
|
|
144
|
+
})]
|
|
145
|
+
})]
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
export default RoleSelectDemo;
|
|
@@ -17,7 +17,7 @@ export declare class KeepAliveClass {
|
|
|
17
17
|
updateAllComponent(type?: 'all' | 'pagesHook' | 'context'): Promise<void>;
|
|
18
18
|
/** 获取页面数据 */
|
|
19
19
|
getPages(): (import("react-router-dom").Location & {
|
|
20
|
-
pageStatus: 200 |
|
|
20
|
+
pageStatus: 200 | 403 | 404;
|
|
21
21
|
pageTitle: string;
|
|
22
22
|
})[];
|
|
23
23
|
/** 关闭页面 */
|
|
@@ -32,7 +32,7 @@ export declare class KeepAliveClass {
|
|
|
32
32
|
useLifeCycle: (callback: IPageLifeCycleCallback) => void;
|
|
33
33
|
/** 获取缓存页面数组 */
|
|
34
34
|
useKeepAlivePages: () => (import("react-router-dom").Location & {
|
|
35
|
-
pageStatus: 200 |
|
|
35
|
+
pageStatus: 200 | 403 | 404;
|
|
36
36
|
pageTitle: string;
|
|
37
37
|
})[];
|
|
38
38
|
/** 更新当前路由页面 */
|
|
@@ -6,7 +6,7 @@ export declare const keepAliveControl: KeepAliveClass;
|
|
|
6
6
|
export declare const useLifeCycle: (callback: import("./types").IPageLifeCycleCallback) => void;
|
|
7
7
|
/** 获取页面数组 */
|
|
8
8
|
export declare const useKeepAlivePages: () => (import("react-router-dom").Location & {
|
|
9
|
-
pageStatus: 200 |
|
|
9
|
+
pageStatus: 200 | 403 | 404;
|
|
10
10
|
pageTitle: string;
|
|
11
11
|
})[];
|
|
12
12
|
/** 根 */
|
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { SmileOutlined } from '@ant-design/icons';
|
|
12
12
|
import { LoginForm } from '@ant-design/pro-components';
|
|
13
|
-
import { Col, Row,
|
|
13
|
+
import { Col, Row, notification } from 'antd';
|
|
14
14
|
import dayjs from 'dayjs';
|
|
15
15
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
16
16
|
import { useState } from 'react';
|
|
@@ -96,16 +96,16 @@ export var Login = function Login(_ref) {
|
|
|
96
96
|
message: "".concat(timeFix(), ", ").concat(userInfo === null || userInfo === void 0 ? void 0 : userInfo.username, " \uD83D\uDC95"),
|
|
97
97
|
icon: /*#__PURE__*/_jsx(SmileOutlined, {})
|
|
98
98
|
});
|
|
99
|
-
_context.next =
|
|
99
|
+
_context.next = 16;
|
|
100
100
|
break;
|
|
101
101
|
case 13:
|
|
102
102
|
_context.prev = 13;
|
|
103
103
|
_context.t0 = _context["catch"](1);
|
|
104
104
|
console.error(_context.t0);
|
|
105
|
-
message.error('登录失败,请重试!');
|
|
106
|
-
case
|
|
105
|
+
// message.error('登录失败,请重试!');
|
|
106
|
+
case 16:
|
|
107
107
|
setLoginLoading(false);
|
|
108
|
-
case
|
|
108
|
+
case 17:
|
|
109
109
|
case "end":
|
|
110
110
|
return _context.stop();
|
|
111
111
|
}
|