Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
1906be4a
Commit
1906be4a
authored
Mar 02, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:组件功能
parent
c39909d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
OptionDTO.cs
Bailun.DC.Models/Component/DTO/OptionDTO.cs
+3
-2
DictionaryService.cs
Bailun.DC.Services/Component/DictionaryService.cs
+9
-2
TableService.cs
Bailun.DC.Services/Component/TableService.cs
+16
-15
el-form-control.js
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
+1
-1
No files found.
Bailun.DC.Models/Component/DTO/OptionDTO.cs
View file @
1906be4a
...
...
@@ -8,11 +8,11 @@
/// <summary>
/// 字段名称
/// </summary>
public
object
V
alue
{
get
;
set
;
}
public
object
v
alue
{
get
;
set
;
}
/// <summary>
/// 操作
/// </summary>
public
string
D
isplay
{
get
;
set
;
}
public
string
d
isplay
{
get
;
set
;
}
}
}
\ No newline at end of file
Bailun.DC.Services/Component/DictionaryService.cs
View file @
1906be4a
...
...
@@ -56,12 +56,19 @@ namespace Bailun.DC.Services.Component
var
paramIndex
=
entity
.
value
.
IndexOf
(
"@"
);
if
(
paramIndex
>=
0
)
{
foreach
(
Match
item
in
Regex
.
Matches
(
entity
.
value
.
Substring
(
paramIndex
),
@"
^
@\w+[^\w]*"
))
foreach
(
Match
item
in
Regex
.
Matches
(
entity
.
value
.
Substring
(
paramIndex
),
@"@\w+[^\w]*"
))
{
string
paramName
=
item
.
Value
.
Substring
(
1
,
Regex
.
Match
(
item
.
Value
.
Substring
(
1
),
@"[^\w]*$"
).
Index
);
if
(!
sqlparam
.
ParameterNames
.
Contains
(
paramName
))
{
sqlparam
.
Add
(
paramName
,
null
);
if
(
entity
.
value
.
Substring
(
0
,
paramIndex
+
item
.
Index
).
TrimEnd
().
EndsWith
(
"in"
,
StringComparison
.
OrdinalIgnoreCase
))
{
sqlparam
.
Add
(
paramName
,
new
string
[]
{
""
});
}
else
{
sqlparam
.
Add
(
paramName
,
null
);
}
}
}
}
...
...
Bailun.DC.Services/Component/TableService.cs
View file @
1906be4a
...
...
@@ -684,23 +684,17 @@ namespace Bailun.DC.Services.Component
sqlparam
.
Add
(
$"@
{
fieldFilter
.
Field
}
"
,
fieldFilter
.
Value
);
}
//其他操作符
else
if
(!
fieldFilter
.
Operator
.
ToUpper
().
Equals
(
"IN"
))
{
sql
.
Append
(
$"
{
sp
}
@
{
fieldFilter
.
Field
}{
sp2
}
"
);
sqlparam
.
Add
(
$"@
{
fieldFilter
.
Field
}
"
,
fieldFilter
.
Value
);
}
//IN
else
{
sql
.
Append
(
"( "
);
string
[]
fieldValues
=
fieldFilter
.
Value
.
Split
(
new
string
[]
{
","
},
StringSplitOptions
.
RemoveEmptyEntries
);
for
(
int
i
=
0
;
i
<
fieldValues
.
Length
;
i
++)
sql
.
Append
(
$"
{
sp
}
@
{
fieldFilter
.
Field
}{
sp2
}
"
);
if
(!
fieldFilter
.
Operator
.
ToUpper
().
Equals
(
"IN"
))
{
sqlparam
.
Add
(
$"@
{
fieldFilter
.
Field
}
"
,
fieldFilter
.
Value
);
}
else
{
sql
.
Append
(
$"
{
sp
}
@
{
fieldFilter
.
Field
+
i
.
ToString
()}{
sp2
}
, "
);
sqlparam
.
Add
(
$"@
{
fieldFilter
.
Field
}{
i
}
"
,
fieldValues
[
i
]);
sqlparam
.
Add
(
$"@
{
fieldFilter
.
Field
}
"
,
fieldFilter
.
Value
.
Split
(
","
,
StringSplitOptions
.
RemoveEmptyEntries
));
}
sql
.
Length
-=
2
;
sql
.
Append
(
" ) "
);
}
}
}
...
...
@@ -809,12 +803,19 @@ namespace Bailun.DC.Services.Component
var
paramIndex
=
entity
.
DataValue
.
IndexOf
(
"@"
);
if
(
paramIndex
>=
0
)
{
foreach
(
Match
item
in
Regex
.
Matches
(
entity
.
DataValue
.
Substring
(
paramIndex
),
@"
^
@\w+[^\w]*"
))
foreach
(
Match
item
in
Regex
.
Matches
(
entity
.
DataValue
.
Substring
(
paramIndex
),
@"@\w+[^\w]*"
))
{
string
paramName
=
item
.
Value
.
Substring
(
1
,
Regex
.
Match
(
item
.
Value
.
Substring
(
1
),
@"[^\w]*$"
).
Index
);
if
(!
sqlparam
.
ParameterNames
.
Contains
(
paramName
))
{
setSql
+=
$"SET @
{
paramName
}
= null;"
;
if
(
entity
.
DataValue
.
Substring
(
0
,
paramIndex
+
item
.
Index
).
TrimEnd
().
EndsWith
(
"in"
,
StringComparison
.
OrdinalIgnoreCase
))
{
sqlparam
.
Add
(
paramName
,
new
string
[]
{
""
});
}
else
{
sqlparam
.
Add
(
paramName
,
null
);
}
}
}
}
...
...
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
View file @
1906be4a
...
...
@@ -103,7 +103,7 @@
if
(
parentItem
&&
parentItem
.
value
)
{
params
[
item
.
parentProp
]
=
parentItem
.
value
;
}
else
{
params
[
item
.
parentProp
]
=
null
;
delete
params
[
item
.
parentProp
]
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment