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
de9dd982
Commit
de9dd982
authored
Mar 07, 2022
by
jianshuqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化:组件功能
parent
b8f5bba6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Control.cshtml
Bailun.DC.Web/Areas/Component/Views/Form/Control.cshtml
+2
-1
el-form-control.js
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
+4
-0
vue-interceptors.js
Bailun.DC.Web/wwwroot/js/vue/vue-interceptors.js
+5
-0
No files found.
Bailun.DC.Web/Areas/Component/Views/Form/Control.cshtml
View file @
de9dd982
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
v-bind:clearable="item.clearable == null || item.clearable"
v-bind:clearable="item.clearable == null || item.clearable"
v-bind:disabled="disabled != null ? disabled :(item.disabled == true || javaScript.call(this,item.disabled))"
v-bind:disabled="disabled != null ? disabled :(item.disabled == true || javaScript.call(this,item.disabled))"
v-bind:placeholder="item.placeholder != null ? item.placeholder :('请选择' + (item.label || item.name || ''))"
v-bind:placeholder="item.placeholder != null ? item.placeholder :('请选择' + (item.label || item.name || ''))"
v-bind:loading="
$root.
loading"
v-bind:loading="loading"
v-bind:size="item.size || 'small'"
v-bind:size="item.size || 'small'"
v-bind:multiple="item.multiple"
v-bind:multiple="item.multiple"
v-bind:filterable="item.filterable == null || item.filterable"
v-bind:filterable="item.filterable == null || item.filterable"
...
@@ -132,6 +132,7 @@
...
@@ -132,6 +132,7 @@
<el-button v-bind:icon="item.icon"
<el-button v-bind:icon="item.icon"
v-bind:size="item.size || 'small'"
v-bind:size="item.size || 'small'"
v-bind:type="item.buttonType"
v-bind:type="item.buttonType"
v-bind:loading="$root.loading"
v-bind:disabled="disabled != null ? disabled :(item.disabled == true || javaScript.call(this,item.disabled))">
v-bind:disabled="disabled != null ? disabled :(item.disabled == true || javaScript.call(this,item.disabled))">
{{ item.name || '浏览' }}
{{ item.name || '浏览' }}
</el-button>
</el-button>
...
...
Bailun.DC.Web/wwwroot/js/component/el-form-control.js
View file @
de9dd982
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
visibleChange
(
visible
,
item
)
{
visibleChange
(
visible
,
item
)
{
var
that
=
this
var
that
=
this
if
(
visible
&&
item
.
api
&&
(
!
item
.
listOption
||
item
.
listOption
.
length
<=
1
||
(
that
.
form
&&
item
.
prop
&&
that
.
form
[
item
.
prop
]
&&
Array
.
isArray
(
that
.
form
[
item
.
prop
])
&&
that
.
form
[
item
.
prop
].
length
==
item
.
listOption
.
length
)))
{
if
(
visible
&&
item
.
api
&&
(
!
item
.
listOption
||
item
.
listOption
.
length
<=
1
||
(
that
.
form
&&
item
.
prop
&&
that
.
form
[
item
.
prop
]
&&
Array
.
isArray
(
that
.
form
[
item
.
prop
])
&&
that
.
form
[
item
.
prop
].
length
==
item
.
listOption
.
length
)))
{
that
.
$set
(
that
,
"loading"
,
true
)
var
params
=
{}
var
params
=
{}
if
(
item
.
params
)
{
if
(
item
.
params
)
{
var
form
=
that
.
form
var
form
=
that
.
form
...
@@ -110,6 +111,7 @@
...
@@ -110,6 +111,7 @@
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
,
control
:
"select"
,
url
:
item
.
api
,
url
:
item
.
api
,
params
:
method
==
"get"
?
params
:
null
,
params
:
method
==
"get"
?
params
:
null
,
body
:
method
==
"post"
?
params
:
null
,
body
:
method
==
"post"
?
params
:
null
,
...
@@ -134,8 +136,10 @@
...
@@ -134,8 +136,10 @@
that
.
$set
(
that
,
"item_value"
,
that
.
form
[
item
.
prop
])
that
.
$set
(
that
,
"item_value"
,
that
.
form
[
item
.
prop
])
}
}
}
}
that
.
$set
(
that
,
"loading"
,
false
)
},
function
(
error
)
{
},
function
(
error
)
{
this
.
$message
(
error
.
statusText
||
" 未知错误!"
);
this
.
$message
(
error
.
statusText
||
" 未知错误!"
);
that
.
$set
(
that
,
"loading"
,
false
)
});
});
}
}
},
},
...
...
Bailun.DC.Web/wwwroot/js/vue/vue-interceptors.js
View file @
de9dd982
Vue
.
http
.
interceptors
.
push
(
function
(
request
,
next
,
a
)
{
Vue
.
http
.
interceptors
.
push
(
function
(
request
,
next
,
a
)
{
if
(
request
.
control
!=
"select"
)
{
this
.
$root
.
loadCount
=
(
this
.
$root
.
loadCount
||
0
)
+
1
;
this
.
$root
.
loadCount
=
(
this
.
$root
.
loadCount
||
0
)
+
1
;
if
(
this
.
$root
.
loading
!=
true
)
{
if
(
this
.
$root
.
loading
!=
true
)
{
//打开loading
//打开loading
Vue
.
set
(
this
.
$root
,
"loading"
,
true
);
Vue
.
set
(
this
.
$root
,
"loading"
,
true
);
}
}
}
next
(
function
(
response
)
{
next
(
function
(
response
)
{
if
(
request
.
control
!=
"select"
)
{
//调用完一个接口就进行-1
//调用完一个接口就进行-1
this
.
$root
.
loadCount
--
;
this
.
$root
.
loadCount
--
;
//当接口都调用完时关闭loading
//当接口都调用完时关闭loading
...
@@ -14,5 +17,6 @@
...
@@ -14,5 +17,6 @@
Vue
.
set
(
this
.
$root
,
"loading"
,
false
);
Vue
.
set
(
this
.
$root
,
"loading"
,
false
);
}
}
}
}
}
})
})
});
});
\ No newline at end of file
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