Skip to content

Commit 6fa4697

Browse files
committed
Java: MultiDataSource 更新 AutoUI
1 parent 310022d commit 6fa4697

5 files changed

Lines changed: 392 additions & 137 deletions

File tree

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/apijson/JSONResponse.js

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3413,7 +3413,7 @@ var JSONResponse = {
34133413
}
34143414

34153415
var v = linkPaths[k]
3416-
var line = (isReq ? 'CUR_ARG(' : 'CUR_DATA(') + k + ')' + (StringUtil.isEmpty(v) ? '' : ' // ' + StringUtil.trim(v))
3416+
var line = (isReq ? 'NEXT_ARG(' : 'PRE_DATA(') + k + ')' + (StringUtil.isEmpty(v) ? '' : ' // ' + StringUtil.trim(v))
34173417

34183418
s += '\n_' + index + ': ' + line
34193419
index ++
@@ -3423,6 +3423,50 @@ var JSONResponse = {
34233423
return StringUtil.trim(s);
34243424
},
34253425

3426+
isViewPathMatch: function(realPath, targetPath) {
3427+
if (realPath == targetPath || StringUtil.isEmpty(targetPath)) {
3428+
return true;
3429+
}
3430+
if (StringUtil.isEmpty(realPath)) {
3431+
return false;
3432+
}
3433+
3434+
var realKeys = StringUtil.splitPath(realPath, false)
3435+
var targetKeys = StringUtil.splitPath(targetPath, false)
3436+
var rl = StringUtil.length(realKeys)
3437+
var tl = StringUtil.length(targetKeys)
3438+
3439+
for (let i = 0; i < tl; i++) {
3440+
if (i >= rl) {
3441+
break
3442+
}
3443+
3444+
var rk = realKeys[rl - 1 - i] // Type:id
3445+
var tk = targetKeys[tl - 1 - i]
3446+
var rp = StringUtil.parsePair(rk)
3447+
var tp = StringUtil.parsePair(tk)
3448+
3449+
var isIdEqual = StringUtil.isEmpty(tp) || rp[1] === tp[1]
3450+
if ((isIdEqual && StringUtil.isNotEmpty(tp[1]))) { // id 一样
3451+
return true
3452+
}
3453+
3454+
if ((isIdEqual || StringUtil.isEmpty(tp[1])) && (rp[0] === tp[0] || StringUtil.isEmpty(tp[0])
3455+
|| (StringUtil.isNumber(tp[0]) && StringUtil.isNumber(rp[1]))
3456+
)) {
3457+
continue
3458+
}
3459+
3460+
return false
3461+
}
3462+
3463+
return true
3464+
},
3465+
3466+
// FIXME 生成 transform 函数内部代码,用这个函数处理后再对比;image/background 需要图像对比
3467+
transform: function (key, val, bbox) {
3468+
return val
3469+
}
34263470
};
34273471

34283472
if (typeof module == 'object') {

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/apijson/StringUtil.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
var StringUtil = {
2020
TAG: 'StringUtil',
21+
MAX_NAME_LENGTH: 30,
22+
MAX_NICK_NAME_LENGTH: 20,
23+
MAX_CONST_NAME_LENGTH: 30,
2124

2225
isString: function(s) {
2326
return typeof s == 'string';
@@ -733,8 +736,16 @@ var StringUtil = {
733736
},
734737
CATEGORY_MAP: { // from TYPE_CATEGORY_KEYS
735738
// 'count': 'integer'
736-
}
739+
},
737740

741+
parsePair: function(s, trim) {
742+
if (StringUtil.isNotString(s) || StringUtil.isEmpty(s, trim)) {
743+
return []
744+
}
745+
746+
var ind = s.indexOf(':')
747+
return ind < 0 ? [s] : [s.substring(0, ind), s.substring(ind + 1)]
748+
}
738749
};
739750

740751
if (typeof module == 'object') {

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/au/css/main.css

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ a:active svg, a:hover svg{
162162
left: 0;
163163
top: 50px;
164164
bottom: 0;
165-
width: 40%;
165+
width: 56%;
166166
box-shadow: 1px 1px 1px rgba(245, 244, 244, 0.52);
167167
padding-top: 40px;
168168
padding-bottom: 10px;
@@ -213,10 +213,10 @@ textarea {
213213

214214
.side-right {
215215
position: absolute;
216-
left: 40%;
216+
left: 56%;
217217
top: 50px;
218218
bottom: 0;
219-
width: 60%;
219+
width: 56%;
220220
padding-left: 5px;
221221
padding-bottom: 10px;
222222
display: flex;
@@ -491,8 +491,8 @@ textarea {
491491
position: absolute;
492492
top: 50px;
493493
bottom: 0;
494-
left: 40%;
495-
z-index: 1000;
494+
left: 56%;
495+
z-index: 100;
496496
cursor: w-resize;
497497
border-right: rgba(221, 221, 221, 0.34) 1px solid;
498498
border-left: rgba(221, 221, 221, 0.34) 1px solid;
@@ -588,15 +588,13 @@ table.diff thead th.texttitle {
588588
right: auto;
589589
top: 100%
590590
}
591-
592591
.method-pop li {
593592
display: block;
594593
padding: 0;
595594
padding-right: 0;
596595
border-bottom: 0;
597596
overflow: visible;
598597
}
599-
600598
.method-pop li a {
601599
display: block;
602600
width: 100%;
@@ -608,21 +606,18 @@ table.diff thead th.texttitle {
608606
color: black;
609607
text-align: center;
610608
}
611-
612609
.type-pop {
613610
left: 0;
614611
right: auto;
615612
top: 100%
616613
}
617-
618614
.type-pop li {
619615
display: block;
620616
padding: 0;
621617
padding-right: 0;
622618
border-bottom: 0;
623619
overflow: visible;
624620
}
625-
626621
.type-pop li a {
627622
display: block;
628623
width: 100%;

0 commit comments

Comments
 (0)