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
fb7d0c77
Commit
fb7d0c77
authored
Feb 16, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:组件功能
parent
a0927245
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
2 deletions
+47
-2
BaseService.cs
Bailun.DC.Services/Component/BaseService.cs
+4
-0
DictionaryService.cs
Bailun.DC.Services/Component/DictionaryService.cs
+14
-0
Filter.cshtml
Bailun.DC.Web/Areas/Component/Views/Form/Filter.cshtml
+2
-2
el-form-control.js
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
+11
-0
el-form-filter.js
Bailun.DC.Web/wwwroot/js/component/el-form-filter.js
+16
-0
No files found.
Bailun.DC.Services/Component/BaseService.cs
View file @
fb7d0c77
...
@@ -293,6 +293,10 @@ namespace Bailun.DC.Services.Component
...
@@ -293,6 +293,10 @@ namespace Bailun.DC.Services.Component
}
}
dataRow
.
CreateCell
(
col
).
SetCellValue
(
value
.
ToString
());
dataRow
.
CreateCell
(
col
).
SetCellValue
(
value
.
ToString
());
}
}
else
if
(
dataCount
>
65535
)
{
dataRow
.
CreateCell
(
col
).
SetCellValue
(
string
.
Empty
);
}
});
});
}
}
}
}
...
...
Bailun.DC.Services/Component/DictionaryService.cs
View file @
fb7d0c77
...
@@ -7,6 +7,7 @@ using Newtonsoft.Json;
...
@@ -7,6 +7,7 @@ using Newtonsoft.Json;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
namespace
Bailun.DC.Services.Component
namespace
Bailun.DC.Services.Component
{
{
...
@@ -51,6 +52,19 @@ namespace Bailun.DC.Services.Component
...
@@ -51,6 +52,19 @@ namespace Bailun.DC.Services.Component
db
=
DB
;
db
=
DB
;
break
;
break
;
}
}
//默认参数
var
paramIndex
=
entity
.
value
.
IndexOf
(
"@"
);
if
(
paramIndex
>=
0
)
{
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
);
}
}
}
//查询
//查询
using
(
db
)
using
(
db
)
{
{
...
...
Bailun.DC.Web/Areas/Component/Views/Form/Filter.cshtml
View file @
fb7d0c77
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<el-row v-bind:gutter="10">
<el-row v-bind:gutter="10">
<el-col v-if="filter.listFilterControl && filter.listFilterControl.length" v-bind:span="item.colSpan || 24" v-bind:class="{'auto-width': item.colSpan == null || item.colSpan == 'auto'}" v-for="(item,index) in filter.listFilterControl" v-bind:key="index">
<el-col v-if="filter.listFilterControl && filter.listFilterControl.length" v-bind:span="item.colSpan || 24" v-bind:class="{'auto-width': item.colSpan == null || item.colSpan == 'auto'}" v-for="(item,index) in filter.listFilterControl" v-bind:key="index">
<el-form-item v-if="item.type"
<el-form-item v-if="item.type"
v-bind:label="item.name"
v-bind:label="item.name"
v-bind:prop="'listFilterControl.' + index + '.value'"
v-bind:prop="'listFilterControl.' + index + '.value'"
v-bind:rules="item.rules || (item.required ? { required: true, message: item.message || ('请输入' + item.name)} : null)">
v-bind:rules="item.rules || (item.required ? { required: true, message: item.message || ('请输入' + item.name)} : null)">
<el-form-control v-bind:item="item" v-model="item.value"></el-form-control>
<el-form-control v-bind:item="item" v-model="item.value"
v-bind:form="filter" v-on:change="onChange(item,$event)"
></el-form-control>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col class="el-form-button">
<el-col class="el-form-button">
...
...
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
View file @
fb7d0c77
...
@@ -96,6 +96,17 @@
...
@@ -96,6 +96,17 @@
console
.
log
(
error
)
console
.
log
(
error
)
}
}
}
}
//父级联动
if
(
item
.
parentProp
)
{
if
(
that
.
form
&&
that
.
form
.
listFilterControl
&&
that
.
form
.
listFilterControl
.
length
)
{
var
parentItem
=
that
.
form
.
listFilterControl
.
find
(
function
(
l
)
{
return
l
.
prop
==
item
.
parentProp
});
if
(
parentItem
&&
parentItem
.
value
)
{
params
[
item
.
parentProp
]
=
parentItem
.
value
;
}
else
{
params
[
item
.
parentProp
]
=
null
;
}
}
}
var
method
=
item
.
apiMethod
&&
item
.
apiMethod
.
toLocaleLowerCase
()
==
"post"
?
item
.
apiMethod
:
'get'
;
var
method
=
item
.
apiMethod
&&
item
.
apiMethod
.
toLocaleLowerCase
()
==
"post"
?
item
.
apiMethod
:
'get'
;
that
.
$http
({
that
.
$http
({
method
:
method
,
method
:
method
,
...
...
Bailun.DC.Web/wwwroot/js/component/el-form-filter.js
View file @
fb7d0c77
...
@@ -138,6 +138,22 @@
...
@@ -138,6 +138,22 @@
}
else
{
}
else
{
this
.
formValidate
.
push
({
field
:
field
,
valid
:
valid
,
message
:
message
});
this
.
formValidate
.
push
({
field
:
field
,
valid
:
valid
,
message
:
message
});
}
}
},
//改变事件
onChange
:
function
(
item
,
val
)
{
var
that
=
this
;
switch
(
item
.
type
)
{
case
"select"
:
//联动子项
var
listFilter
=
that
.
filter
.
listFilterControl
.
filter
(
function
(
l
)
{
return
l
.
type
==
"select"
&&
l
.
parentProp
==
item
.
prop
});
if
(
listFilter
&&
listFilter
.
length
)
{
listFilter
.
forEach
(
function
(
l
)
{
Vue
.
set
(
l
,
"value"
,
null
);
Vue
.
set
(
l
,
"listOption"
,
null
);
})
}
break
;
}
}
}
},
},
mounted
:
function
()
{
mounted
:
function
()
{
...
...
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