# Conflicts: # .env.development # src/settings.js # src/views/component/form.vue # vue.config.jsmaster
@ -1,7 +1,12 @@
|
||||
# just a flag
|
||||
ENV = 'development'
|
||||
ENV='development'
|
||||
|
||||
# base api
|
||||
<<<<<<< HEAD
|
||||
VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
|
||||
VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
|
||||
|
||||
=======
|
||||
VUE_APP_BASE_API=http://starter.ali251.langye.net
|
||||
VUE_APP_UPLOAD_API=http://starter.ali251.langye.net/api/admin/upload-file
|
||||
>>>>>>> 20bcb15194373a4db880ebe3edd27d2d277d5c15
|
||||
|
||||
@ -0,0 +1 @@
|
||||
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;var v=function(){return d.tinymce};p.fn.tinymce=function(o){var e,t,i,l=this,r="";if(!l.length)return l;if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");var n=function(){var a=[],c=0;u||(m(),u=!0),l.each(function(e,t){var n,i=t.id,r=o.oninit;i||(t.id=i=v().DOM.uniqueId()),v().get(i)||(n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),t.apply(e||v(),a))}))}),p.each(a,function(e,t){t.render()})};if(d.tinymce||c||!(e=o.script_url))1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")),-1!=e.indexOf(".min")&&(r=".min"),d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))};n("langs/"+i+".js"),n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.readyState)||(v().dom.Event.domLoaded=1,c=2,o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l},p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}});var m=function(){var r=function(e){"remove"===e&&this.each(function(e,t){var n=l(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})},o=function(i){var e,t=this;if(null!=i)r.call(t),t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()},l=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},u=function(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))},s={};p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!u(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=l(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr,p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();
|
||||
@ -0,0 +1,3 @@
|
||||
This is where language files should be placed.
|
||||
|
||||
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
|
||||
@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
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 this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
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
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser 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 Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "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
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY 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
|
||||
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey 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 library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,75 @@
|
||||
tinymce.PluginManager.add('axupimgs', function(editor, url) {
|
||||
var pluginName='图片上传';
|
||||
window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置
|
||||
var baseURL = `${process.env.VUE_APP_BASE_API}`
|
||||
// var baseURL = 'http://localhost:8000'
|
||||
var iframe1 =baseURL+'/admin/tinymce/plugins/axupimgs/upfiles.html';
|
||||
axupimgs.images_upload_handler = editor.getParam('images_upload_handler', undefined, 'function');
|
||||
axupimgs.images_upload_base_path = editor.getParam('images_upload_base_path', '', 'string');
|
||||
axupimgs.axupimgs_filetype = editor.getParam('axupimgs_filetype', '.png,.gif,.jpg,.jpeg', 'string');
|
||||
axupimgs.res=[];
|
||||
var openDialog = function() {
|
||||
return editor.windowManager.openUrl({
|
||||
title: pluginName,
|
||||
size: 'large',
|
||||
url:iframe1,
|
||||
buttons: [
|
||||
{
|
||||
type: 'cancel',
|
||||
text: 'Close'
|
||||
},
|
||||
{
|
||||
type: 'custom',
|
||||
text: 'Save',
|
||||
name: 'save',
|
||||
primary: true
|
||||
},
|
||||
],
|
||||
onAction: function (api, details) {
|
||||
switch (details.name) {
|
||||
case 'save':
|
||||
var html = '';
|
||||
var imgs = axupimgs.res;
|
||||
var len = imgs.length;
|
||||
for(let i=0;i<len;i++){
|
||||
if( imgs[i].url ){
|
||||
html += '<img src="'+imgs[i].url+'" />';
|
||||
}
|
||||
}
|
||||
editor.insertContent(html);
|
||||
axupimgs.res=[];
|
||||
api.close();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs','<svg viewBox="0 0 1280 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M1126.2,779.8V87.6c0-24-22.6-86.9-83.5-86.9H83.5C14.7,0.7,0,63.7,0,87.7v692c0,36.2,29.2,89.7,83.5,89.7l959.3-1.3c51.7,0,83.5-42.5,83.5-88.3zm-1044,4V86.3h961.6V783.7H82.2v0.1z" fill="#53565A"/><path d="M603,461.6L521.1,366.3,313,629.8,227.2,546.8,102.4,716.8H972.8v-170L768.2,235.2,603.1,461.6zM284.6,358.4a105.4,105.4,0,0,0,73.5-30c19.5-19.1,30.3-45,30.2-71.8,0-56.8-45.9-103-102.4-103-56.6,0-102.4,46.1-102.4,103C183.4,313.5,228,358.4,284.6,358.4z" fill="#9598A0"/><path d="M1197.7,153.6l-0.3,669.3s13.5,113.9-67.4,113.9H153.6c0,24.1,23.9,87.2,83.5,87.2h959.3c58.3,0,83.6-49.5,83.6-89.9V240.8c-0.1-41.8-44.9-87.2-82.3-87.2z" fill="#53565A"/></svg>');
|
||||
|
||||
editor.ui.registry.addButton('axupimgs', {
|
||||
icon: 'axupimgs',
|
||||
tooltip: pluginName,
|
||||
onAction: function() {
|
||||
openDialog();
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('axupimgs', {
|
||||
icon: 'axupimgs',
|
||||
text: '图片批量上传...',
|
||||
onAction: function() {
|
||||
openDialog();
|
||||
}
|
||||
});
|
||||
return {
|
||||
getMetadata: function() {
|
||||
return {
|
||||
name: pluginName,
|
||||
url: "http://tinymce.ax-z.cn/more-plugins/axupimgs.php",
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1,75 @@
|
||||
tinymce.PluginManager.add('axupimgs', function(editor, url) {
|
||||
var pluginName='Ax多图片上传';
|
||||
window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置
|
||||
|
||||
var baseURL=tinymce.baseURL;
|
||||
var iframe1 = baseURL+'/plugins/axupimgs/upfiles.html';
|
||||
axupimgs.images_upload_handler = editor.getParam('images_upload_handler', undefined, 'function');
|
||||
axupimgs.images_upload_base_path = editor.getParam('images_upload_base_path', '', 'string');
|
||||
axupimgs.axupimgs_filetype = editor.getParam('axupimgs_filetype', '.png,.gif,.jpg,.jpeg', 'string');
|
||||
axupimgs.res=[];
|
||||
var openDialog = function() {
|
||||
return editor.windowManager.openUrl({
|
||||
title: pluginName,
|
||||
size: 'large',
|
||||
url:iframe1,
|
||||
buttons: [
|
||||
{
|
||||
type: 'cancel',
|
||||
text: 'Close'
|
||||
},
|
||||
{
|
||||
type: 'custom',
|
||||
text: 'Save',
|
||||
name: 'save',
|
||||
primary: true
|
||||
},
|
||||
],
|
||||
onAction: function (api, details) {
|
||||
switch (details.name) {
|
||||
case 'save':
|
||||
var html = '';
|
||||
var imgs = axupimgs.res;
|
||||
var len = imgs.length;
|
||||
for(let i=0;i<len;i++){
|
||||
if( imgs[i].url ){
|
||||
html += '<img src="'+imgs[i].url+'" />';
|
||||
}
|
||||
}
|
||||
editor.insertContent(html);
|
||||
axupimgs.res=[];
|
||||
api.close();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs','<svg viewBox="0 0 1280 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M1126.2,779.8V87.6c0-24-22.6-86.9-83.5-86.9H83.5C14.7,0.7,0,63.7,0,87.7v692c0,36.2,29.2,89.7,83.5,89.7l959.3-1.3c51.7,0,83.5-42.5,83.5-88.3zm-1044,4V86.3h961.6V783.7H82.2v0.1z" fill="#53565A"/><path d="M603,461.6L521.1,366.3,313,629.8,227.2,546.8,102.4,716.8H972.8v-170L768.2,235.2,603.1,461.6zM284.6,358.4a105.4,105.4,0,0,0,73.5-30c19.5-19.1,30.3-45,30.2-71.8,0-56.8-45.9-103-102.4-103-56.6,0-102.4,46.1-102.4,103C183.4,313.5,228,358.4,284.6,358.4z" fill="#9598A0"/><path d="M1197.7,153.6l-0.3,669.3s13.5,113.9-67.4,113.9H153.6c0,24.1,23.9,87.2,83.5,87.2h959.3c58.3,0,83.6-49.5,83.6-89.9V240.8c-0.1-41.8-44.9-87.2-82.3-87.2z" fill="#53565A"/></svg>');
|
||||
|
||||
editor.ui.registry.addButton('axupimgs', {
|
||||
icon: 'axupimgs',
|
||||
tooltip: pluginName,
|
||||
onAction: function() {
|
||||
openDialog();
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('axupimgs', {
|
||||
icon: 'axupimgs',
|
||||
text: '图片批量上传...',
|
||||
onAction: function() {
|
||||
openDialog();
|
||||
}
|
||||
});
|
||||
return {
|
||||
getMetadata: function() {
|
||||
return {
|
||||
name: pluginName,
|
||||
url: "http://tinymce.ax-z.cn/more-plugins/axupimgs.php",
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -0,0 +1,203 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>axupimgs</title>
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<style>
|
||||
html,body{height:100%;margin:0;padding:0;background:#fff;}
|
||||
ul{margin:0;padding:0;list-style:none;}
|
||||
#wrap{padding:10px;}
|
||||
#topbar{padding:10px 0;border-bottom:1px solid #ccc;text-align:right;}
|
||||
#topbar button {margin:0;margin-left:5px;outline:none;padding: 4px 16px;box-sizing: border-box;
|
||||
display:inline-block;border:none;border-radius:3px;text-align:center;cursor:pointer;
|
||||
font-size:14px;line-height:1.5;background-color:#f0f0f0;color:#223;
|
||||
}
|
||||
#topbar button.primary{background-color:#3d97d4;color:#fff;}
|
||||
#topbar button:hover{background-color:#207ab7;color:#fff;}
|
||||
#topbar button.removeall{float:left}
|
||||
#file_list {display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));padding-top:10px;}
|
||||
#file_list:empty:after{content:'可以直接拖拽文件到这里';color:#777;font-size:0.8em;}
|
||||
#file_list li{position:relative;display:block;vertical-align:top;padding:5px 5px;border-radius:5px;}
|
||||
#file_list li.up-over {}
|
||||
#file_list li.up-now {}
|
||||
#file_list li.up-now:after{content:'';position:absolute;top:0;left:0;display:block;width:100%;height:100%;background:rgba(255,255,255,0.8) url(loading.gif) center center no-repeat;border-radius:5px;z-index:999;}
|
||||
#file_list li:hover{background-color:#ddd;}
|
||||
#file_list li .picbox {display:flex;flex:0 0 auto;justify-content:center;overflow:hidden;position:relative;width:100%;padding-top:100%;align-items:center;}
|
||||
#file_list li .picbox img {display:block;max-width:100%;max-height:100%;position:absolute;
|
||||
top:50%;left:50%;transform:translateX(-50%) translateY(-50%);}
|
||||
#file_list li.up-over .picbox:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M512%200C229.376%200%200%20229.376%200%20512s229.376%20512%20512%20512%20512-229.376%20512-512S794.624%200%20512%200z%22%20fill%3D%22%234AC711%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M855.552%20394.752l-358.4%20358.4a50.9952%2050.9952%200%200%201-72.192%200l-204.8-204.8c-18.944-19.968-18.944-51.2%200-71.168a50.5344%2050.5344%200%200%201%2072.192-1.024L460.8%20644.608l322.048-322.048c19.968-18.944%2051.2-18.944%2071.168%200%2020.48%2019.456%2020.992%2051.712%201.536%2072.192z%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');position:absolute;bottom:2px;right:2px;z-index:9;}
|
||||
#file_list li .tools {display:none;position:absolute;bottom:5px;right:5px;z-index:99;}
|
||||
#file_list li:hover .tools {display:block;}
|
||||
#file_list li .tools .remove{cursor:pointer;}
|
||||
#file_list li .tools .remove:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20width=%2224%22%20height=%2224%22%20viewBox=%220%200%2024%2024%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d=%22M17%206h3a1%201%200%200%201%200%202h-1v11a3%203%200%200%201-3%203H8a3%203%200%200%201-3-3V8H4a1%201%200%201%201%200-2h3V5a3%203%200%200%201%203-3h4a3%203%200%200%201%203%203v1zm-2%200V5a1%201%200%200%200-1-1h-4a1%201%200%200%200-1%201v1h6zm2%202H7v11a1%201%200%200%200%201%201h8a1%201%200%200%200%201-1V8zm-8%203a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6zm4%200a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6z%22%3E%3C/path%3E%3C/svg%3E');}
|
||||
#file_list li .namebox {font-size:14px;line-height:20px;max-height:40px;overflow:hidden;padding:5px 10px;text-align:center;display:flex;justify-content:center;align-items:flex-start;}
|
||||
#file_list li .namebox span{word-break:break-all;vertical-align:top;}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div id="topbar"><button class="addfile primary">+ 添加文件</button><button class="upall primary">全部上传</button><button class="removeall">清空列表</button></div>
|
||||
<ul id="file_list"></ul>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var editor=parent.tinymce.activeEditor;
|
||||
var axupimgs=parent.axupimgs;
|
||||
axupimgs.res = []; //存放本地文件的数组
|
||||
var blobInfo = {file:null}
|
||||
blobInfo.blob = function(){return this.file;}
|
||||
var upload_handler = axupimgs.images_upload_handler;
|
||||
var upload_base_path = axupimgs.images_upload_base_path;
|
||||
|
||||
//为列表添加排序
|
||||
function reSort(){
|
||||
document.querySelectorAll('#file_list li').forEach((el,i)=>{
|
||||
el.setAttribute('data-num',i);
|
||||
});
|
||||
}
|
||||
|
||||
function addList(files){
|
||||
var files_sum = files.length;
|
||||
var vDom = document.createDocumentFragment();
|
||||
for(let i=0;i<files_sum;i++){
|
||||
let file = files[i];
|
||||
let blobUrl = window.URL.createObjectURL(file)
|
||||
axupimgs.res.push({file:file,blobUrl:blobUrl,url:''});
|
||||
let li = document.createElement('li');
|
||||
li.setAttribute('class','up-no');
|
||||
li.setAttribute('data-time',file.lastModified);
|
||||
li.innerHTML='<div class="picbox"><img src="'+blobUrl+'"></div><div class="namebox"><span>'+file.name+'</span></div><div class="tools"><a class="remove"></a></div>';
|
||||
vDom.appendChild(li);
|
||||
}
|
||||
document.querySelector('#file_list').appendChild(vDom);
|
||||
//reSort();
|
||||
}
|
||||
|
||||
|
||||
//清空列表
|
||||
document.querySelector('#topbar .removeall').addEventListener('click',()=>{
|
||||
axupimgs.res=[]
|
||||
document.querySelectorAll('#file_list li').forEach((el,i)=>{
|
||||
el.parentNode.removeChild(el)
|
||||
});
|
||||
});
|
||||
//拖拽添加
|
||||
document.addEventListener('dragover', (e)=>{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = 'copy';
|
||||
});
|
||||
document.addEventListener('drop', (e)=>{
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if(!e.dataTransfer.files){return false;}
|
||||
var dropfiles = e.dataTransfer.files;
|
||||
if(!(dropfiles.length>0)){return false;}
|
||||
var exts=axupimgs.axupimgs_filetype.replace(/(\s)+/g,'').toLowerCase().split(',');
|
||||
var files=[];
|
||||
for( let file of dropfiles ){
|
||||
ext = file.name.split('.');
|
||||
ext = '.'+ext[ext.length-1];
|
||||
for(let s of exts){
|
||||
if(s==ext){
|
||||
files.push(file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(files.length>0){ addList(files) }
|
||||
});
|
||||
|
||||
//添加文件
|
||||
document.querySelector('#topbar .addfile').addEventListener('click',()=>{
|
||||
var input = document.createElement('input');
|
||||
input.setAttribute('type', 'file');
|
||||
input.setAttribute('multiple', 'multiple');
|
||||
input.setAttribute('accept', axupimgs.axupimgs_filetype);
|
||||
input.click();
|
||||
input.onchange = function() {
|
||||
var files = this.files;
|
||||
addList(files);
|
||||
}
|
||||
});
|
||||
|
||||
var file_i = 0;
|
||||
|
||||
function upAllFiles(n){
|
||||
var len = axupimgs.res.length;
|
||||
file_i = n;
|
||||
if(len == n){
|
||||
file_i=0;
|
||||
document.querySelector('#topbar .upall').innerText='全部上传';
|
||||
return true;
|
||||
}
|
||||
if( axupimgs.res[n].url!='' ){
|
||||
n++;
|
||||
upAllFiles(n)
|
||||
}else{
|
||||
blobInfo.file=axupimgs.res[n].file;
|
||||
upload_handler(blobInfo,function(url){
|
||||
if(upload_base_path){
|
||||
|
||||
if(upload_base_path.slice(-1)=='/' && url.substr(0,1)=='/' ){
|
||||
url = upload_base_path + url.slice(1);
|
||||
}else if(upload_base_path.slice(-1)!='/' && url.substr(0,1)!='/' ){
|
||||
url = upload_base_path + '/' + url;
|
||||
}else{
|
||||
url = upload_base_path + url;
|
||||
}
|
||||
}
|
||||
axupimgs.res[file_i].url = url;
|
||||
filename = url.split('/').pop();
|
||||
var li = document.querySelectorAll('#file_list li')[file_i];
|
||||
li.setAttribute('class','up-over');
|
||||
li.querySelector('.namebox span').innerText = filename;
|
||||
n++
|
||||
upAllFiles(n);
|
||||
},function(err){
|
||||
document.querySelector('#topbar .upall').innerText='全部上传';
|
||||
document.querySelectorAll('#file_list li.up-now').forEach((el,i)=>{
|
||||
el.setAttribute('class','up-no');
|
||||
});
|
||||
alert(err);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
document.querySelector('#topbar .upall').addEventListener('click',(e)=>{
|
||||
if(e.target.innerText!='全部上传'){return false;}
|
||||
if(axupimgs.res.length>0){
|
||||
document.querySelectorAll('#file_list li.up-no').forEach((el,i)=>{
|
||||
el.classList ? el.classList.add('up-now') : el.className+=' up-now';
|
||||
});
|
||||
e.target.innerText='上传中...';
|
||||
upAllFiles(0);
|
||||
}
|
||||
});
|
||||
|
||||
var observ_flist = new MutationObserver( (muList,observe)=>{
|
||||
if(muList[0].addedNodes.length>0){
|
||||
muList[0].addedNodes.forEach((el)=>{
|
||||
el.querySelector('.remove').addEventListener('click',(e)=>{
|
||||
var li = e.target.parentNode.parentNode;
|
||||
var n = li.getAttribute('data-num');
|
||||
var el = document.querySelectorAll('#file_list li')[n];
|
||||
el.parentNode.removeChild(el);
|
||||
axupimgs.res.splice(n,1);
|
||||
});
|
||||
});
|
||||
}
|
||||
reSort();
|
||||
});
|
||||
observ_flist.observe(document.querySelector('#file_list'),{childList:true});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1 @@
|
||||
.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,.mce-content-body.mce-content-readonly *[contentEditable=true]:hover{outline:none}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.mce-content-body table{-webkit-nbsp-mode:normal}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2}.mce-content-body{line-height:1.3}
|
||||
@ -0,0 +1 @@
|
||||
body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,.mce-content-body.mce-content-readonly *[contentEditable=true]:hover{outline:none}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.mce-content-body table{-webkit-nbsp-mode:normal}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2}
|
||||
@ -0,0 +1 @@
|
||||
.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{position:absolute;display:inline-block;background-color:green;opacity:.5}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 53 B |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 152 B |
|
After Width: | Height: | Size: 43 B |
@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function uploads(data) {
|
||||
return request({
|
||||
url: '/api/admin/upload-file',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
import {getToken} from "@/utils/auth";
|
||||
|
||||
export const addPropsMap = new Map([
|
||||
["text", {
|
||||
clearable: true
|
||||
}],
|
||||
["richtext",{}],
|
||||
['radio',{
|
||||
|
||||
}],
|
||||
["checkbox", {
|
||||
|
||||
}],
|
||||
["date", {
|
||||
clearable: true,
|
||||
valueFormat: 'yyyy-MM-dd'
|
||||
}],
|
||||
["datetime", {
|
||||
type: 'datetime',
|
||||
clearable: true,
|
||||
valueFormat: 'yyyy-MM-dd mm:hh:ss',
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '今天',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
}
|
||||
}, {
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}, {
|
||||
text: '一周前',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}]
|
||||
}
|
||||
}],
|
||||
["file",{
|
||||
action: process.env.VUE_APP_UPLOAD_API,
|
||||
headers: {
|
||||
Authorization: `Bearer ${getToken()}`,
|
||||
},
|
||||
autoUpload: false,
|
||||
multiple: false,
|
||||
limit: 1
|
||||
}],
|
||||
["files",{
|
||||
action: process.env.VUE_APP_UPLOAD_API,
|
||||
headers: {
|
||||
Authorization: `Bearer ${getToken()}`,
|
||||
},
|
||||
autoUpload: false,
|
||||
multiple: true
|
||||
}],
|
||||
["textarea", {
|
||||
clearable: true,
|
||||
type: 'textarea',
|
||||
autosize: {
|
||||
'minRows': 2
|
||||
}
|
||||
}],
|
||||
|
||||
|
||||
["map", "el-input"],
|
||||
])
|
||||
@ -1,108 +1,14 @@
|
||||
export default [
|
||||
{
|
||||
label: "element-ui",
|
||||
options: [
|
||||
{
|
||||
value: "el-radio",
|
||||
label: "单选框",
|
||||
},
|
||||
{
|
||||
value: "el-checkbox",
|
||||
label: "多选框",
|
||||
},
|
||||
{
|
||||
value: "text",
|
||||
label: "输入框",
|
||||
},
|
||||
{
|
||||
value: "el-input-number",
|
||||
label: "计数器",
|
||||
},
|
||||
{
|
||||
value: "el-select",
|
||||
label: "选择器"
|
||||
},
|
||||
{
|
||||
value: "el-switch",
|
||||
label: "开关",
|
||||
},
|
||||
{
|
||||
value: "el-slider",
|
||||
label: "滑块",
|
||||
},
|
||||
{
|
||||
value: "el-time-select",
|
||||
label: "时间选择器",
|
||||
},
|
||||
{
|
||||
value: "el-date-picker",
|
||||
label: "日期选择器",
|
||||
},
|
||||
{
|
||||
value: "el-upload",
|
||||
label: "上传",
|
||||
},
|
||||
{
|
||||
value: "el-rate",
|
||||
label: "评分",
|
||||
},
|
||||
{
|
||||
value: "el-color-picker",
|
||||
label: "颜色选择器",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "iview",
|
||||
options: [
|
||||
{
|
||||
value: "Input",
|
||||
label: "输入框",
|
||||
},
|
||||
{
|
||||
value: "Radio",
|
||||
label: "单选框",
|
||||
},
|
||||
{
|
||||
value: "Checkbox",
|
||||
label: "多选框",
|
||||
},
|
||||
{
|
||||
value: "Switch",
|
||||
label: "开关",
|
||||
},
|
||||
{
|
||||
value: "select",
|
||||
label: "选择器",
|
||||
},
|
||||
{
|
||||
value: "Slider",
|
||||
label: "滑块",
|
||||
},
|
||||
{
|
||||
value: "DatePicker",
|
||||
label: "日期选择器",
|
||||
},
|
||||
{
|
||||
value: "TimeSelect",
|
||||
label: "时间选择器",
|
||||
},
|
||||
{
|
||||
value: "InputNumber",
|
||||
label: "计数器",
|
||||
},
|
||||
{
|
||||
value: "Upload",
|
||||
label: "上传",
|
||||
},
|
||||
{
|
||||
value: "Rate",
|
||||
label: "评分",
|
||||
},
|
||||
{
|
||||
value: "ColorPicker",
|
||||
label: "颜色选择器",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
export const domMap = new Map([
|
||||
["text", "el-input"],
|
||||
["richtext",'my-tinymce'],
|
||||
['radio','el-radio-group'],
|
||||
["checkbox", "el-checkbox-group"],
|
||||
["date", "el-date-picker"],
|
||||
["datetime", "el-date-picker"],
|
||||
["file","el-upload"],
|
||||
["files","el-upload"],
|
||||
["textarea", "el-input"],
|
||||
|
||||
|
||||
["map", "el-input"],
|
||||
])
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
|
||||
export const templatePropsMap = new Map([
|
||||
["text", {
|
||||
readonly: true,
|
||||
clearable: true
|
||||
}],
|
||||
["richtext",'my-tinymce'],
|
||||
['radio',{
|
||||
value: '选项1'
|
||||
}],
|
||||
["checkbox", {
|
||||
value: ['选项1']
|
||||
}],
|
||||
["date", {
|
||||
readonly: true,
|
||||
}],
|
||||
["datetime", {
|
||||
readonly: true,
|
||||
}],
|
||||
["file",{
|
||||
action: "a",
|
||||
fileList: [
|
||||
{name: 'food.jpeg', url: ''}
|
||||
],
|
||||
autoUpload: false,
|
||||
multiple: false,
|
||||
limit: 1
|
||||
}],
|
||||
["files",{
|
||||
action: "a",
|
||||
fileList: [
|
||||
{name: 'food.jpeg', url: ''},
|
||||
{name: 'food2.jpeg', url: ''}
|
||||
],
|
||||
autoUpload: false,
|
||||
multiple: true
|
||||
}],
|
||||
["textarea", {
|
||||
readonly: true,
|
||||
clearable: true,
|
||||
type: 'textarea',
|
||||
autosize: {
|
||||
'minRows': 2
|
||||
}
|
||||
}],
|
||||
|
||||
|
||||
["map", "el-input"],
|
||||
])
|
||||
@ -0,0 +1,102 @@
|
||||
import { save, index, destroy } from "@/api/system/customFormField";
|
||||
import { Message } from "element-ui";
|
||||
const state = {
|
||||
formList: [], //更个表单配置信息
|
||||
copyFormListId: [], //备份原始的字段id数组,以做删除
|
||||
selectedForm: null, //当前编辑的表单字段配置
|
||||
selectedIndex: null,
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
SET_COPY_FORM_LIST_ID: (state, arr) => {
|
||||
state.copyFormListId = arr;
|
||||
},
|
||||
SET_SELECTED_INDEX: (state, index) => {
|
||||
state.selectedIndex = index;
|
||||
},
|
||||
CLEAR_SELECTED_INDEX: (state) => {
|
||||
state.selectedIndex = null;
|
||||
},
|
||||
SET_SELECTED: (state, value) => {
|
||||
state.selectedForm = value;
|
||||
},
|
||||
CLEAR_SELECTED: (state, value) => {
|
||||
state.selectedForm = null;
|
||||
},
|
||||
SET_FORM_LIST: (state, list) => {
|
||||
state.formList = list;
|
||||
},
|
||||
SPLICE_FORM_LIST: (state, info) => {
|
||||
const { index, length, config } = info;
|
||||
if (config) {
|
||||
state.formList.splice(index, length || 0, config || state.selectedForm);
|
||||
} else {
|
||||
state.formList.splice(index, length || 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {
|
||||
submit: ({ state, commit }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
state.formList.forEach((item,index) => {
|
||||
item.sort = index + 1
|
||||
})
|
||||
let formListId = state.formList.filter((i) => !!i.id).map((i) => i.id);
|
||||
let deleteIds = state.copyFormListId.filter(
|
||||
(i) => !formListId.includes(i)
|
||||
);
|
||||
let promiseAll = [
|
||||
...state.formList.map((i) => save(i)),
|
||||
...deleteIds.map((i) => destroy({ id: i })),
|
||||
];
|
||||
Promise.all(promiseAll)
|
||||
.then((res) => {
|
||||
Message({
|
||||
type: "success",
|
||||
message: "保存成功",
|
||||
});
|
||||
resolve(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
getFormList: ({ state, commit }, custom_form_id) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
index(
|
||||
{
|
||||
page: 1,
|
||||
page_size: 999,
|
||||
sort_name: "sort",
|
||||
sort_type: "asc",
|
||||
custom_form_id,
|
||||
},
|
||||
true
|
||||
)
|
||||
.then((res) => {
|
||||
resolve(res);
|
||||
if (res?.data instanceof Array) {
|
||||
commit("SET_FORM_LIST", res.data);
|
||||
commit(
|
||||
"SET_COPY_FORM_LIST_ID",
|
||||
res.data.map((i) => i.id)
|
||||
);
|
||||
} else {
|
||||
console.warn("res.data not Array");
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions,
|
||||
};
|
||||
@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer
|
||||
ref="elDrawer"
|
||||
:title="detail.name || '详情'"
|
||||
:visible.sync="isShow"
|
||||
size="45%"
|
||||
direction="rtl"
|
||||
>
|
||||
<template>
|
||||
<el-descriptions
|
||||
size="medium"
|
||||
direction="vertical"
|
||||
:column="3"
|
||||
:labelStyle="{ 'font-weight': '600', width: '33%' }"
|
||||
:content-style="{ width: '33%' }"
|
||||
border
|
||||
style="margin: 20px 10px"
|
||||
>
|
||||
<template v-for="info in formInfo">
|
||||
<el-descriptions-item :label="info.name">{{
|
||||
contentFormat(info)
|
||||
}}</el-descriptions-item>
|
||||
</template>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { show } from "@/api/system/baseForm";
|
||||
export default {
|
||||
props: {
|
||||
formInfo: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
tableName: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: "",
|
||||
isShow: false,
|
||||
|
||||
detail: {},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.isShow = true;
|
||||
},
|
||||
hidden() {
|
||||
this.isShow = false;
|
||||
},
|
||||
setId(id) {
|
||||
if (typeof id == "number") {
|
||||
this.id = id;
|
||||
} else {
|
||||
console.error("error typeof id: " + typeof id);
|
||||
}
|
||||
},
|
||||
getId() {
|
||||
return this.id;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
contentFormat() {
|
||||
return function (i) {
|
||||
if (i.parameter_id) {
|
||||
return this.detail[i.link_with_name]?.value;
|
||||
}
|
||||
if (i.link_table_name) {
|
||||
if (i.link_relation === "hasOne") {
|
||||
return (
|
||||
this.detail[i.link_with_name]?.name ||
|
||||
this.detail[i.link_with_name]?.no ||
|
||||
this.detail[i.link_with_name]?.value
|
||||
);
|
||||
}
|
||||
if (i.link_relation === "hasMany") {
|
||||
return this.detail[i.link_with_name]
|
||||
?.map((o) => o?.name || o?.no || o?.value)
|
||||
?.toString();
|
||||
}
|
||||
}
|
||||
|
||||
return this.detail[i.field]
|
||||
};
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isShow(newVal) {
|
||||
if (newVal) {
|
||||
show(
|
||||
{
|
||||
table_name: this.tableName,
|
||||
id: this.id,
|
||||
},
|
||||
true
|
||||
).then((res) => {
|
||||
console.log(111, res);
|
||||
this.detail = res;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.btns {
|
||||
margin: 0 10px 12px 10px;
|
||||
}
|
||||
</style>
|
||||
@ -1,119 +1,328 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div>
|
||||
<!-- 查询配置 -->
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<LxHeader icon="md-apps" text="管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<LxHeader icon="md-apps" :text="customForm.tableName" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content"></div>
|
||||
<slot>
|
||||
<div>
|
||||
<Button type="primary" style="margin-left: 10px" @click="$refs['xyTable'].getTableData()">查询</Button>
|
||||
<Button type="primary" style="margin-left: 10px">新增</Button>
|
||||
</div>
|
||||
<header-content :auths="auths_auth_mixin">
|
||||
<template #search>
|
||||
<div style="display: flex">
|
||||
<Select v-model="select.filter[0].key" style="width: 100px;" placeholder="搜索条目">
|
||||
<Option v-for="item in form" :key="item.id" :value="item.field">{{ item.name }}</Option>
|
||||
</Select>
|
||||
<Select v-model="select.filter[0].op" style="width: 100px;margin-left: 10px;" placeholder="搜索条件">
|
||||
<Option v-for="item in op" :key="item.value" :value="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
<template v-if="select.filter[0].op !== 'range' && !columnArrTest(select.filter[0].key)">
|
||||
<Input v-model="select.filter[0].value" style="width: 150px;margin-left: 10px;" placeholder="请填写关键词"/>
|
||||
</template>
|
||||
<template v-else-if="select.filter[0].op !== 'range' && columnArrTest(select.filter[0].key)">
|
||||
<Select v-model="select.filter[0].value" style="width: 150px;margin-left: 10px;" placeholder="请选择关键词">
|
||||
<Option v-for="item in getColumnParams(select.filter[0].key)" :key="item.id" :value="item.id">{{ item.value || item.name || item.no || item.id }}</Option>
|
||||
</Select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<Input :value="select.filter[0].value.split(',')[0]"
|
||||
style="width: 150px;margin-left: 10px;"
|
||||
placeholder="范围开始关键词"
|
||||
@input="(e)=>inputStartHandler(e,select.filter[0])"/>
|
||||
<span style="margin-left: 10px;display: flex;align-items: center;">至</span>
|
||||
<Input :value="select.filter[0].value.split(',')[1]"
|
||||
style="width: 150px;margin-left: 10px;"
|
||||
placeholder="范围结束关键词"
|
||||
@input="(e)=>inputEndHandler(e,select.filter[0])"/>
|
||||
</template>
|
||||
<Button
|
||||
style="margin-left: 10px"
|
||||
type="primary"
|
||||
@click="$refs['xyTable'].getTableData(true)"
|
||||
>查询</Button
|
||||
>
|
||||
|
||||
<xy-selectors
|
||||
style="margin-left: 10px"
|
||||
@reset="reset"
|
||||
@search="$refs['xyTable'].getTableData(true)"
|
||||
>
|
||||
<template>
|
||||
<div class="select">
|
||||
<div class="select__item" v-for="(item,index) in select.filter" :key="`${item.value}-${index}`">
|
||||
<p>条件{{index+1}}</p>
|
||||
<Select v-model="item.key" style="width: 100px;" placeholder="搜索条目">
|
||||
<Option v-for="item in form" :key="item.id" :value="item.field">{{ item.name }}</Option>
|
||||
</Select>
|
||||
<Select v-model="item.op" style="width: 100px;margin-left: 10px;" placeholder="搜索条件">
|
||||
<Option v-for="item in op" :key="item.value" :value="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
<template v-if="item.op !== 'range' && !columnArrTest(item.key)">
|
||||
<Input v-model="item.value" style="width: 150px;margin-left: 10px;" placeholder="请填写关键词"/>
|
||||
</template>
|
||||
<template v-else-if="item.op !== 'range' && columnArrTest(item.key)">
|
||||
<Select v-model="item.value" style="width: 150px;margin-left: 10px;" placeholder="请选择关键词">
|
||||
<Option v-for="item in getColumnParams(item.key)" :key="item.id" :value="item.id">{{ item.value || item.name || item.no || item.id }}</Option>
|
||||
</Select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<Input :value="item.value.split(',')[0]"
|
||||
style="width: 150px;margin-left: 10px;"
|
||||
placeholder="范围开始关键词"
|
||||
@input="(e)=>inputStartHandler(e,item)"/>
|
||||
<span style="margin-left: 10px;">至</span>
|
||||
<Input :value="item.value.split(',')[1]"
|
||||
style="width: 150px;margin-left: 10px;"
|
||||
placeholder="范围结束关键词"
|
||||
@input="(e)=>inputEndHandler(e,item)"/>
|
||||
</template>
|
||||
<el-button v-if="index !== 0" size="small" type="danger" icon="el-icon-delete" circle style="margin-left: 10px;" @click="select.filter.splice(index,1)"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-btn">
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" circle @click="select.filter.push({key: '',op: '',value: ''})"></el-button>
|
||||
<span>新增一条</span>
|
||||
</div>
|
||||
</template>
|
||||
</xy-selectors>
|
||||
</div>
|
||||
</template>
|
||||
<template #create>
|
||||
<Button
|
||||
type="primary"
|
||||
@click="$refs['dialog'].setType('add'),$refs['dialog'].show()"
|
||||
>新增</Button
|
||||
>
|
||||
</template>
|
||||
<template #export>
|
||||
<Button
|
||||
type="primary"
|
||||
@click="download('/api/admin/base-form/index','get',Object.assign(select,{ page: 1,page_size: 9999,is_export: 1 }),`${new Date().getTime()}.xlsx`)"
|
||||
>导出</Button
|
||||
>
|
||||
</template>
|
||||
</header-content>
|
||||
</slot>
|
||||
</LxHeader>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<xy-table
|
||||
:auths="auths_auth_mixin"
|
||||
:delay-req="true"
|
||||
:destroy-action="destroy"
|
||||
ref="xyTable"
|
||||
:border="true"
|
||||
:list="[]"
|
||||
:req-opt="{keyword:'123'}"
|
||||
res-prop=""
|
||||
:table-item="table"></xy-table>
|
||||
:action="index"
|
||||
:req-opt="Object.assign(select,selectForm)"
|
||||
:destroy-req-opt="select"
|
||||
:table-item="table"
|
||||
@detail="row => {
|
||||
$refs['drawer'].setId(row.id);
|
||||
$refs['drawer'].show();
|
||||
}"
|
||||
@editor="row => {
|
||||
$refs['dialog'].setId(row.id);
|
||||
$refs['dialog'].setType('editor');
|
||||
$refs['dialog'].show();
|
||||
}">
|
||||
</xy-table>
|
||||
|
||||
<dialoger :table-name="customForm.tableName" :form-info="form" ref="dialog" @refresh="$refs['xyTable'].getTableData()"></dialoger>
|
||||
<drawer :table-name="customForm.tableName" :form-info="form" ref="drawer"></drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { index as fieldIndex } from "@/api/system/customFormField"
|
||||
import { authMixin } from "@/mixin/authMixin";
|
||||
import { index,destroy } from "@/api/system/baseForm";
|
||||
import { op } from "@/const/op";
|
||||
import { download } from "@/utils/downloadRequest";
|
||||
import { getparameter } from "@/api/system/dictionary";
|
||||
|
||||
import dialoger from './dialog.vue';
|
||||
import LxHeader from "@/components/LxHeader/index.vue";
|
||||
import { getData } from './data'
|
||||
import {listmenu} from '@/api/system/menu'
|
||||
import headerContent from "@/components/LxHeader/XyContent.vue";
|
||||
import drawer from "@/views/component/drawer.vue";
|
||||
export default {
|
||||
components:{
|
||||
LxHeader
|
||||
LxHeader,
|
||||
dialoger,
|
||||
headerContent,
|
||||
drawer,
|
||||
},
|
||||
mixins: [authMixin],
|
||||
data() {
|
||||
return {
|
||||
select:{
|
||||
page:1,
|
||||
page_size:10
|
||||
op,
|
||||
select: {
|
||||
table_name: "",
|
||||
filter: [
|
||||
{
|
||||
key: "",
|
||||
op: "",
|
||||
value: ""
|
||||
}
|
||||
]
|
||||
},
|
||||
list:[],
|
||||
table:[
|
||||
{
|
||||
type:'expand',
|
||||
width:46,
|
||||
expandFn:props => {
|
||||
selectForm: [],
|
||||
form: [],
|
||||
table: [],
|
||||
customForm: {
|
||||
customFormId: "",
|
||||
tableName: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
index,destroy,download,
|
||||
reset() {
|
||||
this.select.filter.splice(1)
|
||||
this.select.filter[0] = {
|
||||
key: "",
|
||||
op: "",
|
||||
value: ""
|
||||
}
|
||||
},
|
||||
|
||||
//target要为内存地址引用类型
|
||||
inputStartHandler(e,target) {
|
||||
let temp = target?.value.split(',')[1]
|
||||
target.value = `${e},${temp ? temp : ""}`
|
||||
},
|
||||
inputEndHandler(e,target) {
|
||||
let temp = target?.value.split(',')[0]
|
||||
target.value = `${temp ? temp : ""},${e}`
|
||||
},
|
||||
|
||||
async getField() {
|
||||
if(this.$route.meta.params?.custom_form) {
|
||||
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
|
||||
try {
|
||||
let custom_form = JSON.parse(decode)
|
||||
this.customForm.customFormId = custom_form.custom_form_id
|
||||
this.customForm.tableName = custom_form.table_name
|
||||
this.select.table_name = custom_form.table_name
|
||||
}catch (err) {
|
||||
console.warn(err)
|
||||
}
|
||||
}
|
||||
|
||||
const res = await fieldIndex({
|
||||
page: 1,
|
||||
page_size: 999,
|
||||
custom_form_id: this.customForm.customFormId,
|
||||
sort_name: 'sort',
|
||||
sort_type: 'asc',
|
||||
})
|
||||
if(res.data && res.data instanceof Array) {
|
||||
res.data.forEach(i => {
|
||||
if (i.field) {
|
||||
if (i.edit_input === "file" || i.edit_input === "files") {
|
||||
i._fileList = [];
|
||||
}
|
||||
if (
|
||||
(i.edit_input === "checkbox" || i.edit_input === "radio") &&
|
||||
i.parameter_id
|
||||
) {
|
||||
getparameter({ id: i.parameter_id }).then((res) => {
|
||||
i._paramters = res.detail ?? [];
|
||||
});
|
||||
}
|
||||
if (
|
||||
(i.edit_input === "checkbox" || i.edit_input === "radio") &&
|
||||
i.link_table_name
|
||||
) {
|
||||
index({
|
||||
page: 1,
|
||||
page_size: 999,
|
||||
table_name: i.link_table_name,
|
||||
}).then((res) => {
|
||||
i._paramters = res.data ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
this.form = res.data
|
||||
this.selectForm = ''
|
||||
this.table = res.data.map(i => {
|
||||
let linkOb = {}
|
||||
if(i.parameter_id) {
|
||||
linkOb.customFn = row => {
|
||||
return (
|
||||
<div>{props.$index}</div>
|
||||
<span>{ row[i.link_with_name]?.value }</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop:'id',
|
||||
label:'编号',
|
||||
width:80,
|
||||
sortable: 'custom'
|
||||
},
|
||||
{
|
||||
prop:'name',
|
||||
label:'菜单',
|
||||
width:120,
|
||||
sortable:'custom',
|
||||
},
|
||||
{
|
||||
prop:'url',
|
||||
label:'菜单路径',
|
||||
minWidth:140
|
||||
},
|
||||
{
|
||||
prop:'path',
|
||||
label:'路由',
|
||||
minWidth:140
|
||||
},
|
||||
{
|
||||
prop:'icon',
|
||||
label:'图标',
|
||||
minWidth:100
|
||||
},
|
||||
{
|
||||
prop:'api_prefix',
|
||||
label:'API前缀',
|
||||
minWidth:100
|
||||
},
|
||||
{
|
||||
prop:'sortnumber',
|
||||
label:'排序',
|
||||
width:100,
|
||||
filters:[
|
||||
{
|
||||
text:"0",
|
||||
value:0
|
||||
},
|
||||
{
|
||||
text:"1",
|
||||
value:1
|
||||
}
|
||||
if(i.link_table_name) {
|
||||
if(i.link_relation === 'hasOne') {
|
||||
linkOb.customFn = row => {
|
||||
return (
|
||||
<span>{ row[i.link_with_name]?.name || row[i.link_with_name]?.no || row[i.link_with_name]?.value }</span>
|
||||
)
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
if(i.link_relation === 'hasMany') {
|
||||
linkOb.customFn = row => {
|
||||
return (
|
||||
<div>
|
||||
{ row[i.link_with_name]?.map(o => (<span>{ o?.name || o?.no || o?.value }</span>)) }
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.assign({
|
||||
prop: i.field,
|
||||
label: i.name
|
||||
},linkOb)
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listmenu,
|
||||
getList(){
|
||||
this.total = getData(this.select).total
|
||||
this.list = getData(this.select).data
|
||||
}
|
||||
computed: {
|
||||
columnArrTest() {
|
||||
return function (field) {
|
||||
return this.form.find(i => i.field === field) ? this.form.find(i => i.field === field).search_input === 'checkbox' : false
|
||||
}
|
||||
},
|
||||
getColumnParams() {
|
||||
return function (field) {
|
||||
return this.form.find(i => i.field === field) ? this.form.find(i => i.field === field)._paramters : []
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.getList()
|
||||
created() {
|
||||
this.getField()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.select {
|
||||
&__item {
|
||||
|
||||
& > p {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
& + div {
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.add-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin-top: 10px;
|
||||
& > span {
|
||||
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div>
|
||||
123
|
||||
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform"></avue-input-map>
|
||||
<xyTinymce v-model="content"></xyTinymce>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AvueMap from 'avue-plugin-map'
|
||||
import xyTinymce from "@/components/XyTinymce/index.vue";
|
||||
export default{
|
||||
components: {
|
||||
AvueMap,
|
||||
xyTinymce
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
mapparams: {
|
||||
zoom: 11,
|
||||
},
|
||||
mapform: [],
|
||||
content:''
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,350 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
:fullscreen="true"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<template #title>
|
||||
<div class="btns">
|
||||
<span class="title">{{ custom_form.name }}</span>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-right"
|
||||
circle
|
||||
@click="$store.dispatch('form/getFormList')"
|
||||
></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
circle
|
||||
@click="update({ id:custom_form_id })"
|
||||
></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
circle
|
||||
@click="submit"
|
||||
></el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<Split v-model="splitL" :min="0.05">
|
||||
<template #left>
|
||||
<draggable
|
||||
v-model="types"
|
||||
:sort="false"
|
||||
:group="{ name: 'items', pull: 'clone' }"
|
||||
>
|
||||
<div class="type-item" v-for="item in types">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</draggable>
|
||||
</template>
|
||||
<template #right>
|
||||
<Split v-model="splitR" :min="0.2">
|
||||
<template #left>
|
||||
<div style="height: 100%">
|
||||
<el-dialog
|
||||
id="template-dialog"
|
||||
:title="custom_form.name || '模板表单'"
|
||||
style="position: relative; inset: 0 0 0 0; height: 100%"
|
||||
width="600px"
|
||||
top="40px"
|
||||
:visible="true"
|
||||
:modal="false"
|
||||
:append-to-body="false"
|
||||
:modal-append-to-body="false"
|
||||
>
|
||||
<template>
|
||||
<el-form
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
size="small"
|
||||
>
|
||||
<draggable
|
||||
:value="formList"
|
||||
group="items"
|
||||
@change="changeHandler"
|
||||
>
|
||||
<el-form-item
|
||||
:label="i.name || '字段名称'"
|
||||
:required="
|
||||
!!i.validation && i.validation.length > 0
|
||||
"
|
||||
v-for="(i, index) in formList"
|
||||
@click.native="selectPick(i, index)"
|
||||
>
|
||||
<formSlotRender
|
||||
:config="i"
|
||||
:index="index"
|
||||
></formSlotRender>
|
||||
</el-form-item>
|
||||
</draggable>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<div slot="footer">
|
||||
<div>
|
||||
<el-button>取 消</el-button>
|
||||
<el-button type="warning" plain>重 置</el-button>
|
||||
<el-button type="primary">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
<editPane :rules="rules" :types="types"></editPane>
|
||||
</template>
|
||||
</Split>
|
||||
</template>
|
||||
</Split>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listparameter } from "@/api/system/dictionary";
|
||||
import { index, config } from "@/api/system/customFormField";
|
||||
import { mapState } from "vuex";
|
||||
import { index as formIndex } from "@/api/system/customForm";
|
||||
import { deepCopy } from "@/utils";
|
||||
import { update } from "@/api/system/customForm";
|
||||
|
||||
import formSlotRender from "../components/formSlotRender.vue";
|
||||
import editPane from "../components/editPane.vue";
|
||||
export default {
|
||||
components: {
|
||||
formSlotRender,
|
||||
editPane,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//分割面板
|
||||
splitL: 0.13,
|
||||
splitR: 0.7,
|
||||
|
||||
custom_form: {},
|
||||
custom_form_id: "",
|
||||
dialogVisible: false,
|
||||
|
||||
types: [], //输入类型
|
||||
rules: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
deepCopy,update,
|
||||
show() {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
hidden() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
/**
|
||||
* @param key:string | array
|
||||
* @param value:string | array
|
||||
**/
|
||||
set(key, value) {
|
||||
if (
|
||||
key instanceof Array &&
|
||||
value instanceof Array &&
|
||||
key?.length === value?.length
|
||||
) {
|
||||
key.forEach((k, i) => {
|
||||
this[k] = value[i];
|
||||
});
|
||||
} else if (typeof key === "string") {
|
||||
this[key] = value;
|
||||
} else {
|
||||
throw new Error("参数key类型错误");
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm("确认退出?")
|
||||
.then((_) => {
|
||||
done();
|
||||
})
|
||||
.catch((_) => {});
|
||||
},
|
||||
|
||||
//获取列表数据
|
||||
async getForms() {
|
||||
const res = await formIndex({ page: 1, page_size: 999 });
|
||||
this.forms = res.data;
|
||||
},
|
||||
async getParameters() {
|
||||
const res = await listparameter({ page: 1, page_size: 999 });
|
||||
this.parameters = res.data;
|
||||
},
|
||||
async getConfig() {
|
||||
const { edit_to_migration, validation_rules } = await config(false);
|
||||
this.types = edit_to_migration;
|
||||
this.rules = validation_rules;
|
||||
},
|
||||
|
||||
selectPick(i, index) {
|
||||
this.$store.commit("form/SET_SELECTED_INDEX", index);
|
||||
this.$store.commit("form/SET_SELECTED", deepCopy(i));
|
||||
},
|
||||
//拖拽
|
||||
changeHandler(e) {
|
||||
if (e.added) {
|
||||
const { element, newIndex } = e.added;
|
||||
const originalData = element;
|
||||
const newItem = {
|
||||
id: "",
|
||||
custom_form_id: this.custom_form_id,
|
||||
field: "",
|
||||
name: "",
|
||||
parameter_id: "",
|
||||
search_input: originalData.edit_input,
|
||||
edit_input: originalData.edit_input,
|
||||
sort: newIndex,
|
||||
help: "",
|
||||
validation: "",
|
||||
select_item: "",
|
||||
list_show: 1,
|
||||
link_table_name: "",
|
||||
link_relation: "",
|
||||
};
|
||||
|
||||
console.log(newItem);
|
||||
|
||||
this.$store.commit("form/SPLICE_FORM_LIST", {
|
||||
index: newIndex,
|
||||
length: 0,
|
||||
config: newItem,
|
||||
});
|
||||
}
|
||||
if (e.moved) {
|
||||
const { element, newIndex, oldIndex } = e.moved;
|
||||
|
||||
if (element?.sort) {
|
||||
element.sort = newIndex;
|
||||
}
|
||||
|
||||
this.$store.commit("form/SPLICE_FORM_LIST", {
|
||||
index: oldIndex,
|
||||
length: 1,
|
||||
});
|
||||
this.$store.commit("form/SPLICE_FORM_LIST", {
|
||||
index: newIndex,
|
||||
length: 0,
|
||||
config: element,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
submit() {
|
||||
this.$store.dispatch("form/submit").then((res) => {
|
||||
setTimeout(() => {
|
||||
update({ id: this.custom_form_id })
|
||||
.then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "数据库同步成功",
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "数据库同步失败,请手动同步",
|
||||
});
|
||||
});
|
||||
}, 2000);
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState("form", ["selectedForm", "formList", "selectedIndex"]),
|
||||
},
|
||||
watch: {
|
||||
async dialogVisible(newVal) {
|
||||
if (newVal) {
|
||||
await this.$store.dispatch("form/getFormList", this.custom_form_id);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getConfig();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.title {
|
||||
font-weight: 600;
|
||||
letter-spacing: 2px;
|
||||
|
||||
padding: 0 20px;
|
||||
}
|
||||
.type-item {
|
||||
min-width: 40px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
color: $primaryColor;
|
||||
border: solid 1px $primaryColor;
|
||||
border-radius: 0.4em;
|
||||
position: relative;
|
||||
transition: all 0.2s ease-out;
|
||||
|
||||
padding: 0.5em 1em;
|
||||
margin: 0.6em 1em;
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: $primaryColor;
|
||||
}
|
||||
}
|
||||
::v-deep .el-dialog__headerbtn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 10px !important;
|
||||
box-shadow: 0 2px 10px 2px rgba(0, 0, 0, 0.2);
|
||||
position: relative;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
height: calc(100% - 62px);
|
||||
padding: 8px 0 !important;
|
||||
}
|
||||
#template-dialog {
|
||||
::v-deep .el-dialog__header {
|
||||
box-shadow: none;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 30px 20px !important;
|
||||
}
|
||||
}
|
||||
::v-deep .ivu-split-trigger-vertical {
|
||||
width: 2px;
|
||||
}
|
||||
::v-deep .ivu-split-trigger-bar-con.vertical {
|
||||
display: none;
|
||||
}
|
||||
::v-deep .ivu-split-horizontal > .ivu-split-trigger-con {
|
||||
width: 2px;
|
||||
}
|
||||
::v-deep .ivu-split-pane {
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,159 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer
|
||||
ref="elDrawer"
|
||||
title="自定义字段"
|
||||
:visible.sync="isShow"
|
||||
size="49%"
|
||||
direction="rtl"
|
||||
>
|
||||
<template>
|
||||
<div class="btns">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
circle
|
||||
@click="$refs['xyTable'].getTableData(true)"
|
||||
></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
circle
|
||||
@click="$refs['addField'].setForm(['custom_form_id'],[id]),$refs['addField'].setType('add'), $refs['addField'].show()"
|
||||
></el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
circle
|
||||
></el-button>
|
||||
</div>
|
||||
<xy-table
|
||||
:delay-req="true"
|
||||
:auths="['delete','edit']"
|
||||
:action="index"
|
||||
:destroy-action="destroy"
|
||||
:req-opt="{
|
||||
custom_form_id: id
|
||||
}"
|
||||
ref="xyTable"
|
||||
:height="400"
|
||||
style="margin: 0 10px"
|
||||
:table-item="table"
|
||||
@editor="row => {
|
||||
$refs['addField'].setType('editor');
|
||||
$refs['addField'].setId(row.id);
|
||||
$refs['addField'].show();
|
||||
}"
|
||||
@destroyed="row => {
|
||||
update({ id })
|
||||
}"
|
||||
>
|
||||
</xy-table>
|
||||
</template>
|
||||
</el-drawer>
|
||||
|
||||
<addField
|
||||
:z-index="zIndex"
|
||||
ref="addField"
|
||||
@refresh="refreshCallback"
|
||||
></addField>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { update } from "@/api/system/customForm"
|
||||
import { index,destroy } from "@/api/system/customFormField";
|
||||
|
||||
import addField from "./addField.vue";
|
||||
export default {
|
||||
components: {
|
||||
addField,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
zIndex: 2001,
|
||||
select: {
|
||||
custom_form_id: this.id
|
||||
},
|
||||
id: null,
|
||||
isShow: false,
|
||||
|
||||
table: [
|
||||
{
|
||||
type: "index",
|
||||
width: 70,
|
||||
label: "编号",
|
||||
},
|
||||
{
|
||||
prop: "field",
|
||||
label: "字段标识",
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "名字",
|
||||
width: 160,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
index,destroy,update,
|
||||
show() {
|
||||
this.isShow = true;
|
||||
},
|
||||
hidden() {
|
||||
this.isShow = false;
|
||||
},
|
||||
setId(id) {
|
||||
if (typeof id == "number") {
|
||||
this.id = id;
|
||||
} else {
|
||||
console.error("error typeof id: " + typeof id);
|
||||
}
|
||||
},
|
||||
getId() {
|
||||
return this.id;
|
||||
},
|
||||
refreshCallback() {
|
||||
this.$refs['xyTable'].getTableData()
|
||||
update({ id:this.id })
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
isShow: {
|
||||
handler: function (newVal) {
|
||||
if(newVal) {
|
||||
this.zIndex = Number(
|
||||
window
|
||||
.getComputedStyle(this.$refs["elDrawer"].$el)
|
||||
.getPropertyValue("z-index")
|
||||
)
|
||||
? Number(
|
||||
window
|
||||
.getComputedStyle(this.$refs["elDrawer"].$el)
|
||||
.getPropertyValue("z-index")
|
||||
) + 1
|
||||
: 2100;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['xyTable'].getTableData(true);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.btns {
|
||||
margin: 0 10px 12px 10px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,87 @@
|
||||
<script>
|
||||
import { domMap } from "@/const/inputType";
|
||||
import { templatePropsMap } from "@/const/templateProps";
|
||||
export default {
|
||||
props: {
|
||||
config: Object,
|
||||
index: Number,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
optionsRender(h) {
|
||||
if (this.config.edit_input === "radio") {
|
||||
return ['选项1','选项2','选项3'].map(i => h('el-radio',{ label: i }, i))
|
||||
}
|
||||
if(this.config.edit_input === "checkbox") {
|
||||
return ['选项1','选项2','选项3'].map(i => h('el-checkbox',{ label: i }, i))
|
||||
}
|
||||
if(this.config.edit_input === "file" || this.config.edit_input === "files") {
|
||||
return [
|
||||
h('el-button',{
|
||||
slot: 'trigger',
|
||||
props: {
|
||||
size: 'small',
|
||||
type: 'primary'
|
||||
}
|
||||
}, '选取文件'),
|
||||
h('el-button',{
|
||||
style: {
|
||||
'margin-left': '10px'
|
||||
},
|
||||
props: {
|
||||
size: 'small',
|
||||
type: 'success'
|
||||
}
|
||||
}, '上传到服务器'),
|
||||
h('div',{
|
||||
class: 'el-upload__tip',
|
||||
slot: 'tip'
|
||||
},'文件不超过500kb')
|
||||
]
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
render(h) {
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
class: this.config.list_show ? "" : "no-list-show",
|
||||
style: {
|
||||
opacity: this.config.list_show ? 1 : 0.5,
|
||||
filter:
|
||||
this.index === this.$store.state.form.selectedIndex
|
||||
? "drop-shadow(0 0 2px #0077CCFF) drop-shadow(0 0 8px #449FD9FF)"
|
||||
: "",
|
||||
position: "relative",
|
||||
},
|
||||
},
|
||||
[
|
||||
h(domMap.get(this.config.edit_input), {
|
||||
style: {
|
||||
width: "100%",
|
||||
},
|
||||
props: templatePropsMap.get(this.config.edit_input),
|
||||
},this.optionsRender(h)),
|
||||
]
|
||||
);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.no-list-show {
|
||||
&::after {
|
||||
content: "隐藏";
|
||||
color: red;
|
||||
font-size: 12px;
|
||||
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||