style: reformat the codes.
@@ -1,15 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{js,jsx,ts,tsx,vue}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
@@ -0,0 +1 @@
|
||||
<code_scheme name="Project" version="173" />
|
||||
@@ -8,13 +8,13 @@ import en_US from 'antd/es/locale/en_US';
|
||||
import './App.less';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Router>
|
||||
<ConfigProvider locale={en_US}>
|
||||
<Frame/>
|
||||
</ConfigProvider>
|
||||
</Router>
|
||||
);
|
||||
return (
|
||||
<Router>
|
||||
<ConfigProvider locale={en_US}>
|
||||
<Frame/>
|
||||
</ConfigProvider>
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -23,28 +23,28 @@
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
margin: 0 3px;
|
||||
display: inline-block;
|
||||
opacity: 0.85;
|
||||
-webkit-transition: all 0.1s;
|
||||
-o-transition: all 0.1s;
|
||||
transition: all 0.1s;
|
||||
cursor: pointer;
|
||||
margin: 0 3px;
|
||||
display: inline-block;
|
||||
opacity: 0.85;
|
||||
-webkit-transition: all 0.1s;
|
||||
-o-transition: all 0.1s;
|
||||
transition: all 0.1s;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
opacity: 1;
|
||||
-moz-transform: scale(1.2);
|
||||
-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);
|
||||
-ms-transform: scale(1.2);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
opacity: 1;
|
||||
-moz-transform: scale(1.2);
|
||||
-webkit-transform: scale(1.2);
|
||||
-o-transform: scale(1.2);
|
||||
-ms-transform: scale(1.2);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
@@ -52,12 +52,14 @@
|
||||
background-color: #337ab7;
|
||||
border-color: #2e6da4;
|
||||
}
|
||||
|
||||
.btn-primary:focus,
|
||||
.btn-primary.focus {
|
||||
color: #fff;
|
||||
background-color: #286090;
|
||||
border-color: #122b40;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
color: #fff;
|
||||
background-color: #286090;
|
||||
@@ -73,11 +75,11 @@
|
||||
|
||||
//编辑区域按钮,鼠标一上去按钮变大
|
||||
.action-buttons {
|
||||
a {
|
||||
.btn-action;
|
||||
}
|
||||
a {
|
||||
.btn-action;
|
||||
}
|
||||
}
|
||||
|
||||
.cursor {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -1,113 +1,391 @@
|
||||
@import "./variables.less";
|
||||
|
||||
.bg-primary{ background-color: @brand-primary; color: white;}
|
||||
.bg-success{ background-color: @brand-success; color: white; }
|
||||
.bg-info{ background-color: @brand-info; color: white; }
|
||||
.bg-warning{ background-color: @brand-warning; color: white; }
|
||||
.bg-danger{ background-color: @brand-danger; color: white; }
|
||||
.bg-gray{ background-color: @brand-gray; color: white; }
|
||||
.bg-laxative{ background-color: @brand-laxative; color: white; }
|
||||
.bg-primary {
|
||||
background-color: @brand-primary;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-success {
|
||||
background-color: @brand-success;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-info {
|
||||
background-color: @brand-info;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-warning {
|
||||
background-color: @brand-warning;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-danger {
|
||||
background-color: @brand-danger;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-gray {
|
||||
background-color: @brand-gray;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bg-laxative {
|
||||
background-color: @brand-laxative;
|
||||
color: white;
|
||||
}
|
||||
|
||||
|
||||
.text-primary{ color: @brand-primary;}
|
||||
.text-success{ color: @brand-success; }
|
||||
.text-info{ color: @brand-info; }
|
||||
.text-warning{ color: @brand-warning; }
|
||||
.text-danger{ color: @brand-danger; }
|
||||
.text-gray{ color: @brand-gray; }
|
||||
.text-laxative{ color: @brand-laxative; }
|
||||
.text-theme { color: @primary-color; }
|
||||
.text-primary {
|
||||
color: @brand-primary;
|
||||
}
|
||||
|
||||
.text-success {
|
||||
color: @brand-success;
|
||||
}
|
||||
|
||||
.text-info {
|
||||
color: @brand-info;
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: @brand-warning;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: @brand-danger;
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: @brand-gray;
|
||||
}
|
||||
|
||||
.text-laxative {
|
||||
color: @brand-laxative;
|
||||
}
|
||||
|
||||
.text-theme {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
.bg-navy {
|
||||
background-color: #001F3F;
|
||||
}
|
||||
|
||||
.bg-blue {
|
||||
background-color: #0074D9;
|
||||
}
|
||||
|
||||
.bg-aqua {
|
||||
background-color: #7FDBFF;
|
||||
}
|
||||
|
||||
.bg-aliceblue {
|
||||
background-color: aliceblue;
|
||||
}
|
||||
|
||||
.bg-pink {
|
||||
background-color: pink;
|
||||
}
|
||||
|
||||
.bg-azure {
|
||||
background-color: azure;
|
||||
}
|
||||
|
||||
.bg-teal {
|
||||
background-color: #39CCCC;
|
||||
}
|
||||
|
||||
.bg-olive {
|
||||
background-color: #3D9970;
|
||||
}
|
||||
|
||||
.bg-green {
|
||||
background-color: #2ECC40;
|
||||
}
|
||||
|
||||
.bg-lime {
|
||||
background-color: #01FF70;
|
||||
}
|
||||
|
||||
.bg-yellow {
|
||||
background-color: #FFDC00;
|
||||
}
|
||||
|
||||
.bg-pink {
|
||||
color: pink;
|
||||
}
|
||||
|
||||
.bg-orange {
|
||||
background-color: #FF851B;
|
||||
}
|
||||
|
||||
.bg-red {
|
||||
background-color: #FF4136;
|
||||
}
|
||||
|
||||
.bg-fuchsia {
|
||||
background-color: #F012BE;
|
||||
}
|
||||
|
||||
.bg-purple {
|
||||
background-color: #B10DC9;
|
||||
}
|
||||
|
||||
.bg-maroon {
|
||||
background-color: #85144B;
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.bg-gray {
|
||||
background-color: #AAAAAA;
|
||||
}
|
||||
|
||||
.bg-silver {
|
||||
background-color: #DDDDDD;
|
||||
}
|
||||
|
||||
.bg-navy { background-color: #001F3F;}
|
||||
.bg-blue { background-color: #0074D9;}
|
||||
.bg-aqua { background-color: #7FDBFF;}
|
||||
.bg-aliceblue { background-color: aliceblue;}
|
||||
.bg-pink { background-color: pink;}
|
||||
.bg-azure { background-color: azure;}
|
||||
.bg-teal { background-color: #39CCCC;}
|
||||
.bg-olive { background-color: #3D9970;}
|
||||
.bg-green { background-color: #2ECC40;}
|
||||
.bg-lime { background-color: #01FF70;}
|
||||
.bg-yellow { background-color: #FFDC00;}
|
||||
.bg-pink { color: pink; }
|
||||
.bg-orange { background-color: #FF851B;}
|
||||
.bg-red { background-color: #FF4136;}
|
||||
.bg-fuchsia { background-color: #F012BE;}
|
||||
.bg-purple { background-color: #B10DC9;}
|
||||
.bg-maroon { background-color: #85144B;}
|
||||
.bg-white { background-color: #FFFFFF;}
|
||||
.bg-gray { background-color: #AAAAAA;}
|
||||
.bg-silver { background-color: #DDDDDD;}
|
||||
.bg-silver-white {
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
.bg-black { background-color: #111111;}
|
||||
|
||||
.bg-111{ background-color:#111 }
|
||||
.bg-222{ background-color:#222 }
|
||||
.bg-333{ background-color:#333 }
|
||||
.bg-444{ background-color:#444 }
|
||||
.bg-555{ background-color:#555 }
|
||||
.bg-666{ background-color:#666 }
|
||||
.bg-777{ background-color:#777 }
|
||||
.bg-888{ background-color:#888 }
|
||||
.bg-999{ background-color:#999 }
|
||||
.bg-aaa{ background-color:#aaa }
|
||||
.bg-bbb{ background-color:#bbb }
|
||||
.bg-ccc{ background-color:#ccc }
|
||||
.bg-ddd{ background-color:#ddd }
|
||||
.bg-eee{ background-color:#eee }
|
||||
.bg-black {
|
||||
background-color: #111111;
|
||||
}
|
||||
|
||||
.bg-111 {
|
||||
background-color: #111
|
||||
}
|
||||
|
||||
.bg-222 {
|
||||
background-color: #222
|
||||
}
|
||||
|
||||
.bg-333 {
|
||||
background-color: #333
|
||||
}
|
||||
|
||||
.bg-444 {
|
||||
background-color: #444
|
||||
}
|
||||
|
||||
.bg-555 {
|
||||
background-color: #555
|
||||
}
|
||||
|
||||
.bg-666 {
|
||||
background-color: #666
|
||||
}
|
||||
|
||||
.bg-777 {
|
||||
background-color: #777
|
||||
}
|
||||
|
||||
.bg-888 {
|
||||
background-color: #888
|
||||
}
|
||||
|
||||
.bg-999 {
|
||||
background-color: #999
|
||||
}
|
||||
|
||||
.bg-aaa {
|
||||
background-color: #aaa
|
||||
}
|
||||
|
||||
.bg-bbb {
|
||||
background-color: #bbb
|
||||
}
|
||||
|
||||
.bg-ccc {
|
||||
background-color: #ccc
|
||||
}
|
||||
|
||||
.bg-ddd {
|
||||
background-color: #ddd
|
||||
}
|
||||
|
||||
.bg-eee {
|
||||
background-color: #eee
|
||||
}
|
||||
|
||||
|
||||
/* Colors */
|
||||
.navy { color: #001F3F;}
|
||||
.blue { color: #0074D9;}
|
||||
.aqua { color: #7FDBFF;}
|
||||
.teal { color: #39CCCC;}
|
||||
.olive { color: #3D9970;}
|
||||
.green { color: #2ECC40;}
|
||||
.lime { color: #01FF70;}
|
||||
.yellow { color: #FFDC00;}
|
||||
.pink { color: pink; }
|
||||
.orange { color: #FF851B;}
|
||||
.red { color: #FF4136;}
|
||||
.fuchsia { color: #F012BE;}
|
||||
.purple { color: #B10DC9;}
|
||||
.maroon { color: #85144B;}
|
||||
.white { color: #FFFFFF;}
|
||||
.silver { color: #DDDDDD;}
|
||||
.gray { color: #AAAAAA;}
|
||||
.black { color: #111111;}
|
||||
.navy {
|
||||
color: #001F3F;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #0074D9;
|
||||
}
|
||||
|
||||
.aqua {
|
||||
color: #7FDBFF;
|
||||
}
|
||||
|
||||
.teal {
|
||||
color: #39CCCC;
|
||||
}
|
||||
|
||||
.olive {
|
||||
color: #3D9970;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #2ECC40;
|
||||
}
|
||||
|
||||
.lime {
|
||||
color: #01FF70;
|
||||
}
|
||||
|
||||
.yellow {
|
||||
color: #FFDC00;
|
||||
}
|
||||
|
||||
.pink {
|
||||
color: pink;
|
||||
}
|
||||
|
||||
.orange {
|
||||
color: #FF851B;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #FF4136;
|
||||
}
|
||||
|
||||
.fuchsia {
|
||||
color: #F012BE;
|
||||
}
|
||||
|
||||
.purple {
|
||||
color: #B10DC9;
|
||||
}
|
||||
|
||||
.maroon {
|
||||
color: #85144B;
|
||||
}
|
||||
|
||||
.white {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.silver {
|
||||
color: #DDDDDD;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
.black {
|
||||
color: #111111;
|
||||
}
|
||||
|
||||
|
||||
.color-111{color:#111}
|
||||
.color-222{color:#222}
|
||||
.color-333{color:#333}
|
||||
.color-444{color:#444}
|
||||
.color-555{color:#555}
|
||||
.color-666{color:#666}
|
||||
.color-777{color:#777}
|
||||
.color-888{color:#888}
|
||||
.color-999{color:#999}
|
||||
.color-aaa{color:#aaa}
|
||||
.color-bbb{color:#bbb}
|
||||
.color-ccc{color:#ccc}
|
||||
.color-ddd{color:#ddd}
|
||||
.color-eee{color:#eee}
|
||||
.color-111 {
|
||||
color: #111
|
||||
}
|
||||
|
||||
.color-222 {
|
||||
color: #222
|
||||
}
|
||||
|
||||
.color-333 {
|
||||
color: #333
|
||||
}
|
||||
|
||||
.color-444 {
|
||||
color: #444
|
||||
}
|
||||
|
||||
.color-555 {
|
||||
color: #555
|
||||
}
|
||||
|
||||
.color-666 {
|
||||
color: #666
|
||||
}
|
||||
|
||||
.color-777 {
|
||||
color: #777
|
||||
}
|
||||
|
||||
.color-888 {
|
||||
color: #888
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.color-aaa {
|
||||
color: #aaa
|
||||
}
|
||||
|
||||
.color-bbb {
|
||||
color: #bbb
|
||||
}
|
||||
|
||||
.color-ccc {
|
||||
color: #ccc
|
||||
}
|
||||
|
||||
.color-ddd {
|
||||
color: #ddd
|
||||
}
|
||||
|
||||
.color-eee {
|
||||
color: #eee
|
||||
}
|
||||
|
||||
|
||||
.color-text { color: #660E7A;}
|
||||
.color-doc { color: #295496;}
|
||||
.color-xls { color: #1E6C41;}
|
||||
.color-ppt { color: #D04324;}
|
||||
.color-pdf { color: #E40B0B;}
|
||||
.color-audio { color: #5bc0de;}
|
||||
.color-video { color: #5cb85c;}
|
||||
.color-image { color: #0074D9;}
|
||||
.color-archive { color: #4437f2;}
|
||||
.color-text {
|
||||
color: #660E7A;
|
||||
}
|
||||
|
||||
.color-light-active{ color: #ffc60c;}
|
||||
.color-light-inactive{ color:#ccc;}
|
||||
.color-doc {
|
||||
color: #295496;
|
||||
}
|
||||
|
||||
.color-xls {
|
||||
color: #1E6C41;
|
||||
}
|
||||
|
||||
.color-ppt {
|
||||
color: #D04324;
|
||||
}
|
||||
|
||||
.color-pdf {
|
||||
color: #E40B0B;
|
||||
}
|
||||
|
||||
.color-audio {
|
||||
color: #5bc0de;
|
||||
}
|
||||
|
||||
.color-video {
|
||||
color: #5cb85c;
|
||||
}
|
||||
|
||||
.color-image {
|
||||
color: #0074D9;
|
||||
}
|
||||
|
||||
.color-archive {
|
||||
color: #4437f2;
|
||||
}
|
||||
|
||||
.color-light-active {
|
||||
color: #ffc60c;
|
||||
}
|
||||
|
||||
.color-light-inactive {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
#font{
|
||||
.f(@from,@end,@step){
|
||||
.mX(@f,@e,@s) when (@e >= @f){
|
||||
.f@{e}{
|
||||
font-size:@e*1px!important;
|
||||
#font {
|
||||
.f(@from,@end,@step) {
|
||||
.mX(@f,@e,@s) when (@e >= @f) {
|
||||
.f@{e} {
|
||||
font-size: @e*1px !important;
|
||||
}
|
||||
.mX(@f,@e - @s,@s);
|
||||
.mX(@f, @e - @s, @s);
|
||||
}
|
||||
.mX(@from,@end,@step);
|
||||
.mX(@from, @end, @step);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#font > .f(10,80,1);
|
||||
#font > .f(10, 80, 1);
|
||||
|
||||
#font{
|
||||
.ln(@from,@end,@step){
|
||||
.mX(@f,@e,@s) when (@e >= @f){
|
||||
.ln@{e}{
|
||||
line-height:@e*1px!important;
|
||||
#font {
|
||||
.ln(@from,@end,@step) {
|
||||
.mX(@f,@e,@s) when (@e >= @f) {
|
||||
.ln@{e} {
|
||||
line-height: @e*1px !important;
|
||||
}
|
||||
.mX(@f,@e - @s,@s);
|
||||
.mX(@f, @e - @s, @s);
|
||||
}
|
||||
.mX(@from,@end,@step);
|
||||
.mX(@from, @end, @step);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#font > .ln(10,100,1);
|
||||
#font > .ln(10, 100, 1);
|
||||
|
||||
|
||||
|
||||
.bold{
|
||||
font-weight:bold;
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.italic{
|
||||
font-style:italic;
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ a {
|
||||
|
||||
.hot-area {
|
||||
position: relative;
|
||||
|
||||
&:after {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -1 +1,10 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189634329" class="icon" style="" viewBox="0 0 1219 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10648" xmlns:xlink="http://www.w3.org/1999/xlink" width="238.0859375" height="200"><defs><style type="text/css"></style></defs><path d="M1197.787429 327.192381a19.504762 19.504762 0 0 1 19.553523 19.407238v614.156191c0 34.913524-28.574476 63.24419-63.878095 63.24419H63.878095C28.623238 1024 0 995.718095 0 960.75581V346.599619a19.504762 19.504762 0 0 1 19.602286-19.358476h1178.185143z m-66.80381-213.089524C1179.550476 114.102857 1219.047619 153.209905 1219.047619 201.386667v80.213333H1.657905V88.259048C1.657905 39.497143 41.593905 0 90.794667 0h290.864762c17.408 0 33.987048 7.655619 45.104761 20.967619l78.214096 93.135238h626.005333z" fill="#1ab394" p-id="10649"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189634329" class="icon" style="" viewBox="0 0 1219 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="10648" width="238.0859375" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M1197.787429 327.192381a19.504762 19.504762 0 0 1 19.553523 19.407238v614.156191c0 34.913524-28.574476 63.24419-63.878095 63.24419H63.878095C28.623238 1024 0 995.718095 0 960.75581V346.599619a19.504762 19.504762 0 0 1 19.602286-19.358476h1178.185143z m-66.80381-213.089524C1179.550476 114.102857 1219.047619 153.209905 1219.047619 201.386667v80.213333H1.657905V88.259048C1.657905 39.497143 41.593905 0 90.794667 0h290.864762c17.408 0 33.987048 7.655619 45.104761 20.967619l78.214096 93.135238h626.005333z"
|
||||
fill="#1ab394" p-id="10649"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 949 B |
@@ -1 +1,14 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189353878" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1197" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M9.367 0h992.97v341.333H9.366z" fill="#55C7F7" p-id="1198"></path><path d="M9.367 341.333h992.97v341.334H9.366z" fill="#F95F5D" p-id="1199"></path><path d="M9.367 682.667h992.97V1024H9.366z" fill="#7ECF3B" p-id="1200"></path><path d="M350.7 0h310.303v1024H350.7z" fill="#FDAF42" p-id="1201"></path><path d="M304.154 386.638V646.05h403.394V386.638H304.154z m356.849 215.97H350.7V429.46h310.303v173.15z" fill="#FFFFFF" p-id="1202"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189353878" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1197" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M9.367 0h992.97v341.333H9.366z" fill="#55C7F7" p-id="1198"></path>
|
||||
<path d="M9.367 341.333h992.97v341.334H9.366z" fill="#F95F5D" p-id="1199"></path>
|
||||
<path d="M9.367 682.667h992.97V1024H9.366z" fill="#7ECF3B" p-id="1200"></path>
|
||||
<path d="M350.7 0h310.303v1024H350.7z" fill="#FDAF42" p-id="1201"></path>
|
||||
<path d="M304.154 386.638V646.05h403.394V386.638H304.154z m356.849 215.97H350.7V429.46h310.303v173.15z"
|
||||
fill="#FFFFFF" p-id="1202"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 855 B |
@@ -1 +1,14 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543321997742" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3887" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M160 32c-12 0-24.8 4.8-33.6 14.4S112 68 112 80v864c0 12 4.8 24.8 14.4 33.6C136 987.2 148 992 160 992h704c12 0 24.8-4.8 33.6-14.4C907.2 968 912 956 912 944V304L640 32H160z" fill="#FF5562" p-id="3888"></path><path d="M912 304H688c-12 0-24.8-4.8-33.6-14.4-9.6-8.8-14.4-21.6-14.4-33.6V32l272 272z" fill="#FFBBC0" p-id="3889"></path><path d="M669.6 491.2c0-1.6 0.8-4 0-6.4V369.6c0-4.8-2.4-8.8-5.6-12-4-3.2-8-4-12.8-3.2l-250.4 70.4c-7.2 1.6-12 7.2-12 14.4v275.2c-9.6-4-20.8-6.4-32.8-6.4-8.8 0-17.6 0.8-26.4 3.2-40.8 11.2-66.4 43.2-58.4 72.8 6.4 23.2 30.4 37.6 60.8 37.6 8.8 0 17.6-1.6 26.4-3.2 36.8-10.4 60.8-36.8 60-63.2 0.8-1.6 0.8-3.2 0.8-5.6V570.4l220-61.6v136c-9.6-4-20.8-6.4-32.8-6.4-8.8 0-17.6 0.8-26.4 3.2-40.8 11.2-66.4 43.2-58.4 72.8C528 737.6 552 752 582.4 752c8.8 0 17.6-0.8 26.4-3.2 36-9.6 60-36 60-62.4 0.8-1.6 0.8-3.2 0.8-5.6V491.2z m-250.4 48v-53.6l220-61.6v53.6l-220 61.6z" fill="#FFFFFF" p-id="3890"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1543321997742" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="3887" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M160 32c-12 0-24.8 4.8-33.6 14.4S112 68 112 80v864c0 12 4.8 24.8 14.4 33.6C136 987.2 148 992 160 992h704c12 0 24.8-4.8 33.6-14.4C907.2 968 912 956 912 944V304L640 32H160z"
|
||||
fill="#FF5562" p-id="3888"></path>
|
||||
<path d="M912 304H688c-12 0-24.8-4.8-33.6-14.4-9.6-8.8-14.4-21.6-14.4-33.6V32l272 272z" fill="#FFBBC0"
|
||||
p-id="3889"></path>
|
||||
<path d="M669.6 491.2c0-1.6 0.8-4 0-6.4V369.6c0-4.8-2.4-8.8-5.6-12-4-3.2-8-4-12.8-3.2l-250.4 70.4c-7.2 1.6-12 7.2-12 14.4v275.2c-9.6-4-20.8-6.4-32.8-6.4-8.8 0-17.6 0.8-26.4 3.2-40.8 11.2-66.4 43.2-58.4 72.8 6.4 23.2 30.4 37.6 60.8 37.6 8.8 0 17.6-1.6 26.4-3.2 36.8-10.4 60.8-36.8 60-63.2 0.8-1.6 0.8-3.2 0.8-5.6V570.4l220-61.6v136c-9.6-4-20.8-6.4-32.8-6.4-8.8 0-17.6 0.8-26.4 3.2-40.8 11.2-66.4 43.2-58.4 72.8C528 737.6 552 752 582.4 752c8.8 0 17.6-0.8 26.4-3.2 36-9.6 60-36 60-62.4 0.8-1.6 0.8-3.2 0.8-5.6V491.2z m-250.4 48v-53.6l220-61.6v53.6l-220 61.6z"
|
||||
fill="#FFFFFF" p-id="3890"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1 +1,12 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543300132402" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2107" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M533.947184 38.36489h65.880106v88.119185c117.859409 0.660894 235.60867-1.211639 353.35793 0.660894 25.102953-2.533427 44.81962 16.962943 42.506492 42.07691 1.872533 216.993492-0.440596 434.097133 1.112505 651.090626-1.112505 22.250094 2.191965 46.923466-10.695466 66.640133-16.081751 11.455494-36.899909 10.023557-55.625236 10.904749-110.25913-0.550745-220.408111-0.330447-330.656225-0.330447v88.119185h-68.843113c-167.657764-30.621417-335.745108-58.709407-503.722304-88.119185-0.110149-256.977572 0-513.955144 0-770.822567 168.858388-29.519927 337.826924-58.268811 506.685311-88.339483z" fill="#2A5699" p-id="2108"></path><path d="M599.816275 159.528769h363.491637v704.953477h-363.491637v-88.119185h286.38735v-44.059592h-286.38735v-55.07449h286.38735v-44.059593h-286.38735v-55.07449h286.38735v-44.059592h-286.38735v-55.074491h286.38735v-44.059592h-286.38735v-55.074491h286.38735v-44.059592h-286.38735v-55.07449h286.38735v-44.059593h-286.38735v-77.104286zM254.829667 354.162018c20.928306-1.211639 41.856613-2.092831 62.784919-3.19432 14.649814 74.350562 29.619061 148.590975 45.491529 222.61109 12.446835-76.443393 26.215457-152.666487 39.543484-228.999731 22.029796-0.771043 44.059592-1.982682 65.97924-3.30447-24.89367 106.734362-46.703168 214.349917-73.909966 320.423385-18.39488 9.582961-45.932125-0.440596-67.741623 1.10149-14.649814-72.90761-31.722906-145.38564-44.819621-218.645727-12.898446 71.156242-29.641091 141.651589-44.390039 212.367235a4187.754101 4187.754101 0 0 1-63.666111-3.866229c-18.284731-96.931103-39.763782-193.190297-56.836874-290.341698 18.835476-0.881192 37.792115-1.652235 56.627591-2.313129 11.33433 70.164901 24.221761 139.999355 34.146184 210.274404 15.508976-72.037433 31.37043-144.074867 46.791287-216.1123z" fill="#FFFFFF" p-id="2109"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1543300132402" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="2107" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M533.947184 38.36489h65.880106v88.119185c117.859409 0.660894 235.60867-1.211639 353.35793 0.660894 25.102953-2.533427 44.81962 16.962943 42.506492 42.07691 1.872533 216.993492-0.440596 434.097133 1.112505 651.090626-1.112505 22.250094 2.191965 46.923466-10.695466 66.640133-16.081751 11.455494-36.899909 10.023557-55.625236 10.904749-110.25913-0.550745-220.408111-0.330447-330.656225-0.330447v88.119185h-68.843113c-167.657764-30.621417-335.745108-58.709407-503.722304-88.119185-0.110149-256.977572 0-513.955144 0-770.822567 168.858388-29.519927 337.826924-58.268811 506.685311-88.339483z"
|
||||
fill="#2A5699" p-id="2108"></path>
|
||||
<path d="M599.816275 159.528769h363.491637v704.953477h-363.491637v-88.119185h286.38735v-44.059592h-286.38735v-55.07449h286.38735v-44.059593h-286.38735v-55.07449h286.38735v-44.059592h-286.38735v-55.074491h286.38735v-44.059592h-286.38735v-55.074491h286.38735v-44.059592h-286.38735v-55.07449h286.38735v-44.059593h-286.38735v-77.104286zM254.829667 354.162018c20.928306-1.211639 41.856613-2.092831 62.784919-3.19432 14.649814 74.350562 29.619061 148.590975 45.491529 222.61109 12.446835-76.443393 26.215457-152.666487 39.543484-228.999731 22.029796-0.771043 44.059592-1.982682 65.97924-3.30447-24.89367 106.734362-46.703168 214.349917-73.909966 320.423385-18.39488 9.582961-45.932125-0.440596-67.741623 1.10149-14.649814-72.90761-31.722906-145.38564-44.819621-218.645727-12.898446 71.156242-29.641091 141.651589-44.390039 212.367235a4187.754101 4187.754101 0 0 1-63.666111-3.866229c-18.284731-96.931103-39.763782-193.190297-56.836874-290.341698 18.835476-0.881192 37.792115-1.652235 56.627591-2.313129 11.33433 70.164901 24.221761 139.999355 34.146184 210.274404 15.508976-72.037433 31.37043-144.074867 46.791287-216.1123z"
|
||||
fill="#FFFFFF" p-id="2109"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1 +1,19 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189511483" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6709" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M676.297143 0H145.609143C130.834286 0 118.857143 11.977143 118.857143 35.218286V1005.714286c0 6.308571 11.977143 18.285714 26.752 18.285714h732.781714c14.774857 0 26.752-11.977143 26.752-18.285714V237.312c0-12.726857-1.700571-16.822857-4.699428-19.84L687.670857 4.699429A16.164571 16.164571 0 0 0 676.297143 0z" fill="#E9E9E0" p-id="6710"></path><path d="M685.714286 2.761143V219.428571h216.667428z" fill="#D9D7CA" p-id="6711"></path><path d="M878.390857 1024H145.609143A26.752 26.752 0 0 1 118.857143 997.248V713.142857h786.285714v284.105143c0 14.774857-11.977143 26.752-26.752 26.752z" fill="#C8BDB8" p-id="6712"></path><path d="M338.285714 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z" fill="#FFFFFF" p-id="6713"></path><path d="M521.142857 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z" fill="#FFFFFF" p-id="6714"></path><path d="M704 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z" fill="#FFFFFF" p-id="6715"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189511483" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="6709" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M676.297143 0H145.609143C130.834286 0 118.857143 11.977143 118.857143 35.218286V1005.714286c0 6.308571 11.977143 18.285714 26.752 18.285714h732.781714c14.774857 0 26.752-11.977143 26.752-18.285714V237.312c0-12.726857-1.700571-16.822857-4.699428-19.84L687.670857 4.699429A16.164571 16.164571 0 0 0 676.297143 0z"
|
||||
fill="#E9E9E0" p-id="6710"></path>
|
||||
<path d="M685.714286 2.761143V219.428571h216.667428z" fill="#D9D7CA" p-id="6711"></path>
|
||||
<path d="M878.390857 1024H145.609143A26.752 26.752 0 0 1 118.857143 997.248V713.142857h786.285714v284.105143c0 14.774857-11.977143 26.752-26.752 26.752z"
|
||||
fill="#C8BDB8" p-id="6712"></path>
|
||||
<path d="M338.285714 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z"
|
||||
fill="#FFFFFF" p-id="6713"></path>
|
||||
<path d="M521.142857 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z"
|
||||
fill="#FFFFFF" p-id="6714"></path>
|
||||
<path d="M704 859.428571m-54.857143 0a54.857143 54.857143 0 1 0 109.714286 0 54.857143 54.857143 0 1 0-109.714286 0Z"
|
||||
fill="#FFFFFF" p-id="6715"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1 +1,10 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189634329" class="icon" style="" viewBox="0 0 1219 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10648" xmlns:xlink="http://www.w3.org/1999/xlink" width="238.0859375" height="200"><defs><style type="text/css"></style></defs><path d="M1197.787429 327.192381a19.504762 19.504762 0 0 1 19.553523 19.407238v614.156191c0 34.913524-28.574476 63.24419-63.878095 63.24419H63.878095C28.623238 1024 0 995.718095 0 960.75581V346.599619a19.504762 19.504762 0 0 1 19.602286-19.358476h1178.185143z m-66.80381-213.089524C1179.550476 114.102857 1219.047619 153.209905 1219.047619 201.386667v80.213333H1.657905V88.259048C1.657905 39.497143 41.593905 0 90.794667 0h290.864762c17.408 0 33.987048 7.655619 45.104761 20.967619l78.214096 93.135238h626.005333z" fill="#23B7E5" p-id="10649"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189634329" class="icon" style="" viewBox="0 0 1219 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="10648" width="238.0859375" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M1197.787429 327.192381a19.504762 19.504762 0 0 1 19.553523 19.407238v614.156191c0 34.913524-28.574476 63.24419-63.878095 63.24419H63.878095C28.623238 1024 0 995.718095 0 960.75581V346.599619a19.504762 19.504762 0 0 1 19.602286-19.358476h1178.185143z m-66.80381-213.089524C1179.550476 114.102857 1219.047619 153.209905 1219.047619 201.386667v80.213333H1.657905V88.259048C1.657905 39.497143 41.593905 0 90.794667 0h290.864762c17.408 0 33.987048 7.655619 45.104761 20.967619l78.214096 93.135238h626.005333z"
|
||||
fill="#23B7E5" p-id="10649"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 949 B |
@@ -1 +1,16 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514190539077" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14917" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M128 0h597.3l227.6 227.9v739.2c0 31.4-25.5 56.9-56.9 56.9H128c-31.4 0-56.9-25.5-56.9-56.9V56.9C71.1 25.5 96.6 0 128 0z" fill="#13BE93" p-id="14918"></path><path d="M630.5 1024H128c-25.7 0-47.4-17-54.4-40.4l218.1-218.1c22.2-22.2 58.2-22.2 80.5 0L630.5 1024z" fill="#6BD8BD" p-id="14919"></path><path d="M952.9 858v109.1c0 31.4-25.5 56.9-56.9 56.9H322.4l-4.7-4.7 358-358c22.2-22.2 58.2-22.2 80.5 0L952.9 858z" fill="#9CF9E2" p-id="14920"></path><path d="M725.3 0l227.6 227.6H782.2c-31.4 0-56.9-25.5-56.9-56.9V0z" fill="#69DCC0" p-id="14921"></path><path d="M327.1 483.6m-85.3 0a85.3 85.3 0 1 0 170.6 0 85.3 85.3 0 1 0-170.6 0Z" fill="#E9FFFA" p-id="14922"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514190539077" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="14917" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M128 0h597.3l227.6 227.9v739.2c0 31.4-25.5 56.9-56.9 56.9H128c-31.4 0-56.9-25.5-56.9-56.9V56.9C71.1 25.5 96.6 0 128 0z"
|
||||
fill="#13BE93" p-id="14918"></path>
|
||||
<path d="M630.5 1024H128c-25.7 0-47.4-17-54.4-40.4l218.1-218.1c22.2-22.2 58.2-22.2 80.5 0L630.5 1024z"
|
||||
fill="#6BD8BD" p-id="14919"></path>
|
||||
<path d="M952.9 858v109.1c0 31.4-25.5 56.9-56.9 56.9H322.4l-4.7-4.7 358-358c22.2-22.2 58.2-22.2 80.5 0L952.9 858z"
|
||||
fill="#9CF9E2" p-id="14920"></path>
|
||||
<path d="M725.3 0l227.6 227.6H782.2c-31.4 0-56.9-25.5-56.9-56.9V0z" fill="#69DCC0" p-id="14921"></path>
|
||||
<path d="M327.1 483.6m-85.3 0a85.3 85.3 0 1 0 170.6 0 85.3 85.3 0 1 0-170.6 0Z" fill="#E9FFFA" p-id="14922"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1 +1,13 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514284130163" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1551" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M915.114667 1024H108.885333V0h587.776v218.112H914.773333V1024z m-785.066667-20.821333h763.904V238.933333H675.84V20.821333H129.706667v982.357334z" fill="#F90E09" p-id="1552"></path><path d="M708.266667 10.581333L904.533333 206.848h-196.266666z" fill="#F90E09" p-id="1553"></path><path d="M282.965333 792.576c33.450667-23.210667 55.637333-57.344 76.8-91.136-30.378667 25.941333-59.050667 54.954667-76.8 91.136z m396.629334-169.642667c31.402667 15.018667 65.877333 31.061333 101.376 21.504-24.576-29.696-67.584-21.504-101.376-21.504z m-246.101334 23.210667c45.397333-16.725333 91.818667-29.696 138.922667-39.594667-30.378667-26.965333-55.978667-58.368-76.458667-93.525333-16.725333 46.08-38.912 90.112-62.464 133.12z m67.925334-243.370667c14.677333-37.546667 19.114667-83.285333-5.802667-117.418666-7.168 38.912-4.096 79.189333 5.802667 117.418666z m-45.397334-105.130666c4.096-24.917333 35.84-29.696 55.637334-22.186667 12.288 7.850667 18.432 22.869333 18.773333 37.205333 1.365333 44.032-6.485333 87.381333-12.629333 130.730667-3.413333 20.138667 8.874667 38.229333 17.749333 55.296 21.845333 40.277333 52.224 76.458667 92.16 99.669333 48.128-5.802667 98.645333-12.970667 145.749333 2.389334 35.157333 11.946667 26.965333 77.141333-11.264 77.824-53.589333 2.730667-102.058667-23.893333-150.186666-43.349334-66.218667 4.778667-130.730667 24.917333-194.218667 44.032-28.672 46.762667-54.613333 98.986667-101.034667 130.730667-23.210667 18.090667-76.458667 3.072-64.512-32.085333 20.138667-49.152 70.314667-76.117333 114.346667-100.693334 12.629333-6.485333 19.797333-18.773333 26.282667-31.061333 30.037333-57.685333 60.074667-115.370667 84.309333-175.786667-12.629333-56.661333-31.061333-114.688-21.162667-172.714666z" fill="#F90E09" p-id="1554"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514284130163" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1551" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M915.114667 1024H108.885333V0h587.776v218.112H914.773333V1024z m-785.066667-20.821333h763.904V238.933333H675.84V20.821333H129.706667v982.357334z"
|
||||
fill="#F90E09" p-id="1552"></path>
|
||||
<path d="M708.266667 10.581333L904.533333 206.848h-196.266666z" fill="#F90E09" p-id="1553"></path>
|
||||
<path d="M282.965333 792.576c33.450667-23.210667 55.637333-57.344 76.8-91.136-30.378667 25.941333-59.050667 54.954667-76.8 91.136z m396.629334-169.642667c31.402667 15.018667 65.877333 31.061333 101.376 21.504-24.576-29.696-67.584-21.504-101.376-21.504z m-246.101334 23.210667c45.397333-16.725333 91.818667-29.696 138.922667-39.594667-30.378667-26.965333-55.978667-58.368-76.458667-93.525333-16.725333 46.08-38.912 90.112-62.464 133.12z m67.925334-243.370667c14.677333-37.546667 19.114667-83.285333-5.802667-117.418666-7.168 38.912-4.096 79.189333 5.802667 117.418666z m-45.397334-105.130666c4.096-24.917333 35.84-29.696 55.637334-22.186667 12.288 7.850667 18.432 22.869333 18.773333 37.205333 1.365333 44.032-6.485333 87.381333-12.629333 130.730667-3.413333 20.138667 8.874667 38.229333 17.749333 55.296 21.845333 40.277333 52.224 76.458667 92.16 99.669333 48.128-5.802667 98.645333-12.970667 145.749333 2.389334 35.157333 11.946667 26.965333 77.141333-11.264 77.824-53.589333 2.730667-102.058667-23.893333-150.186666-43.349334-66.218667 4.778667-130.730667 24.917333-194.218667 44.032-28.672 46.762667-54.613333 98.986667-101.034667 130.730667-23.210667 18.090667-76.458667 3.072-64.512-32.085333 20.138667-49.152 70.314667-76.117333 114.346667-100.693334 12.629333-6.485333 19.797333-18.773333 26.282667-31.061333 30.037333-57.685333 60.074667-115.370667 84.309333-175.786667-12.629333-56.661333-31.061333-114.688-21.162667-172.714666z"
|
||||
fill="#F90E09" p-id="1554"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1 +1,18 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543300178225" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5733" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M537.372818 38.36489h62.454472v99.134083c117.738246 0.660894 235.60867-1.211639 353.236766 0.550745 25.334266-2.423278 45.172097 17.29339 42.627656 42.627655 1.872533 205.758296-0.440596 411.626741 1.10149 617.506201-1.10149 22.250094 2.20298 46.923466-10.574302 66.640134-16.081751 11.664777-36.999043 10.133706-55.834519 11.014898-110.148981-0.550745-220.297962-0.330447-330.557091-0.330447v110.148981h-68.523681c-167.856032-30.621417-336.06454-58.599258-504.041736-88.119185-0.110149-256.977572 0-513.955144 0-770.822567 169.970892-29.420793 339.93077-59.381316 510.110945-88.350498z" fill="#D24625" p-id="5734"></path><path d="M599.82729 170.543667h363.491636v671.908783h-363.491636v-88.119185h264.357554v-44.059592h-264.357554v-55.074491h264.357554v-44.059592h-264.247405c-0.110149-21.5892-0.110149-43.1784-0.231313-64.767601 43.630011 13.53731 93.307202 13.217878 132.299941-13.008594 42.18706-25.003819 64.216856-72.698327 67.851772-120.271672-48.366417-0.330447-96.710805-0.220298-144.956059-0.220298-0.121164-47.914807 0.550745-95.829613-0.991341-143.634271-18.075448 3.524767-36.128866 7.269833-54.083149 11.125047v-109.818534z" fill="#FFFFFF" p-id="5735"></path><path d="M677.041725 246.216017c76.553542 3.524767 140.880546 67.961921 144.956059 144.295165-48.366417 0.550745-96.710805 0.330447-145.066208 0.330447 0-48.245254-0.121164-96.490507 0.110149-144.625612z" fill="#D24625" p-id="5736"></path><path d="M203.940838 329.378497c59.810897 2.863874 132.288926-23.682031 181.855967 21.148605 47.485226 57.607917 34.917227 163.571236-35.467972 198.047867-25.003819 12.777282-53.642554 11.014898-80.849351 10.133706-0.110149 43.068251-0.220298 86.136503-0.110149 129.19374-21.820513-1.872533-43.74016-3.745065-65.538644-5.507449-0.980326-117.628097-1.211639-235.377357 0.110149-353.016469z" fill="#FFFFFF" p-id="5737"></path><path d="M269.380347 388.969096c21.699349-0.991341 48.575701-4.956704 63.214501 15.420857 12.567999 21.5892 11.89609 50.007637 1.442951 72.257732-12.567999 22.69069-40.986436 20.48771-62.895068 23.131286-2.313129-36.899909-2.092831-73.799817-1.762384-110.809875z" fill="#D24625" p-id="5738"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1543300178225" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="5733" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M537.372818 38.36489h62.454472v99.134083c117.738246 0.660894 235.60867-1.211639 353.236766 0.550745 25.334266-2.423278 45.172097 17.29339 42.627656 42.627655 1.872533 205.758296-0.440596 411.626741 1.10149 617.506201-1.10149 22.250094 2.20298 46.923466-10.574302 66.640134-16.081751 11.664777-36.999043 10.133706-55.834519 11.014898-110.148981-0.550745-220.297962-0.330447-330.557091-0.330447v110.148981h-68.523681c-167.856032-30.621417-336.06454-58.599258-504.041736-88.119185-0.110149-256.977572 0-513.955144 0-770.822567 169.970892-29.420793 339.93077-59.381316 510.110945-88.350498z"
|
||||
fill="#D24625" p-id="5734"></path>
|
||||
<path d="M599.82729 170.543667h363.491636v671.908783h-363.491636v-88.119185h264.357554v-44.059592h-264.357554v-55.074491h264.357554v-44.059592h-264.247405c-0.110149-21.5892-0.110149-43.1784-0.231313-64.767601 43.630011 13.53731 93.307202 13.217878 132.299941-13.008594 42.18706-25.003819 64.216856-72.698327 67.851772-120.271672-48.366417-0.330447-96.710805-0.220298-144.956059-0.220298-0.121164-47.914807 0.550745-95.829613-0.991341-143.634271-18.075448 3.524767-36.128866 7.269833-54.083149 11.125047v-109.818534z"
|
||||
fill="#FFFFFF" p-id="5735"></path>
|
||||
<path d="M677.041725 246.216017c76.553542 3.524767 140.880546 67.961921 144.956059 144.295165-48.366417 0.550745-96.710805 0.330447-145.066208 0.330447 0-48.245254-0.121164-96.490507 0.110149-144.625612z"
|
||||
fill="#D24625" p-id="5736"></path>
|
||||
<path d="M203.940838 329.378497c59.810897 2.863874 132.288926-23.682031 181.855967 21.148605 47.485226 57.607917 34.917227 163.571236-35.467972 198.047867-25.003819 12.777282-53.642554 11.014898-80.849351 10.133706-0.110149 43.068251-0.220298 86.136503-0.110149 129.19374-21.820513-1.872533-43.74016-3.745065-65.538644-5.507449-0.980326-117.628097-1.211639-235.377357 0.110149-353.016469z"
|
||||
fill="#FFFFFF" p-id="5737"></path>
|
||||
<path d="M269.380347 388.969096c21.699349-0.991341 48.575701-4.956704 63.214501 15.420857 12.567999 21.5892 11.89609 50.007637 1.442951 72.257732-12.567999 22.69069-40.986436 20.48771-62.895068 23.131286-2.313129-36.899909-2.092831-73.799817-1.762384-110.809875z"
|
||||
fill="#D24625" p-id="5738"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1 +1,16 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1545064197737" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14227" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M759.725253 0H134.464646v1024h817.131314V191.870707z" fill="#02007A" p-id="14228"></path><path d="M72.40404 708.525253h687.838384v258.585858H72.40404z" fill="#230091" p-id="14229"></path><path d="M82.747475 718.868687h667.151515v237.89899H82.747475zM755.070707 5.171717l191.353535 191.353536h-191.353535z" fill="#FFFFFF" p-id="14230"></path><path d="M506.828283 791.272727v93.090909h25.858586c28.444444 0 41.373737-12.929293 41.373737-45.511111s-12.929293-47.579798-41.373737-47.579798h-25.858586z m-25.858586-25.858586h51.717172c42.408081 0 67.232323 29.99596 67.232323 74.989899S575.612121 910.222222 532.686869 910.222222H480.969697v-144.808081z m-132.39596 104.468687c1.034343 26.375758 22.755556 42.408081 55.337374 42.408081 34.650505 0 55.854545-17.066667 55.854546-43.959596 0-21.20404-12.412121-33.09899-40.856566-39.822222l-16.549495-3.620202c-17.583838-4.137374-24.824242-9.826263-24.824242-19.135354 0-11.894949 10.860606-19.652525 26.892929-19.652525s27.410101 7.757576 28.444444 21.204041h24.307071c-0.517172-24.824242-21.20404-41.890909-52.751515-41.89091S351.676768 782.480808 351.676768 807.822222c0 20.169697 12.412121 33.09899 38.787878 38.787879l18.618182 4.137374c18.10101 4.137374 25.341414 10.343434 25.341414 20.169697 0 11.894949-11.894949 20.169697-28.961616 20.169697s-30.513131-8.791919-32.064646-21.721212l-24.824243 0.517171zM258.585859 788.686869v53.785858h20.686868c18.10101 0 31.030303-9.826263 31.030303-26.892929s-12.412121-26.892929-31.030303-26.892929h-20.686868z m-25.858586-23.272728h56.888889c28.444444 0 46.545455 20.686869 46.545454 49.131314s-17.583838 49.131313-46.545454 49.131313h-31.030303v46.545454h-25.858586v-144.808081z" fill="#230091" p-id="14231"></path><path d="M415.806061 443.216162h-31.030303v137.567676H321.163636V196.525253h93.090909c91.022222 0 140.670707 35.684848 140.670708 122.052525 0.517172 103.434343-92.573737 124.638384-139.119192 124.638384z m-5.688889-192.905051c-6.206061 0-14.99798 0.517172-26.89293 1.551515V387.878788h36.202021C461.834343 387.878788 491.313131 366.157576 491.313131 312.888889c0-40.856566-32.064646-62.577778-81.195959-62.577778z m258.068687 337.19596c70.852525 0 96.711111-50.165657 96.711111-84.816162 0-54.820202-35.684848-67.749495-66.19798-87.40202-25.858586-17.066667-49.648485-23.272727-49.648485-40.856566 0-22.755556 15.515152-27.410101 36.20202-27.410101 25.858586 0 54.820202 2.068687 67.232323 16.032323V306.682828c-12.929293-10.343434-37.236364-13.446465-68.783838-13.446464-67.749495 0-93.608081 44.993939-93.608081 84.29899 0 50.682828 33.616162 65.680808 66.19798 83.781818 21.20404 11.894949 46.545455 20.686869 46.545455 44.476767 0 13.963636-8.791919 27.927273-37.753536 27.927273-26.892929 0-59.991919-10.343434-74.989899-23.789899v59.991919c13.446465 10.343434 40.339394 17.583838 78.09293 17.583839z" fill="#7AB7FF" p-id="14232"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1545064197737" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="14227" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M759.725253 0H134.464646v1024h817.131314V191.870707z" fill="#02007A" p-id="14228"></path>
|
||||
<path d="M72.40404 708.525253h687.838384v258.585858H72.40404z" fill="#230091" p-id="14229"></path>
|
||||
<path d="M82.747475 718.868687h667.151515v237.89899H82.747475zM755.070707 5.171717l191.353535 191.353536h-191.353535z"
|
||||
fill="#FFFFFF" p-id="14230"></path>
|
||||
<path d="M506.828283 791.272727v93.090909h25.858586c28.444444 0 41.373737-12.929293 41.373737-45.511111s-12.929293-47.579798-41.373737-47.579798h-25.858586z m-25.858586-25.858586h51.717172c42.408081 0 67.232323 29.99596 67.232323 74.989899S575.612121 910.222222 532.686869 910.222222H480.969697v-144.808081z m-132.39596 104.468687c1.034343 26.375758 22.755556 42.408081 55.337374 42.408081 34.650505 0 55.854545-17.066667 55.854546-43.959596 0-21.20404-12.412121-33.09899-40.856566-39.822222l-16.549495-3.620202c-17.583838-4.137374-24.824242-9.826263-24.824242-19.135354 0-11.894949 10.860606-19.652525 26.892929-19.652525s27.410101 7.757576 28.444444 21.204041h24.307071c-0.517172-24.824242-21.20404-41.890909-52.751515-41.89091S351.676768 782.480808 351.676768 807.822222c0 20.169697 12.412121 33.09899 38.787878 38.787879l18.618182 4.137374c18.10101 4.137374 25.341414 10.343434 25.341414 20.169697 0 11.894949-11.894949 20.169697-28.961616 20.169697s-30.513131-8.791919-32.064646-21.721212l-24.824243 0.517171zM258.585859 788.686869v53.785858h20.686868c18.10101 0 31.030303-9.826263 31.030303-26.892929s-12.412121-26.892929-31.030303-26.892929h-20.686868z m-25.858586-23.272728h56.888889c28.444444 0 46.545455 20.686869 46.545454 49.131314s-17.583838 49.131313-46.545454 49.131313h-31.030303v46.545454h-25.858586v-144.808081z"
|
||||
fill="#230091" p-id="14231"></path>
|
||||
<path d="M415.806061 443.216162h-31.030303v137.567676H321.163636V196.525253h93.090909c91.022222 0 140.670707 35.684848 140.670708 122.052525 0.517172 103.434343-92.573737 124.638384-139.119192 124.638384z m-5.688889-192.905051c-6.206061 0-14.99798 0.517172-26.89293 1.551515V387.878788h36.202021C461.834343 387.878788 491.313131 366.157576 491.313131 312.888889c0-40.856566-32.064646-62.577778-81.195959-62.577778z m258.068687 337.19596c70.852525 0 96.711111-50.165657 96.711111-84.816162 0-54.820202-35.684848-67.749495-66.19798-87.40202-25.858586-17.066667-49.648485-23.272727-49.648485-40.856566 0-22.755556 15.515152-27.410101 36.20202-27.410101 25.858586 0 54.820202 2.068687 67.232323 16.032323V306.682828c-12.929293-10.343434-37.236364-13.446465-68.783838-13.446464-67.749495 0-93.608081 44.993939-93.608081 84.29899 0 50.682828 33.616162 65.680808 66.19798 83.781818 21.20404 11.894949 46.545455 20.686869 46.545455 44.476767 0 13.963636-8.791919 27.927273-37.753536 27.927273-26.892929 0-59.991919-10.343434-74.989899-23.789899v59.991919c13.446465 10.343434 40.339394 17.583838 78.09293 17.583839z"
|
||||
fill="#7AB7FF" p-id="14232"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1 +1,10 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189544355" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8186" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M176 1024l672 0c26.464 0 48-21.536 48-48l0-672c0-0.544-0.256-0.992-0.288-1.504-0.064-0.736-0.256-1.376-0.416-2.08-0.544-2.272-1.472-4.32-2.88-6.112-0.224-0.288-0.192-0.64-0.416-0.928l-256-288c-0.096-0.096-0.224-0.096-0.32-0.192-1.92-2.048-4.352-3.456-7.136-4.288-0.608-0.192-1.152-0.256-1.792-0.352-0.928-0.16-1.792-0.544-2.752-0.544l-448 0c-26.464 0-48 21.536-48 48l0 928c0 26.464 21.536 48 48 48zM640 58.08l204.384 229.92-188.384 0c-7.04 0-16-13.44-16-24l0-205.92zM160 48c0-8.832 7.2-16 16-16l432 0 0 232c0 25.888 20.96 56 48 56l208 0 0 656c0 8.832-7.2 16-16 16l-672 0c-8.96 0-16-7.04-16-16l0-928zM304 448l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 576l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 320l192 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-192 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 704l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 832l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16z" p-id="8187"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189544355" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="8186" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M176 1024l672 0c26.464 0 48-21.536 48-48l0-672c0-0.544-0.256-0.992-0.288-1.504-0.064-0.736-0.256-1.376-0.416-2.08-0.544-2.272-1.472-4.32-2.88-6.112-0.224-0.288-0.192-0.64-0.416-0.928l-256-288c-0.096-0.096-0.224-0.096-0.32-0.192-1.92-2.048-4.352-3.456-7.136-4.288-0.608-0.192-1.152-0.256-1.792-0.352-0.928-0.16-1.792-0.544-2.752-0.544l-448 0c-26.464 0-48 21.536-48 48l0 928c0 26.464 21.536 48 48 48zM640 58.08l204.384 229.92-188.384 0c-7.04 0-16-13.44-16-24l0-205.92zM160 48c0-8.832 7.2-16 16-16l432 0 0 232c0 25.888 20.96 56 48 56l208 0 0 656c0 8.832-7.2 16-16 16l-672 0c-8.96 0-16-7.04-16-16l0-928zM304 448l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 576l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 320l192 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-192 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 704l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16zM304 832l416 0c8.832 0 16-7.168 16-16s-7.168-16-16-16l-416 0c-8.832 0-16 7.168-16 16s7.168 16 16 16z"
|
||||
p-id="8187"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1 +1,23 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1514189554639" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8871" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M80 34.4h864v960H80z" fill="#8095FF" p-id="8872"></path><path d="M176 112m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8873"></path><path d="M176 272m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8874"></path><path d="M176 432m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8875"></path><path d="M176 592m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8876"></path><path d="M176 752m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8877"></path><path d="M176 912m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8878"></path><path d="M864 112m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8879"></path><path d="M864 272m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8880"></path><path d="M864 432m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8881"></path><path d="M864 592m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8882"></path><path d="M864 752m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8883"></path><path d="M864 912m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8884"></path><path d="M648 508L436 362.4c-4.8-3.2-11.2-4-16.8-0.8-5.6 3.2-8.8 8.8-8.8 14.4v290.4c0 5.6 3.2 11.2 8.8 14.4 5.6 3.2 12 2.4 16.8-0.8L648 533.6c4.8-2.4 7.2-8 7.2-12.8 0-4.8-3.2-9.6-7.2-12.8z" fill="#FFFFFF" p-id="8885"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1514189554639" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="8871" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M80 34.4h864v960H80z" fill="#8095FF" p-id="8872"></path>
|
||||
<path d="M176 112m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8873"></path>
|
||||
<path d="M176 272m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8874"></path>
|
||||
<path d="M176 432m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8875"></path>
|
||||
<path d="M176 592m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8876"></path>
|
||||
<path d="M176 752m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8877"></path>
|
||||
<path d="M176 912m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8878"></path>
|
||||
<path d="M864 112m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8879"></path>
|
||||
<path d="M864 272m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8880"></path>
|
||||
<path d="M864 432m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8881"></path>
|
||||
<path d="M864 592m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8882"></path>
|
||||
<path d="M864 752m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8883"></path>
|
||||
<path d="M864 912m-40 0a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" fill="#FFFFFF" p-id="8884"></path>
|
||||
<path d="M648 508L436 362.4c-4.8-3.2-11.2-4-16.8-0.8-5.6 3.2-8.8 8.8-8.8 14.4v290.4c0 5.6 3.2 11.2 8.8 14.4 5.6 3.2 12 2.4 16.8-0.8L648 533.6c4.8-2.4 7.2-8 7.2-12.8 0-4.8-3.2-9.6-7.2-12.8z"
|
||||
fill="#FFFFFF" p-id="8885"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -1 +1,17 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1543300142282" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2233" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M534.310676 38.36489h65.428495v88.119185c110.25913 0 220.507245 0.220298 330.766374-0.330447 18.615178 0.771043 39.113903-0.550745 55.305803 10.574302 11.345345 16.302049 10.023557 37.010058 10.783586 55.746399-0.550745 191.218631-0.319432 382.327112-0.220298 573.435594-0.550745 32.053353 2.974022 64.767601-3.745066 96.380358-4.405959 22.910988-31.943204 23.461733-50.338084 24.232776-114.114344 0.330447-228.338837-0.220298-342.56333 0v99.134083h-68.402517c-167.867047-30.511268-336.075555-58.709407-504.151885-88.119185v-770.932716c169.0897-29.420793 338.168386-58.389975 507.136922-88.240349z" fill="#207245" p-id="2234"></path><path d="M599.739171 159.528769h363.491636v693.938579h-363.491636v-66.089389h88.119184v-77.104286h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-66.089388z" fill="#FFFFFF" p-id="2235"></path><path d="M731.917948 225.618157h154.208573v77.104287h-154.208573v-77.104287z" fill="#207245" p-id="2236"></path><path d="M353.44605 328.827752c24.89367-1.762384 49.897488-3.304469 74.901307-4.516108-29.409778 60.251492-58.929705 120.502985-88.879213 180.53418 30.29097 61.683429 61.242833 122.926263 91.632937 184.609692-26.545904-1.553101-52.98166-3.19432-79.527564-5.066854-18.725327-45.932125-41.526166-90.322164-54.964342-138.358134-14.969246 44.731501-36.349164 86.918561-53.521389 130.74684-24.122627-0.330447-48.256268-1.321788-72.367881-2.313129 28.308288-55.404937 55.625235-111.250471 84.814716-166.324961-24.783521-56.726725-52.001334-112.35196-77.544883-168.748238 24.232776-1.431937 48.454537-2.863874 72.698327-4.185662 16.412198 43.068251 34.366482 85.585758 47.925822 129.7555 14.506621-46.802302 36.216985-90.861894 54.832163-136.133126z" fill="#FFFFFF" p-id="2237"></path><path d="M731.917948 346.782036h154.208573v77.104287h-154.208573v-77.104287zM731.917948 467.945915h154.208573v77.104287h-154.208573v-77.104287zM731.917948 589.109794h154.208573v77.104287h-154.208573v-77.104287zM731.917948 710.273673h154.208573v77.104286h-154.208573v-77.104286z" fill="#207245" p-id="2238"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1543300142282" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="2233" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M534.310676 38.36489h65.428495v88.119185c110.25913 0 220.507245 0.220298 330.766374-0.330447 18.615178 0.771043 39.113903-0.550745 55.305803 10.574302 11.345345 16.302049 10.023557 37.010058 10.783586 55.746399-0.550745 191.218631-0.319432 382.327112-0.220298 573.435594-0.550745 32.053353 2.974022 64.767601-3.745066 96.380358-4.405959 22.910988-31.943204 23.461733-50.338084 24.232776-114.114344 0.330447-228.338837-0.220298-342.56333 0v99.134083h-68.402517c-167.867047-30.511268-336.075555-58.709407-504.151885-88.119185v-770.932716c169.0897-29.420793 338.168386-58.389975 507.136922-88.240349z"
|
||||
fill="#207245" p-id="2234"></path>
|
||||
<path d="M599.739171 159.528769h363.491636v693.938579h-363.491636v-66.089389h88.119184v-77.104286h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-44.059592h88.119184v-77.104287h-88.119184v-66.089388z"
|
||||
fill="#FFFFFF" p-id="2235"></path>
|
||||
<path d="M731.917948 225.618157h154.208573v77.104287h-154.208573v-77.104287z" fill="#207245" p-id="2236"></path>
|
||||
<path d="M353.44605 328.827752c24.89367-1.762384 49.897488-3.304469 74.901307-4.516108-29.409778 60.251492-58.929705 120.502985-88.879213 180.53418 30.29097 61.683429 61.242833 122.926263 91.632937 184.609692-26.545904-1.553101-52.98166-3.19432-79.527564-5.066854-18.725327-45.932125-41.526166-90.322164-54.964342-138.358134-14.969246 44.731501-36.349164 86.918561-53.521389 130.74684-24.122627-0.330447-48.256268-1.321788-72.367881-2.313129 28.308288-55.404937 55.625235-111.250471 84.814716-166.324961-24.783521-56.726725-52.001334-112.35196-77.544883-168.748238 24.232776-1.431937 48.454537-2.863874 72.698327-4.185662 16.412198 43.068251 34.366482 85.585758 47.925822 129.7555 14.506621-46.802302 36.216985-90.861894 54.832163-136.133126z"
|
||||
fill="#FFFFFF" p-id="2237"></path>
|
||||
<path d="M731.917948 346.782036h154.208573v77.104287h-154.208573v-77.104287zM731.917948 467.945915h154.208573v77.104287h-154.208573v-77.104287zM731.917948 589.109794h154.208573v77.104287h-154.208573v-77.104287zM731.917948 710.273673h154.208573v77.104286h-154.208573v-77.104286z"
|
||||
fill="#207245" p-id="2238"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -1 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544085034574" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1828" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M0 512A512 512 0 1 0 512 0 512 512 0 0 0 0 512" fill="#36D49F" p-id="1829"></path><path d="M450.37037 552.580741l-115.105185-87.798519-50.820741 39.822222L483.365926 701.62963C517.499259 616.296296 625.777778 449.232593 758.518519 330.714074L746.382222 303.407407a1264.071111 1264.071111 0 0 0-296.011852 249.173334" fill="#FFFFFF" p-id="1830"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1544085034574" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1828" width="200" height="200">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M0 512A512 512 0 1 0 512 0 512 512 0 0 0 0 512" fill="#36D49F" p-id="1829"></path>
|
||||
<path d="M450.37037 552.580741l-115.105185-87.798519-50.820741 39.822222L483.365926 701.62963C517.499259 616.296296 625.777778 449.232593 758.518519 330.714074L746.382222 303.407407a1264.071111 1264.071111 0 0 0-296.011852 249.173334"
|
||||
fill="#FFFFFF" p-id="1830"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 743 B After Width: | Height: | Size: 755 B |
@@ -6,32 +6,32 @@ import React from 'react';
|
||||
*/
|
||||
export default class TankComponent<P, S> extends React.Component <P, S> {
|
||||
|
||||
//是否处于挂载的状态。
|
||||
mounted: boolean = false
|
||||
//是否处于挂载的状态。
|
||||
mounted: boolean = false
|
||||
|
||||
componentWillUnmount() {
|
||||
let that = this
|
||||
that.mounted = false
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let that = this
|
||||
that.mounted = true
|
||||
}
|
||||
|
||||
//更新当前视图。
|
||||
updateUI() {
|
||||
let that = this
|
||||
if (that.mounted) {
|
||||
that.setState({})
|
||||
} else {
|
||||
console.info(this.constructor.name + "已经脱离挂载,不再刷新视图。")
|
||||
componentWillUnmount() {
|
||||
let that = this
|
||||
that.mounted = false
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前组件的唯一标识
|
||||
getIdentifier() {
|
||||
return this.constructor.name;
|
||||
}
|
||||
componentWillMount() {
|
||||
let that = this
|
||||
that.mounted = true
|
||||
}
|
||||
|
||||
//更新当前视图。
|
||||
updateUI() {
|
||||
let that = this
|
||||
if (that.mounted) {
|
||||
that.setState({})
|
||||
} else {
|
||||
console.info(this.constructor.name + "已经脱离挂载,不再刷新视图。")
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前组件的唯一标识
|
||||
getIdentifier() {
|
||||
return this.constructor.name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,23 +2,23 @@ import {ToolItem} from "../types";
|
||||
import React from "react";
|
||||
|
||||
export default class MenuItem implements ToolItem {
|
||||
name: string;
|
||||
url: string;
|
||||
icon: React.ReactNode;
|
||||
active: boolean = false;
|
||||
name: string;
|
||||
url: string;
|
||||
icon: React.ReactNode;
|
||||
active: boolean = false;
|
||||
|
||||
|
||||
constructor(name: string, url: string, icon: React.ReactNode) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
this.icon = icon;
|
||||
constructor(name: string, url: string, icon: React.ReactNode) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
this.icon = icon;
|
||||
|
||||
//当前的url完全一致,那么就高亮显示
|
||||
if (url == "/user/login") {
|
||||
this.active = window.location.pathname === url || window.location.pathname === "/user/register"
|
||||
} else {
|
||||
this.active = window.location.pathname === url
|
||||
}
|
||||
|
||||
//当前的url完全一致,那么就高亮显示
|
||||
if (url == "/user/login") {
|
||||
this.active = window.location.pathname === url || window.location.pathname === "/user/register"
|
||||
} else {
|
||||
this.active = window.location.pathname === url
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import User from '../model/user/User';
|
||||
import {UserRole} from '../model/user/UserRole';
|
||||
import Sun from '../../common/model/global/Sun';
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
DashboardOutlined,
|
||||
PoweroffOutlined,
|
||||
SettingOutlined,
|
||||
ShareAltOutlined,
|
||||
TeamOutlined,
|
||||
DeleteOutlined
|
||||
AppstoreOutlined,
|
||||
DashboardOutlined,
|
||||
DeleteOutlined,
|
||||
PoweroffOutlined,
|
||||
SettingOutlined,
|
||||
ShareAltOutlined,
|
||||
TeamOutlined
|
||||
} from '@ant-design/icons';
|
||||
import {LoginOutlined} from "@ant-design/icons/lib";
|
||||
import Preference from "../model/preference/Preference";
|
||||
@@ -23,79 +23,80 @@ import Lang from "../model/global/Lang";
|
||||
|
||||
export default class MenuManager {
|
||||
|
||||
//单例模式
|
||||
private static singleton: MenuManager;
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
static getSingleton(): MenuManager {
|
||||
if (!MenuManager.singleton) {
|
||||
//初始化一个mainLand.
|
||||
MenuManager.singleton = new MenuManager();
|
||||
|
||||
}
|
||||
return MenuManager.singleton;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到当前高亮的菜单
|
||||
*/
|
||||
getSelectedKeys(): string[] {
|
||||
|
||||
let keys: string[] = this.getMenuItems()
|
||||
.filter((menuItem: MenuItem, index: number) => {
|
||||
return menuItem.active;
|
||||
}).map((menuItem: MenuItem, index: number) => {
|
||||
return menuItem.url;
|
||||
});
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高亮某个菜单
|
||||
*/
|
||||
selectMenu(url: string) {
|
||||
|
||||
this.getMenuItems().forEach((menuItem: MenuItem, index: number) => {
|
||||
menuItem.active = menuItem.url === url;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
getMenuItems(): MenuItem[] {
|
||||
let user: User = Moon.getSingleton().user;
|
||||
let preference: Preference = Moon.getSingleton().preference;
|
||||
|
||||
let menuItems: MenuItem[] = [];
|
||||
|
||||
if (!preference.installed) {
|
||||
menuItems = [
|
||||
new MenuItem(Lang.t("layout.install"), '/install/index', <SettingOutlined/>),
|
||||
];
|
||||
} else if (user.role === UserRole.GUEST) {
|
||||
menuItems = [
|
||||
new MenuItem(Lang.t("user.login"), '/user/login', <LoginOutlined/>),
|
||||
];
|
||||
} else {
|
||||
menuItems.push(new MenuItem(Lang.t("layout.allFiles"), '/matter/list', <AppstoreOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.myShare"), '/share/list', <ShareAltOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.bin"), '/bin/list', <DeleteOutlined />))
|
||||
|
||||
if (user.role === UserRole.ADMINISTRATOR) {
|
||||
menuItems.push(new MenuItem(Lang.t("layout.setting"), '/preference/index', <SettingOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.dashboard"), '/dashboard/index', <DashboardOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.users"), `${Sun.getSingleton().isMobile ? '/mobile': ''}/user/list`, <TeamOutlined/>))
|
||||
}
|
||||
menuItems.push(new MenuItem(Lang.t("layout.logout"), '/user/logout', <PoweroffOutlined/>))
|
||||
//单例模式
|
||||
private static singleton: MenuManager;
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
return menuItems;
|
||||
static getSingleton(): MenuManager {
|
||||
if (!MenuManager.singleton) {
|
||||
//初始化一个mainLand.
|
||||
MenuManager.singleton = new MenuManager();
|
||||
|
||||
}
|
||||
}
|
||||
return MenuManager.singleton;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到当前高亮的菜单
|
||||
*/
|
||||
getSelectedKeys(): string[] {
|
||||
|
||||
let keys: string[] = this.getMenuItems()
|
||||
.filter((menuItem: MenuItem, index: number) => {
|
||||
return menuItem.active;
|
||||
}).map((menuItem: MenuItem, index: number) => {
|
||||
return menuItem.url;
|
||||
});
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高亮某个菜单
|
||||
*/
|
||||
selectMenu(url: string) {
|
||||
|
||||
this.getMenuItems().forEach((menuItem: MenuItem, index: number) => {
|
||||
menuItem.active = menuItem.url === url;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
getMenuItems(): MenuItem[] {
|
||||
let user: User = Moon.getSingleton().user;
|
||||
let preference: Preference = Moon.getSingleton().preference;
|
||||
|
||||
let menuItems: MenuItem[] = [];
|
||||
|
||||
if (!preference.installed) {
|
||||
menuItems = [
|
||||
new MenuItem(Lang.t("layout.install"), '/install/index', <SettingOutlined/>),
|
||||
];
|
||||
} else if (user.role === UserRole.GUEST) {
|
||||
menuItems = [
|
||||
new MenuItem(Lang.t("user.login"), '/user/login', <LoginOutlined/>),
|
||||
];
|
||||
} else {
|
||||
menuItems.push(new MenuItem(Lang.t("layout.allFiles"), '/matter/list', <AppstoreOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.myShare"), '/share/list', <ShareAltOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.bin"), '/bin/list', <DeleteOutlined/>))
|
||||
|
||||
if (user.role === UserRole.ADMINISTRATOR) {
|
||||
menuItems.push(new MenuItem(Lang.t("layout.setting"), '/preference/index', <SettingOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.dashboard"), '/dashboard/index', <DashboardOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.users"), `${Sun.getSingleton().isMobile ? '/mobile' : ''}/user/list`,
|
||||
<TeamOutlined/>))
|
||||
}
|
||||
menuItems.push(new MenuItem(Lang.t("layout.logout"), '/user/logout', <PoweroffOutlined/>))
|
||||
|
||||
|
||||
}
|
||||
|
||||
return menuItems;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,137 +9,137 @@ import DateUtil from "../../util/DateUtil";
|
||||
*/
|
||||
export default class Base {
|
||||
|
||||
//id自增长值
|
||||
private static AUTO_INCREMENT_ID = 0
|
||||
//id自增长值
|
||||
private static AUTO_INCREMENT_ID = 0
|
||||
|
||||
//当前对象的ID,这个字段让我们可以很轻松的统计出共创建了多少个实体类。
|
||||
autoId: number = 0
|
||||
//当前对象的ID,这个字段让我们可以很轻松的统计出共创建了多少个实体类。
|
||||
autoId: number = 0
|
||||
|
||||
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor() {
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor() {
|
||||
|
||||
this.autoId = Base.generateAutoId()
|
||||
}
|
||||
|
||||
static generateAutoId() {
|
||||
Base.AUTO_INCREMENT_ID++
|
||||
return Base.AUTO_INCREMENT_ID
|
||||
}
|
||||
|
||||
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
ObjectUtil.extend(this, obj)
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param field 字段名
|
||||
* @param Clazz 类型名
|
||||
*/
|
||||
assignList<F extends keyof this>(field: string, Clazz: any) {
|
||||
|
||||
ObjectUtil.assignList(this, field, Clazz)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据一个类型,渲染出对应的数组。
|
||||
* @param json 字符串或者数组对象。
|
||||
* @param Clazz 需要渲染的目标对象
|
||||
* @returns {*}
|
||||
*/
|
||||
static renderList(json: any, Clazz: any) {
|
||||
|
||||
let target: any = []
|
||||
|
||||
|
||||
let arr: any = []
|
||||
|
||||
if (json instanceof String || typeof json === "string") {
|
||||
|
||||
arr = JsonUtil.parseList(json)
|
||||
|
||||
} else if (json instanceof Array) {
|
||||
arr = json
|
||||
} else {
|
||||
|
||||
console.error("源必须为字符或者数组", json, typeof json)
|
||||
return target
|
||||
this.autoId = Base.generateAutoId()
|
||||
}
|
||||
|
||||
//如果我们要转换成字符串的数组形式,那么this[field]应该是一个字符串才对。
|
||||
if (Clazz === String) {
|
||||
return arr
|
||||
static generateAutoId() {
|
||||
Base.AUTO_INCREMENT_ID++
|
||||
return Base.AUTO_INCREMENT_ID
|
||||
}
|
||||
|
||||
if (!Clazz || !(Clazz.prototype instanceof Base)) {
|
||||
console.error("指定的类型必须是 Base的子类 ")
|
||||
return target
|
||||
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
ObjectUtil.extend(this, obj)
|
||||
}
|
||||
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
let bean = arr[i]
|
||||
/**
|
||||
*
|
||||
* @param field 字段名
|
||||
* @param Clazz 类型名
|
||||
*/
|
||||
assignList<F extends keyof this>(field: string, Clazz: any) {
|
||||
|
||||
let clazz = new Clazz()
|
||||
|
||||
clazz.assign(bean)
|
||||
|
||||
target.push(clazz)
|
||||
ObjectUtil.assignList(this, field, Clazz)
|
||||
}
|
||||
|
||||
return target
|
||||
}
|
||||
|
||||
//直接render出一个Entity. field字段名,Clazz类名。
|
||||
assignEntity(field: any, Clazz: any) {
|
||||
/**
|
||||
* 根据一个类型,渲染出对应的数组。
|
||||
* @param json 字符串或者数组对象。
|
||||
* @param Clazz 需要渲染的目标对象
|
||||
* @returns {*}
|
||||
*/
|
||||
static renderList(json: any, Clazz: any) {
|
||||
|
||||
let thisObj: any = this
|
||||
|
||||
let obj: any = thisObj[field]
|
||||
if (!obj) {
|
||||
if (Clazz) {
|
||||
let EntityClazz: any = this.constructor
|
||||
obj = (new EntityClazz())[field]
|
||||
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (Clazz === Date) {
|
||||
|
||||
thisObj[field] = DateUtil.str2Date(obj)
|
||||
|
||||
} else if (Clazz.prototype instanceof Base) {
|
||||
|
||||
//可能此处的该项属性做了特殊处理的。
|
||||
//1024*1024 以及 "图片尺寸不超过1M"用let bean = new Clazz(); 就无法反映出来。因为父类assign的时候已经将avatar给变成了Object.
|
||||
let bean = (new thisObj.constructor())[field]
|
||||
if (!bean) {
|
||||
bean = new Clazz()
|
||||
}
|
||||
let target: any = []
|
||||
|
||||
|
||||
if (typeof obj === "string") {
|
||||
try {
|
||||
obj = JSON.parse(obj)
|
||||
} catch (e) {
|
||||
console.error("JSON parse obj error", e)
|
||||
let arr: any = []
|
||||
|
||||
if (json instanceof String || typeof json === "string") {
|
||||
|
||||
arr = JsonUtil.parseList(json)
|
||||
|
||||
} else if (json instanceof Array) {
|
||||
arr = json
|
||||
} else {
|
||||
|
||||
console.error("源必须为字符或者数组", json, typeof json)
|
||||
return target
|
||||
}
|
||||
}
|
||||
|
||||
if (obj !== null) {
|
||||
bean.assign(obj)
|
||||
thisObj[field] = bean
|
||||
}
|
||||
//如果我们要转换成字符串的数组形式,那么this[field]应该是一个字符串才对。
|
||||
if (Clazz === String) {
|
||||
return arr
|
||||
}
|
||||
|
||||
} else {
|
||||
console.error('调用错误!')
|
||||
if (!Clazz || !(Clazz.prototype instanceof Base)) {
|
||||
console.error("指定的类型必须是 Base的子类 ")
|
||||
return target
|
||||
}
|
||||
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
let bean = arr[i]
|
||||
|
||||
let clazz = new Clazz()
|
||||
|
||||
clazz.assign(bean)
|
||||
|
||||
target.push(clazz)
|
||||
}
|
||||
|
||||
return target
|
||||
}
|
||||
|
||||
}
|
||||
//直接render出一个Entity. field字段名,Clazz类名。
|
||||
assignEntity(field: any, Clazz: any) {
|
||||
|
||||
let thisObj: any = this
|
||||
|
||||
let obj: any = thisObj[field]
|
||||
if (!obj) {
|
||||
if (Clazz) {
|
||||
let EntityClazz: any = this.constructor
|
||||
obj = (new EntityClazz())[field]
|
||||
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (Clazz === Date) {
|
||||
|
||||
thisObj[field] = DateUtil.str2Date(obj)
|
||||
|
||||
} else if (Clazz.prototype instanceof Base) {
|
||||
|
||||
//可能此处的该项属性做了特殊处理的。
|
||||
//1024*1024 以及 "图片尺寸不超过1M"用let bean = new Clazz(); 就无法反映出来。因为父类assign的时候已经将avatar给变成了Object.
|
||||
let bean = (new thisObj.constructor())[field]
|
||||
if (!bean) {
|
||||
bean = new Clazz()
|
||||
}
|
||||
|
||||
|
||||
if (typeof obj === "string") {
|
||||
try {
|
||||
obj = JSON.parse(obj)
|
||||
} catch (e) {
|
||||
console.error("JSON parse obj error", e)
|
||||
}
|
||||
}
|
||||
|
||||
if (obj !== null) {
|
||||
bean.assign(obj)
|
||||
thisObj[field] = bean
|
||||
}
|
||||
|
||||
} else {
|
||||
console.error('调用错误!')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,213 +11,213 @@ import HttpBase from './HttpBase';
|
||||
*/
|
||||
export default class BaseEntity extends HttpBase {
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
uuid: string | null = null;
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
uuid: string | null = null;
|
||||
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
sort: number = 0;
|
||||
/**
|
||||
* 排序值
|
||||
*/
|
||||
sort: number = 0;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: Date | null = null;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: Date | null = null;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
updateTime: Date | null = null;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
updateTime: Date | null = null;
|
||||
|
||||
|
||||
//************ 前端辅助字段 ****************/
|
||||
//加载详情的指示
|
||||
detailLoading: boolean = false;
|
||||
//************ 前端辅助字段 ****************/
|
||||
//加载详情的指示
|
||||
detailLoading: boolean = false;
|
||||
|
||||
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor(reactComponent?: React.Component | null) {
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor(reactComponent?: React.Component | null) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
}
|
||||
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignEntity('createTime', Date);
|
||||
this.assignEntity('updateTime', Date);
|
||||
|
||||
}
|
||||
|
||||
//获取过滤器,必须每次动态生成,否则会造成filter逻辑混乱。
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
new SortFilter('修改时间排序', 'orderCreateTime'),
|
||||
new SortFilter('创建时间排序', 'orderUpdateTime'),
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
//提交之前对自己进行验证。返回错误信息,null表示没有错误。
|
||||
validate(): any {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
//提交的表单
|
||||
getForm(): any {
|
||||
console.error('getForm: you should override this base method.');
|
||||
}
|
||||
|
||||
//获取到当前类的单数标签。比如 Project便得到 project
|
||||
getTAG(): string {
|
||||
|
||||
let className = this.constructor.name;
|
||||
|
||||
//IE无法直接通过this.constructor.name获取到相应名称
|
||||
if (!className) {
|
||||
className = StringUtil.functionName(this.constructor);
|
||||
}
|
||||
|
||||
return StringUtil.lowerCamel(className);
|
||||
}
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignEntity('createTime', Date);
|
||||
this.assignEntity('updateTime', Date);
|
||||
|
||||
}
|
||||
|
||||
//获取过滤器,必须每次动态生成,否则会造成filter逻辑混乱。
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
new SortFilter('修改时间排序', 'orderCreateTime'),
|
||||
new SortFilter('创建时间排序', 'orderUpdateTime'),
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
//获取到当前实体的url前缀。比如Notification获取到 /api/fs/notification
|
||||
getUrlPrefix(): string {
|
||||
return '/api' + StringUtil.lowerSlash(this.getTAG());
|
||||
}
|
||||
//提交之前对自己进行验证。返回错误信息,null表示没有错误。
|
||||
validate(): any {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
getUrlCreate(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
//提交的表单
|
||||
getForm(): any {
|
||||
console.error('getForm: you should override this base method.');
|
||||
}
|
||||
|
||||
return prefix + '/create';
|
||||
}
|
||||
//获取到当前类的单数标签。比如 Project便得到 project
|
||||
getTAG(): string {
|
||||
|
||||
getUrlDel(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
let className = this.constructor.name;
|
||||
|
||||
return prefix + '/delete';
|
||||
//IE无法直接通过this.constructor.name获取到相应名称
|
||||
if (!className) {
|
||||
className = StringUtil.functionName(this.constructor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getUrlEdit(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/edit';
|
||||
}
|
||||
|
||||
getUrlDetail(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/detail';
|
||||
}
|
||||
|
||||
getUrlList(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/page';
|
||||
}
|
||||
|
||||
getUrlSort(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/sort';
|
||||
}
|
||||
|
||||
|
||||
//新增或者修改
|
||||
httpSave(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let url = this.getUrlCreate();
|
||||
if (this.uuid) {
|
||||
url = this.getUrlEdit();
|
||||
return StringUtil.lowerCamel(className);
|
||||
}
|
||||
|
||||
|
||||
this.errorMessage = this.validate();
|
||||
if (this.errorMessage) {
|
||||
that.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
return;
|
||||
//获取到当前实体的url前缀。比如Notification获取到 /api/fs/notification
|
||||
getUrlPrefix(): string {
|
||||
return '/api' + StringUtil.lowerSlash(this.getTAG());
|
||||
}
|
||||
|
||||
this.httpPost(url, this.getForm(), function(response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
getUrlCreate(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finallyCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//common http detail methods.
|
||||
httpDetail(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (!this.uuid) {
|
||||
|
||||
this.errorMessage = 'uuid未指定,无法获取到详情!';
|
||||
|
||||
this.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
|
||||
return;
|
||||
return prefix + '/create';
|
||||
}
|
||||
|
||||
let url = this.getUrlDetail() + '?uuid=' + this.uuid;
|
||||
getUrlDel(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
this.detailLoading = true;
|
||||
return prefix + '/delete';
|
||||
|
||||
this.httpGet(url, {}, function(response: any) {
|
||||
that.detailLoading = false;
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, function(response: any) {
|
||||
|
||||
that.detailLoading = false;
|
||||
|
||||
if (typeof errorCallback === 'function') {
|
||||
errorCallback(that.getErrorMessage(response), response);
|
||||
} else {
|
||||
//没有传入错误处理的方法就采用默认处理方法:toast弹出该错误信息。
|
||||
that.defaultErrorHandler(response);
|
||||
}
|
||||
}, finallyCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
httpDel(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (!this.uuid) {
|
||||
|
||||
this.errorMessage = '没有id,无法删除!';
|
||||
that.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let url = this.getUrlDel() + '?uuid=' + this.uuid;
|
||||
getUrlEdit(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
this.httpPost(url, {}, function(response: any) {
|
||||
return prefix + '/edit';
|
||||
}
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
getUrlDetail(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
}, errorCallback, finallyCallback);
|
||||
return prefix + '/detail';
|
||||
}
|
||||
|
||||
}
|
||||
getUrlList(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/page';
|
||||
}
|
||||
|
||||
getUrlSort(): string {
|
||||
let prefix = this.getUrlPrefix();
|
||||
|
||||
return prefix + '/sort';
|
||||
}
|
||||
|
||||
|
||||
//新增或者修改
|
||||
httpSave(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let url = this.getUrlCreate();
|
||||
if (this.uuid) {
|
||||
url = this.getUrlEdit();
|
||||
}
|
||||
|
||||
|
||||
this.errorMessage = this.validate();
|
||||
if (this.errorMessage) {
|
||||
that.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
this.httpPost(url, this.getForm(), function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finallyCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//common http detail methods.
|
||||
httpDetail(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (!this.uuid) {
|
||||
|
||||
this.errorMessage = 'uuid未指定,无法获取到详情!';
|
||||
|
||||
this.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let url = this.getUrlDetail() + '?uuid=' + this.uuid;
|
||||
|
||||
this.detailLoading = true;
|
||||
|
||||
this.httpGet(url, {}, function (response: any) {
|
||||
that.detailLoading = false;
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, function (response: any) {
|
||||
|
||||
that.detailLoading = false;
|
||||
|
||||
if (typeof errorCallback === 'function') {
|
||||
errorCallback(that.getErrorMessage(response), response);
|
||||
} else {
|
||||
//没有传入错误处理的方法就采用默认处理方法:toast弹出该错误信息。
|
||||
that.defaultErrorHandler(response);
|
||||
}
|
||||
}, finallyCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
httpDel(successCallback?: any, errorCallback?: any, finallyCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (!this.uuid) {
|
||||
|
||||
this.errorMessage = '没有id,无法删除!';
|
||||
that.defaultErrorHandler(this.errorMessage, errorCallback);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let url = this.getUrlDel() + '?uuid=' + this.uuid;
|
||||
|
||||
this.httpPost(url, {}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finallyCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,275 +13,275 @@ import MessageBoxUtil from "../../util/MessageBoxUtil";
|
||||
*/
|
||||
export default class HttpBase extends ViewBase {
|
||||
|
||||
static lastLoginErrorTimestamp = 0
|
||||
static lastLoginErrorTimestamp = 0
|
||||
|
||||
//是否需要自动刷新State
|
||||
needReactComponentUpdate: boolean = true
|
||||
//是否需要自动刷新State
|
||||
needReactComponentUpdate: boolean = true
|
||||
|
||||
//当前是否正在进行http请求
|
||||
loading: boolean = false
|
||||
//当前是否正在进行http请求
|
||||
loading: boolean = false
|
||||
|
||||
//请求http的时候是否有错误
|
||||
errorMessage: string | null = null
|
||||
//请求http的时候是否有错误
|
||||
errorMessage: string | null = null
|
||||
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor(reactComponent?: React.Component | null) {
|
||||
//我们认为每个实体都会存放于某个react组件中,当然可以不传入。
|
||||
constructor(reactComponent?: React.Component | null) {
|
||||
|
||||
super()
|
||||
super()
|
||||
|
||||
if (reactComponent) {
|
||||
this.reactComponent = reactComponent
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//更新当前的视图,只在需要更新的情况下才更新。
|
||||
updateUI() {
|
||||
if (this.needReactComponentUpdate && this.reactComponent) {
|
||||
ViewBase.updateComponentUI(this.reactComponent, this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 转跳到登录页面
|
||||
*/
|
||||
jumpLogin() {
|
||||
|
||||
Sun.navigateTo("/user/login")
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转跳到网站安装页面
|
||||
*/
|
||||
jumpInstall() {
|
||||
|
||||
Sun.navigateTo("/install/index")
|
||||
|
||||
}
|
||||
|
||||
//从一个返回中获取出其错误信息。适配各种错误的类型。
|
||||
getErrorMessage(response: any) {
|
||||
|
||||
console.error("getErrorMessage", response)
|
||||
let msg = '服务器出错,请稍后再试!'
|
||||
|
||||
if (!response) {
|
||||
msg = '出错啦,请稍后重试!'
|
||||
} else if (typeof response === 'string') {
|
||||
msg = response
|
||||
} else if (response['msg']) {
|
||||
msg = response['msg']
|
||||
} else if (response['message']) {
|
||||
msg = response['message']
|
||||
} else {
|
||||
let temp = response['data']
|
||||
if (temp !== null && typeof temp === 'object') {
|
||||
if (temp['message']) {
|
||||
msg = temp['message']
|
||||
} else if (temp['msg']) {
|
||||
msg = temp['msg']
|
||||
} else {
|
||||
if (temp['error'] && temp['error']['message']) {
|
||||
msg = temp['error']['message']
|
||||
}
|
||||
if (reactComponent) {
|
||||
this.reactComponent = reactComponent
|
||||
}
|
||||
}
|
||||
}
|
||||
this.errorMessage = msg
|
||||
return msg
|
||||
}
|
||||
|
||||
|
||||
//提供全局的默认处理方式,可以自定义错误处理
|
||||
defaultErrorHandler(response: any, errorCallback?: any) {
|
||||
|
||||
let msg = this.getErrorMessage(response)
|
||||
|
||||
console.error("请求出错了", typeof msg, msg)
|
||||
|
||||
if (typeof errorCallback === 'function') {
|
||||
errorCallback(msg, response)
|
||||
} else {
|
||||
MessageBoxUtil.error(msg)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//专门捕捉没有登录这种错误。return true -> 有错误(已经处理掉了) false -> 没错误 (什么都没干)
|
||||
specialErrorHandler(response: any) {
|
||||
|
||||
if (!response || !response.data) {
|
||||
return false
|
||||
}
|
||||
|
||||
//1.判断是不是登录错误
|
||||
if (response.data["code"] === WebResultCode.LOGIN) {
|
||||
|
||||
//这个问题不能报的太频繁,比如一个页面请求了两个接口,两个接口都报没有登录。
|
||||
if ((new Date().getTime()) - HttpBase.lastLoginErrorTimestamp < 3000) {
|
||||
return true
|
||||
} else {
|
||||
HttpBase.lastLoginErrorTimestamp = (new Date().getTime());
|
||||
}
|
||||
|
||||
MessageBoxUtil.error("您尚未登录,请登录后访问!")
|
||||
|
||||
//立即进行登录跳转。
|
||||
this.jumpLogin()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 基类中的http请求会去统一处理错误情况。
|
||||
* 1.登录过期
|
||||
*
|
||||
*/
|
||||
httpGet(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
//更新当前的视图,只在需要更新的情况下才更新。
|
||||
updateUI() {
|
||||
if (this.needReactComponentUpdate && this.reactComponent) {
|
||||
ViewBase.updateComponentUI(this.reactComponent, this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
that.loading = true
|
||||
/**
|
||||
* 转跳到登录页面
|
||||
*/
|
||||
jumpLogin() {
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
return HttpUtil.httpGet(url, params, function (response: any) {
|
||||
//有可能正常接口回来的数据也是错误的。交给错误处理器处理。
|
||||
if (that.specialErrorHandler(response)) {
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(response)
|
||||
return
|
||||
}
|
||||
Sun.navigateTo("/user/login")
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
|
||||
}, function (err: any) {
|
||||
|
||||
let response = err.response
|
||||
console.error("请求出错啦", response)
|
||||
|
||||
//特殊错误情况的通用处理方式
|
||||
if (that.specialErrorHandler(response)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
that.defaultErrorHandler(response, errorCallback)
|
||||
|
||||
}, function (res: any) {
|
||||
|
||||
that.loading = false
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
|
||||
}, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基类中纯粹的http get请求。
|
||||
*
|
||||
*/
|
||||
httpPureGet(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
return HttpUtil.httpGet(url, params, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
}, function (err: any) {
|
||||
SafeUtil.safeCallback(errorCallback)(that.getErrorMessage(err.response))
|
||||
}, function (res: any) {
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
}, opts);
|
||||
}
|
||||
/**
|
||||
* 转跳到网站安装页面
|
||||
*/
|
||||
jumpInstall() {
|
||||
|
||||
Sun.navigateTo("/install/index")
|
||||
|
||||
/**
|
||||
* 基类中的http请求会去统一处理错误情况。
|
||||
* 1.登录过期
|
||||
*
|
||||
*/
|
||||
httpPost(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
that.loading = true
|
||||
//从一个返回中获取出其错误信息。适配各种错误的类型。
|
||||
getErrorMessage(response: any) {
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
console.error("getErrorMessage", response)
|
||||
let msg = '服务器出错,请稍后再试!'
|
||||
|
||||
|
||||
let formData = qs.stringify(params);
|
||||
|
||||
if (!opts["headers"]) {
|
||||
opts["headers"] = {}
|
||||
if (!response) {
|
||||
msg = '出错啦,请稍后重试!'
|
||||
} else if (typeof response === 'string') {
|
||||
msg = response
|
||||
} else if (response['msg']) {
|
||||
msg = response['msg']
|
||||
} else if (response['message']) {
|
||||
msg = response['message']
|
||||
} else {
|
||||
let temp = response['data']
|
||||
if (temp !== null && typeof temp === 'object') {
|
||||
if (temp['message']) {
|
||||
msg = temp['message']
|
||||
} else if (temp['msg']) {
|
||||
msg = temp['msg']
|
||||
} else {
|
||||
if (temp['error'] && temp['error']['message']) {
|
||||
msg = temp['error']['message']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.errorMessage = msg
|
||||
return msg
|
||||
}
|
||||
opts["headers"]['Content-Type'] = 'application/x-www-form-urlencoded'
|
||||
|
||||
|
||||
return HttpUtil.httpPost(url, formData, function (response: any) {
|
||||
//提供全局的默认处理方式,可以自定义错误处理
|
||||
defaultErrorHandler(response: any, errorCallback?: any) {
|
||||
|
||||
//有可能正常接口回来的数据也是错误的。交给错误处理器处理。
|
||||
if (that.specialErrorHandler(response)) {
|
||||
let msg = this.getErrorMessage(response)
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(response)
|
||||
return
|
||||
}
|
||||
console.error("请求出错了", typeof msg, msg)
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
if (typeof errorCallback === 'function') {
|
||||
errorCallback(msg, response)
|
||||
} else {
|
||||
MessageBoxUtil.error(msg)
|
||||
}
|
||||
|
||||
}, function (err: any) {
|
||||
}
|
||||
|
||||
let response = err.response
|
||||
|
||||
console.error("请求出错啦", response ? response : err)
|
||||
//专门捕捉没有登录这种错误。return true -> 有错误(已经处理掉了) false -> 没错误 (什么都没干)
|
||||
specialErrorHandler(response: any) {
|
||||
|
||||
//特殊错误情况的通用处理方式
|
||||
if (that.specialErrorHandler(response)) {
|
||||
return
|
||||
}
|
||||
if (!response || !response.data) {
|
||||
return false
|
||||
}
|
||||
|
||||
that.defaultErrorHandler(response, errorCallback)
|
||||
//1.判断是不是登录错误
|
||||
if (response.data["code"] === WebResultCode.LOGIN) {
|
||||
|
||||
}, function (res: any) {
|
||||
//这个问题不能报的太频繁,比如一个页面请求了两个接口,两个接口都报没有登录。
|
||||
if ((new Date().getTime()) - HttpBase.lastLoginErrorTimestamp < 3000) {
|
||||
return true
|
||||
} else {
|
||||
HttpBase.lastLoginErrorTimestamp = (new Date().getTime());
|
||||
}
|
||||
|
||||
that.loading = false
|
||||
MessageBoxUtil.error("您尚未登录,请登录后访问!")
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
//立即进行登录跳转。
|
||||
this.jumpLogin()
|
||||
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
return true;
|
||||
}
|
||||
|
||||
}, opts);
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 基类中的http请求会去统一处理错误情况。
|
||||
* 1.登录过期
|
||||
*
|
||||
*/
|
||||
httpGet(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
|
||||
that.loading = true
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
return HttpUtil.httpGet(url, params, function (response: any) {
|
||||
//有可能正常接口回来的数据也是错误的。交给错误处理器处理。
|
||||
if (that.specialErrorHandler(response)) {
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(response)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
|
||||
}, function (err: any) {
|
||||
|
||||
let response = err.response
|
||||
console.error("请求出错啦", response)
|
||||
|
||||
//特殊错误情况的通用处理方式
|
||||
if (that.specialErrorHandler(response)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
that.defaultErrorHandler(response, errorCallback)
|
||||
|
||||
}, function (res: any) {
|
||||
|
||||
that.loading = false
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
|
||||
}, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 基类中纯粹的http get请求。
|
||||
*
|
||||
*/
|
||||
httpPureGet(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
return HttpUtil.httpGet(url, params, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
}, function (err: any) {
|
||||
SafeUtil.safeCallback(errorCallback)(that.getErrorMessage(err.response))
|
||||
}, function (res: any) {
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
}, opts);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 基类中的http请求会去统一处理错误情况。
|
||||
* 1.登录过期
|
||||
*
|
||||
*/
|
||||
httpPost(url: any, params = {}, successCallback?: any, errorCallback?: any, finallyCallback?: any, opts?: any) {
|
||||
|
||||
let that = this
|
||||
|
||||
if (!opts) {
|
||||
opts = {}
|
||||
}
|
||||
|
||||
that.loading = true
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
|
||||
let formData = qs.stringify(params);
|
||||
|
||||
if (!opts["headers"]) {
|
||||
opts["headers"] = {}
|
||||
}
|
||||
opts["headers"]['Content-Type'] = 'application/x-www-form-urlencoded'
|
||||
|
||||
|
||||
return HttpUtil.httpPost(url, formData, function (response: any) {
|
||||
|
||||
//有可能正常接口回来的数据也是错误的。交给错误处理器处理。
|
||||
if (that.specialErrorHandler(response)) {
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(response)
|
||||
return
|
||||
}
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
|
||||
}, function (err: any) {
|
||||
|
||||
let response = err.response
|
||||
|
||||
console.error("请求出错啦", response ? response : err)
|
||||
|
||||
//特殊错误情况的通用处理方式
|
||||
if (that.specialErrorHandler(response)) {
|
||||
return
|
||||
}
|
||||
|
||||
that.defaultErrorHandler(response, errorCallback)
|
||||
|
||||
}, function (res: any) {
|
||||
|
||||
that.loading = false
|
||||
|
||||
//更新react控件的状态
|
||||
that.updateUI()
|
||||
|
||||
SafeUtil.safeCallback(finallyCallback)(res)
|
||||
|
||||
}, opts);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,416 +14,416 @@ import HttpBase from './HttpBase';
|
||||
*/
|
||||
export default class Pager<T> extends HttpBase {
|
||||
|
||||
static MAX_PAGE_SIZE = 500;
|
||||
static MAX_PAGE_SIZE = 500;
|
||||
|
||||
/**
|
||||
* 当前分页大小 0基
|
||||
*/
|
||||
page: number = 0;
|
||||
/**
|
||||
* 每一页的大小
|
||||
*/
|
||||
pageSize: number = 10;
|
||||
/**
|
||||
* 总的条目数量
|
||||
*/
|
||||
totalItems: number = 0;
|
||||
/**
|
||||
* 总的页数
|
||||
*/
|
||||
totalPages: number = 0;
|
||||
/**
|
||||
* 当前分页大小 0基
|
||||
*/
|
||||
page: number = 0;
|
||||
/**
|
||||
* 每一页的大小
|
||||
*/
|
||||
pageSize: number = 10;
|
||||
/**
|
||||
* 总的条目数量
|
||||
*/
|
||||
totalItems: number = 0;
|
||||
/**
|
||||
* 总的页数
|
||||
*/
|
||||
totalPages: number = 0;
|
||||
|
||||
/**
|
||||
* 返回的数据,类型为泛型
|
||||
*/
|
||||
data: T[] = [];
|
||||
/**
|
||||
* 返回的数据,类型为泛型
|
||||
*/
|
||||
data: T[] = [];
|
||||
|
||||
/**
|
||||
* 类。这个很特殊。
|
||||
*/
|
||||
Clazz: any = null;
|
||||
/**
|
||||
* 类。这个很特殊。
|
||||
*/
|
||||
Clazz: any = null;
|
||||
|
||||
/**
|
||||
* 分页的url链接地址
|
||||
*/
|
||||
urlPage: string | null = null;
|
||||
/**
|
||||
* 分页的url链接地址
|
||||
*/
|
||||
urlPage: string | null = null;
|
||||
|
||||
/**
|
||||
* 过滤筛选器
|
||||
*/
|
||||
filters: Filter[] = [];
|
||||
/**
|
||||
* 过滤筛选器
|
||||
*/
|
||||
filters: Filter[] = [];
|
||||
|
||||
/**
|
||||
* 是否要求在浏览器中保存参数
|
||||
*/
|
||||
history: boolean = false;
|
||||
/**
|
||||
* 是否要求在浏览器中保存参数
|
||||
*/
|
||||
history: boolean = false;
|
||||
|
||||
|
||||
constructor(reactComponent: React.Component | null, Clazz: any, pageSize = 20) {
|
||||
constructor(reactComponent: React.Component | null, Clazz: any, pageSize = 20) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
this.pageSize = pageSize;
|
||||
this.pageSize = pageSize;
|
||||
|
||||
//这里的处理利用了js的原型调用链,比较魔法。
|
||||
if (Clazz && (Clazz.prototype instanceof BaseEntity)) {
|
||||
this.Clazz = Clazz;
|
||||
//这里的处理利用了js的原型调用链,比较魔法。
|
||||
if (Clazz && (Clazz.prototype instanceof BaseEntity)) {
|
||||
this.Clazz = Clazz;
|
||||
|
||||
let urlPage = Clazz.prototype.getUrlList();
|
||||
if (urlPage) {
|
||||
this.urlPage = urlPage;
|
||||
} else {
|
||||
console.error(Clazz + '必须定义分页url');
|
||||
}
|
||||
let urlPage = Clazz.prototype.getUrlList();
|
||||
if (urlPage) {
|
||||
this.urlPage = urlPage;
|
||||
} else {
|
||||
console.error(Clazz + '必须定义分页url');
|
||||
}
|
||||
|
||||
if (Clazz.prototype.getFilters) {
|
||||
if (Clazz.prototype.getFilters) {
|
||||
|
||||
//直接获取该类的过滤器。
|
||||
this.filters = Clazz.prototype.getFilters();
|
||||
//直接获取该类的过滤器。
|
||||
this.filters = Clazz.prototype.getFilters();
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
console.error('The Clazz MUST define a prototype method named \'getFilters\'');
|
||||
console.error('The Clazz MUST define a prototype method named \'getFilters\'');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
console.error('You MUST specify a Clazz extended BaseEntity');
|
||||
}
|
||||
}
|
||||
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
|
||||
super.assign(obj);
|
||||
|
||||
this.assignList('data', this.Clazz);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//该方法是在地址栏添加上query参数,参数就是filters中的key和value.
|
||||
//同时地址栏上有的参数也会自动读取到filters中去
|
||||
//因此,启用该方法后返回时可以停留在之前的页码中。
|
||||
enableHistory() {
|
||||
this.history = true;
|
||||
|
||||
let queryPageNum: string | null = BrowserUtil.getQueryByName('page');
|
||||
let queryPageSize: string | null = BrowserUtil.getQueryByName('pageSize');
|
||||
|
||||
if (queryPageNum !== null && queryPageNum !== '') {
|
||||
this.page = parseInt(queryPageNum);
|
||||
}
|
||||
|
||||
if (queryPageSize !== null && queryPageSize !== '') {
|
||||
this.pageSize = parseInt(queryPageSize);
|
||||
}
|
||||
|
||||
if (!NumberUtil.isInteger(this.page)) {
|
||||
this.page = 0;
|
||||
}
|
||||
if (!NumberUtil.isInteger(this.pageSize)) {
|
||||
this.pageSize = 10;
|
||||
}
|
||||
|
||||
|
||||
//从请求参数中传值。
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
|
||||
let filter: Filter = this.filters[i];
|
||||
|
||||
let queryValue = BrowserUtil.getQueryByName(filter.key);
|
||||
|
||||
if (queryValue !== null && queryValue !== '') {
|
||||
|
||||
filter.putValue(queryValue);
|
||||
|
||||
} else {
|
||||
filter.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重置所有过滤器
|
||||
resetFilter() {
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
filter.reset();
|
||||
}
|
||||
};
|
||||
|
||||
//重置排序过滤器
|
||||
resetSortFilters() {
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter instanceof SortFilter) {
|
||||
filter.reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//手动设置过滤器的值
|
||||
setFilterValue(key: string, value: any) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
|
||||
let filter = this.filters[i];
|
||||
|
||||
if (filter.key === key) {
|
||||
filter.putValue(value);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
setFilterValues(obj: any) {
|
||||
const keys = Object.keys(obj);
|
||||
if(keys.length) {
|
||||
keys.forEach(key => this.setFilterValue(key, obj[key]))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//根据key来删除某个Filter
|
||||
removeFilter(key: string) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
this.filters.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//隐藏某个Filter,实际上我们可以根据这个filter来筛选,只不过不出现在NbFilter中而已。
|
||||
showFilter(key: string, visible = true) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
filter.visible = visible;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
showAllFilter(visible = true) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
filter.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
//根据一个key来获取某个filter
|
||||
getFilter(key: string): Filter | null {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
return filter;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
//根据一个key来获取某个filter
|
||||
getFilterValue(key: string) {
|
||||
let filter = this.getFilter(key);
|
||||
if (!filter) {
|
||||
return null
|
||||
} else {
|
||||
return filter.getValueString()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前进行sort的那个filter
|
||||
* 我们认为一次只有一个排序值
|
||||
*/
|
||||
getCurrentSortFilter(): Filter | null {
|
||||
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter instanceof SortFilter) {
|
||||
if (!filter.isEmpty()) {
|
||||
return filter;
|
||||
} else {
|
||||
console.error('You MUST specify a Clazz extended BaseEntity');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//把obj中的属性,赋值到this中来。采用深拷贝。
|
||||
assign(obj: any) {
|
||||
|
||||
super.assign(obj);
|
||||
|
||||
this.assignList('data', this.Clazz);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//获取所有的filter参数,键值对形式
|
||||
getParams(): { [s: string]: string | number } {
|
||||
//该方法是在地址栏添加上query参数,参数就是filters中的key和value.
|
||||
//同时地址栏上有的参数也会自动读取到filters中去
|
||||
//因此,启用该方法后返回时可以停留在之前的页码中。
|
||||
enableHistory() {
|
||||
this.history = true;
|
||||
|
||||
let params: { [s: string]: string | number } = {
|
||||
page: this.page,
|
||||
pageSize: this.pageSize,
|
||||
let queryPageNum: string | null = BrowserUtil.getQueryByName('page');
|
||||
let queryPageSize: string | null = BrowserUtil.getQueryByName('pageSize');
|
||||
|
||||
if (queryPageNum !== null && queryPageNum !== '') {
|
||||
this.page = parseInt(queryPageNum);
|
||||
}
|
||||
|
||||
if (queryPageSize !== null && queryPageSize !== '') {
|
||||
this.pageSize = parseInt(queryPageSize);
|
||||
}
|
||||
|
||||
if (!NumberUtil.isInteger(this.page)) {
|
||||
this.page = 0;
|
||||
}
|
||||
if (!NumberUtil.isInteger(this.pageSize)) {
|
||||
this.pageSize = 10;
|
||||
}
|
||||
|
||||
|
||||
//从请求参数中传值。
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
|
||||
let filter: Filter = this.filters[i];
|
||||
|
||||
let queryValue = BrowserUtil.getQueryByName(filter.key);
|
||||
|
||||
if (queryValue !== null && queryValue !== '') {
|
||||
|
||||
filter.putValue(queryValue);
|
||||
|
||||
} else {
|
||||
filter.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重置所有过滤器
|
||||
resetFilter() {
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
filter.reset();
|
||||
}
|
||||
};
|
||||
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return params;
|
||||
//重置排序过滤器
|
||||
resetSortFilters() {
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter instanceof SortFilter) {
|
||||
filter.reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//手动设置过滤器的值
|
||||
setFilterValue(key: string, value: any) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
|
||||
let filter = this.filters[i];
|
||||
|
||||
if (filter.key === key) {
|
||||
filter.putValue(value);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
setFilterValues(obj: any) {
|
||||
const keys = Object.keys(obj);
|
||||
if (keys.length) {
|
||||
keys.forEach(key => this.setFilterValue(key, obj[key]))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//根据key来删除某个Filter
|
||||
removeFilter(key: string) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
this.filters.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//隐藏某个Filter,实际上我们可以根据这个filter来筛选,只不过不出现在NbFilter中而已。
|
||||
showFilter(key: string, visible = true) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
filter.visible = visible;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
showAllFilter(visible = true) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
filter.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
//根据一个key来获取某个filter
|
||||
getFilter(key: string): Filter | null {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!filter.isEmpty()) {
|
||||
params[filter.key] = filter.getValueString();
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter.key === key) {
|
||||
return filter;
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
};
|
||||
return null;
|
||||
};
|
||||
|
||||
//根据一个key来获取某个filter
|
||||
getFilterValue(key: string) {
|
||||
let filter = this.getFilter(key);
|
||||
if (!filter) {
|
||||
return null
|
||||
} else {
|
||||
return filter.getValueString()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//元素是否为空
|
||||
isEmpty(): boolean {
|
||||
return !this.data || !this.data.length;
|
||||
}
|
||||
/**
|
||||
* 获取当前进行sort的那个filter
|
||||
* 我们认为一次只有一个排序值
|
||||
*/
|
||||
getCurrentSortFilter(): Filter | null {
|
||||
|
||||
//去服务器端进行请求
|
||||
httpList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let that = this;
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
if (filter instanceof SortFilter) {
|
||||
if (!filter.isEmpty()) {
|
||||
return filter;
|
||||
}
|
||||
}
|
||||
|
||||
let params: { [s: string]: string | number } = this.getParams();
|
||||
|
||||
|
||||
if (this.history) {
|
||||
window.history.replaceState({}, '', window.location.pathname + '?' + ObjectUtil.param(params));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//准备去请求,所有错误置为空
|
||||
this.errorMessage = null;
|
||||
//获取所有的filter参数,键值对形式
|
||||
getParams(): { [s: string]: string | number } {
|
||||
|
||||
this.httpGet(this.urlPage, params, function(response: any) {
|
||||
// handle success
|
||||
let params: { [s: string]: string | number } = {
|
||||
page: this.page,
|
||||
pageSize: this.pageSize,
|
||||
};
|
||||
|
||||
that.assign(response.data.data);
|
||||
if (!this.filters || !this.filters.length) {
|
||||
return params;
|
||||
}
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
for (let i = 0; i < this.filters.length; i++) {
|
||||
let filter = this.filters[i];
|
||||
|
||||
}, function(errorMessage: any, response: any) {
|
||||
if (!filter.isEmpty()) {
|
||||
params[filter.key] = filter.getValueString();
|
||||
}
|
||||
}
|
||||
|
||||
//失败了就清空
|
||||
that.data = [];
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(errorMessage, response);
|
||||
|
||||
}, finalCallback);
|
||||
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
|
||||
//从pager中获取当前的分页情况,在table的分页器中显示 PaginationConfig
|
||||
getPagination(): any | false {
|
||||
let that = this;
|
||||
//元素是否为空
|
||||
isEmpty(): boolean {
|
||||
return !this.data || !this.data.length;
|
||||
}
|
||||
|
||||
//去服务器端进行请求
|
||||
httpList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let params: { [s: string]: string | number } = this.getParams();
|
||||
|
||||
|
||||
if (this.history) {
|
||||
window.history.replaceState({}, '', window.location.pathname + '?' + ObjectUtil.param(params));
|
||||
}
|
||||
|
||||
|
||||
//准备去请求,所有错误置为空
|
||||
this.errorMessage = null;
|
||||
|
||||
this.httpGet(this.urlPage, params, function (response: any) {
|
||||
// handle success
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, function (errorMessage: any, response: any) {
|
||||
|
||||
//失败了就清空
|
||||
that.data = [];
|
||||
|
||||
SafeUtil.safeCallback(errorCallback)(errorMessage, response);
|
||||
|
||||
}, finalCallback);
|
||||
|
||||
if (this.totalPages > 1) {
|
||||
return {
|
||||
current: that.page + 1,
|
||||
pageSize: that.pageSize,
|
||||
total: that.totalItems,
|
||||
showTotal: (totalNum: number) => '共' + totalNum + '条',
|
||||
showSizeChanger: true,
|
||||
};
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//从pager中获取当前的分页情况,在table的分页器中显示 PaginationConfig
|
||||
getPagination(): any | false {
|
||||
let that = this;
|
||||
|
||||
//获取默认的排序顺序,提供给table使用
|
||||
getDefaultSortOrder(columnKey: string): any | boolean {
|
||||
if (this.totalPages > 1) {
|
||||
return {
|
||||
current: that.page + 1,
|
||||
pageSize: that.pageSize,
|
||||
total: that.totalItems,
|
||||
showTotal: (totalNum: number) => '共' + totalNum + '条',
|
||||
showSizeChanger: true,
|
||||
};
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
//将变化的这个情况更新。
|
||||
let filterKey = 'order' + StringUtil.capitalize(columnKey);
|
||||
|
||||
//直接放进排序值即可,底层会自动兼容
|
||||
let sortFilter = this.getFilter(filterKey);
|
||||
|
||||
if (sortFilter && (sortFilter instanceof SortFilter)) {
|
||||
|
||||
let antdSortValue: any | null = sortFilter.getAntdValue();
|
||||
if (antdSortValue) {
|
||||
return antdSortValue;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//在table的分页器 发生变化调用 TODO: PaginationConfig SorterResult TableCurrentDataSource
|
||||
tableOnChange(pagination: any, filters: any, sorter: any, extra: any) {
|
||||
let that = this;
|
||||
|
||||
if (pagination.current !== undefined) {
|
||||
that.page = pagination.current - 1;
|
||||
}
|
||||
|
||||
if (pagination.pageSize !== undefined) {
|
||||
|
||||
that.pageSize = pagination.pageSize;
|
||||
}
|
||||
|
||||
|
||||
//重置所有的sort
|
||||
that.resetSortFilters();
|
||||
if (!StringUtil.isEmptyObject(sorter)) {
|
||||
|
||||
//将变化的这个情况更新。
|
||||
let filterKey = 'order' + StringUtil.capitalize(StringUtil.underScoreToCamel(sorter.field));
|
||||
|
||||
|
||||
//直接放进排序值即可,底层会自动兼容
|
||||
that.setFilterValue(filterKey, sorter.order);
|
||||
|
||||
}
|
||||
|
||||
//直接去刷新
|
||||
that.httpList();
|
||||
}
|
||||
//获取默认的排序顺序,提供给table使用
|
||||
getDefaultSortOrder(columnKey: string): any | boolean {
|
||||
|
||||
//清空data中的数据。
|
||||
clear() {
|
||||
this.data = [];
|
||||
this.page = 0;
|
||||
this.totalItems = 0;
|
||||
this.totalPages = 0;
|
||||
}
|
||||
//将变化的这个情况更新。
|
||||
let filterKey = 'order' + StringUtil.capitalize(columnKey);
|
||||
|
||||
//直接放进排序值即可,底层会自动兼容
|
||||
let sortFilter = this.getFilter(filterKey);
|
||||
|
||||
if (sortFilter && (sortFilter instanceof SortFilter)) {
|
||||
|
||||
let antdSortValue: any | null = sortFilter.getAntdValue();
|
||||
if (antdSortValue) {
|
||||
return antdSortValue;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//在table的分页器 发生变化调用 TODO: PaginationConfig SorterResult TableCurrentDataSource
|
||||
tableOnChange(pagination: any, filters: any, sorter: any, extra: any) {
|
||||
let that = this;
|
||||
|
||||
if (pagination.current !== undefined) {
|
||||
that.page = pagination.current - 1;
|
||||
}
|
||||
|
||||
if (pagination.pageSize !== undefined) {
|
||||
|
||||
that.pageSize = pagination.pageSize;
|
||||
}
|
||||
|
||||
|
||||
//重置所有的sort
|
||||
that.resetSortFilters();
|
||||
if (!StringUtil.isEmptyObject(sorter)) {
|
||||
|
||||
//将变化的这个情况更新。
|
||||
let filterKey = 'order' + StringUtil.capitalize(StringUtil.underScoreToCamel(sorter.field));
|
||||
|
||||
|
||||
//直接放进排序值即可,底层会自动兼容
|
||||
that.setFilterValue(filterKey, sorter.order);
|
||||
|
||||
}
|
||||
|
||||
//直接去刷新
|
||||
that.httpList();
|
||||
}
|
||||
|
||||
//清空data中的数据。
|
||||
clear() {
|
||||
this.data = [];
|
||||
this.page = 0;
|
||||
this.totalItems = 0;
|
||||
this.totalPages = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
enum SortDirection {
|
||||
//这两个是后台通用的标准
|
||||
ASC = 'ASC',
|
||||
DESC = 'DESC',
|
||||
//这两个是后台通用的标准
|
||||
ASC = 'ASC',
|
||||
DESC = 'DESC',
|
||||
|
||||
//这两项是antd的标准
|
||||
DESCEND = 'descend',
|
||||
ASCEND = 'ascend'
|
||||
//这两项是antd的标准
|
||||
DESCEND = 'descend',
|
||||
ASCEND = 'ascend'
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,25 +10,25 @@ import React from "react";
|
||||
|
||||
export default class ViewBase extends Base {
|
||||
|
||||
//该类对应的React视图。
|
||||
reactComponent: React.Component | null = null
|
||||
//该类对应的React视图。
|
||||
reactComponent: React.Component | null = null
|
||||
|
||||
//更新某一个组件对应的UI
|
||||
static updateComponentUI(component: React.Component | null, entity?: any) {
|
||||
if (component) {
|
||||
//_version在这里是充当fake的。
|
||||
component.setState({_version: new Date().getTime()})
|
||||
} else {
|
||||
console.warn(`${entity && entity.constructor ? entity.constructor.name : '未知对象'} 的 reactComponent 不存在,无法更新其对应的UI`)
|
||||
//更新某一个组件对应的UI
|
||||
static updateComponentUI(component: React.Component | null, entity?: any) {
|
||||
if (component) {
|
||||
//_version在这里是充当fake的。
|
||||
component.setState({_version: new Date().getTime()})
|
||||
} else {
|
||||
console.warn(`${entity && entity.constructor ? entity.constructor.name : '未知对象'} 的 reactComponent 不存在,无法更新其对应的UI`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//更新当前的视图
|
||||
updateUI() {
|
||||
//更新当前的视图
|
||||
updateUI() {
|
||||
|
||||
ViewBase.updateComponentUI(this.reactComponent, this)
|
||||
ViewBase.updateComponentUI(this.reactComponent, this)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,56 +2,56 @@ import SelectionOption from "../base/option/SelectionOption";
|
||||
|
||||
|
||||
enum WebResultCode {
|
||||
OK = "OK",
|
||||
BAD_REQUEST = "BAD_REQUEST",
|
||||
NEED_SHARE_CODE = "NEED_SHARE_CODE",
|
||||
SHARE_CODE_ERROR = "SHARE_CODE_ERROR",
|
||||
LOGIN = "LOGIN",
|
||||
NOT_INSTALLED = "NOT_INSTALLED",
|
||||
SERVER = "SERVER",
|
||||
UNKNOWN = "UNKNOWN",
|
||||
OK = "OK",
|
||||
BAD_REQUEST = "BAD_REQUEST",
|
||||
NEED_SHARE_CODE = "NEED_SHARE_CODE",
|
||||
SHARE_CODE_ERROR = "SHARE_CODE_ERROR",
|
||||
LOGIN = "LOGIN",
|
||||
NOT_INSTALLED = "NOT_INSTALLED",
|
||||
SERVER = "SERVER",
|
||||
UNKNOWN = "UNKNOWN",
|
||||
}
|
||||
|
||||
let WebResultCodes: WebResultCode[] = Object.keys(WebResultCode).map(k => k as WebResultCode)
|
||||
|
||||
let WebResultCodeMap: { [key in keyof typeof WebResultCode]: SelectionOption } = {
|
||||
OK: {
|
||||
"name": "成功",
|
||||
"value": "OK",
|
||||
},
|
||||
BAD_REQUEST: {
|
||||
"name": "请求错误",
|
||||
"value": "BAD_REQUEST",
|
||||
},
|
||||
NEED_SHARE_CODE: {
|
||||
name: "提取码必填",
|
||||
value: "NEED_SHARE_CODE"
|
||||
},
|
||||
SHARE_CODE_ERROR: {
|
||||
name: "提取码错误",
|
||||
value: "SHARE_CODE_ERROR"
|
||||
},
|
||||
LOGIN: {
|
||||
"name": "未登录",
|
||||
"value": "LOGIN",
|
||||
},
|
||||
NOT_INSTALLED: {
|
||||
"name": "未安装",
|
||||
"value": "NOT_INSTALLED",
|
||||
},
|
||||
SERVER: {
|
||||
"name": "服务器出错",
|
||||
"value": "SERVER",
|
||||
},
|
||||
UNKNOWN: {
|
||||
"name": "未知错误",
|
||||
"value": "UNKNOWN",
|
||||
},
|
||||
OK: {
|
||||
"name": "成功",
|
||||
"value": "OK",
|
||||
},
|
||||
BAD_REQUEST: {
|
||||
"name": "请求错误",
|
||||
"value": "BAD_REQUEST",
|
||||
},
|
||||
NEED_SHARE_CODE: {
|
||||
name: "提取码必填",
|
||||
value: "NEED_SHARE_CODE"
|
||||
},
|
||||
SHARE_CODE_ERROR: {
|
||||
name: "提取码错误",
|
||||
value: "SHARE_CODE_ERROR"
|
||||
},
|
||||
LOGIN: {
|
||||
"name": "未登录",
|
||||
"value": "LOGIN",
|
||||
},
|
||||
NOT_INSTALLED: {
|
||||
"name": "未安装",
|
||||
"value": "NOT_INSTALLED",
|
||||
},
|
||||
SERVER: {
|
||||
"name": "服务器出错",
|
||||
"value": "SERVER",
|
||||
},
|
||||
UNKNOWN: {
|
||||
"name": "未知错误",
|
||||
"value": "UNKNOWN",
|
||||
},
|
||||
}
|
||||
|
||||
let WebResultCodeList: SelectionOption[] = []
|
||||
WebResultCodes.forEach((type: WebResultCode, index: number) => {
|
||||
WebResultCodeList.push(WebResultCodeMap[type])
|
||||
WebResultCodeList.push(WebResultCodeMap[type])
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -8,45 +8,45 @@ import Filter from "./Filter";
|
||||
*/
|
||||
export default class CheckFilter extends Filter {
|
||||
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: boolean | null = null
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: boolean | null = null
|
||||
|
||||
constructor(name: string, code: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
}
|
||||
|
||||
|
||||
//获取值字符串,[null,true,false] => ["","true","false"]
|
||||
getValueString(): string {
|
||||
let stringValue = ""
|
||||
if (this.value === true) {
|
||||
stringValue = "true"
|
||||
} else if (this.value === false) {
|
||||
stringValue = "false"
|
||||
} else {
|
||||
stringValue = ""
|
||||
constructor(name: string, code: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
}
|
||||
return stringValue
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: any) {
|
||||
|
||||
if (value === "true" || value === true) {
|
||||
this.value = true
|
||||
} else if (value === "false" || value === false) {
|
||||
this.value = false
|
||||
} else {
|
||||
this.value = null
|
||||
//获取值字符串,[null,true,false] => ["","true","false"]
|
||||
getValueString(): string {
|
||||
let stringValue = ""
|
||||
if (this.value === true) {
|
||||
stringValue = "true"
|
||||
} else if (this.value === false) {
|
||||
stringValue = "false"
|
||||
} else {
|
||||
stringValue = ""
|
||||
}
|
||||
return stringValue
|
||||
}
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: any) {
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
if (value === "true" || value === true) {
|
||||
this.value = true
|
||||
} else if (value === "false" || value === false) {
|
||||
this.value = false
|
||||
} else {
|
||||
this.value = null
|
||||
}
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,46 +9,45 @@ import DateUtil from "../../../util/DateUtil";
|
||||
*/
|
||||
export default class DateFilter extends Filter {
|
||||
|
||||
//时间筛选的格式
|
||||
format: string
|
||||
//时间筛选的格式
|
||||
format: string
|
||||
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: Date | null = null
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: Date | null = null
|
||||
|
||||
constructor(name: string, code: string, format?: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
if (format) {
|
||||
this.format = format
|
||||
} else {
|
||||
this.format = DateUtil.DATE_FORMAT
|
||||
constructor(name: string, code: string, format?: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
if (format) {
|
||||
this.format = format
|
||||
} else {
|
||||
this.format = DateUtil.DATE_FORMAT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return DateUtil.format(this.value, this.format)
|
||||
} else {
|
||||
return ""
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return DateUtil.format(this.value, this.format)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
|
||||
this.value = DateUtil.parse(value)
|
||||
}
|
||||
this.value = DateUtil.parse(value)
|
||||
}
|
||||
|
||||
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,46 +9,45 @@ import DateUtil from "../../../util/DateUtil";
|
||||
*/
|
||||
export default class DateTimeFilter extends Filter {
|
||||
|
||||
//时间筛选的格式
|
||||
format: string
|
||||
//时间筛选的格式
|
||||
format: string
|
||||
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: Date | null = null
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: Date | null = null
|
||||
|
||||
constructor(name: string, code: string, format?: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
if (format) {
|
||||
this.format = format
|
||||
} else {
|
||||
this.format = DateUtil.DEFAULT_FORMAT
|
||||
constructor(name: string, code: string, format?: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
if (format) {
|
||||
this.format = format
|
||||
} else {
|
||||
this.format = DateUtil.DEFAULT_FORMAT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return DateUtil.format(this.value, this.format)
|
||||
} else {
|
||||
return ""
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return DateUtil.format(this.value, this.format)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
|
||||
this.value = DateUtil.parse(value)
|
||||
}
|
||||
this.value = DateUtil.parse(value)
|
||||
}
|
||||
|
||||
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,53 +3,53 @@
|
||||
*/
|
||||
export default class Filter {
|
||||
|
||||
//中文名
|
||||
name: string
|
||||
//提交时候的键值,英文
|
||||
key: string
|
||||
//是否可见
|
||||
visible: boolean = true
|
||||
//中文名
|
||||
name: string
|
||||
//提交时候的键值,英文
|
||||
key: string
|
||||
//是否可见
|
||||
visible: boolean = true
|
||||
|
||||
constructor(name: string, key: string, visible?: boolean) {
|
||||
this.name = name
|
||||
this.key = key
|
||||
constructor(name: string, key: string, visible?: boolean) {
|
||||
this.name = name
|
||||
this.key = key
|
||||
|
||||
//没有传默认为true.
|
||||
if (visible === undefined) {
|
||||
this.visible = true
|
||||
} else {
|
||||
this.visible = visible
|
||||
//没有传默认为true.
|
||||
if (visible === undefined) {
|
||||
this.visible = true
|
||||
} else {
|
||||
this.visible = visible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到一个字符串的值
|
||||
*/
|
||||
getValueString(): string {
|
||||
console.error(`${this.constructor.name} 的 getValue 不存在,请开发者及时配置。`)
|
||||
return ""
|
||||
}
|
||||
/**
|
||||
* 获取到一个字符串的值
|
||||
*/
|
||||
getValueString(): string {
|
||||
console.error(`${this.constructor.name} 的 getValue 不存在,请开发者及时配置。`)
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* 把一个字符串放置到value中去,因为有可能从请求参数中回填值
|
||||
*/
|
||||
putValue(value: string) {
|
||||
console.error(`${this.constructor.name} 的 putValue 不存在,请开发者及时配置。`)
|
||||
}
|
||||
/**
|
||||
* 把一个字符串放置到value中去,因为有可能从请求参数中回填值
|
||||
*/
|
||||
putValue(value: string) {
|
||||
console.error(`${this.constructor.name} 的 putValue 不存在,请开发者及时配置。`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 将过滤器的值清空
|
||||
*/
|
||||
reset() {
|
||||
console.error(`${this.constructor.name} 的 reset 不存在,请开发者及时配置。`)
|
||||
}
|
||||
/**
|
||||
* 将过滤器的值清空
|
||||
*/
|
||||
reset() {
|
||||
console.error(`${this.constructor.name} 的 reset 不存在,请开发者及时配置。`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前过滤器是否为空
|
||||
*/
|
||||
isEmpty():boolean {
|
||||
console.error(`${this.constructor.name} 的 isEmpty 不存在,请开发者及时配置。`)
|
||||
return false
|
||||
}
|
||||
/**
|
||||
* 当前过滤器是否为空
|
||||
*/
|
||||
isEmpty(): boolean {
|
||||
console.error(`${this.constructor.name} 的 isEmpty 不存在,请开发者及时配置。`)
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,24 +9,24 @@ import SelectionFilterType from "./SelectionFilterType";
|
||||
*/
|
||||
export default class HttpSelectionFilter extends SelectionFilter {
|
||||
|
||||
//远程的访问链接。
|
||||
url: string
|
||||
//远程的访问链接。
|
||||
url: string
|
||||
|
||||
constructor(name: string, code: string, url: string, selectionType?: SelectionFilterType, visible?: boolean) {
|
||||
super(name, code, [], selectionType, visible)
|
||||
this.url = url
|
||||
}
|
||||
constructor(name: string, code: string, url: string, selectionType?: SelectionFilterType, visible?: boolean) {
|
||||
super(name, code, [], selectionType, visible)
|
||||
this.url = url
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
//远程调用的值必须要宽容,因为值可能还没有从远程取回来呢。
|
||||
putValue(value: string) {
|
||||
this.value = value
|
||||
}
|
||||
//通过一个字符串来设置值
|
||||
//远程调用的值必须要宽容,因为值可能还没有从远程取回来呢。
|
||||
putValue(value: string) {
|
||||
this.value = value
|
||||
}
|
||||
|
||||
//严格的回填,采用父类的策略
|
||||
//这个方法会在http请求完成了之后调用。HttpSelectionFilter中会调用
|
||||
strictPutValue(value: string) {
|
||||
super.putValue(value)
|
||||
}
|
||||
//严格的回填,采用父类的策略
|
||||
//这个方法会在http请求完成了之后调用。HttpSelectionFilter中会调用
|
||||
strictPutValue(value: string) {
|
||||
super.putValue(value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,42 +6,42 @@ import Filter from "./Filter";
|
||||
*/
|
||||
export default class InputFilter extends Filter {
|
||||
|
||||
//值,最终填写的内容
|
||||
value: string = ""
|
||||
//值,最终填写的内容
|
||||
value: string = ""
|
||||
|
||||
//占位符
|
||||
placeholder: string
|
||||
//占位符
|
||||
placeholder: string
|
||||
|
||||
constructor(name: string, code: string, placeholder?: string | null, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
constructor(name: string, code: string, placeholder?: string | null, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
|
||||
if (placeholder) {
|
||||
this.placeholder = placeholder
|
||||
} else {
|
||||
this.placeholder = name
|
||||
if (placeholder) {
|
||||
this.placeholder = placeholder
|
||||
} else {
|
||||
this.placeholder = name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
return this.value
|
||||
}
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
return this.value
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
|
||||
this.value = value
|
||||
this.value = value
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
reset() {
|
||||
this.value = ""
|
||||
}
|
||||
reset() {
|
||||
this.value = ""
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === "";
|
||||
}
|
||||
isEmpty(): boolean {
|
||||
return this.value === "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,59 +10,59 @@ import SelectionFilterType from "./SelectionFilterType";
|
||||
*/
|
||||
export default class SelectionFilter extends Filter {
|
||||
|
||||
//候选项,要求必须有name和value。
|
||||
options: SelectionOption[]
|
||||
//候选项,要求必须有name和value。
|
||||
options: SelectionOption[]
|
||||
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: string = ""
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: string = ""
|
||||
|
||||
//采用的样式
|
||||
selectionType: SelectionFilterType
|
||||
//采用的样式
|
||||
selectionType: SelectionFilterType
|
||||
|
||||
constructor(name: string, code: string, options: SelectionOption[],selectionType?: SelectionFilterType, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
constructor(name: string, code: string, options: SelectionOption[], selectionType?: SelectionFilterType, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
|
||||
this.options = options
|
||||
if (selectionType === undefined) {
|
||||
this.selectionType = SelectionFilterType.COMBOBOX
|
||||
} else {
|
||||
this.selectionType = selectionType
|
||||
}
|
||||
}
|
||||
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
return this.value
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
|
||||
if (value === "") {
|
||||
this.value = ""
|
||||
} else {
|
||||
|
||||
//必须是options中的值才接纳。
|
||||
for (let j = 0; j < this.options.length; j++) {
|
||||
let opt = this.options[j]
|
||||
if (opt.value === value) {
|
||||
this.value = value
|
||||
return
|
||||
this.options = options
|
||||
if (selectionType === undefined) {
|
||||
this.selectionType = SelectionFilterType.COMBOBOX
|
||||
} else {
|
||||
this.selectionType = selectionType
|
||||
}
|
||||
}
|
||||
|
||||
this.value = ""
|
||||
}
|
||||
|
||||
}
|
||||
//获取值字符串
|
||||
getValueString(): string {
|
||||
return this.value
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
|
||||
if (value === "") {
|
||||
this.value = ""
|
||||
} else {
|
||||
|
||||
//必须是options中的值才接纳。
|
||||
for (let j = 0; j < this.options.length; j++) {
|
||||
let opt = this.options[j]
|
||||
if (opt.value === value) {
|
||||
this.value = value
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.value = ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
reset() {
|
||||
this.value = ""
|
||||
}
|
||||
reset() {
|
||||
this.value = ""
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === "";
|
||||
}
|
||||
isEmpty(): boolean {
|
||||
return this.value === "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* 过滤器中的选择样式
|
||||
*/
|
||||
enum SelectionFilterType {
|
||||
//下拉框的样式
|
||||
COMBOBOX = "COMBOBOX",
|
||||
//按钮的样式
|
||||
BUTTON = "BUTTON",
|
||||
//下拉框的样式
|
||||
COMBOBOX = "COMBOBOX",
|
||||
//按钮的样式
|
||||
BUTTON = "BUTTON",
|
||||
}
|
||||
|
||||
export default SelectionFilterType
|
||||
|
||||
@@ -9,61 +9,61 @@ import SortDirection from "../SortDirection";
|
||||
*/
|
||||
export default class SortFilter extends Filter {
|
||||
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: SortDirection | null = null
|
||||
//值,最终填写的内容。null表示这个值不设置
|
||||
value: SortDirection | null = null
|
||||
|
||||
constructor(name: string, code: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
//过滤排序器,more是不显示的。
|
||||
//没有传默认为true.
|
||||
if (visible === undefined) {
|
||||
this.visible = false
|
||||
} else {
|
||||
this.visible = visible
|
||||
constructor(name: string, code: string, visible?: boolean) {
|
||||
super(name, code, visible)
|
||||
//过滤排序器,more是不显示的。
|
||||
//没有传默认为true.
|
||||
if (visible === undefined) {
|
||||
this.visible = false
|
||||
} else {
|
||||
this.visible = visible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取值字符串,[null,true,false] => ["","true","false"]
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return this.value
|
||||
} else {
|
||||
return ""
|
||||
//获取值字符串,[null,true,false] => ["","true","false"]
|
||||
getValueString(): string {
|
||||
if (this.value) {
|
||||
return this.value
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
if (value === SortDirection.DESC || value === SortDirection.DESCEND) {
|
||||
this.value = SortDirection.DESC
|
||||
} else if (value === SortDirection.ASC || value === SortDirection.ASCEND) {
|
||||
this.value = SortDirection.ASC
|
||||
} else {
|
||||
this.value = null
|
||||
//通过一个字符串来设置值
|
||||
putValue(value: string) {
|
||||
if (value === SortDirection.DESC || value === SortDirection.DESCEND) {
|
||||
this.value = SortDirection.DESC
|
||||
} else if (value === SortDirection.ASC || value === SortDirection.ASCEND) {
|
||||
this.value = SortDirection.ASC
|
||||
} else {
|
||||
this.value = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//获取到antd需要使用的值 TODO: SortOrder
|
||||
getAntdValue(): any | null {
|
||||
if (this.value === SortDirection.DESC || this.value === SortDirection.DESCEND) {
|
||||
return SortDirection.DESCEND
|
||||
} else if (this.value === SortDirection.ASC || this.value === SortDirection.ASCEND) {
|
||||
return SortDirection.ASCEND
|
||||
} else {
|
||||
return null
|
||||
//获取到antd需要使用的值 TODO: SortOrder
|
||||
getAntdValue(): any | null {
|
||||
if (this.value === SortDirection.DESC || this.value === SortDirection.DESCEND) {
|
||||
return SortDirection.DESCEND
|
||||
} else if (this.value === SortDirection.ASC || this.value === SortDirection.ASCEND) {
|
||||
return SortDirection.ASCEND
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
reset() {
|
||||
this.value = null
|
||||
}
|
||||
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
isEmpty(): boolean {
|
||||
return this.value === null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* 面包屑对应的模型
|
||||
*/
|
||||
export default interface BreadcrumbModel {
|
||||
name: string,
|
||||
path: string,
|
||||
query: any,
|
||||
displayDirect: boolean,
|
||||
name: string,
|
||||
path: string,
|
||||
query: any,
|
||||
displayDirect: boolean,
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface CodeSelectionOption extends SelectionOption {
|
||||
code: string,
|
||||
type: string,
|
||||
code: string,
|
||||
type: string,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
enum Color {
|
||||
PRIMARY = "#215891",
|
||||
INFO = "#2DB7F5",
|
||||
SUCCESS = "#67C23A",
|
||||
WARNING = "#E6A23C",
|
||||
DANGER = "#FF756F",
|
||||
PRIMARY = "#215891",
|
||||
INFO = "#2DB7F5",
|
||||
SUCCESS = "#67C23A",
|
||||
WARNING = "#E6A23C",
|
||||
DANGER = "#FF756F",
|
||||
}
|
||||
|
||||
export default Color
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface ColorSelectionOption extends SelectionOption {
|
||||
index: number,
|
||||
color: string,
|
||||
index: number,
|
||||
color: string,
|
||||
}
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface ColorSelectionOption extends SelectionOption {
|
||||
color: string,
|
||||
color: string,
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface IconIndexSelectionOption extends SelectionOption {
|
||||
index: number,
|
||||
icon: string,
|
||||
index: number,
|
||||
icon: string,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface IndexSelectionOption extends SelectionOption {
|
||||
index: number,
|
||||
name: string,
|
||||
value: string
|
||||
index: number,
|
||||
name: string,
|
||||
value: string
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 下拉筛选框的选项,统一使用该接口,同时这个作为枚举的复杂类型。
|
||||
*/
|
||||
export default interface SelectionOption {
|
||||
name: string,
|
||||
value: string
|
||||
name: string,
|
||||
value: string
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
import SelectionOption from "./SelectionOption";
|
||||
|
||||
export default interface StyleSelectionOption extends SelectionOption {
|
||||
style: string,
|
||||
style: string,
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
* 定义了一个图标行为的对象,这个可以辅助一些组件。
|
||||
*/
|
||||
export interface IconActionItem {
|
||||
//图片的资源链接(优先级高于iconType)
|
||||
icon?: string
|
||||
//antd的图标类型
|
||||
iconType?: string
|
||||
//名称
|
||||
name?: string
|
||||
//是否可见。默认可见
|
||||
visible?: boolean
|
||||
//点击图标后的行为
|
||||
onClick?: () => void
|
||||
//图片的资源链接(优先级高于iconType)
|
||||
icon?: string
|
||||
//antd的图标类型
|
||||
iconType?: string
|
||||
//名称
|
||||
name?: string
|
||||
//是否可见。默认可见
|
||||
visible?: boolean
|
||||
//点击图标后的行为
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ export interface IconActionItem {
|
||||
*/
|
||||
export interface ToolItem {
|
||||
|
||||
name: string
|
||||
name: string
|
||||
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
|
||||
//antd的图标样式
|
||||
iconType: string
|
||||
//antd的图标样式
|
||||
iconType: string
|
||||
|
||||
}
|
||||
|
||||
@@ -38,16 +38,16 @@ export interface ToolItem {
|
||||
*/
|
||||
export interface SkeletonItem {
|
||||
|
||||
name: string
|
||||
name: string
|
||||
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
|
||||
//高亮的图标 资源链接
|
||||
activeIcon: string
|
||||
//高亮的图标 资源链接
|
||||
activeIcon: string
|
||||
|
||||
//一般状态的图标 资源链接
|
||||
icon: string
|
||||
//一般状态的图标 资源链接
|
||||
icon: string
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,67 +2,66 @@ import SafeUtil from '../../util/SafeUtil';
|
||||
import BaseEntity from '../base/BaseEntity';
|
||||
import Filter from "../base/filter/Filter";
|
||||
import SortFilter from "../base/filter/SortFilter";
|
||||
import StringUtil from "../../util/StringUtil";
|
||||
|
||||
|
||||
export default class Dashboard extends BaseEntity {
|
||||
|
||||
static URL_ACTIVE_IP_TOP10 = "/api/dashboard/active/ip/top10"
|
||||
static URL_ETL = "/api/dashboard/etl"
|
||||
static URL_ACTIVE_IP_TOP10 = "/api/dashboard/active/ip/top10"
|
||||
static URL_ETL = "/api/dashboard/etl"
|
||||
|
||||
invokeNum: number = 0;
|
||||
totalInvokeNum: number = 0;
|
||||
uv: number = 0;
|
||||
totalUv: number = 0;
|
||||
matterNum: number = 0;
|
||||
totalMatterNum: number = 0;
|
||||
fileSize: number = 0;
|
||||
totalFileSize: number = 0;
|
||||
avgCost: number = 0;
|
||||
dt: string = "";
|
||||
invokeNum: number = 0;
|
||||
totalInvokeNum: number = 0;
|
||||
uv: number = 0;
|
||||
totalUv: number = 0;
|
||||
matterNum: number = 0;
|
||||
totalMatterNum: number = 0;
|
||||
fileSize: number = 0;
|
||||
totalFileSize: number = 0;
|
||||
avgCost: number = 0;
|
||||
dt: string = "";
|
||||
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
constructor(reactComponent?: React.Component) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
getTAG(): string {
|
||||
return "dashboard";
|
||||
}
|
||||
getTAG(): string {
|
||||
return "dashboard";
|
||||
}
|
||||
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new SortFilter("按DT排序", "orderDt"),
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new SortFilter("按DT排序", "orderDt"),
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
httpActiveIpTop10(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Dashboard.URL_ACTIVE_IP_TOP10, {}, function (response: any) {
|
||||
httpActiveIpTop10(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Dashboard.URL_ACTIVE_IP_TOP10, {}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response.data.data);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
httpEtl(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Dashboard.URL_ETL, {}, function (response: any) {
|
||||
httpEtl(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Dashboard.URL_ETL, {}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response.data.data);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,51 +3,51 @@ import DateUtil from "../../../util/DateUtil";
|
||||
import SafeUtil from "../../../util/SafeUtil";
|
||||
|
||||
export default class DownloadToken extends BaseEntity {
|
||||
userUuid: string | null = null;
|
||||
matterUuid: string | null = null;
|
||||
expireTime: string | null = null;
|
||||
ip: string | null = null;
|
||||
userUuid: string | null = null;
|
||||
matterUuid: string | null = null;
|
||||
expireTime: string | null = null;
|
||||
ip: string | null = null;
|
||||
|
||||
static URL_FETCH_DOWNLOAD_TOKEN = "/api/alien/fetch/download/token";
|
||||
static URL_FETCH_DOWNLOAD_TOKEN = "/api/alien/fetch/download/token";
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
|
||||
|
||||
getTAG(): string {
|
||||
return "downloadToken";
|
||||
}
|
||||
getTAG(): string {
|
||||
return "downloadToken";
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
this.assignEntity("expireTime", Date);
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
this.assignEntity("expireTime", Date);
|
||||
}
|
||||
|
||||
getFilters() {
|
||||
return [...super.getFilters()];
|
||||
}
|
||||
getFilters() {
|
||||
return [...super.getFilters()];
|
||||
}
|
||||
|
||||
httpFetchDownloadToken(
|
||||
matterUuid: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
let date = new Date(new Date().getTime() + 10 * 60 * 1000);
|
||||
httpFetchDownloadToken(
|
||||
matterUuid: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
let date = new Date(new Date().getTime() + 10 * 60 * 1000);
|
||||
|
||||
let form = {
|
||||
expireTime: DateUtil.simpleDateTime(date),
|
||||
matterUuid,
|
||||
};
|
||||
this.httpPost(
|
||||
DownloadToken.URL_FETCH_DOWNLOAD_TOKEN,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
let form = {
|
||||
expireTime: DateUtil.simpleDateTime(date),
|
||||
matterUuid,
|
||||
};
|
||||
this.httpPost(
|
||||
DownloadToken.URL_FETCH_DOWNLOAD_TOKEN,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,66 +8,66 @@ import LangZh from "./i18n/LangZh";
|
||||
|
||||
export default class Lang {
|
||||
|
||||
//当前使用的语言,默认中文
|
||||
lang: string = "zh"
|
||||
//当前使用的语言,默认中文
|
||||
lang: string = "zh"
|
||||
|
||||
//全局的一个store对象
|
||||
private static singleton: Lang | null = null
|
||||
//全局的一个store对象
|
||||
private static singleton: Lang | null = null
|
||||
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Lang {
|
||||
if (Lang.singleton == null) {
|
||||
Lang.singleton = new Lang();
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Lang {
|
||||
if (Lang.singleton == null) {
|
||||
Lang.singleton = new Lang();
|
||||
|
||||
//读取默认的语言
|
||||
let lang = BrowserUtil.browserLang()
|
||||
let localLang = localStorage.getItem("_lang");
|
||||
if (localLang === "zh" || localLang === "en") {
|
||||
lang = localLang
|
||||
}
|
||||
Lang.singleton.lang = lang
|
||||
console.info("current lang: ", lang)
|
||||
//读取默认的语言
|
||||
let lang = BrowserUtil.browserLang()
|
||||
let localLang = localStorage.getItem("_lang");
|
||||
if (localLang === "zh" || localLang === "en") {
|
||||
lang = localLang
|
||||
}
|
||||
Lang.singleton.lang = lang
|
||||
console.info("current lang: ", lang)
|
||||
|
||||
}
|
||||
|
||||
return Lang.singleton
|
||||
}
|
||||
|
||||
return Lang.singleton
|
||||
}
|
||||
//快捷获取一种语言对应的文字。
|
||||
static t(key: string, ...params: any[]): string {
|
||||
|
||||
//快捷获取一种语言对应的文字。
|
||||
static t(key: string, ...params: any[]): string {
|
||||
let json: { [key: string]: any } = LangEn
|
||||
|
||||
let json: { [key: string]: any } = LangEn
|
||||
let lang = Lang.getSingleton().lang
|
||||
if (lang == "zh") {
|
||||
json = LangZh
|
||||
}
|
||||
|
||||
let lang = Lang.getSingleton().lang
|
||||
if (lang == "zh") {
|
||||
json = LangZh
|
||||
let keyParts: string[] = key.split(".")
|
||||
let jsonBody: any = json
|
||||
for (let i = 0; i < keyParts.length; i++) {
|
||||
let part: string = keyParts[i]
|
||||
jsonBody = jsonBody[part]
|
||||
if (jsonBody === undefined || jsonBody === null) {
|
||||
//找不到key对应的内容,直接返回key
|
||||
return key
|
||||
}
|
||||
}
|
||||
|
||||
//到这里已经找到了
|
||||
if (typeof jsonBody !== "string") {
|
||||
return key
|
||||
}
|
||||
|
||||
//依次将参数写入进去。
|
||||
if (params && params.length > 0) {
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
let param = params[i]
|
||||
jsonBody = jsonBody.replace("{}", param)
|
||||
}
|
||||
}
|
||||
|
||||
return jsonBody
|
||||
}
|
||||
|
||||
let keyParts: string[] = key.split(".")
|
||||
let jsonBody: any = json
|
||||
for (let i = 0; i < keyParts.length; i++) {
|
||||
let part: string = keyParts[i]
|
||||
jsonBody = jsonBody[part]
|
||||
if (jsonBody === undefined || jsonBody === null) {
|
||||
//找不到key对应的内容,直接返回key
|
||||
return key
|
||||
}
|
||||
}
|
||||
|
||||
//到这里已经找到了
|
||||
if (typeof jsonBody !== "string") {
|
||||
return key
|
||||
}
|
||||
|
||||
//依次将参数写入进去。
|
||||
if (params && params.length > 0) {
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
let param = params[i]
|
||||
jsonBody = jsonBody.replace("{}", param)
|
||||
}
|
||||
}
|
||||
|
||||
return jsonBody
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,28 +5,27 @@
|
||||
*/
|
||||
import User from "../user/User";
|
||||
import Preference from "../preference/Preference";
|
||||
import Matter from "../matter/Matter";
|
||||
|
||||
|
||||
export default class Moon {
|
||||
|
||||
//全局具有唯一的用户,即当前登录的用户.
|
||||
user: User = new User()
|
||||
//全局具有唯一的用户,即当前登录的用户.
|
||||
user: User = new User()
|
||||
|
||||
//全局唯一的偏好设置
|
||||
preference: Preference = new Preference()
|
||||
//全局唯一的偏好设置
|
||||
preference: Preference = new Preference()
|
||||
|
||||
//全局的一个store对象
|
||||
private static singleton: Moon | null = null
|
||||
//全局的一个store对象
|
||||
private static singleton: Moon | null = null
|
||||
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Moon {
|
||||
if (Moon.singleton == null) {
|
||||
Moon.singleton = new Moon();
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Moon {
|
||||
if (Moon.singleton == null) {
|
||||
Moon.singleton = new Moon();
|
||||
|
||||
}
|
||||
|
||||
return Moon.singleton
|
||||
}
|
||||
|
||||
return Moon.singleton
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,88 +6,87 @@
|
||||
|
||||
export default class Sun {
|
||||
|
||||
//全局的一个store对象
|
||||
static singleton: Sun | null = null;
|
||||
//全局的一个store对象
|
||||
static singleton: Sun | null = null;
|
||||
|
||||
//持有整个网站最外层的frame,方便我们刷新整个页面。
|
||||
frameComponent: any = null;
|
||||
//持有整个网站最外层的frame,方便我们刷新整个页面。
|
||||
frameComponent: any = null;
|
||||
|
||||
//持有全局的react-router对象,方便我们在非jsx环境中控制路由跳转
|
||||
reactRouter: any = null;
|
||||
//持有全局的react-router对象,方便我们在非jsx环境中控制路由跳转
|
||||
reactRouter: any = null;
|
||||
|
||||
//全局布局样式,是否展示出左边的菜单.
|
||||
showDrawer: boolean = false;
|
||||
//全局布局样式,是否展示出左边的菜单.
|
||||
showDrawer: boolean = false;
|
||||
|
||||
//全局mobile标识
|
||||
isMobile: boolean = /Mobile|iP(hone|od|ad)|iOS|Android|BlackBerry/i.test(window.navigator.userAgent);
|
||||
//全局mobile标识
|
||||
isMobile: boolean = /Mobile|iP(hone|od|ad)|iOS|Android|BlackBerry/i.test(window.navigator.userAgent);
|
||||
|
||||
|
||||
|
||||
//由于这个类采用单例模式,因此所有属性都是独一份的。
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Sun {
|
||||
if (Sun.singleton == null) {
|
||||
Sun.singleton = new Sun();
|
||||
//由于这个类采用单例模式,因此所有属性都是独一份的。
|
||||
constructor() {
|
||||
|
||||
}
|
||||
return Sun.singleton
|
||||
}
|
||||
|
||||
//使用懒加载模式。
|
||||
static getSingleton(): Sun {
|
||||
if (Sun.singleton == null) {
|
||||
Sun.singleton = new Sun();
|
||||
|
||||
//*******************和路由相关的方法 开始 *******************//
|
||||
|
||||
/**
|
||||
* 跳转到某个页面去
|
||||
*/
|
||||
static navigateTo(path: any) {
|
||||
if (Sun.getSingleton().reactRouter) {
|
||||
Sun.getSingleton().reactRouter.push(path)
|
||||
} else {
|
||||
console.error("全局的 reactRouter 未定义,请检查代码!")
|
||||
}
|
||||
return Sun.singleton
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到某个页面去,带query
|
||||
* route: {path: '', query: {}}
|
||||
*/
|
||||
static navigateQueryTo(route: any) {
|
||||
let path = route.path;
|
||||
if (Object.keys(route.query).length) {
|
||||
const params = new URLSearchParams(route.query).toString();
|
||||
path += `?${params}`;
|
||||
|
||||
//*******************和路由相关的方法 开始 *******************//
|
||||
|
||||
/**
|
||||
* 跳转到某个页面去
|
||||
*/
|
||||
static navigateTo(path: any) {
|
||||
if (Sun.getSingleton().reactRouter) {
|
||||
Sun.getSingleton().reactRouter.push(path)
|
||||
} else {
|
||||
console.error("全局的 reactRouter 未定义,请检查代码!")
|
||||
}
|
||||
}
|
||||
Sun.navigateTo(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回到上一页
|
||||
*/
|
||||
static navigateBack() {
|
||||
if (Sun.getSingleton().reactRouter) {
|
||||
Sun.getSingleton().reactRouter.go(-1)
|
||||
} else {
|
||||
console.error("全局的 reactRouter 未定义,请检查代码!")
|
||||
/**
|
||||
* 跳转到某个页面去,带query
|
||||
* route: {path: '', query: {}}
|
||||
*/
|
||||
static navigateQueryTo(route: any) {
|
||||
let path = route.path;
|
||||
if (Object.keys(route.query).length) {
|
||||
const params = new URLSearchParams(route.query).toString();
|
||||
path += `?${params}`;
|
||||
}
|
||||
Sun.navigateTo(path);
|
||||
}
|
||||
}
|
||||
|
||||
//******************* 和路由相关的方法 结束 *******************//
|
||||
|
||||
//*******************和全局视图相关的方法 开始 *******************//
|
||||
/**
|
||||
* 刷新主框架内容
|
||||
*/
|
||||
static updateFrame() {
|
||||
if (Sun.getSingleton().frameComponent) {
|
||||
Sun.getSingleton().frameComponent.updateUI()
|
||||
} else {
|
||||
console.error("全局的 frameComponent 未定义,请检查代码!")
|
||||
/**
|
||||
* 回到上一页
|
||||
*/
|
||||
static navigateBack() {
|
||||
if (Sun.getSingleton().reactRouter) {
|
||||
Sun.getSingleton().reactRouter.go(-1)
|
||||
} else {
|
||||
console.error("全局的 reactRouter 未定义,请检查代码!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//******************* 和全局视图相关的方法 结束 *******************//
|
||||
//******************* 和路由相关的方法 结束 *******************//
|
||||
|
||||
//*******************和全局视图相关的方法 开始 *******************//
|
||||
/**
|
||||
* 刷新主框架内容
|
||||
*/
|
||||
static updateFrame() {
|
||||
if (Sun.getSingleton().frameComponent) {
|
||||
Sun.getSingleton().frameComponent.updateUI()
|
||||
} else {
|
||||
console.error("全局的 frameComponent 未定义,请检查代码!")
|
||||
}
|
||||
}
|
||||
|
||||
//******************* 和全局视图相关的方法 结束 *******************//
|
||||
}
|
||||
|
||||
@@ -1,375 +1,375 @@
|
||||
let LangEn = {
|
||||
eyeblueTank: "EyeblueTank",
|
||||
dashboard: {
|
||||
totalInvokeNum: 'Total PV',
|
||||
weekRate: 'Week',
|
||||
dayRate: 'Day',
|
||||
yesterdayInvoke: 'Yesterday PV',
|
||||
totalUV: 'Total UV',
|
||||
yesterdayUV: 'Yesterday UV',
|
||||
totalMatterNum: 'Total file num',
|
||||
yesterdayMatterNum: 'Yesterday File Num',
|
||||
totalFileSize: 'Total File Size',
|
||||
yesterdayMatterSize: 'Yesterday File Size',
|
||||
recentDayInvokeUV: 'Recent {} days PV/UV',
|
||||
downloadMatterTop10: 'File download TOP10',
|
||||
activeIpTop10: 'Active IP TOP10',
|
||||
loading: 'loading...',
|
||||
date: 'Date',
|
||||
num: 'Num',
|
||||
warnHint: 'Hint: data in this page updates everyday at 0.a.m. ',
|
||||
reRun: 'ReRun',
|
||||
},
|
||||
install: {
|
||||
configMysql: "Config Database",
|
||||
dbType: "Database Type",
|
||||
port: "Port",
|
||||
schema: "Schema",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
charset: "Charset",
|
||||
mysqlConnectionPass: "Connect MySQL Ok",
|
||||
testMysqlConnection: "Tes MySQL Connection",
|
||||
notice: "Notice",
|
||||
sqliteNotice1: "Sqlite is a tiny file database, you can use it without installation",
|
||||
mysqlNotice1: "If Mysql and EyeblueTank installed on the same server, Host is 127.0.0.1",
|
||||
mysqlNotice2: "Your mysql account must have access to create table, or the second step will fail.",
|
||||
validateMysqlFirst: "Please test the mysql connection firstly.",
|
||||
preStep: "Pre Step",
|
||||
nextStep: "Next Step",
|
||||
createTable: "Craete Tables",
|
||||
installed: "Installed",
|
||||
installedButMissing: "Installed, but missing fields",
|
||||
toBeInstalled: "To be installed",
|
||||
allFields: "All fields",
|
||||
missingFields: "Missing fields",
|
||||
tableNotice: "'Create Tables' will trigger the following actions:",
|
||||
tableNotice1: "If a table not exist, create it.",
|
||||
tableNotice2: "If a table exist and no fields missing, nothing will do on this table.",
|
||||
tableNotice3: "If a table exist but some fields is missing, it will add the missing fields.",
|
||||
tableNotice4: "If a table exist and some fields not necessary, nothing will do on this table.",
|
||||
oneKeyCreate: "Create Tables",
|
||||
createFinish: "Finish Creating Tables",
|
||||
createTableSuccess: "Create tables successfully",
|
||||
crateTableFirst: "Please click 'Create Tables'",
|
||||
setAdministrator: "Config Administrator",
|
||||
detectAdministrator: "Detect the following administrators:",
|
||||
useOrCreateAdministrator: "You can validate one of them, or you can create a new one.",
|
||||
validateAdministrator: "Validate administrator",
|
||||
createAdministrator: "Create administrator",
|
||||
administratorUsername: "username",
|
||||
administratorPassword: "password",
|
||||
administratorRePassword: "Enter administrator password again",
|
||||
usernameRule: "EyeblueTank will use username as directory name, so only lowercase letter and number and _ is permitted.",
|
||||
congratulationInstall: "Congratulations, install successfully!",
|
||||
configAdminFirst: "Please config administrator first.",
|
||||
createAdminSuccess: "Create administrator successfully!",
|
||||
validateAdminSuccess: "Validate administrator successfully!",
|
||||
pressToHome: "Click the button below to enter home。",
|
||||
enterHome: "Finish And Enter Home",
|
||||
finish: "Finish",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "Files",
|
||||
myShare: "My Share",
|
||||
bin: "Recycle bin",
|
||||
setting: "Setting",
|
||||
dashboard: "Dashboard",
|
||||
users: "Users",
|
||||
logout: "Logout",
|
||||
about: "About",
|
||||
install: "Install",
|
||||
dragMouseUp: "Put file here~"
|
||||
},
|
||||
matter: {
|
||||
file: "File",
|
||||
directory: "Directory",
|
||||
rename: "Rename",
|
||||
download: "Download",
|
||||
delete: "Delete",
|
||||
hardDelete: "Hard delete",
|
||||
recovery: "Recovery",
|
||||
more: "More",
|
||||
share: "Share",
|
||||
close: "Close",
|
||||
size: "Size",
|
||||
preview: "Preview",
|
||||
move: "Move",
|
||||
moveTo: "MoveTo",
|
||||
upload: "Upload",
|
||||
create: "Create",
|
||||
createTime: "Create Time",
|
||||
updateTime: "Update Time",
|
||||
deleteTime: "Deleted Time",
|
||||
root: "Root",
|
||||
fillInPicLink: "Fill in Picture Link",
|
||||
rePick: "Re Choose",
|
||||
chooseImage: "Choose Image",
|
||||
uploadMode: "Upload Mode",
|
||||
fillMode: "Fill Mode",
|
||||
sizeExceedLimit: "File size exceed limit {}>{}",
|
||||
dropNotDirectory: "Cannot drag and drop folders for uploading",
|
||||
setPublic: "Set as public",
|
||||
setPrivate: "Set as private",
|
||||
copyLink: "Copy Link",
|
||||
enterName: "Please enter name",
|
||||
publicFileEveryoneCanVisit: "Public file, anyone can access",
|
||||
fileDetail: "File info",
|
||||
expire: "Expire",
|
||||
copyLinkAndCode: "Copy link and code",
|
||||
uploaded: "Uploaded",
|
||||
uploadDir: 'Upload dir',
|
||||
uploadInfo: 'Upload Info',
|
||||
uploadErrorInfo: 'Some files failed to upload, you can export CSV files for viewing',
|
||||
exportCSV: 'Export upload error detail',
|
||||
speed: "Speed",
|
||||
fileInfo: "File basic info",
|
||||
fileName: "Filename",
|
||||
path: "Path",
|
||||
copyPath: "Copy path",
|
||||
publicOrPrivate: "Public or private",
|
||||
privateInfo: "Private file, only self or auth user can download",
|
||||
publicInfo: "Public file, anyone can download",
|
||||
downloadTimes: "Download times",
|
||||
operations: "Operation",
|
||||
oneTimeLink: "One time link",
|
||||
oneTimeLinkInfo: "One time link will expire after downloading, click to copy",
|
||||
imageCache: "Image cache",
|
||||
searchFile: "Search file",
|
||||
noContentYet: "No content under this directory yet",
|
||||
allFiles: "All Files",
|
||||
newDirectory: "New directory",
|
||||
notChoose: "Not choose any file",
|
||||
exceed1000: "Exceed file limit 1000",
|
||||
noImageCache: "No image cache",
|
||||
recycleBin: "Recycle bin",
|
||||
deleted: "Deleted",
|
||||
unCompatibleBrowser: "The current browser does not support it. Please try choose another one",
|
||||
canIUse: "To see if the current browser supports it",
|
||||
intoRecycleBin: "Recycle bin",
|
||||
finishingTip: "Please wait while files are sorted..."
|
||||
},
|
||||
router: {
|
||||
allFiles: "All Files",
|
||||
fileDetail: "File Detail",
|
||||
login: "Login",
|
||||
autoLogin: "Auto Login",
|
||||
register: "Register",
|
||||
users: "Users",
|
||||
userDetail: "User Detail",
|
||||
changePassword: "Change password",
|
||||
editUser: "Edit User",
|
||||
createUser: "Create User",
|
||||
shareDetail: "Share Detail",
|
||||
myShare: "My Share",
|
||||
dashboard: "Dashboard",
|
||||
install: "Install",
|
||||
setting: "Setting"
|
||||
},
|
||||
preference: {
|
||||
basic: "Base Info",
|
||||
preview: "Preview Conf",
|
||||
scan: "Scan Disk",
|
||||
websiteName: "Website Name",
|
||||
logo: "Logo",
|
||||
logoSquare: "Logo will be cropped to square size",
|
||||
onlyAllowIco: "Only .ico allowed",
|
||||
copyright: "Copyright (support html)",
|
||||
extraInfo: "Extra info (support html)",
|
||||
zipMaxNumLimit: "Zip download max num limit",
|
||||
zipMaxSizeLimit: "Zip download max size limit(B)",
|
||||
current: "Current",
|
||||
noLimit: "No limit",
|
||||
userDefaultSizeLimit: "User default size limit(B) ",
|
||||
matterBinDefaultSaveDay: "Matter bin storage days",
|
||||
enterMatterBinDefaultSaveDay: "Please enter matter bin storage days!",
|
||||
docLink: "Document Link",
|
||||
tankDocLink: "https://tank-doc.eyeblue.cn",
|
||||
allowRegister: "Allow register",
|
||||
systemCleanup: "System Cleanup",
|
||||
systemCleanupDescription: "This operation will cleanup everything except administrators' data",
|
||||
systemCleanupPrompt: "This operation will cleanup everything except administrators' account data, please input login password.",
|
||||
previewConfig: "File Preview Config",
|
||||
editPreference: "Edit Preference",
|
||||
editPreviewEngine: "Edit Preview engine",
|
||||
enterWebsiteName: "Please enter website name!",
|
||||
enterZipMaxNumLimit: "Please enter zip max num!",
|
||||
enterZipMaxSizeLimit: "Please enter zip max size!",
|
||||
enterUserDefaultSizeLimit: "Please enter user's default size!",
|
||||
engine: "The number {} engine",
|
||||
noEngine: "No preview engine",
|
||||
newEngine: "Add a preview engine",
|
||||
engineReg: "Engine format",
|
||||
engineSuffix: "Engine suffix",
|
||||
enginePreview: "Engine preview",
|
||||
defaultPreview: "Default preview engine",
|
||||
previewEngine: "Number {} preview engine",
|
||||
defaultPreviewDesc: "Default preview engine, can not be removed",
|
||||
engineUsageHint: "Previewing a file using the first engine matches the extentions.",
|
||||
engineRegHelper: "template syntax, {url} represents the file path, the preview will automatically replace with the corresponding file url",
|
||||
engineRegPlaceHolder: "eg:https://xxx.xxx.xxx?url={url}",
|
||||
engineSuffixPlaceHolder: "suffix can not be null, split by comma, look like: doc,ppt,xls",
|
||||
previewCurrent: "preview in current page",
|
||||
previewOpen: "preview in new page",
|
||||
editScan: "Edit Scan disk",
|
||||
enableScan: "Enable Scan disk",
|
||||
disabledScan: "Disabled Scan disk",
|
||||
scanCron: "Regularly Scan disk",
|
||||
cron: "Cron expression",
|
||||
cronValidate: "Cron expression can not be null",
|
||||
scanScope: "Scan scope",
|
||||
scanUsers: "Scan users",
|
||||
scanPerTenSeconds: "Scan every ten seconds",
|
||||
scanPerThirtySeconds: "Scan every thirty seconds",
|
||||
scanPerMinute: "Scan every minute",
|
||||
scanPerHour: "Scan every hour",
|
||||
scanCustom: "Scan custom",
|
||||
chooseUsers: "Fuzzy search users",
|
||||
chooseUsersValidate: "choose one more user",
|
||||
scanLoading: "waiting...",
|
||||
matterBinDefaultTip: "set zero means to turn off the recycle bin"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "Share Detail",
|
||||
shareTime: "Share Time",
|
||||
expireTime: "Expire Time",
|
||||
noExpire: "Never Expire",
|
||||
expired: "Expired",
|
||||
copyLinkAndCode: "Copy Link And Code",
|
||||
shareSuccess: "Share Successfully",
|
||||
sharer: "Share Person",
|
||||
link: "Link",
|
||||
copyLink: "Copy Link",
|
||||
code: "Code",
|
||||
copyCode: "Copy Code",
|
||||
copySuccess: "Copy Successfully",
|
||||
more: "More",
|
||||
cancelShare: "Cancel Share",
|
||||
getLink: "Get Link",
|
||||
allFiles: "All Files",
|
||||
noContent: "No content in this directory",
|
||||
enterCode: "Please enter code",
|
||||
getFiles: "Get Files",
|
||||
codeError: "Code Error",
|
||||
cancelPrompt: "This operation will cancel sharing forever, continue?",
|
||||
hour: "1 Hour",
|
||||
day: "1 Day",
|
||||
week: "1 Week",
|
||||
month: "1 Month",
|
||||
year: "1 Year",
|
||||
infinity: "Forever",
|
||||
emptyHint: "No Share Yet",
|
||||
},
|
||||
user: {
|
||||
redirecting: "Redirecting...",
|
||||
oldPassword: "Old Password",
|
||||
newPassword: "New Password",
|
||||
confirmNewPassword: "Confirm New Password",
|
||||
cannotBeNull: "Cannot be null!",
|
||||
passwordNotSame: "passwords above not same!",
|
||||
role: "Role",
|
||||
singleFileSizeLimit: "Single File Limit",
|
||||
totalFileSizeLimit: "Total Space Limit",
|
||||
current: "Current",
|
||||
noLimit: "No Limit",
|
||||
totalFileSize: "Used Space",
|
||||
status: "Status",
|
||||
lastLogin: "Last Login",
|
||||
lastLoginIp: "Last Login Ip",
|
||||
lastLoginTime: "Last Login Time",
|
||||
resetPassword: "Reset Password",
|
||||
transfiguration: "Transfiguration",
|
||||
changePassword: "Edit Password",
|
||||
enterPassword: "Please Enter Password",
|
||||
enterUsername: "Please Enter Username",
|
||||
enterNewPassword: "Please Enter New Password",
|
||||
profile: "Profile",
|
||||
avatar: "Avatar",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
confirmPassword: "Confirm Password",
|
||||
disabled: "Disabled",
|
||||
disableUser: "Disable this user",
|
||||
disable: "Disable",
|
||||
active: "Active",
|
||||
sync: "Sync",
|
||||
activeUser: "Active this user",
|
||||
deleteUser: "Delete this user",
|
||||
deleteHint: "This action will delete {}'s all records, including files,shares,user infos etc. Continue?",
|
||||
welcomeLogin: "Welcome Login",
|
||||
logining: "Login...",
|
||||
login: "Login",
|
||||
loginSuccess: "Login Success",
|
||||
toToRegister: "Go To Register",
|
||||
welcomeRegister: "Welcome Register",
|
||||
registering: "Login...",
|
||||
register: "Register",
|
||||
goToLogin: "Go To Login",
|
||||
roleGuest: "Guest",
|
||||
roleUser: "User",
|
||||
roleAdministrator: "Administrator",
|
||||
statusActive: "Ok",
|
||||
statusDisabled: "Disabled",
|
||||
webdavLink: "WebDAV Link",
|
||||
docLink: "Document Link",
|
||||
createUser: "Create User",
|
||||
editUser: "Edit User",
|
||||
editSomebodyPassword: "Edit {}'s Password",
|
||||
transfigurationPromptText: "Transfiguration Prompt",
|
||||
transfigurationPrompt: "You will login as this user.Please visit this link in other browser, if in current browser, you will logout.",
|
||||
allUsers: "All users",
|
||||
partialUsers: "Partial users",
|
||||
searchUser: "Search user"
|
||||
},
|
||||
model: {
|
||||
usernameRule: "only lowercase letter and number and _ is permitted.",
|
||||
passwordRule: "Password must have more than 6 chars",
|
||||
linkCodeText: "Link:{} Code:{}",
|
||||
copyLinkCodeSuccess: "Copy Link and Code successfully",
|
||||
eyeblueTank: "EyeblueTank",
|
||||
dashboard: {
|
||||
totalInvokeNum: 'Total PV',
|
||||
weekRate: 'Week',
|
||||
dayRate: 'Day',
|
||||
yesterdayInvoke: 'Yesterday PV',
|
||||
totalUV: 'Total UV',
|
||||
yesterdayUV: 'Yesterday UV',
|
||||
totalMatterNum: 'Total file num',
|
||||
yesterdayMatterNum: 'Yesterday File Num',
|
||||
totalFileSize: 'Total File Size',
|
||||
yesterdayMatterSize: 'Yesterday File Size',
|
||||
recentDayInvokeUV: 'Recent {} days PV/UV',
|
||||
downloadMatterTop10: 'File download TOP10',
|
||||
activeIpTop10: 'Active IP TOP10',
|
||||
loading: 'loading...',
|
||||
date: 'Date',
|
||||
num: 'Num',
|
||||
warnHint: 'Hint: data in this page updates everyday at 0.a.m. ',
|
||||
reRun: 'ReRun',
|
||||
},
|
||||
install: {
|
||||
configMysql: "Config Database",
|
||||
dbType: "Database Type",
|
||||
port: "Port",
|
||||
schema: "Schema",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
charset: "Charset",
|
||||
mysqlConnectionPass: "Connect MySQL Ok",
|
||||
testMysqlConnection: "Tes MySQL Connection",
|
||||
notice: "Notice",
|
||||
sqliteNotice1: "Sqlite is a tiny file database, you can use it without installation",
|
||||
mysqlNotice1: "If Mysql and EyeblueTank installed on the same server, Host is 127.0.0.1",
|
||||
mysqlNotice2: "Your mysql account must have access to create table, or the second step will fail.",
|
||||
validateMysqlFirst: "Please test the mysql connection firstly.",
|
||||
preStep: "Pre Step",
|
||||
nextStep: "Next Step",
|
||||
createTable: "Craete Tables",
|
||||
installed: "Installed",
|
||||
installedButMissing: "Installed, but missing fields",
|
||||
toBeInstalled: "To be installed",
|
||||
allFields: "All fields",
|
||||
missingFields: "Missing fields",
|
||||
tableNotice: "'Create Tables' will trigger the following actions:",
|
||||
tableNotice1: "If a table not exist, create it.",
|
||||
tableNotice2: "If a table exist and no fields missing, nothing will do on this table.",
|
||||
tableNotice3: "If a table exist but some fields is missing, it will add the missing fields.",
|
||||
tableNotice4: "If a table exist and some fields not necessary, nothing will do on this table.",
|
||||
oneKeyCreate: "Create Tables",
|
||||
createFinish: "Finish Creating Tables",
|
||||
createTableSuccess: "Create tables successfully",
|
||||
crateTableFirst: "Please click 'Create Tables'",
|
||||
setAdministrator: "Config Administrator",
|
||||
detectAdministrator: "Detect the following administrators:",
|
||||
useOrCreateAdministrator: "You can validate one of them, or you can create a new one.",
|
||||
validateAdministrator: "Validate administrator",
|
||||
createAdministrator: "Create administrator",
|
||||
administratorUsername: "username",
|
||||
administratorPassword: "password",
|
||||
administratorRePassword: "Enter administrator password again",
|
||||
usernameRule: "EyeblueTank will use username as directory name, so only lowercase letter and number and _ is permitted.",
|
||||
congratulationInstall: "Congratulations, install successfully!",
|
||||
configAdminFirst: "Please config administrator first.",
|
||||
createAdminSuccess: "Create administrator successfully!",
|
||||
validateAdminSuccess: "Validate administrator successfully!",
|
||||
pressToHome: "Click the button below to enter home。",
|
||||
enterHome: "Finish And Enter Home",
|
||||
finish: "Finish",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "Files",
|
||||
myShare: "My Share",
|
||||
bin: "Recycle bin",
|
||||
setting: "Setting",
|
||||
dashboard: "Dashboard",
|
||||
users: "Users",
|
||||
logout: "Logout",
|
||||
about: "About",
|
||||
install: "Install",
|
||||
dragMouseUp: "Put file here~"
|
||||
},
|
||||
matter: {
|
||||
file: "File",
|
||||
directory: "Directory",
|
||||
rename: "Rename",
|
||||
download: "Download",
|
||||
delete: "Delete",
|
||||
hardDelete: "Hard delete",
|
||||
recovery: "Recovery",
|
||||
more: "More",
|
||||
share: "Share",
|
||||
close: "Close",
|
||||
size: "Size",
|
||||
preview: "Preview",
|
||||
move: "Move",
|
||||
moveTo: "MoveTo",
|
||||
upload: "Upload",
|
||||
create: "Create",
|
||||
createTime: "Create Time",
|
||||
updateTime: "Update Time",
|
||||
deleteTime: "Deleted Time",
|
||||
root: "Root",
|
||||
fillInPicLink: "Fill in Picture Link",
|
||||
rePick: "Re Choose",
|
||||
chooseImage: "Choose Image",
|
||||
uploadMode: "Upload Mode",
|
||||
fillMode: "Fill Mode",
|
||||
sizeExceedLimit: "File size exceed limit {}>{}",
|
||||
dropNotDirectory: "Cannot drag and drop folders for uploading",
|
||||
setPublic: "Set as public",
|
||||
setPrivate: "Set as private",
|
||||
copyLink: "Copy Link",
|
||||
enterName: "Please enter name",
|
||||
publicFileEveryoneCanVisit: "Public file, anyone can access",
|
||||
fileDetail: "File info",
|
||||
expire: "Expire",
|
||||
copyLinkAndCode: "Copy link and code",
|
||||
uploaded: "Uploaded",
|
||||
uploadDir: 'Upload dir',
|
||||
uploadInfo: 'Upload Info',
|
||||
uploadErrorInfo: 'Some files failed to upload, you can export CSV files for viewing',
|
||||
exportCSV: 'Export upload error detail',
|
||||
speed: "Speed",
|
||||
fileInfo: "File basic info",
|
||||
fileName: "Filename",
|
||||
path: "Path",
|
||||
copyPath: "Copy path",
|
||||
publicOrPrivate: "Public or private",
|
||||
privateInfo: "Private file, only self or auth user can download",
|
||||
publicInfo: "Public file, anyone can download",
|
||||
downloadTimes: "Download times",
|
||||
operations: "Operation",
|
||||
oneTimeLink: "One time link",
|
||||
oneTimeLinkInfo: "One time link will expire after downloading, click to copy",
|
||||
imageCache: "Image cache",
|
||||
searchFile: "Search file",
|
||||
noContentYet: "No content under this directory yet",
|
||||
allFiles: "All Files",
|
||||
newDirectory: "New directory",
|
||||
notChoose: "Not choose any file",
|
||||
exceed1000: "Exceed file limit 1000",
|
||||
noImageCache: "No image cache",
|
||||
recycleBin: "Recycle bin",
|
||||
deleted: "Deleted",
|
||||
unCompatibleBrowser: "The current browser does not support it. Please try choose another one",
|
||||
canIUse: "To see if the current browser supports it",
|
||||
intoRecycleBin: "Recycle bin",
|
||||
finishingTip: "Please wait while files are sorted..."
|
||||
},
|
||||
router: {
|
||||
allFiles: "All Files",
|
||||
fileDetail: "File Detail",
|
||||
login: "Login",
|
||||
autoLogin: "Auto Login",
|
||||
register: "Register",
|
||||
users: "Users",
|
||||
userDetail: "User Detail",
|
||||
changePassword: "Change password",
|
||||
editUser: "Edit User",
|
||||
createUser: "Create User",
|
||||
shareDetail: "Share Detail",
|
||||
myShare: "My Share",
|
||||
dashboard: "Dashboard",
|
||||
install: "Install",
|
||||
setting: "Setting"
|
||||
},
|
||||
preference: {
|
||||
basic: "Base Info",
|
||||
preview: "Preview Conf",
|
||||
scan: "Scan Disk",
|
||||
websiteName: "Website Name",
|
||||
logo: "Logo",
|
||||
logoSquare: "Logo will be cropped to square size",
|
||||
onlyAllowIco: "Only .ico allowed",
|
||||
copyright: "Copyright (support html)",
|
||||
extraInfo: "Extra info (support html)",
|
||||
zipMaxNumLimit: "Zip download max num limit",
|
||||
zipMaxSizeLimit: "Zip download max size limit(B)",
|
||||
current: "Current",
|
||||
noLimit: "No limit",
|
||||
userDefaultSizeLimit: "User default size limit(B) ",
|
||||
matterBinDefaultSaveDay: "Matter bin storage days",
|
||||
enterMatterBinDefaultSaveDay: "Please enter matter bin storage days!",
|
||||
docLink: "Document Link",
|
||||
tankDocLink: "https://tank-doc.eyeblue.cn",
|
||||
allowRegister: "Allow register",
|
||||
systemCleanup: "System Cleanup",
|
||||
systemCleanupDescription: "This operation will cleanup everything except administrators' data",
|
||||
systemCleanupPrompt: "This operation will cleanup everything except administrators' account data, please input login password.",
|
||||
previewConfig: "File Preview Config",
|
||||
editPreference: "Edit Preference",
|
||||
editPreviewEngine: "Edit Preview engine",
|
||||
enterWebsiteName: "Please enter website name!",
|
||||
enterZipMaxNumLimit: "Please enter zip max num!",
|
||||
enterZipMaxSizeLimit: "Please enter zip max size!",
|
||||
enterUserDefaultSizeLimit: "Please enter user's default size!",
|
||||
engine: "The number {} engine",
|
||||
noEngine: "No preview engine",
|
||||
newEngine: "Add a preview engine",
|
||||
engineReg: "Engine format",
|
||||
engineSuffix: "Engine suffix",
|
||||
enginePreview: "Engine preview",
|
||||
defaultPreview: "Default preview engine",
|
||||
previewEngine: "Number {} preview engine",
|
||||
defaultPreviewDesc: "Default preview engine, can not be removed",
|
||||
engineUsageHint: "Previewing a file using the first engine matches the extentions.",
|
||||
engineRegHelper: "template syntax, {url} represents the file path, the preview will automatically replace with the corresponding file url",
|
||||
engineRegPlaceHolder: "eg:https://xxx.xxx.xxx?url={url}",
|
||||
engineSuffixPlaceHolder: "suffix can not be null, split by comma, look like: doc,ppt,xls",
|
||||
previewCurrent: "preview in current page",
|
||||
previewOpen: "preview in new page",
|
||||
editScan: "Edit Scan disk",
|
||||
enableScan: "Enable Scan disk",
|
||||
disabledScan: "Disabled Scan disk",
|
||||
scanCron: "Regularly Scan disk",
|
||||
cron: "Cron expression",
|
||||
cronValidate: "Cron expression can not be null",
|
||||
scanScope: "Scan scope",
|
||||
scanUsers: "Scan users",
|
||||
scanPerTenSeconds: "Scan every ten seconds",
|
||||
scanPerThirtySeconds: "Scan every thirty seconds",
|
||||
scanPerMinute: "Scan every minute",
|
||||
scanPerHour: "Scan every hour",
|
||||
scanCustom: "Scan custom",
|
||||
chooseUsers: "Fuzzy search users",
|
||||
chooseUsersValidate: "choose one more user",
|
||||
scanLoading: "waiting...",
|
||||
matterBinDefaultTip: "set zero means to turn off the recycle bin"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "Share Detail",
|
||||
shareTime: "Share Time",
|
||||
expireTime: "Expire Time",
|
||||
noExpire: "Never Expire",
|
||||
expired: "Expired",
|
||||
copyLinkAndCode: "Copy Link And Code",
|
||||
shareSuccess: "Share Successfully",
|
||||
sharer: "Share Person",
|
||||
link: "Link",
|
||||
copyLink: "Copy Link",
|
||||
code: "Code",
|
||||
copyCode: "Copy Code",
|
||||
copySuccess: "Copy Successfully",
|
||||
more: "More",
|
||||
cancelShare: "Cancel Share",
|
||||
getLink: "Get Link",
|
||||
allFiles: "All Files",
|
||||
noContent: "No content in this directory",
|
||||
enterCode: "Please enter code",
|
||||
getFiles: "Get Files",
|
||||
codeError: "Code Error",
|
||||
cancelPrompt: "This operation will cancel sharing forever, continue?",
|
||||
hour: "1 Hour",
|
||||
day: "1 Day",
|
||||
week: "1 Week",
|
||||
month: "1 Month",
|
||||
year: "1 Year",
|
||||
infinity: "Forever",
|
||||
emptyHint: "No Share Yet",
|
||||
},
|
||||
user: {
|
||||
redirecting: "Redirecting...",
|
||||
oldPassword: "Old Password",
|
||||
newPassword: "New Password",
|
||||
confirmNewPassword: "Confirm New Password",
|
||||
cannotBeNull: "Cannot be null!",
|
||||
passwordNotSame: "passwords above not same!",
|
||||
role: "Role",
|
||||
singleFileSizeLimit: "Single File Limit",
|
||||
totalFileSizeLimit: "Total Space Limit",
|
||||
current: "Current",
|
||||
noLimit: "No Limit",
|
||||
totalFileSize: "Used Space",
|
||||
status: "Status",
|
||||
lastLogin: "Last Login",
|
||||
lastLoginIp: "Last Login Ip",
|
||||
lastLoginTime: "Last Login Time",
|
||||
resetPassword: "Reset Password",
|
||||
transfiguration: "Transfiguration",
|
||||
changePassword: "Edit Password",
|
||||
enterPassword: "Please Enter Password",
|
||||
enterUsername: "Please Enter Username",
|
||||
enterNewPassword: "Please Enter New Password",
|
||||
profile: "Profile",
|
||||
avatar: "Avatar",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
confirmPassword: "Confirm Password",
|
||||
disabled: "Disabled",
|
||||
disableUser: "Disable this user",
|
||||
disable: "Disable",
|
||||
active: "Active",
|
||||
sync: "Sync",
|
||||
activeUser: "Active this user",
|
||||
deleteUser: "Delete this user",
|
||||
deleteHint: "This action will delete {}'s all records, including files,shares,user infos etc. Continue?",
|
||||
welcomeLogin: "Welcome Login",
|
||||
logining: "Login...",
|
||||
login: "Login",
|
||||
loginSuccess: "Login Success",
|
||||
toToRegister: "Go To Register",
|
||||
welcomeRegister: "Welcome Register",
|
||||
registering: "Login...",
|
||||
register: "Register",
|
||||
goToLogin: "Go To Login",
|
||||
roleGuest: "Guest",
|
||||
roleUser: "User",
|
||||
roleAdministrator: "Administrator",
|
||||
statusActive: "Ok",
|
||||
statusDisabled: "Disabled",
|
||||
webdavLink: "WebDAV Link",
|
||||
docLink: "Document Link",
|
||||
createUser: "Create User",
|
||||
editUser: "Edit User",
|
||||
editSomebodyPassword: "Edit {}'s Password",
|
||||
transfigurationPromptText: "Transfiguration Prompt",
|
||||
transfigurationPrompt: "You will login as this user.Please visit this link in other browser, if in current browser, you will logout.",
|
||||
allUsers: "All users",
|
||||
partialUsers: "Partial users",
|
||||
searchUser: "Search user"
|
||||
},
|
||||
model: {
|
||||
usernameRule: "only lowercase letter and number and _ is permitted.",
|
||||
passwordRule: "Password must have more than 6 chars",
|
||||
linkCodeText: "Link:{} Code:{}",
|
||||
copyLinkCodeSuccess: "Copy Link and Code successfully",
|
||||
|
||||
},
|
||||
plugin: {
|
||||
cannotPreview: "Cannot Preview",
|
||||
emptyHintDefault: "No Items",
|
||||
everyPage: "Every Page",
|
||||
items: "Items",
|
||||
total: "Total",
|
||||
clickRefresh: "Click To Refresh",
|
||||
},
|
||||
loading: "Loading",
|
||||
selectAll: "All",
|
||||
edit: "Edit",
|
||||
createTime: "Create Time",
|
||||
download: "Download",
|
||||
close: "Close",
|
||||
required: "Required",
|
||||
cancel: "Cancel",
|
||||
delete: "Delete",
|
||||
actionCanNotRevertConfirm: "This action cannot be reverted, confirm?",
|
||||
actionDeleteConfirm: "Delete, confirm?",
|
||||
actionRecoveryConfirm: "Recovery, confirm?",
|
||||
prompt: "Prompt",
|
||||
confirm: "Confirm",
|
||||
copy: "Copy",
|
||||
copySuccess: "Copy Success!",
|
||||
copyError: "Copy Error!",
|
||||
showMore: "Show More",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
submit: "Submit",
|
||||
save: "Save",
|
||||
create: "Create",
|
||||
finish: "Finish",
|
||||
operationSuccess: "Operation success",
|
||||
operation: "Operation",
|
||||
notFound: "404 Not Found",
|
||||
login: "Login",
|
||||
logout: "Logout",
|
||||
yes: "Yes",
|
||||
no: "No",
|
||||
all: "All",
|
||||
refresh: "refresh",
|
||||
inputRequired: "Input required",
|
||||
},
|
||||
plugin: {
|
||||
cannotPreview: "Cannot Preview",
|
||||
emptyHintDefault: "No Items",
|
||||
everyPage: "Every Page",
|
||||
items: "Items",
|
||||
total: "Total",
|
||||
clickRefresh: "Click To Refresh",
|
||||
},
|
||||
loading: "Loading",
|
||||
selectAll: "All",
|
||||
edit: "Edit",
|
||||
createTime: "Create Time",
|
||||
download: "Download",
|
||||
close: "Close",
|
||||
required: "Required",
|
||||
cancel: "Cancel",
|
||||
delete: "Delete",
|
||||
actionCanNotRevertConfirm: "This action cannot be reverted, confirm?",
|
||||
actionDeleteConfirm: "Delete, confirm?",
|
||||
actionRecoveryConfirm: "Recovery, confirm?",
|
||||
prompt: "Prompt",
|
||||
confirm: "Confirm",
|
||||
copy: "Copy",
|
||||
copySuccess: "Copy Success!",
|
||||
copyError: "Copy Error!",
|
||||
showMore: "Show More",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
submit: "Submit",
|
||||
save: "Save",
|
||||
create: "Create",
|
||||
finish: "Finish",
|
||||
operationSuccess: "Operation success",
|
||||
operation: "Operation",
|
||||
notFound: "404 Not Found",
|
||||
login: "Login",
|
||||
logout: "Logout",
|
||||
yes: "Yes",
|
||||
no: "No",
|
||||
all: "All",
|
||||
refresh: "refresh",
|
||||
inputRequired: "Input required",
|
||||
}
|
||||
|
||||
export default LangEn
|
||||
|
||||
@@ -1,376 +1,376 @@
|
||||
let LangZh = {
|
||||
eyeblueTank: "蓝眼云盘",
|
||||
dashboard: {
|
||||
totalInvokeNum: '总PV',
|
||||
weekRate: '周环比',
|
||||
dayRate: '日环比',
|
||||
yesterdayInvoke: '昨日PV',
|
||||
totalUV: '总UV',
|
||||
yesterdayUV: '昨日UV',
|
||||
totalMatterNum: '总文件数',
|
||||
yesterdayMatterNum: '昨日文件数',
|
||||
totalFileSize: '文件总大小',
|
||||
yesterdayMatterSize: '昨日文件大小',
|
||||
recentDayInvokeUV: '最近{}日PV/UV',
|
||||
downloadMatterTop10: '文件下载量TOP10',
|
||||
activeIpTop10: '活跃IP TOP10',
|
||||
loading: '加载中…',
|
||||
date: '日期',
|
||||
num: '数量',
|
||||
warnHint: '温馨提示:本页面数据每日凌晨0点清洗一次。',
|
||||
reRun: '立即重跑',
|
||||
},
|
||||
install: {
|
||||
configMysql: "配置数据库",
|
||||
dbType: "数据库类型",
|
||||
port: "端口",
|
||||
schema: "库名",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
charset: "编码",
|
||||
mysqlConnectionPass: "MySQL连接测试通过",
|
||||
testMysqlConnection: "测试MySQL连接",
|
||||
notice: "注意",
|
||||
sqliteNotice1: "sqlite是一个轻量的文件数据库,无需安装即可使用",
|
||||
mysqlNotice1: "如果数据库和蓝眼云盘安装在同一台服务器,Host可以直接填写 127.0.0.1。",
|
||||
mysqlNotice2: "数据库账户的权限要求要能够创建表,否则第二步\"创建表\"操作会出错",
|
||||
validateMysqlFirst: "请首先验证数据库连接",
|
||||
preStep: "上一步",
|
||||
nextStep: "下一步",
|
||||
createTable: "创建表",
|
||||
installed: "已安装",
|
||||
installedButMissing: "已安装,字段缺失",
|
||||
toBeInstalled: "待安装",
|
||||
allFields: "所有字段",
|
||||
missingFields: "缺失字段",
|
||||
tableNotice: "点击\"一键建表\"后会按照以下逻辑执行操作:",
|
||||
tableNotice1: "如果某表不存在,则直接创建表。",
|
||||
tableNotice2: "如果某表存在并且字段齐全,那么不会对该表做任何操作。",
|
||||
tableNotice3: "如果某表存在但是部分字段缺失,那么会在该表中增加缺失字段。",
|
||||
tableNotice4: "如果表中有多余的字段(多余字段即不是蓝眼云盘需要的字段),不会做删除处理,而会维持原样。",
|
||||
oneKeyCreate: "一键建表",
|
||||
createFinish: "建表完成",
|
||||
createTableSuccess: "建表成功",
|
||||
crateTableFirst: "请首先点击'一键建表'",
|
||||
setAdministrator: "设置管理员",
|
||||
detectAdministrator: "检测到系统中已经存在有以下管理员:",
|
||||
useOrCreateAdministrator: "你可以使用其中一位管理员的用户名和密码进行验证,或者创建一位新的管理员账户",
|
||||
validateAdministrator: "验证管理员账户",
|
||||
createAdministrator: "创建管理员账户",
|
||||
administratorUsername: "管理员用户名",
|
||||
administratorPassword: "管理员密码",
|
||||
administratorRePassword: "再次输入密码",
|
||||
usernameRule: "由于用户名将作为文件上传的目录,因此只允许字母数字以及\"_\"。",
|
||||
congratulationInstall: "恭喜,安装成功!",
|
||||
configAdminFirst: "请首先配置管理员信息!",
|
||||
createAdminSuccess: "创建管理员成功!",
|
||||
validateAdminSuccess: "验证管理员成功!",
|
||||
pressToHome: "点击下方按钮来完成安装过程并进入首页。",
|
||||
enterHome: "完成,并进入首页",
|
||||
finish: "完成",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "全部文件",
|
||||
myShare: "我的分享",
|
||||
bin: "回收站",
|
||||
setting: "网站设置",
|
||||
dashboard: "监控统计",
|
||||
users: "用户管理",
|
||||
logout: "退出登录",
|
||||
about: "关于",
|
||||
install: "安装网站",
|
||||
dragMouseUp: "可以松手啦~"
|
||||
},
|
||||
matter: {
|
||||
file: "文件",
|
||||
directory: "文件夹",
|
||||
rename: "重命名",
|
||||
download: "下载",
|
||||
delete: "删除",
|
||||
hardDelete: "彻底删除",
|
||||
recovery: "恢复",
|
||||
more: "更多",
|
||||
share: "分享",
|
||||
close: "关闭",
|
||||
size: "大小",
|
||||
preview: "预览",
|
||||
move: "移动",
|
||||
moveTo: "移动到",
|
||||
upload: "上传",
|
||||
create: "新建",
|
||||
createTime: "创建时间",
|
||||
updateTime: "修改时间",
|
||||
deleteTime: "删除时间",
|
||||
root: "根目录",
|
||||
fillInPicLink: "请填写图片链接",
|
||||
rePick: "重新选择",
|
||||
chooseImage: "选择图片",
|
||||
uploadMode: "上传模式",
|
||||
fillMode: "填写模式",
|
||||
sizeExceedLimit: "文件大小超过了限制{}>{}",
|
||||
dropNotDirectory: "不可拖拽文件夹进行上传",
|
||||
setPublic: "设置为公有文件",
|
||||
setPrivate: "设置为私有文件",
|
||||
copyLink: "复制下载链接",
|
||||
enterName: "请输入名称",
|
||||
publicFileEveryoneCanVisit: "公有文件,任何人可以访问",
|
||||
fileDetail: "文件详情",
|
||||
expire: "有效期",
|
||||
copyLinkAndCode: "复制链接+提取码",
|
||||
uploaded: "已上传",
|
||||
uploadDir: '上传文件夹',
|
||||
uploadInfo: '上传信息',
|
||||
uploadErrorInfo: '部分文件上传失败,可导出csv文件查看',
|
||||
exportCSV: '导出上传错误详情',
|
||||
speed: "速度",
|
||||
fileInfo: "文件基本信息",
|
||||
fileName: "文件名",
|
||||
path: "路径",
|
||||
copyPath: "复制路径",
|
||||
publicOrPrivate: "文件公开性",
|
||||
privateInfo: "私有文件,只有自己或者授权的用户可以下载",
|
||||
publicInfo: "公有文件,任何人可以通过链接下载",
|
||||
downloadTimes: "下载次数",
|
||||
operations: "操作",
|
||||
oneTimeLink: "一次性链接",
|
||||
oneTimeLinkInfo: "使用一次性链接下载后链接立即失效,可以分享这个链接给朋友,点击复制",
|
||||
imageCache: "图片缓存",
|
||||
searchFile: "搜索文件",
|
||||
noContentYet: "该目录下暂无任何内容",
|
||||
allFiles: "全部文件",
|
||||
newDirectory: "新建文件夹",
|
||||
notChoose: "没有选择文件",
|
||||
exceed1000: "最多只能同时选取1000个文件",
|
||||
noImageCache: "暂无图片缓存数据",
|
||||
recycleBin: "回收站",
|
||||
deleted: "已删除",
|
||||
unCompatibleBrowser: "当前浏览器不支持,请切换浏览器尝试",
|
||||
canIUse: "查看当前浏览器是否支持,点击跳转",
|
||||
intoRecycleBin: "放入回收站",
|
||||
finishingTip: "后台文件整理中,请稍候..."
|
||||
},
|
||||
router: {
|
||||
allFiles: "全部文件",
|
||||
fileDetail: "文件详情",
|
||||
login: "登录",
|
||||
autoLogin: "自动登录",
|
||||
register: "注册",
|
||||
users: "用户列表",
|
||||
userDetail: "用户详情",
|
||||
changePassword: "修改密码",
|
||||
editUser: "编辑用户",
|
||||
createUser: "创建用户",
|
||||
shareDetail: "分享详情",
|
||||
myShare: "我的分享",
|
||||
dashboard: "监控统计",
|
||||
install: "安装网站",
|
||||
setting: "网站设置"
|
||||
},
|
||||
preference: {
|
||||
basic: "基本信息",
|
||||
preview: "预览引擎",
|
||||
scan: "扫描磁盘",
|
||||
websiteName: "网站名称",
|
||||
logo: "Logo",
|
||||
logoSquare: "logo请使用正方形图片,否则在显示时会裁剪成正方形",
|
||||
onlyAllowIco: "只允许上传.ico图标",
|
||||
copyright: "版权信息(支持html)",
|
||||
extraInfo: "备案信息(支持html)",
|
||||
zipMaxNumLimit: "zip下载数量限制",
|
||||
zipMaxSizeLimit: "zip下载大小限制(B)",
|
||||
current: "当前值",
|
||||
noLimit: "无限制",
|
||||
userDefaultSizeLimit: "用户默认总大小限制(B) ",
|
||||
matterBinDefaultSaveDay: "回收站默认保留天数",
|
||||
enterMatterBinDefaultSaveDay: "默认回收站默认保留天数必填!",
|
||||
docLink: "文档链接",
|
||||
tankDocLink: "https://tank-doc.eyeblue.cn/zh",
|
||||
allowRegister: "允许自主注册",
|
||||
systemCleanup: "重置系统",
|
||||
systemCleanupDescription: "重置系统将清空除管理员账号外所有数据",
|
||||
systemCleanupPrompt: "重置系统将清空除管理员账号外所有数据,事关重大,请输入登录密码",
|
||||
previewConfig: "文件预览配置",
|
||||
editPreference: "设置网站偏好",
|
||||
editPreviewEngine: "设置预览引擎",
|
||||
enterWebsiteName: "请输入网站名称!",
|
||||
enterZipMaxNumLimit: "zip最大数量限制必填!",
|
||||
enterZipMaxSizeLimit: "zip大小限制必填!",
|
||||
enterUserDefaultSizeLimit: "默认用户空间大小必填!",
|
||||
engine: "{}号预览引擎",
|
||||
noEngine: "暂无在线预览引擎配置",
|
||||
newEngine: "添加一个预览引擎",
|
||||
engineReg: "引擎格式",
|
||||
engineSuffix: "匹配后缀",
|
||||
enginePreview: "预览方式",
|
||||
defaultPreview: "默认引擎",
|
||||
previewEngine: "{}号引擎",
|
||||
defaultPreviewDesc: "默认预览引擎,不可移除",
|
||||
engineRegHelper: "此处填写模板语法:{url}表示文件路径,预览时会自动替换成对应的文件url;{b64url}表示base64机密后的路径,适用于kkfileview;",
|
||||
engineUsageHint: "对于一个文件的预览,使用第一个匹配到后缀名的引擎,没有配匹到则使用系统默认预览引擎",
|
||||
engineRegPlaceHolder: "例如:https://xxx.xxx.xxx?url={url}",
|
||||
engineSuffixPlaceHolder: '输入后缀,使用逗号分隔,不用带. 例如:doc,ppt,xls',
|
||||
previewCurrent: "本站预览",
|
||||
previewOpen: "新标签打开",
|
||||
editScan: "设置磁盘扫描",
|
||||
enableScan: "开启磁盘扫描",
|
||||
disabledScan: "暂未开启磁盘扫描",
|
||||
scanCron: "定时扫描",
|
||||
cron: "cron表达式",
|
||||
cronValidate: "cron表达式不能为空",
|
||||
scanScope: "扫描范围",
|
||||
scanUsers: "扫描用户",
|
||||
scanPerTenSeconds: "每十秒",
|
||||
scanPerThirtySeconds: "每三十秒",
|
||||
scanPerMinute: "每分钟",
|
||||
scanPerHour: "每小时",
|
||||
scanCustom: "自定义",
|
||||
chooseUsers: "模糊搜索用户",
|
||||
chooseUsersValidate: "请选择至少一个用户",
|
||||
scanLoading: "扫描中,请稍后...",
|
||||
matterBinDefaultTip: "设置0表示关闭回收站功能"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "分享详情",
|
||||
shareTime: "分享时间",
|
||||
expireTime: "失效时间",
|
||||
noExpire: "永久有效",
|
||||
expired: "已过期",
|
||||
copyLinkAndCode: "复制链接+提取码",
|
||||
shareSuccess: "分享成功",
|
||||
sharer: "分享者",
|
||||
link: "链接",
|
||||
copyLink: "复制链接",
|
||||
code: "提取码",
|
||||
copyCode: "复制提取码",
|
||||
copySuccess: "复制成功",
|
||||
more: "更多",
|
||||
cancelShare: "取消分享",
|
||||
getLink: "获取链接",
|
||||
allFiles: "全部文件",
|
||||
noContent: "该目录下暂无任何内容",
|
||||
enterCode: "请输入提取码",
|
||||
getFiles: "提取文件",
|
||||
codeError: "提取码错误",
|
||||
cancelPrompt: "此操作将永久取消该分享, 是否继续?",
|
||||
hour: "1小时",
|
||||
day: "1天",
|
||||
week: "1周",
|
||||
month: "1个月",
|
||||
year: "1年",
|
||||
infinity: "永远有效",
|
||||
emptyHint: "暂无任何分享",
|
||||
},
|
||||
user: {
|
||||
redirecting: "正在转跳...",
|
||||
oldPassword: "旧密码",
|
||||
newPassword: "新密码",
|
||||
confirmNewPassword: "确认新密码",
|
||||
cannotBeNull: "不能为空!",
|
||||
passwordNotSame: "两次输入不一致!",
|
||||
role: "角色",
|
||||
singleFileSizeLimit: "单文件限制",
|
||||
totalFileSizeLimit: "空间限制",
|
||||
current: "当前值",
|
||||
noLimit: "无限制",
|
||||
totalFileSize: "已使用空间",
|
||||
status: "状态",
|
||||
lastLogin: "上次登录",
|
||||
lastLoginIp: "上次登录IP",
|
||||
lastLoginTime: "上次登录时间",
|
||||
resetPassword: "重置密码",
|
||||
transfiguration: "变身",
|
||||
changePassword: "修改密码",
|
||||
enterPassword: "输入密码",
|
||||
enterUsername: "请输入用户名",
|
||||
enterNewPassword: "请输入新密码",
|
||||
profile: "个人详情",
|
||||
avatar: "头像",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
confirmPassword: "确认密码",
|
||||
disabled: "已禁用",
|
||||
disableUser: "禁用该用户",
|
||||
activeUser: "激活该用户",
|
||||
deleteUser: "删除该用户",
|
||||
deleteHint: "此操作将删除用户【{}】的所有记录,包括文件,分享,用户信息等内容,确定继续?",
|
||||
disable: "禁用",
|
||||
sync: "同步",
|
||||
active: "激活",
|
||||
welcomeLogin: "欢迎登录",
|
||||
logining: "正在登录...",
|
||||
login: "登录",
|
||||
loginSuccess: "登录成功",
|
||||
toToRegister: "立即注册",
|
||||
welcomeRegister: "欢迎注册",
|
||||
registering: "正在登录...",
|
||||
register: "注册",
|
||||
goToLogin: "前往登录",
|
||||
roleGuest: "游客",
|
||||
roleUser: "注册用户",
|
||||
roleAdministrator: "管理员",
|
||||
statusActive: "正常",
|
||||
statusDisabled: "禁用",
|
||||
webdavLink: "WebDAV 地址",
|
||||
docLink: "文档链接",
|
||||
createUser: "创建用户",
|
||||
editUser: "编辑用户",
|
||||
editSomebodyPassword: "修改{}的密码",
|
||||
transfigurationPromptText: "变身提示",
|
||||
transfigurationPrompt: "您将使用该用户的身份登录。请复制以下链接到其他浏览器访问,在当前浏览器访问会导致当前用户登录信息失效。",
|
||||
allUsers: "全部用户",
|
||||
partialUsers: "局部用户",
|
||||
searchUser: "搜索用户"
|
||||
},
|
||||
model: {
|
||||
usernameRule: "用户名只能包含字母,数字和\"_\"",
|
||||
passwordRule: "密码长度至少为6位",
|
||||
linkCodeText: "链接:{} 提取码:{}",
|
||||
copyLinkCodeSuccess: "复制链接提取码成功",
|
||||
eyeblueTank: "蓝眼云盘",
|
||||
dashboard: {
|
||||
totalInvokeNum: '总PV',
|
||||
weekRate: '周环比',
|
||||
dayRate: '日环比',
|
||||
yesterdayInvoke: '昨日PV',
|
||||
totalUV: '总UV',
|
||||
yesterdayUV: '昨日UV',
|
||||
totalMatterNum: '总文件数',
|
||||
yesterdayMatterNum: '昨日文件数',
|
||||
totalFileSize: '文件总大小',
|
||||
yesterdayMatterSize: '昨日文件大小',
|
||||
recentDayInvokeUV: '最近{}日PV/UV',
|
||||
downloadMatterTop10: '文件下载量TOP10',
|
||||
activeIpTop10: '活跃IP TOP10',
|
||||
loading: '加载中…',
|
||||
date: '日期',
|
||||
num: '数量',
|
||||
warnHint: '温馨提示:本页面数据每日凌晨0点清洗一次。',
|
||||
reRun: '立即重跑',
|
||||
},
|
||||
install: {
|
||||
configMysql: "配置数据库",
|
||||
dbType: "数据库类型",
|
||||
port: "端口",
|
||||
schema: "库名",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
charset: "编码",
|
||||
mysqlConnectionPass: "MySQL连接测试通过",
|
||||
testMysqlConnection: "测试MySQL连接",
|
||||
notice: "注意",
|
||||
sqliteNotice1: "sqlite是一个轻量的文件数据库,无需安装即可使用",
|
||||
mysqlNotice1: "如果数据库和蓝眼云盘安装在同一台服务器,Host可以直接填写 127.0.0.1。",
|
||||
mysqlNotice2: "数据库账户的权限要求要能够创建表,否则第二步\"创建表\"操作会出错",
|
||||
validateMysqlFirst: "请首先验证数据库连接",
|
||||
preStep: "上一步",
|
||||
nextStep: "下一步",
|
||||
createTable: "创建表",
|
||||
installed: "已安装",
|
||||
installedButMissing: "已安装,字段缺失",
|
||||
toBeInstalled: "待安装",
|
||||
allFields: "所有字段",
|
||||
missingFields: "缺失字段",
|
||||
tableNotice: "点击\"一键建表\"后会按照以下逻辑执行操作:",
|
||||
tableNotice1: "如果某表不存在,则直接创建表。",
|
||||
tableNotice2: "如果某表存在并且字段齐全,那么不会对该表做任何操作。",
|
||||
tableNotice3: "如果某表存在但是部分字段缺失,那么会在该表中增加缺失字段。",
|
||||
tableNotice4: "如果表中有多余的字段(多余字段即不是蓝眼云盘需要的字段),不会做删除处理,而会维持原样。",
|
||||
oneKeyCreate: "一键建表",
|
||||
createFinish: "建表完成",
|
||||
createTableSuccess: "建表成功",
|
||||
crateTableFirst: "请首先点击'一键建表'",
|
||||
setAdministrator: "设置管理员",
|
||||
detectAdministrator: "检测到系统中已经存在有以下管理员:",
|
||||
useOrCreateAdministrator: "你可以使用其中一位管理员的用户名和密码进行验证,或者创建一位新的管理员账户",
|
||||
validateAdministrator: "验证管理员账户",
|
||||
createAdministrator: "创建管理员账户",
|
||||
administratorUsername: "管理员用户名",
|
||||
administratorPassword: "管理员密码",
|
||||
administratorRePassword: "再次输入密码",
|
||||
usernameRule: "由于用户名将作为文件上传的目录,因此只允许字母数字以及\"_\"。",
|
||||
congratulationInstall: "恭喜,安装成功!",
|
||||
configAdminFirst: "请首先配置管理员信息!",
|
||||
createAdminSuccess: "创建管理员成功!",
|
||||
validateAdminSuccess: "验证管理员成功!",
|
||||
pressToHome: "点击下方按钮来完成安装过程并进入首页。",
|
||||
enterHome: "完成,并进入首页",
|
||||
finish: "完成",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "全部文件",
|
||||
myShare: "我的分享",
|
||||
bin: "回收站",
|
||||
setting: "网站设置",
|
||||
dashboard: "监控统计",
|
||||
users: "用户管理",
|
||||
logout: "退出登录",
|
||||
about: "关于",
|
||||
install: "安装网站",
|
||||
dragMouseUp: "可以松手啦~"
|
||||
},
|
||||
matter: {
|
||||
file: "文件",
|
||||
directory: "文件夹",
|
||||
rename: "重命名",
|
||||
download: "下载",
|
||||
delete: "删除",
|
||||
hardDelete: "彻底删除",
|
||||
recovery: "恢复",
|
||||
more: "更多",
|
||||
share: "分享",
|
||||
close: "关闭",
|
||||
size: "大小",
|
||||
preview: "预览",
|
||||
move: "移动",
|
||||
moveTo: "移动到",
|
||||
upload: "上传",
|
||||
create: "新建",
|
||||
createTime: "创建时间",
|
||||
updateTime: "修改时间",
|
||||
deleteTime: "删除时间",
|
||||
root: "根目录",
|
||||
fillInPicLink: "请填写图片链接",
|
||||
rePick: "重新选择",
|
||||
chooseImage: "选择图片",
|
||||
uploadMode: "上传模式",
|
||||
fillMode: "填写模式",
|
||||
sizeExceedLimit: "文件大小超过了限制{}>{}",
|
||||
dropNotDirectory: "不可拖拽文件夹进行上传",
|
||||
setPublic: "设置为公有文件",
|
||||
setPrivate: "设置为私有文件",
|
||||
copyLink: "复制下载链接",
|
||||
enterName: "请输入名称",
|
||||
publicFileEveryoneCanVisit: "公有文件,任何人可以访问",
|
||||
fileDetail: "文件详情",
|
||||
expire: "有效期",
|
||||
copyLinkAndCode: "复制链接+提取码",
|
||||
uploaded: "已上传",
|
||||
uploadDir: '上传文件夹',
|
||||
uploadInfo: '上传信息',
|
||||
uploadErrorInfo: '部分文件上传失败,可导出csv文件查看',
|
||||
exportCSV: '导出上传错误详情',
|
||||
speed: "速度",
|
||||
fileInfo: "文件基本信息",
|
||||
fileName: "文件名",
|
||||
path: "路径",
|
||||
copyPath: "复制路径",
|
||||
publicOrPrivate: "文件公开性",
|
||||
privateInfo: "私有文件,只有自己或者授权的用户可以下载",
|
||||
publicInfo: "公有文件,任何人可以通过链接下载",
|
||||
downloadTimes: "下载次数",
|
||||
operations: "操作",
|
||||
oneTimeLink: "一次性链接",
|
||||
oneTimeLinkInfo: "使用一次性链接下载后链接立即失效,可以分享这个链接给朋友,点击复制",
|
||||
imageCache: "图片缓存",
|
||||
searchFile: "搜索文件",
|
||||
noContentYet: "该目录下暂无任何内容",
|
||||
allFiles: "全部文件",
|
||||
newDirectory: "新建文件夹",
|
||||
notChoose: "没有选择文件",
|
||||
exceed1000: "最多只能同时选取1000个文件",
|
||||
noImageCache: "暂无图片缓存数据",
|
||||
recycleBin: "回收站",
|
||||
deleted: "已删除",
|
||||
unCompatibleBrowser: "当前浏览器不支持,请切换浏览器尝试",
|
||||
canIUse: "查看当前浏览器是否支持,点击跳转",
|
||||
intoRecycleBin: "放入回收站",
|
||||
finishingTip: "后台文件整理中,请稍候..."
|
||||
},
|
||||
router: {
|
||||
allFiles: "全部文件",
|
||||
fileDetail: "文件详情",
|
||||
login: "登录",
|
||||
autoLogin: "自动登录",
|
||||
register: "注册",
|
||||
users: "用户列表",
|
||||
userDetail: "用户详情",
|
||||
changePassword: "修改密码",
|
||||
editUser: "编辑用户",
|
||||
createUser: "创建用户",
|
||||
shareDetail: "分享详情",
|
||||
myShare: "我的分享",
|
||||
dashboard: "监控统计",
|
||||
install: "安装网站",
|
||||
setting: "网站设置"
|
||||
},
|
||||
preference: {
|
||||
basic: "基本信息",
|
||||
preview: "预览引擎",
|
||||
scan: "扫描磁盘",
|
||||
websiteName: "网站名称",
|
||||
logo: "Logo",
|
||||
logoSquare: "logo请使用正方形图片,否则在显示时会裁剪成正方形",
|
||||
onlyAllowIco: "只允许上传.ico图标",
|
||||
copyright: "版权信息(支持html)",
|
||||
extraInfo: "备案信息(支持html)",
|
||||
zipMaxNumLimit: "zip下载数量限制",
|
||||
zipMaxSizeLimit: "zip下载大小限制(B)",
|
||||
current: "当前值",
|
||||
noLimit: "无限制",
|
||||
userDefaultSizeLimit: "用户默认总大小限制(B) ",
|
||||
matterBinDefaultSaveDay: "回收站默认保留天数",
|
||||
enterMatterBinDefaultSaveDay: "默认回收站默认保留天数必填!",
|
||||
docLink: "文档链接",
|
||||
tankDocLink: "https://tank-doc.eyeblue.cn/zh",
|
||||
allowRegister: "允许自主注册",
|
||||
systemCleanup: "重置系统",
|
||||
systemCleanupDescription: "重置系统将清空除管理员账号外所有数据",
|
||||
systemCleanupPrompt: "重置系统将清空除管理员账号外所有数据,事关重大,请输入登录密码",
|
||||
previewConfig: "文件预览配置",
|
||||
editPreference: "设置网站偏好",
|
||||
editPreviewEngine: "设置预览引擎",
|
||||
enterWebsiteName: "请输入网站名称!",
|
||||
enterZipMaxNumLimit: "zip最大数量限制必填!",
|
||||
enterZipMaxSizeLimit: "zip大小限制必填!",
|
||||
enterUserDefaultSizeLimit: "默认用户空间大小必填!",
|
||||
engine: "{}号预览引擎",
|
||||
noEngine: "暂无在线预览引擎配置",
|
||||
newEngine: "添加一个预览引擎",
|
||||
engineReg: "引擎格式",
|
||||
engineSuffix: "匹配后缀",
|
||||
enginePreview: "预览方式",
|
||||
defaultPreview: "默认引擎",
|
||||
previewEngine: "{}号引擎",
|
||||
defaultPreviewDesc: "默认预览引擎,不可移除",
|
||||
engineRegHelper: "此处填写模板语法:{url}表示文件路径,预览时会自动替换成对应的文件url;{b64url}表示base64机密后的路径,适用于kkfileview;",
|
||||
engineUsageHint: "对于一个文件的预览,使用第一个匹配到后缀名的引擎,没有配匹到则使用系统默认预览引擎",
|
||||
engineRegPlaceHolder: "例如:https://xxx.xxx.xxx?url={url}",
|
||||
engineSuffixPlaceHolder: '输入后缀,使用逗号分隔,不用带. 例如:doc,ppt,xls',
|
||||
previewCurrent: "本站预览",
|
||||
previewOpen: "新标签打开",
|
||||
editScan: "设置磁盘扫描",
|
||||
enableScan: "开启磁盘扫描",
|
||||
disabledScan: "暂未开启磁盘扫描",
|
||||
scanCron: "定时扫描",
|
||||
cron: "cron表达式",
|
||||
cronValidate: "cron表达式不能为空",
|
||||
scanScope: "扫描范围",
|
||||
scanUsers: "扫描用户",
|
||||
scanPerTenSeconds: "每十秒",
|
||||
scanPerThirtySeconds: "每三十秒",
|
||||
scanPerMinute: "每分钟",
|
||||
scanPerHour: "每小时",
|
||||
scanCustom: "自定义",
|
||||
chooseUsers: "模糊搜索用户",
|
||||
chooseUsersValidate: "请选择至少一个用户",
|
||||
scanLoading: "扫描中,请稍后...",
|
||||
matterBinDefaultTip: "设置0表示关闭回收站功能"
|
||||
},
|
||||
share: {
|
||||
shareDetail: "分享详情",
|
||||
shareTime: "分享时间",
|
||||
expireTime: "失效时间",
|
||||
noExpire: "永久有效",
|
||||
expired: "已过期",
|
||||
copyLinkAndCode: "复制链接+提取码",
|
||||
shareSuccess: "分享成功",
|
||||
sharer: "分享者",
|
||||
link: "链接",
|
||||
copyLink: "复制链接",
|
||||
code: "提取码",
|
||||
copyCode: "复制提取码",
|
||||
copySuccess: "复制成功",
|
||||
more: "更多",
|
||||
cancelShare: "取消分享",
|
||||
getLink: "获取链接",
|
||||
allFiles: "全部文件",
|
||||
noContent: "该目录下暂无任何内容",
|
||||
enterCode: "请输入提取码",
|
||||
getFiles: "提取文件",
|
||||
codeError: "提取码错误",
|
||||
cancelPrompt: "此操作将永久取消该分享, 是否继续?",
|
||||
hour: "1小时",
|
||||
day: "1天",
|
||||
week: "1周",
|
||||
month: "1个月",
|
||||
year: "1年",
|
||||
infinity: "永远有效",
|
||||
emptyHint: "暂无任何分享",
|
||||
},
|
||||
user: {
|
||||
redirecting: "正在转跳...",
|
||||
oldPassword: "旧密码",
|
||||
newPassword: "新密码",
|
||||
confirmNewPassword: "确认新密码",
|
||||
cannotBeNull: "不能为空!",
|
||||
passwordNotSame: "两次输入不一致!",
|
||||
role: "角色",
|
||||
singleFileSizeLimit: "单文件限制",
|
||||
totalFileSizeLimit: "空间限制",
|
||||
current: "当前值",
|
||||
noLimit: "无限制",
|
||||
totalFileSize: "已使用空间",
|
||||
status: "状态",
|
||||
lastLogin: "上次登录",
|
||||
lastLoginIp: "上次登录IP",
|
||||
lastLoginTime: "上次登录时间",
|
||||
resetPassword: "重置密码",
|
||||
transfiguration: "变身",
|
||||
changePassword: "修改密码",
|
||||
enterPassword: "输入密码",
|
||||
enterUsername: "请输入用户名",
|
||||
enterNewPassword: "请输入新密码",
|
||||
profile: "个人详情",
|
||||
avatar: "头像",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
confirmPassword: "确认密码",
|
||||
disabled: "已禁用",
|
||||
disableUser: "禁用该用户",
|
||||
activeUser: "激活该用户",
|
||||
deleteUser: "删除该用户",
|
||||
deleteHint: "此操作将删除用户【{}】的所有记录,包括文件,分享,用户信息等内容,确定继续?",
|
||||
disable: "禁用",
|
||||
sync: "同步",
|
||||
active: "激活",
|
||||
welcomeLogin: "欢迎登录",
|
||||
logining: "正在登录...",
|
||||
login: "登录",
|
||||
loginSuccess: "登录成功",
|
||||
toToRegister: "立即注册",
|
||||
welcomeRegister: "欢迎注册",
|
||||
registering: "正在登录...",
|
||||
register: "注册",
|
||||
goToLogin: "前往登录",
|
||||
roleGuest: "游客",
|
||||
roleUser: "注册用户",
|
||||
roleAdministrator: "管理员",
|
||||
statusActive: "正常",
|
||||
statusDisabled: "禁用",
|
||||
webdavLink: "WebDAV 地址",
|
||||
docLink: "文档链接",
|
||||
createUser: "创建用户",
|
||||
editUser: "编辑用户",
|
||||
editSomebodyPassword: "修改{}的密码",
|
||||
transfigurationPromptText: "变身提示",
|
||||
transfigurationPrompt: "您将使用该用户的身份登录。请复制以下链接到其他浏览器访问,在当前浏览器访问会导致当前用户登录信息失效。",
|
||||
allUsers: "全部用户",
|
||||
partialUsers: "局部用户",
|
||||
searchUser: "搜索用户"
|
||||
},
|
||||
model: {
|
||||
usernameRule: "用户名只能包含字母,数字和\"_\"",
|
||||
passwordRule: "密码长度至少为6位",
|
||||
linkCodeText: "链接:{} 提取码:{}",
|
||||
copyLinkCodeSuccess: "复制链接提取码成功",
|
||||
|
||||
},
|
||||
plugin: {
|
||||
cannotPreview: "无法预览",
|
||||
emptyHintDefault: "没有符合条件的项目",
|
||||
everyPage: "每页",
|
||||
items: "条",
|
||||
total: "共",
|
||||
clickRefresh: "点击刷新",
|
||||
},
|
||||
loading: "加载中",
|
||||
selectAll: "全选",
|
||||
edit: "修改",
|
||||
createTime: "创建时间",
|
||||
download: "下载",
|
||||
close: "关闭",
|
||||
required: "必填",
|
||||
cancel: "取消",
|
||||
delete: "删除",
|
||||
deleteDirectly: "直接删除",
|
||||
actionCanNotRevertConfirm: "此操作不可撤回, 是否继续?",
|
||||
actionDeleteConfirm: "确定删除吗?",
|
||||
actionRecoveryConfirm: "确定恢复吗?",
|
||||
prompt: "提示",
|
||||
confirm: "确定",
|
||||
copy: "复制",
|
||||
copySuccess: "复制成功!",
|
||||
copyError: "复制失败!",
|
||||
showMore: "显示更多",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
submit: "提交",
|
||||
save: "保存",
|
||||
create: "创建",
|
||||
finish: "完成",
|
||||
operationSuccess: "操作成功",
|
||||
operation: "操作",
|
||||
notFound: "404 页面找不到",
|
||||
login: "登录",
|
||||
logout: "退出",
|
||||
yes: "是",
|
||||
no: "否",
|
||||
all: "所有",
|
||||
refresh: "刷新",
|
||||
inputRequired: "该项必填",
|
||||
},
|
||||
plugin: {
|
||||
cannotPreview: "无法预览",
|
||||
emptyHintDefault: "没有符合条件的项目",
|
||||
everyPage: "每页",
|
||||
items: "条",
|
||||
total: "共",
|
||||
clickRefresh: "点击刷新",
|
||||
},
|
||||
loading: "加载中",
|
||||
selectAll: "全选",
|
||||
edit: "修改",
|
||||
createTime: "创建时间",
|
||||
download: "下载",
|
||||
close: "关闭",
|
||||
required: "必填",
|
||||
cancel: "取消",
|
||||
delete: "删除",
|
||||
deleteDirectly: "直接删除",
|
||||
actionCanNotRevertConfirm: "此操作不可撤回, 是否继续?",
|
||||
actionDeleteConfirm: "确定删除吗?",
|
||||
actionRecoveryConfirm: "确定恢复吗?",
|
||||
prompt: "提示",
|
||||
confirm: "确定",
|
||||
copy: "复制",
|
||||
copySuccess: "复制成功!",
|
||||
copyError: "复制失败!",
|
||||
showMore: "显示更多",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
submit: "提交",
|
||||
save: "保存",
|
||||
create: "创建",
|
||||
finish: "完成",
|
||||
operationSuccess: "操作成功",
|
||||
operation: "操作",
|
||||
notFound: "404 页面找不到",
|
||||
login: "登录",
|
||||
logout: "退出",
|
||||
yes: "是",
|
||||
no: "否",
|
||||
all: "所有",
|
||||
refresh: "刷新",
|
||||
inputRequired: "该项必填",
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,66 +6,66 @@ import SafeUtil from "../../../util/SafeUtil";
|
||||
|
||||
export default class ImageCache extends BaseEntity {
|
||||
|
||||
static URL_DELETE_BATCH = '/api/image/cache/delete/batch';
|
||||
static URL_DELETE_BATCH = '/api/image/cache/delete/batch';
|
||||
|
||||
name: string | null = null;
|
||||
userUuid: string | null = null;
|
||||
matterUuid: string | null = null;
|
||||
matterName: string | null = null;
|
||||
mode: string | null = null;
|
||||
md5: string | null = null;
|
||||
size: number = 0;
|
||||
path: number = 0;
|
||||
name: string | null = null;
|
||||
userUuid: string | null = null;
|
||||
matterUuid: string | null = null;
|
||||
matterName: string | null = null;
|
||||
mode: string | null = null;
|
||||
md5: string | null = null;
|
||||
size: number = 0;
|
||||
path: number = 0;
|
||||
|
||||
/*
|
||||
这部分是辅助UI的字段信息
|
||||
*/
|
||||
//作为勾选变量
|
||||
check: boolean = false;
|
||||
/*
|
||||
这部分是辅助UI的字段信息
|
||||
*/
|
||||
//作为勾选变量
|
||||
check: boolean = false;
|
||||
|
||||
user: User = new User();
|
||||
matter: Matter = new Matter();
|
||||
user: User = new User();
|
||||
matter: Matter = new Matter();
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
|
||||
getTAG(): string {
|
||||
return "imageCache";
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
|
||||
getFilters() {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new InputFilter("User Uuid", "userUuid", null, false),
|
||||
new InputFilter("File Uuid", "matterUuid", null, false),
|
||||
]
|
||||
}
|
||||
|
||||
getForm() {
|
||||
return {
|
||||
uuid: this.uuid ? this.uuid : null
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
}
|
||||
|
||||
getResizeUrl() {
|
||||
return '/api/alien/preview/' + this.matterUuid + '/' + this.matterName + "?ir=" + this.mode
|
||||
}
|
||||
getTAG(): string {
|
||||
return "imageCache";
|
||||
}
|
||||
|
||||
getOriginUrl() {
|
||||
return '/api/alien/download/' + this.matterUuid + '/' + this.matterName
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
|
||||
getFilters() {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new InputFilter("User Uuid", "userUuid", null, false),
|
||||
new InputFilter("File Uuid", "matterUuid", null, false),
|
||||
]
|
||||
}
|
||||
|
||||
getForm() {
|
||||
return {
|
||||
uuid: this.uuid ? this.uuid : null
|
||||
}
|
||||
}
|
||||
|
||||
getResizeUrl() {
|
||||
return '/api/alien/preview/' + this.matterUuid + '/' + this.matterName + "?ir=" + this.mode
|
||||
}
|
||||
|
||||
getOriginUrl() {
|
||||
return '/api/alien/download/' + this.matterUuid + '/' + this.matterName
|
||||
}
|
||||
|
||||
|
||||
httpDeleteBatch(uuids: string, successCallback?: () => any, errorCallback?: () => any) {
|
||||
this.httpPost(ImageCache.URL_DELETE_BATCH, {'uuids': uuids}, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
}, errorCallback)
|
||||
}
|
||||
httpDeleteBatch(uuids: string, successCallback?: () => any, errorCallback?: () => any) {
|
||||
this.httpPost(ImageCache.URL_DELETE_BATCH, {'uuids': uuids}, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response)
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,240 +6,240 @@ import Base from "../base/Base";
|
||||
|
||||
export default class Install extends BaseEntity {
|
||||
|
||||
static URL_VERIFY = '/api/install/verify'
|
||||
static URL_TABLE_INFO_LIST = '/api/install/table/info/list'
|
||||
static URL_ADMIN_LIST = '/api/install/admin/list'
|
||||
static URL_CREATE_TABLE = '/api/install/create/table'
|
||||
static URL_CREATE_ADMIN = '/api/install/create/admin'
|
||||
static URL_VALIDATE_ADMIN = '/api/install/validate/admin'
|
||||
static URL_FINISH = '/api/install/finish'
|
||||
static URL_VERIFY = '/api/install/verify'
|
||||
static URL_TABLE_INFO_LIST = '/api/install/table/info/list'
|
||||
static URL_ADMIN_LIST = '/api/install/admin/list'
|
||||
static URL_CREATE_TABLE = '/api/install/create/table'
|
||||
static URL_CREATE_ADMIN = '/api/install/create/admin'
|
||||
static URL_VALIDATE_ADMIN = '/api/install/validate/admin'
|
||||
static URL_FINISH = '/api/install/finish'
|
||||
|
||||
//数据库类型
|
||||
dbType: string = "mysql"
|
||||
//数据库类型
|
||||
dbType: string = "mysql"
|
||||
|
||||
//数据库名
|
||||
mysqlPort: number = 3306
|
||||
mysqlHost: string = "127.0.0.1"
|
||||
mysqlSchema: string = "tank"
|
||||
mysqlUsername: string = "tank"
|
||||
mysqlPassword: string | null = null
|
||||
mysqlCharset: string = "utf8"
|
||||
//数据库名
|
||||
mysqlPort: number = 3306
|
||||
mysqlHost: string = "127.0.0.1"
|
||||
mysqlSchema: string = "tank"
|
||||
mysqlUsername: string = "tank"
|
||||
mysqlPassword: string | null = null
|
||||
mysqlCharset: string = "utf8"
|
||||
|
||||
//管理员用户名
|
||||
adminUsername: string | null = null
|
||||
adminPassword: string | null = null
|
||||
adminRepassword: string | null = null
|
||||
//管理员用户名
|
||||
adminUsername: string | null = null
|
||||
adminPassword: string | null = null
|
||||
adminRepassword: string | null = null
|
||||
|
||||
//表元信息
|
||||
tableInfoList: InstallTableInfo[] = []
|
||||
//表元信息
|
||||
tableInfoList: InstallTableInfo[] = []
|
||||
|
||||
//管理员列表
|
||||
adminList: User[] = []
|
||||
//管理员列表
|
||||
adminList: User[] = []
|
||||
|
||||
//数据库连接是否可用
|
||||
verified: boolean = false
|
||||
//管理员配置完毕
|
||||
adminConfigured: boolean = false
|
||||
//数据库连接是否可用
|
||||
verified: boolean = false
|
||||
//管理员配置完毕
|
||||
adminConfigured: boolean = false
|
||||
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
constructor(reactComponent?: React.Component) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
getTAG():string {
|
||||
return "install"
|
||||
}
|
||||
|
||||
|
||||
getMysqlForm() {
|
||||
return {
|
||||
dbType: this.dbType,
|
||||
mysqlHost: this.mysqlHost,
|
||||
mysqlPort: this.mysqlPort,
|
||||
mysqlSchema: this.mysqlSchema,
|
||||
mysqlUsername: this.mysqlUsername,
|
||||
mysqlPassword: this.mysqlPassword,
|
||||
mysqlCharset: this.mysqlCharset,
|
||||
}
|
||||
}
|
||||
|
||||
getForm() {
|
||||
return {
|
||||
dbType: this.dbType,
|
||||
mysqlPort: this.mysqlPort,
|
||||
mysqlHost: this.mysqlHost,
|
||||
mysqlSchema: this.mysqlSchema,
|
||||
mysqlUsername: this.mysqlUsername,
|
||||
mysqlPassword: this.mysqlPassword,
|
||||
mysqlCharset: this.mysqlCharset,
|
||||
adminUsername: this.adminUsername,
|
||||
adminPassword: this.adminPassword,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//表创建完毕
|
||||
tableCreated() {
|
||||
if (!this.tableInfoList || this.tableInfoList.length === 0) {
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableInfoList.length; i++) {
|
||||
let tableInfo = this.tableInfoList[i]
|
||||
if (!tableInfo.tableExist) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (tableInfo.tableExist && tableInfo.missingFields.length !== 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
httpVerify(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
this.httpPost(Install.URL_VERIFY, this.getMysqlForm(), function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
httpTableInfoList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.verified) {
|
||||
this.defaultErrorHandler("Please verify mysql first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
this.httpPost(Install.URL_TABLE_INFO_LIST, this.getForm(), function (response: any) {
|
||||
|
||||
that.tableInfoList.splice(0, that.tableInfoList.length);
|
||||
let list = Base.renderList(response.data.data, InstallTableInfo);
|
||||
that.tableInfoList.push(...list)
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
httpCreateTable(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.verified) {
|
||||
this.defaultErrorHandler("Please verify mysql first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
this.httpPost(Install.URL_CREATE_TABLE, this.getForm(), function (response: any) {
|
||||
|
||||
that.tableInfoList.splice(0, that.tableInfoList.length);
|
||||
that.tableInfoList.push(...response.data.data)
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
//获取管理员列表
|
||||
httpAdminList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
let form = this.getForm()
|
||||
|
||||
|
||||
this.httpPost(Install.URL_ADMIN_LIST, form, function (response: any) {
|
||||
|
||||
that.adminList = BaseEntity.renderList(response.data.data, User)
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
httpCreateAdmin(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
getTAG(): string {
|
||||
return "install"
|
||||
}
|
||||
|
||||
|
||||
if (this.adminPassword !== this.adminRepassword) {
|
||||
this.defaultErrorHandler("password not same", errorCallback)
|
||||
return
|
||||
getMysqlForm() {
|
||||
return {
|
||||
dbType: this.dbType,
|
||||
mysqlHost: this.mysqlHost,
|
||||
mysqlPort: this.mysqlPort,
|
||||
mysqlSchema: this.mysqlSchema,
|
||||
mysqlUsername: this.mysqlUsername,
|
||||
mysqlPassword: this.mysqlPassword,
|
||||
mysqlCharset: this.mysqlCharset,
|
||||
}
|
||||
}
|
||||
|
||||
getForm() {
|
||||
return {
|
||||
dbType: this.dbType,
|
||||
mysqlPort: this.mysqlPort,
|
||||
mysqlHost: this.mysqlHost,
|
||||
mysqlSchema: this.mysqlSchema,
|
||||
mysqlUsername: this.mysqlUsername,
|
||||
mysqlPassword: this.mysqlPassword,
|
||||
mysqlCharset: this.mysqlCharset,
|
||||
adminUsername: this.adminUsername,
|
||||
adminPassword: this.adminPassword,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let form = this.getForm()
|
||||
//表创建完毕
|
||||
tableCreated() {
|
||||
if (!this.tableInfoList || this.tableInfoList.length === 0) {
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableInfoList.length; i++) {
|
||||
let tableInfo = this.tableInfoList[i]
|
||||
if (!tableInfo.tableExist) {
|
||||
return false
|
||||
}
|
||||
|
||||
this.httpPost(Install.URL_CREATE_ADMIN, form, function (response: any) {
|
||||
if (tableInfo.tableExist && tableInfo.missingFields.length !== 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
that.adminConfigured = true
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
//验证管理员账号
|
||||
httpValidateAdmin(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.adminUsername || !this.adminPassword) {
|
||||
this.defaultErrorHandler("username and password required", errorCallback)
|
||||
return
|
||||
httpVerify(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
this.httpPost(Install.URL_VERIFY, this.getMysqlForm(), function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
let form = this.getForm()
|
||||
httpTableInfoList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
this.httpPost(Install.URL_VALIDATE_ADMIN, form, function (response: any) {
|
||||
if (!this.verified) {
|
||||
this.defaultErrorHandler("Please verify mysql first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
that.adminConfigured = true
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
this.httpPost(Install.URL_TABLE_INFO_LIST, this.getForm(), function (response: any) {
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
that.tableInfoList.splice(0, that.tableInfoList.length);
|
||||
let list = Base.renderList(response.data.data, InstallTableInfo);
|
||||
that.tableInfoList.push(...list)
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
httpCreateTable(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.verified) {
|
||||
this.defaultErrorHandler("Please verify mysql first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
this.httpPost(Install.URL_CREATE_TABLE, this.getForm(), function (response: any) {
|
||||
|
||||
that.tableInfoList.splice(0, that.tableInfoList.length);
|
||||
that.tableInfoList.push(...response.data.data)
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
//获取管理员列表
|
||||
httpAdminList(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
//完成安装过程
|
||||
httpFinish(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = this.getForm()
|
||||
|
||||
|
||||
let form = this.getForm()
|
||||
this.httpPost(Install.URL_ADMIN_LIST, form, function (response: any) {
|
||||
|
||||
this.httpPost(Install.URL_FINISH, form, function (response: any) {
|
||||
that.adminList = BaseEntity.renderList(response.data.data, User)
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
httpCreateAdmin(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (this.adminPassword !== this.adminRepassword) {
|
||||
this.defaultErrorHandler("password not same", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
let form = this.getForm()
|
||||
|
||||
this.httpPost(Install.URL_CREATE_ADMIN, form, function (response: any) {
|
||||
|
||||
that.adminConfigured = true
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
//验证管理员账号
|
||||
httpValidateAdmin(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
if (!this.tableCreated()) {
|
||||
this.defaultErrorHandler("Please verify create table first", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.adminUsername || !this.adminPassword) {
|
||||
this.defaultErrorHandler("username and password required", errorCallback)
|
||||
return
|
||||
}
|
||||
|
||||
let form = this.getForm()
|
||||
|
||||
this.httpPost(Install.URL_VALIDATE_ADMIN, form, function (response: any) {
|
||||
|
||||
that.adminConfigured = true
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
|
||||
//完成安装过程
|
||||
httpFinish(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
|
||||
|
||||
let form = this.getForm()
|
||||
|
||||
this.httpPost(Install.URL_FINISH, form, function (response: any) {
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Base from "../base/Base";
|
||||
|
||||
export default class InstallFieldInfo extends Base{
|
||||
export default class InstallFieldInfo extends Base {
|
||||
|
||||
name: string = "";
|
||||
dataType: boolean = false;
|
||||
name: string = "";
|
||||
dataType: boolean = false;
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,17 +3,17 @@ import InstallFieldInfo from "./InstallFieldInfo";
|
||||
|
||||
export default class InstallTableInfo extends Base {
|
||||
|
||||
name: string = "";
|
||||
tableExist: boolean = false;
|
||||
allFields: InstallFieldInfo[] = [];
|
||||
missingFields: InstallFieldInfo[] = [];
|
||||
name: string = "";
|
||||
tableExist: boolean = false;
|
||||
allFields: InstallFieldInfo[] = [];
|
||||
missingFields: InstallFieldInfo[] = [];
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignList("allFields", InstallFieldInfo);
|
||||
this.assignList("missingFields", InstallFieldInfo);
|
||||
}
|
||||
this.assignList("allFields", InstallFieldInfo);
|
||||
this.assignList("missingFields", InstallFieldInfo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,154 +7,154 @@ import ScanConfig from "./model/ScanConfig";
|
||||
|
||||
export default class Preference extends BaseEntity {
|
||||
|
||||
//获取当前登录者的信息
|
||||
static URL_API_PREFERENCE_FETCH = '/api/preference/fetch'
|
||||
static URL_API_SYSTEM_CLEANUP = '/api/preference/system/cleanup'
|
||||
static URL_API_PREFERENCE_EDIT_PREVIEW_CONFIG = '/api/preference/edit/preview/config'
|
||||
static URL_API_PREFERENCE_EDIT_SCAN = '/api/preference/edit/scan/config'
|
||||
static URL_API_PREFERENCE_SCAN_ONCE = '/api/preference/scan/once'
|
||||
//获取当前登录者的信息
|
||||
static URL_API_PREFERENCE_FETCH = '/api/preference/fetch'
|
||||
static URL_API_SYSTEM_CLEANUP = '/api/preference/system/cleanup'
|
||||
static URL_API_PREFERENCE_EDIT_PREVIEW_CONFIG = '/api/preference/edit/preview/config'
|
||||
static URL_API_PREFERENCE_EDIT_SCAN = '/api/preference/edit/scan/config'
|
||||
static URL_API_PREFERENCE_SCAN_ONCE = '/api/preference/scan/once'
|
||||
|
||||
|
||||
//网站名称
|
||||
name: string = ""
|
||||
//网站名称
|
||||
name: string = ""
|
||||
|
||||
//logo
|
||||
logoUrl: string | null = null
|
||||
faviconUrl: string | null = null
|
||||
//logo
|
||||
logoUrl: string | null = null
|
||||
faviconUrl: string | null = null
|
||||
|
||||
//版权信息
|
||||
copyright: string = ""
|
||||
record: string = ""
|
||||
//版权信息
|
||||
copyright: string = ""
|
||||
record: string = ""
|
||||
|
||||
//大小限制
|
||||
downloadDirMaxSize: number = -1
|
||||
//文件数量
|
||||
downloadDirMaxNum: number = -1
|
||||
//用户默认总大小限制
|
||||
defaultTotalSizeLimit: number = -1
|
||||
//回收站保存文件天数
|
||||
deletedKeepDays: number = 7
|
||||
//是否允许自主注册
|
||||
allowRegister: boolean = false
|
||||
//预览配置
|
||||
previewConfig: PreviewConfig = new PreviewConfig()
|
||||
//扫描磁盘配置
|
||||
scanConfig: ScanConfig = new ScanConfig()
|
||||
//后台版本
|
||||
version: string | null = null
|
||||
//大小限制
|
||||
downloadDirMaxSize: number = -1
|
||||
//文件数量
|
||||
downloadDirMaxNum: number = -1
|
||||
//用户默认总大小限制
|
||||
defaultTotalSizeLimit: number = -1
|
||||
//回收站保存文件天数
|
||||
deletedKeepDays: number = 7
|
||||
//是否允许自主注册
|
||||
allowRegister: boolean = false
|
||||
//预览配置
|
||||
previewConfig: PreviewConfig = new PreviewConfig()
|
||||
//扫描磁盘配置
|
||||
scanConfig: ScanConfig = new ScanConfig()
|
||||
//后台版本
|
||||
version: string | null = null
|
||||
|
||||
|
||||
//*****************前端辅助变量***********************/
|
||||
//网站是否完成了安装
|
||||
installed: boolean = true
|
||||
//*****************前端辅助变量***********************/
|
||||
//网站是否完成了安装
|
||||
installed: boolean = true
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
constructor(reactComponent?: React.Component) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignEntity("previewConfig", PreviewConfig)
|
||||
this.assignEntity("scanConfig", ScanConfig)
|
||||
}
|
||||
|
||||
getTAG():string {
|
||||
return "preference"
|
||||
}
|
||||
|
||||
getRecycleBinStatus() {
|
||||
return this.deletedKeepDays > 0
|
||||
}
|
||||
|
||||
getForm(): any {
|
||||
return {
|
||||
name: this.name,
|
||||
logoUrl: this.logoUrl,
|
||||
faviconUrl: this.faviconUrl,
|
||||
copyright: this.copyright,
|
||||
record: this.record,
|
||||
downloadDirMaxNum: this.downloadDirMaxNum,
|
||||
downloadDirMaxSize: this.downloadDirMaxSize,
|
||||
defaultTotalSizeLimit: this.defaultTotalSizeLimit,
|
||||
deletedKeepDays: this.deletedKeepDays,
|
||||
allowRegister: this.allowRegister,
|
||||
previewConfig: JsonUtil.toJson(this.previewConfig.getForm()),
|
||||
scanConfig: JsonUtil.toJson(this.scanConfig.getForm())
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//修改title和favicon
|
||||
updateTitleAndFavicon() {
|
||||
|
||||
if (this.faviconUrl) {
|
||||
//修改favicon
|
||||
let link: any = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
||||
link.type = 'image/x-icon';
|
||||
link.rel = 'shortcut icon';
|
||||
link.href = this.faviconUrl;
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
|
||||
document.title = this.name
|
||||
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
httpFetch(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_FETCH, {}, function (response: any) {
|
||||
this.assignEntity("previewConfig", PreviewConfig)
|
||||
this.assignEntity("scanConfig", ScanConfig)
|
||||
}
|
||||
|
||||
that.assign(response.data.data);
|
||||
getTAG(): string {
|
||||
return "preference"
|
||||
}
|
||||
|
||||
that.updateTitleAndFavicon()
|
||||
getRecycleBinStatus() {
|
||||
return this.deletedKeepDays > 0
|
||||
}
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
getForm(): any {
|
||||
return {
|
||||
name: this.name,
|
||||
logoUrl: this.logoUrl,
|
||||
faviconUrl: this.faviconUrl,
|
||||
copyright: this.copyright,
|
||||
record: this.record,
|
||||
downloadDirMaxNum: this.downloadDirMaxNum,
|
||||
downloadDirMaxSize: this.downloadDirMaxSize,
|
||||
defaultTotalSizeLimit: this.defaultTotalSizeLimit,
|
||||
deletedKeepDays: this.deletedKeepDays,
|
||||
allowRegister: this.allowRegister,
|
||||
previewConfig: JsonUtil.toJson(this.previewConfig.getForm()),
|
||||
scanConfig: JsonUtil.toJson(this.scanConfig.getForm())
|
||||
};
|
||||
}
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
httpSystemCleanup(password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Preference.URL_API_SYSTEM_CLEANUP, {password}, function (response: any) {
|
||||
//修改title和favicon
|
||||
updateTitleAndFavicon() {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
if (this.faviconUrl) {
|
||||
//修改favicon
|
||||
let link: any = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
||||
link.type = 'image/x-icon';
|
||||
link.rel = 'shortcut icon';
|
||||
link.href = this.faviconUrl;
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
document.title = this.name
|
||||
|
||||
httpSavePreviewEngine(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
const that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_EDIT_PREVIEW_CONFIG, this.getForm(), function(response: any) {
|
||||
}
|
||||
|
||||
that.assign(response.data.data);
|
||||
httpFetch(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_FETCH, {}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
that.assign(response.data.data);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
that.updateTitleAndFavicon()
|
||||
|
||||
}
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
httpSaveScan(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
const that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_EDIT_SCAN, this.getForm(), function(response: any) {
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
that.assign(response.data.data);
|
||||
httpSystemCleanup(password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(Preference.URL_API_SYSTEM_CLEANUP, {password}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
}
|
||||
httpSavePreviewEngine(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
const that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_EDIT_PREVIEW_CONFIG, this.getForm(), function (response: any) {
|
||||
|
||||
httpScanOnce(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
this.httpGet(Preference.URL_API_PREFERENCE_SCAN_ONCE, {}, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
httpSaveScan(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
const that = this
|
||||
this.httpPost(Preference.URL_API_PREFERENCE_EDIT_SCAN, this.getForm(), function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
httpScanOnce(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
this.httpGet(Preference.URL_API_PREFERENCE_SCAN_ONCE, {}, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,42 +4,40 @@
|
||||
*/
|
||||
import Base from "../../base/Base";
|
||||
import PreviewEngine from "./PreviewEngine";
|
||||
import MimeUtil from "../../../util/MimeUtil";
|
||||
import MessageBoxUtil from "../../../util/MessageBoxUtil";
|
||||
|
||||
/**
|
||||
* 预览配置
|
||||
*/
|
||||
export default class PreviewConfig extends Base {
|
||||
|
||||
/**
|
||||
* 预览引擎
|
||||
*/
|
||||
previewEngines: PreviewEngine[] = []
|
||||
/**
|
||||
* 预览引擎
|
||||
*/
|
||||
previewEngines: PreviewEngine[] = []
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
super()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignList("previewEngines", PreviewEngine)
|
||||
}
|
||||
this.assignList("previewEngines", PreviewEngine)
|
||||
}
|
||||
|
||||
|
||||
getForm(): any {
|
||||
getForm(): any {
|
||||
|
||||
let forms = this.previewEngines.map((item: PreviewEngine, index: number) => {
|
||||
return item.getForm()
|
||||
})
|
||||
let forms = this.previewEngines.map((item: PreviewEngine, index: number) => {
|
||||
return item.getForm()
|
||||
})
|
||||
|
||||
return {
|
||||
previewEngines: forms
|
||||
};
|
||||
}
|
||||
return {
|
||||
previewEngines: forms
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,83 +6,83 @@ import Base from "../../base/Base";
|
||||
import MimeUtil from "../../../util/MimeUtil";
|
||||
|
||||
export default class PreviewEngine extends Base {
|
||||
/**
|
||||
* 此预览引擎的url
|
||||
* {originUrl} 文件原始的url地址。eg: https://tanker.eyeblue.cn/api/alien/download/2a0ceee1-744c-4c82-4215-69c382597a50/abstract-free-photo-2210x1473.jpg
|
||||
* {url} 对于公有文件publicUrl=originUrl,对于私有文件publicUrl是originUrl带上downloadToken。 eg: https://tanker.eyeblue.cn/api/alien/download/2a0ceee1-744c-4c82-4215-69c382597a50/abstract-free-photo-2210x1473.jpg?downloadTokenUuid=6bdba52f-af6b-49ae-5a5d-fd80bfb01d3b
|
||||
* {b64Url} 文件原始地址
|
||||
*/
|
||||
url: string = "";
|
||||
/**
|
||||
* 此预览引擎的url
|
||||
* {originUrl} 文件原始的url地址。eg: https://tanker.eyeblue.cn/api/alien/download/2a0ceee1-744c-4c82-4215-69c382597a50/abstract-free-photo-2210x1473.jpg
|
||||
* {url} 对于公有文件publicUrl=originUrl,对于私有文件publicUrl是originUrl带上downloadToken。 eg: https://tanker.eyeblue.cn/api/alien/download/2a0ceee1-744c-4c82-4215-69c382597a50/abstract-free-photo-2210x1473.jpg?downloadTokenUuid=6bdba52f-af6b-49ae-5a5d-fd80bfb01d3b
|
||||
* {b64Url} 文件原始地址
|
||||
*/
|
||||
url: string = "";
|
||||
|
||||
/**
|
||||
* 此预览引擎支持的文件后缀名。
|
||||
* 星好*表示匹配所有的后缀名。
|
||||
* 逗号分隔,不带. 例如: xls,doc,ppt,xlsx,docx,pptx
|
||||
*/
|
||||
extensions: string = "";
|
||||
/**
|
||||
* 此预览引擎支持的文件后缀名。
|
||||
* 星好*表示匹配所有的后缀名。
|
||||
* 逗号分隔,不带. 例如: xls,doc,ppt,xlsx,docx,pptx
|
||||
*/
|
||||
extensions: string = "";
|
||||
|
||||
/**
|
||||
* 本站预览,新标签打开
|
||||
*/
|
||||
previewInSite: boolean = true;
|
||||
/**
|
||||
* 本站预览,新标签打开
|
||||
*/
|
||||
previewInSite: boolean = true;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
getForm(): any {
|
||||
return {
|
||||
url: this.url,
|
||||
extensions: this.extensions,
|
||||
previewInSite: this.previewInSite,
|
||||
};
|
||||
}
|
||||
|
||||
//提供几个默认的预览引擎。
|
||||
static defaultPreviewEngines(): PreviewEngine[] {
|
||||
let defaultEngines: PreviewEngine[] = [];
|
||||
|
||||
//添加office默认预览引擎,使用微软开放接口
|
||||
let officeEngine: PreviewEngine = new PreviewEngine();
|
||||
officeEngine.url =
|
||||
"https://view.officeapps.live.com/op/embed.aspx?src={url}";
|
||||
officeEngine.extensions = "doc,ppt,xls,docx,pptx,xlsx";
|
||||
officeEngine.previewInSite = true;
|
||||
defaultEngines.push(officeEngine);
|
||||
|
||||
//添加全局预览引擎,使用浏览器预览能力。
|
||||
let globalEngine: PreviewEngine = new PreviewEngine();
|
||||
globalEngine.url = "{originUrl}";
|
||||
globalEngine.extensions = "*";
|
||||
globalEngine.previewInSite = true;
|
||||
defaultEngines.push(globalEngine);
|
||||
|
||||
return defaultEngines;
|
||||
}
|
||||
|
||||
//对于某个文件,是否能够预览
|
||||
canPreview(fileName: string): boolean {
|
||||
let extension: string = MimeUtil.getExtensionWithoutDot(fileName);
|
||||
if (!extension) {
|
||||
return false;
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
let canHandle = false;
|
||||
if (this.extensions === "*") {
|
||||
canHandle = true;
|
||||
} else {
|
||||
let parts: string[] = this.extensions.split(",");
|
||||
for (let part of parts) {
|
||||
if (
|
||||
extension === part.toLowerCase() ||
|
||||
"." + extension === part.toLowerCase()
|
||||
) {
|
||||
canHandle = true;
|
||||
break;
|
||||
getForm(): any {
|
||||
return {
|
||||
url: this.url,
|
||||
extensions: this.extensions,
|
||||
previewInSite: this.previewInSite,
|
||||
};
|
||||
}
|
||||
|
||||
//提供几个默认的预览引擎。
|
||||
static defaultPreviewEngines(): PreviewEngine[] {
|
||||
let defaultEngines: PreviewEngine[] = [];
|
||||
|
||||
//添加office默认预览引擎,使用微软开放接口
|
||||
let officeEngine: PreviewEngine = new PreviewEngine();
|
||||
officeEngine.url =
|
||||
"https://view.officeapps.live.com/op/embed.aspx?src={url}";
|
||||
officeEngine.extensions = "doc,ppt,xls,docx,pptx,xlsx";
|
||||
officeEngine.previewInSite = true;
|
||||
defaultEngines.push(officeEngine);
|
||||
|
||||
//添加全局预览引擎,使用浏览器预览能力。
|
||||
let globalEngine: PreviewEngine = new PreviewEngine();
|
||||
globalEngine.url = "{originUrl}";
|
||||
globalEngine.extensions = "*";
|
||||
globalEngine.previewInSite = true;
|
||||
defaultEngines.push(globalEngine);
|
||||
|
||||
return defaultEngines;
|
||||
}
|
||||
|
||||
//对于某个文件,是否能够预览
|
||||
canPreview(fileName: string): boolean {
|
||||
let extension: string = MimeUtil.getExtensionWithoutDot(fileName);
|
||||
if (!extension) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return canHandle;
|
||||
}
|
||||
let canHandle = false;
|
||||
if (this.extensions === "*") {
|
||||
canHandle = true;
|
||||
} else {
|
||||
let parts: string[] = this.extensions.split(",");
|
||||
for (let part of parts) {
|
||||
if (
|
||||
extension === part.toLowerCase() ||
|
||||
"." + extension === part.toLowerCase()
|
||||
) {
|
||||
canHandle = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return canHandle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
/**
|
||||
* 扫描配置
|
||||
*/
|
||||
import { LabeledValue } from 'antd/lib/select';
|
||||
import {LabeledValue} from 'antd/lib/select';
|
||||
import Base from "../../base/Base";
|
||||
import { ScanScopeType } from "./ScanScopeType";
|
||||
import { ScanCronType } from "./ScanCronType";
|
||||
import {ScanScopeType} from "./ScanScopeType";
|
||||
import {ScanCronType} from "./ScanCronType";
|
||||
|
||||
export default class ScanConfig extends Base {
|
||||
// 是否开启
|
||||
enable: boolean = false;
|
||||
// cron表达式 定时任务用
|
||||
cron: string | null = null;
|
||||
// 扫描磁盘开启范围(全部用户 or 局部用户)
|
||||
scope: ScanScopeType = ScanScopeType.ALL;
|
||||
// 开启扫描磁盘功能的用户们
|
||||
usernames: string[] = [];
|
||||
// 是否开启
|
||||
enable: boolean = false;
|
||||
// cron表达式 定时任务用
|
||||
cron: string | null = null;
|
||||
// 扫描磁盘开启范围(全部用户 or 局部用户)
|
||||
scope: ScanScopeType = ScanScopeType.ALL;
|
||||
// 开启扫描磁盘功能的用户们
|
||||
usernames: string[] = [];
|
||||
|
||||
// 前端辅助字段
|
||||
cronType: string | null = null;
|
||||
users: LabeledValue[] = [];
|
||||
// 前端辅助字段
|
||||
cronType: string | null = null;
|
||||
users: LabeledValue[] = [];
|
||||
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
}
|
||||
|
||||
getForm(): any {
|
||||
return {
|
||||
enable: this.enable,
|
||||
scope: this.scope,
|
||||
cron: this.cronType === ScanCronType.CUSTOM ? this.cron : this.cronType,
|
||||
usernames: this.usernames,
|
||||
};
|
||||
}
|
||||
getForm(): any {
|
||||
return {
|
||||
enable: this.enable,
|
||||
scope: this.scope,
|
||||
cron: this.cronType === ScanCronType.CUSTOM ? this.cron : this.cronType,
|
||||
usernames: this.usernames,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,48 +2,48 @@ import SelectionOption from "../../base/option/SelectionOption";
|
||||
import Lang from "../../global/Lang";
|
||||
|
||||
enum ScanCronType {
|
||||
TEN_SECONDS = "TEN_SECONDS",
|
||||
THIRTY_SECONDS = "THIRTY_SECONDS",
|
||||
MINUTE = "MINUTE",
|
||||
HOUR = "HOUR",
|
||||
CUSTOM = "CUSTOM",
|
||||
TEN_SECONDS = "TEN_SECONDS",
|
||||
THIRTY_SECONDS = "THIRTY_SECONDS",
|
||||
MINUTE = "MINUTE",
|
||||
HOUR = "HOUR",
|
||||
CUSTOM = "CUSTOM",
|
||||
}
|
||||
|
||||
const ScanCronTypes: ScanCronType[] = Object.keys(ScanCronType).map(
|
||||
(k) => k as ScanCronType
|
||||
(k) => k as ScanCronType
|
||||
);
|
||||
|
||||
const ScanCronTypeMap: { [key in keyof typeof ScanCronType]: SelectionOption } = {
|
||||
TEN_SECONDS: {
|
||||
name: Lang.t("preference.scanPerTenSeconds"),
|
||||
value: "@every 10s",
|
||||
},
|
||||
THIRTY_SECONDS: {
|
||||
name: Lang.t("preference.scanPerThirtySeconds"),
|
||||
value: "@every 30s",
|
||||
},
|
||||
MINUTE: {
|
||||
name: Lang.t("preference.scanPerMinute"),
|
||||
value: "@every 1m",
|
||||
},
|
||||
HOUR: {
|
||||
name: Lang.t("preference.scanPerHour"),
|
||||
value: "0 * * * *",
|
||||
},
|
||||
CUSTOM: {
|
||||
name: Lang.t("preference.scanCustom"),
|
||||
value: "CUSTOM",
|
||||
},
|
||||
TEN_SECONDS: {
|
||||
name: Lang.t("preference.scanPerTenSeconds"),
|
||||
value: "@every 10s",
|
||||
},
|
||||
THIRTY_SECONDS: {
|
||||
name: Lang.t("preference.scanPerThirtySeconds"),
|
||||
value: "@every 30s",
|
||||
},
|
||||
MINUTE: {
|
||||
name: Lang.t("preference.scanPerMinute"),
|
||||
value: "@every 1m",
|
||||
},
|
||||
HOUR: {
|
||||
name: Lang.t("preference.scanPerHour"),
|
||||
value: "0 * * * *",
|
||||
},
|
||||
CUSTOM: {
|
||||
name: Lang.t("preference.scanCustom"),
|
||||
value: "CUSTOM",
|
||||
},
|
||||
};
|
||||
|
||||
const ScanCronTypeList: SelectionOption[] = [];
|
||||
ScanCronTypes.forEach((type: ScanCronType) => {
|
||||
ScanCronTypeList.push(ScanCronTypeMap[type]);
|
||||
ScanCronTypeList.push(ScanCronTypeMap[type]);
|
||||
});
|
||||
|
||||
const ScanCronTypeValueList: string[] = [];
|
||||
ScanCronTypes.forEach((type: ScanCronType) => {
|
||||
ScanCronTypeValueList.push(ScanCronTypeMap[type].value);
|
||||
ScanCronTypeValueList.push(ScanCronTypeMap[type].value);
|
||||
});
|
||||
|
||||
export { ScanCronType, ScanCronTypeMap, ScanCronTypeList, ScanCronTypeValueList };
|
||||
export {ScanCronType, ScanCronTypeMap, ScanCronTypeList, ScanCronTypeValueList};
|
||||
|
||||
@@ -2,28 +2,28 @@ import SelectionOption from "../../base/option/SelectionOption";
|
||||
import Lang from "../../global/Lang";
|
||||
|
||||
enum ScanScopeType {
|
||||
ALL = "ALL",
|
||||
CUSTOM = "CUSTOM",
|
||||
ALL = "ALL",
|
||||
CUSTOM = "CUSTOM",
|
||||
}
|
||||
|
||||
const ScanScopeTypes: ScanScopeType[] = Object.keys(ScanScopeType).map(
|
||||
(k) => k as ScanScopeType
|
||||
(k) => k as ScanScopeType
|
||||
);
|
||||
|
||||
const ScanScopeTypeMap: { [key in keyof typeof ScanScopeType]: SelectionOption } = {
|
||||
ALL: {
|
||||
name: Lang.t("user.allUsers"),
|
||||
value: "ALL",
|
||||
},
|
||||
CUSTOM: {
|
||||
name: Lang.t("user.partialUsers"),
|
||||
value: "CUSTOM",
|
||||
},
|
||||
ALL: {
|
||||
name: Lang.t("user.allUsers"),
|
||||
value: "ALL",
|
||||
},
|
||||
CUSTOM: {
|
||||
name: Lang.t("user.partialUsers"),
|
||||
value: "CUSTOM",
|
||||
},
|
||||
};
|
||||
|
||||
let ScanScopeTypeList: SelectionOption[] = [];
|
||||
ScanScopeTypes.forEach((type: ScanScopeType) => {
|
||||
ScanScopeTypeList.push(ScanScopeTypeMap[type]);
|
||||
ScanScopeTypeList.push(ScanScopeTypeMap[type]);
|
||||
});
|
||||
|
||||
export { ScanScopeType, ScanScopeTypeMap, ScanScopeTypeList };
|
||||
export {ScanScopeType, ScanScopeTypeMap, ScanScopeTypeList};
|
||||
|
||||
@@ -9,172 +9,172 @@ import SafeUtil from "../../util/SafeUtil";
|
||||
import MessageBoxUtil from "../../util/MessageBoxUtil";
|
||||
|
||||
export default class Share extends BaseEntity {
|
||||
name: string | null = null;
|
||||
shareType: ShareType = ShareType.MIX;
|
||||
userUuid: string | null = null;
|
||||
username: string | null = null;
|
||||
downloadTimes: number = 0;
|
||||
code: string | null = null;
|
||||
expireInfinity: boolean = false;
|
||||
expireTime: Date | null = null;
|
||||
name: string | null = null;
|
||||
shareType: ShareType = ShareType.MIX;
|
||||
userUuid: string | null = null;
|
||||
username: string | null = null;
|
||||
downloadTimes: number = 0;
|
||||
code: string | null = null;
|
||||
expireInfinity: boolean = false;
|
||||
expireTime: Date | null = null;
|
||||
|
||||
//当前正在查看的文件夹
|
||||
dirMatter: Matter = new Matter();
|
||||
//当前share对应的matters
|
||||
matters: Matter[] = [];
|
||||
//当前正在查看的文件夹
|
||||
dirMatter: Matter = new Matter();
|
||||
//当前share对应的matters
|
||||
matters: Matter[] = [];
|
||||
|
||||
//当前分享正在查看的根目录matter的uuid。前端辅助字段。
|
||||
rootUuid: string = Matter.MATTER_ROOT;
|
||||
//当前分享正在查看的根目录matter的uuid。前端辅助字段。
|
||||
rootUuid: string = Matter.MATTER_ROOT;
|
||||
|
||||
//本地临时字段
|
||||
expireOption: ShareExpireOption = ShareExpireOption.MONTH;
|
||||
//本地临时字段
|
||||
expireOption: ShareExpireOption = ShareExpireOption.MONTH;
|
||||
|
||||
static URL_CREATE = "/api/share/create";
|
||||
static URL_BROWSE = "/api/share/browse";
|
||||
static URL_DELETE_BATCH = "/api/share/delete/batch";
|
||||
static URL_ZIP = "/api/share/zip";
|
||||
static URL_CREATE = "/api/share/create";
|
||||
static URL_BROWSE = "/api/share/browse";
|
||||
static URL_DELETE_BATCH = "/api/share/delete/batch";
|
||||
static URL_ZIP = "/api/share/zip";
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
super.assignEntity("expireTime", Date);
|
||||
super.assignEntity("dirMatter", Matter);
|
||||
super.assignList("matters", Matter);
|
||||
}
|
||||
|
||||
getTAG():string {
|
||||
return "share"
|
||||
}
|
||||
|
||||
getFilters() {
|
||||
return [...super.getFilters()];
|
||||
}
|
||||
|
||||
getForm() {
|
||||
return {
|
||||
name: this.name,
|
||||
uuid: this.uuid ? this.uuid : null,
|
||||
};
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
if (this.shareType === ShareType.MIX) {
|
||||
return FileUtil.getIcon(
|
||||
"zip",
|
||||
false
|
||||
);
|
||||
} else {
|
||||
return FileUtil.getIcon(
|
||||
this.name,
|
||||
this.shareType === ShareType.DIRECTORY
|
||||
);
|
||||
constructor(reactComponent?: React.Component) {
|
||||
super(reactComponent);
|
||||
}
|
||||
}
|
||||
|
||||
getLink() {
|
||||
return EnvUtil.currentHost() + "/share/detail/" + this.uuid;
|
||||
}
|
||||
|
||||
hasExpired() {
|
||||
if (this.expireInfinity) {
|
||||
return false;
|
||||
} else {
|
||||
if (this.expireTime) {
|
||||
return new Date(this.expireTime).getTime() < new Date().getTime();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
super.assignEntity("expireTime", Date);
|
||||
super.assignEntity("dirMatter", Matter);
|
||||
super.assignList("matters", Matter);
|
||||
}
|
||||
}
|
||||
|
||||
//获取过期时间
|
||||
getExpireTime() {
|
||||
const delta = ShareExpireOptionMap[this.expireOption].deltaMillisecond;
|
||||
const now = new Date();
|
||||
return new Date(now.getTime() + delta);
|
||||
}
|
||||
getTAG(): string {
|
||||
return "share"
|
||||
}
|
||||
|
||||
//下载zip包
|
||||
downloadZip(puuid?: string) {
|
||||
window.open(
|
||||
`${EnvUtil.currentHost()}${Share.URL_ZIP}?shareUuid=${this.uuid}&code=${
|
||||
this.code
|
||||
}&puuid=${puuid}&rootUuid=${this.rootUuid}`
|
||||
);
|
||||
}
|
||||
getFilters() {
|
||||
return [...super.getFilters()];
|
||||
}
|
||||
|
||||
//创建一个分享matterUuids要求为数组,expireTime要求为时间对象
|
||||
httpCreate(
|
||||
matterUuids: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
getForm() {
|
||||
return {
|
||||
name: this.name,
|
||||
uuid: this.uuid ? this.uuid : null,
|
||||
};
|
||||
}
|
||||
|
||||
const form = {
|
||||
matterUuids: matterUuids,
|
||||
expireInfinity: this.expireOption === ShareExpireOption.INFINITY,
|
||||
expireTime: DateUtil.simpleDateTime(this.getExpireTime()),
|
||||
};
|
||||
getIcon() {
|
||||
if (this.shareType === ShareType.MIX) {
|
||||
return FileUtil.getIcon(
|
||||
"zip",
|
||||
false
|
||||
);
|
||||
} else {
|
||||
return FileUtil.getIcon(
|
||||
this.name,
|
||||
this.shareType === ShareType.DIRECTORY
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.httpPost(
|
||||
Share.URL_CREATE,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
getLink() {
|
||||
return EnvUtil.currentHost() + "/share/detail/" + this.uuid;
|
||||
}
|
||||
|
||||
httpDeleteBatch(
|
||||
uuids: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
this.httpPost(
|
||||
Share.URL_DELETE_BATCH,
|
||||
{uuids: uuids},
|
||||
function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
hasExpired() {
|
||||
if (this.expireInfinity) {
|
||||
return false;
|
||||
} else {
|
||||
if (this.expireTime) {
|
||||
return new Date(this.expireTime).getTime() < new Date().getTime();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
httpBrowse(
|
||||
puuid: string,
|
||||
rootUuid: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
//获取过期时间
|
||||
getExpireTime() {
|
||||
const delta = ShareExpireOptionMap[this.expireOption].deltaMillisecond;
|
||||
const now = new Date();
|
||||
return new Date(now.getTime() + delta);
|
||||
}
|
||||
|
||||
const form = {
|
||||
puuid,
|
||||
rootUuid,
|
||||
shareUuid: this.uuid,
|
||||
code: this.code,
|
||||
};
|
||||
//下载zip包
|
||||
downloadZip(puuid?: string) {
|
||||
window.open(
|
||||
`${EnvUtil.currentHost()}${Share.URL_ZIP}?shareUuid=${this.uuid}&code=${
|
||||
this.code
|
||||
}&puuid=${puuid}&rootUuid=${this.rootUuid}`
|
||||
);
|
||||
}
|
||||
|
||||
this.detailLoading = true;
|
||||
this.httpPost(
|
||||
Share.URL_BROWSE,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
that.detailLoading = false;
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
function (errorMsg: any) {
|
||||
that.detailLoading = false;
|
||||
MessageBoxUtil.error(errorMsg);
|
||||
SafeUtil.safeCallback(errorCallback)(errorMsg);
|
||||
}
|
||||
);
|
||||
}
|
||||
//创建一个分享matterUuids要求为数组,expireTime要求为时间对象
|
||||
httpCreate(
|
||||
matterUuids: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
|
||||
const form = {
|
||||
matterUuids: matterUuids,
|
||||
expireInfinity: this.expireOption === ShareExpireOption.INFINITY,
|
||||
expireTime: DateUtil.simpleDateTime(this.getExpireTime()),
|
||||
};
|
||||
|
||||
this.httpPost(
|
||||
Share.URL_CREATE,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
|
||||
httpDeleteBatch(
|
||||
uuids: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
this.httpPost(
|
||||
Share.URL_DELETE_BATCH,
|
||||
{uuids: uuids},
|
||||
function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
errorCallback
|
||||
);
|
||||
}
|
||||
|
||||
httpBrowse(
|
||||
puuid: string,
|
||||
rootUuid: string,
|
||||
successCallback?: () => any,
|
||||
errorCallback?: () => any
|
||||
) {
|
||||
let that = this;
|
||||
|
||||
const form = {
|
||||
puuid,
|
||||
rootUuid,
|
||||
shareUuid: this.uuid,
|
||||
code: this.code,
|
||||
};
|
||||
|
||||
this.detailLoading = true;
|
||||
this.httpPost(
|
||||
Share.URL_BROWSE,
|
||||
form,
|
||||
function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
that.detailLoading = false;
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
},
|
||||
function (errorMsg: any) {
|
||||
that.detailLoading = false;
|
||||
MessageBoxUtil.error(errorMsg);
|
||||
SafeUtil.safeCallback(errorCallback)(errorMsg);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
import SelectionOption from "../base/option/SelectionOption";
|
||||
|
||||
enum ShareExpireOption {
|
||||
HOUR = "HOUR",
|
||||
DAY = "DAY",
|
||||
WEEK = "WEEK",
|
||||
MONTH = "MONTH",
|
||||
YEAR = "YEAR",
|
||||
INFINITY = "INFINITY",
|
||||
HOUR = "HOUR",
|
||||
DAY = "DAY",
|
||||
WEEK = "WEEK",
|
||||
MONTH = "MONTH",
|
||||
YEAR = "YEAR",
|
||||
INFINITY = "INFINITY",
|
||||
}
|
||||
|
||||
interface ShareExpireSelection extends SelectionOption {
|
||||
deltaMillisecond: number;
|
||||
deltaMillisecond: number;
|
||||
}
|
||||
|
||||
const ShareExpireOptions: ShareExpireOption[] = Object.keys(
|
||||
ShareExpireOption
|
||||
ShareExpireOption
|
||||
).map((k) => k as ShareExpireOption);
|
||||
|
||||
const ShareExpireOptionMap: {
|
||||
[key in keyof typeof ShareExpireOption]: ShareExpireSelection;
|
||||
[key in keyof typeof ShareExpireOption]: ShareExpireSelection;
|
||||
} = {
|
||||
HOUR: {
|
||||
name: "share.hour",
|
||||
value: "HOUR",
|
||||
deltaMillisecond: 60 * 60 * 1000,
|
||||
},
|
||||
DAY: {
|
||||
name: "share.day",
|
||||
value: "DAY",
|
||||
deltaMillisecond: 24 * 60 * 60 * 1000,
|
||||
},
|
||||
WEEK: {
|
||||
name: "share.week",
|
||||
value: "WEEK",
|
||||
deltaMillisecond: 7 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
MONTH: {
|
||||
name: "share.month",
|
||||
value: "MONTH",
|
||||
deltaMillisecond: 30 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
YEAR: {
|
||||
name: "share.year",
|
||||
value: "YEAR",
|
||||
deltaMillisecond: 365 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
INFINITY: {
|
||||
name: "share.infinity",
|
||||
value: "INFINITY",
|
||||
deltaMillisecond: 0,
|
||||
},
|
||||
HOUR: {
|
||||
name: "share.hour",
|
||||
value: "HOUR",
|
||||
deltaMillisecond: 60 * 60 * 1000,
|
||||
},
|
||||
DAY: {
|
||||
name: "share.day",
|
||||
value: "DAY",
|
||||
deltaMillisecond: 24 * 60 * 60 * 1000,
|
||||
},
|
||||
WEEK: {
|
||||
name: "share.week",
|
||||
value: "WEEK",
|
||||
deltaMillisecond: 7 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
MONTH: {
|
||||
name: "share.month",
|
||||
value: "MONTH",
|
||||
deltaMillisecond: 30 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
YEAR: {
|
||||
name: "share.year",
|
||||
value: "YEAR",
|
||||
deltaMillisecond: 365 * 24 * 60 * 60 * 1000,
|
||||
},
|
||||
INFINITY: {
|
||||
name: "share.infinity",
|
||||
value: "INFINITY",
|
||||
deltaMillisecond: 0,
|
||||
},
|
||||
};
|
||||
|
||||
let ShareExpireOptionList: ShareExpireSelection[] = [];
|
||||
ShareExpireOptions.forEach((type: ShareExpireOption) => {
|
||||
ShareExpireOptionList.push(ShareExpireOptionMap[type]);
|
||||
ShareExpireOptionList.push(ShareExpireOptionMap[type]);
|
||||
});
|
||||
|
||||
export { ShareExpireOption, ShareExpireOptionMap, ShareExpireOptionList };
|
||||
export {ShareExpireOption, ShareExpireOptionMap, ShareExpireOptionList};
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
import SelectionOption from "../base/option/SelectionOption";
|
||||
|
||||
enum ShareType {
|
||||
FILE = "FILE",
|
||||
DIRECTORY = "DIRECTORY",
|
||||
MIX = "MIX",
|
||||
FILE = "FILE",
|
||||
DIRECTORY = "DIRECTORY",
|
||||
MIX = "MIX",
|
||||
}
|
||||
|
||||
const ShareTypes: ShareType[] = Object.keys(ShareType).map(
|
||||
(k) => k as ShareType
|
||||
(k) => k as ShareType
|
||||
);
|
||||
|
||||
const ShareTypeMap: { [key in keyof typeof ShareType]: SelectionOption } = {
|
||||
FILE: {
|
||||
name: "文件",
|
||||
value: "FILE",
|
||||
},
|
||||
DIRECTORY: {
|
||||
name: "文件夹",
|
||||
value: "DIRECTORY",
|
||||
},
|
||||
MIX: {
|
||||
name: "混合",
|
||||
value: "MIX",
|
||||
},
|
||||
FILE: {
|
||||
name: "文件",
|
||||
value: "FILE",
|
||||
},
|
||||
DIRECTORY: {
|
||||
name: "文件夹",
|
||||
value: "DIRECTORY",
|
||||
},
|
||||
MIX: {
|
||||
name: "混合",
|
||||
value: "MIX",
|
||||
},
|
||||
};
|
||||
|
||||
let ShareTypeList: SelectionOption[] = [];
|
||||
ShareTypes.forEach((type: ShareType) => {
|
||||
ShareTypeList.push(ShareTypeMap[type]);
|
||||
ShareTypeList.push(ShareTypeMap[type]);
|
||||
});
|
||||
|
||||
export { ShareType, ShareTypeMap, ShareTypeList };
|
||||
export {ShareType, ShareTypeMap, ShareTypeList};
|
||||
|
||||
@@ -11,228 +11,228 @@ import SelectionFilter from "../base/filter/SelectionFilter";
|
||||
|
||||
export default class User extends BaseEntity {
|
||||
|
||||
//获取当前登录者的信息
|
||||
static URL_INFO = '/api/user/info';
|
||||
static URL_LOGIN = '/api/user/login'
|
||||
static URL_AUTHENTICATION_LOGIN = '/api/user/authentication/login'
|
||||
static URL_REGISTER = '/api/user/register'
|
||||
static URL_LOGOUT = '/api/user/logout'
|
||||
static URL_USER_CHANGE_PASSWORD = '/api/user/change/password'
|
||||
static URL_USER_RESET_PASSWORD = '/api/user/reset/password'
|
||||
static URL_USER_TOGGLE_STATUS = '/api/user/toggle/status'
|
||||
static URL_USER_TRANSFIGURATION = '/api/user/transfiguration'
|
||||
static URL_USER_SCAN = '/api/user/scan'
|
||||
//获取当前登录者的信息
|
||||
static URL_INFO = '/api/user/info';
|
||||
static URL_LOGIN = '/api/user/login'
|
||||
static URL_AUTHENTICATION_LOGIN = '/api/user/authentication/login'
|
||||
static URL_REGISTER = '/api/user/register'
|
||||
static URL_LOGOUT = '/api/user/logout'
|
||||
static URL_USER_CHANGE_PASSWORD = '/api/user/change/password'
|
||||
static URL_USER_RESET_PASSWORD = '/api/user/reset/password'
|
||||
static URL_USER_TOGGLE_STATUS = '/api/user/toggle/status'
|
||||
static URL_USER_TRANSFIGURATION = '/api/user/transfiguration'
|
||||
static URL_USER_SCAN = '/api/user/scan'
|
||||
|
||||
role: UserRole = UserRole.GUEST
|
||||
username: string | null = null
|
||||
password: string | null = null
|
||||
avatarUrl: string | null = null
|
||||
lastIp: string | null = null
|
||||
lastTime: Date = new Date()
|
||||
//默认大小限制100Mb.
|
||||
sizeLimit: number = 104857600
|
||||
totalSize: number = 0
|
||||
totalSizeLimit: number = -1
|
||||
status: UserStatus = UserStatus.OK
|
||||
role: UserRole = UserRole.GUEST
|
||||
username: string | null = null
|
||||
password: string | null = null
|
||||
avatarUrl: string | null = null
|
||||
lastIp: string | null = null
|
||||
lastTime: Date = new Date()
|
||||
//默认大小限制100Mb.
|
||||
sizeLimit: number = 104857600
|
||||
totalSize: number = 0
|
||||
totalSizeLimit: number = -1
|
||||
status: UserStatus = UserStatus.OK
|
||||
|
||||
|
||||
constructor(reactComponent?: React.Component) {
|
||||
constructor(reactComponent?: React.Component) {
|
||||
|
||||
super(reactComponent);
|
||||
super(reactComponent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
this.assignEntity("lastTime", Date)
|
||||
|
||||
}
|
||||
|
||||
getTAG(): string {
|
||||
return "user"
|
||||
}
|
||||
|
||||
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new SortFilter("按上次登录时间排序", "orderLastTime"),
|
||||
new InputFilter("用户名", "username", "按用户名搜索"),
|
||||
new SelectionFilter("状态", "status", UserStatusList),
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
getForm(): any {
|
||||
return {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
role: this.role,
|
||||
avatarUrl: this.avatarUrl,
|
||||
sizeLimit: this.sizeLimit,
|
||||
totalSizeLimit: this.totalSizeLimit,
|
||||
uuid: this.uuid ? this.uuid : null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
getAvatarUrl(origin: boolean = false) {
|
||||
if (this.avatarUrl) {
|
||||
return ImageUtil.handleImageUrl(this.avatarUrl, origin)
|
||||
} else {
|
||||
return defaultAvatarPath
|
||||
}
|
||||
}
|
||||
|
||||
//登录
|
||||
httpLogin(username: string, password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
assign(obj: any) {
|
||||
super.assign(obj);
|
||||
|
||||
let form = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
this.assignEntity("lastTime", Date)
|
||||
|
||||
this.httpGet(User.URL_LOGIN, form, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
//注册
|
||||
httpRegister(username: string, password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let form = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
|
||||
this.httpGet(User.URL_REGISTER, form, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
//获取当前登录者的信息
|
||||
httpInfo(loginRequired: boolean, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (loginRequired) { // httpGet有统一的登录处理机制
|
||||
this.httpGet(User.URL_INFO, {}, function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
}, null, finalCallback);
|
||||
} else {
|
||||
this.httpPureGet(User.URL_INFO, {}, function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
}, () => {
|
||||
}, finalCallback);
|
||||
}
|
||||
}
|
||||
|
||||
getTAG(): string {
|
||||
return "user"
|
||||
}
|
||||
|
||||
|
||||
//退出登录
|
||||
httpLogout(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
getFilters(): Filter[] {
|
||||
return [
|
||||
...super.getFilters(),
|
||||
new SortFilter("按上次登录时间排序", "orderLastTime"),
|
||||
new InputFilter("用户名", "username", "按用户名搜索"),
|
||||
new SelectionFilter("状态", "status", UserStatusList),
|
||||
|
||||
let that = this;
|
||||
]
|
||||
}
|
||||
|
||||
let form = {};
|
||||
|
||||
this.httpGet(User.URL_LOGOUT, form, function (response: any) {
|
||||
|
||||
console.info('退出成功!');
|
||||
|
||||
that.assign(new User())
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
getForm(): any {
|
||||
return {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
role: this.role,
|
||||
avatarUrl: this.avatarUrl,
|
||||
sizeLimit: this.sizeLimit,
|
||||
totalSizeLimit: this.totalSizeLimit,
|
||||
uuid: this.uuid ? this.uuid : null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
httpChangePassword(oldPassword: string, newPassword: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(User.URL_USER_CHANGE_PASSWORD, {
|
||||
'oldPassword': oldPassword,
|
||||
'newPassword': newPassword
|
||||
}, function (response: any) {
|
||||
getAvatarUrl(origin: boolean = false) {
|
||||
if (this.avatarUrl) {
|
||||
return ImageUtil.handleImageUrl(this.avatarUrl, origin)
|
||||
} else {
|
||||
return defaultAvatarPath
|
||||
}
|
||||
}
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
//登录
|
||||
httpLogin(username: string, password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let form = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
|
||||
this.httpGet(User.URL_LOGIN, form, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
//注册
|
||||
httpRegister(username: string, password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
|
||||
let form = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
|
||||
this.httpGet(User.URL_REGISTER, form, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
//获取当前登录者的信息
|
||||
httpInfo(loginRequired: boolean, finalCallback?: any) {
|
||||
|
||||
let that = this;
|
||||
if (loginRequired) { // httpGet有统一的登录处理机制
|
||||
this.httpGet(User.URL_INFO, {}, function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
}, null, finalCallback);
|
||||
} else {
|
||||
this.httpPureGet(User.URL_INFO, {}, function (response: any) {
|
||||
that.assign(response.data.data);
|
||||
}, () => {
|
||||
}, finalCallback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
//退出登录
|
||||
httpLogout(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
|
||||
httpResetPassword(password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
this.httpPost(User.URL_USER_RESET_PASSWORD, {
|
||||
'userUuid': this.uuid,
|
||||
'password': password
|
||||
}, function (response: any) {
|
||||
let that = this;
|
||||
|
||||
let form = {};
|
||||
|
||||
this.httpGet(User.URL_LOGOUT, form, function (response: any) {
|
||||
|
||||
console.info('退出成功!');
|
||||
|
||||
that.assign(new User())
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
}, errorCallback, finalCallback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
httpChangePassword(oldPassword: string, newPassword: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(User.URL_USER_CHANGE_PASSWORD, {
|
||||
'oldPassword': oldPassword,
|
||||
'newPassword': newPassword
|
||||
}, function (response: any) {
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
httpResetPassword(password: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
this.httpPost(User.URL_USER_RESET_PASSWORD, {
|
||||
'userUuid': this.uuid,
|
||||
'password': password
|
||||
}, function (response: any) {
|
||||
|
||||
|
||||
httpToggleStatus(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(User.URL_USER_TOGGLE_STATUS, {'uuid': this.uuid}, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
httpAuthenticationLogin(authentication: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {authentication}
|
||||
this.httpPost(User.URL_AUTHENTICATION_LOGIN, form, function (response: any) {
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
httpToggleStatus(successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
this.httpPost(User.URL_USER_TOGGLE_STATUS, {'uuid': this.uuid}, function (response: any) {
|
||||
|
||||
that.assign(response.data.data);
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
httpTransfiguration(successCallback: (text: string) => void, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {'uuid': this.uuid}
|
||||
this.httpPost(User.URL_USER_TRANSFIGURATION, form, function (response: any) {
|
||||
|
||||
successCallback(response.data.msg)
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
httpAuthenticationLogin(authentication: string, successCallback?: any, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {authentication}
|
||||
this.httpPost(User.URL_AUTHENTICATION_LOGIN, form, function (response: any) {
|
||||
|
||||
|
||||
httpScan(successCallback: (text: string) => void, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {'uuid': this.uuid}
|
||||
this.httpPost(User.URL_USER_SCAN, form, function (response: any) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
|
||||
successCallback(response.data.msg)
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
httpTransfiguration(successCallback: (text: string) => void, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {'uuid': this.uuid}
|
||||
this.httpPost(User.URL_USER_TRANSFIGURATION, form, function (response: any) {
|
||||
|
||||
successCallback(response.data.msg)
|
||||
|
||||
}, errorCallback)
|
||||
}
|
||||
|
||||
|
||||
httpScan(successCallback: (text: string) => void, errorCallback?: any, finalCallback?: any) {
|
||||
let that = this
|
||||
let form = {'uuid': this.uuid}
|
||||
this.httpPost(User.URL_USER_SCAN, form, function (response: any) {
|
||||
|
||||
successCallback(response.data.msg)
|
||||
|
||||
}, errorCallback, finalCallback)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,35 +4,35 @@ import Lang from "../global/Lang";
|
||||
|
||||
|
||||
enum UserRole {
|
||||
GUEST = 'GUEST',
|
||||
USER = 'USER',
|
||||
ADMINISTRATOR = 'ADMINISTRATOR',
|
||||
GUEST = 'GUEST',
|
||||
USER = 'USER',
|
||||
ADMINISTRATOR = 'ADMINISTRATOR',
|
||||
}
|
||||
|
||||
let UserRoles: UserRole[] = Object.keys(UserRole).map(k => k as UserRole);
|
||||
|
||||
let UserRoleMap: { [key in keyof typeof UserRole]: ColorSelectionOption } = {
|
||||
GUEST: {
|
||||
'name': Lang.t("user.roleGuest"),
|
||||
'value': 'GUEST',
|
||||
'color': Color.WARNING,
|
||||
},
|
||||
USER: {
|
||||
'name': Lang.t("user.roleUser"),
|
||||
'value': 'USER',
|
||||
'color': Color.PRIMARY,
|
||||
},
|
||||
ADMINISTRATOR: {
|
||||
'name': Lang.t("user.roleAdministrator"),
|
||||
'value': 'ADMINISTRATOR',
|
||||
'color': Color.DANGER,
|
||||
},
|
||||
GUEST: {
|
||||
'name': Lang.t("user.roleGuest"),
|
||||
'value': 'GUEST',
|
||||
'color': Color.WARNING,
|
||||
},
|
||||
USER: {
|
||||
'name': Lang.t("user.roleUser"),
|
||||
'value': 'USER',
|
||||
'color': Color.PRIMARY,
|
||||
},
|
||||
ADMINISTRATOR: {
|
||||
'name': Lang.t("user.roleAdministrator"),
|
||||
'value': 'ADMINISTRATOR',
|
||||
'color': Color.DANGER,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
let UserRoleList: ColorSelectionOption[] = [];
|
||||
UserRoles.forEach((type: UserRole, index: number) => {
|
||||
UserRoleList.push(UserRoleMap[type]);
|
||||
UserRoleList.push(UserRoleMap[type]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -4,28 +4,28 @@ import Lang from "../global/Lang";
|
||||
|
||||
|
||||
enum UserStatus {
|
||||
OK = 'OK',
|
||||
DISABLED = 'DISABLED'
|
||||
OK = 'OK',
|
||||
DISABLED = 'DISABLED'
|
||||
}
|
||||
|
||||
let UserStatuss: UserStatus[] = Object.keys(UserStatus).map(k => k as UserStatus);
|
||||
|
||||
let UserStatusMap: { [key in keyof typeof UserStatus]: ColorSelectionOption } = {
|
||||
OK: {
|
||||
'name': Lang.t("user.statusActive"),
|
||||
'value': 'OK',
|
||||
'color': Color.SUCCESS,
|
||||
},
|
||||
DISABLED: {
|
||||
'name': Lang.t("user.statusDisabled"),
|
||||
'value': 'DISABLED',
|
||||
'color': Color.DANGER,
|
||||
},
|
||||
OK: {
|
||||
'name': Lang.t("user.statusActive"),
|
||||
'value': 'OK',
|
||||
'color': Color.SUCCESS,
|
||||
},
|
||||
DISABLED: {
|
||||
'name': Lang.t("user.statusDisabled"),
|
||||
'value': 'DISABLED',
|
||||
'color': Color.DANGER,
|
||||
},
|
||||
};
|
||||
|
||||
let UserStatusList: ColorSelectionOption[] = [];
|
||||
UserStatuss.forEach((type: UserStatus, index: number) => {
|
||||
UserStatusList.push(UserStatusMap[type]);
|
||||
UserStatusList.push(UserStatusMap[type]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@ import * as React from "react";
|
||||
* 定义了一个图标行为的对象,这个可以辅助一些组件。
|
||||
*/
|
||||
export interface IconActionItem {
|
||||
//图片的资源链接(优先级高于iconType)
|
||||
icon?: string
|
||||
//antd的图标类型
|
||||
iconType?: string
|
||||
//名称
|
||||
name?: string
|
||||
//是否可见。默认可见
|
||||
visible?: boolean
|
||||
//点击图标后的行为
|
||||
onClick?: () => void
|
||||
//图片的资源链接(优先级高于iconType)
|
||||
icon?: string
|
||||
//antd的图标类型
|
||||
iconType?: string
|
||||
//名称
|
||||
name?: string
|
||||
//是否可见。默认可见
|
||||
visible?: boolean
|
||||
//点击图标后的行为
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ export interface IconActionItem {
|
||||
*/
|
||||
export interface ToolItem {
|
||||
|
||||
name: string
|
||||
name: string
|
||||
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
|
||||
//antd的图标样式
|
||||
icon: React.ReactNode
|
||||
//antd的图标样式
|
||||
icon: React.ReactNode
|
||||
|
||||
}
|
||||
|
||||
@@ -40,16 +40,16 @@ export interface ToolItem {
|
||||
*/
|
||||
export interface SkeletonItem {
|
||||
|
||||
name: string
|
||||
name: string
|
||||
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
//当前是否处于展开状态
|
||||
active: boolean
|
||||
|
||||
//高亮的图标 资源链接
|
||||
activeIcon: string
|
||||
//高亮的图标 资源链接
|
||||
activeIcon: string
|
||||
|
||||
//一般状态的图标 资源链接
|
||||
icon: string
|
||||
//一般状态的图标 资源链接
|
||||
icon: string
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,91 +2,91 @@ import SafeUtil from "./SafeUtil";
|
||||
|
||||
export default class AnimateUtil {
|
||||
|
||||
/**
|
||||
* 动画函数
|
||||
* @param startValue 开始的值
|
||||
* @param endValue 结束的值
|
||||
* @param duration 动画持续时间,单位ms 如果开始值和结束值一样,那么会提前结束。
|
||||
* @param processHandler 过程中处理的回调函数. 该函数能保证第一个值是startValue,结束的值是endValue
|
||||
* @param startHandler 开始的回调函数
|
||||
* @param endHandler 结束的回调函数
|
||||
* @param standard 每隔多少毫秒进行一次处理。
|
||||
*
|
||||
*/
|
||||
static animate(
|
||||
startValue: number,
|
||||
endValue: number,
|
||||
duration: number,
|
||||
processHandler: (value: number) => void,
|
||||
startHandler?: (value: number) => void,
|
||||
endHandler?: (value: number) => void,
|
||||
standard?: number
|
||||
): void {
|
||||
/**
|
||||
* 动画函数
|
||||
* @param startValue 开始的值
|
||||
* @param endValue 结束的值
|
||||
* @param duration 动画持续时间,单位ms 如果开始值和结束值一样,那么会提前结束。
|
||||
* @param processHandler 过程中处理的回调函数. 该函数能保证第一个值是startValue,结束的值是endValue
|
||||
* @param startHandler 开始的回调函数
|
||||
* @param endHandler 结束的回调函数
|
||||
* @param standard 每隔多少毫秒进行一次处理。
|
||||
*
|
||||
*/
|
||||
static animate(
|
||||
startValue: number,
|
||||
endValue: number,
|
||||
duration: number,
|
||||
processHandler: (value: number) => void,
|
||||
startHandler?: (value: number) => void,
|
||||
endHandler?: (value: number) => void,
|
||||
standard?: number
|
||||
): void {
|
||||
|
||||
|
||||
//规则校验。
|
||||
if (duration <= 0) {
|
||||
console.error("duration值只能是正整数")
|
||||
return
|
||||
//规则校验。
|
||||
if (duration <= 0) {
|
||||
console.error("duration值只能是正整数")
|
||||
return
|
||||
}
|
||||
|
||||
if (standard == undefined) {
|
||||
standard = 20
|
||||
} else if (standard <= 0) {
|
||||
console.error("standard值只能是正整数")
|
||||
return
|
||||
}
|
||||
|
||||
let totalStep: number = endValue - startValue
|
||||
|
||||
//从startValue到endValue需要触发几次。
|
||||
let num = Math.ceil(duration / standard)
|
||||
|
||||
//每一步的长度
|
||||
let delta: number = totalStep
|
||||
if (num != 0) {
|
||||
delta = Math.ceil(totalStep / num)
|
||||
}
|
||||
|
||||
//定时执行
|
||||
let sum = 0;
|
||||
SafeUtil.safeCallback(startHandler)(startValue)
|
||||
processHandler(startValue)
|
||||
let intervalHandler = setInterval(() => {
|
||||
|
||||
sum = sum + delta
|
||||
if (Math.abs(sum) >= Math.abs(totalStep)) {
|
||||
//该停止了
|
||||
processHandler(endValue)
|
||||
SafeUtil.safeCallback(endHandler)(endValue)
|
||||
|
||||
//关闭定时器。
|
||||
clearInterval(intervalHandler)
|
||||
|
||||
} else {
|
||||
//更新当前进度
|
||||
processHandler(startValue + sum)
|
||||
}
|
||||
|
||||
}, standard)
|
||||
|
||||
}
|
||||
|
||||
if (standard == undefined) {
|
||||
standard = 20
|
||||
} else if (standard <= 0) {
|
||||
console.error("standard值只能是正整数")
|
||||
return
|
||||
static setInputSelection(input: HTMLInputElement, startPos: number, endPos: number) {
|
||||
input.focus();
|
||||
if (typeof input.selectionStart !== "undefined") {
|
||||
input.selectionStart = startPos;
|
||||
input.selectionEnd = endPos;
|
||||
} else if ((document as any).selection && (document as any).selection.createRange) {
|
||||
// IE branch
|
||||
input.select();
|
||||
let range = (document as any).selection.createRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd("character", endPos);
|
||||
range.moveStart("character", startPos);
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
|
||||
let totalStep: number = endValue - startValue
|
||||
|
||||
//从startValue到endValue需要触发几次。
|
||||
let num = Math.ceil(duration / standard)
|
||||
|
||||
//每一步的长度
|
||||
let delta: number = totalStep
|
||||
if (num != 0) {
|
||||
delta = Math.ceil(totalStep / num)
|
||||
}
|
||||
|
||||
//定时执行
|
||||
let sum = 0;
|
||||
SafeUtil.safeCallback(startHandler)(startValue)
|
||||
processHandler(startValue)
|
||||
let intervalHandler = setInterval(() => {
|
||||
|
||||
sum = sum + delta
|
||||
if (Math.abs(sum) >= Math.abs(totalStep)) {
|
||||
//该停止了
|
||||
processHandler(endValue)
|
||||
SafeUtil.safeCallback(endHandler)(endValue)
|
||||
|
||||
//关闭定时器。
|
||||
clearInterval(intervalHandler)
|
||||
|
||||
} else {
|
||||
//更新当前进度
|
||||
processHandler(startValue + sum)
|
||||
}
|
||||
|
||||
}, standard)
|
||||
|
||||
}
|
||||
|
||||
static setInputSelection(input: HTMLInputElement, startPos: number, endPos: number) {
|
||||
input.focus();
|
||||
if (typeof input.selectionStart !== "undefined") {
|
||||
input.selectionStart = startPos;
|
||||
input.selectionEnd = endPos;
|
||||
} else if ((document as any).selection && (document as any).selection.createRange) {
|
||||
// IE branch
|
||||
input.select();
|
||||
let range = (document as any).selection.createRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd("character", endPos);
|
||||
range.moveStart("character", startPos);
|
||||
range.select();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,41 +6,41 @@ import DateUtil from "./DateUtil";
|
||||
export default class AntdUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 从一个数组中,获取到antd table想要的那种dataSource格式
|
||||
*/
|
||||
static getDataSource(columns :any, data :any) {
|
||||
/**
|
||||
* 从一个数组中,获取到antd table想要的那种dataSource格式
|
||||
*/
|
||||
static getDataSource(columns: any, data: any) {
|
||||
|
||||
let dataSource :any= []
|
||||
if (!((columns instanceof Array) && (data instanceof Array))) {
|
||||
let dataSource: any = []
|
||||
if (!((columns instanceof Array) && (data instanceof Array))) {
|
||||
|
||||
console.error("columns和data必须为数组")
|
||||
return dataSource
|
||||
}
|
||||
|
||||
data.forEach((item, index) => {
|
||||
|
||||
let obj :any = {key: index, id: item.id}
|
||||
|
||||
|
||||
columns.forEach((column, i) => {
|
||||
|
||||
let value = item[column.key]
|
||||
|
||||
//遇到时间自动转成 yyyy-MM-dd HH:mm:ss
|
||||
if (value instanceof Date) {
|
||||
value = DateUtil.simpleDateTime(value)
|
||||
console.error("columns和data必须为数组")
|
||||
return dataSource
|
||||
}
|
||||
|
||||
obj[column.key] = value
|
||||
})
|
||||
data.forEach((item, index) => {
|
||||
|
||||
dataSource.push(obj)
|
||||
})
|
||||
let obj: any = {key: index, id: item.id}
|
||||
|
||||
|
||||
return dataSource
|
||||
columns.forEach((column, i) => {
|
||||
|
||||
}
|
||||
let value = item[column.key]
|
||||
|
||||
//遇到时间自动转成 yyyy-MM-dd HH:mm:ss
|
||||
if (value instanceof Date) {
|
||||
value = DateUtil.simpleDateTime(value)
|
||||
}
|
||||
|
||||
obj[column.key] = value
|
||||
})
|
||||
|
||||
dataSource.push(obj)
|
||||
})
|
||||
|
||||
|
||||
return dataSource
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,142 +1,142 @@
|
||||
export default class ArrayUtil {
|
||||
|
||||
|
||||
//从srcArray中减去childArray的元素
|
||||
static substract(srcArray: [], childArray: any) {
|
||||
if (!srcArray) {
|
||||
return [];
|
||||
}
|
||||
//从srcArray中减去childArray的元素
|
||||
static substract(srcArray: [], childArray: any) {
|
||||
if (!srcArray) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!childArray || childArray.length === 0) {
|
||||
return srcArray;
|
||||
}
|
||||
if (!childArray || childArray.length === 0) {
|
||||
return srcArray;
|
||||
}
|
||||
|
||||
let newArray: [] = []
|
||||
let newArray: [] = []
|
||||
|
||||
for (let i = 0; i < srcArray.length; i++) {
|
||||
for (let i = 0; i < srcArray.length; i++) {
|
||||
|
||||
//在childArray的那些元素就不要了。
|
||||
if (childArray.indexOf(srcArray[i]) === -1) {
|
||||
newArray.push(srcArray[i])
|
||||
}
|
||||
//在childArray的那些元素就不要了。
|
||||
if (childArray.indexOf(srcArray[i]) === -1) {
|
||||
newArray.push(srcArray[i])
|
||||
}
|
||||
|
||||
}
|
||||
return newArray
|
||||
|
||||
}
|
||||
|
||||
//不重复添加
|
||||
static uniqueAdd(srcArray: any, childArray: any) {
|
||||
if (!srcArray) {
|
||||
srcArray = []
|
||||
}
|
||||
|
||||
if (!childArray || childArray.length === 0) {
|
||||
return srcArray;
|
||||
}
|
||||
|
||||
|
||||
for (let i = 0; i < childArray.length; i++) {
|
||||
|
||||
//在childArray的那些元素就不要了。
|
||||
if (srcArray.indexOf(childArray[i]) === -1) {
|
||||
srcArray.push(childArray[i])
|
||||
}
|
||||
|
||||
}
|
||||
return srcArray
|
||||
}
|
||||
|
||||
//不重复添加
|
||||
static uniqueAddOne(srcArray: any[], child: any) {
|
||||
if (!srcArray) {
|
||||
srcArray = []
|
||||
}
|
||||
|
||||
if (child === undefined || child === null) {
|
||||
return srcArray;
|
||||
}
|
||||
|
||||
//在childArray的那些元素就不要了。
|
||||
if (srcArray.indexOf(child) === -1) {
|
||||
srcArray.push(child)
|
||||
}
|
||||
|
||||
return srcArray
|
||||
}
|
||||
|
||||
//数组中查找特定元素并返回所有该元素的索引
|
||||
static findAll(a: any, x: any) {
|
||||
let results: number[] = [],
|
||||
len = a.length,
|
||||
pos: number = 0;
|
||||
while (pos < len) {
|
||||
pos = a.indexOf(x, pos);
|
||||
if (pos === -1) {//未找到就退出循环完成搜索
|
||||
break;
|
||||
}
|
||||
results.push(pos);//找到就存储索引
|
||||
pos += 1;//并从下个位置开始搜索
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
//调整元素位置。将dragIndex的元素放到hoverIndex的前面,其余顺移。在拖拽排序中用到。
|
||||
static insertSort(arr: any, dragIndex: any, hoverIndex: any) {
|
||||
|
||||
|
||||
if (!(arr instanceof Array)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex < 0 || dragIndex >= arr.length) {
|
||||
console.error("dragIndex = " + dragIndex + " index越界 length = " + arr.length)
|
||||
return
|
||||
}
|
||||
|
||||
if (hoverIndex < 0 || hoverIndex >= arr.length) {
|
||||
console.error("hoverIndex = " + hoverIndex + " index越界 length = " + arr.length)
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex === hoverIndex) {
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex > hoverIndex) {
|
||||
|
||||
let temp = arr[dragIndex]
|
||||
|
||||
for (let i = dragIndex; i >= hoverIndex + 1; i--) {
|
||||
arr[i] = arr[i - 1]
|
||||
}
|
||||
arr[hoverIndex] = temp
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
let temp = arr[dragIndex]
|
||||
|
||||
for (let i = dragIndex; i <= hoverIndex - 1; i++) {
|
||||
arr[i] = arr[i + 1]
|
||||
}
|
||||
arr[hoverIndex] = temp
|
||||
}
|
||||
return newArray
|
||||
|
||||
}
|
||||
|
||||
//不重复添加
|
||||
static uniqueAdd(srcArray: any, childArray: any) {
|
||||
if (!srcArray) {
|
||||
srcArray = []
|
||||
}
|
||||
|
||||
}
|
||||
if (!childArray || childArray.length === 0) {
|
||||
return srcArray;
|
||||
}
|
||||
|
||||
//数组去重
|
||||
static unique(arr: string[]) {
|
||||
let newArr: string[] = [];
|
||||
for (let i = 0, item; item = arr[i++];) {
|
||||
if (newArr.indexOf(item) === -1) {
|
||||
newArr.push(item);
|
||||
}
|
||||
|
||||
for (let i = 0; i < childArray.length; i++) {
|
||||
|
||||
//在childArray的那些元素就不要了。
|
||||
if (srcArray.indexOf(childArray[i]) === -1) {
|
||||
srcArray.push(childArray[i])
|
||||
}
|
||||
|
||||
}
|
||||
return srcArray
|
||||
}
|
||||
return newArr;
|
||||
};
|
||||
|
||||
//不重复添加
|
||||
static uniqueAddOne(srcArray: any[], child: any) {
|
||||
if (!srcArray) {
|
||||
srcArray = []
|
||||
}
|
||||
|
||||
if (child === undefined || child === null) {
|
||||
return srcArray;
|
||||
}
|
||||
|
||||
//在childArray的那些元素就不要了。
|
||||
if (srcArray.indexOf(child) === -1) {
|
||||
srcArray.push(child)
|
||||
}
|
||||
|
||||
return srcArray
|
||||
}
|
||||
|
||||
//数组中查找特定元素并返回所有该元素的索引
|
||||
static findAll(a: any, x: any) {
|
||||
let results: number[] = [],
|
||||
len = a.length,
|
||||
pos: number = 0;
|
||||
while (pos < len) {
|
||||
pos = a.indexOf(x, pos);
|
||||
if (pos === -1) {//未找到就退出循环完成搜索
|
||||
break;
|
||||
}
|
||||
results.push(pos);//找到就存储索引
|
||||
pos += 1;//并从下个位置开始搜索
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
//调整元素位置。将dragIndex的元素放到hoverIndex的前面,其余顺移。在拖拽排序中用到。
|
||||
static insertSort(arr: any, dragIndex: any, hoverIndex: any) {
|
||||
|
||||
|
||||
if (!(arr instanceof Array)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex < 0 || dragIndex >= arr.length) {
|
||||
console.error("dragIndex = " + dragIndex + " index越界 length = " + arr.length)
|
||||
return
|
||||
}
|
||||
|
||||
if (hoverIndex < 0 || hoverIndex >= arr.length) {
|
||||
console.error("hoverIndex = " + hoverIndex + " index越界 length = " + arr.length)
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex === hoverIndex) {
|
||||
return
|
||||
}
|
||||
|
||||
if (dragIndex > hoverIndex) {
|
||||
|
||||
let temp = arr[dragIndex]
|
||||
|
||||
for (let i = dragIndex; i >= hoverIndex + 1; i--) {
|
||||
arr[i] = arr[i - 1]
|
||||
}
|
||||
arr[hoverIndex] = temp
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
let temp = arr[dragIndex]
|
||||
|
||||
for (let i = dragIndex; i <= hoverIndex - 1; i++) {
|
||||
arr[i] = arr[i + 1]
|
||||
}
|
||||
arr[hoverIndex] = temp
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//数组去重
|
||||
static unique(arr: string[]) {
|
||||
let newArr: string[] = [];
|
||||
for (let i = 0, item; item = arr[i++];) {
|
||||
if (newArr.indexOf(item) === -1) {
|
||||
newArr.push(item);
|
||||
}
|
||||
}
|
||||
return newArr;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,128 +1,128 @@
|
||||
export default class BrowserUtil {
|
||||
|
||||
//根据cookie键,读取cookie值
|
||||
static readCookie(name: any) {
|
||||
let nameEQ = name + "=";
|
||||
let ca = document.cookie.split(';');
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 获取url地址栏的参数
|
||||
* // query string: ?foo=lorem&bar=&baz
|
||||
* var foo = getQueryByName('foo'); // "lorem"
|
||||
* var bar = getQueryByName('bar'); // "" (present with empty value)
|
||||
* var baz = getQueryByName('baz'); // "" (present with no value)
|
||||
* var qux = getQueryByName('qux'); // null (absent)
|
||||
* @param name
|
||||
* @param url
|
||||
* @returns {*}
|
||||
*/
|
||||
static getQueryByName(name: string, url?: string): string | null {
|
||||
|
||||
if (!url) {
|
||||
url = window.location.href
|
||||
//根据cookie键,读取cookie值
|
||||
static readCookie(name: any) {
|
||||
let nameEQ = name + "=";
|
||||
let ca = document.cookie.split(';');
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
|
||||
let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)")
|
||||
let results = regex.exec(url);
|
||||
/**
|
||||
*
|
||||
* 获取url地址栏的参数
|
||||
* // query string: ?foo=lorem&bar=&baz
|
||||
* var foo = getQueryByName('foo'); // "lorem"
|
||||
* var bar = getQueryByName('bar'); // "" (present with empty value)
|
||||
* var baz = getQueryByName('baz'); // "" (present with no value)
|
||||
* var qux = getQueryByName('qux'); // null (absent)
|
||||
* @param name
|
||||
* @param url
|
||||
* @returns {*}
|
||||
*/
|
||||
static getQueryByName(name: string, url?: string): string | null {
|
||||
|
||||
if (!results) {
|
||||
return null;
|
||||
if (!url) {
|
||||
url = window.location.href
|
||||
}
|
||||
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
|
||||
let regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)")
|
||||
let results = regex.exec(url);
|
||||
|
||||
if (!results) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!results[2]) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
if (!results[2]) {
|
||||
return "";
|
||||
|
||||
/**
|
||||
* 半颜的方法。注释待补充
|
||||
* @param name
|
||||
* @returns {*}
|
||||
*/
|
||||
static getQueryString(name: any) {
|
||||
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null;
|
||||
}
|
||||
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 半颜的方法。注释待补充
|
||||
* @param name
|
||||
* @returns {*}
|
||||
*/
|
||||
static getQueryString(name: any) {
|
||||
let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
static isLocalStorageNameSupported() {
|
||||
let testKey = 'test';
|
||||
let storage = window.localStorage;
|
||||
try {
|
||||
storage.setItem(testKey, '1');
|
||||
storage.removeItem(testKey);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
static isLocalStorageNameSupported() {
|
||||
let testKey = 'test';
|
||||
let storage = window.localStorage;
|
||||
try {
|
||||
storage.setItem(testKey, '1');
|
||||
storage.removeItem(testKey);
|
||||
return true;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static readLocalStorage(key: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
return window.localStorage[key];
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
return null;
|
||||
static readLocalStorage(key: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
return window.localStorage[key];
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static saveToLocalStorage(key: any, content: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
window.localStorage[key] = content;
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
static saveToLocalStorage(key: any, content: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
window.localStorage[key] = content;
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static removeLocalStorage(key: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
window.localStorage.removeItem(key);
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
static removeLocalStorage(key: any) {
|
||||
if (BrowserUtil.isLocalStorageNameSupported()) {
|
||||
window.localStorage.removeItem(key);
|
||||
} else {
|
||||
console.error("not support localStorage.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取完整的host
|
||||
* eg:
|
||||
* https://tanker.eyeblue.cn
|
||||
*/
|
||||
static fullHost() {
|
||||
return window.location.protocol + "//" + window.location.host
|
||||
}
|
||||
/**
|
||||
* 获取完整的host
|
||||
* eg:
|
||||
* https://tanker.eyeblue.cn
|
||||
*/
|
||||
static fullHost() {
|
||||
return window.location.protocol + "//" + window.location.host
|
||||
}
|
||||
|
||||
|
||||
//只支持zh和en
|
||||
static browserLang() {
|
||||
//常规浏览器语言和IE浏览器
|
||||
let lang = navigator.language || (navigator as any).userLanguage;
|
||||
//只支持zh和en
|
||||
static browserLang() {
|
||||
//常规浏览器语言和IE浏览器
|
||||
let lang = navigator.language || (navigator as any).userLanguage;
|
||||
|
||||
//截取lang前2位字符
|
||||
lang = lang.substr(0, 2);
|
||||
if (lang === "zh") {
|
||||
return "zh"
|
||||
} else {
|
||||
return "en"
|
||||
//截取lang前2位字符
|
||||
lang = lang.substr(0, 2);
|
||||
if (lang === "zh") {
|
||||
return "zh"
|
||||
} else {
|
||||
return "en"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,37 +3,37 @@ import SafeUtil from "./SafeUtil";
|
||||
export default class ClipboardUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 复制一段文字到粘贴板。
|
||||
*
|
||||
*/
|
||||
static copy(text: string, successCallback: () => void, errorCallback?: () => void) {
|
||||
/**
|
||||
* 复制一段文字到粘贴板。
|
||||
*
|
||||
*/
|
||||
static copy(text: string, successCallback: () => void, errorCallback?: () => void) {
|
||||
|
||||
let className = "clipboard-textarea-util"
|
||||
let className = "clipboard-textarea-util"
|
||||
|
||||
let textAreaElement: HTMLTextAreaElement | null = document.querySelector("." + className);
|
||||
let textAreaElement: HTMLTextAreaElement | null = document.querySelector("." + className);
|
||||
|
||||
if (!textAreaElement) {
|
||||
textAreaElement = document.createElement("textarea")
|
||||
textAreaElement.className = className
|
||||
textAreaElement.style.cssText = "position:fixed;opacity:0;z-index:0;width:5px;height:5px;"
|
||||
document.body.appendChild(textAreaElement)
|
||||
if (!textAreaElement) {
|
||||
textAreaElement = document.createElement("textarea")
|
||||
textAreaElement.className = className
|
||||
textAreaElement.style.cssText = "position:fixed;opacity:0;z-index:0;width:5px;height:5px;"
|
||||
document.body.appendChild(textAreaElement)
|
||||
}
|
||||
|
||||
textAreaElement.value = text
|
||||
textAreaElement.select();
|
||||
|
||||
try {
|
||||
let successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
successCallback()
|
||||
} else {
|
||||
SafeUtil.safeCallback(errorCallback)()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('复制失败', err);
|
||||
SafeUtil.safeCallback(errorCallback)()
|
||||
}
|
||||
}
|
||||
|
||||
textAreaElement.value = text
|
||||
textAreaElement.select();
|
||||
|
||||
try {
|
||||
let successful = document.execCommand('copy');
|
||||
if (successful) {
|
||||
successCallback()
|
||||
} else {
|
||||
SafeUtil.safeCallback(errorCallback)()
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('复制失败', err);
|
||||
SafeUtil.safeCallback(errorCallback)()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,93 +2,94 @@ import moment from "moment"
|
||||
|
||||
export default class DateUtil {
|
||||
|
||||
static DEFAULT_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
||||
static DEFAULT_HOUR_MINUTE = "YYYY-MM-DD HH:mm";
|
||||
static SLASH_DATE_FORMAT = "YYYY/MM/DD";
|
||||
static TIME_FORMAT = "HH:mm:ss";
|
||||
static DATE_FORMAT = "YYYY-MM-DD";
|
||||
//紧凑型的时间格式
|
||||
static COMPACT_DATE_FORMAT = "YYYYMMDD";
|
||||
static DEFAULT_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
||||
static DEFAULT_HOUR_MINUTE = "YYYY-MM-DD HH:mm";
|
||||
static SLASH_DATE_FORMAT = "YYYY/MM/DD";
|
||||
static TIME_FORMAT = "HH:mm:ss";
|
||||
static DATE_FORMAT = "YYYY-MM-DD";
|
||||
//紧凑型的时间格式
|
||||
static COMPACT_DATE_FORMAT = "YYYYMMDD";
|
||||
|
||||
static simpleDateHourMinute(date: Date |null): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DEFAULT_HOUR_MINUTE)
|
||||
}
|
||||
}
|
||||
static simpleDateTime(date: Date | null): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DEFAULT_FORMAT)
|
||||
}
|
||||
}
|
||||
|
||||
static simpleDate(date: Date | null): string {
|
||||
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DATE_FORMAT)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 某个日期的前一天
|
||||
*/
|
||||
static lastDay(date: Date | null, format?: string): string {
|
||||
|
||||
if (format === undefined) {
|
||||
format = DateUtil.DEFAULT_FORMAT
|
||||
static simpleDateHourMinute(date: Date | null): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DEFAULT_HOUR_MINUTE)
|
||||
}
|
||||
}
|
||||
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).add(-1, 'days').format(format)
|
||||
static simpleDateTime(date: Date | null): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DEFAULT_FORMAT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static simpleDate(date: Date | null): string {
|
||||
|
||||
/**
|
||||
* 按照指定格式进行格式化
|
||||
*/
|
||||
static format(date: Date | null, formatString: string): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(formatString)
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(DateUtil.DATE_FORMAT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 某个日期的前一天
|
||||
*/
|
||||
static lastDay(date: Date | null, format?: string): string {
|
||||
|
||||
/**
|
||||
* 将字符串,按照指定的格式反序列化成为时间对象
|
||||
* @param str
|
||||
*/
|
||||
static parse(str: string): Date | null {
|
||||
if (format === undefined) {
|
||||
format = DateUtil.DEFAULT_FORMAT
|
||||
}
|
||||
|
||||
let valid = moment(str).isValid();
|
||||
if (valid) {
|
||||
return moment(str).toDate()
|
||||
} else {
|
||||
return null
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).add(-1, 'days').format(format)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//将时间字符串转化成js date
|
||||
//deprecated,使用 parse方法替代。
|
||||
static str2Date(str: any): Date {
|
||||
|
||||
let valid = moment(str).isValid();
|
||||
if (valid) {
|
||||
return moment(str).toDate()
|
||||
} else {
|
||||
//console.warn("不能转换成时间对象:", str)
|
||||
return new Date()
|
||||
/**
|
||||
* 按照指定格式进行格式化
|
||||
*/
|
||||
static format(date: Date | null, formatString: string): string {
|
||||
if (date == null) {
|
||||
return ""
|
||||
} else {
|
||||
return moment(date).format(formatString)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将字符串,按照指定的格式反序列化成为时间对象
|
||||
* @param str
|
||||
*/
|
||||
static parse(str: string): Date | null {
|
||||
|
||||
let valid = moment(str).isValid();
|
||||
if (valid) {
|
||||
return moment(str).toDate()
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//将时间字符串转化成js date
|
||||
//deprecated,使用 parse方法替代。
|
||||
static str2Date(str: any): Date {
|
||||
|
||||
let valid = moment(str).isValid();
|
||||
if (valid) {
|
||||
return moment(str).toDate()
|
||||
} else {
|
||||
//console.warn("不能转换成时间对象:", str)
|
||||
return new Date()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
export default class DomUtil {
|
||||
|
||||
static addEvent(el: Node, event: string, handler: (evt: Event) => void): void {
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener(event, handler, true);
|
||||
} else {
|
||||
console.error("不支持事件监听!", el)
|
||||
static addEvent(el: Node, event: string, handler: (evt: Event) => void): void {
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener(event, handler, true);
|
||||
} else {
|
||||
console.error("不支持事件监听!", el)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static removeEvent(el: Node, event: string, handler: (evt: Event) => void): void {
|
||||
static removeEvent(el: Node, event: string, handler: (evt: Event) => void): void {
|
||||
|
||||
if (el.removeEventListener) {
|
||||
el.removeEventListener(event, handler, true);
|
||||
} else {
|
||||
console.error("不支持事件监听!", el)
|
||||
if (el.removeEventListener) {
|
||||
el.removeEventListener(event, handler, true);
|
||||
} else {
|
||||
console.error("不支持事件监听!", el)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export default class EnvUtil {
|
||||
static currentHost() {
|
||||
return window.location.protocol + "//" + window.location.host;
|
||||
return window.location.protocol + "//" + window.location.host;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,149 +16,149 @@ import videoSvg from "../../assets/image/file/video.svg";
|
||||
import xlsSvg from "../../assets/image/file/xls.svg";
|
||||
|
||||
export default class FileUtil {
|
||||
static isImage(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "image");
|
||||
}
|
||||
|
||||
static isPdf(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "application/pdf");
|
||||
}
|
||||
|
||||
static isText(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "text");
|
||||
}
|
||||
|
||||
static isDoc(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/msword") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static isPpt(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/vnd.ms-powerpoint") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static isXls(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/vnd.ms-excel") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static isAudio(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "audio");
|
||||
}
|
||||
|
||||
static isVideo(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "video");
|
||||
}
|
||||
|
||||
static isPsd(name: string | null): boolean {
|
||||
let extension = MimeUtil.getExtension(name);
|
||||
return extension === ".psd";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名字获取对应的图标。imageIcon传值了,那么图片格式采用imageIcon
|
||||
* @param name
|
||||
* @param idDir
|
||||
*/
|
||||
static getIcon(name: string | null, idDir: boolean = false): any {
|
||||
if (idDir) {
|
||||
return folderSvg;
|
||||
static isImage(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "image");
|
||||
}
|
||||
|
||||
if (FileUtil.isPdf(name)) {
|
||||
return pdfSvg;
|
||||
} else if (FileUtil.isDoc(name)) {
|
||||
return docSvg;
|
||||
} else if (FileUtil.isPpt(name)) {
|
||||
return pptSvg;
|
||||
} else if (FileUtil.isXls(name)) {
|
||||
return xlsSvg;
|
||||
} else if (FileUtil.isAudio(name)) {
|
||||
return audioSvg;
|
||||
} else if (
|
||||
FileUtil.isVideo(name) ||
|
||||
MimeUtil.getExtension(name) === ".mkv"
|
||||
) {
|
||||
return videoSvg;
|
||||
} else if (FileUtil.isText(name)) {
|
||||
return textSvg;
|
||||
} else if (FileUtil.isPsd(name)) {
|
||||
return psdSvg;
|
||||
} else if (FileUtil.isImage(name)) {
|
||||
return imageSvg;
|
||||
} else if (
|
||||
StringUtil.endWith(name, "zip") ||
|
||||
StringUtil.endWith(name, "rar") ||
|
||||
StringUtil.endWith(name, "7z") ||
|
||||
StringUtil.endWith(name, "tar") ||
|
||||
StringUtil.endWith(name, "tar") ||
|
||||
StringUtil.endWith(name, "gz")
|
||||
) {
|
||||
return archiveSvg;
|
||||
} else {
|
||||
return fileSvg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//把一个大小转变成方便读的格式
|
||||
//human readable file size
|
||||
static humanFileSize(bytes: number, si: boolean = false): string {
|
||||
if (bytes == -1) {
|
||||
return Lang.t("preference.noLimit")
|
||||
static isPdf(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "application/pdf");
|
||||
}
|
||||
|
||||
let thresh = si ? 1000 : 1024
|
||||
if (Math.abs(bytes) < thresh) {
|
||||
return bytes + ' B'
|
||||
static isText(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "text");
|
||||
}
|
||||
let units = si
|
||||
? ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
||||
: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
let u = -1
|
||||
do {
|
||||
bytes /= thresh
|
||||
++u
|
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1)
|
||||
return bytes.toFixed(1) + ' ' + units[u]
|
||||
}
|
||||
|
||||
static getErrorLogsToCSVUrl(logs: object) {
|
||||
const _utf = "\uFEFF"; // 为了使文件以utf-8的编码模式,同时也是解决中文乱码的问题
|
||||
if (window.Blob && window.URL && window.URL.createObjectURL) {
|
||||
const csvStr = new CSV(logs, {
|
||||
header: ["filename", "path", "errorMsg"],
|
||||
}).encode();
|
||||
const blob = new Blob([_utf + csvStr], {
|
||||
type: "text/csv",
|
||||
});
|
||||
return window.URL.createObjectURL(blob);
|
||||
static isDoc(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/msword") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
)
|
||||
);
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
static isPpt(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/vnd.ms-powerpoint") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static isXls(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return (
|
||||
StringUtil.startWith(mimeType, "application/vnd.ms-excel") ||
|
||||
StringUtil.startWith(
|
||||
mimeType,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static isAudio(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "audio");
|
||||
}
|
||||
|
||||
static isVideo(name: string | null): boolean {
|
||||
let mimeType = MimeUtil.getMimeType(name);
|
||||
return StringUtil.startWith(mimeType, "video");
|
||||
}
|
||||
|
||||
static isPsd(name: string | null): boolean {
|
||||
let extension = MimeUtil.getExtension(name);
|
||||
return extension === ".psd";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据名字获取对应的图标。imageIcon传值了,那么图片格式采用imageIcon
|
||||
* @param name
|
||||
* @param idDir
|
||||
*/
|
||||
static getIcon(name: string | null, idDir: boolean = false): any {
|
||||
if (idDir) {
|
||||
return folderSvg;
|
||||
}
|
||||
|
||||
if (FileUtil.isPdf(name)) {
|
||||
return pdfSvg;
|
||||
} else if (FileUtil.isDoc(name)) {
|
||||
return docSvg;
|
||||
} else if (FileUtil.isPpt(name)) {
|
||||
return pptSvg;
|
||||
} else if (FileUtil.isXls(name)) {
|
||||
return xlsSvg;
|
||||
} else if (FileUtil.isAudio(name)) {
|
||||
return audioSvg;
|
||||
} else if (
|
||||
FileUtil.isVideo(name) ||
|
||||
MimeUtil.getExtension(name) === ".mkv"
|
||||
) {
|
||||
return videoSvg;
|
||||
} else if (FileUtil.isText(name)) {
|
||||
return textSvg;
|
||||
} else if (FileUtil.isPsd(name)) {
|
||||
return psdSvg;
|
||||
} else if (FileUtil.isImage(name)) {
|
||||
return imageSvg;
|
||||
} else if (
|
||||
StringUtil.endWith(name, "zip") ||
|
||||
StringUtil.endWith(name, "rar") ||
|
||||
StringUtil.endWith(name, "7z") ||
|
||||
StringUtil.endWith(name, "tar") ||
|
||||
StringUtil.endWith(name, "tar") ||
|
||||
StringUtil.endWith(name, "gz")
|
||||
) {
|
||||
return archiveSvg;
|
||||
} else {
|
||||
return fileSvg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//把一个大小转变成方便读的格式
|
||||
//human readable file size
|
||||
static humanFileSize(bytes: number, si: boolean = false): string {
|
||||
if (bytes == -1) {
|
||||
return Lang.t("preference.noLimit")
|
||||
}
|
||||
|
||||
let thresh = si ? 1000 : 1024
|
||||
if (Math.abs(bytes) < thresh) {
|
||||
return bytes + ' B'
|
||||
}
|
||||
let units = si
|
||||
? ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
||||
: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
let u = -1
|
||||
do {
|
||||
bytes /= thresh
|
||||
++u
|
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1)
|
||||
return bytes.toFixed(1) + ' ' + units[u]
|
||||
}
|
||||
|
||||
static getErrorLogsToCSVUrl(logs: object) {
|
||||
const _utf = "\uFEFF"; // 为了使文件以utf-8的编码模式,同时也是解决中文乱码的问题
|
||||
if (window.Blob && window.URL && window.URL.createObjectURL) {
|
||||
const csvStr = new CSV(logs, {
|
||||
header: ["filename", "path", "errorMsg"],
|
||||
}).encode();
|
||||
const blob = new Blob([_utf + csvStr], {
|
||||
type: "text/csv",
|
||||
});
|
||||
return window.URL.createObjectURL(blob);
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
import axios, { AxiosRequestConfig } from "axios";
|
||||
import axios, {AxiosRequestConfig} from "axios";
|
||||
import SafeUtil from "./SafeUtil";
|
||||
|
||||
//http请求全部收口在这个工具类中,可以快速切换http框架。
|
||||
export default class HttpUtil {
|
||||
static httpGet(
|
||||
url: any,
|
||||
params = {},
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
opts?: any
|
||||
) {
|
||||
axios
|
||||
.get(url, {
|
||||
params: params,
|
||||
})
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
static httpGet(
|
||||
url: any,
|
||||
params = {},
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
opts?: any
|
||||
) {
|
||||
axios
|
||||
.get(url, {
|
||||
params: params,
|
||||
})
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
|
||||
static httpPost(
|
||||
url: any,
|
||||
params = {},
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
opts?: any
|
||||
) {
|
||||
return axios
|
||||
.post(url, params, opts)
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
static httpPost(
|
||||
url: any,
|
||||
params = {},
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
opts?: any
|
||||
) {
|
||||
return axios
|
||||
.post(url, params, opts)
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件的请求
|
||||
*/
|
||||
static httpPostFile(
|
||||
url: string,
|
||||
formData: FormData,
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
processCallback?: (progressEvent: any) => void,
|
||||
opts?: any
|
||||
) {
|
||||
const config: AxiosRequestConfig = {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
cancelToken: opts ? opts.cancelToken : "",
|
||||
onUploadProgress: processCallback,
|
||||
};
|
||||
/**
|
||||
* 上传文件的请求
|
||||
*/
|
||||
static httpPostFile(
|
||||
url: string,
|
||||
formData: FormData,
|
||||
successCallback?: any,
|
||||
errorCallback?: any,
|
||||
finallyCallback?: any,
|
||||
processCallback?: (progressEvent: any) => void,
|
||||
opts?: any
|
||||
) {
|
||||
const config: AxiosRequestConfig = {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
cancelToken: opts ? opts.cancelToken : "",
|
||||
onUploadProgress: processCallback,
|
||||
};
|
||||
|
||||
axios
|
||||
.post(url, formData, config)
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
axios
|
||||
.post(url, formData, config)
|
||||
.then(function (response) {
|
||||
SafeUtil.safeCallback(successCallback)(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
SafeUtil.safeCallback(errorCallback)(error);
|
||||
})
|
||||
.finally(function () {
|
||||
SafeUtil.safeCallback(finallyCallback)();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,67 +4,67 @@ import NumberUtil from "./NumberUtil";
|
||||
import MimeUtil from "./MimeUtil";
|
||||
|
||||
export default class ImageUtil {
|
||||
static IMAGE_PLACEHOLDER_10_10 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAEUlEQVR42mP88J8BAzAOZUEAoc4TYb5Mv7IAAAAASUVORK5CYII=";
|
||||
static IMAGE_PLACEHOLDER_20_7 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAQAAACiwqWzAAAAEklEQVR42mP88J+BKMA4IhUCAJ1VDZFobOQaAAAAAElFTkSuQmCC";
|
||||
static IMAGE_PLACEHOLDER_4_3 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAQAAAAe/WZNAAAAEElEQVR42mP88J8BDBgxGABf8QXRk11CBwAAAABJRU5ErkJggg==";
|
||||
static IMAGE_PLACEHOLDER_16_9 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEklEQVR42mP88J8BL2AcVQAGACSgEXHKPyH/AAAAAElFTkSuQmCC";
|
||||
static IMAGE_PLACEHOLDER_2_1 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAQAAAAeXLZtAAAAE0lEQVR42mP88J+BKMA4qpC+CgH2ThNhpeSxLAAAAABJRU5ErkJggg==";
|
||||
static IMAGE_PLACEHOLDER_10_10 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAEUlEQVR42mP88J8BAzAOZUEAoc4TYb5Mv7IAAAAASUVORK5CYII=";
|
||||
static IMAGE_PLACEHOLDER_20_7 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAQAAACiwqWzAAAAEklEQVR42mP88J+BKMA4IhUCAJ1VDZFobOQaAAAAAElFTkSuQmCC";
|
||||
static IMAGE_PLACEHOLDER_4_3 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAQAAAAe/WZNAAAAEElEQVR42mP88J8BDBgxGABf8QXRk11CBwAAAABJRU5ErkJggg==";
|
||||
static IMAGE_PLACEHOLDER_16_9 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEklEQVR42mP88J8BL2AcVQAGACSgEXHKPyH/AAAAAElFTkSuQmCC";
|
||||
static IMAGE_PLACEHOLDER_2_1 =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAQAAAAeXLZtAAAAE0lEQVR42mP88J+BKMA4qpC+CgH2ThNhpeSxLAAAAABJRU5ErkJggg==";
|
||||
|
||||
/**
|
||||
* 统一处理图片url。
|
||||
* @param url 原图片路径
|
||||
* @param origin 是否使用原图,一般在查看图片详情的时候使用
|
||||
* @param width 如果origin=false 裁剪的宽度
|
||||
* @param height 如果origin=false 裁剪的高度
|
||||
* @returns
|
||||
*/
|
||||
static handleImageUrl(
|
||||
url: string | null = null,
|
||||
origin: boolean = false,
|
||||
width: number = 200,
|
||||
height: number = 200
|
||||
) {
|
||||
if (url) {
|
||||
if (origin) {
|
||||
return url;
|
||||
} else {
|
||||
//目前支持这几种格式的处理。 jpg jpeg png tif tiff bmp gif
|
||||
let supportExtensions = [
|
||||
".jpg",
|
||||
".jpeg",
|
||||
".png",
|
||||
".tif",
|
||||
".tiff",
|
||||
".bmp",
|
||||
".gif",
|
||||
];
|
||||
let extension = MimeUtil.getExtension(url);
|
||||
if (supportExtensions.indexOf(extension) === -1) {
|
||||
return url;
|
||||
/**
|
||||
* 统一处理图片url。
|
||||
* @param url 原图片路径
|
||||
* @param origin 是否使用原图,一般在查看图片详情的时候使用
|
||||
* @param width 如果origin=false 裁剪的宽度
|
||||
* @param height 如果origin=false 裁剪的高度
|
||||
* @returns
|
||||
*/
|
||||
static handleImageUrl(
|
||||
url: string | null = null,
|
||||
origin: boolean = false,
|
||||
width: number = 200,
|
||||
height: number = 200
|
||||
) {
|
||||
if (url) {
|
||||
if (origin) {
|
||||
return url;
|
||||
} else {
|
||||
//目前支持这几种格式的处理。 jpg jpeg png tif tiff bmp gif
|
||||
let supportExtensions = [
|
||||
".jpg",
|
||||
".jpeg",
|
||||
".png",
|
||||
".tif",
|
||||
".tiff",
|
||||
".bmp",
|
||||
".gif",
|
||||
];
|
||||
let extension = MimeUtil.getExtension(url);
|
||||
if (supportExtensions.indexOf(extension) === -1) {
|
||||
return url;
|
||||
} else {
|
||||
return url + "?ir=fill_" + width + "_" + height;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return url + "?ir=fill_" + width + "_" + height;
|
||||
if (NumberUtil.fractionEqual(1, 1, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_10_10;
|
||||
} else if (NumberUtil.fractionEqual(20, 7, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_20_7;
|
||||
} else if (NumberUtil.fractionEqual(4, 3, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_4_3;
|
||||
} else if (NumberUtil.fractionEqual(16, 9, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_16_9;
|
||||
} else if (NumberUtil.fractionEqual(2, 1, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_2_1;
|
||||
} else {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_10_10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (NumberUtil.fractionEqual(1, 1, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_10_10;
|
||||
} else if (NumberUtil.fractionEqual(20, 7, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_20_7;
|
||||
} else if (NumberUtil.fractionEqual(4, 3, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_4_3;
|
||||
} else if (NumberUtil.fractionEqual(16, 9, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_16_9;
|
||||
} else if (NumberUtil.fractionEqual(2, 1, width, height)) {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_2_1;
|
||||
} else {
|
||||
return ImageUtil.IMAGE_PLACEHOLDER_10_10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
export default class JsonUtil {
|
||||
|
||||
|
||||
//将一个json字符串转换成 json 数组
|
||||
static parseList(str: any) {
|
||||
if (!str) {
|
||||
return []
|
||||
}
|
||||
if (str instanceof Array) {
|
||||
return str;
|
||||
}
|
||||
try {
|
||||
let list = JSON.parse(str);
|
||||
if (list instanceof Array) {
|
||||
return list;
|
||||
} else {
|
||||
console.error("不能将" + str + "转换成数组");
|
||||
return [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("不能将" + str + "转换成JSON");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//将一个字符串转成js对象
|
||||
static toObj(str: any) {
|
||||
|
||||
if (!str) {
|
||||
return {}
|
||||
//将一个json字符串转换成 json 数组
|
||||
static parseList(str: any) {
|
||||
if (!str) {
|
||||
return []
|
||||
}
|
||||
if (str instanceof Array) {
|
||||
return str;
|
||||
}
|
||||
try {
|
||||
let list = JSON.parse(str);
|
||||
if (list instanceof Array) {
|
||||
return list;
|
||||
} else {
|
||||
console.error("不能将" + str + "转换成数组");
|
||||
return [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("不能将" + str + "转换成JSON");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(str)
|
||||
} catch (e) {
|
||||
console.error("不能将json字符串" + str + "转换成对象");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
//将一个对象转成json字符串
|
||||
static toJson(obj: any): string {
|
||||
//将一个字符串转成js对象
|
||||
static toObj(str: any) {
|
||||
|
||||
if (!obj) {
|
||||
obj = {}
|
||||
if (!str) {
|
||||
return {}
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(str)
|
||||
} catch (e) {
|
||||
console.error("不能将json字符串" + str + "转换成对象");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify(obj)
|
||||
}
|
||||
//将一个对象转成json字符串
|
||||
static toJson(obj: any): string {
|
||||
|
||||
//将JSON进行格式化。
|
||||
static prettyJson(json: any) {
|
||||
if (!obj) {
|
||||
obj = {}
|
||||
}
|
||||
|
||||
if (typeof json === 'string') {
|
||||
json = JSON.parse(json);
|
||||
return JSON.stringify(obj)
|
||||
}
|
||||
|
||||
return JSON.stringify(json, null, 2)
|
||||
};
|
||||
//将JSON进行格式化。
|
||||
static prettyJson(json: any) {
|
||||
|
||||
if (typeof json === 'string') {
|
||||
json = JSON.parse(json);
|
||||
}
|
||||
|
||||
return JSON.stringify(json, null, 2)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -5,24 +5,24 @@ import {message} from 'antd';
|
||||
*/
|
||||
export default class MessageBoxUtil {
|
||||
|
||||
static success(content: string) {
|
||||
message.success(content)
|
||||
}
|
||||
static success(content: string) {
|
||||
message.success(content)
|
||||
}
|
||||
|
||||
static info(content: string) {
|
||||
message.info(content)
|
||||
}
|
||||
static info(content: string) {
|
||||
message.info(content)
|
||||
}
|
||||
|
||||
static error(content: string) {
|
||||
message.error(content)
|
||||
}
|
||||
static error(content: string) {
|
||||
message.error(content)
|
||||
}
|
||||
|
||||
static warn(content: string) {
|
||||
message.warn(content)
|
||||
}
|
||||
static warn(content: string) {
|
||||
message.warn(content)
|
||||
}
|
||||
|
||||
static warning(content: string) {
|
||||
message.warning(content)
|
||||
}
|
||||
static warning(content: string) {
|
||||
message.warning(content)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
export default class NumberUtil {
|
||||
//求最大公约数
|
||||
static gcd(a: number, b: number): number {
|
||||
return b ? NumberUtil.gcd(b, a % b) : a;
|
||||
}
|
||||
|
||||
//约分 numerator:分子 denominator:分母
|
||||
static reduce(numerator: number, denominator: number) {
|
||||
let maxFactor = NumberUtil.gcd(numerator, denominator);
|
||||
return [numerator / maxFactor, denominator / maxFactor];
|
||||
}
|
||||
|
||||
static isInteger(obj: any) {
|
||||
return typeof obj === "number" && obj % 1 === 0;
|
||||
}
|
||||
|
||||
//转换成整型
|
||||
static parseInt(obj: any): number {
|
||||
try {
|
||||
return parseInt(obj);
|
||||
} catch (e) {
|
||||
console.error("无法转换成整数", obj);
|
||||
return 0;
|
||||
//求最大公约数
|
||||
static gcd(a: number, b: number): number {
|
||||
return b ? NumberUtil.gcd(b, a % b) : a;
|
||||
}
|
||||
}
|
||||
|
||||
//比较两个分数是否相等
|
||||
static fractionEqual(
|
||||
numerator1: number,
|
||||
denominator1: number,
|
||||
numerator2: number,
|
||||
denominator2: number
|
||||
) {
|
||||
let fraction1 = NumberUtil.reduce(numerator1, denominator1);
|
||||
let fraction2 = NumberUtil.reduce(numerator2, denominator2);
|
||||
//约分 numerator:分子 denominator:分母
|
||||
static reduce(numerator: number, denominator: number) {
|
||||
let maxFactor = NumberUtil.gcd(numerator, denominator);
|
||||
return [numerator / maxFactor, denominator / maxFactor];
|
||||
}
|
||||
|
||||
return fraction1[0] === fraction2[0] && fraction1[1] === fraction2[1];
|
||||
}
|
||||
static isInteger(obj: any) {
|
||||
return typeof obj === "number" && obj % 1 === 0;
|
||||
}
|
||||
|
||||
//转换成整型
|
||||
static parseInt(obj: any): number {
|
||||
try {
|
||||
return parseInt(obj);
|
||||
} catch (e) {
|
||||
console.error("无法转换成整数", obj);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//比较两个分数是否相等
|
||||
static fractionEqual(
|
||||
numerator1: number,
|
||||
denominator1: number,
|
||||
numerator2: number,
|
||||
denominator2: number
|
||||
) {
|
||||
let fraction1 = NumberUtil.reduce(numerator1, denominator1);
|
||||
let fraction2 = NumberUtil.reduce(numerator2, denominator2);
|
||||
|
||||
return fraction1[0] === fraction2[0] && fraction1[1] === fraction2[1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,113 +2,113 @@ import DateUtil from "./DateUtil";
|
||||
import JsonUtil from "./JsonUtil";
|
||||
|
||||
export default class ObjectUtil {
|
||||
//将 extraObj 中的属性全部赋值给standardObj
|
||||
static extend(standardObj: any, extraObj: any) {
|
||||
for (let key in extraObj) {
|
||||
if (extraObj.hasOwnProperty(key)) {
|
||||
if (standardObj.hasOwnProperty(key)) {
|
||||
standardObj[key] = extraObj[key];
|
||||
//将 extraObj 中的属性全部赋值给standardObj
|
||||
static extend(standardObj: any, extraObj: any) {
|
||||
for (let key in extraObj) {
|
||||
if (extraObj.hasOwnProperty(key)) {
|
||||
if (standardObj.hasOwnProperty(key)) {
|
||||
standardObj[key] = extraObj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 深拷贝,保留standardObj第一层全部属性
|
||||
static deepExtend(standardObj: any, extraObj: any, checkKey: boolean = true) {
|
||||
for (let key in extraObj) {
|
||||
if (checkKey) {
|
||||
if (standardObj.hasOwnProperty(key)) {
|
||||
standardObj[key] =
|
||||
extraObj[key] instanceof Object
|
||||
? ObjectUtil.deepExtend({}, extraObj[key], false)
|
||||
: extraObj[key];
|
||||
// 深拷贝,保留standardObj第一层全部属性
|
||||
static deepExtend(standardObj: any, extraObj: any, checkKey: boolean = true) {
|
||||
for (let key in extraObj) {
|
||||
if (checkKey) {
|
||||
if (standardObj.hasOwnProperty(key)) {
|
||||
standardObj[key] =
|
||||
extraObj[key] instanceof Object
|
||||
? ObjectUtil.deepExtend({}, extraObj[key], false)
|
||||
: extraObj[key];
|
||||
}
|
||||
} else {
|
||||
standardObj[key] =
|
||||
extraObj[key] instanceof Object
|
||||
? ObjectUtil.deepExtend({}, extraObj[key], false)
|
||||
: extraObj[key];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
standardObj[key] =
|
||||
extraObj[key] instanceof Object
|
||||
? ObjectUtil.deepExtend({}, extraObj[key], false)
|
||||
: extraObj[key];
|
||||
}
|
||||
return standardObj;
|
||||
}
|
||||
return standardObj;
|
||||
}
|
||||
|
||||
//将standardObj的field属性规整成时间格式。
|
||||
static assignDate(standardObj: any, field: any) {
|
||||
if (standardObj.hasOwnProperty(field)) {
|
||||
standardObj[field] = DateUtil.str2Date(standardObj[field]);
|
||||
//将standardObj的field属性规整成时间格式。
|
||||
static assignDate(standardObj: any, field: any) {
|
||||
if (standardObj.hasOwnProperty(field)) {
|
||||
standardObj[field] = DateUtil.str2Date(standardObj[field]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//吧standardObj的field属性归整成Clazz类型
|
||||
static assignList(standardObj: any, field: any, Clazz: any) {
|
||||
if (standardObj.hasOwnProperty(field)) {
|
||||
//如果我们要转换成字符串的数组形式,那么this[field]应该是一个字符串才对。
|
||||
if (Clazz === String) {
|
||||
standardObj[field] = JsonUtil.parseList(standardObj[field]);
|
||||
//吧standardObj的field属性归整成Clazz类型
|
||||
static assignList(standardObj: any, field: any, Clazz: any) {
|
||||
if (standardObj.hasOwnProperty(field)) {
|
||||
//如果我们要转换成字符串的数组形式,那么this[field]应该是一个字符串才对。
|
||||
if (Clazz === String) {
|
||||
standardObj[field] = JsonUtil.parseList(standardObj[field]);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//下面就是转换实体数组了。
|
||||
let beans = standardObj[field];
|
||||
if (!beans) {
|
||||
//服务器返回这个字段为空 维持构造函数中的默认值(一般而言是一个[])
|
||||
standardObj[field] = new standardObj.constructor()[field];
|
||||
return;
|
||||
}
|
||||
//下面就是转换实体数组了。
|
||||
let beans = standardObj[field];
|
||||
if (!beans) {
|
||||
//服务器返回这个字段为空 维持构造函数中的默认值(一般而言是一个[])
|
||||
standardObj[field] = new standardObj.constructor()[field];
|
||||
return;
|
||||
}
|
||||
|
||||
standardObj[field] = [];
|
||||
standardObj[field] = [];
|
||||
|
||||
if (!Clazz) {
|
||||
return;
|
||||
}
|
||||
if (!Clazz) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < beans.length; i++) {
|
||||
let bean = beans[i];
|
||||
let clazz = new Clazz();
|
||||
for (let i = 0; i < beans.length; i++) {
|
||||
let bean = beans[i];
|
||||
let clazz = new Clazz();
|
||||
|
||||
if (clazz.assign) {
|
||||
clazz.assign(bean);
|
||||
} else {
|
||||
console.error(clazz);
|
||||
console.error("没有定义assign方法");
|
||||
if (clazz.assign) {
|
||||
clazz.assign(bean);
|
||||
} else {
|
||||
console.error(clazz);
|
||||
console.error("没有定义assign方法");
|
||||
}
|
||||
|
||||
standardObj[field].push(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check whether an obj is empty
|
||||
static isEmptyObject(obj: object) {
|
||||
if (typeof obj !== "object") {
|
||||
console.error("判定的不是obj对象");
|
||||
return true;
|
||||
}
|
||||
|
||||
standardObj[field].push(clazz);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//check whether an obj is empty
|
||||
static isEmptyObject(obj: object) {
|
||||
if (typeof obj !== "object") {
|
||||
console.error("判定的不是obj对象");
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
/**
|
||||
* 将键值对转换成 age=18&name=xxx 的形式
|
||||
*/
|
||||
static param(map: any) {
|
||||
let arr: string[] = [];
|
||||
for (let key in map) {
|
||||
if (map.hasOwnProperty(key)) {
|
||||
let value = map[key];
|
||||
arr[arr.length] =
|
||||
encodeURIComponent(key) +
|
||||
"=" +
|
||||
encodeURIComponent(value == null ? "" : value);
|
||||
}
|
||||
}
|
||||
|
||||
return arr.join("&");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将键值对转换成 age=18&name=xxx 的形式
|
||||
*/
|
||||
static param(map: any) {
|
||||
let arr: string[] = [];
|
||||
for (let key in map) {
|
||||
if (map.hasOwnProperty(key)) {
|
||||
let value = map[key];
|
||||
arr[arr.length] =
|
||||
encodeURIComponent(key) +
|
||||
"=" +
|
||||
encodeURIComponent(value == null ? "" : value);
|
||||
}
|
||||
}
|
||||
|
||||
return arr.join("&");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
export default class SafeUtil {
|
||||
|
||||
//安全的调用某个函数,函数不存在,创建一个空函数。
|
||||
static safeCallback(callback: any) {
|
||||
if (typeof callback === "function") {
|
||||
return callback
|
||||
} else {
|
||||
return SafeUtil.noop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//空函数
|
||||
static noop = () => {
|
||||
};
|
||||
|
||||
|
||||
//停止事件冒泡
|
||||
static stopPropagation(e: any) {
|
||||
if (!e) {
|
||||
return
|
||||
//安全的调用某个函数,函数不存在,创建一个空函数。
|
||||
static safeCallback(callback: any) {
|
||||
if (typeof callback === "function") {
|
||||
return callback
|
||||
} else {
|
||||
return SafeUtil.noop
|
||||
}
|
||||
}
|
||||
|
||||
if (e.stopPropagation) {
|
||||
//系统的点击事件
|
||||
e.stopPropagation()
|
||||
} else if (e.domEvent && e.domEvent.stopPropagation) {
|
||||
//antd的事件
|
||||
e.domEvent.stopPropagation()
|
||||
|
||||
}
|
||||
}
|
||||
//空函数
|
||||
static noop = () => {
|
||||
};
|
||||
|
||||
// 停止事件冒泡包装函数
|
||||
static stopPropagationWrap(e: any) {
|
||||
SafeUtil.stopPropagation(e);
|
||||
return (func?: any) => {
|
||||
SafeUtil.safeCallback(func);
|
||||
|
||||
//停止事件冒泡
|
||||
static stopPropagation(e: any) {
|
||||
if (!e) {
|
||||
return
|
||||
}
|
||||
|
||||
if (e.stopPropagation) {
|
||||
//系统的点击事件
|
||||
e.stopPropagation()
|
||||
} else if (e.domEvent && e.domEvent.stopPropagation) {
|
||||
//antd的事件
|
||||
e.domEvent.stopPropagation()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 停止事件冒泡包装函数
|
||||
static stopPropagationWrap(e: any) {
|
||||
SafeUtil.stopPropagation(e);
|
||||
return (func?: any) => {
|
||||
SafeUtil.safeCallback(func);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,275 +1,275 @@
|
||||
export default class StringUtil {
|
||||
|
||||
//大写字母
|
||||
static UPPER_CASES = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
//大写字母
|
||||
static UPPER_CASES = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
//下划线转驼峰
|
||||
static underScoreToCamel(str: string) {
|
||||
//下划线转驼峰
|
||||
static underScoreToCamel(str: string) {
|
||||
|
||||
if (!str) {
|
||||
console.error('不能转换空的驼峰字符串。')
|
||||
return str
|
||||
if (!str) {
|
||||
console.error('不能转换空的驼峰字符串。')
|
||||
return str
|
||||
}
|
||||
|
||||
const regex = /_[a-z]/gm;
|
||||
|
||||
return str.replace(regex, function (letter: any, index: any) {
|
||||
return letter.substr(1).toUpperCase()
|
||||
})
|
||||
}
|
||||
|
||||
const regex = /_[a-z]/gm;
|
||||
//转换成首字母小写的驼峰法
|
||||
static lowerCamel(str: any) {
|
||||
|
||||
return str.replace(regex, function (letter: any, index: any) {
|
||||
return letter.substr(1).toUpperCase()
|
||||
})
|
||||
}
|
||||
if (!str) {
|
||||
console.error('不能转换空的驼峰字符串。')
|
||||
return str
|
||||
}
|
||||
|
||||
//转换成首字母小写的驼峰法
|
||||
static lowerCamel(str: any) {
|
||||
|
||||
if (!str) {
|
||||
console.error('不能转换空的驼峰字符串。')
|
||||
return str
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter: any, index: any) {
|
||||
return index === 0 ? letter.toLowerCase() : letter.toUpperCase()
|
||||
}).replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter: any, index: any) {
|
||||
return index === 0 ? letter.toLowerCase() : letter.toUpperCase()
|
||||
}).replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
|
||||
//转换成全部小写的使用 /分隔的字符串
|
||||
static lowerSlash(str: any) {
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter: any, index: any) {
|
||||
return '/' + letter.toLowerCase()
|
||||
}).replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
//一个字符串包含子字符串
|
||||
static containStr(father: string | null, child: string): boolean {
|
||||
|
||||
if (father === null || father === '') {
|
||||
return false
|
||||
}
|
||||
return father.indexOf(child) !== -1
|
||||
}
|
||||
|
||||
//把一个大小转变成方便读的格式
|
||||
//human readable file size
|
||||
static humanFileSize(bytes: number, si:boolean = false) {
|
||||
let thresh = si ? 1000 : 1024
|
||||
if (Math.abs(bytes) < thresh) {
|
||||
return bytes + ' B'
|
||||
}
|
||||
let units = si
|
||||
? ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
||||
: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
let u = -1
|
||||
do {
|
||||
bytes /= thresh
|
||||
++u
|
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1)
|
||||
return bytes.toFixed(1) + ' ' + units[u]
|
||||
}
|
||||
|
||||
//将首字母大写
|
||||
static capitalize(str: any) {
|
||||
|
||||
if (!str) {
|
||||
return str;
|
||||
//转换成全部小写的使用 /分隔的字符串
|
||||
static lowerSlash(str: any) {
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter: any, index: any) {
|
||||
return '/' + letter.toLowerCase()
|
||||
}).replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
str = str.replace(/^\w/, (c: any) => c.toUpperCase());
|
||||
//一个字符串包含子字符串
|
||||
static containStr(father: string | null, child: string): boolean {
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
//将首字母小写
|
||||
static lower(str: any) {
|
||||
|
||||
if (!str) {
|
||||
return str;
|
||||
if (father === null || father === '') {
|
||||
return false
|
||||
}
|
||||
return father.indexOf(child) !== -1
|
||||
}
|
||||
|
||||
str = str.replace(/^\w/, (c: any) => c.toLowerCase());
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
//获取一个function的名字
|
||||
static functionName(func: any) {
|
||||
// Match:
|
||||
// - ^ the beginning of the string
|
||||
// - function the word 'function'
|
||||
// - \s+ at least some white space
|
||||
// - ([\w\$]+) capture one or more valid JavaScript identifier characters
|
||||
// - \s* optionally followed by white space (in theory there won't be any here,
|
||||
// so if performance is an issue this can be omitted[1]
|
||||
// - \( followed by an opening brace
|
||||
//
|
||||
let result = /^function\s+([\w\$]+)\s*\(/.exec(func.toString())
|
||||
|
||||
return result ? result[1] : '' // for an anonymous function there won't be a match
|
||||
}
|
||||
|
||||
//check whether an obj is empty
|
||||
static isEmptyObject(obj: any) {
|
||||
|
||||
if (!obj) {
|
||||
return true;
|
||||
//把一个大小转变成方便读的格式
|
||||
//human readable file size
|
||||
static humanFileSize(bytes: number, si: boolean = false) {
|
||||
let thresh = si ? 1000 : 1024
|
||||
if (Math.abs(bytes) < thresh) {
|
||||
return bytes + ' B'
|
||||
}
|
||||
let units = si
|
||||
? ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
|
||||
: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
let u = -1
|
||||
do {
|
||||
bytes /= thresh
|
||||
++u
|
||||
} while (Math.abs(bytes) >= thresh && u < units.length - 1)
|
||||
return bytes.toFixed(1) + ' ' + units[u]
|
||||
}
|
||||
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
||||
//将首字母大写
|
||||
static capitalize(str: any) {
|
||||
|
||||
if (!str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取到上num级路径
|
||||
* 例子: /tank/setting/notification -> /tank/setting
|
||||
* @param path 原路径
|
||||
* @param num 上几级,默认1级
|
||||
*/
|
||||
static prePath(path: string, num: number = 1): string {
|
||||
if (!path) {
|
||||
return path
|
||||
}
|
||||
str = str.replace(/^\w/, (c: any) => c.toUpperCase());
|
||||
|
||||
//去除掉最后的/符号。
|
||||
let parts: string[] = path.split("/");
|
||||
//去除所有的空
|
||||
parts = parts.filter((item: string, index: number) => {
|
||||
return item !== ""
|
||||
})
|
||||
|
||||
//前面几层就是删掉前面几个元素。如果超出了,会全部删掉。
|
||||
parts.splice(parts.length - num)
|
||||
|
||||
return "/" + parts.join("/")
|
||||
}
|
||||
|
||||
|
||||
static startWith(str: any, prefix: any) {
|
||||
if (typeof prefix === 'undefined' || prefix === null || prefix === '' || typeof str === 'undefined' || str === null || str.length === 0 || prefix.length > str.length) {
|
||||
return false
|
||||
}
|
||||
|
||||
return str.substr(0, prefix.length) === prefix
|
||||
}
|
||||
|
||||
static endWith(str: any, suffix: any) {
|
||||
if (suffix === null || suffix === '' || str === null || str.length === 0 || suffix.length > str.length) {
|
||||
return false
|
||||
}
|
||||
|
||||
return str.substring(str.length - suffix.length) === suffix
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去除掉开头的前缀
|
||||
* @param str 待处理的字符串
|
||||
* @param prefix 前缀
|
||||
*/
|
||||
static trimPrefix(str: string | null, prefix: string): string {
|
||||
|
||||
if (!str) {
|
||||
return ""
|
||||
} else {
|
||||
if (str.substr(0, prefix.length) === prefix) {
|
||||
return str.substr(prefix.length)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//将首字母小写
|
||||
static lower(str: any) {
|
||||
|
||||
/**
|
||||
* 去除掉后缀
|
||||
* @param str 待处理的字符串
|
||||
* @param suffix 前缀
|
||||
*/
|
||||
static trimSuffix(str: string | null, suffix: string): string {
|
||||
if (!str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
str = str.replace(/^\w/, (c: any) => c.toLowerCase());
|
||||
|
||||
if (!str) {
|
||||
return ""
|
||||
} else {
|
||||
if (str.substring(str.length - suffix.length) === suffix) {
|
||||
return str.substr(0, str.length - suffix.length)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//获取一个function的名字
|
||||
static functionName(func: any) {
|
||||
// Match:
|
||||
// - ^ the beginning of the string
|
||||
// - function the word 'function'
|
||||
// - \s+ at least some white space
|
||||
// - ([\w\$]+) capture one or more valid JavaScript identifier characters
|
||||
// - \s* optionally followed by white space (in theory there won't be any here,
|
||||
// so if performance is an issue this can be omitted[1]
|
||||
// - \( followed by an opening brace
|
||||
//
|
||||
let result = /^function\s+([\w\$]+)\s*\(/.exec(func.toString())
|
||||
|
||||
|
||||
//在字符串a后面追加字符串b
|
||||
static append(a: any, b: any, separator = "") {
|
||||
|
||||
if (a === null || a === "" || typeof a !== "string") {
|
||||
return b;
|
||||
} else {
|
||||
return a + separator + b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static isBlank(text: string | null | undefined): boolean {
|
||||
|
||||
if (text === null || text == undefined) {
|
||||
return true
|
||||
return result ? result[1] : '' // for an anonymous function there won't be a match
|
||||
}
|
||||
|
||||
return text.trim() === "";
|
||||
//check whether an obj is empty
|
||||
static isEmptyObject(obj: any) {
|
||||
|
||||
}
|
||||
if (!obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static isNotBlank(text: string | null | undefined): boolean {
|
||||
|
||||
return !StringUtil.isBlank(text)
|
||||
|
||||
}
|
||||
|
||||
|
||||
//将时间戳转换成62进制
|
||||
static generateUniqueCode(num?: number): string {
|
||||
//获取时间戳
|
||||
|
||||
if (num === undefined) {
|
||||
num = new Date().getTime()
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
let standardString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
let result;
|
||||
let list: number[] = [];
|
||||
let len = standardString.length;
|
||||
let level;
|
||||
for (level = 0; Math.floor(num / len) > 0; level++) {
|
||||
result = num % len;
|
||||
list.push(result)
|
||||
num = (num - result) / len
|
||||
}
|
||||
list.push(num);
|
||||
let code = '';
|
||||
list.forEach((item) => {
|
||||
code = standardString[item] + code;
|
||||
})
|
||||
return code
|
||||
}
|
||||
|
||||
//字符串转换成十进制
|
||||
static parseUniqueCode(str: string): number {
|
||||
/**
|
||||
* 获取到上num级路径
|
||||
* 例子: /tank/setting/notification -> /tank/setting
|
||||
* @param path 原路径
|
||||
* @param num 上几级,默认1级
|
||||
*/
|
||||
static prePath(path: string, num: number = 1): string {
|
||||
if (!path) {
|
||||
return path
|
||||
}
|
||||
|
||||
let exchangeString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
let strNew = str.split("");
|
||||
let list: number[] = [];
|
||||
strNew.map((item: string) => {
|
||||
list.push(exchangeString.indexOf(item));
|
||||
});
|
||||
let num = 0;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
num += list[i] * Math.pow(exchangeString.length, list.length - i - 1);
|
||||
//去除掉最后的/符号。
|
||||
let parts: string[] = path.split("/");
|
||||
//去除所有的空
|
||||
parts = parts.filter((item: string, index: number) => {
|
||||
return item !== ""
|
||||
})
|
||||
|
||||
//前面几层就是删掉前面几个元素。如果超出了,会全部删掉。
|
||||
parts.splice(parts.length - num)
|
||||
|
||||
return "/" + parts.join("/")
|
||||
}
|
||||
|
||||
|
||||
static startWith(str: any, prefix: any) {
|
||||
if (typeof prefix === 'undefined' || prefix === null || prefix === '' || typeof str === 'undefined' || str === null || str.length === 0 || prefix.length > str.length) {
|
||||
return false
|
||||
}
|
||||
|
||||
return str.substr(0, prefix.length) === prefix
|
||||
}
|
||||
|
||||
static endWith(str: any, suffix: any) {
|
||||
if (suffix === null || suffix === '' || str === null || str.length === 0 || suffix.length > str.length) {
|
||||
return false
|
||||
}
|
||||
|
||||
return str.substring(str.length - suffix.length) === suffix
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去除掉开头的前缀
|
||||
* @param str 待处理的字符串
|
||||
* @param prefix 前缀
|
||||
*/
|
||||
static trimPrefix(str: string | null, prefix: string): string {
|
||||
|
||||
if (!str) {
|
||||
return ""
|
||||
} else {
|
||||
if (str.substr(0, prefix.length) === prefix) {
|
||||
return str.substr(prefix.length)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除掉后缀
|
||||
* @param str 待处理的字符串
|
||||
* @param suffix 前缀
|
||||
*/
|
||||
static trimSuffix(str: string | null, suffix: string): string {
|
||||
|
||||
if (!str) {
|
||||
return ""
|
||||
} else {
|
||||
if (str.substring(str.length - suffix.length) === suffix) {
|
||||
return str.substr(0, str.length - suffix.length)
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//在字符串a后面追加字符串b
|
||||
static append(a: any, b: any, separator = "") {
|
||||
|
||||
if (a === null || a === "" || typeof a !== "string") {
|
||||
return b;
|
||||
} else {
|
||||
return a + separator + b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static isBlank(text: string | null | undefined): boolean {
|
||||
|
||||
if (text === null || text == undefined) {
|
||||
return true
|
||||
}
|
||||
|
||||
return text.trim() === "";
|
||||
|
||||
}
|
||||
|
||||
static isNotBlank(text: string | null | undefined): boolean {
|
||||
|
||||
return !StringUtil.isBlank(text)
|
||||
|
||||
}
|
||||
|
||||
|
||||
//将时间戳转换成62进制
|
||||
static generateUniqueCode(num?: number): string {
|
||||
//获取时间戳
|
||||
|
||||
if (num === undefined) {
|
||||
num = new Date().getTime()
|
||||
}
|
||||
|
||||
let standardString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
let result;
|
||||
let list: number[] = [];
|
||||
let len = standardString.length;
|
||||
let level;
|
||||
for (level = 0; Math.floor(num / len) > 0; level++) {
|
||||
result = num % len;
|
||||
list.push(result)
|
||||
num = (num - result) / len
|
||||
}
|
||||
list.push(num);
|
||||
let code = '';
|
||||
list.forEach((item) => {
|
||||
code = standardString[item] + code;
|
||||
})
|
||||
return code
|
||||
}
|
||||
|
||||
//字符串转换成十进制
|
||||
static parseUniqueCode(str: string): number {
|
||||
|
||||
let exchangeString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
let strNew = str.split("");
|
||||
let list: number[] = [];
|
||||
strNew.map((item: string) => {
|
||||
list.push(exchangeString.indexOf(item));
|
||||
});
|
||||
let num = 0;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
num += list[i] * Math.pow(exchangeString.length, list.length - i - 1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.render(
|
||||
<App/>,
|
||||
document.getElementById('root')
|
||||
<App/>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
|
||||
|
||||
@@ -15,10 +15,7 @@
|
||||
height: 100%;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import React from "react";
|
||||
import {
|
||||
Redirect,
|
||||
Route,
|
||||
RouteComponentProps,
|
||||
withRouter,
|
||||
} from "react-router-dom";
|
||||
import {Redirect, Route, RouteComponentProps, withRouter,} from "react-router-dom";
|
||||
|
||||
import "./Frame.less";
|
||||
import TankComponent from "../common/component/TankComponent";
|
||||
@@ -37,159 +32,161 @@ import Moon from "../common/model/global/Moon";
|
||||
import Sun from "../common/model/global/Sun";
|
||||
import FrameLoading from "./widget/FrameLoading";
|
||||
import Preference from "../common/model/preference/Preference";
|
||||
import { WebResultCode } from "../common/model/base/WebResultCode";
|
||||
import {WebResultCode} from "../common/model/base/WebResultCode";
|
||||
import MessageBoxUtil from "../common/util/MessageBoxUtil";
|
||||
import BottomLayout from "./layout/BottomLayout";
|
||||
import SideLayout from "./layout/SideLayout";
|
||||
import TopLayout from "./layout/TopLayout";
|
||||
import ContentLayout from "./layout/ContentLayout";
|
||||
|
||||
interface IProps extends RouteComponentProps<{}> {}
|
||||
interface IProps extends RouteComponentProps<{}> {
|
||||
}
|
||||
|
||||
interface IState {}
|
||||
interface IState {
|
||||
}
|
||||
|
||||
class RawFrame extends TankComponent<IProps, IState> {
|
||||
user: User = Moon.getSingleton().user;
|
||||
user: User = Moon.getSingleton().user;
|
||||
|
||||
preference: Preference = Moon.getSingleton().preference;
|
||||
preference: Preference = Moon.getSingleton().preference;
|
||||
|
||||
//是否已经完成初始化
|
||||
initialized: boolean = false;
|
||||
//是否已经完成初始化
|
||||
initialized: boolean = false;
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
//装载全局的路由
|
||||
Sun.getSingleton().reactRouter = this.props.history;
|
||||
//装在全局Frame
|
||||
Sun.getSingleton().frameComponent = this;
|
||||
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
//获取当前登录者的信息
|
||||
initialize() {
|
||||
let that = this;
|
||||
let pathname: string = that.props.location.pathname;
|
||||
|
||||
this.preference.httpFetch(
|
||||
function () {
|
||||
// 白名单,不要求登录
|
||||
let whitePaths = [
|
||||
"/user/login",
|
||||
"/user/register",
|
||||
"/user/authentication",
|
||||
];
|
||||
// 尝试登录名单,登录失败不做处理
|
||||
let tryLoginPaths = [
|
||||
"/share/detail",
|
||||
];
|
||||
|
||||
if(whitePaths.findIndex((path) => pathname.startsWith(path)) >= 0){
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
} else if(tryLoginPaths.findIndex((path) => pathname.startsWith(path)) >= 0) {
|
||||
that.user.httpInfo(false, function () {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
});
|
||||
} else {
|
||||
that.user.httpInfo(true, function () {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
});
|
||||
}
|
||||
},
|
||||
function (errMessage: string, response: any) {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
if (
|
||||
response &&
|
||||
response.data &&
|
||||
response.data["code"] === WebResultCode.NOT_INSTALLED
|
||||
) {
|
||||
MessageBoxUtil.warning("网站尚未安装,即将引导进入安装页面!");
|
||||
that.preference.installed = false;
|
||||
Sun.navigateTo("/install/index");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
let content: React.ReactNode;
|
||||
|
||||
if (this.initialized) {
|
||||
content = (
|
||||
<div className="pages-frame-inner">
|
||||
<SideLayout />
|
||||
|
||||
<TopLayout />
|
||||
|
||||
<ContentLayout>
|
||||
{this.preference.installed ? (
|
||||
<div className="pages-content">
|
||||
<Route
|
||||
exact
|
||||
path="/"
|
||||
render={() => <Redirect to="/matter/list" />}
|
||||
/>
|
||||
<Route path="/user/login" component={UserLogin} />
|
||||
<Route path="/user/register" component={UserRegister} />
|
||||
<Route path="/user/detail/:uuid" component={UserDetail} />
|
||||
<Route path="/user/list" component={UserList} />
|
||||
<Route path="/mobile/user/list" component={MobileUserList} />
|
||||
<Route path="/user/create" component={UserEdit} />
|
||||
<Route path="/user/edit/:uuid" component={UserEdit} />
|
||||
<Route
|
||||
path="/user/authentication/:authentication"
|
||||
component={UserAuthentication}
|
||||
/>
|
||||
|
||||
<Route path="/dashboard/index" component={DashboardIndex} />
|
||||
|
||||
<Route path="/preference/index" component={PreferenceIndex} />
|
||||
<Route path="/preference/edit" component={PreferenceEdit} />
|
||||
<Route
|
||||
path="/preference/engine/edit"
|
||||
component={PreferenceEngineEdit}
|
||||
/>
|
||||
<Route
|
||||
path="/preference/scan/edit"
|
||||
component={PreferenceScanEdit}
|
||||
/>
|
||||
|
||||
<Route path="/matter/detail/:uuid" component={MatterDetail} />
|
||||
<Route
|
||||
exact
|
||||
path="/matter"
|
||||
render={() => <Redirect to="/matter/list" />}
|
||||
/>
|
||||
<Route path="/matter/list" component={MatterList} />
|
||||
|
||||
<Route path="/share/list" component={ShareList} />
|
||||
<Route path="/share/detail/:uuid" component={ShareDetail} />
|
||||
|
||||
<Route path="/bin/list" component={BinList} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="pages-content">
|
||||
<Route path="/install/index" component={InstallIndex} />
|
||||
</div>
|
||||
)}
|
||||
</ContentLayout>
|
||||
|
||||
<BottomLayout />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
content = <FrameLoading />;
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
return <div className="pages-frame">{content}</div>;
|
||||
}
|
||||
componentDidMount() {
|
||||
//装载全局的路由
|
||||
Sun.getSingleton().reactRouter = this.props.history;
|
||||
//装在全局Frame
|
||||
Sun.getSingleton().frameComponent = this;
|
||||
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
//获取当前登录者的信息
|
||||
initialize() {
|
||||
let that = this;
|
||||
let pathname: string = that.props.location.pathname;
|
||||
|
||||
this.preference.httpFetch(
|
||||
function () {
|
||||
// 白名单,不要求登录
|
||||
let whitePaths = [
|
||||
"/user/login",
|
||||
"/user/register",
|
||||
"/user/authentication",
|
||||
];
|
||||
// 尝试登录名单,登录失败不做处理
|
||||
let tryLoginPaths = [
|
||||
"/share/detail",
|
||||
];
|
||||
|
||||
if (whitePaths.findIndex((path) => pathname.startsWith(path)) >= 0) {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
} else if (tryLoginPaths.findIndex((path) => pathname.startsWith(path)) >= 0) {
|
||||
that.user.httpInfo(false, function () {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
});
|
||||
} else {
|
||||
that.user.httpInfo(true, function () {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
});
|
||||
}
|
||||
},
|
||||
function (errMessage: string, response: any) {
|
||||
that.initialized = true;
|
||||
that.updateUI();
|
||||
if (
|
||||
response &&
|
||||
response.data &&
|
||||
response.data["code"] === WebResultCode.NOT_INSTALLED
|
||||
) {
|
||||
MessageBoxUtil.warning("网站尚未安装,即将引导进入安装页面!");
|
||||
that.preference.installed = false;
|
||||
Sun.navigateTo("/install/index");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
let content: React.ReactNode;
|
||||
|
||||
if (this.initialized) {
|
||||
content = (
|
||||
<div className="pages-frame-inner">
|
||||
<SideLayout/>
|
||||
|
||||
<TopLayout/>
|
||||
|
||||
<ContentLayout>
|
||||
{this.preference.installed ? (
|
||||
<div className="pages-content">
|
||||
<Route
|
||||
exact
|
||||
path="/"
|
||||
render={() => <Redirect to="/matter/list"/>}
|
||||
/>
|
||||
<Route path="/user/login" component={UserLogin}/>
|
||||
<Route path="/user/register" component={UserRegister}/>
|
||||
<Route path="/user/detail/:uuid" component={UserDetail}/>
|
||||
<Route path="/user/list" component={UserList}/>
|
||||
<Route path="/mobile/user/list" component={MobileUserList}/>
|
||||
<Route path="/user/create" component={UserEdit}/>
|
||||
<Route path="/user/edit/:uuid" component={UserEdit}/>
|
||||
<Route
|
||||
path="/user/authentication/:authentication"
|
||||
component={UserAuthentication}
|
||||
/>
|
||||
|
||||
<Route path="/dashboard/index" component={DashboardIndex}/>
|
||||
|
||||
<Route path="/preference/index" component={PreferenceIndex}/>
|
||||
<Route path="/preference/edit" component={PreferenceEdit}/>
|
||||
<Route
|
||||
path="/preference/engine/edit"
|
||||
component={PreferenceEngineEdit}
|
||||
/>
|
||||
<Route
|
||||
path="/preference/scan/edit"
|
||||
component={PreferenceScanEdit}
|
||||
/>
|
||||
|
||||
<Route path="/matter/detail/:uuid" component={MatterDetail}/>
|
||||
<Route
|
||||
exact
|
||||
path="/matter"
|
||||
render={() => <Redirect to="/matter/list"/>}
|
||||
/>
|
||||
<Route path="/matter/list" component={MatterList}/>
|
||||
|
||||
<Route path="/share/list" component={ShareList}/>
|
||||
<Route path="/share/detail/:uuid" component={ShareDetail}/>
|
||||
|
||||
<Route path="/bin/list" component={BinList}/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="pages-content">
|
||||
<Route path="/install/index" component={InstallIndex}/>
|
||||
</div>
|
||||
)}
|
||||
</ContentLayout>
|
||||
|
||||
<BottomLayout/>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
content = <FrameLoading/>;
|
||||
}
|
||||
|
||||
return <div className="pages-frame">{content}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
const Frame = withRouter<IProps, React.ComponentType<IProps>>(RawFrame);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { RouteComponentProps } from "react-router-dom";
|
||||
import {RouteComponentProps} from "react-router-dom";
|
||||
import "./List.less";
|
||||
import TankComponent from "../../common/component/TankComponent";
|
||||
import Pager from "../../common/model/base/Pager";
|
||||
@@ -7,277 +7,279 @@ import Matter from "../../common/model/matter/Matter";
|
||||
import Moon from "../../common/model/global/Moon";
|
||||
import SortDirection from "../../common/model/base/SortDirection";
|
||||
import MatterPanel from "../matter/widget/MatterPanel";
|
||||
import { Button, Col, Empty, Input, Modal, Pagination, Row, Space } from "antd";
|
||||
import {Button, Col, Empty, Input, Modal, Pagination, Row, Space} from "antd";
|
||||
import MessageBoxUtil from "../../common/util/MessageBoxUtil";
|
||||
import {
|
||||
ExclamationCircleFilled,
|
||||
PlusSquareOutlined,
|
||||
MinusSquareOutlined,
|
||||
SyncOutlined,
|
||||
RedoOutlined,
|
||||
CloseCircleOutlined,
|
||||
CloseCircleOutlined,
|
||||
ExclamationCircleFilled,
|
||||
MinusSquareOutlined,
|
||||
PlusSquareOutlined,
|
||||
RedoOutlined,
|
||||
SyncOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import ImagePreviewer from "../widget/previewer/ImagePreviewer";
|
||||
import { UserRole } from "../../common/model/user/UserRole";
|
||||
import {UserRole} from "../../common/model/user/UserRole";
|
||||
import Lang from "../../common/model/global/Lang";
|
||||
import TankTitle from "../widget/TankTitle";
|
||||
|
||||
interface IProps extends RouteComponentProps {}
|
||||
interface IProps extends RouteComponentProps {
|
||||
}
|
||||
|
||||
interface IState {}
|
||||
interface IState {
|
||||
}
|
||||
|
||||
export default class List extends TankComponent<IProps, IState> {
|
||||
//当前文件夹信息。
|
||||
matter = new Matter();
|
||||
//当前选中的文件
|
||||
selectedMatters: Matter[] = [];
|
||||
//获取分页的一个帮助器
|
||||
pager = new Pager<Matter>(this, Matter, Pager.MAX_PAGE_SIZE);
|
||||
user = Moon.getSingleton().user;
|
||||
preference = Moon.getSingleton().preference;
|
||||
//当前文件夹信息。
|
||||
matter = new Matter();
|
||||
//当前选中的文件
|
||||
selectedMatters: Matter[] = [];
|
||||
//获取分页的一个帮助器
|
||||
pager = new Pager<Matter>(this, Matter, Pager.MAX_PAGE_SIZE);
|
||||
user = Moon.getSingleton().user;
|
||||
preference = Moon.getSingleton().preference;
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
//刷新一下列表
|
||||
if (this.user.role === UserRole.ADMINISTRATOR) {
|
||||
this.pager.getFilter("userUuid")!.visible = true;
|
||||
} else {
|
||||
this.pager.setFilterValue("userUuid", this.user.uuid);
|
||||
}
|
||||
this.pager.enableHistory();
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Readonly<IProps>, nextContext: any) {
|
||||
if (this.props.location.search !== nextProps.location.search) {
|
||||
this.pager.enableHistory();
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
refresh() {
|
||||
// 清空暂存区
|
||||
this.selectedMatters = [];
|
||||
// 刷新文件列表
|
||||
this.refreshPager();
|
||||
}
|
||||
|
||||
refreshPager() {
|
||||
//如果没有任何的排序,默认使用时间倒序和文件夹在顶部
|
||||
if (!this.pager.getCurrentSortFilter()) {
|
||||
this.pager.setFilterValue("orderDeleteTime", SortDirection.DESC);
|
||||
this.pager.setFilterValue("orderDir", SortDirection.DESC);
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
// 过滤掉被软删除的文件
|
||||
this.pager.setFilterValue("deleted", true);
|
||||
componentDidMount() {
|
||||
//刷新一下列表
|
||||
if (this.user.role === UserRole.ADMINISTRATOR) {
|
||||
this.pager.getFilter("userUuid")!.visible = true;
|
||||
} else {
|
||||
this.pager.setFilterValue("userUuid", this.user.uuid);
|
||||
}
|
||||
this.pager.enableHistory();
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
this.pager.httpList();
|
||||
}
|
||||
componentWillReceiveProps(nextProps: Readonly<IProps>, nextContext: any) {
|
||||
if (this.props.location.search !== nextProps.location.search) {
|
||||
this.pager.enableHistory();
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
checkMatter(matter?: Matter) {
|
||||
if (matter) {
|
||||
if (matter.check) {
|
||||
this.selectedMatters.push(matter);
|
||||
} else {
|
||||
const index = this.selectedMatters.findIndex(
|
||||
(item) => item.uuid === matter.uuid
|
||||
refresh() {
|
||||
// 清空暂存区
|
||||
this.selectedMatters = [];
|
||||
// 刷新文件列表
|
||||
this.refreshPager();
|
||||
}
|
||||
|
||||
refreshPager() {
|
||||
//如果没有任何的排序,默认使用时间倒序和文件夹在顶部
|
||||
if (!this.pager.getCurrentSortFilter()) {
|
||||
this.pager.setFilterValue("orderDeleteTime", SortDirection.DESC);
|
||||
this.pager.setFilterValue("orderDir", SortDirection.DESC);
|
||||
}
|
||||
|
||||
// 过滤掉被软删除的文件
|
||||
this.pager.setFilterValue("deleted", true);
|
||||
|
||||
this.pager.httpList();
|
||||
}
|
||||
|
||||
checkMatter(matter?: Matter) {
|
||||
if (matter) {
|
||||
if (matter.check) {
|
||||
this.selectedMatters.push(matter);
|
||||
} else {
|
||||
const index = this.selectedMatters.findIndex(
|
||||
(item) => item.uuid === matter.uuid
|
||||
);
|
||||
this.selectedMatters.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
//统计所有的勾选
|
||||
this.selectedMatters = [];
|
||||
this.pager.data.forEach((matter) => {
|
||||
if (matter.check) {
|
||||
this.selectedMatters.push(matter);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
checkAll() {
|
||||
this.pager.data.forEach((i) => {
|
||||
i.check = true;
|
||||
});
|
||||
this.checkMatter();
|
||||
}
|
||||
|
||||
checkNone() {
|
||||
this.pager.data.forEach((i) => {
|
||||
i.check = false;
|
||||
});
|
||||
this.checkMatter();
|
||||
}
|
||||
|
||||
deleteBatch() {
|
||||
Modal.confirm({
|
||||
title: Lang.t("actionCanNotRevertConfirm"),
|
||||
icon: <ExclamationCircleFilled twoToneColor="#FFDC00"/>,
|
||||
onOk: () => {
|
||||
const uuids = this.selectedMatters.map((i) => i.uuid).toString();
|
||||
this.matter.httpDeleteBatch(uuids, () => {
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"));
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
recoverBatch() {
|
||||
Modal.confirm({
|
||||
title: Lang.t("actionRecoveryConfirm"),
|
||||
icon: <ExclamationCircleFilled twoToneColor="#FFDC00"/>,
|
||||
onOk: () => {
|
||||
const uuids = this.selectedMatters.map((i) => i.uuid).toString();
|
||||
this.matter.httpRecoveryBatch(uuids, () => {
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"));
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
searchFile(value?: string) {
|
||||
this.pager.resetFilter();
|
||||
if (value) {
|
||||
this.pager.setFilterValue("orderCreateTime", SortDirection.DESC);
|
||||
this.pager.setFilterValue("orderDir", SortDirection.DESC);
|
||||
this.pager.setFilterValue("name", value);
|
||||
this.pager.setFilterValue("deleted", true);
|
||||
this.pager.httpList();
|
||||
} else {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
changeSearch(e: any) {
|
||||
if (!e.currentTarget.value) this.searchFile();
|
||||
}
|
||||
|
||||
changePage(page: number) {
|
||||
this.pager.page = page - 1; // page的页数0基
|
||||
this.pager.httpList();
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
previewImage(matter: Matter) {
|
||||
let imageArray: string[] = [];
|
||||
let startIndex = -1;
|
||||
this.pager.data.forEach((item) => {
|
||||
if (item.isImage()) {
|
||||
imageArray.push(item.getPreviewUrl());
|
||||
if (item.uuid === matter.uuid) {
|
||||
startIndex = imageArray.length - 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ImagePreviewer.showMultiPhoto(imageArray, startIndex);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {pager, selectedMatters} = this;
|
||||
return (
|
||||
<div className="matter-list">
|
||||
<TankTitle name={Lang.t("layout.bin")}/>
|
||||
|
||||
<Row className="mt10">
|
||||
<Col xs={24} sm={24} md={14} lg={16}>
|
||||
<Space className="buttons">
|
||||
{selectedMatters.length !== pager.data.length ? (
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.checkAll()}
|
||||
>
|
||||
<PlusSquareOutlined/>
|
||||
{Lang.t("selectAll")}
|
||||
</Button>
|
||||
) : null}
|
||||
{pager.data.length &&
|
||||
selectedMatters.length === pager.data.length ? (
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.checkNone()}
|
||||
>
|
||||
<MinusSquareOutlined/>
|
||||
{Lang.t("cancel")}
|
||||
</Button>
|
||||
) : null}
|
||||
{selectedMatters.length ? (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.recoverBatch()}
|
||||
>
|
||||
<RedoOutlined/>
|
||||
{Lang.t("matter.recovery")}
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.deleteBatch()}
|
||||
>
|
||||
<CloseCircleOutlined/>
|
||||
{Lang.t("matter.hardDelete")}
|
||||
</Button>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.refresh()}
|
||||
>
|
||||
<SyncOutlined/>
|
||||
{Lang.t("refresh")}
|
||||
</Button>
|
||||
</Space>
|
||||
</Col>
|
||||
<Col xs={24} sm={24} md={10} lg={8}>
|
||||
<Input.Search
|
||||
className="mb10"
|
||||
placeholder={Lang.t("matter.searchFile")}
|
||||
onSearch={(value) => this.searchFile(value)}
|
||||
onChange={(e) => this.changeSearch(e)}
|
||||
enterButton
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
{pager.loading || pager.data.length ? (
|
||||
pager.data.map((matter) => (
|
||||
<MatterPanel
|
||||
recycleMode
|
||||
key={matter.uuid!}
|
||||
matter={matter}
|
||||
onDeleteSuccess={() => this.refresh()}
|
||||
onRecoverySuccess={() => this.refresh()}
|
||||
onCheckMatter={(m) => this.checkMatter(m)}
|
||||
onPreviewImage={(m) => this.previewImage(m)}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<Empty description={Lang.t("matter.noContentYet")}/>
|
||||
)}
|
||||
</div>
|
||||
<Pagination
|
||||
className="mt10 pull-right"
|
||||
onChange={(page) => this.changePage(page)}
|
||||
current={pager.page + 1}
|
||||
total={pager.totalItems}
|
||||
pageSize={pager.pageSize}
|
||||
hideOnSinglePage
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
this.selectedMatters.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
//统计所有的勾选
|
||||
this.selectedMatters = [];
|
||||
this.pager.data.forEach((matter) => {
|
||||
if (matter.check) {
|
||||
this.selectedMatters.push(matter);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
checkAll() {
|
||||
this.pager.data.forEach((i) => {
|
||||
i.check = true;
|
||||
});
|
||||
this.checkMatter();
|
||||
}
|
||||
|
||||
checkNone() {
|
||||
this.pager.data.forEach((i) => {
|
||||
i.check = false;
|
||||
});
|
||||
this.checkMatter();
|
||||
}
|
||||
|
||||
deleteBatch() {
|
||||
Modal.confirm({
|
||||
title: Lang.t("actionCanNotRevertConfirm"),
|
||||
icon: <ExclamationCircleFilled twoToneColor="#FFDC00" />,
|
||||
onOk: () => {
|
||||
const uuids = this.selectedMatters.map((i) => i.uuid).toString();
|
||||
this.matter.httpDeleteBatch(uuids, () => {
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"));
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
recoverBatch() {
|
||||
Modal.confirm({
|
||||
title: Lang.t("actionRecoveryConfirm"),
|
||||
icon: <ExclamationCircleFilled twoToneColor="#FFDC00" />,
|
||||
onOk: () => {
|
||||
const uuids = this.selectedMatters.map((i) => i.uuid).toString();
|
||||
this.matter.httpRecoveryBatch(uuids, () => {
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"));
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
searchFile(value?: string) {
|
||||
this.pager.resetFilter();
|
||||
if (value) {
|
||||
this.pager.setFilterValue("orderCreateTime", SortDirection.DESC);
|
||||
this.pager.setFilterValue("orderDir", SortDirection.DESC);
|
||||
this.pager.setFilterValue("name", value);
|
||||
this.pager.setFilterValue("deleted", true);
|
||||
this.pager.httpList();
|
||||
} else {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
changeSearch(e: any) {
|
||||
if (!e.currentTarget.value) this.searchFile();
|
||||
}
|
||||
|
||||
changePage(page: number) {
|
||||
this.pager.page = page - 1; // page的页数0基
|
||||
this.pager.httpList();
|
||||
this.updateUI();
|
||||
}
|
||||
|
||||
previewImage(matter: Matter) {
|
||||
let imageArray: string[] = [];
|
||||
let startIndex = -1;
|
||||
this.pager.data.forEach((item) => {
|
||||
if (item.isImage()) {
|
||||
imageArray.push(item.getPreviewUrl());
|
||||
if (item.uuid === matter.uuid) {
|
||||
startIndex = imageArray.length - 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ImagePreviewer.showMultiPhoto(imageArray, startIndex);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { pager, selectedMatters } = this;
|
||||
return (
|
||||
<div className="matter-list">
|
||||
<TankTitle name={Lang.t("layout.bin")} />
|
||||
|
||||
<Row className="mt10">
|
||||
<Col xs={24} sm={24} md={14} lg={16}>
|
||||
<Space className="buttons">
|
||||
{selectedMatters.length !== pager.data.length ? (
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.checkAll()}
|
||||
>
|
||||
<PlusSquareOutlined />
|
||||
{Lang.t("selectAll")}
|
||||
</Button>
|
||||
) : null}
|
||||
{pager.data.length &&
|
||||
selectedMatters.length === pager.data.length ? (
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.checkNone()}
|
||||
>
|
||||
<MinusSquareOutlined />
|
||||
{Lang.t("cancel")}
|
||||
</Button>
|
||||
) : null}
|
||||
{selectedMatters.length ? (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.recoverBatch()}
|
||||
>
|
||||
<RedoOutlined />
|
||||
{Lang.t("matter.recovery")}
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.deleteBatch()}
|
||||
>
|
||||
<CloseCircleOutlined />
|
||||
{Lang.t("matter.hardDelete")}
|
||||
</Button>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
className="mb10"
|
||||
onClick={() => this.refresh()}
|
||||
>
|
||||
<SyncOutlined />
|
||||
{Lang.t("refresh")}
|
||||
</Button>
|
||||
</Space>
|
||||
</Col>
|
||||
<Col xs={24} sm={24} md={10} lg={8}>
|
||||
<Input.Search
|
||||
className="mb10"
|
||||
placeholder={Lang.t("matter.searchFile")}
|
||||
onSearch={(value) => this.searchFile(value)}
|
||||
onChange={(e) => this.changeSearch(e)}
|
||||
enterButton
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
{pager.loading || pager.data.length ? (
|
||||
pager.data.map((matter) => (
|
||||
<MatterPanel
|
||||
recycleMode
|
||||
key={matter.uuid!}
|
||||
matter={matter}
|
||||
onDeleteSuccess={() => this.refresh()}
|
||||
onRecoverySuccess={() => this.refresh()}
|
||||
onCheckMatter={(m) => this.checkMatter(m)}
|
||||
onPreviewImage={(m) => this.previewImage(m)}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<Empty description={Lang.t("matter.noContentYet")} />
|
||||
)}
|
||||
</div>
|
||||
<Pagination
|
||||
className="mt10 pull-right"
|
||||
onChange={(page) => this.changePage(page)}
|
||||
current={pager.page + 1}
|
||||
total={pager.totalItems}
|
||||
pageSize={pager.pageSize}
|
||||
hideOnSinglePage
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,431 +28,438 @@ interface IState {
|
||||
}
|
||||
|
||||
interface IpStruct {
|
||||
ip: string
|
||||
times: number
|
||||
ip: string
|
||||
times: number
|
||||
}
|
||||
|
||||
export default class Index extends TankComponent<IProps, IState> {
|
||||
|
||||
|
||||
//获取分页的一个帮助器
|
||||
pager: Pager<Dashboard> = new Pager<Dashboard>(this, Dashboard, 15);
|
||||
//获取分页的一个帮助器
|
||||
pager: Pager<Dashboard> = new Pager<Dashboard>(this, Dashboard, 15);
|
||||
|
||||
//今天的统计情况
|
||||
dashboard: Dashboard = new Dashboard(this)
|
||||
yesterdayDashboard: Dashboard = new Dashboard(this)
|
||||
//今天的统计情况
|
||||
dashboard: Dashboard = new Dashboard(this)
|
||||
yesterdayDashboard: Dashboard = new Dashboard(this)
|
||||
|
||||
matterPager: Pager<Matter> = new Pager<Matter>(this, Matter, 10);
|
||||
matterPager: Pager<Matter> = new Pager<Matter>(this, Matter, 10);
|
||||
|
||||
activeIpTop10: IpStruct[] = []
|
||||
activeIpTop10: IpStruct[] = []
|
||||
|
||||
//****************作图需要的对象******************/
|
||||
days: number = 15
|
||||
//用来存放日期的,辅助x轴的生成
|
||||
dateStrings: string[] = []
|
||||
//****************作图需要的对象******************/
|
||||
days: number = 15
|
||||
//用来存放日期的,辅助x轴的生成
|
||||
dateStrings: string[] = []
|
||||
|
||||
//调用量周环比
|
||||
standardWeekInvokeNum: number = 0
|
||||
compareWeekInvokeNum: number = 0
|
||||
//调用量日环比
|
||||
standardDayInvokeNum: number = 0
|
||||
compareDayInvokeNum: number = 0
|
||||
//UV周环比
|
||||
standardWeekUv: number = 0
|
||||
compareWeekUv: number = 0
|
||||
//UV日环比
|
||||
standardDayUv: number = 0
|
||||
compareDayUv: number = 0
|
||||
//文件总数周环比
|
||||
standardWeekMatterNum: number = 0
|
||||
compareWeekMatterNum: number = 0
|
||||
//文件总数日环比
|
||||
standardDayMatterNum: number = 0
|
||||
compareDayMatterNum: number = 0
|
||||
//文件大小周环比
|
||||
standardWeekSize: number = 0
|
||||
compareWeekSize: number = 0
|
||||
//文件大小日环比
|
||||
standardDaySize: number = 0
|
||||
compareDaySize: number = 0
|
||||
//调用量周环比
|
||||
standardWeekInvokeNum: number = 0
|
||||
compareWeekInvokeNum: number = 0
|
||||
//调用量日环比
|
||||
standardDayInvokeNum: number = 0
|
||||
compareDayInvokeNum: number = 0
|
||||
//UV周环比
|
||||
standardWeekUv: number = 0
|
||||
compareWeekUv: number = 0
|
||||
//UV日环比
|
||||
standardDayUv: number = 0
|
||||
compareDayUv: number = 0
|
||||
//文件总数周环比
|
||||
standardWeekMatterNum: number = 0
|
||||
compareWeekMatterNum: number = 0
|
||||
//文件总数日环比
|
||||
standardDayMatterNum: number = 0
|
||||
compareDayMatterNum: number = 0
|
||||
//文件大小周环比
|
||||
standardWeekSize: number = 0
|
||||
compareWeekSize: number = 0
|
||||
//文件大小日环比
|
||||
standardDaySize: number = 0
|
||||
compareDaySize: number = 0
|
||||
|
||||
invokeListOption: any = {
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data: ['PV', 'UV']
|
||||
},
|
||||
xAxis: {
|
||||
name: Lang.t("assign.date"),
|
||||
data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
},
|
||||
yAxis: {
|
||||
name: Lang.t("assign.num")
|
||||
},
|
||||
series: [{
|
||||
name: 'PV',
|
||||
type: 'bar',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}, {
|
||||
name: 'UV',
|
||||
type: 'line',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
};
|
||||
invokeListOption: any = {
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data: ['PV', 'UV']
|
||||
},
|
||||
xAxis: {
|
||||
name: Lang.t("assign.date"),
|
||||
data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
|
||||
},
|
||||
yAxis: {
|
||||
name: Lang.t("assign.num")
|
||||
},
|
||||
series: [{
|
||||
name: 'PV',
|
||||
type: 'bar',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}, {
|
||||
name: 'UV',
|
||||
type: 'line',
|
||||
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
}]
|
||||
};
|
||||
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {};
|
||||
this.state = {};
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
this.refresh()
|
||||
|
||||
}
|
||||
|
||||
refresh() {
|
||||
|
||||
this.updateDateStrings()
|
||||
this.refreshDashboardPager()
|
||||
this.refreshMatterPager()
|
||||
this.refreshActiveIpTop10()
|
||||
}
|
||||
|
||||
updateDateStrings() {
|
||||
let that = this;
|
||||
//更新横坐标 从今天开始倒推
|
||||
let arr = []
|
||||
for (let d = that.days - 1; d >= 0; d--) {
|
||||
let thenDate = new Date((new Date()).getTime() - d * 24 * 60 * 60 * 1000)
|
||||
arr.push(DateUtil.simpleDate(thenDate))
|
||||
}
|
||||
that.dateStrings = arr
|
||||
}
|
||||
|
||||
//获取15日调用分时数据
|
||||
refreshDashboardPager() {
|
||||
let that = this;
|
||||
componentDidMount() {
|
||||
|
||||
this.pager.setFilterValue("orderDt", SortDirection.DESC)
|
||||
this.refresh()
|
||||
|
||||
this.pager.httpList(function (response: any) {
|
||||
}
|
||||
|
||||
let list = that.pager.data
|
||||
refresh() {
|
||||
|
||||
if (list.length > 0) {
|
||||
that.dashboard.assign(list[0])
|
||||
}
|
||||
|
||||
if (list.length > 1) {
|
||||
that.yesterdayDashboard.assign(list[1])
|
||||
}
|
||||
|
||||
//数据转换成map,方便检索
|
||||
let map: { [key: string]: Dashboard } = {}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
map[list[i].dt] = list[i]
|
||||
}
|
||||
|
||||
let invokeNumData = []
|
||||
let uvData = []
|
||||
let matterNumData = []
|
||||
let fileSizeData = []
|
||||
for (let i = 0; i < that.days; i++) {
|
||||
invokeNumData.push(0)
|
||||
uvData.push(0)
|
||||
matterNumData.push(0)
|
||||
fileSizeData.push(0)
|
||||
}
|
||||
|
||||
//按照日期对应。
|
||||
for (let i = 0; i < that.dateStrings.length; i++) {
|
||||
let item = map[that.dateStrings[i]];
|
||||
if (item) {
|
||||
invokeNumData[i] = item.invokeNum
|
||||
uvData[i] = item.uv
|
||||
matterNumData[i] = item.matterNum
|
||||
fileSizeData[i] = item.fileSize
|
||||
this.updateDateStrings()
|
||||
this.refreshDashboardPager()
|
||||
this.refreshMatterPager()
|
||||
this.refreshActiveIpTop10()
|
||||
}
|
||||
|
||||
updateDateStrings() {
|
||||
let that = this;
|
||||
//更新横坐标 从今天开始倒推
|
||||
let arr = []
|
||||
for (let d = that.days - 1; d >= 0; d--) {
|
||||
let thenDate = new Date((new Date()).getTime() - d * 24 * 60 * 60 * 1000)
|
||||
arr.push(DateUtil.simpleDate(thenDate))
|
||||
}
|
||||
}
|
||||
that.dateStrings = arr
|
||||
}
|
||||
|
||||
//同环比
|
||||
that.standardWeekInvokeNum = 0
|
||||
that.compareWeekInvokeNum = 0
|
||||
//调用量日环比
|
||||
that.standardDayInvokeNum = 0
|
||||
that.compareDayInvokeNum = 0
|
||||
//UV周环比
|
||||
that.standardWeekUv = 0
|
||||
that.compareWeekUv = 0
|
||||
//UV日环比
|
||||
that.standardDayUv = 0
|
||||
that.compareDayUv = 0
|
||||
//获取15日调用分时数据
|
||||
refreshDashboardPager() {
|
||||
let that = this;
|
||||
|
||||
//文件总数周环比
|
||||
that.standardWeekMatterNum = 0
|
||||
that.compareWeekMatterNum = 0
|
||||
//文件总数日环比
|
||||
that.standardDayMatterNum = 0
|
||||
that.compareDayMatterNum = 0
|
||||
//文件大小周环比
|
||||
that.standardWeekSize = 0
|
||||
that.compareWeekSize = 0
|
||||
//文件大小日环比
|
||||
that.standardDaySize = 0
|
||||
that.compareDaySize = 0
|
||||
this.pager.setFilterValue("orderDt", SortDirection.DESC)
|
||||
|
||||
for (let i = 0; i < that.days; i++) {
|
||||
if (i >= 0 && i <= 6) {
|
||||
that.standardWeekInvokeNum += invokeNumData[i]
|
||||
that.standardWeekUv += uvData[i]
|
||||
that.standardWeekMatterNum += matterNumData[i]
|
||||
that.standardWeekSize += fileSizeData[i]
|
||||
this.pager.httpList(function (response: any) {
|
||||
|
||||
} else if (i >= 7 && i <= 13) {
|
||||
that.compareWeekInvokeNum += invokeNumData[i]
|
||||
that.compareWeekUv += uvData[i]
|
||||
that.compareWeekMatterNum += matterNumData[i]
|
||||
that.compareWeekSize += fileSizeData[i]
|
||||
}
|
||||
if (i === 12) {
|
||||
that.standardDayInvokeNum = invokeNumData[i]
|
||||
that.standardDayUv = uvData[i]
|
||||
that.standardDayMatterNum = matterNumData[i]
|
||||
that.standardDaySize = fileSizeData[i]
|
||||
let list = that.pager.data
|
||||
|
||||
}
|
||||
if (i === 13) {
|
||||
that.compareDayInvokeNum = invokeNumData[i]
|
||||
that.compareDayUv = uvData[i]
|
||||
that.compareDayMatterNum = matterNumData[i]
|
||||
that.compareDaySize = fileSizeData[i]
|
||||
}
|
||||
}
|
||||
if (list.length > 0) {
|
||||
that.dashboard.assign(list[0])
|
||||
}
|
||||
|
||||
if (list.length > 1) {
|
||||
that.yesterdayDashboard.assign(list[1])
|
||||
}
|
||||
|
||||
//数据转换成map,方便检索
|
||||
let map: { [key: string]: Dashboard } = {}
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
map[list[i].dt] = list[i]
|
||||
}
|
||||
|
||||
let invokeNumData = []
|
||||
let uvData = []
|
||||
let matterNumData = []
|
||||
let fileSizeData = []
|
||||
for (let i = 0; i < that.days; i++) {
|
||||
invokeNumData.push(0)
|
||||
uvData.push(0)
|
||||
matterNumData.push(0)
|
||||
fileSizeData.push(0)
|
||||
}
|
||||
|
||||
//按照日期对应。
|
||||
for (let i = 0; i < that.dateStrings.length; i++) {
|
||||
let item = map[that.dateStrings[i]];
|
||||
if (item) {
|
||||
invokeNumData[i] = item.invokeNum
|
||||
uvData[i] = item.uv
|
||||
matterNumData[i] = item.matterNum
|
||||
fileSizeData[i] = item.fileSize
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//同环比
|
||||
that.standardWeekInvokeNum = 0
|
||||
that.compareWeekInvokeNum = 0
|
||||
//调用量日环比
|
||||
that.standardDayInvokeNum = 0
|
||||
that.compareDayInvokeNum = 0
|
||||
//UV周环比
|
||||
that.standardWeekUv = 0
|
||||
that.compareWeekUv = 0
|
||||
//UV日环比
|
||||
that.standardDayUv = 0
|
||||
that.compareDayUv = 0
|
||||
|
||||
//文件总数周环比
|
||||
that.standardWeekMatterNum = 0
|
||||
that.compareWeekMatterNum = 0
|
||||
//文件总数日环比
|
||||
that.standardDayMatterNum = 0
|
||||
that.compareDayMatterNum = 0
|
||||
//文件大小周环比
|
||||
that.standardWeekSize = 0
|
||||
that.compareWeekSize = 0
|
||||
//文件大小日环比
|
||||
that.standardDaySize = 0
|
||||
that.compareDaySize = 0
|
||||
|
||||
for (let i = 0; i < that.days; i++) {
|
||||
if (i >= 0 && i <= 6) {
|
||||
that.standardWeekInvokeNum += invokeNumData[i]
|
||||
that.standardWeekUv += uvData[i]
|
||||
that.standardWeekMatterNum += matterNumData[i]
|
||||
that.standardWeekSize += fileSizeData[i]
|
||||
|
||||
} else if (i >= 7 && i <= 13) {
|
||||
that.compareWeekInvokeNum += invokeNumData[i]
|
||||
that.compareWeekUv += uvData[i]
|
||||
that.compareWeekMatterNum += matterNumData[i]
|
||||
that.compareWeekSize += fileSizeData[i]
|
||||
}
|
||||
if (i === 12) {
|
||||
that.standardDayInvokeNum = invokeNumData[i]
|
||||
that.standardDayUv = uvData[i]
|
||||
that.standardDayMatterNum = matterNumData[i]
|
||||
that.standardDaySize = fileSizeData[i]
|
||||
|
||||
}
|
||||
if (i === 13) {
|
||||
that.compareDayInvokeNum = invokeNumData[i]
|
||||
that.compareDayUv = uvData[i]
|
||||
that.compareDayMatterNum = matterNumData[i]
|
||||
that.compareDaySize = fileSizeData[i]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
that.invokeListOption.xAxis.data = that.dateStrings.map((k) => k.substr(5))
|
||||
that.invokeListOption.series[0].data = invokeNumData
|
||||
that.invokeListOption.series[1].data = uvData
|
||||
that.invokeListOption.xAxis.data = that.dateStrings.map((k) => k.substr(5))
|
||||
that.invokeListOption.series[0].data = invokeNumData
|
||||
that.invokeListOption.series[1].data = uvData
|
||||
|
||||
that.updateUI()
|
||||
})
|
||||
that.updateUI()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//获取下载前10的文件
|
||||
refreshMatterPager() {
|
||||
let that = this;
|
||||
that.matterPager.setFilterValue("orderTimes", SortDirection.DESC)
|
||||
that.matterPager.httpList()
|
||||
}
|
||||
//获取下载前10的文件
|
||||
refreshMatterPager() {
|
||||
let that = this;
|
||||
that.matterPager.setFilterValue("orderTimes", SortDirection.DESC)
|
||||
that.matterPager.httpList()
|
||||
}
|
||||
|
||||
refreshActiveIpTop10() {
|
||||
let that = this
|
||||
that.dashboard.httpActiveIpTop10(function (data: any) {
|
||||
if (data) {
|
||||
that.activeIpTop10 = data
|
||||
}
|
||||
that.updateUI()
|
||||
})
|
||||
}
|
||||
refreshActiveIpTop10() {
|
||||
let that = this
|
||||
that.dashboard.httpActiveIpTop10(function (data: any) {
|
||||
if (data) {
|
||||
that.activeIpTop10 = data
|
||||
}
|
||||
that.updateUI()
|
||||
})
|
||||
}
|
||||
|
||||
reRun() {
|
||||
let that = this
|
||||
that.dashboard.httpEtl(function (data: any) {
|
||||
reRun() {
|
||||
let that = this
|
||||
that.dashboard.httpEtl(function (data: any) {
|
||||
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"))
|
||||
MessageBoxUtil.success(Lang.t("operationSuccess"))
|
||||
|
||||
that.refresh()
|
||||
})
|
||||
}
|
||||
that.refresh()
|
||||
})
|
||||
}
|
||||
|
||||
onChartReady() {
|
||||
onChartReady() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
render() {
|
||||
|
||||
let that = this
|
||||
let that = this
|
||||
|
||||
let dashboard: Dashboard = this.dashboard
|
||||
let yesterdayDashboard: Dashboard = this.yesterdayDashboard
|
||||
let dashboard: Dashboard = this.dashboard
|
||||
let yesterdayDashboard: Dashboard = this.yesterdayDashboard
|
||||
|
||||
return (
|
||||
<div className="page-dashboard-index">
|
||||
return (
|
||||
<div className="page-dashboard-index">
|
||||
|
||||
<TankTitle name={Lang.t("layout.dashboard")}>
|
||||
</TankTitle>
|
||||
<TankTitle name={Lang.t("layout.dashboard")}>
|
||||
</TankTitle>
|
||||
|
||||
<Row gutter={18}>
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalInvokeNum")}</div>
|
||||
<div className="amount">{dashboard.totalInvokeNum}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")}
|
||||
standardValue={this.standardWeekInvokeNum}
|
||||
compareValue={this.compareWeekInvokeNum}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")}
|
||||
standardValue={this.standardDayInvokeNum}
|
||||
compareValue={this.compareDayInvokeNum}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayInvoke")}:{yesterdayDashboard.invokeNum}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalUV")}</div>
|
||||
<div className="amount">{dashboard.totalUv}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekUv}
|
||||
compareValue={this.compareWeekUv}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDayUv}
|
||||
compareValue={this.compareDayUv}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayUV")}:{yesterdayDashboard.uv}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalMatterNum")}</div>
|
||||
<div className="amount">{dashboard.totalMatterNum}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")}
|
||||
standardValue={this.standardWeekMatterNum}
|
||||
compareValue={this.compareWeekMatterNum}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")}
|
||||
standardValue={this.standardDayMatterNum}
|
||||
compareValue={this.compareDayMatterNum}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayMatterNum")}:{yesterdayDashboard.matterNum}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalFileSize")}</div>
|
||||
<div className="amount">{FileUtil.humanFileSize(dashboard.totalFileSize)}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekSize}
|
||||
compareValue={this.compareWeekSize}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDaySize}
|
||||
compareValue={this.compareDaySize}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayMatterSize")}:{FileUtil.humanFileSize(yesterdayDashboard.fileSize)}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.recentDayInvokeUV", 15)}
|
||||
</div>
|
||||
<figure>
|
||||
<ReactEcharts
|
||||
option={that.invokeListOption}
|
||||
notMerge={true}
|
||||
lazyUpdate={false}
|
||||
theme={"tank_theme"}
|
||||
onChartReady={this.onChartReady.bind(this)}
|
||||
showLoading={this.pager.loading}
|
||||
opts={{renderer: "svg"}}/>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={18}>
|
||||
<Col xs={24} sm={24} md={12} lg={12}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.downloadMatterTop10")}
|
||||
</div>
|
||||
<div className="list-rank">
|
||||
<ul>
|
||||
{
|
||||
this.matterPager.data.map((matter: Matter, index: number) => {
|
||||
return (
|
||||
<li key={index}>
|
||||
<span
|
||||
className={`rank ${index < 3 ? 'top3' : ''}`}>{index + 1}</span>
|
||||
<Link className="name"
|
||||
to={'/matter/detail/' + matter.uuid}>{matter.name}</Link>
|
||||
<span className="info">{matter.times}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={12}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.activeIpTop10")}
|
||||
</div>
|
||||
<div className="list-rank">
|
||||
<ul>
|
||||
{
|
||||
this.activeIpTop10.map((item: IpStruct, index: number) => {
|
||||
return (
|
||||
<li key={index}>
|
||||
<span
|
||||
className={`rank ${index < 3 ? 'top3' : ''}`}>{index + 1}</span>
|
||||
<span className="name">{item.ip}</span>
|
||||
<span className="info">{item.times}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Col>
|
||||
|
||||
</Row>
|
||||
|
||||
<Row gutter={18}>
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalInvokeNum")}</div>
|
||||
<div className="amount">{dashboard.totalInvokeNum}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekInvokeNum}
|
||||
compareValue={this.compareWeekInvokeNum}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDayInvokeNum}
|
||||
compareValue={this.compareDayInvokeNum}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayInvoke")}:{yesterdayDashboard.invokeNum}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalUV")}</div>
|
||||
<div className="amount">{dashboard.totalUv}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekUv}
|
||||
compareValue={this.compareWeekUv}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDayUv}
|
||||
compareValue={this.compareDayUv}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayUV")}:{yesterdayDashboard.uv}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalMatterNum")}</div>
|
||||
<div className="amount">{dashboard.totalMatterNum}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekMatterNum}
|
||||
compareValue={this.compareWeekMatterNum}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDayMatterNum}
|
||||
compareValue={this.compareDayMatterNum}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayMatterNum")}:{yesterdayDashboard.matterNum}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={6}>
|
||||
<div className="text-block">
|
||||
<div className="upper">
|
||||
<div className="indicator">{Lang.t("dashboard.totalFileSize")}</div>
|
||||
<div className="amount">{FileUtil.humanFileSize(dashboard.totalFileSize)}</div>
|
||||
<div>
|
||||
<RatePanel name={Lang.t("dashboard.weekRate")} standardValue={this.standardWeekSize}
|
||||
compareValue={this.compareWeekSize}/>
|
||||
<RatePanel name={Lang.t("dashboard.dayRate")} standardValue={this.standardDaySize}
|
||||
compareValue={this.compareDaySize}/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="lower">
|
||||
{Lang.t("dashboard.yesterdayMatterSize")}:{FileUtil.humanFileSize(yesterdayDashboard.fileSize)}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.recentDayInvokeUV", 15)}
|
||||
</div>
|
||||
<figure>
|
||||
<ReactEcharts
|
||||
option={that.invokeListOption}
|
||||
notMerge={true}
|
||||
lazyUpdate={false}
|
||||
theme={"tank_theme"}
|
||||
onChartReady={this.onChartReady.bind(this)}
|
||||
showLoading={this.pager.loading}
|
||||
opts={{renderer: "svg"}}/>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={18}>
|
||||
<Col xs={24} sm={24} md={12} lg={12}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.downloadMatterTop10")}
|
||||
</div>
|
||||
<div className="list-rank">
|
||||
<ul>
|
||||
{
|
||||
this.matterPager.data.map((matter: Matter, index: number) => {
|
||||
return (
|
||||
<li key={index}>
|
||||
<span className={`rank ${index < 3 ? 'top3' : ''}`}>{index + 1}</span>
|
||||
<Link className="name" to={'/matter/detail/' + matter.uuid}>{matter.name}</Link>
|
||||
<span className="info">{matter.times}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</Col>
|
||||
|
||||
|
||||
<Col xs={24} sm={24} md={12} lg={12}>
|
||||
|
||||
<div className="figure-block">
|
||||
<div className="title">
|
||||
{Lang.t("dashboard.activeIpTop10")}
|
||||
</div>
|
||||
<div className="list-rank">
|
||||
<ul>
|
||||
{
|
||||
this.activeIpTop10.map((item: IpStruct, index: number) => {
|
||||
return (
|
||||
<li key={index}>
|
||||
<span className={`rank ${index < 3 ? 'top3' : ''}`}>{index + 1}</span>
|
||||
<span className="name">{item.ip}</span>
|
||||
<span className="info">{item.times}</span>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Col>
|
||||
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
<Alert
|
||||
message={<span>
|
||||
<Alert
|
||||
message={<span>
|
||||
{Lang.t("dashboard.warnHint")}
|
||||
<span className="link" onClick={this.reRun.bind(this)}>{Lang.t("dashboard.reRun")}</span>
|
||||
<span className="link" onClick={this.reRun.bind(this)}>{Lang.t("dashboard.reRun")}</span>
|
||||
</span>}
|
||||
type="warning"
|
||||
/>
|
||||
</div>
|
||||
type="warning"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||