Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
cb7db6a0
Commit
cb7db6a0
authored
Nov 13, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.mes123.com:zhouyx/mes-ui into product-rjt
parents
84e73337
2c85d4bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
EditGrid.vue
components/page/treeGrid/EditGrid.vue
+17
-9
No files found.
components/page/treeGrid/EditGrid.vue
View file @
cb7db6a0
...
...
@@ -69,11 +69,11 @@
<!-- 多选 -->
<label
v-if=
"column.type === 'selection'"
@
click=
"rowChecked(item, index, $event)"
>
<Checkbox
v-model=
"item._checked"
:indeterminate=
"item._indeterminate"
@
on-change=
"rowChecked($event,item, index,)"
:indeterminate=
"indeterminateBoys(item)"
></Checkbox>
</label>
...
...
@@ -210,7 +210,7 @@
</li>
</ul>
</Drawer>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar"
class=
"ftball"
>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar
&&selectItems.length>0
"
class=
"ftball"
>
<div
class=
"ib"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
<Button
@
click=
"cancelBatch"
>
取消
</Button>
...
...
@@ -357,7 +357,7 @@ export default {
spaceWidth
:
{
//树形表格缩进距离
type
:
Number
,
default
:
20
,
default
:
35
,
},
exportTitle
:
{
type
:
String
,
...
...
@@ -384,6 +384,7 @@ export default {
isDesc
:
true
,
conditions
:
[],
},
level
:
1
,
searchConditions
:
this
.
search
,
pageSizeOpts
:
[
20
,
50
,
100
],
tableHeight
:
0
,
...
...
@@ -420,6 +421,7 @@ export default {
},
watch
:
{
items
()
{
this
.
selectItems
=
[];
if
(
this
.
items
)
{
this
.
trs
=
this
.
treeToList
(
this
.
items
);
}
...
...
@@ -590,9 +592,8 @@ export default {
return
parents
;
},
// 点击check勾选框,判断是否有children节点 如果有就一并勾选
rowChecked
(
data
,
index
,
event
)
{
this
.
$set
(
this
.
trs
,
index
,
data
);
console
.
log
(
"rowChecked"
,
data
,
this
.
trs
[
index
])
rowChecked
(
event
,
data
,
index
,
)
{
this
.
trs
[
index
].
_checked
=
data
.
_checked
;
var
boys
=
this
.
getChildrens
(
data
);
if
(
boys
.
length
>
0
)
{
this
.
trs
.
forEach
((
u
,
i
)
=>
{
...
...
@@ -600,11 +601,10 @@ export default {
return
b
[
this
.
keyname
]
==
u
[
this
.
keyname
];
});
if
(
items
.
length
==
1
)
{
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
!
data
.
_checked
);
this
.
$set
(
this
.
trs
[
i
],
"_checked"
,
data
.
_checked
);
}
});
}
this
.
checkAll
=
this
.
trs
.
length
>
this
.
trs
.
filter
((
u
)
=>
{
...
...
@@ -614,6 +614,14 @@ export default {
this
.
selectionChange
();
});
},
indeterminateBoys
(
item
){
var
boys
=
this
.
getChildrens
(
item
);
if
(
boys
.
length
==
0
){
return
false
;
}
else
{
return
boys
.
filter
(
u
=>
{
return
u
.
_checked
===
item
.
_checked
}).
length
<
boys
.
length
;
}
},
getChildrens
(
data
)
{
var
childrens
=
[];
var
that
=
this
;
...
...
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