Compare commits
No commits in common. "main" and "gh-pages" have entirely different histories.
@ -1,16 +0,0 @@
|
|||||||
# http://editorconfig.org
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
||||||
[Makefile]
|
|
||||||
indent_style = tab
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
/lambda/
|
|
||||||
/scripts
|
|
||||||
/config
|
|
||||||
.history
|
|
||||||
public
|
|
||||||
dist
|
|
||||||
.umi
|
|
||||||
mock
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
extends: [require.resolve('@umijs/lint/dist/config/eslint')],
|
|
||||||
globals: {
|
|
||||||
page: true,
|
|
||||||
REACT_APP_ENV: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
45
.gitignore
vendored
45
.gitignore
vendored
@ -1,45 +0,0 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
**/node_modules
|
|
||||||
# roadhog-api-doc ignore
|
|
||||||
/src/utils/request-temp.js
|
|
||||||
_roadhog-api-doc
|
|
||||||
|
|
||||||
# production
|
|
||||||
/dist
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-error.log
|
|
||||||
|
|
||||||
/coverage
|
|
||||||
.idea
|
|
||||||
yarn.lock
|
|
||||||
package-lock.json
|
|
||||||
*bak
|
|
||||||
.vscode
|
|
||||||
|
|
||||||
|
|
||||||
# visual studio code
|
|
||||||
.history
|
|
||||||
*.log
|
|
||||||
functions/*
|
|
||||||
.temp/**
|
|
||||||
|
|
||||||
# umi
|
|
||||||
.umi
|
|
||||||
.umi-production
|
|
||||||
.umi-test
|
|
||||||
|
|
||||||
# screenshot
|
|
||||||
screenshot
|
|
||||||
.firebase
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
build
|
|
||||||
|
|
||||||
#yarn
|
|
||||||
**/.yarn
|
|
||||||
.yarnrc.yml
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
# Export Git hook params
|
|
||||||
export GIT_PARAMS=$*
|
|
||||||
|
|
||||||
npx --no-install fabric verify-commit
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
npx --no-install lint-staged
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
**/*.svg
|
|
||||||
.umi
|
|
||||||
.umi-production
|
|
||||||
/dist
|
|
||||||
.dockerignore
|
|
||||||
.DS_Store
|
|
||||||
.eslintignore
|
|
||||||
*.png
|
|
||||||
*.toml
|
|
||||||
docker
|
|
||||||
.editorconfig
|
|
||||||
Dockerfile*
|
|
||||||
.gitignore
|
|
||||||
.prettierignore
|
|
||||||
LICENSE
|
|
||||||
.eslintcache
|
|
||||||
*.lock
|
|
||||||
yarn-error.log
|
|
||||||
.history
|
|
||||||
CNAME
|
|
||||||
/build
|
|
||||||
/public
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'all',
|
|
||||||
printWidth: 100,
|
|
||||||
proseWrap: 'never',
|
|
||||||
endOfLine: 'lf',
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: '.prettierrc',
|
|
||||||
options: {
|
|
||||||
parser: 'json',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: 'document.ejs',
|
|
||||||
options: {
|
|
||||||
parser: 'html',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
1
134.3ec4f3bc.async.js
Normal file
1
134.3ec4f3bc.async.js
Normal file
File diff suppressed because one or more lines are too long
297
140.da0c226b.async.js
Normal file
297
140.da0c226b.async.js
Normal file
File diff suppressed because one or more lines are too long
236
217.ee6b7f3b.async.js
Normal file
236
217.ee6b7f3b.async.js
Normal file
File diff suppressed because one or more lines are too long
42
276.d255913c.async.js
Normal file
42
276.d255913c.async.js
Normal file
File diff suppressed because one or more lines are too long
1
390.41467286.async.js
Normal file
1
390.41467286.async.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[390],{96390:function(o,n,t){t.r(n),t.d(n,{default:function(){return E}});var O=t(67294),u=t(35312),s=t(85893);function E(){var e=(0,u.useOutletContext)();return(0,s.jsx)(u.Outlet,{context:e})}}}]);
|
||||||
10
393.fb29dfde.async.js
Normal file
10
393.fb29dfde.async.js
Normal file
File diff suppressed because one or more lines are too long
21
421.42c42abc.async.js
Normal file
21
421.42c42abc.async.js
Normal file
File diff suppressed because one or more lines are too long
8
559.c5ec3d42.async.js
Normal file
8
559.c5ec3d42.async.js
Normal file
File diff suppressed because one or more lines are too long
24
781.0077d585.async.js
Normal file
24
781.0077d585.async.js
Normal file
File diff suppressed because one or more lines are too long
3
897.fc555352.async.js
Normal file
3
897.fc555352.async.js
Normal file
File diff suppressed because one or more lines are too long
1
905.6e225d1b.async.js
Normal file
1
905.6e225d1b.async.js
Normal file
File diff suppressed because one or more lines are too long
27
992.0e91f55e.async.js
Normal file
27
992.0e91f55e.async.js
Normal file
File diff suppressed because one or more lines are too long
674
LICENSE
674
LICENSE
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
57
README.md
57
README.md
@ -1,57 +0,0 @@
|
|||||||
# Ans 智能 BI
|
|
||||||
|
|
||||||
This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
|
|
||||||
|
|
||||||
## Environment Prepare
|
|
||||||
|
|
||||||
Install `node_modules`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn
|
|
||||||
```
|
|
||||||
|
|
||||||
## Provided Scripts
|
|
||||||
|
|
||||||
Ans 智能 BI provides some useful script to help you quick start and build with web project, code style check and test.
|
|
||||||
|
|
||||||
Scripts provided in `package.json`. It's safe to modify or add additional script:
|
|
||||||
|
|
||||||
### Start project
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm start
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build project
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Check code style
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run lint
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also use script to auto fix some lint error:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run lint:fix
|
|
||||||
```
|
|
||||||
|
|
||||||
### Test code
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm test
|
|
||||||
```
|
|
||||||
|
|
||||||
## More
|
|
||||||
|
|
||||||
You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).
|
|
||||||
147
config/config.ts
147
config/config.ts
@ -1,147 +0,0 @@
|
|||||||
// https://umijs.org/config/
|
|
||||||
import { defineConfig } from '@umijs/max';
|
|
||||||
import defaultSettings from './defaultSettings';
|
|
||||||
import proxy from './proxy';
|
|
||||||
import routes from './routes';
|
|
||||||
const { REACT_APP_ENV = 'dev' } = process.env;
|
|
||||||
export default defineConfig({
|
|
||||||
/**
|
|
||||||
* @name 开启 hash 模式
|
|
||||||
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
|
|
||||||
* @doc https://umijs.org/docs/api/config#hash
|
|
||||||
*/
|
|
||||||
hash: true,
|
|
||||||
/**
|
|
||||||
* @name 兼容性设置
|
|
||||||
* @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
|
|
||||||
* @doc https://umijs.org/docs/api/config#targets
|
|
||||||
*/
|
|
||||||
// targets: {
|
|
||||||
// ie: 11,
|
|
||||||
// },
|
|
||||||
/**
|
|
||||||
* @name 路由的配置,不在路由中引入的文件不会编译
|
|
||||||
* @description 只支持 path,component,routes,redirect,wrappers,title 的配置
|
|
||||||
* @doc https://umijs.org/docs/guides/routes
|
|
||||||
*/
|
|
||||||
// umi routes: https://umijs.org/docs/routing
|
|
||||||
routes,
|
|
||||||
/**
|
|
||||||
* @name 主题的配置
|
|
||||||
* @description 虽然叫主题,但是其实只是 less 的变量设置
|
|
||||||
* @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn
|
|
||||||
* @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme
|
|
||||||
*/
|
|
||||||
theme: {
|
|
||||||
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
|
|
||||||
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
|
|
||||||
'root-entry-name': 'variable',
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @name moment 的国际化配置
|
|
||||||
* @description 如果对国际化没有要求,打开之后能减少js的包大小
|
|
||||||
* @doc https://umijs.org/docs/api/config#ignoremomentlocale
|
|
||||||
*/
|
|
||||||
ignoreMomentLocale: true,
|
|
||||||
/**
|
|
||||||
* @name 代理配置
|
|
||||||
* @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
|
|
||||||
* @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。
|
|
||||||
* @doc 代理介绍 https://umijs.org/docs/guides/proxy
|
|
||||||
* @doc 代理配置 https://umijs.org/docs/api/config#proxy
|
|
||||||
*/
|
|
||||||
proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
|
|
||||||
/**
|
|
||||||
* @name 快速热更新配置
|
|
||||||
* @description 一个不错的热更新组件,更新时可以保留 state
|
|
||||||
*/
|
|
||||||
fastRefresh: true,
|
|
||||||
//============== 以下都是max的插件配置 ===============
|
|
||||||
/**
|
|
||||||
* @name 数据流插件
|
|
||||||
* @@doc https://umijs.org/docs/max/data-flow
|
|
||||||
*/
|
|
||||||
model: {},
|
|
||||||
/**
|
|
||||||
* 一个全局的初始数据流,可以用它在插件之间共享数据
|
|
||||||
* @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。
|
|
||||||
* @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81
|
|
||||||
*/
|
|
||||||
initialState: {},
|
|
||||||
/**
|
|
||||||
* @name layout 插件
|
|
||||||
* @doc https://umijs.org/docs/max/layout-menu
|
|
||||||
*/
|
|
||||||
title: 'Ans智能BI',
|
|
||||||
layout: {
|
|
||||||
locale: true,
|
|
||||||
...defaultSettings,
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @name moment2dayjs 插件
|
|
||||||
* @description 将项目中的 moment 替换为 dayjs
|
|
||||||
* @doc https://umijs.org/docs/max/moment2dayjs
|
|
||||||
*/
|
|
||||||
moment2dayjs: {
|
|
||||||
preset: 'antd',
|
|
||||||
plugins: ['duration'],
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @name 国际化插件
|
|
||||||
* @doc https://umijs.org/docs/max/i18n
|
|
||||||
*/ /**
|
|
||||||
* @name antd 插件
|
|
||||||
* @description 内置了 babel import 插件
|
|
||||||
* @doc https://umijs.org/docs/max/antd#antd
|
|
||||||
*/
|
|
||||||
antd: {},
|
|
||||||
/**
|
|
||||||
* @name 网络请求配置
|
|
||||||
* @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
|
|
||||||
* @doc https://umijs.org/docs/max/request
|
|
||||||
*/
|
|
||||||
request: {},
|
|
||||||
/**
|
|
||||||
* @name 权限插件
|
|
||||||
* @description 基于 initialState 的权限插件,必须先打开 initialState
|
|
||||||
* @doc https://umijs.org/docs/max/access
|
|
||||||
*/
|
|
||||||
access: {},
|
|
||||||
/**
|
|
||||||
* @name <head> 中额外的 script
|
|
||||||
* @description 配置 <head> 中额外的 script
|
|
||||||
*/
|
|
||||||
headScripts: [
|
|
||||||
// 解决首次加载时白屏的问题
|
|
||||||
{
|
|
||||||
src: '/scripts/loading.js',
|
|
||||||
async: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
//================ pro 插件配置 =================
|
|
||||||
presets: ['umi-presets-pro'],
|
|
||||||
/**
|
|
||||||
* @name openAPI 插件的配置
|
|
||||||
* @description 基于 openapi 的规范生成serve 和mock,能减少很多样板代码
|
|
||||||
* @doc https://pro.ant.design/zh-cn/docs/openapi/
|
|
||||||
*/
|
|
||||||
openAPI: [
|
|
||||||
{
|
|
||||||
requestLibPath: "import { request } from '@umijs/max'",
|
|
||||||
// 或者使用在线的版本
|
|
||||||
schemaPath: 'http://localhost:8101/api/v2/api-docs',
|
|
||||||
projectName: 'answerbi',
|
|
||||||
//schemaPath: join(__dirname, 'oneapi.json'),
|
|
||||||
mock: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
requestLibPath: "import { request } from '@umijs/max'",
|
|
||||||
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
|
|
||||||
projectName: 'swagger',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
mfsu: {
|
|
||||||
strategy: 'normal',
|
|
||||||
},
|
|
||||||
requestRecord: {},
|
|
||||||
});
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
import { ProLayoutProps } from '@ant-design/pro-components';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name
|
|
||||||
*/
|
|
||||||
const Settings: ProLayoutProps & {
|
|
||||||
pwa?: boolean;
|
|
||||||
logo?: string;
|
|
||||||
} = {
|
|
||||||
navTheme: 'light',
|
|
||||||
// 拂晓蓝
|
|
||||||
colorPrimary: '#1890ff',
|
|
||||||
layout: 'mix',
|
|
||||||
contentWidth: 'Fluid',
|
|
||||||
fixedHeader: false,
|
|
||||||
fixSiderbar: true,
|
|
||||||
splitMenus: false,
|
|
||||||
colorWeak: false,
|
|
||||||
title: 'Ans智能BI',
|
|
||||||
pwa: true,
|
|
||||||
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
|
|
||||||
iconfontUrl: '',
|
|
||||||
token: {
|
|
||||||
// 参见ts声明,demo 见文档,通过token 修改样式
|
|
||||||
//https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Settings;
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
/**
|
|
||||||
* @name 代理的配置
|
|
||||||
* @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
|
|
||||||
* -------------------------------
|
|
||||||
* The agent cannot take effect in the production environment
|
|
||||||
* so there is no configuration of the production environment
|
|
||||||
* For details, please see
|
|
||||||
* https://pro.ant.design/docs/deploy
|
|
||||||
*
|
|
||||||
* @doc https://umijs.org/docs/guides/proxy
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
// 如果需要自定义本地开发服务器 请取消注释按需调整
|
|
||||||
// dev: {
|
|
||||||
// // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
|
||||||
// '/api/': {
|
|
||||||
// // 要代理的地址
|
|
||||||
// target: 'https://preview.pro.ant.design',
|
|
||||||
// // 配置了这个可以从 http 代理到 https
|
|
||||||
// // 依赖 origin 的功能可能需要这个,比如 cookie
|
|
||||||
// changeOrigin: true,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name 详细的代理配置
|
|
||||||
* @doc https://github.com/chimurai/http-proxy-middleware
|
|
||||||
*/
|
|
||||||
test: {
|
|
||||||
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
|
||||||
'/api/': {
|
|
||||||
target: 'https://proapi.azurewebsites.net',
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: { '^': '' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pre: {
|
|
||||||
'/api/': {
|
|
||||||
target: 'your pre url',
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: { '^': '' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
export default [
|
|
||||||
{
|
|
||||||
path: '/user',
|
|
||||||
layout: false,
|
|
||||||
routes: [
|
|
||||||
{ name: '登录', path: '/user/login', component: './User/Login' },
|
|
||||||
{ name: '注册', path: '/user/register', component: './User/Register' }
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '智能分析',
|
|
||||||
path: '/analyze',
|
|
||||||
icon: 'barChart',
|
|
||||||
component: './Chart/AddChart'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '智能分析(异步)',
|
|
||||||
path: '/analyze/async',
|
|
||||||
icon: 'barChart',
|
|
||||||
component: './Chart/AddChartAsync'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '我的图表',
|
|
||||||
path: '/my_chart',
|
|
||||||
icon: 'pieChart',
|
|
||||||
component: './Chart/MyChart'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/admin',
|
|
||||||
name: '管理页',
|
|
||||||
icon: 'crown',
|
|
||||||
access: 'canAdmin',
|
|
||||||
routes: [
|
|
||||||
{ path: '/admin', redirect: 'user-manage' },
|
|
||||||
{ path: '/admin/user-manage', name: '用户管理', icon: 'smile', component: './Admin/UserManage' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{ path: '/', redirect: '/analyze' },
|
|
||||||
{ path: '*', layout: false, component: './404' },
|
|
||||||
];
|
|
||||||
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
16
index.html
Normal file
16
index.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Ans智能BI</title>
|
||||||
|
<link rel="stylesheet" href="/umi.426615b6.css">
|
||||||
|
<script async src="/scripts/loading.js"></script>
|
||||||
|
<script>!function(){"use strict";var t="/".replace(/([^/])$/,"$1/"),e=location.pathname,n=e.startsWith(t)&&decodeURI("/".concat(e.slice(t.length)));if(n){var a=document,c=a.head,r=a.createElement.bind(a),i=function(t,e,n){var a,c=e.r[t]||(null===(a=Object.entries(e.r).find((function(e){var n=e[0];return new RegExp("^".concat(n.replace(/\/:[^/]+/g,"/[^/]+").replace("/*","/.+"),"$")).test(t)})))||void 0===a?void 0:a[1]);return null==c?void 0:c.map((function(t){var a=e.f[t][1],c=e.f[t][0];return{type:c.split(".").pop(),url:"".concat(n.publicPath).concat(c),attrs:[["data-".concat(e.b),"".concat(e.p,":").concat(a)]]}}))}(n,{"p":"ant-design-pro","b":"webpack","f":[["p__Chart__AddChart__index.a2ceb04e.async.js",12],["134.3ec4f3bc.async.js",134],["140.da0c226b.async.js",140],["217.ee6b7f3b.async.js",217],["276.d255913c.async.js",276],["t__plugin-layout__Layout.6cae69f5.chunk.css",301],["t__plugin-layout__Layout.ccbd539b.async.js",301],["p__User__Login__index.14e6857c.async.js",366],["p__Chart__MyChart__index.efcc7ecd.async.js",375],["390.41467286.async.js",390],["393.fb29dfde.async.js",393],["421.42c42abc.async.js",421],["p__User__Register__index.c1185fca.async.js",470],["p__Chart__AddChartAsync__index.c490d257.async.js",471],["559.c5ec3d42.async.js",559],["p__404.23e1e28a.async.js",571],["781.0077d585.async.js",781],["897.fc555352.async.js",897],["p__Admin__UserManage__index.8e0adaf6.async.js",901],["905.6e225d1b.async.js",905],["992.0e91f55e.async.js",992]],"r":{"/*":[15,19],"/":[1,5,6,14,19,20],"/analyze":[0,4,10,11,14,16,17,1,5,6,19,20],"/my_chart":[1,4,8,10,14,17,19,5,6,20],"/user/login":[1,2,7,16,17],"/user/register":[1,2,12,16,17],"/analyze/async":[10,11,13,14,16,17,1,5,6,19,20],"/admin/user-manage":[1,2,3,16,17,18,19,5,6,14,20]}},{publicPath:"/"});null==i||i.forEach((function(t){var e,n=t.type,a=t.url;if("js"===n)(e=r("script")).src=a,e.async=!0;else{if("css"!==n)return;(e=r("link")).href=a,e.rel="preload",e.as="style"}t.attrs.forEach((function(t){e.setAttribute(t[0],t[1]||"")})),c.appendChild(e)}))}}();</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script src="/umi.2ed4be52.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
1
p__404.23e1e28a.async.js
Normal file
1
p__404.23e1e28a.async.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[571],{9826:function(E,n,t){t.r(n);var a=t(35312),o=t(29905),_=t(14726),P=t(67294),s=t(85893),u=function(){return(0,s.jsx)(o.ZP,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist.",extra:(0,s.jsx)(_.ZP,{type:"primary",onClick:function(){return a.history.push("/")},children:"Back Home"})})};n.default=u}}]);
|
||||||
1
p__Admin__UserManage__index.8e0adaf6.async.js
Normal file
1
p__Admin__UserManage__index.8e0adaf6.async.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[901],{14145:function(j,m,t){t.r(m),t.d(m,{waitTime:function(){return D},waitTimePromise:function(){return p}});var v=t(97857),f=t.n(v),E=t(15009),o=t.n(E),h=t(99289),c=t.n(h),g=t(42127),b=t(96906),T=t(86120),P=t(67294),d=t(85893),p=function(){var u=c()(o()().mark(function a(){var e,r=arguments;return o()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e=r.length>0&&r[0]!==void 0?r[0]:100,n.abrupt("return",new Promise(function(_){setTimeout(function(){_(!0)},e)}));case 2:case"end":return n.stop()}},a)}));return function(){return u.apply(this,arguments)}}(),D=function(){var u=c()(o()().mark(function a(){var e,r=arguments;return o()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e=r.length>0&&r[0]!==void 0?r[0]:100,n.next=3,p(e);case 3:case"end":return n.stop()}},a)}));return function(){return u.apply(this,arguments)}}(),y=[{dataIndex:"id",valueType:"indexBorder",width:48},{title:"\u6635\u79F0",dataIndex:"userName",copyable:!0},{title:"\u7528\u6237\u8D26\u53F7",dataIndex:"userAccount",copyable:!0},{title:"\u5934\u50CF",dataIndex:"userAvatar",search:!1,render:function(a,e){return(0,d.jsx)("div",{children:(0,d.jsx)("img",{src:e.userAvatar,width:100})})}},{title:"\u89D2\u8272",dataIndex:"userRole",valueType:"select",valueEnum:{user:{text:"\u666E\u901A\u7528\u6237",status:"Default"},admin:{text:"\u7BA1\u7406\u5458",status:"Success"},ban:{text:"\u8FDD\u89C4\u88AB\u5C01",status:"Error"}}},{title:"\u521B\u5EFA\u65F6\u95F4",key:"createdTime",dataIndex:"createdTime",valueType:"dateTime",sorter:!0,search:!1},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(a,e,r,s){return[(0,d.jsx)("a",{onClick:function(){var _;s==null||(_=s.startEditable)===null||_===void 0||_.call(s,e.id)},children:"\u7F16\u8F91"},"editable"),(0,d.jsx)(b.Z,{onSelect:function(){return s==null?void 0:s.reload()},menus:[{key:"copy",name:"\u590D\u5236"},{key:"delete",name:"\u5220\u9664"}]},"actionGroup")]}}];m.default=function(){var u=(0,P.useRef)();return(0,d.jsx)(T.Z,{columns:y,actionRef:u,cardBordered:!0,request:c()(o()().mark(function a(){var e,r,s,n,_,i=arguments;return o()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return r=i.length>0&&i[0]!==void 0?i[0]:{},s=i.length>1?i[1]:void 0,n=i.length>2?i[2]:void 0,console.log(s,n),l.next=6,(0,g.fY)(r);case 6:return _=l.sent,l.abrupt("return",{data:(e=_.data)===null||e===void 0?void 0:e.records});case 8:case"end":return l.stop()}},a)})),editable:{type:"multiple"},columnsState:{persistenceKey:"pro-table-singe-demos",persistenceType:"localStorage",onChange:function(e){console.log("value: ",e)}},rowKey:"id",search:{labelWidth:"auto"},options:{setting:{listsHeight:400}},form:{syncToUrl:function(e,r){return r==="get"?f()(f()({},e),{},{created_at:[e.startTime,e.endTime]}):e}},pagination:{pageSize:10,onChange:function(e){return console.log(e)}},dateFormatter:"string",headerTitle:"\u7528\u6237\u5217\u8868"})}}}]);
|
||||||
1
p__Chart__AddChartAsync__index.c490d257.async.js
Normal file
1
p__Chart__AddChartAsync__index.c490d257.async.js
Normal file
File diff suppressed because one or more lines are too long
1
p__Chart__AddChart__index.a2ceb04e.async.js
Normal file
1
p__Chart__AddChart__index.a2ceb04e.async.js
Normal file
File diff suppressed because one or more lines are too long
1
p__Chart__MyChart__index.efcc7ecd.async.js
Normal file
1
p__Chart__MyChart__index.efcc7ecd.async.js
Normal file
File diff suppressed because one or more lines are too long
1
p__User__Login__index.14e6857c.async.js
Normal file
1
p__User__Login__index.14e6857c.async.js
Normal file
File diff suppressed because one or more lines are too long
1
p__User__Register__index.c1185fca.async.js
Normal file
1
p__User__Register__index.c1185fca.async.js
Normal file
File diff suppressed because one or more lines are too long
102
package.json
102
package.json
@ -1,102 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "ant-design-pro",
|
|
||||||
"version": "6.0.0",
|
|
||||||
"private": true,
|
|
||||||
"description": "An out-of-box UI solution for enterprise applications",
|
|
||||||
"scripts": {
|
|
||||||
"analyze": "cross-env ANALYZE=1 max build",
|
|
||||||
"build": "max build",
|
|
||||||
"deploy": "npm run build && npm run gh-pages",
|
|
||||||
"dev": "npm run start:dev",
|
|
||||||
"gh-pages": "gh-pages -d dist",
|
|
||||||
"i18n-remove": "pro i18n-remove --locale=zh-CN --write",
|
|
||||||
"postinstall": "max setup",
|
|
||||||
"jest": "jest",
|
|
||||||
"lint": "npm run lint:js && npm run lint:prettier && npm run tsc",
|
|
||||||
"lint-staged": "lint-staged",
|
|
||||||
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
|
|
||||||
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
|
|
||||||
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
|
|
||||||
"lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
|
|
||||||
"openapi": "max openapi",
|
|
||||||
"prepare": "husky install",
|
|
||||||
"prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
|
|
||||||
"preview": "npm run build && max preview --port 8000",
|
|
||||||
"record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login",
|
|
||||||
"serve": "umi-serve",
|
|
||||||
"start": "cross-env UMI_ENV=dev max dev",
|
|
||||||
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev",
|
|
||||||
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev",
|
|
||||||
"start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev",
|
|
||||||
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev",
|
|
||||||
"test": "jest",
|
|
||||||
"test:coverage": "npm run jest -- --coverage",
|
|
||||||
"test:update": "npm run jest -- -u",
|
|
||||||
"tsc": "tsc --noEmit"
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
|
|
||||||
"**/*.{js,jsx,tsx,ts,less,md,json}": [
|
|
||||||
"prettier --write"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"not ie <= 10"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"@ant-design/icons": "^4.8.0",
|
|
||||||
"@ant-design/pro-components": "^2.3.57",
|
|
||||||
"@ant-design/use-emotion-css": "1.0.4",
|
|
||||||
"@umijs/route-utils": "^2.2.2",
|
|
||||||
"antd": "^5.2.2",
|
|
||||||
"classnames": "^2.3.2",
|
|
||||||
"echarts-for-react": "^3.0.2",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"moment": "^2.29.4",
|
|
||||||
"omit.js": "^2.0.2",
|
|
||||||
"rc-menu": "^9.8.2",
|
|
||||||
"rc-util": "^5.27.2",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-dev-inspector": "^1.8.4",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"react-helmet-async": "^1.3.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@ant-design/pro-cli": "^2.1.5",
|
|
||||||
"@testing-library/react": "^13.4.0",
|
|
||||||
"@types/classnames": "^2.3.1",
|
|
||||||
"@types/express": "^4.17.17",
|
|
||||||
"@types/history": "^4.7.11",
|
|
||||||
"@types/jest": "^29.4.0",
|
|
||||||
"@types/lodash": "^4.14.191",
|
|
||||||
"@types/react": "^18.0.28",
|
|
||||||
"@types/react-dom": "^18.0.11",
|
|
||||||
"@types/react-helmet": "^6.1.6",
|
|
||||||
"@umijs/fabric": "^2.14.1",
|
|
||||||
"@umijs/lint": "^4.0.52",
|
|
||||||
"@umijs/max": "^4.0.52",
|
|
||||||
"add": "^2.0.6",
|
|
||||||
"cross-env": "^7.0.3",
|
|
||||||
"eslint": "^8.34.0",
|
|
||||||
"eslint-config-prettier": "^8.8.0",
|
|
||||||
"eslint-plugin-unicorn": "^47.0.0",
|
|
||||||
"express": "^4.18.2",
|
|
||||||
"gh-pages": "^3.2.3",
|
|
||||||
"husky": "^7.0.4",
|
|
||||||
"jest": "^29.4.3",
|
|
||||||
"jest-environment-jsdom": "^29.4.3",
|
|
||||||
"lint-staged": "^10.5.4",
|
|
||||||
"mockjs": "^1.1.0",
|
|
||||||
"prettier": "^2.8.4",
|
|
||||||
"swagger-ui-dist": "^4.15.5",
|
|
||||||
"ts-node": "^10.9.1",
|
|
||||||
"typescript": "^4.9.5",
|
|
||||||
"umi-presets-pro": "^2.0.2",
|
|
||||||
"yarn": "^1.22.19"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16883
pnpm-lock.yaml
generated
16883
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* @see https://umijs.org/zh-CN/plugins/plugin-access
|
|
||||||
* */
|
|
||||||
export default function access(initialState: { currentUser?: API.LoginUserVO } | undefined) {
|
|
||||||
const { currentUser } = initialState ?? {};
|
|
||||||
return {
|
|
||||||
canAdmin: currentUser && currentUser.userRole === 'admin',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
135
src/app.tsx
135
src/app.tsx
@ -1,135 +0,0 @@
|
|||||||
import Footer from '@/components/Footer';
|
|
||||||
import { Question } from '@/components/RightContent';
|
|
||||||
import { LinkOutlined } from '@ant-design/icons';
|
|
||||||
import type { Settings as LayoutSettings } from '@ant-design/pro-components';
|
|
||||||
import { SettingDrawer } from '@ant-design/pro-components';
|
|
||||||
import type { RunTimeLayoutConfig } from '@umijs/max';
|
|
||||||
import { history, Link } from '@umijs/max';
|
|
||||||
import defaultSettings from '../config/defaultSettings';
|
|
||||||
import { AvatarDropdown, AvatarName } from './components/RightContent/AvatarDropdown';
|
|
||||||
import { errorConfig } from './requestConfig';
|
|
||||||
import { getLoginUserUsingGET } from './services/answerbi/userController';
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
|
||||||
const loginPath = '/user/login';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see https://umijs.org/zh-CN/plugins/plugin-initial-state
|
|
||||||
* */
|
|
||||||
export async function getInitialState(): Promise<{
|
|
||||||
settings?: Partial<LayoutSettings>;
|
|
||||||
currentUser?: API.LoginUserVO;
|
|
||||||
}> {
|
|
||||||
const fetchUserInfo = async () => {
|
|
||||||
try {
|
|
||||||
const res = await getLoginUserUsingGET();
|
|
||||||
return res.data;
|
|
||||||
} catch (error) {
|
|
||||||
//history.push(loginPath);
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
};
|
|
||||||
// 如果不是登录页面,执行
|
|
||||||
const { location } = history;
|
|
||||||
if (location.pathname !== loginPath) {
|
|
||||||
const currentUser = await fetchUserInfo();
|
|
||||||
return {
|
|
||||||
currentUser,
|
|
||||||
settings: defaultSettings as Partial<LayoutSettings>,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
settings: defaultSettings as Partial<LayoutSettings>,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// ProLayout 支持的api https://procomponents.ant.design/components/layout
|
|
||||||
export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) => {
|
|
||||||
return {
|
|
||||||
actionsRender: () => [<Question key="doc" />],
|
|
||||||
avatarProps: {
|
|
||||||
src: initialState?.currentUser?.userAvatar,
|
|
||||||
title: <AvatarName />,
|
|
||||||
render: (_, avatarChildren) => {
|
|
||||||
return <AvatarDropdown>{avatarChildren}</AvatarDropdown>;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
waterMarkProps: {
|
|
||||||
content: initialState?.currentUser?.userName,
|
|
||||||
},
|
|
||||||
footerRender: () => <Footer />,
|
|
||||||
onPageChange: () => {
|
|
||||||
const { location } = history;
|
|
||||||
const whiteList = ['/user/register',loginPath];
|
|
||||||
if(whiteList.includes(location.pathname)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 如果没有登录,重定向到 login
|
|
||||||
if (!initialState?.currentUser) {
|
|
||||||
history.push(loginPath);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
layoutBgImgList: [
|
|
||||||
{
|
|
||||||
src: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/D2LWSqNny4sAAAAAAAAAAAAAFl94AQBr',
|
|
||||||
left: 85,
|
|
||||||
bottom: 100,
|
|
||||||
height: '303px',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/C2TWRpJpiC0AAAAAAAAAAAAAFl94AQBr',
|
|
||||||
bottom: -68,
|
|
||||||
right: -45,
|
|
||||||
height: '303px',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: 'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/F6vSTbj8KpYAAAAAAAAAAAAAFl94AQBr',
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '331px',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
links: isDev
|
|
||||||
? [
|
|
||||||
<Link key="openapi" to="/umi/plugin/openapi" target="_blank">
|
|
||||||
<LinkOutlined />
|
|
||||||
<span>OpenAPI 文档</span>
|
|
||||||
</Link>,
|
|
||||||
]
|
|
||||||
: [],
|
|
||||||
menuHeaderRender: undefined,
|
|
||||||
// 自定义 403 页面
|
|
||||||
// unAccessible: <div>unAccessible</div>,
|
|
||||||
// 增加一个 loading 的状态
|
|
||||||
childrenRender: (children) => {
|
|
||||||
// if (initialState?.loading) return <PageLoading />;
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{children}
|
|
||||||
<SettingDrawer
|
|
||||||
disableUrlParams
|
|
||||||
enableDarkTheme
|
|
||||||
settings={initialState?.settings}
|
|
||||||
onSettingChange={(settings) => {
|
|
||||||
setInitialState((preInitialState) => ({
|
|
||||||
...preInitialState,
|
|
||||||
settings,
|
|
||||||
}));
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
...initialState?.settings,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name request 配置,可以配置错误处理
|
|
||||||
* 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
|
|
||||||
* @doc https://umijs.org/docs/max/request#配置
|
|
||||||
*/
|
|
||||||
export const request = {
|
|
||||||
baseURL: 'http://localhost:8101',
|
|
||||||
withCredentials: true,
|
|
||||||
...errorConfig,
|
|
||||||
};
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
import { GithubOutlined } from '@ant-design/icons';
|
|
||||||
import { DefaultFooter } from '@ant-design/pro-components';
|
|
||||||
import '@umijs/max';
|
|
||||||
import React from 'react';
|
|
||||||
const Footer: React.FC = () => {
|
|
||||||
const defaultMessage = 'YunPeng';
|
|
||||||
const currentYear = new Date().getFullYear();
|
|
||||||
return (
|
|
||||||
<DefaultFooter
|
|
||||||
style={{
|
|
||||||
background: 'none',
|
|
||||||
}}
|
|
||||||
copyright={`${currentYear} ${defaultMessage}`}
|
|
||||||
links={[
|
|
||||||
{
|
|
||||||
key: 'blog',
|
|
||||||
title: 'pengSpace',
|
|
||||||
href: 'https://pengspace.top',
|
|
||||||
blankTarget: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'github',
|
|
||||||
title: <GithubOutlined />,
|
|
||||||
href: 'https://gitee.com/anscoder',
|
|
||||||
blankTarget: true,
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default Footer;
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import { Dropdown } from 'antd';
|
|
||||||
import type { DropDownProps } from 'antd/es/dropdown';
|
|
||||||
import React from 'react';
|
|
||||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
export type HeaderDropdownProps = {
|
|
||||||
overlayClassName?: string;
|
|
||||||
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight' | 'bottomCenter';
|
|
||||||
} & Omit<DropDownProps, 'overlay'>;
|
|
||||||
|
|
||||||
const HeaderDropdown: React.FC<HeaderDropdownProps> = ({ overlayClassName: cls, ...restProps }) => {
|
|
||||||
const className = useEmotionCss(({ token }) => {
|
|
||||||
return {
|
|
||||||
[`@media screen and (max-width: ${token.screenXS})`]: {
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
return <Dropdown overlayClassName={classNames(className, cls)} {...restProps} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default HeaderDropdown;
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
import { userLogoutUsingPOST } from '@/services/answerbi/userController';
|
|
||||||
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
|
|
||||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
|
||||||
import { history, useModel } from '@umijs/max';
|
|
||||||
import { Spin } from 'antd';
|
|
||||||
import { stringify } from 'querystring';
|
|
||||||
import type { MenuInfo } from 'rc-menu/lib/interface';
|
|
||||||
import React, { useCallback } from 'react';
|
|
||||||
import { flushSync } from 'react-dom';
|
|
||||||
import HeaderDropdown from '../HeaderDropdown';
|
|
||||||
|
|
||||||
export type GlobalHeaderRightProps = {
|
|
||||||
menu?: boolean;
|
|
||||||
children?: React.ReactNode;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AvatarName = () => {
|
|
||||||
const { initialState } = useModel('@@initialState');
|
|
||||||
const { currentUser } = initialState || {};
|
|
||||||
return <span className="anticon">{currentUser?.userName}</span>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu, children }) => {
|
|
||||||
/**
|
|
||||||
* 退出登录,并且将当前的 url 保存
|
|
||||||
*/
|
|
||||||
const loginOut = async () => {
|
|
||||||
await userLogoutUsingPOST();
|
|
||||||
const { search, pathname } = window.location;
|
|
||||||
const urlParams = new URL(window.location.href).searchParams;
|
|
||||||
/** 此方法会跳转到 redirect 参数所在的位置 */
|
|
||||||
const redirect = urlParams.get('redirect');
|
|
||||||
// Note: There may be security issues, please note
|
|
||||||
if (window.location.pathname !== '/user/login' && !redirect) {
|
|
||||||
history.replace({
|
|
||||||
pathname: '/user/login',
|
|
||||||
search: stringify({
|
|
||||||
redirect: pathname + search,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const actionClassName = useEmotionCss(({ token }) => {
|
|
||||||
return {
|
|
||||||
display: 'flex',
|
|
||||||
height: '48px',
|
|
||||||
marginLeft: 'auto',
|
|
||||||
overflow: 'hidden',
|
|
||||||
alignItems: 'center',
|
|
||||||
padding: '0 8px',
|
|
||||||
cursor: 'pointer',
|
|
||||||
borderRadius: token.borderRadius,
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: token.colorBgTextHover,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
const { initialState, setInitialState } = useModel('@@initialState');
|
|
||||||
|
|
||||||
const onMenuClick = useCallback(
|
|
||||||
(event: MenuInfo) => {
|
|
||||||
const { key } = event;
|
|
||||||
if (key === 'logout') {
|
|
||||||
flushSync(() => {
|
|
||||||
setInitialState((s) => ({ ...s, currentUser: undefined }));
|
|
||||||
});
|
|
||||||
loginOut();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
history.push(`/account/${key}`);
|
|
||||||
},
|
|
||||||
[setInitialState],
|
|
||||||
);
|
|
||||||
|
|
||||||
const loading = (
|
|
||||||
<span className={actionClassName}>
|
|
||||||
<Spin
|
|
||||||
size="small"
|
|
||||||
style={{
|
|
||||||
marginLeft: 8,
|
|
||||||
marginRight: 8,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!initialState) {
|
|
||||||
return loading;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { currentUser } = initialState;
|
|
||||||
|
|
||||||
if (!currentUser || !currentUser.userName) {
|
|
||||||
return loading;
|
|
||||||
}
|
|
||||||
|
|
||||||
const menuItems = [
|
|
||||||
...(menu
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
key: 'center',
|
|
||||||
icon: <UserOutlined />,
|
|
||||||
label: '个人中心',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'settings',
|
|
||||||
icon: <SettingOutlined />,
|
|
||||||
label: '个人设置',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'divider' as const,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
|
||||||
key: 'logout',
|
|
||||||
icon: <LogoutOutlined />,
|
|
||||||
label: '退出登录',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<HeaderDropdown
|
|
||||||
menu={{
|
|
||||||
selectedKeys: [],
|
|
||||||
onClick: onMenuClick,
|
|
||||||
items: menuItems,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</HeaderDropdown>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
||||||
import '@umijs/max';
|
|
||||||
export type SiderTheme = 'light' | 'dark';
|
|
||||||
export const SelectLang = () => {
|
|
||||||
return (
|
|
||||||
<UmiSelectLang
|
|
||||||
style={{
|
|
||||||
padding: 4,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export const Question = () => {
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
height: 26,
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
window.open('https://pro.ant.design/docs/getting-started');
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<QuestionCircleOutlined />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
html,
|
|
||||||
body,
|
|
||||||
#root {
|
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
||||||
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
||||||
'Noto Color Emoji';
|
|
||||||
}
|
|
||||||
|
|
||||||
.colorWeak {
|
|
||||||
filter: invert(80%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-layout {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
|
|
||||||
left: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
text-rendering: optimizeLegibility;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.ant-table {
|
|
||||||
width: 100%;
|
|
||||||
overflow-x: auto;
|
|
||||||
&-thead > tr,
|
|
||||||
&-tbody > tr {
|
|
||||||
> th,
|
|
||||||
> td {
|
|
||||||
white-space: pre;
|
|
||||||
> span {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.margin-16 {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
import '@umijs/max';
|
|
||||||
import { Button, message, notification } from 'antd';
|
|
||||||
import defaultSettings from '../config/defaultSettings';
|
|
||||||
const { pwa } = defaultSettings;
|
|
||||||
const isHttps = document.location.protocol === 'https:';
|
|
||||||
const clearCache = () => {
|
|
||||||
// remove all caches
|
|
||||||
if (window.caches) {
|
|
||||||
caches
|
|
||||||
.keys()
|
|
||||||
.then((keys) => {
|
|
||||||
keys.forEach((key) => {
|
|
||||||
caches.delete(key);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((e) => console.log(e));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// if pwa is true
|
|
||||||
if (pwa) {
|
|
||||||
// Notify user if offline now
|
|
||||||
window.addEventListener('sw.offline', () => {
|
|
||||||
message.warning('当前处于离线状态');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Pop up a prompt on the page asking the user if they want to use the latest version
|
|
||||||
window.addEventListener('sw.updated', (event: Event) => {
|
|
||||||
const e = event as CustomEvent;
|
|
||||||
const reloadSW = async () => {
|
|
||||||
// Check if there is sw whose state is waiting in ServiceWorkerRegistration
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
|
|
||||||
const worker = e.detail && e.detail.waiting;
|
|
||||||
if (!worker) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Send skip-waiting event to waiting SW with MessageChannel
|
|
||||||
await new Promise((resolve, reject) => {
|
|
||||||
const channel = new MessageChannel();
|
|
||||||
channel.port1.onmessage = (msgEvent) => {
|
|
||||||
if (msgEvent.data.error) {
|
|
||||||
reject(msgEvent.data.error);
|
|
||||||
} else {
|
|
||||||
resolve(msgEvent.data);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
worker.postMessage(
|
|
||||||
{
|
|
||||||
type: 'skip-waiting',
|
|
||||||
},
|
|
||||||
[channel.port2],
|
|
||||||
);
|
|
||||||
});
|
|
||||||
clearCache();
|
|
||||||
window.location.reload();
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
const key = `open${Date.now()}`;
|
|
||||||
const btn = (
|
|
||||||
<Button
|
|
||||||
type="primary"
|
|
||||||
onClick={() => {
|
|
||||||
notification.destroy(key);
|
|
||||||
reloadSW();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{'刷新'}
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
notification.open({
|
|
||||||
message: '有新内容',
|
|
||||||
description: '请点击“刷新”按钮或者手动刷新页面',
|
|
||||||
btn,
|
|
||||||
key,
|
|
||||||
onClose: async () => null,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if ('serviceWorker' in navigator && isHttps) {
|
|
||||||
// unregister service worker
|
|
||||||
const { serviceWorker } = navigator;
|
|
||||||
if (serviceWorker.getRegistrations) {
|
|
||||||
serviceWorker.getRegistrations().then((sws) => {
|
|
||||||
sws.forEach((sw) => {
|
|
||||||
sw.unregister();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
serviceWorker.getRegistration().then((sw) => {
|
|
||||||
if (sw) sw.unregister();
|
|
||||||
});
|
|
||||||
clearCache();
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
import { history } from '@umijs/max';
|
|
||||||
import { Button, Result } from 'antd';
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
const NoFoundPage: React.FC = () => (
|
|
||||||
<Result
|
|
||||||
status="404"
|
|
||||||
title="404"
|
|
||||||
subTitle="Sorry, the page you visited does not exist."
|
|
||||||
extra={
|
|
||||||
<Button type="primary" onClick={() => history.push('/')}>
|
|
||||||
Back Home
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default NoFoundPage;
|
|
||||||
@ -1,139 +0,0 @@
|
|||||||
import { listUserByPageUsingPOST } from '@/services/answerbi/userController';
|
|
||||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
|
||||||
import { ProTable, TableDropdown } from '@ant-design/pro-components';
|
|
||||||
import { useRef } from 'react';
|
|
||||||
export const waitTimePromise = async (time: number = 100) => {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
resolve(true);
|
|
||||||
}, time);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const waitTime = async (time: number = 100) => {
|
|
||||||
await waitTimePromise(time);
|
|
||||||
};
|
|
||||||
|
|
||||||
const columns: ProColumns<API.User>[] = [
|
|
||||||
{
|
|
||||||
dataIndex: 'id',
|
|
||||||
valueType: 'indexBorder',
|
|
||||||
width: 48,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '昵称',
|
|
||||||
dataIndex: 'userName',
|
|
||||||
copyable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '用户账号',
|
|
||||||
dataIndex: 'userAccount',
|
|
||||||
copyable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '头像',
|
|
||||||
dataIndex: 'userAvatar',
|
|
||||||
search: false,
|
|
||||||
render: (_, record) => (
|
|
||||||
<div>
|
|
||||||
<img src={record.userAvatar} width={100} />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '角色',
|
|
||||||
dataIndex: 'userRole',
|
|
||||||
valueType: 'select',
|
|
||||||
valueEnum :{
|
|
||||||
'user': {text : '普通用户',status : 'Default'},
|
|
||||||
'admin': {text:'管理员', status : 'Success'},
|
|
||||||
'ban': {text:'违规被封',status:'Error'},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
key: 'createdTime',
|
|
||||||
dataIndex: 'createdTime',
|
|
||||||
valueType: 'dateTime',
|
|
||||||
sorter : true,
|
|
||||||
search : false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
valueType: 'option',
|
|
||||||
key: 'option',
|
|
||||||
render: (text, record, _, action) => [
|
|
||||||
<a
|
|
||||||
key="editable"
|
|
||||||
onClick={() => {
|
|
||||||
action?.startEditable?.(record.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</a>,
|
|
||||||
<TableDropdown
|
|
||||||
key="actionGroup"
|
|
||||||
onSelect={() => action?.reload()}
|
|
||||||
menus={[
|
|
||||||
{ key: 'copy', name: '复制' },
|
|
||||||
{ key: 'delete', name: '删除' },
|
|
||||||
]}
|
|
||||||
/>,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default () => {
|
|
||||||
const actionRef = useRef<ActionType>();
|
|
||||||
return (
|
|
||||||
<ProTable<API.User>
|
|
||||||
columns={columns}
|
|
||||||
actionRef={actionRef}
|
|
||||||
cardBordered
|
|
||||||
request={async (params = {}, sort, filter) => {
|
|
||||||
console.log(sort, filter);
|
|
||||||
const userList = await listUserByPageUsingPOST(params);
|
|
||||||
return {
|
|
||||||
data: userList.data?.records
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
editable={{
|
|
||||||
type: 'multiple',
|
|
||||||
}}
|
|
||||||
columnsState={{
|
|
||||||
persistenceKey: 'pro-table-singe-demos',
|
|
||||||
persistenceType: 'localStorage',
|
|
||||||
onChange(value) {
|
|
||||||
console.log('value: ', value);
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
rowKey="id"
|
|
||||||
search={{
|
|
||||||
labelWidth: 'auto',
|
|
||||||
}}
|
|
||||||
options={{
|
|
||||||
setting: {
|
|
||||||
listsHeight: 400,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
form={{
|
|
||||||
// 由于配置了 transform,提交的参与与定义的不同这里需要转化一下
|
|
||||||
syncToUrl: (values, type) => {
|
|
||||||
if (type === 'get') {
|
|
||||||
return {
|
|
||||||
...values,
|
|
||||||
created_at: [values.startTime, values.endTime],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return values;
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
pagination={{
|
|
||||||
pageSize: 10,
|
|
||||||
onChange: (page) => console.log(page),
|
|
||||||
}}
|
|
||||||
dateFormatter="string"
|
|
||||||
headerTitle="用户列表"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@ -1,134 +0,0 @@
|
|||||||
import { genChartByAiUsingPOST } from '@/services/answerbi/chartController';
|
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Col,
|
|
||||||
Divider,
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
message,
|
|
||||||
Row,
|
|
||||||
Select,
|
|
||||||
Space,
|
|
||||||
Spin,
|
|
||||||
Upload,
|
|
||||||
} from 'antd';
|
|
||||||
import TextArea from 'antd/es/input/TextArea';
|
|
||||||
import ReactECharts from 'echarts-for-react';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
|
|
||||||
const AddChart: React.FC = () => {
|
|
||||||
//定义状态,用来接收后端返回值,让它实时展示再页面上
|
|
||||||
const [chart, setChart] = useState<API.BiResponse>();
|
|
||||||
const [option, setOption] = useState<any>();
|
|
||||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const onFinish = async (values: any) => {
|
|
||||||
if (submitting) return;
|
|
||||||
setSubmitting(true);
|
|
||||||
setChart(undefined);
|
|
||||||
setOption(undefined);
|
|
||||||
//对接后端,上传数据
|
|
||||||
const params = {
|
|
||||||
...values,
|
|
||||||
file: undefined,
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
//需要取到上传的原始数据 file->file->originFileObj
|
|
||||||
const res = await genChartByAiUsingPOST(params, {}, values.file.file.originFileObj);
|
|
||||||
//正常情况下,如果没有返回值就分析失败,有就分析成功
|
|
||||||
if (!res?.data) {
|
|
||||||
message.error(res.message ?? '分析失败');
|
|
||||||
} else {
|
|
||||||
message.success('分析成功');
|
|
||||||
//解析成对象
|
|
||||||
console.log(res.data.genChart);
|
|
||||||
const chartOption = JSON.parse(res.data.genChart ?? '');
|
|
||||||
console.log(chartOption);
|
|
||||||
if (!chartOption) {
|
|
||||||
throw new Error('图表代码解析错误');
|
|
||||||
} else {
|
|
||||||
setChart(res.data);
|
|
||||||
setOption(chartOption);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e: any) {
|
|
||||||
//异常情况下,提示分析失败+具体失败原因
|
|
||||||
message.error('分析失败,' + e.message);
|
|
||||||
}
|
|
||||||
setSubmitting(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="add-chart">
|
|
||||||
<Row gutter={24}>
|
|
||||||
<Col span={12}>
|
|
||||||
<Card title="智能分析">
|
|
||||||
<Form
|
|
||||||
name="addChart"
|
|
||||||
labelAlign="left"
|
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
onFinish={onFinish}
|
|
||||||
initialValues={{}}
|
|
||||||
>
|
|
||||||
<Form.Item
|
|
||||||
name="goal"
|
|
||||||
label="分析目标"
|
|
||||||
rules={[{ required: true, message: '请输入分析目标!' }]}
|
|
||||||
>
|
|
||||||
<TextArea placeholder="请输入你的分析需求,比如:分析网站用户的增长情况" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="chartName" label="图表名称">
|
|
||||||
<Input placeholder="请输入图表名称" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="chartType" label="图表类型">
|
|
||||||
<Select
|
|
||||||
placeholder="请选择图表类型"
|
|
||||||
options={[
|
|
||||||
{ value: '折线图', label: '折线图' },
|
|
||||||
{ value: '柱状图', label: '柱状图' },
|
|
||||||
{ value: '堆叠图', label: '堆叠图' },
|
|
||||||
{ value: '饼图', label: '饼图' },
|
|
||||||
{ value: '雷达图', label: '雷达图' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="file" label="上传原始数据">
|
|
||||||
<Upload name="file" action="/uploadExcel">
|
|
||||||
<Button icon={<UploadOutlined />}>上传EXCEL文件</Button>
|
|
||||||
</Upload>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item wrapperCol={{ span: 12, offset: 6 }}>
|
|
||||||
<Space>
|
|
||||||
<Button type="primary" htmlType="submit">
|
|
||||||
提交
|
|
||||||
</Button>
|
|
||||||
<Button htmlType="reset">重置</Button>
|
|
||||||
</Space>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
</Card>
|
|
||||||
</Col>
|
|
||||||
|
|
||||||
<Col span={12}>
|
|
||||||
<Card title="分析结论">
|
|
||||||
{chart?.genResult ?? <div>请先在左侧提交!</div>}
|
|
||||||
<Spin spinning={submitting} />
|
|
||||||
</Card>
|
|
||||||
<Divider />
|
|
||||||
<Card title="可视化图表">
|
|
||||||
{option ? <ReactECharts option={option} /> : <div>请先在左侧提交!</div>}
|
|
||||||
<Spin spinning={submitting} />
|
|
||||||
</Card>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default AddChart;
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
import { genChartByAiAsyncMqUsingPOST } from '@/services/answerbi/chartController';
|
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
|
||||||
import { Button, Card, Form, Input, message, Select, Space, Upload } from 'antd';
|
|
||||||
import { useForm } from 'antd/es/form/Form';
|
|
||||||
import TextArea from 'antd/es/input/TextArea';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
|
|
||||||
const AddChartAsync: React.FC = () => {
|
|
||||||
//定义状态,用来接收后端返回值,让它实时展示再页面上
|
|
||||||
const [form] = useForm();
|
|
||||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const onFinish = async (values: any) => {
|
|
||||||
if (submitting) return;
|
|
||||||
setSubmitting(true);
|
|
||||||
//对接后端,上传数据
|
|
||||||
const params = {
|
|
||||||
...values,
|
|
||||||
file: undefined,
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
//需要取到上传的原始数据 file->file->originFileObj
|
|
||||||
const res = await genChartByAiAsyncMqUsingPOST(params, {}, values.file.file.originFileObj);
|
|
||||||
//正常情况下,如果没有返回值就分析失败,有就分析成功
|
|
||||||
if (!res?.data) {
|
|
||||||
message.error(res.message ?? '分析失败');
|
|
||||||
} else {
|
|
||||||
message.success('分析任务提交成功,稍后请在我的图表页面查看');
|
|
||||||
form.resetFields();
|
|
||||||
}
|
|
||||||
} catch (e: any) {
|
|
||||||
//异常情况下,提示分析失败+具体失败原因
|
|
||||||
message.error('分析失败,' + e.message);
|
|
||||||
}
|
|
||||||
setSubmitting(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="add-chart-async">
|
|
||||||
<Card title="智能分析">
|
|
||||||
<Form
|
|
||||||
form={form}
|
|
||||||
name="addChart"
|
|
||||||
labelAlign="left"
|
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
onFinish={onFinish}
|
|
||||||
initialValues={{}}
|
|
||||||
>
|
|
||||||
<Form.Item
|
|
||||||
name="goal"
|
|
||||||
label="分析目标"
|
|
||||||
rules={[{ required: true, message: '请输入分析目标!' }]}
|
|
||||||
>
|
|
||||||
<TextArea placeholder="请输入你的分析需求,比如:分析网站用户的增长情况" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="chartName" label="图表名称">
|
|
||||||
<Input placeholder="请输入图表名称" />
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="chartType" label="图表类型">
|
|
||||||
<Select
|
|
||||||
placeholder="请选择图表类型"
|
|
||||||
options={[
|
|
||||||
{ value: '折线图', label: '折线图' },
|
|
||||||
{ value: '柱状图', label: '柱状图' },
|
|
||||||
{ value: '堆叠图', label: '堆叠图' },
|
|
||||||
{ value: '饼图', label: '饼图' },
|
|
||||||
{ value: '雷达图', label: '雷达图' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item name="file" label="上传原始数据">
|
|
||||||
<Upload name="file" action="/uploadExcel">
|
|
||||||
<Button icon={<UploadOutlined />}>上传EXCEL文件</Button>
|
|
||||||
</Upload>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Form.Item wrapperCol={{ span: 12, offset: 6 }}>
|
|
||||||
<Space>
|
|
||||||
<Button type="primary" htmlType="submit">
|
|
||||||
提交
|
|
||||||
</Button>
|
|
||||||
<Button htmlType="reset">重置</Button>
|
|
||||||
</Space>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default AddChartAsync;
|
|
||||||
@ -1,188 +0,0 @@
|
|||||||
import { listMyChartByPageUsingPOST, regenChartByAiAsyncMqUsingPOST } from '@/services/answerbi/chartController';
|
|
||||||
import { useModel } from '@umijs/max';
|
|
||||||
import { Avatar, Button, Card, List, Result, message } from 'antd';
|
|
||||||
import Search from 'antd/es/input/Search';
|
|
||||||
import ReactECharts from 'echarts-for-react';
|
|
||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
|
|
||||||
const MyChartPage: React.FC = () => {
|
|
||||||
const initSearchParams = {
|
|
||||||
current: 1,
|
|
||||||
pageSize: 4,
|
|
||||||
sortField: 'created_time',
|
|
||||||
sortOrder: 'desc',
|
|
||||||
}
|
|
||||||
|
|
||||||
const [searchParams, setSearchParams] = useState<API.ChartQueryRequest>({...initSearchParams});
|
|
||||||
|
|
||||||
const [chartList,setChartList] = useState<API.Chart[]>();
|
|
||||||
const [total, setTotal] = useState<number>(0);
|
|
||||||
//页面加载状态
|
|
||||||
const [loading, setLoading] = useState<boolean>(true);
|
|
||||||
|
|
||||||
//从全局状态中获取当前登录用户信息
|
|
||||||
const { initialState } = useModel('@@initialState')
|
|
||||||
const { currentUser } = initialState ?? {};
|
|
||||||
//获取数据
|
|
||||||
const loadData = async () => {
|
|
||||||
setLoading(true);
|
|
||||||
try {
|
|
||||||
const res = await listMyChartByPageUsingPOST(searchParams);
|
|
||||||
|
|
||||||
if(res.data){
|
|
||||||
setChartList(res.data.records ?? []);
|
|
||||||
setTotal(res.data.total ?? 0);
|
|
||||||
//去除图表标题
|
|
||||||
if(res.data.records){
|
|
||||||
res.data.records.forEach(data => {
|
|
||||||
if(data.status === 'succeed'){
|
|
||||||
const chartOption = JSON.parse(data.genChart ?? '{}');
|
|
||||||
chartOption.title = undefined;
|
|
||||||
data.genChart = JSON.stringify(chartOption);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
message.error(res.message ?? '获取我的图表失败');
|
|
||||||
}
|
|
||||||
} catch (e : any) {
|
|
||||||
message.error('获取我的图表失败,' + e.message);
|
|
||||||
}
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
//重新生成
|
|
||||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
|
||||||
const reloadGenChart = async (chartId: any) => {
|
|
||||||
if(submitting) return;
|
|
||||||
setSubmitting(true);
|
|
||||||
const param = { chartId : chartId };
|
|
||||||
try {
|
|
||||||
const res = await regenChartByAiAsyncMqUsingPOST(param);
|
|
||||||
if(!res?.data){
|
|
||||||
message.error(res.message ??'分析失败');
|
|
||||||
}else{
|
|
||||||
message.success('分析任务提交成功,稍后请在我的图表页面查看');
|
|
||||||
//重新加载一下页面
|
|
||||||
await loadData();
|
|
||||||
}
|
|
||||||
} catch (e: any) {
|
|
||||||
message.error('分析失败,' + e.message);
|
|
||||||
}
|
|
||||||
setSubmitting(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
//首次加载页面时,触发加载数据
|
|
||||||
useEffect(() => {
|
|
||||||
//这个页面首次渲染的时候,以及这个数组中的搜索条件发生变化的时候,会执行loadData方法,自动触发重新搜索
|
|
||||||
/* const timer = setInterval(() => {
|
|
||||||
loadData();
|
|
||||||
}, 5000);
|
|
||||||
return () => clearInterval(timer); */
|
|
||||||
loadData();
|
|
||||||
},[searchParams]);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className='my-chart-page'>
|
|
||||||
<div>
|
|
||||||
<Search placeholder="请输入图表名称" enterButton loading={loading} onSearch={(value) => {
|
|
||||||
setSearchParams({
|
|
||||||
...initSearchParams,
|
|
||||||
chartName: value,
|
|
||||||
})
|
|
||||||
}}/>
|
|
||||||
</div>
|
|
||||||
<div className='margin-16'/>
|
|
||||||
<List
|
|
||||||
/*
|
|
||||||
栅格间隔16像素;
|
|
||||||
xs屏幕<576px,栅格数1;
|
|
||||||
sm屏幕≥576px,栅格数1;
|
|
||||||
md屏幕≥768px,栅格数1;
|
|
||||||
lg屏幕≥992px,栅格数2;
|
|
||||||
xl屏幕≥1200px,栅格数2;
|
|
||||||
xxl屏幕≥1660px,栅格数2
|
|
||||||
*/
|
|
||||||
grid={{
|
|
||||||
gutter: 16,
|
|
||||||
xs: 1,
|
|
||||||
sm: 1,
|
|
||||||
md: 1,
|
|
||||||
lg: 2,
|
|
||||||
xl: 2,
|
|
||||||
xxl: 2,
|
|
||||||
}}
|
|
||||||
pagination={{
|
|
||||||
onChange: (page, pageSize) => {
|
|
||||||
setSearchParams({
|
|
||||||
...searchParams,
|
|
||||||
current: page,
|
|
||||||
pageSize,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
current: searchParams.current,
|
|
||||||
pageSize: searchParams.pageSize,
|
|
||||||
total: total,
|
|
||||||
}}
|
|
||||||
loading={loading}
|
|
||||||
dataSource={chartList}
|
|
||||||
renderItem={(item) => (
|
|
||||||
<List.Item key={item.id}>
|
|
||||||
<Card style={{ width: '100%' }}>
|
|
||||||
<List.Item.Meta
|
|
||||||
avatar={<Avatar src={currentUser && currentUser.userAvatar} />}
|
|
||||||
title={item.chartName}
|
|
||||||
description={item.chartType ? '图表类型:' + item.chartType : undefined}
|
|
||||||
/>
|
|
||||||
<>
|
|
||||||
{
|
|
||||||
item.status === 'wait' && <>
|
|
||||||
<Result
|
|
||||||
status="warning"
|
|
||||||
title="待生成"
|
|
||||||
subTitle={item.execMessage ?? '当前图表生成队列繁忙,请耐心等候'}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
{
|
|
||||||
item.status === 'running' && <>
|
|
||||||
<Result
|
|
||||||
status="info"
|
|
||||||
title="图表生成中"
|
|
||||||
subTitle={item.execMessage}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
{
|
|
||||||
item.status === 'succeed' && <>
|
|
||||||
<div style={{ marginBottom: 16 }} />
|
|
||||||
<p>{'分析目标:' + item.goal}</p>
|
|
||||||
<div style={{ marginBottom: 16 }} />
|
|
||||||
<ReactECharts option={item.genChart && JSON.parse(item.genChart)} />
|
|
||||||
<div style={{ marginBottom: 16 }} />
|
|
||||||
<p>{'分析结论:' + item.genResult}</p>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
{
|
|
||||||
item.status === 'failed' && <>
|
|
||||||
<Result
|
|
||||||
status="error"
|
|
||||||
title="图表生成失败"
|
|
||||||
subTitle={item.execMessage}
|
|
||||||
extra={[
|
|
||||||
<Button type="primary" key={item.id} onClick={()=>reloadGenChart(item.id)}>重新生成</Button>
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
</>
|
|
||||||
</Card>
|
|
||||||
</List.Item>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default MyChartPage;
|
|
||||||
@ -1,142 +0,0 @@
|
|||||||
import Footer from '@/components/Footer';
|
|
||||||
import { getLoginUserUsingGET, userLoginUsingPOST } from '@/services/answerbi/userController';
|
|
||||||
import { LockOutlined, UserOutlined } from '@ant-design/icons';
|
|
||||||
import { LoginForm, ProFormText } from '@ant-design/pro-components';
|
|
||||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
|
||||||
import { Helmet, Link, history, useModel } from '@umijs/max';
|
|
||||||
import { Tabs, message } from 'antd';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
import { flushSync } from 'react-dom';
|
|
||||||
import Settings from '../../../../config/defaultSettings';
|
|
||||||
const Login: React.FC = () => {
|
|
||||||
const [type, setType] = useState<string>('account');
|
|
||||||
const { setInitialState } = useModel('@@initialState');
|
|
||||||
const containerClassName = useEmotionCss(() => {
|
|
||||||
return {
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
height: '100vh',
|
|
||||||
overflow: 'auto',
|
|
||||||
backgroundImage:
|
|
||||||
"url('https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/V-_oS6r-i7wAAAAAAAAAAAAAFl94AQBr')",
|
|
||||||
backgroundSize: '100% 100%',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* 登录成功后,获取用户登录信息
|
|
||||||
*/
|
|
||||||
const fetchUserInfo = async () => {
|
|
||||||
const userInfo = await getLoginUserUsingGET();
|
|
||||||
if (userInfo) {
|
|
||||||
flushSync(() => {
|
|
||||||
setInitialState((s) => ({
|
|
||||||
...s,
|
|
||||||
currentUser: userInfo.data,
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleSubmit = async (values: API.UserLoginRequest) => {
|
|
||||||
try {
|
|
||||||
// 登录
|
|
||||||
const res = await userLoginUsingPOST(values);
|
|
||||||
if (res.code === 0) {
|
|
||||||
const defaultLoginSuccessMessage = '登录成功!';
|
|
||||||
message.success(defaultLoginSuccessMessage);
|
|
||||||
await fetchUserInfo();
|
|
||||||
const urlParams = new URL(window.location.href).searchParams;
|
|
||||||
history.push(urlParams.get('redirect') || '/');
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
message.error(res.message);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
const defaultLoginFailureMessage = '登录失败,请重试!';
|
|
||||||
console.log(error);
|
|
||||||
message.error(defaultLoginFailureMessage);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={containerClassName}>
|
|
||||||
<Helmet>
|
|
||||||
<title>
|
|
||||||
{'登录'}- {Settings.title}
|
|
||||||
</title>
|
|
||||||
</Helmet>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
flex: '1',
|
|
||||||
padding: '32px 0',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<LoginForm
|
|
||||||
contentStyle={{
|
|
||||||
minWidth: 280,
|
|
||||||
maxWidth: '75vw',
|
|
||||||
}}
|
|
||||||
logo={<img alt="logo" src="/logo.svg" />}
|
|
||||||
title="Ans智能BI"
|
|
||||||
subTitle={'Ans智能BI - 一键生成图表,智能分析'}
|
|
||||||
onFinish={async (values) => {
|
|
||||||
await handleSubmit(values as API.UserLoginRequest);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Tabs
|
|
||||||
activeKey={type}
|
|
||||||
onChange={setType}
|
|
||||||
centered
|
|
||||||
items={[
|
|
||||||
{
|
|
||||||
key: 'account',
|
|
||||||
label: '账户密码登录',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{type === 'account' && (
|
|
||||||
<>
|
|
||||||
<ProFormText
|
|
||||||
name="userAccount"
|
|
||||||
fieldProps={{
|
|
||||||
size: 'large',
|
|
||||||
prefix: <UserOutlined />,
|
|
||||||
}}
|
|
||||||
placeholder={'请输入用户名'}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '用户名是必填项!',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<ProFormText.Password
|
|
||||||
name="userPassword"
|
|
||||||
fieldProps={{
|
|
||||||
size: 'large',
|
|
||||||
prefix: <LockOutlined />,
|
|
||||||
}}
|
|
||||||
placeholder={'请输入密码'}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '密码是必填项!',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
marginBottom: 24,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Link to="/user/register">注册</Link>
|
|
||||||
</div>
|
|
||||||
</LoginForm>
|
|
||||||
</div>
|
|
||||||
<Footer />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default Login;
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
import Footer from '@/components/Footer';
|
|
||||||
import { userRegisterUsingPOST } from '@/services/answerbi/userController';
|
|
||||||
import { LockOutlined, UserOutlined } from '@ant-design/icons';
|
|
||||||
import { LoginForm, ProFormText } from '@ant-design/pro-components';
|
|
||||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
|
||||||
import { Helmet, Link, history } from '@umijs/max';
|
|
||||||
import { Tabs, message } from 'antd';
|
|
||||||
import { stringify } from 'querystring';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
import Settings from '../../../../config/defaultSettings';
|
|
||||||
const Register: React.FC = () => {
|
|
||||||
const [type, setType] = useState<string>('account');
|
|
||||||
|
|
||||||
const containerClassName = useEmotionCss(() => {
|
|
||||||
return {
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
height: '100vh',
|
|
||||||
overflow: 'auto',
|
|
||||||
backgroundImage:
|
|
||||||
"url('https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/V-_oS6r-i7wAAAAAAAAAAAAAFl94AQBr')",
|
|
||||||
backgroundSize: '100% 100%',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleSubmit = async (values: API.UserRegisterRequest) => {
|
|
||||||
const { userPassword, checkPassword } = values;
|
|
||||||
//校验
|
|
||||||
if (userPassword !== checkPassword){
|
|
||||||
message.error('两次输入的密码不一致!');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// 注册
|
|
||||||
const res = await userRegisterUsingPOST(values);
|
|
||||||
if (res.code === 0) {
|
|
||||||
const defaultLoginSuccessMessage = '注册成功,跳转登录页!';
|
|
||||||
message.success(defaultLoginSuccessMessage);
|
|
||||||
const { search, pathname } = window.location;
|
|
||||||
const urlParams = new URL(window.location.href).searchParams;
|
|
||||||
/** 此方法会跳转到 redirect 参数所在的位置 */
|
|
||||||
const redirect = urlParams.get('redirect');
|
|
||||||
// Note: There may be security issues, please note
|
|
||||||
if (window.location.pathname !== '/user/login' && !redirect) {
|
|
||||||
history.replace({
|
|
||||||
pathname: '/user/login',
|
|
||||||
search: search ? stringify({
|
|
||||||
redirect: pathname + search,
|
|
||||||
}):'',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
message.error(res.message);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
const defaultLoginFailureMessage = '注册失败,请重试!';
|
|
||||||
console.log(error);
|
|
||||||
message.error(defaultLoginFailureMessage);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={containerClassName}>
|
|
||||||
<Helmet>
|
|
||||||
<title>
|
|
||||||
{'注册'}- {Settings.title}
|
|
||||||
</title>
|
|
||||||
</Helmet>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
flex: '1',
|
|
||||||
padding: '32px 0',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<LoginForm
|
|
||||||
submitter={{
|
|
||||||
searchConfig:{
|
|
||||||
submitText:'注册'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
contentStyle={{
|
|
||||||
minWidth: 280,
|
|
||||||
maxWidth: '75vw',
|
|
||||||
}}
|
|
||||||
logo={<img alt="logo" src="/logo.svg" />}
|
|
||||||
title="Ans智能BI"
|
|
||||||
subTitle={'Ans智能BI - 一键生成图表,智能分析'}
|
|
||||||
onFinish={async (values) => {
|
|
||||||
await handleSubmit(values as API.UserRegisterRequest);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Tabs
|
|
||||||
activeKey={type}
|
|
||||||
onChange={setType}
|
|
||||||
centered
|
|
||||||
items={[
|
|
||||||
{
|
|
||||||
key: 'account',
|
|
||||||
label: '账户密码注册',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{type === 'account' && (
|
|
||||||
<>
|
|
||||||
<ProFormText
|
|
||||||
name="userAccount"
|
|
||||||
fieldProps={{
|
|
||||||
size: 'large',
|
|
||||||
prefix: <UserOutlined />,
|
|
||||||
}}
|
|
||||||
placeholder={'请输入用户名'}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '用户名是必填项!',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<ProFormText.Password
|
|
||||||
name="userPassword"
|
|
||||||
fieldProps={{
|
|
||||||
size: 'large',
|
|
||||||
prefix: <LockOutlined />,
|
|
||||||
}}
|
|
||||||
placeholder={'请输入密码'}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '密码是必填项!',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<ProFormText.Password
|
|
||||||
name="checkPassword"
|
|
||||||
fieldProps={{
|
|
||||||
size: 'large',
|
|
||||||
prefix: <LockOutlined />,
|
|
||||||
}}
|
|
||||||
placeholder={'请再次输入密码'}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '确认密码是必填项!',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
marginBottom: 24,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Link to="/user/login">已有账号? 去登录</Link>
|
|
||||||
</div>
|
|
||||||
</LoginForm>
|
|
||||||
</div>
|
|
||||||
<Footer />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default Register;
|
|
||||||
@ -1,164 +0,0 @@
|
|||||||
import { PageContainer } from '@ant-design/pro-components';
|
|
||||||
import { useModel } from '@umijs/max';
|
|
||||||
import { Card, theme } from 'antd';
|
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每个单独的卡片,为了复用样式抽成了组件
|
|
||||||
* @param param0
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const InfoCard: React.FC<{
|
|
||||||
title: string;
|
|
||||||
index: number;
|
|
||||||
desc: string;
|
|
||||||
href: string;
|
|
||||||
}> = ({ title, href, index, desc }) => {
|
|
||||||
const { useToken } = theme;
|
|
||||||
|
|
||||||
const { token } = useToken();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundColor: token.colorBgContainer,
|
|
||||||
boxShadow: token.boxShadow,
|
|
||||||
borderRadius: '8px',
|
|
||||||
fontSize: '14px',
|
|
||||||
color: token.colorTextSecondary,
|
|
||||||
lineHeight: '22px',
|
|
||||||
padding: '16px 19px',
|
|
||||||
minWidth: '220px',
|
|
||||||
flex: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
gap: '4px',
|
|
||||||
alignItems: 'center',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: 48,
|
|
||||||
height: 48,
|
|
||||||
lineHeight: '22px',
|
|
||||||
backgroundSize: '100%',
|
|
||||||
textAlign: 'center',
|
|
||||||
padding: '8px 16px 16px 12px',
|
|
||||||
color: '#FFF',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
backgroundImage:
|
|
||||||
"url('https://gw.alipayobjects.com/zos/bmw-prod/daaf8d50-8e6d-4251-905d-676a24ddfa12.svg')",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{index}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '16px',
|
|
||||||
color: token.colorText,
|
|
||||||
paddingBottom: 8,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '14px',
|
|
||||||
color: token.colorTextSecondary,
|
|
||||||
textAlign: 'justify',
|
|
||||||
lineHeight: '22px',
|
|
||||||
marginBottom: 8,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{desc}
|
|
||||||
</div>
|
|
||||||
<a href={href} target="_blank" rel="noreferrer">
|
|
||||||
了解更多 {'>'}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const Welcome: React.FC = () => {
|
|
||||||
const { token } = theme.useToken();
|
|
||||||
const { initialState } = useModel('@@initialState');
|
|
||||||
return (
|
|
||||||
<PageContainer>
|
|
||||||
<Card
|
|
||||||
style={{
|
|
||||||
borderRadius: 8,
|
|
||||||
}}
|
|
||||||
bodyStyle={{
|
|
||||||
backgroundImage:
|
|
||||||
initialState?.settings?.navTheme === 'realDark'
|
|
||||||
? 'background-image: linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)'
|
|
||||||
: 'background-image: linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundPosition: '100% -30%',
|
|
||||||
backgroundRepeat: 'no-repeat',
|
|
||||||
backgroundSize: '274px auto',
|
|
||||||
backgroundImage:
|
|
||||||
"url('https://gw.alipayobjects.com/mdn/rms_a9745b/afts/img/A*BuFmQqsB2iAAAAAAAAAAAAAAARQnAQ')",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '20px',
|
|
||||||
color: token.colorTextHeading,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
欢迎使用 Ans智能BI
|
|
||||||
</div>
|
|
||||||
<p
|
|
||||||
style={{
|
|
||||||
fontSize: '14px',
|
|
||||||
color: token.colorTextSecondary,
|
|
||||||
lineHeight: '22px',
|
|
||||||
marginTop: 16,
|
|
||||||
marginBottom: 32,
|
|
||||||
width: '65%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Ans智能BI 是一个整合了 umi,Ans智能BI 和 ProComponents
|
|
||||||
的脚手架方案。致力于在设计规范和基础组件的基础上,继续向上构建,提炼出典型模板/业务组件/配套设计资源,进一步提升企业级中后台产品设计研发过程中的『用户』和『设计者』的体验。
|
|
||||||
</p>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
gap: 16,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<InfoCard
|
|
||||||
index={1}
|
|
||||||
href="https://umijs.org/docs/introduce/introduce"
|
|
||||||
title="了解 umi"
|
|
||||||
desc="umi 是一个可扩展的企业级前端应用框架,umi 以路由为基础的,同时支持配置式路由和约定式路由,保证路由的功能完备,并以此进行功能扩展。"
|
|
||||||
/>
|
|
||||||
<InfoCard
|
|
||||||
index={2}
|
|
||||||
title="了解 Ans智能BI"
|
|
||||||
href="https://ant.design"
|
|
||||||
desc="antd 是基于 Ans智能BI 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。"
|
|
||||||
/>
|
|
||||||
<InfoCard
|
|
||||||
index={3}
|
|
||||||
title="了解 Pro Components"
|
|
||||||
href="https://procomponents.ant.design"
|
|
||||||
desc="ProComponents 是一个基于 Ans智能BI 做了更高抽象的模板组件,以 一个组件就是一个页面为开发理念,为中后台开发带来更好的体验。"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</PageContainer>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Welcome;
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
import type { RequestOptions } from '@@/plugin-request/request';
|
|
||||||
import type { RequestConfig } from '@umijs/max';
|
|
||||||
import { message, notification } from 'antd';
|
|
||||||
|
|
||||||
// 错误处理方案: 错误类型
|
|
||||||
enum ErrorShowType {
|
|
||||||
SILENT = 0,
|
|
||||||
WARN_MESSAGE = 1,
|
|
||||||
ERROR_MESSAGE = 2,
|
|
||||||
NOTIFICATION = 3,
|
|
||||||
REDIRECT = 9,
|
|
||||||
}
|
|
||||||
// 与后端约定的响应数据格式
|
|
||||||
interface ResponseStructure {
|
|
||||||
success: boolean;
|
|
||||||
data: any;
|
|
||||||
errorCode?: number;
|
|
||||||
errorMessage?: string;
|
|
||||||
showType?: ErrorShowType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name 错误处理
|
|
||||||
* pro 自带的错误处理, 可以在这里做自己的改动
|
|
||||||
* @doc https://umijs.org/docs/max/request#配置
|
|
||||||
*/
|
|
||||||
export const errorConfig: RequestConfig = {
|
|
||||||
// 错误处理: umi@3 的错误处理方案。
|
|
||||||
errorConfig: {
|
|
||||||
// 错误抛出
|
|
||||||
errorThrower: (res) => {
|
|
||||||
const { success, data, errorCode, errorMessage, showType } =
|
|
||||||
res as unknown as ResponseStructure;
|
|
||||||
if (!success) {
|
|
||||||
const error: any = new Error(errorMessage);
|
|
||||||
error.name = 'BizError';
|
|
||||||
error.info = { errorCode, errorMessage, showType, data };
|
|
||||||
throw error; // 抛出自制的错误
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 错误接收及处理
|
|
||||||
errorHandler: (error: any, opts: any) => {
|
|
||||||
if (opts?.skipErrorHandler) throw error;
|
|
||||||
// 我们的 errorThrower 抛出的错误。
|
|
||||||
if (error.name === 'BizError') {
|
|
||||||
const errorInfo: ResponseStructure | undefined = error.info;
|
|
||||||
if (errorInfo) {
|
|
||||||
const { errorMessage, errorCode } = errorInfo;
|
|
||||||
switch (errorInfo.showType) {
|
|
||||||
case ErrorShowType.SILENT:
|
|
||||||
// do nothing
|
|
||||||
break;
|
|
||||||
case ErrorShowType.WARN_MESSAGE:
|
|
||||||
message.warning(errorMessage);
|
|
||||||
break;
|
|
||||||
case ErrorShowType.ERROR_MESSAGE:
|
|
||||||
message.error(errorMessage);
|
|
||||||
break;
|
|
||||||
case ErrorShowType.NOTIFICATION:
|
|
||||||
notification.open({
|
|
||||||
description: errorMessage,
|
|
||||||
message: errorCode,
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case ErrorShowType.REDIRECT:
|
|
||||||
// TODO: redirect
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
message.error(errorMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (error.response) {
|
|
||||||
// Axios 的错误
|
|
||||||
// 请求成功发出且服务器也响应了状态码,但状态代码超出了 2xx 的范围
|
|
||||||
message.error(`Response status:${error.response.status}`);
|
|
||||||
} else if (error.request) {
|
|
||||||
// 请求已经成功发起,但没有收到响应
|
|
||||||
// \`error.request\` 在浏览器中是 XMLHttpRequest 的实例,
|
|
||||||
// 而在node.js中是 http.ClientRequest 的实例
|
|
||||||
message.error('None response! Please retry.');
|
|
||||||
} else {
|
|
||||||
// 发送请求时出了点问题
|
|
||||||
message.error('Request error, please retry.');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// 请求拦截器
|
|
||||||
requestInterceptors: [
|
|
||||||
(config: RequestOptions) => {
|
|
||||||
// 拦截请求配置,进行个性化处理。
|
|
||||||
//const url = config?.url?.concat('?token = 123');
|
|
||||||
//return { ...config, url };
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
// 响应拦截器
|
|
||||||
responseInterceptors: [
|
|
||||||
(response) => {
|
|
||||||
// 拦截响应数据,进行个性化处理
|
|
||||||
const { data } = response as unknown as ResponseStructure;
|
|
||||||
|
|
||||||
if (data?.success === false) {
|
|
||||||
message.error('请求失败!');
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
@ -1,65 +0,0 @@
|
|||||||
/* eslint-disable no-restricted-globals */
|
|
||||||
/* eslint-disable no-underscore-dangle */
|
|
||||||
/* globals workbox */
|
|
||||||
workbox.core.setCacheNameDetails({
|
|
||||||
prefix: 'antd-pro',
|
|
||||||
suffix: 'v5',
|
|
||||||
});
|
|
||||||
// Control all opened tabs ASAP
|
|
||||||
workbox.clientsClaim();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use precaching list generated by workbox in build process.
|
|
||||||
* https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching
|
|
||||||
*/
|
|
||||||
workbox.precaching.precacheAndRoute(self.__precacheManifest || []);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Register a navigation route.
|
|
||||||
* https://developers.google.com/web/tools/workbox/modules/workbox-routing#how_to_register_a_navigation_route
|
|
||||||
*/
|
|
||||||
workbox.routing.registerNavigationRoute('/index.html');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Use runtime cache:
|
|
||||||
* https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.routing#.registerRoute
|
|
||||||
*
|
|
||||||
* Workbox provides all common caching strategies including CacheFirst, NetworkFirst etc.
|
|
||||||
* https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.strategies
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Handle API requests */
|
|
||||||
workbox.routing.registerRoute(/\/api\//, workbox.strategies.networkFirst());
|
|
||||||
|
|
||||||
/** Handle third party requests */
|
|
||||||
workbox.routing.registerRoute(
|
|
||||||
/^https:\/\/gw\.alipayobjects\.com\//,
|
|
||||||
workbox.strategies.networkFirst(),
|
|
||||||
);
|
|
||||||
workbox.routing.registerRoute(
|
|
||||||
/^https:\/\/cdnjs\.cloudflare\.com\//,
|
|
||||||
workbox.strategies.networkFirst(),
|
|
||||||
);
|
|
||||||
workbox.routing.registerRoute(/\/color.less/, workbox.strategies.networkFirst());
|
|
||||||
|
|
||||||
/** Response to client after skipping waiting with MessageChannel */
|
|
||||||
addEventListener('message', (event) => {
|
|
||||||
const replyPort = event.ports[0];
|
|
||||||
const message = event.data;
|
|
||||||
if (replyPort && message && message.type === 'skip-waiting') {
|
|
||||||
event.waitUntil(
|
|
||||||
self.skipWaiting().then(
|
|
||||||
() => {
|
|
||||||
replyPort.postMessage({
|
|
||||||
error: null,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
replyPort.postMessage({
|
|
||||||
error,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@ -1,231 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** addChart POST /api/chart/add */
|
|
||||||
export async function addChartUsingPOST(
|
|
||||||
body: API.ChartAddRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseLong_>('/api/chart/add', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** deleteChart POST /api/chart/delete */
|
|
||||||
export async function deleteChartUsingPOST(
|
|
||||||
body: API.DeleteRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/chart/delete', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** editChart POST /api/chart/edit */
|
|
||||||
export async function editChartUsingPOST(
|
|
||||||
body: API.ChartEditRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/chart/edit', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** genChartByAi POST /api/chart/gen */
|
|
||||||
export async function genChartByAiUsingPOST(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.genChartByAiUsingPOSTParams,
|
|
||||||
body: {},
|
|
||||||
file?: File,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
const formData = new FormData();
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
formData.append('file', file);
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(body).forEach((ele) => {
|
|
||||||
const item = (body as any)[ele];
|
|
||||||
|
|
||||||
if (item !== undefined && item !== null) {
|
|
||||||
formData.append(
|
|
||||||
ele,
|
|
||||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return request<API.CommonResponseBiResponse_>('/api/chart/gen', {
|
|
||||||
method: 'POST',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
data: formData,
|
|
||||||
requestType: 'form',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** genChartByAiAsync POST /api/chart/gen/async */
|
|
||||||
export async function genChartByAiAsyncUsingPOST(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.genChartByAiAsyncUsingPOSTParams,
|
|
||||||
body: {},
|
|
||||||
file?: File,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
const formData = new FormData();
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
formData.append('file', file);
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(body).forEach((ele) => {
|
|
||||||
const item = (body as any)[ele];
|
|
||||||
|
|
||||||
if (item !== undefined && item !== null) {
|
|
||||||
formData.append(
|
|
||||||
ele,
|
|
||||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return request<API.CommonResponseBiResponse_>('/api/chart/gen/async', {
|
|
||||||
method: 'POST',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
data: formData,
|
|
||||||
requestType: 'form',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** genChartByAiAsyncMq POST /api/chart/gen/async/mq */
|
|
||||||
export async function genChartByAiAsyncMqUsingPOST(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.genChartByAiAsyncMqUsingPOSTParams,
|
|
||||||
body: {},
|
|
||||||
file?: File,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
const formData = new FormData();
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
formData.append('file', file);
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(body).forEach((ele) => {
|
|
||||||
const item = (body as any)[ele];
|
|
||||||
|
|
||||||
if (item !== undefined && item !== null) {
|
|
||||||
formData.append(
|
|
||||||
ele,
|
|
||||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return request<API.CommonResponseBiResponse_>('/api/chart/gen/async/mq', {
|
|
||||||
method: 'POST',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
data: formData,
|
|
||||||
requestType: 'form',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** getChartById GET /api/chart/get */
|
|
||||||
export async function getChartByIdUsingGET(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.getChartByIdUsingGETParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseChart_>('/api/chart/get', {
|
|
||||||
method: 'GET',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** listChartByPage POST /api/chart/list/page */
|
|
||||||
export async function listChartByPageUsingPOST(
|
|
||||||
body: API.ChartQueryRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponsePageChart_>('/api/chart/list/page', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** listMyChartByPage POST /api/chart/my/list/page */
|
|
||||||
export async function listMyChartByPageUsingPOST(
|
|
||||||
body: API.ChartQueryRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponsePageChart_>('/api/chart/my/list/page', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** regenChartByAiAsyncMq POST /api/chart/regen */
|
|
||||||
export async function regenChartByAiAsyncMqUsingPOST(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.regenChartByAiAsyncMqUsingPOSTParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBiResponse_>('/api/chart/regen', {
|
|
||||||
method: 'POST',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** updateChart POST /api/chart/update */
|
|
||||||
export async function updateChartUsingPOST(
|
|
||||||
body: API.ChartUpdateRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/chart/update', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** uploadFile POST /api/file/upload */
|
|
||||||
export async function uploadFileUsingPOST(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.uploadFileUsingPOSTParams,
|
|
||||||
body: {},
|
|
||||||
file?: File,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
const formData = new FormData();
|
|
||||||
|
|
||||||
if (file) {
|
|
||||||
formData.append('file', file);
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(body).forEach((ele) => {
|
|
||||||
const item = (body as any)[ele];
|
|
||||||
|
|
||||||
if (item !== undefined && item !== null) {
|
|
||||||
formData.append(
|
|
||||||
ele,
|
|
||||||
typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return request<API.CommonResponseString_>('/api/file/upload', {
|
|
||||||
method: 'POST',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
data: formData,
|
|
||||||
requestType: 'form',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
// API 更新时间:
|
|
||||||
// API 唯一标识:
|
|
||||||
import * as chartController from './chartController';
|
|
||||||
import * as fileController from './fileController';
|
|
||||||
import * as userController from './userController';
|
|
||||||
export default {
|
|
||||||
chartController,
|
|
||||||
fileController,
|
|
||||||
userController,
|
|
||||||
};
|
|
||||||
295
src/services/answerbi/typings.d.ts
vendored
295
src/services/answerbi/typings.d.ts
vendored
@ -1,295 +0,0 @@
|
|||||||
declare namespace API {
|
|
||||||
type BiResponse = {
|
|
||||||
chartId?: number;
|
|
||||||
genChart?: string;
|
|
||||||
genResult?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type Chart = {
|
|
||||||
chartData?: string;
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
createdTime?: string;
|
|
||||||
deletedFlag?: number;
|
|
||||||
execMessage?: string;
|
|
||||||
genChart?: string;
|
|
||||||
genResult?: string;
|
|
||||||
goal?: string;
|
|
||||||
id?: number;
|
|
||||||
status?: string;
|
|
||||||
updatedTime?: string;
|
|
||||||
userId?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type ChartAddRequest = {
|
|
||||||
chartData?: string;
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
goal?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type ChartEditRequest = {
|
|
||||||
chartData?: string;
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
goal?: string;
|
|
||||||
id?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type ChartQueryRequest = {
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
current?: number;
|
|
||||||
goal?: string;
|
|
||||||
id?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
sortField?: string;
|
|
||||||
sortOrder?: string;
|
|
||||||
userId?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type ChartUpdateRequest = {
|
|
||||||
chartData?: string;
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
createdTime?: string;
|
|
||||||
deletedFlag?: number;
|
|
||||||
genChart?: string;
|
|
||||||
genResult?: string;
|
|
||||||
goal?: string;
|
|
||||||
id?: number;
|
|
||||||
updatedTime?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseBiResponse_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: BiResponse;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseBoolean_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: boolean;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseChart_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: Chart;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseLoginUserVO_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: LoginUserVO;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseLong_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: number;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponsePageChart_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: PageChart_;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponsePageUser_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: PageUser_;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponsePageUserVO_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: PageUserVO_;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseString_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: string;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseUser_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: User;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type CommonResponseUserVO_ = {
|
|
||||||
code?: number;
|
|
||||||
data?: UserVO;
|
|
||||||
message?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type DeleteRequest = {
|
|
||||||
id?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type genChartByAiAsyncMqUsingPOSTParams = {
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
goal?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type genChartByAiAsyncUsingPOSTParams = {
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
goal?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type genChartByAiUsingPOSTParams = {
|
|
||||||
chartName?: string;
|
|
||||||
chartType?: string;
|
|
||||||
goal?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type getChartByIdUsingGETParams = {
|
|
||||||
/** id */
|
|
||||||
id?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type getUserByIdUsingGETParams = {
|
|
||||||
/** id */
|
|
||||||
id?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type getUserVOByIdUsingGETParams = {
|
|
||||||
/** id */
|
|
||||||
id?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type LoginUserVO = {
|
|
||||||
createdTime?: string;
|
|
||||||
id?: number;
|
|
||||||
updatedTime?: string;
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userProfile?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type OrderItem = {
|
|
||||||
asc?: boolean;
|
|
||||||
column?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type PageChart_ = {
|
|
||||||
countId?: string;
|
|
||||||
current?: number;
|
|
||||||
maxLimit?: number;
|
|
||||||
optimizeCountSql?: boolean;
|
|
||||||
orders?: OrderItem[];
|
|
||||||
pages?: number;
|
|
||||||
records?: Chart[];
|
|
||||||
searchCount?: boolean;
|
|
||||||
size?: number;
|
|
||||||
total?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type PageUser_ = {
|
|
||||||
countId?: string;
|
|
||||||
current?: number;
|
|
||||||
maxLimit?: number;
|
|
||||||
optimizeCountSql?: boolean;
|
|
||||||
orders?: OrderItem[];
|
|
||||||
pages?: number;
|
|
||||||
records?: User[];
|
|
||||||
searchCount?: boolean;
|
|
||||||
size?: number;
|
|
||||||
total?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type PageUserVO_ = {
|
|
||||||
countId?: string;
|
|
||||||
current?: number;
|
|
||||||
maxLimit?: number;
|
|
||||||
optimizeCountSql?: boolean;
|
|
||||||
orders?: OrderItem[];
|
|
||||||
pages?: number;
|
|
||||||
records?: UserVO[];
|
|
||||||
searchCount?: boolean;
|
|
||||||
size?: number;
|
|
||||||
total?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type regenChartByAiAsyncMqUsingPOSTParams = {
|
|
||||||
/** chartId */
|
|
||||||
chartId?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
type uploadFileUsingPOSTParams = {
|
|
||||||
biz?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type User = {
|
|
||||||
createdTime?: string;
|
|
||||||
deletedFlag?: number;
|
|
||||||
id?: number;
|
|
||||||
updatedTime?: string;
|
|
||||||
userAccount?: string;
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userPassword?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserAddRequest = {
|
|
||||||
userAccount?: string;
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserLoginRequest = {
|
|
||||||
userAccount?: string;
|
|
||||||
userPassword?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserQueryRequest = {
|
|
||||||
current?: number;
|
|
||||||
id?: number;
|
|
||||||
pageSize?: number;
|
|
||||||
sortField?: string;
|
|
||||||
sortOrder?: string;
|
|
||||||
userAccount?: string;
|
|
||||||
userName?: string;
|
|
||||||
userProfile?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserRegisterRequest = {
|
|
||||||
checkPassword?: string;
|
|
||||||
userAccount?: string;
|
|
||||||
userPassword?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserUpdateMyRequest = {
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userProfile?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserUpdateRequest = {
|
|
||||||
id?: number;
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userProfile?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UserVO = {
|
|
||||||
createdTime?: string;
|
|
||||||
id?: number;
|
|
||||||
userAccount?: string;
|
|
||||||
userAvatar?: string;
|
|
||||||
userName?: string;
|
|
||||||
userProfile?: string;
|
|
||||||
userRole?: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,166 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** addUser POST /api/user/add */
|
|
||||||
export async function addUserUsingPOST(body: API.UserAddRequest, options?: { [key: string]: any }) {
|
|
||||||
return request<API.CommonResponseLong_>('/api/user/add', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** deleteUser POST /api/user/delete */
|
|
||||||
export async function deleteUserUsingPOST(
|
|
||||||
body: API.DeleteRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/user/delete', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** getUserById GET /api/user/get */
|
|
||||||
export async function getUserByIdUsingGET(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.getUserByIdUsingGETParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseUser_>('/api/user/get', {
|
|
||||||
method: 'GET',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** getLoginUser GET /api/user/get/login */
|
|
||||||
export async function getLoginUserUsingGET(options?: { [key: string]: any }) {
|
|
||||||
return request<API.CommonResponseLoginUserVO_>('/api/user/get/login', {
|
|
||||||
method: 'GET',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** getUserVOById GET /api/user/get/vo */
|
|
||||||
export async function getUserVOByIdUsingGET(
|
|
||||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
|
||||||
params: API.getUserVOByIdUsingGETParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseUserVO_>('/api/user/get/vo', {
|
|
||||||
method: 'GET',
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** listUserByPage POST /api/user/list/page */
|
|
||||||
export async function listUserByPageUsingPOST(
|
|
||||||
body: API.UserQueryRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponsePageUser_>('/api/user/list/page', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** listUserVOByPage POST /api/user/list/page/vo */
|
|
||||||
export async function listUserVOByPageUsingPOST(
|
|
||||||
body: API.UserQueryRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponsePageUserVO_>('/api/user/list/page/vo', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** userLogin POST /api/user/login */
|
|
||||||
export async function userLoginUsingPOST(
|
|
||||||
body: API.UserLoginRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseLoginUserVO_>('/api/user/login', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** userLogout POST /api/user/logout */
|
|
||||||
export async function userLogoutUsingPOST(options?: { [key: string]: any }) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/user/logout', {
|
|
||||||
method: 'POST',
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** userRegister POST /api/user/register */
|
|
||||||
export async function userRegisterUsingPOST(
|
|
||||||
body: API.UserRegisterRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseLong_>('/api/user/register', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** updateUser POST /api/user/update */
|
|
||||||
export async function updateUserUsingPOST(
|
|
||||||
body: API.UserUpdateRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/user/update', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** updateMyUser POST /api/user/update/my */
|
|
||||||
export async function updateMyUserUsingPOST(
|
|
||||||
body: API.UserUpdateMyRequest,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.CommonResponseBoolean_>('/api/user/update/my', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
20
src/typings.d.ts
vendored
20
src/typings.d.ts
vendored
@ -1,20 +0,0 @@
|
|||||||
declare module 'slash2';
|
|
||||||
declare module '*.css';
|
|
||||||
declare module '*.less';
|
|
||||||
declare module '*.scss';
|
|
||||||
declare module '*.sass';
|
|
||||||
declare module '*.svg';
|
|
||||||
declare module '*.png';
|
|
||||||
declare module '*.jpg';
|
|
||||||
declare module '*.jpeg';
|
|
||||||
declare module '*.gif';
|
|
||||||
declare module '*.bmp';
|
|
||||||
declare module '*.tiff';
|
|
||||||
declare module 'omit.js';
|
|
||||||
declare module 'numeral';
|
|
||||||
declare module '@antv/data-set';
|
|
||||||
declare module 'mockjs';
|
|
||||||
declare module 'react-fittext';
|
|
||||||
declare module 'bizcharts-plugin-slider';
|
|
||||||
|
|
||||||
declare const REACT_APP_ENV: 'test' | 'dev' | 'pre' | false;
|
|
||||||
1
t__plugin-layout__Layout.6cae69f5.chunk.css
Normal file
1
t__plugin-layout__Layout.6cae69f5.chunk.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
@media screen and (max-width: 480px){.umi-plugin-layout-container{width:100%!important}.umi-plugin-layout-container>*{border-radius:0!important}}.umi-plugin-layout-menu .anticon{margin-right:8px}.umi-plugin-layout-menu .ant-dropdown-menu-item{min-width:160px}.umi-plugin-layout-right{display:flex!important;float:right;height:100%;margin-left:auto;overflow:hidden}.umi-plugin-layout-right .umi-plugin-layout-action{display:flex;align-items:center;height:100%;padding:0 12px;cursor:pointer;transition:all .3s}.umi-plugin-layout-right .umi-plugin-layout-action>i{color:#ffffffd9;vertical-align:middle}.umi-plugin-layout-right .umi-plugin-layout-action:hover,.umi-plugin-layout-right .umi-plugin-layout-action.opened{background:rgba(0,0,0,.025)}.umi-plugin-layout-right .umi-plugin-layout-search{padding:0 12px}.umi-plugin-layout-right .umi-plugin-layout-search:hover{background:transparent}.umi-plugin-layout-name{margin-left:8px}.umi-plugin-layout-name.umi-plugin-layout-hide-avatar-img{margin-left:0}
|
||||||
1
t__plugin-layout__Layout.ccbd539b.async.js
Normal file
1
t__plugin-layout__Layout.ccbd539b.async.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "esnext",
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"importHelpers": true,
|
|
||||||
"jsx": "preserve",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"baseUrl": "./",
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"strict": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"],
|
|
||||||
"@@/*": ["./src/.umi/*"],
|
|
||||||
"@@test/*": ["./src/.umi-test/*"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx"]
|
|
||||||
}
|
|
||||||
410
umi.2ed4be52.js
Normal file
410
umi.2ed4be52.js
Normal file
File diff suppressed because one or more lines are too long
1
umi.426615b6.css
Normal file
1
umi.426615b6.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
html,body,#root{height:100%;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.colorWeak{filter:invert(80%)}.ant-layout{min-height:100vh}.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed{left:unset}canvas{display:block}body{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}ul,ol{list-style:none}@media (max-width: 768px){.ant-table{width:100%;overflow-x:auto}.ant-table-thead>tr>th,.ant-table-tbody>tr>th,.ant-table-thead>tr>td,.ant-table-tbody>tr>td{white-space:pre}.ant-table-thead>tr>th>span,.ant-table-tbody>tr>th>span,.ant-table-thead>tr>td>span,.ant-table-tbody>tr>td>span{display:block}}.margin-16{margin-bottom:16px}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type="range"]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6}
|
||||||
Loading…
Reference in New Issue
Block a user