代码初始化
|
@ -0,0 +1,5 @@
|
|||
*.js linguist-language=vue
|
||||
|
||||
*.css linguist-language=vue
|
||||
|
||||
*.html linguist-language=vue
|
|
@ -0,0 +1,35 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/build/
|
||||
/nbbuild/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
/dist/
|
|
@ -0,0 +1,674 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://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 <https://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
|
||||
<https://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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
**vue3-admin** **版本线上预览地址:**[http://vue3-admin.newbee.ltd](http://vue3-admin.newbee.ltd),测试账号密码:admin 123456
|
||||
|
||||
## 安装注意事项,强制安装
|
||||
### npm install --force
|
|
@ -0,0 +1,11 @@
|
|||
export default {
|
||||
development: {
|
||||
baseUrl: '/api' // 测试接口域名
|
||||
},
|
||||
beta: {
|
||||
baseUrl: '/api' // 测试接口域名
|
||||
},
|
||||
release: {
|
||||
baseUrl: '/api' // 正式接口域名
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'vue3-admin',
|
||||
script: 'vue3-admin-server.js'
|
||||
},
|
||||
],
|
||||
deploy: {
|
||||
production: {
|
||||
user: 'root',
|
||||
host: '47.99.134.126',
|
||||
ref: 'origin/main',
|
||||
repo: 'git@git.zhlh6.cn:newbee-ltd/vue3-admin.git',
|
||||
path: '/workspace/vue3-admin',
|
||||
'post-deploy': 'git reset --hard && git checkout main && git pull && npm i --production=false && pm2 startOrReload ecosystem.config.js', // -production=false 下载全量包
|
||||
env: {
|
||||
NODE_ENV: 'production'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" href="./favicon.ico">
|
||||
<title>vue3-admin</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="https://s.yezgea02.com/1609305532675/echarts.js"></script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "vue3-admin",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite --mode development --host=0.0.0.0",
|
||||
"build:beta": "vite build --mode beta",
|
||||
"build:release": "vite build --mode release",
|
||||
"serve": "vite preview",
|
||||
"tauri": "tauri",
|
||||
"pd": "pbjs -t static-module -w es6 -o ./src/proto/data/pd.js ./src/proto/*.proto"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"@sentry/browser": "^6.3.1",
|
||||
"@sentry/tracing": "^6.3.1",
|
||||
"axios": "^0.21.1",
|
||||
"echarts": "^5.4.2",
|
||||
"element-plus": "^2.3.4",
|
||||
"js-base64": "^3.7.5",
|
||||
"js-md5": "^0.7.3",
|
||||
"mitt": "^3.0.1",
|
||||
"moment": "^2.29.4",
|
||||
"protobufjs": "^7.2.4",
|
||||
"protobufjs-cli": "^1.1.2",
|
||||
"pushstate-server": "^3.1.0",
|
||||
"sass": "^1.32.8",
|
||||
"sass-loader": "^10.1.1",
|
||||
"vue": "^3.0.5",
|
||||
"vue-router": "^4.0.4",
|
||||
"vue3-cron-plus": "^0.1.9",
|
||||
"vuex": "^4.0.2",
|
||||
"vuex-persistedstate": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.8",
|
||||
"@babel/runtime": "^7.13.8",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"@vitejs/plugin-vue": "^1.1.4",
|
||||
"@vue/compiler-sfc": "^3.0.5",
|
||||
"babel": "^6.23.0",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"babel-plugin-import": "^1.13.3",
|
||||
"vite": "^2.0.1",
|
||||
"vite-babel-plugin": "^0.0.2",
|
||||
"vite-plugin-babel-import": "^2.0.2",
|
||||
"vite-plugin-imp": "^2.0.4"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 33 KiB |
|
@ -0,0 +1,133 @@
|
|||
<template>
|
||||
<div class="layout">
|
||||
<el-container v-if="state.showMenu" class="container">
|
||||
<!-- <Sidebar :currentPath="state.currentPath"></Sidebar> -->
|
||||
<el-container class="content">
|
||||
<Header />
|
||||
<div class="main">
|
||||
<router-view />
|
||||
</div>
|
||||
<!-- <Footer /> -->
|
||||
</el-container>
|
||||
</el-container>
|
||||
<el-container v-else class="container">
|
||||
<router-view />
|
||||
</el-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onUnmounted, reactive } from 'vue'
|
||||
import Header from '@/components/Header.vue'
|
||||
import Footer from '@/components/Footer.vue'
|
||||
import Sidebar from '@/components/Sidebar.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { pathMap, localGet } from '@/utils';
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Header,
|
||||
Footer,
|
||||
Sidebar
|
||||
},
|
||||
setup() {
|
||||
const noMenu = ['/login']
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
defaultOpen: ['1', '2', '3', '4'],
|
||||
showMenu: true,
|
||||
currentPath: '/dashboard'
|
||||
})
|
||||
// 监听浏览器原生回退事件
|
||||
if (window.history && window.history.pushState) {
|
||||
history.pushState(null, null, document.URL);
|
||||
window.addEventListener('popstate', () => {
|
||||
if (!localGet('token')) {
|
||||
state.showMenu = false
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
const unwatch = router.beforeEach((to, from, next) => {
|
||||
if (to.path == '/login') {
|
||||
// 如果路径是 /login 则正常执行
|
||||
next()
|
||||
} else {
|
||||
// 如果不是 /login,判断是否有 token
|
||||
if (!localGet('token')) {
|
||||
// 如果没有,则跳至登录页面
|
||||
next({ path: '/login' })
|
||||
} else {
|
||||
// 否则继续执行
|
||||
next()
|
||||
}
|
||||
}
|
||||
state.showMenu = !noMenu.includes(to.path)
|
||||
state.currentPath = to.path
|
||||
document.title = pathMap[to.name]
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
unwatch();
|
||||
})
|
||||
|
||||
return {
|
||||
state
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.layout {
|
||||
min-height: 100vh;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.container {
|
||||
height: 100vh;
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.main {
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
::v-deep .el-card__body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.el-menu {
|
||||
border-right: none!important;
|
||||
}
|
||||
.el-submenu {
|
||||
border-top: 1px solid hsla(0, 0%, 100%, .05);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, .2);
|
||||
}
|
||||
.el-submenu:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
.el-submenu [class^="el-icon-"] {
|
||||
vertical-align: -1px!important;
|
||||
}
|
||||
a {
|
||||
color: #409eff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.el-pagination {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.el-popper__arrow {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,134 @@
|
|||
import {
|
||||
getRequest,
|
||||
postJsonRequest,
|
||||
deleteRequest,
|
||||
putRequest,
|
||||
} from "@/utils/axios";
|
||||
const infoApi = {
|
||||
// 获取设备信息
|
||||
getSys(params) {
|
||||
return getRequest("/info", params);
|
||||
},
|
||||
// 获取网络信息
|
||||
getNet(params) {
|
||||
return getRequest("/net", params);
|
||||
},
|
||||
saveNet(params) {
|
||||
return putRequest("/net", params);
|
||||
},
|
||||
reboot() {
|
||||
return postJsonRequest("/reboot",);
|
||||
},
|
||||
// 透传列表
|
||||
getTc(params) {
|
||||
return getRequest('/tc', params)
|
||||
},
|
||||
// 获取透传类型
|
||||
getSupport(params) {
|
||||
return getRequest('/tc/support', params)
|
||||
},
|
||||
// 获取可用串口列表
|
||||
getFree(params) {
|
||||
return getRequest('/com/free', params)
|
||||
},
|
||||
// 获取支持的通讯驱动
|
||||
getTxSupport(params) {
|
||||
return getRequest('/tx/support', params)
|
||||
},
|
||||
|
||||
// 获取所有串口列表api/com
|
||||
getCom(params) {
|
||||
return getRequest('/com', params)
|
||||
},
|
||||
|
||||
saveTx(params) {
|
||||
return postJsonRequest("/tx", params);
|
||||
},
|
||||
editTx(params) {
|
||||
return putRequest("/tx", params);
|
||||
},
|
||||
// 透传服务启停
|
||||
stopTc(params) {
|
||||
return putRequest("/tc", params);
|
||||
},
|
||||
// 透传服务删除
|
||||
delTc(params) {
|
||||
return deleteRequest("/tc", params);
|
||||
},
|
||||
// 模板列表
|
||||
getMb(params) {
|
||||
return getRequest('/tx/mb/list', params)
|
||||
},
|
||||
// 新增模板
|
||||
addMb(params) {
|
||||
return postJsonRequest('/tx/mb', params)
|
||||
},
|
||||
// 编辑模板
|
||||
editMb(params) {
|
||||
return putRequest('/tx/mb', params)
|
||||
},
|
||||
// 删除模板
|
||||
delMb(params) {
|
||||
return deleteRequest('/tx/mb', params)
|
||||
},
|
||||
// 新增点位
|
||||
addP(params) {
|
||||
return putRequest('/tx/mb', params)
|
||||
},
|
||||
|
||||
// 获取点位
|
||||
getP(params) {
|
||||
return postJsonRequest('/tx/mb/info', params)
|
||||
},
|
||||
// 获取设备列表
|
||||
getSet(params) {
|
||||
return postJsonRequest('/tx/info', params)
|
||||
},
|
||||
// 新增设备
|
||||
addSet(params) {
|
||||
return putRequest('/tx/device', params)
|
||||
},
|
||||
// 通讯列表
|
||||
getTx(params) {
|
||||
return getRequest('/tx/list', params)
|
||||
},
|
||||
// 新增通讯列表
|
||||
saveTx(params) {
|
||||
return postJsonRequest("/tx", params);
|
||||
},
|
||||
|
||||
// 通讯服务启用,停用
|
||||
changeStatus(params) {
|
||||
return postJsonRequest(`/tx/${params.url}/${params.name}`, params);
|
||||
},
|
||||
|
||||
// 删除通讯
|
||||
delTx(params) {
|
||||
return deleteRequest(`/tx`, params);
|
||||
},
|
||||
// 获取上报列表
|
||||
getSc(params) {
|
||||
return getRequest('/sb/list', params)
|
||||
},
|
||||
// 获取上报驱动
|
||||
getQuDong(params) {
|
||||
return getRequest('/sb/support', params)
|
||||
},
|
||||
// 新增上报
|
||||
saveTx(params) {
|
||||
return postJsonRequest("/sb", params);
|
||||
},
|
||||
// 编辑通讯
|
||||
updateTx(params) {
|
||||
return putRequest('/sb', params);
|
||||
},
|
||||
// 上报启停
|
||||
stopSc(params) {
|
||||
return putRequest("/sc", params);
|
||||
},
|
||||
// 删除上报
|
||||
delSc(params) {
|
||||
return deleteRequest("/sb", params);
|
||||
},
|
||||
};
|
||||
export default infoApi;
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
getRequest,
|
||||
postJsonRequest,
|
||||
deleteRequest,
|
||||
putRequest
|
||||
} from '@/utils/axios';
|
||||
const myApi = {
|
||||
// 登录
|
||||
login(params = {}) {
|
||||
return postJsonRequest('/login', params);
|
||||
},
|
||||
// 修改密码
|
||||
editPass(params) {
|
||||
return putRequest("/user", params);
|
||||
},
|
||||
// 退出
|
||||
logOut() {
|
||||
return postJsonRequest('/logout');
|
||||
}
|
||||
}
|
||||
export default myApi;
|
||||
|
After Width: | Height: | Size: 75 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 148 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 303 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 526 B |
After Width: | Height: | Size: 648 B |
|
@ -0,0 +1,267 @@
|
|||
<template>
|
||||
<div class="analyse-container">
|
||||
<div id="echartDiv" class="echartDiv100"></div>
|
||||
<div id="echartDivQ" class="echartDiv100"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "Analyse",
|
||||
components: {
|
||||
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
|
||||
});
|
||||
onMounted(async () => {
|
||||
getChartsZfl("echartDiv", '蒸发量');
|
||||
getChartsZfl("echartDivQ", '蒸发带走的潜热')
|
||||
});
|
||||
const getChartsZfl = (id, text) => {
|
||||
var dom = document.getElementById(id);
|
||||
var op = {
|
||||
color: ['#80FFA5', '#00DDFF', '#37A2FF', '#FF0087', '#FFBF00'],
|
||||
title: {
|
||||
text: text
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['系统A', '系统B', '系统C', '系统D', '系统E']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: [
|
||||
"00",
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
]
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '系统A',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 0
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgb(128, 255, 165)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgb(1, 191, 236)'
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101, 264, 90, 340, 250, 140, 232, 101]
|
||||
},
|
||||
{
|
||||
name: '系统B',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 0
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgb(0, 221, 255)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgb(77, 119, 255)'
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [120, 700, 600, 500, 900, 282, 111, 120, 700, 600, 500, 900, 282, 111, 234, 220, 340, 310, 234, 220, 340, 310, 220, 340]
|
||||
},
|
||||
{
|
||||
name: '系统C',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 0
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgb(55, 162, 255)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgb(116, 21, 219)'
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [320, 132, 201, 334, 190, 130, 320, 132, 201, 334, 190, 130, 220, 220, 320, 132, 201, 334, 190, 130, 220, 190, 130, 220]
|
||||
},
|
||||
{
|
||||
name: '系统D',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 0
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgb(255, 0, 135)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgb(135, 0, 157)'
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [220, 402, 231, 134, 190, 230, 120, 200, 500, 800, 600, 700, 220, 402, 231, 134, 190, 230, 120, 200, 500, 800, 600, 700]
|
||||
},
|
||||
{
|
||||
name: '系统E',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
width: 0
|
||||
},
|
||||
showSymbol: false,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top'
|
||||
},
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgb(255, 191, 0)'
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgb(224, 62, 76)'
|
||||
}
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: [220, 302, 181, 30, 120, 200, 500, 800, 600, 700, 220, 402, 231, 134, 190, 230, 234, 210, 290, 150, 181, 30, 120, 200]
|
||||
}
|
||||
]
|
||||
};
|
||||
getEchart(dom, op)
|
||||
}
|
||||
const getEchart = (dom, op) => {
|
||||
if (dom) {
|
||||
var myChart = echarts.init(dom);
|
||||
var option = op;
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
getChartsZfl,
|
||||
getEchart
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.analyse-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
|
||||
.echartDiv100 {
|
||||
width: 100%;
|
||||
height: 49%;
|
||||
margin: 0 auto;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,264 @@
|
|||
<template>
|
||||
<div class="echart-div">
|
||||
<div class="top-title">
|
||||
<div class="title">{{echartData.title}}</div>
|
||||
</div>
|
||||
<div class="echart" :id="echartData.id">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import moment from "moment";
|
||||
import { useStore } from "vuex";
|
||||
import * as echarts from "echarts";
|
||||
import bus from '../utils/bus.js'
|
||||
|
||||
export default {
|
||||
name: "LineEchart",
|
||||
props: {
|
||||
echartData: Object
|
||||
},
|
||||
setup(props) {
|
||||
const store = useStore();
|
||||
let myChart = null;
|
||||
let data = {};
|
||||
const state = reactive({
|
||||
});
|
||||
onMounted(() => {
|
||||
bus.on('foo', e => {
|
||||
console.log(e)
|
||||
getEchart();
|
||||
})
|
||||
getEchart();
|
||||
});
|
||||
const getEchart = () => {
|
||||
if (store.state.selectDate === 1) {
|
||||
data = {
|
||||
legend: props.echartData.legend,
|
||||
color: props.echartData.color,
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
|
||||
2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 8.3, 5, 4, 5, 6, 7,
|
||||
],
|
||||
type: ["bar"],
|
||||
};
|
||||
} else if (store.state.selectDate === 2) {
|
||||
data = {
|
||||
legend: props.echartData.legend,
|
||||
color: props.echartData.color,
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7
|
||||
],
|
||||
type: ["bar"],
|
||||
};
|
||||
} else if (store.state.selectDate === 0) {
|
||||
var data = {
|
||||
legend: props.echartData.legend,
|
||||
color: props.echartData.color,
|
||||
xData: [
|
||||
"00",
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
|
||||
2.3, 5.3, 8.3, 5, 4, 5, 6, 7,
|
||||
],
|
||||
type: ["bar"],
|
||||
};
|
||||
}
|
||||
let dom = document.getElementById(props.echartData.id);
|
||||
if (dom) {
|
||||
myChart = echarts.init(dom);
|
||||
loadlineChart(myChart, data);
|
||||
}
|
||||
};
|
||||
const loadlineChart = (myChart, data) => {
|
||||
console.log(data);
|
||||
var option = {
|
||||
grid: {
|
||||
left: "8%", //画布左移位置
|
||||
top: "10",
|
||||
width: "90%", //画布宽度
|
||||
height: "75%", //画布高度
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisLabel: {
|
||||
margin: 10, //X轴标签与轴线之间的距离
|
||||
interval: 0, //X轴0强制显示所有标签,1,隔一个显示
|
||||
rotate: -60,
|
||||
textStyle: {
|
||||
color: "#303133", //X轴字体颜色
|
||||
fontSize: "12", //X轴字体大小
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#dfe4ed", //X轴线颜色
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false, //X轴刻度线隐藏
|
||||
},
|
||||
data: data.xData,
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
interval: 0, //X轴0强制显示所有标签,1,隔一个显示
|
||||
textStyle: {
|
||||
color: "#303133", //X轴字体颜色
|
||||
fontSize: "12", //X轴字体大小
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false, //X轴刻度线隐藏
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#dfe4ed", //y轴线颜色
|
||||
},
|
||||
},
|
||||
// 网格线
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: ["#dfe4ed"],
|
||||
width: 1,
|
||||
type: "dotted",
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: data.legend[0],
|
||||
data: data.Values,
|
||||
type: data.type[0],
|
||||
symbolSize: 8,
|
||||
barWidth: "10",
|
||||
barGap: "20%",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: data.color[0],
|
||||
lineStyle: {
|
||||
color: data.color[0],
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
};
|
||||
myChart.setOption(option);
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
getEchart,
|
||||
loadlineChart
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.echart-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.top-title {
|
||||
height: 10%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
border-left: 3px solid #5dcbed;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.echart {
|
||||
height: 85%;
|
||||
width: 100%;
|
||||
|
||||
#myChart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<div class="index">
|
||||
<div class="index-left">
|
||||
|
||||
</div>
|
||||
<div class="index-right">
|
||||
<div class="one-card">
|
||||
<h2>数据显示</h2>
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>生物滞留区域面积</p>
|
||||
<font>75</font>
|
||||
<font>㎡</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>滞留系统液位</p>
|
||||
<font>323</font>
|
||||
<font>mm</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>渗透量</p>
|
||||
<font>1356</font>
|
||||
<font>m³</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>COD</p>
|
||||
<font>19</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>氨氮</p>
|
||||
<font>8</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>SS</p>
|
||||
<font>9</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.index {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.index-left {
|
||||
width: 74%;
|
||||
border: 1px solid rgb(179, 174, 174);
|
||||
}
|
||||
.index-right {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
.one-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
|
||||
h2 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.one-card-content {
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
||||
>div {
|
||||
width: 40%;
|
||||
height: 30%;
|
||||
border: 1px solid rgb(197, 195, 195);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background:#d8e8f7;
|
||||
// align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
font-size: 26px;
|
||||
line-height: 45px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,80 @@
|
|||
<template>
|
||||
<ul>
|
||||
<li v-for="(item,i) in menus" :class="activeI === i? 'active-menu' : ''" @click="activeI = i, go(item.val)"> {{ item.name }} </li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs } from "vue";
|
||||
import {useStore} from 'vuex'
|
||||
import { useRouter } from "vue-router";
|
||||
import bus from '../utils/bus.js'
|
||||
export default {
|
||||
name: "Header",
|
||||
props: ["pactiveI"],
|
||||
setup(props, ctx) {
|
||||
const router = useRouter();
|
||||
const store = useStore();
|
||||
const state = reactive({
|
||||
menus:[
|
||||
{
|
||||
name: '日',
|
||||
val: 0
|
||||
},
|
||||
{
|
||||
name: '月',
|
||||
val: 1
|
||||
},
|
||||
{
|
||||
name: '年',
|
||||
val: 2
|
||||
}
|
||||
],
|
||||
activeI: 0
|
||||
});
|
||||
onMounted(() => {
|
||||
if (props.pactiveI) {
|
||||
state.activeI = props.pactiveI;
|
||||
}
|
||||
});
|
||||
|
||||
const go = (val) => {
|
||||
store.commit("changeSelectDate", val);
|
||||
bus.emit('foo', val);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
go
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
ul {
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
padding: 0 5px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
// border-radius: 5px;
|
||||
&.active-menu
|
||||
{
|
||||
background:#A7DCF5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="type == 'add' ? '添加轮播图' : '修改轮播图'"
|
||||
v-model="visible"
|
||||
width="400px"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form :model="ruleForm" :rules="rules" ref="formRef" label-width="100px" class="good-form">
|
||||
<el-form-item label="图片" prop="url">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="uploadImgServer"
|
||||
accept="jpg,jpeg,png"
|
||||
:headers="{
|
||||
token: token
|
||||
}"
|
||||
:show-file-list="false"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-success="handleUrlSuccess"
|
||||
>
|
||||
<img style="width: 200px; height: 100px; border: 1px solid #e9e9e9;" v-if="ruleForm.url" :src="ruleForm.url" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="跳转链接" prop="link">
|
||||
<el-input type="text" v-model="ruleForm.link"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序值" prop="sort">
|
||||
<el-input type="number" v-model="ruleForm.sort"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reactive, ref, toRefs } from 'vue'
|
||||
// import axios from '@/utils/axios'
|
||||
import { localGet, uploadImgServer, hasEmoji } from '@/utils'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
export default {
|
||||
name: 'DialogAddSwiper',
|
||||
props: {
|
||||
type: String,
|
||||
reload: Function
|
||||
},
|
||||
setup(props) {
|
||||
const formRef = ref(null)
|
||||
const state = reactive({
|
||||
uploadImgServer,
|
||||
token: localGet('token') || '',
|
||||
visible: false,
|
||||
ruleForm: {
|
||||
url: '',
|
||||
link: '',
|
||||
sort: ''
|
||||
},
|
||||
rules: {
|
||||
url: [
|
||||
{ required: 'true', message: '图片不能为空', trigger: ['change'] }
|
||||
],
|
||||
sort: [
|
||||
{ required: 'true', message: '排序不能为空', trigger: ['change'] }
|
||||
]
|
||||
},
|
||||
id: ''
|
||||
})
|
||||
// 获取详情
|
||||
const getDetail = (id) => {
|
||||
// axios.get(`/carousels/${id}`).then(res => {
|
||||
// state.ruleForm = {
|
||||
// url: res.carouselUrl,
|
||||
// link: res.redirectUrl,
|
||||
// sort: res.carouselRank
|
||||
// }
|
||||
// })
|
||||
}
|
||||
const handleBeforeUpload = (file) => {
|
||||
const sufix = file.name.split('.')[1] || ''
|
||||
if (!['jpg', 'jpeg', 'png'].includes(sufix)) {
|
||||
ElMessage.error('请上传 jpg、jpeg、png 格式的图片')
|
||||
return false
|
||||
}
|
||||
}
|
||||
// 上传图片
|
||||
const handleUrlSuccess = (val) => {
|
||||
state.ruleForm.url = val.data || ''
|
||||
}
|
||||
// 开启弹窗
|
||||
const open = (id) => {
|
||||
state.visible = true
|
||||
if (id) {
|
||||
state.id = id
|
||||
getDetail(id)
|
||||
} else {
|
||||
state.ruleForm = {
|
||||
url: '',
|
||||
link: '',
|
||||
sort: ''
|
||||
}
|
||||
}
|
||||
}
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
state.visible = false
|
||||
}
|
||||
const handleClose = () => {
|
||||
formRef.value.resetFields()
|
||||
}
|
||||
const submitForm = () => {
|
||||
console.log(formRef.value.validate)
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
if (hasEmoji(state.ruleForm.link)) {
|
||||
ElMessage.error('不要输入表情包,再输入就打死你个龟孙儿~')
|
||||
return
|
||||
}
|
||||
if (props.type == 'add') {
|
||||
// axios.post('/carousels', {
|
||||
// carouselUrl: state.ruleForm.url,
|
||||
// redirectUrl: state.ruleForm.link,
|
||||
// carouselRank: state.ruleForm.sort
|
||||
// }).then(() => {
|
||||
// ElMessage.success('添加成功')
|
||||
// state.visible = false
|
||||
// if (props.reload) props.reload()
|
||||
// })
|
||||
} else {
|
||||
// axios.put('/carousels', {
|
||||
// carouselId: state.id,
|
||||
// carouselUrl: state.ruleForm.url,
|
||||
// redirectUrl: state.ruleForm.link,
|
||||
// carouselRank: state.ruleForm.sort
|
||||
// }).then(() => {
|
||||
// ElMessage.success('修改成功')
|
||||
// state.visible = false
|
||||
// if (props.reload) props.reload()
|
||||
// })
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
open,
|
||||
close,
|
||||
formRef,
|
||||
handleBeforeUpload,
|
||||
handleUrlSuccess,
|
||||
submitForm,
|
||||
handleClose
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.avatar-uploader {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
color: #ddd;
|
||||
font-size: 30px;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 32px 17px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,202 @@
|
|||
<template>
|
||||
<div class="flow-container">
|
||||
<div class="left-div">
|
||||
<div class="date">
|
||||
<Date />
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) of listData"
|
||||
:key="index"
|
||||
class="echart-content"
|
||||
>
|
||||
<BarEchart :echartData="item" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-div">
|
||||
<div
|
||||
v-for="(item, index) of dataList"
|
||||
:key="index"
|
||||
:class="'div' + index"
|
||||
>
|
||||
<div>{{ item.title }}</div>
|
||||
<div v-for="(it, i) of item.data" :key="i">
|
||||
<Process :itemData="it"></Process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "Flow",
|
||||
components: {
|
||||
BarEchart,
|
||||
Process,
|
||||
Date
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
listData: [
|
||||
{
|
||||
id: "echart0",
|
||||
title: "UF产水流量-柱状图",
|
||||
legend: ["UF产水流量-柱状图"],
|
||||
color: ["#6fdbce", "#eafbf7"],
|
||||
},
|
||||
{
|
||||
id: "echart1",
|
||||
title: "自来水前端流量-柱状图",
|
||||
legend: ["自来水前端流量-柱状图"],
|
||||
color: ["#308286", "#eafbf7"],
|
||||
},
|
||||
{
|
||||
id: "echart2",
|
||||
title: "供水流量-柱状图",
|
||||
legend: ["供水流量-柱状图"],
|
||||
color: ["#308286", "#eafbf7"],
|
||||
},
|
||||
{
|
||||
id: "echart3",
|
||||
title: "自来水后端流量-柱状图",
|
||||
legend: ["自来水后端流量-柱状图"],
|
||||
color: ["#62d3ff", "#eafbf7"],
|
||||
},
|
||||
],
|
||||
dataList: [
|
||||
{
|
||||
title: "UF产水瞬时流量:m3/H:",
|
||||
data: [
|
||||
{
|
||||
id: "0",
|
||||
color: "#6fdbce",
|
||||
label: "Q1",
|
||||
value: "20",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "UF产水累计流量:m3",
|
||||
data: [
|
||||
{
|
||||
id: "1",
|
||||
color: "#00baff",
|
||||
label: "Q2",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "自来水前端瞬时流量:m3/H",
|
||||
data: [
|
||||
{
|
||||
id: "3",
|
||||
color: "#308286",
|
||||
label: "Q3",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "自来水前端累计流量:m3",
|
||||
data: [
|
||||
{
|
||||
id: "4",
|
||||
color: "#00baff",
|
||||
label: "Q4",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "供水瞬时流量:m3/H",
|
||||
data: [
|
||||
{
|
||||
id: "5",
|
||||
color: "#00baff",
|
||||
label: "Q5",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "供水累计流量:m3",
|
||||
data: [
|
||||
{
|
||||
id: "6",
|
||||
color: "#00baff",
|
||||
label: "Q6",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "自程谥来水后端瞬时流量:m3/H",
|
||||
data: [
|
||||
{
|
||||
id: "7",
|
||||
color: "#00baff",
|
||||
label: "Q7",
|
||||
value: "10",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "自来水后端累计弃流量:m3",
|
||||
data: [
|
||||
{
|
||||
id: "8",
|
||||
color: "#00baff",
|
||||
label: "Q8",
|
||||
value: "40",
|
||||
},
|
||||
],
|
||||
}
|
||||
],
|
||||
});
|
||||
onMounted(async () => {});
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.flow-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
.left-div {
|
||||
width: 75%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.echart-content {
|
||||
width: 49%;
|
||||
height: 46%;
|
||||
}
|
||||
}
|
||||
.right-div {
|
||||
width: 22%;
|
||||
height: 100%;
|
||||
}
|
||||
.date {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 3%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<div class="footer">
|
||||
<div class="left">Copyright © 2019-2021 十三. All rights reserved.</div>
|
||||
<div class="right">
|
||||
<a target="_blank" href="https://github.com/newbee-ltd/vue3-admin">vue3-admin Version 3.0.0</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Footer'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.footer {
|
||||
height: 50px;
|
||||
border-top: 1px solid #e9e9e9;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,170 @@
|
|||
<template>
|
||||
<div class="analyse-container">
|
||||
<div id="echartDiv" class="echartDiv100"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "Analyse",
|
||||
components: {
|
||||
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
|
||||
});
|
||||
onMounted(async () => {
|
||||
getChartsZfl("echartDiv", '蒸发量');
|
||||
getChartsZfl("echartDivQ", '蒸发带走的潜热')
|
||||
});
|
||||
const getChartsZfl = (id, text) => {
|
||||
var dom = document.getElementById(id);
|
||||
var op = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['系统A', '系统B', '系统C', '系统D', '系统E']
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [
|
||||
"00",
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
],
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '热岛消减率A',
|
||||
min: 0,
|
||||
max: 250,
|
||||
interval: 50,
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '热岛消减率B',
|
||||
min: 0,
|
||||
max: 25,
|
||||
interval: 5,
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '系统A',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
data: [
|
||||
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3, 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '系统B',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
data: [
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '系统C',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
data: [
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '系统D',
|
||||
type: 'bar',
|
||||
stack: 'one',
|
||||
data: [
|
||||
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3, 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '系统E',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [
|
||||
2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2, 2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
getEchart(dom, op)
|
||||
}
|
||||
const getEchart = (dom, op) => {
|
||||
if (dom) {
|
||||
var myChart = echarts.init(dom);
|
||||
var option = op;
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
getChartsZfl,
|
||||
getEchart
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.analyse-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
|
||||
.echartDiv100 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,124 @@
|
|||
<template>
|
||||
<div class="green">
|
||||
<div class="index-top">
|
||||
|
||||
</div>
|
||||
<div class="index-bottom">
|
||||
<div class="one-card">
|
||||
<h2>数据显示</h2>
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>径流系数</p>
|
||||
<font>0.6</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>蒸腾量</p>
|
||||
<font>32%</font>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<p>COD</p>
|
||||
<font>27</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>氨氮</p>
|
||||
<font>11</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>Ss</p>
|
||||
<font>6</font>
|
||||
<font>mg/L</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>屋面温度 无绿化</p>
|
||||
<font>23</font>
|
||||
<font>℃</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>屋面温度 有绿化</p>
|
||||
<font>19</font>
|
||||
<font>℃</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>热岛减率</p>
|
||||
<font>21%</font>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'green',
|
||||
components: {
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.green {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
.index-top {
|
||||
width: 100%;
|
||||
height: 74%;
|
||||
border: 1px solid rgb(179, 174, 174);
|
||||
}
|
||||
.index-bottom {
|
||||
width: 100%;
|
||||
height: 25%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.one-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
|
||||
h2 {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.one-card-content {
|
||||
width: 100%;
|
||||
height: 73%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
||||
>div {
|
||||
width: 10%;
|
||||
height: 80%;
|
||||
border: 1px solid rgb(197, 195, 195);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background:#d8e8f7;
|
||||
// align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div class="header">
|
||||
<div class="left" @click="back" style="cursor: pointer">
|
||||
<i v-if="hasBack" class="el-icon-back" ></i>
|
||||
<span style="font-size: 20px">{{ name }}</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
:width="320"
|
||||
trigger="click"
|
||||
popper-class="popper-user-box"
|
||||
>
|
||||
<template #reference>
|
||||
<div class="author">
|
||||
<i class="icon el-icon-s-custom" />
|
||||
{{ userInfo && userInfo.nickName || '' }}
|
||||
<i class="el-icon-caret-bottom" />
|
||||
</div>
|
||||
</template>
|
||||
<div class="nickname">
|
||||
<p>登录名:{{ userInfo && userInfo.loginUserName || '' }}</p>
|
||||
<p>昵称:{{ userInfo && userInfo.nickName || '' }}</p>
|
||||
<el-tag size="small" effect="dark" class="logout" @click="logout">退出</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { localRemove, pathMap } from '@/utils'
|
||||
import myApi from '@/api/myApi.js'
|
||||
export default {
|
||||
name: 'Header',
|
||||
setup() {
|
||||
const router = useRouter()
|
||||
const state = reactive({
|
||||
name: 'dashboard',
|
||||
userInfo: null,
|
||||
hasBack: false
|
||||
})
|
||||
onMounted(() => {
|
||||
const pathname = window.location.hash.split('/')[1] || ''
|
||||
if (!['login'].includes(pathname)) {
|
||||
getUserInfo()
|
||||
}
|
||||
})
|
||||
const getUserInfo = async () => {
|
||||
const userInfo = await myApi.getUserInfo();
|
||||
state.userInfo = userInfo
|
||||
}
|
||||
const logout = async () => {
|
||||
await myApi.logout();
|
||||
localRemove('token')
|
||||
window.location.reload()
|
||||
}
|
||||
const back = () => {
|
||||
router.push('/home')
|
||||
}
|
||||
router.afterEach((to) => {
|
||||
console.log('to', to)
|
||||
const { id } = to.query
|
||||
state.name = pathMap[to.name]
|
||||
// state.hasBack = ['level2', 'level3', 'order_detail'].includes(to.name)
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
logout,
|
||||
back
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.header {
|
||||
height: 50px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.el-icon-back {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 4px;
|
||||
border-radius: 50px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.right > div > .icon{
|
||||
font-size: 18px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.author {
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.popper-user-box {
|
||||
background: url('https://s.yezgea02.com/lingling-h5/static/account-banner-bg.png') 50% 50% no-repeat!important;
|
||||
background-size: cover!important;
|
||||
border-radius: 0!important;
|
||||
}
|
||||
.popper-user-box .nickname {
|
||||
position: relative;
|
||||
color: #ffffff;
|
||||
}
|
||||
.popper-user-box .nickname .logout {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,174 @@
|
|||
<template>
|
||||
<div class="level-container">
|
||||
<div class="content">
|
||||
<div class="top-div">
|
||||
</div>
|
||||
<div class="bottom-div">
|
||||
<div class="left-bottom">
|
||||
<BarEchart :echartData="echartData"/>
|
||||
</div>
|
||||
<div class="right-bottom">
|
||||
<div v-for="(item, index) of dataList" :key="index" :class="'div'+ index">
|
||||
<div>{{item.title}}</div>
|
||||
<div v-for="(it, i) of item.data" :key="i">
|
||||
<Process :itemData="it"></Process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import BarEchart from '@/components/BarEchart.vue';
|
||||
import Process from "@/components/Process.vue"
|
||||
import Menus from "@/components/Menus.vue";
|
||||
export default {
|
||||
name: "Level",
|
||||
components: {
|
||||
BarEchart,
|
||||
Process,
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
dataList:[
|
||||
{
|
||||
title: '当天液位数据:m',
|
||||
data: [
|
||||
{
|
||||
id: '0',
|
||||
color: '#00baff',
|
||||
label: 'H1',
|
||||
value: '20'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '5号井的液位设置参数:m',
|
||||
data: [
|
||||
{
|
||||
id: '1',
|
||||
color: '#00baff',
|
||||
label: 'Hmax',
|
||||
value: '80'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
color: '#6fdbce',
|
||||
label: 'Hmin',
|
||||
value: '20'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '溢流堰液位:m',
|
||||
data: [
|
||||
{
|
||||
id: '3',
|
||||
color: '#308286',
|
||||
label: 'Hy',
|
||||
value: '80'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '未来待三天控制液位:m',
|
||||
data: [
|
||||
{
|
||||
id: '4',
|
||||
color: '#00baff',
|
||||
label: 'F1',
|
||||
value: '80'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
color: '#6fdbce',
|
||||
label: 'F2',
|
||||
value: '80'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
color: '#308286',
|
||||
label: 'F3',
|
||||
value: '60'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
echartData: {
|
||||
type:"day" ,
|
||||
title: "日液位-柱状图",
|
||||
id: "echart0",
|
||||
legend: ["日液位曲线"],
|
||||
color: ["#62d3ff", "#eafbf7"]
|
||||
}
|
||||
});
|
||||
onMounted(() => {
|
||||
|
||||
});
|
||||
|
||||
return {
|
||||
...toRefs(state)
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.level-container {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
}
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// border: 1px solid red;
|
||||
.top-div {
|
||||
height:40%;
|
||||
background: url('../assets/flow.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.bottom-div {
|
||||
margin-top:2%;
|
||||
height:55%;
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
.left-bottom {
|
||||
width: 60%;
|
||||
height:100%;
|
||||
}
|
||||
.right-bottom {
|
||||
width: 38%;
|
||||
height:100%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
flex-wrap: wrap;
|
||||
.div0 {
|
||||
width: 48%;
|
||||
height: 30%;
|
||||
}
|
||||
.div1 {
|
||||
width: 48%;
|
||||
height: 40%;
|
||||
}
|
||||
.div2 {
|
||||
width: 48%;
|
||||
height: 30%;
|
||||
}
|
||||
.div3 {
|
||||
width: 48%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,170 @@
|
|||
<template>
|
||||
<div class="history-container">
|
||||
<div class="flex top">
|
||||
<div class="flex width200">
|
||||
<span> 系统选择:</span>
|
||||
<el-select v-model="value1" placeholder="请选择" size="mini">
|
||||
<el-option
|
||||
v-for="item in fxOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="date">
|
||||
<Date />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) of listData"
|
||||
:key="index"
|
||||
class="middle"
|
||||
>
|
||||
<BarEchart :echartData="item" class="echartDiv100"/>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<el-table :data="tableData" style="width: 100%" border="1" height="360" class="table-left-header">
|
||||
<el-table-column v-for="item in tableHeader" :prop="item.prop" :label="item.label" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "History",
|
||||
components: {
|
||||
BarEchart,
|
||||
Process,
|
||||
Date
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
listData: [
|
||||
{
|
||||
id: "echart0",
|
||||
title: "降水量-柱状图",
|
||||
legend: ['降水量'],
|
||||
color: ["#6fdbce"],
|
||||
}],
|
||||
fxOptions: [{
|
||||
value: '0',
|
||||
label: '降水量',
|
||||
},{
|
||||
value: '1',
|
||||
label: '系统A',
|
||||
},{
|
||||
value: '2',
|
||||
label: '系统B',
|
||||
},{
|
||||
value: '3',
|
||||
label: '系统C',
|
||||
},{
|
||||
value: '4',
|
||||
label: '系统D',
|
||||
},{
|
||||
value: '5',
|
||||
label: '系统E',
|
||||
}],
|
||||
value1:'降水量',
|
||||
tableHeader: [{
|
||||
prop: 'one',
|
||||
label: '1点'
|
||||
},{
|
||||
prop: 'two',
|
||||
label: '2点'
|
||||
},{
|
||||
prop: 'three',
|
||||
label: '3点'
|
||||
},{
|
||||
prop: 'four',
|
||||
label: '4点'
|
||||
},{
|
||||
prop: 'five',
|
||||
label: '5点'
|
||||
},{
|
||||
prop: 'six',
|
||||
label: '6点'
|
||||
},{
|
||||
prop: 'seven',
|
||||
label: '7点'
|
||||
},{
|
||||
prop: 'eight',
|
||||
label: '8点'
|
||||
},{
|
||||
prop: 'nine',
|
||||
label: '9点'
|
||||
},{
|
||||
prop: 'ten',
|
||||
label: '10点'
|
||||
}],
|
||||
tableData: [{
|
||||
one: '100',
|
||||
two: '200',
|
||||
three: '100',
|
||||
four: '500',
|
||||
five: '200',
|
||||
six: '300',
|
||||
seven: '200',
|
||||
eight: '100',
|
||||
nine: '300',
|
||||
ten: '400'
|
||||
}]
|
||||
});
|
||||
onMounted(async () => {});
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.history-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
.top {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
}
|
||||
.middle {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
// border: 1px solid red;s
|
||||
.echartDiv100 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
.bottom{
|
||||
height: calc(100% - 520px);
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.date {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 50%;
|
||||
}
|
||||
.width200 {
|
||||
width: 200px;
|
||||
>span {
|
||||
display: inline-block;
|
||||
width: 180px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<div class="index">
|
||||
<div class="index-left">
|
||||
|
||||
</div>
|
||||
<div class="index-right">
|
||||
<div class="one-card">
|
||||
<div class="one-card-left">
|
||||
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>节水量</p>
|
||||
<font>4.00m³</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>节碳量</p>
|
||||
<font>0.67KG</font>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color0 one-card-right">
|
||||
<h3>
|
||||
节水与节碳
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="one-card">
|
||||
<div class="one-card-left">
|
||||
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>原水箱液位</p>
|
||||
<p>0.39m</p>
|
||||
<p>历史最高:0.50m</p>
|
||||
<p>历史最低:0.24m</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>净水箱液位</p>
|
||||
<p>0.81m</p>
|
||||
<p>历史最高:1.63m</p>
|
||||
<p>历史最低:0.48m</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color1 one-card-right">
|
||||
<h3>
|
||||
液位
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="one-card">
|
||||
<div class="one-card-left">
|
||||
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>UF产水</p>
|
||||
<p>瞬时流量:0.00 m³/H</p>
|
||||
<p>累计流量:4m³</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>自来水前端</p>
|
||||
<p>瞬时流量:0.00 m³/H</p>
|
||||
<p>累计流量:4m³</p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<p>供水</p>
|
||||
<p>瞬时流量:0.00 m³/H</p>
|
||||
<p>累计流量:4m³</p>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<p>自来水后端</p>
|
||||
<p>瞬时流量:0.00 m³/H</p>
|
||||
<p>累计流量:4m³</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color2 one-card-right">
|
||||
<h3>
|
||||
流量
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="one-card">
|
||||
<div class="one-card-left">
|
||||
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>原水水质</p>
|
||||
<p>余氯:0.00 mg/L</p>
|
||||
<p>浊度:1.63 mg/L</p>
|
||||
<p>氨氮:1.41 mg/L</p>
|
||||
<p>COD:4.80 mg/L</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>净水水质</p>
|
||||
<p>余氯:-0.73 mg/L</p>
|
||||
<p>浊度:3.56 mg/L</p>
|
||||
<p>氨氮:41.89 mg/L</p>
|
||||
<p>COD:3.53 mg/L</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color3 one-card-right">
|
||||
<h3>
|
||||
水质
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.index {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.index-left {
|
||||
width: 69%;
|
||||
border: 1px solid rgb(179, 174, 174);
|
||||
}
|
||||
.index-right {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
.one-card {
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.one-card-left {
|
||||
width: 80%;
|
||||
padding: 10px;
|
||||
|
||||
.one-card-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
// border: 1px solid #1840af;
|
||||
justify-content: space-between;
|
||||
>div {
|
||||
width: 48%;
|
||||
// height: 48%;
|
||||
border: 1px solid rgb(197, 195, 195);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// align-items: center;
|
||||
justify-content: center;
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.one-card-right {
|
||||
width: 20%;
|
||||
background: #ddd;
|
||||
h3 {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.color0 {
|
||||
background: linear-gradient(to right, rgb(171, 187, 187), #7BB7B7);
|
||||
}
|
||||
.color1 {
|
||||
background: linear-gradient(to right, #e2eff1, #99ACB0);
|
||||
}
|
||||
.color2 {
|
||||
background: linear-gradient(to right, #b8e5f5, #6ED2F6);
|
||||
}
|
||||
.color3 {
|
||||
background: linear-gradient(to right, #bfdad9, #A3D8D6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,396 @@
|
|||
<template>
|
||||
<div class="echart-div">
|
||||
<div class="top-title">
|
||||
<div class="title">{{ echartData.title }}</div>
|
||||
</div>
|
||||
<div class="echart" :id="echartData.id"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs, watch,defineExpose } from "vue";
|
||||
import moment from "moment";
|
||||
import { useStore } from "vuex";
|
||||
import * as echarts from "echarts";
|
||||
import bus from '../utils/bus.js'
|
||||
export default {
|
||||
name: "LineEchart",
|
||||
props: {
|
||||
echartData: Object,
|
||||
activeName: String
|
||||
},
|
||||
setup(props) {
|
||||
const store = useStore();
|
||||
let myChart = null;
|
||||
let data = {};
|
||||
const state = reactive({
|
||||
dates: "",
|
||||
});
|
||||
onMounted(() => {
|
||||
bus.on('foo', e => {
|
||||
getEchart();
|
||||
})
|
||||
getEchart();
|
||||
});
|
||||
const getEchart = () => {
|
||||
if (store.state.selectTab === 'pure') {
|
||||
if (store.state.selectDate === 1) {
|
||||
data = {
|
||||
legend: ["月余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
|
||||
2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 8.3, 5, 4, 5, 6, 7,
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
} else if (store.state.selectDate === 2) {
|
||||
data = {
|
||||
legend: ["年余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
],
|
||||
Values: [
|
||||
4.3, 1.3, 5.3, 3, 1.3, 2.3, 3.3, 4, 4, 5, 3, 1
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
} else if (store.state.selectDate === 0) {
|
||||
var data = {
|
||||
legend: ["日余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"00",
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
|
||||
2.3, 5.3, 8.3, 5, 4, 5, 6, 7,
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (store.state.selectDate === 1) {
|
||||
data = {
|
||||
legend: ["月余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
"24",
|
||||
"25",
|
||||
"26",
|
||||
"27",
|
||||
"28",
|
||||
"29",
|
||||
"30",
|
||||
],
|
||||
Values: [
|
||||
8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 5, 4, 5, 6, 7,6, 7, 8.3,2.3, 5.3, 8.3, 5, 2.3, 5.3,
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
} else if (store.state.selectDate === 2) {
|
||||
data = {
|
||||
legend: ["年余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5",
|
||||
"6",
|
||||
"7",
|
||||
"8",
|
||||
"9",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
],
|
||||
Values: [
|
||||
5, 6, 7, 2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4,
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
} else if (store.state.selectDate === 0) {
|
||||
var data = {
|
||||
legend: ["日余氯查询"],
|
||||
color: ["#62d3ff"],
|
||||
xData: [
|
||||
"00",
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"05",
|
||||
"06",
|
||||
"07",
|
||||
"08",
|
||||
"09",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
"20",
|
||||
"21",
|
||||
"22",
|
||||
"23",
|
||||
],
|
||||
Values: [
|
||||
2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5, 2.3, 5.3
|
||||
],
|
||||
type: ["line"],
|
||||
};
|
||||
}
|
||||
}
|
||||
let dom = document.getElementById(props.echartData.id);
|
||||
if (dom) {
|
||||
myChart = echarts.init(dom);
|
||||
loadlineChart(myChart, data);
|
||||
}
|
||||
};
|
||||
const loadlineChart = (myChart, data) => {
|
||||
console.log(store.state.selectTab );
|
||||
console.log(store.state.selectDate );
|
||||
console.log(data );
|
||||
var option = {
|
||||
legend: {
|
||||
data: data.legend,
|
||||
left: "center",
|
||||
top: "bottom",
|
||||
textStyle: {
|
||||
color: "#393333",
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: "8%", //画布左移位置
|
||||
top: "10",
|
||||
bottom: "20",
|
||||
width: "90%", //画布宽度
|
||||
height: "60%", //画布高度
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis"
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisLabel: {
|
||||
margin: 10, //X轴标签与轴线之间的距离
|
||||
interval: 0, //X轴0强制显示所有标签,1,隔一个显示
|
||||
rotate: -60,
|
||||
textStyle: {
|
||||
color: "#303133", //X轴字体颜色
|
||||
fontSize: "12", //X轴字体大小
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#dfe4ed", //X轴线颜色
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false, //X轴刻度线隐藏
|
||||
},
|
||||
data: data.xData,
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
axisLabel: {
|
||||
interval: 0, //X轴0强制显示所有标签,1,隔一个显示
|
||||
textStyle: {
|
||||
color: "#303133", //X轴字体颜色
|
||||
fontSize: "12", //X轴字体大小
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false, //X轴刻度线隐藏
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#dfe4ed", //y轴线颜色
|
||||
},
|
||||
},
|
||||
// 网格线
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: ["#dfe4ed"],
|
||||
width: 1,
|
||||
type: "dotted",
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: data.legend[0],
|
||||
data: data.Values,
|
||||
type: data.type[0],
|
||||
symbolSize: 8,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: data.color[0],
|
||||
lineStyle: {
|
||||
color: data.color[0],
|
||||
},
|
||||
},
|
||||
},
|
||||
markLine: {
|
||||
symbol: ["none", "none"], // 标线两端的样式
|
||||
data: [
|
||||
{
|
||||
yAxis: 20,
|
||||
},
|
||||
// { yAxis: 10 },
|
||||
],
|
||||
lineStyle: {
|
||||
color: "red",
|
||||
width: 2,
|
||||
},
|
||||
label: {
|
||||
position: "end", // 表现内容展示的位置
|
||||
formatter: props.echartData.title + "限定值", // 标线展示的内容
|
||||
color: "#8C8C8C", // 展示内容颜色
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
};
|
||||
myChart.setOption(option);
|
||||
};
|
||||
// 输出组件的方法,让外部组件可以调用
|
||||
defineExpose({
|
||||
getEchart
|
||||
});
|
||||
return {
|
||||
...toRefs(state),
|
||||
getEchart,
|
||||
// loadlineChart
|
||||
};
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.echart-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.top-title {
|
||||
height: 10%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
border-left: 3px solid #5dcbed;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.echart {
|
||||
height: 85%;
|
||||
width: 100%;
|
||||
border: 1px solid green;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,168 @@
|
|||
<template>
|
||||
<div class="liquid-container">
|
||||
<div class="left-div">
|
||||
<div class="date">
|
||||
<Date />
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) of listData"
|
||||
:key="index"
|
||||
class="echart-content"
|
||||
>
|
||||
<BarEchart :echartData="item" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-div">
|
||||
<div
|
||||
v-for="(item, index) of dataList"
|
||||
:key="index"
|
||||
:class="'div' + index"
|
||||
>
|
||||
<div>{{ item.title }}</div>
|
||||
<div v-for="(it, i) of item.data" :key="i">
|
||||
<Process :itemData="it"></Process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "Flow",
|
||||
components: {
|
||||
BarEchart,
|
||||
Process,
|
||||
Date
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
listData: [
|
||||
{
|
||||
id: "echart0",
|
||||
title: "原水箱液位-柱状图",
|
||||
legend: ['原水箱柱状图'],
|
||||
color: ["#6fdbce", "#eafbf7"],
|
||||
},
|
||||
{
|
||||
id: "echart1",
|
||||
title: "净水箱液位-柱状图",
|
||||
legend: ['净水箱柱状图'],
|
||||
color: ["#308286", "#eafbf7"],
|
||||
}
|
||||
],
|
||||
dataList: [
|
||||
{
|
||||
title: "原水箱液位数据(m):",
|
||||
data: [
|
||||
{
|
||||
id: "0",
|
||||
color: "#6fdbce",
|
||||
label: "Q1",
|
||||
value: "20",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "原水箱历史最高值(m):",
|
||||
data: [
|
||||
{
|
||||
id: "1",
|
||||
color: "#00baff",
|
||||
label: "Max",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "原水箱历史最低值(m):",
|
||||
data: [
|
||||
{
|
||||
id: "3",
|
||||
color: "#308286",
|
||||
label: "Min",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "净水箱液位数据(m):",
|
||||
data: [
|
||||
{
|
||||
id: "0",
|
||||
color: "#6fdbce",
|
||||
label: "Q2",
|
||||
value: "20",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "净水箱历史最高值(m):",
|
||||
data: [
|
||||
{
|
||||
id: "1",
|
||||
color: "#00baff",
|
||||
label: "Max",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "净水箱历史最低值(m):",
|
||||
data: [
|
||||
{
|
||||
id: "3",
|
||||
color: "#308286",
|
||||
label: "Min",
|
||||
value: "80",
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
});
|
||||
onMounted(async () => {});
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.liquid-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
.left-div {
|
||||
width: 75%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.echart-content {
|
||||
width: 100%;
|
||||
height: 46%;
|
||||
}
|
||||
}
|
||||
.right-div {
|
||||
width: 22%;
|
||||
height: 100%;
|
||||
}
|
||||
.date {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 3%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,65 @@
|
|||
<template>
|
||||
<ul>
|
||||
<li v-for="(item,i) in menus" :class="activeI === i? 'active-menu' : ''" @click="activeI = i, go(i)"> {{ item.name }} </li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
export default {
|
||||
name: "Header",
|
||||
props: ["pactiveI", "menus"],
|
||||
setup(props, ctx) {
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
activeI: 0,
|
||||
menus: []
|
||||
});
|
||||
onMounted(() => {
|
||||
if (props.pactiveI) {
|
||||
state.activeI = props.pactiveI;
|
||||
state.menus = props.menus
|
||||
}
|
||||
});
|
||||
|
||||
const go = (i) => {
|
||||
ctx.emit("changeIndex", i);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
go
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
ul {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20px;
|
||||
// border: 1px solid #0f9b49;
|
||||
display: flex;
|
||||
padding: 0 5px;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
height: 24%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
border-radius: 5px;
|
||||
&.active-menu
|
||||
{
|
||||
background:#A7DCF5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,174 @@
|
|||
<template>
|
||||
<div class="process-div">
|
||||
<span>{{ itemData.label }}</span>
|
||||
<!-- <div :id="'process' + itemData.id" class="process-echart"></div> -->
|
||||
<div class="process-echart">
|
||||
<el-progress
|
||||
:text-inside="true"
|
||||
:stroke-width="20"
|
||||
:percentage="itemData.value"
|
||||
:color="itemData.color"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import * as echarts from "echarts";
|
||||
export default {
|
||||
name: "Process",
|
||||
props: {
|
||||
itemData: Object,
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
let myChart = null;
|
||||
let data = {};
|
||||
const state = reactive({});
|
||||
onMounted(() => {
|
||||
getEchart();
|
||||
});
|
||||
const getEchart = () => {
|
||||
data = {};
|
||||
let dom = document.getElementById("process" + props.itemData.id);
|
||||
if (dom) {
|
||||
myChart = echarts.init(dom);
|
||||
loadProcessChart(myChart, data);
|
||||
}
|
||||
};
|
||||
const loadProcessChart = (myChart, data) => {
|
||||
console.log(123, myChart);
|
||||
var option = {
|
||||
grid: {
|
||||
top: "0",
|
||||
left: "1%",
|
||||
right: "10%",
|
||||
bottom: "0",
|
||||
},
|
||||
xAxis: {
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
data: ["水"],
|
||||
inverse: true,
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 18,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
axisTick: { show: false }, // 不显示刻度线
|
||||
axisLabel: {
|
||||
color: "#000",
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
inverse: true,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "进度条",
|
||||
yAxisIndex: 0,
|
||||
type: "pictorialBar",
|
||||
symbol: "rect", // 长方形
|
||||
symbolRepeat: "fixed",
|
||||
symbolMargin: "0", // 缝隙
|
||||
symbolClip: true,
|
||||
symbolSize: ["3", "16"],
|
||||
barCategoryGap: 50,
|
||||
label: {
|
||||
show: true,
|
||||
position: [0, 50],
|
||||
fontSize: 14,
|
||||
formatter: "水(m³)",
|
||||
},
|
||||
zlevel: 1, // zlevel 大的 Canvas 会放在 zlevel 小的 Canvas 的上面
|
||||
data: [
|
||||
{
|
||||
value: 780,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#047CFF",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "进度条背景",
|
||||
type: "bar",
|
||||
yAxisIndex: 1,
|
||||
barGap: "-100%", // 不同系列的柱间距离,为百分比。
|
||||
barCategoryGap: 5,
|
||||
barWidth: 20,
|
||||
left: "50",
|
||||
data: [1000],
|
||||
color: "#00baff", // 柱条颜色
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: function (params) {
|
||||
return '#fff';
|
||||
},
|
||||
barBorderRadius: [10], //设置圆角
|
||||
},
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true, // 是否显示进度条上方的百分比
|
||||
formatter: (series) => "780/1000",
|
||||
position: [913, -20],
|
||||
textStyle: {
|
||||
color: "#000", // 进度条上方百分比字体颜色
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
myChart.setOption(option);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
getEchart,
|
||||
loadProcessChart
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.process-div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 50px;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
.process-echart {
|
||||
width: 83%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,199 @@
|
|||
<template>
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
type="card"
|
||||
class="demo-tabs"
|
||||
@tab-click="handleClick"
|
||||
>
|
||||
<el-tab-pane label="原水水质" name="old" key="old">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="净水水质" name="pure" key="pure">
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="content-water">
|
||||
<div class="date">
|
||||
<Date />
|
||||
</div>
|
||||
<div class="flow-container">
|
||||
<div class="left-div">
|
||||
<div
|
||||
v-for="(item, index) of dataList"
|
||||
:key="index"
|
||||
:class="'div' + index"
|
||||
class="process-content"
|
||||
>
|
||||
<div>{{ item.title }}</div>
|
||||
<div v-for="(it, i) of item.data" :key="i">
|
||||
<Process :itemData="it"></Process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-div">
|
||||
<div
|
||||
v-for="(item, index) of listData"
|
||||
:key="index"
|
||||
class="echart-content"
|
||||
>
|
||||
<LineEchart :echartData="item" :activeName="activeName" ref="refSon"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs, ref, nextTick } from "vue";
|
||||
import LineEchart from "@/components/LineEchart.vue";
|
||||
import Process from "@/components/Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
import {useStore} from 'vuex';
|
||||
import bus from '../utils/bus.js'
|
||||
export default {
|
||||
name: "Flow",
|
||||
components: {
|
||||
LineEchart,
|
||||
Process,
|
||||
Date
|
||||
},
|
||||
setup() {
|
||||
const refSon = ref(null);
|
||||
const store = useStore();
|
||||
const state = reactive({
|
||||
listData: [
|
||||
{
|
||||
id: "echart0",
|
||||
title: "余氯查询",
|
||||
},
|
||||
{
|
||||
id: "echart1",
|
||||
title: "浊度查询",
|
||||
},
|
||||
{
|
||||
id: "echart2",
|
||||
title: "氨氮查询",
|
||||
},
|
||||
{
|
||||
id: "echart3",
|
||||
title: "COD查询",
|
||||
},
|
||||
],
|
||||
dataList: [
|
||||
{
|
||||
title: "余氯:",
|
||||
data: [
|
||||
{
|
||||
id: "0",
|
||||
color: "#6fdbce",
|
||||
label: "COD1",
|
||||
value: "20",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "浊度:",
|
||||
data: [
|
||||
{
|
||||
id: "1",
|
||||
color: "#00baff",
|
||||
label: "COD2",
|
||||
value: "80",
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "氨氮:",
|
||||
data: [
|
||||
{
|
||||
id: "3",
|
||||
color: "#308286",
|
||||
label: "氨氮",
|
||||
value: "80",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "COD:",
|
||||
data: [
|
||||
{
|
||||
id: "4",
|
||||
color: "#00baff",
|
||||
label: "COD",
|
||||
value: "80",
|
||||
}
|
||||
],
|
||||
}
|
||||
],
|
||||
activeName: 'old'
|
||||
});
|
||||
onMounted(() => {
|
||||
store.commit("changeSelectTab", "old");
|
||||
});
|
||||
const handleClick = (tab) => {
|
||||
console.log(tab.props.name);
|
||||
store.commit("changeSelectTab", tab.props.name);
|
||||
bus.emit('foo');
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
handleClick,
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.content-water {
|
||||
width: 100% !important;
|
||||
height: 95% !important;
|
||||
}
|
||||
/* .el-tabs__content{
|
||||
width: 100% !important;
|
||||
height: 95% !important;
|
||||
} */
|
||||
.el-tab-pane, .el-tabs {
|
||||
width: 100% !important;
|
||||
/* height: 100% !important; */
|
||||
}
|
||||
.el-tabs__item {
|
||||
font-weight: 800;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.date {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
height: 3%;
|
||||
}
|
||||
.flow-container {
|
||||
width: 100%;
|
||||
height: 87%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 10px;
|
||||
.right-div {
|
||||
width: 75%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.echart-content {
|
||||
width: 100%;
|
||||
height: 24%;
|
||||
}
|
||||
}
|
||||
.left-div {
|
||||
width: 22%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,342 @@
|
|||
<template>
|
||||
<div class="liquid-container">
|
||||
<div class="top-div">
|
||||
<div class="left">
|
||||
<h1>当前实时预报</h1>
|
||||
<div class="flex1 ">
|
||||
<div class="mr20">
|
||||
<img src="../assets/cloud.png" width="66px" alt="">
|
||||
</div>
|
||||
<div class="cur-temp mr20">
|
||||
14℃
|
||||
</div>
|
||||
<div class="ti">
|
||||
<p>多云</p>
|
||||
<p>体感温度:13℃</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="today">
|
||||
今天大部分地区天气晴朗。 最低气温9°
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<p>空气质量</p>
|
||||
<p>56</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>风速</p>
|
||||
<p>北风 1级</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>湿度</p>
|
||||
<p>67%</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>能见度</p>
|
||||
<p>4.4 公里</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>气压</p>
|
||||
<p>962 hPa</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>露点</p>
|
||||
<p>8°</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle-div">
|
||||
<h2>
|
||||
未来7天预报
|
||||
</h2>
|
||||
<div class="flex">
|
||||
<div class="one-day" v-for="item in weekDay" :key="item">
|
||||
<p>
|
||||
{{ item.day }}{{ item.date }}
|
||||
</p>
|
||||
<div class="flex ">
|
||||
<span class="weather-icon">
|
||||
<img src="../assets/cloud.png" alt="">
|
||||
</span>
|
||||
<span class="high-low">
|
||||
<p>{{ item.high }}</p>
|
||||
<p>{{ item.low }}</p>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-div">
|
||||
<div id="echartDiv" class="echartDiv100"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import myApi from "@/api/myApi.js";
|
||||
import BarEchart from "./BarEchart.vue";
|
||||
import Process from "./Process.vue";
|
||||
import Date from "@/components/Date.vue";
|
||||
export default {
|
||||
name: "Flow",
|
||||
components: {
|
||||
BarEchart,
|
||||
Process,
|
||||
Date
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
weekDay: [
|
||||
{
|
||||
day: '今晚',
|
||||
date: '27日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周六',
|
||||
date: '28日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周天',
|
||||
date: '29日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周一',
|
||||
date: '30日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周二',
|
||||
date: '31日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周三',
|
||||
date: '1日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}, {
|
||||
day: '周四',
|
||||
date: '2日',
|
||||
icon: '',
|
||||
high: '23°',
|
||||
low: '9°'
|
||||
}
|
||||
]
|
||||
});
|
||||
onMounted(async () => { getWeatherCharts() });
|
||||
const getWeatherCharts = () => {
|
||||
var dom = document.getElementById("echartDiv");
|
||||
var op = {
|
||||
title: {
|
||||
text: '未来一周天气图'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周天']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
formatter: '{value} °C'
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '最高点',
|
||||
type: 'line',
|
||||
data: [10, 11, 13, 11, 12, 12, 9],
|
||||
markPoint: {
|
||||
data: [
|
||||
{ type: 'max', name: 'Max' },
|
||||
{ type: 'min', name: 'Min' }
|
||||
]
|
||||
},
|
||||
markLine: {
|
||||
data: [{ type: 'average', name: 'Avg' }]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '最低点',
|
||||
type: 'line',
|
||||
data: [1, -2, 2, 5, 3, 2, 0],
|
||||
markPoint: {
|
||||
data: [{ name: '周最低', value: -2, xAxis: 1, yAxis: -1.5 }]
|
||||
},
|
||||
markLine: {
|
||||
data: [
|
||||
{ type: 'average', name: 'Avg' },
|
||||
[
|
||||
{
|
||||
symbol: 'none',
|
||||
x: '90%',
|
||||
yAxis: 'max'
|
||||
},
|
||||
{
|
||||
symbol: 'circle',
|
||||
label: {
|
||||
position: 'start',
|
||||
formatter: 'Max'
|
||||
},
|
||||
type: 'max',
|
||||
name: '最高点'
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
getEchart(dom, op)
|
||||
}
|
||||
const getEchart = (dom, op) => {
|
||||
if (dom) {
|
||||
var myChart = echarts.init(dom);
|
||||
var option = op;
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
getWeatherCharts,
|
||||
getEchart
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.liquid-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
|
||||
// border-color: #5C8AB3;
|
||||
.top-div {
|
||||
width: 100%;
|
||||
height: 35%;
|
||||
// border: 1px solid rgb(58, 152, 230);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left,
|
||||
.right {
|
||||
width: 49.8%;
|
||||
border: 1px solid rgb(58, 152, 230);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.flex1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
|
||||
.cur-temp {
|
||||
font-size: 56px;
|
||||
}
|
||||
|
||||
.ti {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.today {
|
||||
font-size: 18px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 15px;
|
||||
|
||||
li {
|
||||
padding: 10px;
|
||||
font-size: 22px;
|
||||
width: 16%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.middle-div {
|
||||
width: 100%;
|
||||
height: 25%;
|
||||
border: 1px solid rgb(58, 152, 230);
|
||||
font-size: 26px;
|
||||
padding: 20px;
|
||||
|
||||
h2 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.one-day {
|
||||
width: 13%;
|
||||
height: 120px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid rgb(58, 152, 230);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
line-height: 40px;
|
||||
|
||||
.weather-icon {
|
||||
display: inline-block;
|
||||
height: 46px;
|
||||
|
||||
img {
|
||||
margin-right: 20px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.high-low {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-div {
|
||||
width: 100%;
|
||||
height: 40%;
|
||||
border: 1px solid red;
|
||||
|
||||
.echartDiv100 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
}</style>
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<el-aside class="aside">
|
||||
<div class="head">
|
||||
<div>
|
||||
<!-- <img src="https://s.weituibao.com/1582958061265/mlogo.png" alt="logo" /> -->
|
||||
<span>智能监测</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line" />
|
||||
<el-menu
|
||||
:default-openeds="state.defaultOpen"
|
||||
background-color="#222832"
|
||||
text-color="#fff"
|
||||
:router="true"
|
||||
:default-active="currentPath"
|
||||
>
|
||||
<el-menu-item :index="list.index" v-for="(list, i) of state.menuList"
|
||||
><i class="el-icon-data-line" />{{list.name}}</el-menu-item
|
||||
>
|
||||
</el-menu>
|
||||
</el-aside>
|
||||
</template>
|
||||
<script>
|
||||
import { onMounted, reactive } from "vue";
|
||||
import { useStore } from 'vuex'
|
||||
export default {
|
||||
name: "Sidebar",
|
||||
props: {
|
||||
currentPath: String,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore()
|
||||
const state = reactive({
|
||||
defaultOpen: ["1",],
|
||||
menuList: [
|
||||
{
|
||||
id: 1,
|
||||
name: '首页',
|
||||
index: '/home'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '液位',
|
||||
index: '/level'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '流量',
|
||||
index: '/flow'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '水质',
|
||||
index: '/quality'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: '联动',
|
||||
index: '/link'
|
||||
}
|
||||
]
|
||||
});
|
||||
return {
|
||||
state,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.aside {
|
||||
width: 200px !important;
|
||||
background-color: #222832;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
-ms-overflow-style: none;
|
||||
overflow: -moz-scrollbars-none;
|
||||
}
|
||||
.aside::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 50px;
|
||||
div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
span {
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.line {
|
||||
border-top: 1px solid hsla(0, 0%, 100%, 0.05);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<div class="index">
|
||||
<div class="index-left">
|
||||
|
||||
</div>
|
||||
<div class="index-right">
|
||||
<div class="one-card">
|
||||
<h2>数据显示</h2>
|
||||
<div class="one-card-content">
|
||||
<div>
|
||||
<p>降雨量</p>
|
||||
<font>12</font>
|
||||
<font>mm/s</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>温度</p>
|
||||
<font>23</font>
|
||||
<font>℃</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>空气湿度</p>
|
||||
<font>22</font>
|
||||
<font>%</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>蒸发量</p>
|
||||
<font>9</font>
|
||||
<font>mm</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>土壤湿度</p>
|
||||
<font>56</font>
|
||||
<font>%</font>
|
||||
</div>
|
||||
<div>
|
||||
<p>风速</p>
|
||||
<font>3</font>
|
||||
<font>m/s</font>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.index {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.index-left {
|
||||
width: 74%;
|
||||
border: 1px solid rgb(179, 174, 174);
|
||||
}
|
||||
.index-right {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
.one-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
|
||||
h2 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.one-card-content {
|
||||
width: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
||||
>div {
|
||||
width: 40%;
|
||||
height: 30%;
|
||||
border: 1px solid rgb(197, 195, 195);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background:#d8e8f7;
|
||||
// align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
font-size: 26px;
|
||||
line-height: 45px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,244 @@
|
|||
html,
|
||||
body,
|
||||
#app {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
ul,
|
||||
p,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
ul,
|
||||
h5 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
ul,
|
||||
li,
|
||||
a,
|
||||
b,
|
||||
s {
|
||||
list-style: none;
|
||||
}
|
||||
.el-breadcrumb {
|
||||
margin-bottom: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-main {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
.el-card {
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
|
||||
}
|
||||
.el-table,
|
||||
.el-pagination {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.el-button--primary {
|
||||
border: 0 !important;
|
||||
}
|
||||
.mb {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.mt {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.ml {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.mt15 {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.mt5 {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.mr20
|
||||
{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.btns {
|
||||
text-align: center;
|
||||
}
|
||||
.el-drawer {
|
||||
width: 50% !important;
|
||||
padding: 20px 15px;
|
||||
}
|
||||
.title-form {
|
||||
height: 50px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
.el-date-editor {
|
||||
width: 100% !important;
|
||||
}
|
||||
.right-pop {
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
.el-upload--picture-card {
|
||||
width: 48px !important;
|
||||
height: 48px !important;
|
||||
line-height: 55px !important;
|
||||
}
|
||||
.el-upload-list--picture-card .el-upload-list__item {
|
||||
width: 48px !important;
|
||||
height: 48px !important;
|
||||
}
|
||||
.el-container {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.v-modal {
|
||||
z-index: 2000 !important;
|
||||
}
|
||||
.rt {
|
||||
float: right;
|
||||
}
|
||||
.menu-right-pop {
|
||||
.el-form {
|
||||
padding: 50px 20px !important;
|
||||
}
|
||||
}
|
||||
.no-label {
|
||||
.el-radio__label {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
.space-between {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-dialog__header {
|
||||
border-bottom: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
.el-upload-list__item {
|
||||
transition: none !important;
|
||||
}
|
||||
.border {
|
||||
border: 1px solid red;
|
||||
}
|
||||
.bottom-menu {
|
||||
/* width: 100%; */
|
||||
position: fixed;
|
||||
bottom: 50px;
|
||||
left: 50%;
|
||||
text-align: center;
|
||||
z-index: 10000;
|
||||
transform: translate(-50%);
|
||||
}
|
||||
.turn {
|
||||
background: rgba(15, 179, 251, 0.2);
|
||||
color: #00ffff !important;
|
||||
animation: turn 1s linear infinite;
|
||||
}
|
||||
@keyframes turn {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
25% {
|
||||
-webkit-transform: rotate(90deg);
|
||||
}
|
||||
50% {
|
||||
-webkit-transform: rotate(180deg);
|
||||
}
|
||||
75% {
|
||||
-webkit-transform: rotate(270deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
.bottom-menu span {
|
||||
display: inline-block;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
border-radius: 50%;
|
||||
margin-right: 100px;
|
||||
box-shadow: 0 0 15px 8px rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
.bottom-menu span img {
|
||||
vertical-align: -2px;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.xh-allow-up::after,
|
||||
.xh-allow-down::after {
|
||||
border: solid 2px #fff;
|
||||
border-bottom-width: 0;
|
||||
border-left-width: 0;
|
||||
content: " ";
|
||||
top: 22px;
|
||||
right: 20px;
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
}
|
||||
.xh-allow-down::after {
|
||||
transform: translateY(-50%) rotate(135deg);
|
||||
}
|
||||
.move-enter {
|
||||
max-height: 0;
|
||||
}
|
||||
.move-enter-active {
|
||||
max-height: 480px;
|
||||
-webkit-transition: max-height 0.5s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
transition: max-height 0.5s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
}
|
||||
.move-leave {
|
||||
max-height: 0;
|
||||
}
|
||||
.move-leave-active {
|
||||
max-height: 0;
|
||||
-webkit-transition: max-height 0.5s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
transition: max-height 0.5s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
}
|
||||
/*滚动条样式*/
|
||||
::-webkit-scrollbar {
|
||||
/*滚动条整体样式*/
|
||||
width: 4px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 4px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
/*滚动条里面小方块*/
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: inset 0 0 5px #00ffff;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
/*滚动条里面轨道*/
|
||||
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 0;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.content-div {
|
||||
width:100%;
|
||||
height:100%;
|
||||
.all-content {
|
||||
width:100%;
|
||||
height:100%;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
|
||||
import router from "./router/index";
|
||||
import store from "./store/index";
|
||||
import "./css/index.scss";
|
||||
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
|
||||
const app = createApp(App);
|
||||
app.use(ElementPlus, {
|
||||
locale: zhCn
|
||||
})
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
|
||||
app.use(ElementPlus);
|
||||
app.use(router);
|
||||
app.use(store);
|
||||
|
||||
app.mount("#app");
|
|
@ -0,0 +1,17 @@
|
|||
syntax = "proto3";
|
||||
option go_package = "data/";
|
||||
|
||||
message com_list{
|
||||
repeated com_info com = 1;
|
||||
}
|
||||
|
||||
message com_info{
|
||||
string name = 1;
|
||||
string path = 2;
|
||||
bool used = 3;
|
||||
int32 baud_rate = 4;
|
||||
int32 data_bits = 5;
|
||||
int32 stop_bits = 6;
|
||||
string parity = 7;
|
||||
int32 timeout = 8;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
syntax = "proto3";
|
||||
option go_package = "data/";
|
||||
|
||||
message info{
|
||||
Basicinfo basicinfo = 1;
|
||||
Hostinfo hostinfo = 2;
|
||||
Meminfo meminfo = 3;
|
||||
repeated Diskinfo diskinfo = 4;
|
||||
repeated Netinfo netinfo = 5;
|
||||
}
|
||||
|
||||
// 基本信息
|
||||
message Basicinfo{
|
||||
string model = 1; // 设备型号
|
||||
string sn = 2; // 设备SN
|
||||
string first_time = 3; // 初次激活时间
|
||||
}
|
||||
|
||||
// 主机信息
|
||||
message Hostinfo{
|
||||
int32 cpu = 1; // cpu核数
|
||||
string uptime = 2; // 开机时长
|
||||
string boottime = 3; // 开机时间
|
||||
}
|
||||
|
||||
// 内存信息
|
||||
message Meminfo{
|
||||
double total = 1; // 总大小
|
||||
double available = 2; // 可用
|
||||
double used = 3; // 已用
|
||||
double used_percent = 4; // 已用占比
|
||||
double free = 5; // 空闲
|
||||
double buffers = 6; // 缓冲区
|
||||
double cached = 7; // 缓存
|
||||
}
|
||||
|
||||
// 存储信息
|
||||
message Diskinfo{
|
||||
string name = 1; // 名称
|
||||
string path = 2; // 路径
|
||||
double total = 3; // 总大小
|
||||
double free = 4; // 空闲
|
||||
double used = 5; // 已用
|
||||
double used_percent = 6; // 已用占比
|
||||
}
|
||||
|
||||
// 网络信息
|
||||
message Netinfo{
|
||||
string name = 1; // 网卡名称
|
||||
uint64 bytesSent = 2; // number of bytes sent
|
||||
uint64 bytesRecv = 3; // number of bytes received
|
||||
uint64 packetsSent = 4; // number of packets sent
|
||||
uint64 packetsRecv = 5; // number of packets received
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
syntax = "proto3";
|
||||
option go_package = "data/";
|
||||
|
||||
message net_info{
|
||||
repeated ip_info ip = 1;
|
||||
dns_info dns = 2;
|
||||
}
|
||||
|
||||
message ip_info{
|
||||
string name = 1;
|
||||
string mode = 2;
|
||||
string ip = 3;
|
||||
string mk = 4;
|
||||
string gw = 5;
|
||||
}
|
||||
|
||||
message dns_info{
|
||||
string dns1 = 1;
|
||||
string dns2 = 2;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
syntax = "proto3";
|
||||
option go_package = "data/";
|
||||
|
||||
message response{
|
||||
uint32 code = 1;
|
||||
bytes data = 2;
|
||||
string msg = 3;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
syntax = "proto3";
|
||||
option go_package = "data/";
|
||||
|
||||
message user{
|
||||
string name = 1;
|
||||
string password = 2;
|
||||
fixed64 timestamp = 3;
|
||||
}
|
||||
|
||||
message token{
|
||||
string name = 1;
|
||||
string token = 2;
|
||||
fixed64 timestamp = 3;
|
||||
fixed64 expiration_time = 4;
|
||||
}
|
||||
|
||||
message passwd{
|
||||
string name = 1;
|
||||
string old_password = 2;
|
||||
string new_password = 3;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/home'
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
name: 'home',
|
||||
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue')
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue')
|
||||
},
|
||||
{
|
||||
path: '/page',
|
||||
name: 'page',
|
||||
component: () => import(/* webpackChunkName: "login" */ '../views/page.vue')
|
||||
},
|
||||
{
|
||||
path: '/level',
|
||||
name: 'level',
|
||||
component: () => import(/* webpackChunkName: "level" */ '../views/Level.vue')
|
||||
},
|
||||
{
|
||||
path: '/link',
|
||||
name: 'link',
|
||||
component: () => import(/* webpackChunkName: "link" */ '../views/Link.vue')
|
||||
},
|
||||
{
|
||||
path: '/weather',
|
||||
name: 'weather',
|
||||
component: () => import(/* webpackChunkName: "link" */ '../views/Weather.vue')
|
||||
},
|
||||
{
|
||||
path: '/green',
|
||||
name: 'green',
|
||||
component: () => import(/* webpackChunkName: "link" */ '../views/Green.vue')
|
||||
},
|
||||
{
|
||||
path: '/biology',
|
||||
name: 'biology',
|
||||
component: () => import(/* webpackChunkName: "link" */ '../views/Biology.vue')
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export default router
|
|
@ -0,0 +1,44 @@
|
|||
import { createStore } from "vuex"
|
||||
// 引入持久化
|
||||
import createPersistedState from 'vuex-persistedstate';
|
||||
|
||||
const store = createStore({
|
||||
state: {
|
||||
currentPath: '',
|
||||
userInfo: {},
|
||||
selectDate: 0,
|
||||
selectTab: 'old'
|
||||
},
|
||||
mutations: {
|
||||
updateCurrentPath(state, path) {
|
||||
state.currentPath = path
|
||||
},
|
||||
setUserInfo(state, data) {
|
||||
state.userInfo = data;
|
||||
},
|
||||
changeSelectDate(state, data) {
|
||||
state.selectDate = data;
|
||||
},
|
||||
changeSelectTab(state, data) {
|
||||
state.selectTab = data;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
updateCurrentPath({ commit }, path) {
|
||||
commit('updateCurrentPath', path)
|
||||
}
|
||||
},
|
||||
modules: {},
|
||||
getters: {
|
||||
getCurrentPath(state) {
|
||||
return state.currentPath;
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
createPersistedState({
|
||||
key: 'vuex',
|
||||
storage: window.localStorage
|
||||
})
|
||||
]
|
||||
})
|
||||
export default store
|
|
@ -0,0 +1,85 @@
|
|||
import axios from "axios";
|
||||
import md5 from "js-md5";
|
||||
import { Base64 } from "js-base64";
|
||||
import { ElMessage } from "element-plus";
|
||||
import router from "@/router/index";
|
||||
import { localGet } from "./index";
|
||||
import config from "~/config";
|
||||
import { token } from '../proto/data/pd'
|
||||
|
||||
axios.defaults.baseURL = config[import.meta.env.MODE].baseUrl;
|
||||
axios.defaults.withCredentials = true;
|
||||
// 请求头,headers 信息
|
||||
axios.defaults.headers["X-Requested-With"] = "XMLHttpRequest";
|
||||
|
||||
// axios.defaults.headers = getNeedToken();
|
||||
|
||||
|
||||
// function getNeedToken() {
|
||||
// console.log(333, localGet("token"));
|
||||
// const ret_token = localGet("token");
|
||||
// if (ret_token) {
|
||||
// ret_token.timestamp = new Date().getTime();
|
||||
// const tokenInfo = token.encode(ret_token).finish();
|
||||
// // 直接转换为string丢到header里,header的key为"cdcm"
|
||||
// const cdcm = tokenInfo.slice(0, tokenInfo.length).toString()
|
||||
// return { cdcm };
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// 请求拦截器,内部根据返回值,重新组装,统一管理。
|
||||
axios.interceptors.response.use(
|
||||
(res) => {
|
||||
return res.data;
|
||||
},
|
||||
(error) => {
|
||||
ElMessage.closeAll();
|
||||
ElMessage.error(error || "401 Unauthorized");
|
||||
router.push({ path: "/login" });
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
// post请求
|
||||
export function postJsonRequest(url, params) {
|
||||
return axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
data: params,
|
||||
// responseType: 'arraybuffer',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
// get请求
|
||||
export function getRequest(url, params) {
|
||||
return axios({
|
||||
method: "get",
|
||||
// responseType: 'arraybuffer',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
url: url,
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteRequest(url, params) {
|
||||
return axios({
|
||||
method: "delete",
|
||||
data: params,
|
||||
// responseType: 'arraybuffer',
|
||||
url: url,
|
||||
});
|
||||
}
|
||||
export const putRequest = (url, params) => {
|
||||
return axios({
|
||||
method: "put",
|
||||
data: params,
|
||||
// responseType: 'arraybuffer',
|
||||
url: url,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
};
|
|
@ -0,0 +1,2 @@
|
|||
import mitt from 'mitt'
|
||||
export default mitt()
|
|
@ -0,0 +1,38 @@
|
|||
export function localGet (key) {
|
||||
const value = window.localStorage.getItem(key)
|
||||
try {
|
||||
return JSON.parse(window.localStorage.getItem(key))
|
||||
} catch (error) {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
export function localSet (key, value) {
|
||||
window.localStorage.setItem(key, JSON.stringify(value))
|
||||
}
|
||||
|
||||
|
||||
export function localRemove (key) {
|
||||
window.localStorage.removeItem(key)
|
||||
}
|
||||
|
||||
// 判断内容是否含有表情字符,现有数据库不支持。
|
||||
export function hasEmoji (str = '') {
|
||||
const reg = /[^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n]/g;
|
||||
return str.match(reg) && str.match(reg).length
|
||||
}
|
||||
|
||||
// 单张图片上传
|
||||
export const uploadImgServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/upload/file'
|
||||
// 多张图片上传
|
||||
export const uploadImgsServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/upload/files'
|
||||
|
||||
export const pathMap = {
|
||||
login: '登录',
|
||||
home: '世博浦西区活水公园',
|
||||
level: '世博浦西区活水公园',
|
||||
page: '世博浦西区活水公园',
|
||||
weather: '世博浦西区活水公园',
|
||||
green: '世博浦西区活水公园',
|
||||
biology: '世博浦西区活水公园'
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="cl-hy">
|
||||
<div class="menus">
|
||||
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Bindex v-if="index === 0"/>
|
||||
<Report v-else-if="index === 1"/>
|
||||
<Analyse v-else-if="index === 2"/>
|
||||
<History v-else-if="index === 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import Bindex from "@/components/Bindex.vue";
|
||||
import Report from "@/components/Report.vue";
|
||||
import Analyse from "@/components/Analyse.vue";
|
||||
import History from "@/components/History.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'weather',
|
||||
components: {
|
||||
Menus,
|
||||
Bindex,
|
||||
Report,
|
||||
Analyse,
|
||||
History
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
index: 0,
|
||||
menus:[
|
||||
{
|
||||
name: '首页',
|
||||
},
|
||||
{
|
||||
name: '气象预报',
|
||||
},
|
||||
{
|
||||
name: '数据分析',
|
||||
},
|
||||
{
|
||||
name: '历史数据',
|
||||
}
|
||||
],
|
||||
})
|
||||
const changeIndex = (index) => {
|
||||
state.index = index;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cl-hy {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// border: 1px solid red;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.content {
|
||||
width: 96%;
|
||||
height:100%;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="cl-hy">
|
||||
<div class="menus">
|
||||
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Gindex v-if="index === 0"/>
|
||||
<Report v-else-if="index === 1"/>
|
||||
<Ganalyse v-else-if="index === 2"/>
|
||||
<History v-else-if="index === 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import Gindex from "@/components/Gindex.vue";
|
||||
import Report from "@/components/Report.vue";
|
||||
import Ganalyse from "@/components/Ganalyse.vue";
|
||||
import History from "@/components/History.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'weather',
|
||||
components: {
|
||||
Menus,
|
||||
Gindex,
|
||||
Report,
|
||||
Ganalyse,
|
||||
History
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
index: 0,
|
||||
menus:[
|
||||
{
|
||||
name: '首页',
|
||||
},
|
||||
{
|
||||
name: '检测指标',
|
||||
},
|
||||
{
|
||||
name: '数据分析',
|
||||
},
|
||||
{
|
||||
name: '历史数据',
|
||||
}
|
||||
],
|
||||
})
|
||||
const changeIndex = (index) => {
|
||||
state.index = index;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cl-hy {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// border: 1px solid red;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.content {
|
||||
width: 96%;
|
||||
height:100%;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,66 @@
|
|||
<template>
|
||||
<div class="info">
|
||||
<Menus :pactiveI="3"/>
|
||||
<div class="bottom">
|
||||
<LeftMenu @showContent="showContent" />
|
||||
<div class="search-content" v-if="activeindex === 0">
|
||||
044
|
||||
</div>
|
||||
<div class="search-content" v-if="activeindex === 1">
|
||||
1
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, toRefs } from "vue";
|
||||
import LeftMenu from "@/components/LeftMenu.vue";
|
||||
import Menus from "@/components/Menus.vue";
|
||||
export default {
|
||||
name: "history",
|
||||
components: {
|
||||
LeftMenu,
|
||||
Menus
|
||||
},
|
||||
setup() {
|
||||
const state = reactive({
|
||||
activeindex: 0
|
||||
});
|
||||
onMounted(() => {
|
||||
});
|
||||
const showContent = (i) => {
|
||||
console.log(i)
|
||||
state.activeindex = i;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
showContent
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info
|
||||
{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.bottom {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 92%;
|
||||
border: 1px solid red;
|
||||
}
|
||||
.search-content {
|
||||
width: calc(100% - 50px);
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<div class="home">
|
||||
<div class="left">
|
||||
<img src="../assets/bg.png" alt="" />
|
||||
<div class="hot" v-for="(item, i) in menus" :class="'hot' + i" :key="i" @click="go(item)">{{ i }}</div>
|
||||
</div>
|
||||
<ul class="menus">
|
||||
<li class="one-card" v-for="(item, i) in menus" :key="i" @click="go(item)">
|
||||
<div class="one-card-left" :class="'menu' + i" >{{ item.name }}</div>
|
||||
<div class="one-card-right" :class="'color' + i"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
export default {
|
||||
name: 'home',
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
menus: [{
|
||||
name: '处理&回用系统',
|
||||
url: 'page'
|
||||
}, {
|
||||
name: '屋顶绿化系统',
|
||||
url: 'green'
|
||||
}, {
|
||||
name: '生物滞留&净化系统',
|
||||
url: 'biology'
|
||||
}, {
|
||||
name: '透水铺装&入渗系统',
|
||||
url: 'level'
|
||||
}, {
|
||||
name: '调蓄系统&逆流监测系统',
|
||||
url: 'level'
|
||||
}, {
|
||||
name: '气象监测系统',
|
||||
url: 'weather'
|
||||
}]
|
||||
})
|
||||
const go = (item) => {
|
||||
router.push(item.url);
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
go
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.home {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// background: url(../assets/bg2.png) left top no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
// border: 1px solid rgb(180, 20, 180);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
// border: 1px solid red;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.hot {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border: 1px solid blue;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
}
|
||||
.hot0 {
|
||||
top: 0px;
|
||||
left: 597px;
|
||||
}
|
||||
|
||||
.hot1 {
|
||||
top: 133px;
|
||||
left: 1051px;
|
||||
}
|
||||
|
||||
.hot4 {
|
||||
top: 524px;
|
||||
left: 301px;
|
||||
}
|
||||
.hot5 {
|
||||
top: 172px;
|
||||
left: 300px;
|
||||
}
|
||||
.hot2 {
|
||||
top: 580px;
|
||||
left: 1061px;
|
||||
}
|
||||
|
||||
.hot3 {
|
||||
top: 757px;
|
||||
left: 647px;
|
||||
}
|
||||
|
||||
.menus {
|
||||
float: right;
|
||||
width: 20%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// border: 1px solid rgb(27, 187, 21);
|
||||
justify-content: space-between;
|
||||
.one-card {
|
||||
width: 100%;
|
||||
height: 140px;
|
||||
// border: 1px solid red;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0 0 8px #99ACB0 inset;
|
||||
cursor: pointer;
|
||||
.one-card-left {
|
||||
width: 80%;
|
||||
padding: 10px;
|
||||
font-weight: 800;
|
||||
|
||||
}
|
||||
.menu0 {
|
||||
background: url(../assets/p1.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.menu1 {
|
||||
background: url(../assets/p2.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.menu2 {
|
||||
background: url(../assets/p3.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.menu3 {
|
||||
background: url(../assets/p4.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.menu4 {
|
||||
background: url(../assets/p5.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.menu5 {
|
||||
background: url(../assets/p6.png) center 40px no-repeat;
|
||||
background-size: 50% auto;
|
||||
}
|
||||
.color0 {
|
||||
background: linear-gradient(to right, rgb(171, 187, 187), #7BB7B7);
|
||||
}
|
||||
.color1 {
|
||||
background: linear-gradient(to right, #e2eff1, #99ACB0);
|
||||
}
|
||||
.color2 {
|
||||
background: linear-gradient(to right, #b8e5f5, #6ED2F6);
|
||||
}
|
||||
.color3 {
|
||||
background: linear-gradient(to right, #bfdad9, #A3D8D6);
|
||||
}
|
||||
.color4 {
|
||||
background: linear-gradient(to right, #c3d4cb, #81CFA3);
|
||||
}
|
||||
.color5 {
|
||||
background: linear-gradient(to right, #c3d4cb, #81CFA3);
|
||||
}
|
||||
.one-card-right {
|
||||
width: 20%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="cl-hy">
|
||||
<div class="menus">
|
||||
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Hindex v-if="index === 0"/>
|
||||
<Liquid v-else-if="index === 1"/>
|
||||
<Flow v-else-if="index === 2"/>
|
||||
<Quality v-else-if="index === 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import Hindex from "@/components/Hindex.vue";
|
||||
import Liquid from "@/components/Liquid.vue";
|
||||
import Quality from "@/components/Quality.vue";
|
||||
import Flow from "@/components/Flow.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'cl-hy',
|
||||
components: {
|
||||
Menus,
|
||||
Hindex,
|
||||
Quality,
|
||||
Flow,
|
||||
Liquid
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
index: 0,
|
||||
menus:[
|
||||
{
|
||||
name: '首页',
|
||||
},
|
||||
{
|
||||
name: '液位',
|
||||
},
|
||||
{
|
||||
name: '流量',
|
||||
},
|
||||
{
|
||||
name: '水质',
|
||||
}
|
||||
],
|
||||
})
|
||||
const changeIndex = (index) => {
|
||||
state.index = index;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cl-hy {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// border: 1px solid red;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.content {
|
||||
width: 96%;
|
||||
height:100%;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>联动</div>
|
||||
</template>
|
|
@ -0,0 +1,131 @@
|
|||
<template>
|
||||
<div class="login-body">
|
||||
<div class="login-container">
|
||||
<div class="head">
|
||||
<!-- <img class="logo" src="https://s.weituibao.com/1582958061265/mlogo.png" /> -->
|
||||
<div class="name">
|
||||
<div class="title">海绵城市智能监测井</div>
|
||||
<!-- <div class="tips">Vue3.0 后台管理系统</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<el-form label-position="top" :rules="rules" :model="ruleForm" ref="loginForm" class="login-form">
|
||||
<el-form-item label="账号" prop="username">
|
||||
<el-input type="text" v-model.trim="ruleForm.username" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input type="password" v-model.trim="ruleForm.password" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <div style="color: #333">登录表示您已同意<a>《服务条款》</a></div> -->
|
||||
<el-button style="width: 100%" type="primary" @click="submitForm">立即登录</el-button>
|
||||
<!-- <el-checkbox v-model="checked" @change="!checked">下次自动登录</el-checkbox> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import md5 from 'js-md5';
|
||||
import { reactive, ref, toRefs } from 'vue'
|
||||
import { localSet } from '@/utils'
|
||||
import myApi from "@/api/myApi.js";
|
||||
export default {
|
||||
name: 'Login',
|
||||
setup() {
|
||||
const loginForm = ref(null)
|
||||
const state = reactive({
|
||||
ruleForm: {
|
||||
username: '',
|
||||
password: ''
|
||||
},
|
||||
checked: true,
|
||||
rules: {
|
||||
username: [
|
||||
{ required: 'true', message: '账户不能为空', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: 'true', message: '密码不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
})
|
||||
const submitForm = async () => {
|
||||
loginForm.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
const param = {
|
||||
userName: state.ruleForm.username || '',
|
||||
passwordMd5: md5(state.ruleForm.password)
|
||||
}
|
||||
// const res = await myApi.login(param);
|
||||
localSet('token', "81527a9e9e2594b58babdd7f623f112f")
|
||||
window.location.href = '/';
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
const resetForm = () => {
|
||||
loginForm.value.resetFields();
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
loginForm,
|
||||
submitForm,
|
||||
resetForm
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
/* background-color: #fff; */
|
||||
/* background-image: linear-gradient(25deg, #077f7c, #3aa693, #5ecfaa, #7ffac2); */
|
||||
background: url('../assets/bg1.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.login-container {
|
||||
width: 420px;
|
||||
height: 400px;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 21px 41px 0px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 40px 0 20px 0;
|
||||
}
|
||||
.head img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.head .title {
|
||||
font-size: 28px;
|
||||
color: #1BAEAE;
|
||||
font-weight: bold;
|
||||
}
|
||||
.head .tips {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
.login-form {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-form--label-top .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
.login-form .el-form-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="cl-hy">
|
||||
<div class="menus">
|
||||
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Windex v-if="index === 0"/>
|
||||
<Report v-else-if="index === 1"/>
|
||||
<Analyse v-else-if="index === 2"/>
|
||||
<History v-else-if="index === 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import Windex from "@/components/Windex.vue";
|
||||
import Report from "@/components/Report.vue";
|
||||
import Analyse from "@/components/Analyse.vue";
|
||||
import History from "@/components/History.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'weather',
|
||||
components: {
|
||||
Menus,
|
||||
Windex,
|
||||
Report,
|
||||
Analyse,
|
||||
History
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
index: 0,
|
||||
menus:[
|
||||
{
|
||||
name: '首页',
|
||||
},
|
||||
{
|
||||
name: '气象预报',
|
||||
},
|
||||
{
|
||||
name: '数据分析',
|
||||
},
|
||||
{
|
||||
name: '历史数据',
|
||||
}
|
||||
],
|
||||
})
|
||||
const changeIndex = (index) => {
|
||||
state.index = index;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cl-hy {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// border: 1px solid red;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.content {
|
||||
width: 96%;
|
||||
height:100%;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,82 @@
|
|||
<template>
|
||||
<div class="cl-hy">
|
||||
<div class="menus">
|
||||
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
|
||||
</div>
|
||||
<div class="content">
|
||||
<Index v-if="index === 0"/>
|
||||
<Liquid v-else-if="index === 1"/>
|
||||
<Flow v-else-if="index === 2"/>
|
||||
<Quality v-else-if="index === 3"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Menus from "@/components/Menus.vue";
|
||||
import Index from "@/components/Index.vue";
|
||||
import Liquid from "@/components/Liquid.vue";
|
||||
import Quality from "@/components/Quality.vue";
|
||||
import Flow from "@/components/Flow.vue";
|
||||
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
|
||||
export default {
|
||||
name: 'cl-hy',
|
||||
components: {
|
||||
Menus,
|
||||
Index,
|
||||
Quality,
|
||||
Flow,
|
||||
Liquid
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
index: 0,
|
||||
menus:[
|
||||
{
|
||||
name: '首页',
|
||||
},
|
||||
{
|
||||
name: '液位',
|
||||
},
|
||||
{
|
||||
name: '流量',
|
||||
},
|
||||
{
|
||||
name: '水质',
|
||||
}
|
||||
],
|
||||
})
|
||||
const changeIndex = (index) => {
|
||||
state.index = index;
|
||||
}
|
||||
return {
|
||||
...toRefs(state),
|
||||
changeIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.mt10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cl-hy {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// border: 1px solid red;
|
||||
.menus {
|
||||
width: 4%;
|
||||
height: 700px;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
.content {
|
||||
width: 96%;
|
||||
height:100%;
|
||||
// border: 1px solid red;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,35 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vitePluginImport from 'vite-plugin-babel-import';
|
||||
import path from 'path'
|
||||
|
||||
const baseUrl = {
|
||||
development: './',
|
||||
beta: './',
|
||||
release: './'
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default ({ mode }) => defineConfig({
|
||||
plugins: [
|
||||
vue()
|
||||
],
|
||||
base: baseUrl[mode],
|
||||
resolve: {
|
||||
alias: {
|
||||
'~': path.resolve(__dirname, './'),
|
||||
'@': path.resolve(__dirname, 'src')
|
||||
}
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
// target: 'http://192.168.1.123:8866',
|
||||
// target: 'http://10.10.14.123',
|
||||
target: 'https://cdcmapi.shikicc.com',
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace(/^\/api/, '/api')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,6 @@
|
|||
const server = require('pushstate-server')
|
||||
|
||||
server.start({
|
||||
port: 5018,
|
||||
directory: './dist'
|
||||
})
|