Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
5ddf2473
Commit
5ddf2473
authored
Aug 12, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
978ef702
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
7 deletions
+46
-7
examEdit.vue
src/pages/exam/examEdit.vue
+46
-7
No files found.
src/pages/exam/examEdit.vue
View file @
5ddf2473
...
...
@@ -240,16 +240,16 @@
</strong>
<i
class=
"iconfont icon-edit"
title=
"编辑"
style=
"font-size:18px;margin-right:5px;"
@
click=
"getNameEdit(DataObj.GroupList,gIndex)"
></i>
<i
class=
"iconfont icon-ico_commodity_defaul"
v-if=
"gItem.isShowEdit"
title=
"保存"
style=
"top:0;margin-right:5px;"
@
click=
"saveExamName(DataObj.GroupList)"
></i>
<i
class=
"iconfont icon-shangyi2"
style=
"margin-right:5px;"
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
<i
class=
"iconfont icon-shangyi2"
style=
"margin-right:5px;"
@
click
.
stop=
"MoveFatherItem(gIndex,0)"
v-if=
"gIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveFatherItem(gIndex,1)"
v-if=
"gIndex!=DataObj.GroupList.length-1"
></i>
</div>
<ul
class=
"List-ul"
v-if=
"gItem.DetailsList&&gItem.DetailsList.length>0"
>
<li
class=
""
style=
"cursor:pointer;"
v-for=
"(dItem,dIndex) in gItem.DetailsList"
:key=
"dIndex"
@
click=
"ClickItem(dItem)"
>
{{dIndex+1}}
<span
class=
"exam_DetailList"
@
click=
"ClickItem(dItem)"
v-html=
"dItem.ShowTitle"
></span>
<span
class=
"exam_ListSHow"
>
<i
class=
"iconfont icon-shangyi2"
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-shangyi2"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,0)"
style=
"margin-right:5px;"
v-if=
"dIndex!=0"
></i>
<i
class=
"iconfont icon-xiayi"
@
click
.
stop=
"MoveChildItem(gIndex,dIndex,1)"
v-if=
"dIndex!=gItem.DetailsList.length-1"
></i>
<i
class=
"iconfont icon-shanchu2"
style=
"margin-left:5px;font-size:17px;"
></i>
</span>
</li>
...
...
@@ -452,10 +452,50 @@
this
.
GetPaperInfo
()
},
methods
:
{
//上移下移(IsUp:0上移,1下移)
MoveFatherItem
(
subIndex
,
IsUp
)
{
var
currentItem
=
this
.
DataObj
.
GroupList
[
subIndex
];
//上移
if
(
IsUp
==
0
)
{
if
(
subIndex
>
0
)
{
var
upItem
=
this
.
DataObj
.
GroupList
[
subIndex
-
1
];
this
.
$set
(
this
.
DataObj
.
GroupList
,
subIndex
-
1
,
currentItem
);
this
.
$set
(
this
.
DataObj
.
GroupList
,
subIndex
,
upItem
);
this
.
$forceUpdate
();
}
}
else
{
//下移
if
(
subIndex
!=
this
.
DataObj
.
GroupList
.
length
-
1
)
{
var
downItem
=
this
.
DataObj
.
GroupList
[
subIndex
+
1
];
this
.
$set
(
this
.
DataObj
.
GroupList
,
subIndex
+
1
,
currentItem
);
this
.
$set
(
this
.
DataObj
.
GroupList
,
subIndex
,
downItem
);
this
.
$forceUpdate
();
}
}
},
//移动子项
MoveChildItem
(
Index
,
subIndex
,
IsUp
){
var
currentItem
=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
[
subIndex
];
//上移
if
(
IsUp
==
0
)
{
if
(
subIndex
>
0
)
{
var
upItem
=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
[
subIndex
-
1
];
this
.
$set
(
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
,
subIndex
-
1
,
currentItem
);
this
.
$set
(
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
,
subIndex
,
upItem
);
this
.
$forceUpdate
();
}
}
else
{
//下移
if
(
subIndex
!=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
.
length
-
1
)
{
var
downItem
=
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
[
subIndex
+
1
];
this
.
$set
(
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
,
subIndex
+
1
,
currentItem
);
this
.
$set
(
this
.
DataObj
.
GroupList
[
Index
].
DetailsList
,
subIndex
,
downItem
);
this
.
$forceUpdate
();
}
}
},
//点击修改标题名字和分数
getNameEdit
(
item
,
index
){
console
.
log
(
item
,
'item'
);
console
.
log
(
index
,
'index'
);
item
.
forEach
(
x
=>
{
x
.
isShowEdit
=
false
;
})
...
...
@@ -529,7 +569,6 @@
this
.
DataObj
.
GroupList
.
forEach
(
x
=>
{
x
.
isShowEdit
=
false
;
})
console
.
log
(
"this.DataObj"
,
this
.
DataObj
);
})
},
//点击问题
...
...
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