Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
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
常超
founder_vue
Commits
295f0f20
Commit
295f0f20
authored
Jan 11, 2022
by
lp784568205
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数组排序方式
parent
41d7a0e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
src/views/ajbzDetail.vue
+22
-8
No files found.
src/views/ajbzDetail.vue
View file @
295f0f20
...
@@ -998,15 +998,27 @@ export default {
...
@@ -998,15 +998,27 @@ export default {
axios
.
get
(
`JsonData/CODE_AJXZ.json`
).
then
((
response
)
=>
{
axios
.
get
(
`JsonData/CODE_AJXZ.json`
).
then
((
response
)
=>
{
if
(
response
.
success
===
true
)
{
if
(
response
.
success
===
true
)
{
this
.
laData
=
response
.
data
.
rows
.
filter
((
val
)
=>
{
this
.
laData
=
response
.
data
.
rows
.
filter
((
val
)
=>
{
return
val
.
parentId
==
`
${
this
.
ajzlb
}
0000`
;
if
(
val
.
id
.
indexOf
(
this
.
ajzlb
,
0
)
==
0
)
{
});
return
val
;
response
.
data
.
rows
.
map
((
item
)
=>
{
this
.
laData
.
forEach
((
good
)
=>
{
if
(
good
.
parentId
==
item
.
id
)
{
this
.
laData
.
push
(
good
);
}
}
});
});
});
// response.data.rows.map((item) => {
// this.laData.forEach((good) => {
// if (good.id == item.parentId) {
// this.laData.push(item);
// }
// });
// });
console
.
log
(
this
.
laData
);
function
compare
(
id
)
{
return
function
(
a
,
b
)
{
var
value1
=
a
[
id
];
var
value2
=
b
[
id
];
return
value1
-
value2
;
};
}
this
.
laData
.
sort
(
compare
(
"id"
));
this
.
parentLb
.
id
=
this
.
ajxzlb
;
this
.
parentLb
.
id
=
this
.
ajxzlb
;
}
}
});
});
...
@@ -1193,6 +1205,7 @@ export default {
...
@@ -1193,6 +1205,7 @@ export default {
array
[
1
];
array
[
1
];
},
},
shrHighlight
(
val
)
{
shrHighlight
(
val
)
{
debugger
var
array
=
this
.
jyaq
.
split
(
val
);
var
array
=
this
.
jyaq
.
split
(
val
);
this
.
jyaq
=
this
.
jyaq
=
array
[
0
]
+
array
[
0
]
+
...
@@ -1437,10 +1450,11 @@ export default {
...
@@ -1437,10 +1450,11 @@ export default {
response
.
data
.
rows
.
map
((
item
)
=>
{
response
.
data
.
rows
.
map
((
item
)
=>
{
this
.
laData
.
forEach
((
good
)
=>
{
this
.
laData
.
forEach
((
good
)
=>
{
if
(
good
.
id
==
item
.
parentId
)
{
if
(
good
.
id
==
item
.
parentId
)
{
this
.
laData
.
push
(
item
);
//
this.laData.push(item);
}
}
});
});
});
});
console
.
log
(
this
.
laData
);
}
}
});
});
axios
.
get
(
`JsonData/CODE_AJXLB.json`
).
then
((
response
)
=>
{
axios
.
get
(
`JsonData/CODE_AJXLB.json`
).
then
((
response
)
=>
{
...
...
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