Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
horse
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
向伟
horse
Commits
e8fbb105
Commit
e8fbb105
authored
Nov 22, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d46f7d80
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
5 deletions
+42
-5
departmentStaff.vue
src/components/common/departmentStaff.vue
+42
-5
No files found.
src/components/common/departmentStaff.vue
View file @
e8fbb105
...
...
@@ -65,7 +65,7 @@
/>
<span
class=
"q-ml-sm"
>
{{ item.Name }}
</span>
</div>
<q-icon
name=
"cancel"
@
click=
"delItem(index)"
></q-icon>
<q-icon
name=
"cancel"
@
click=
"delItem(i
tem.Id,i
ndex)"
></q-icon>
</div>
</div>
</div>
...
...
@@ -86,7 +86,7 @@ interface parmas {
[
key
:
string
]:
any
}
interface
SelectParams
{
Id
:
number
,
Id
:
string
,
Name
:
string
}
export
default
{
...
...
@@ -141,6 +141,7 @@ export default {
setup
(
props
,
ctx
)
{
let
tree
=
ref
<
any
>
(
null
);
let
list
=
ref
<
Array
<
string
>>
([])
let
keys
=
ref
<
Array
<
string
>>
([])
let
selectArray
=
ref
<
Array
<
SelectParams
>>
([])
let
hideDialog
=
()
=>
{
ctx
.
emit
(
"update:modelValue"
,
false
)
...
...
@@ -168,8 +169,42 @@ export default {
},
100
)
}
let
delItem
=
(
i
:
number
)
=>
{
props
.
defaultArray
.
splice
(
i
,
1
)
let
delItemitem
=
(
arr
:
parmas
)
=>
{
console
.
log
(
arr
,
'arr'
)
arr
.
map
(
x
=>
{
if
(
x
.
ChildList
&&
x
.
ChildList
){
delItemitem
(
x
.
ChildList
)
}
else
{
keys
.
value
.
push
(
x
.
newId
)
}
})
}
let
delItemArray
=
(
arr
:
parmas
,
Id
:
string
)
=>
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
){
let
j
=
arr
[
i
]
if
(
j
.
newId
==
Id
){
if
(
j
.
ChildList
&&
j
.
ChildList
.
length
>
0
){
console
.
log
(
j
.
ChildList
)
delItemitem
(
j
.
ChildList
)
}
}
else
{
if
(
j
.
ChildList
&&
j
.
ChildList
.
length
>
0
){
delItemArray
(
j
.
ChildList
,
Id
)
}
}
}
}
let
delItem
=
(
Id
:
string
,
i
:
number
)
=>
{
keys
.
value
=
[]
delItemArray
(
props
.
treeData
,
Id
)
tree
.
value
.
setTicked
(
keys
.
value
,
false
)
selectArray
.
value
.
splice
(
i
,
1
)
}
...
...
@@ -181,7 +216,9 @@ export default {
delItem
,
list
,
getselectArray
,
selectArray
selectArray
,
delItemArray
,
delItemitem
}
}
...
...
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