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
ac7eee4a
Commit
ac7eee4a
authored
Apr 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
18ce8843
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
105 deletions
+5
-105
v-matching.vue
src/components/questiontype/v-matching.vue
+5
-105
No files found.
src/components/questiontype/v-matching.vue
View file @
ac7eee4a
...
...
@@ -47,19 +47,14 @@
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex!=index"
@
click=
"changeEdit(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
<div
class=
"InpDIV"
v-html=
"item.Content"
></div>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(0,index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addOption(0)"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
</td>
</tr>
</tfoot>
...
...
@@ -71,19 +66,15 @@
{{
item
.
Name
}}
</td>
<td>
<div
class=
"InpDIV"
v-html=
"item.Content"
v-if=
"commonIndex2!=index"
@
click=
"changeEdit2(index)"
></div>
<UeEditor
v-model=
"item.Content"
:config=
"config"
v-else
></UeEditor>
<div
class=
"InpDIV"
v-html=
"item.Content"
></div>
</td>
<td
style=
"width:40px;text-align:center;"
>
<i
class=
"iconfont icon-guanbi Tiku_DelIcon"
@
click=
"deleteOpion(1,index)"
></i>
</td>
</tr>
<tfoot>
<tr>
<td
colspan=
"3"
>
<a
class=
"addTiMuList"
style=
"margin-left:13px;"
@
click=
"addOption(1)"
>
<i
class=
"iconfont icon-add"
></i>
添加更多
</a>
</td>
</tr>
</tfoot>
...
...
@@ -110,10 +101,6 @@
</div>
</template>
<
script
>
import
{
getOptionList
,
//获取选择标签【A,B,C,D....】
}
from
'../../api/question/questionconfig'
import
UeEditor
from
'../editor/UeEditor'
export
default
{
props
:
{
questionData
:
{
...
...
@@ -129,92 +116,15 @@
data
()
{
return
{
data
:
this
.
questionData
,
config
:
{
initialFrameWidth
:
null
,
initialFrameHeight
:
80
,
},
optionTitleList
:
[],
commonIndex
:
-
1
,
commonIndex2
:
-
1
};
},
computed
:
{
},
created
()
{
this
.
initConfig
();
},
methods
:
{
initConfig
()
{
this
.
optionTitleList
=
getOptionList
();
},
//删除选项
deleteOpion
(
index
,
subIndex
)
{
this
.
$q
.
dialog
({
title
:
'提示信息'
,
message
:
'是否确定删除?'
,
cancel
:
true
,
persistent
:
true
,
ok
:
"确定"
,
cancel
:
"取消"
,
}).
onOk
(()
=>
{
//删除第一组是,也删除答案里面的
if
(
index
==
0
)
{
this
.
data
[
2
].
splice
(
subIndex
,
1
);
}
this
.
data
[
index
].
splice
(
subIndex
,
1
);
//删除的第二组
if
(
index
==
1
)
{
var
temp1
=
this
.
data
[
1
];
this
.
data
[
2
].
forEach
(
item
=>
{
var
isExists
=
false
;
if
(
temp1
&&
temp1
.
length
>
0
)
{
temp1
.
forEach
(
subItem
=>
{
if
(
subItem
.
Name
==
item
.
Content
)
{
isExists
=
true
;
}
})
}
if
(
!
isExists
)
{
item
.
Content
=
""
;
}
})
}
this
.
commonIndex
=
-
1
;
this
.
commonIndex2
=
-
1
;
this
.
calcOptionTitle
();
}).
onCancel
(()
=>
{
});
},
//新增选项
addOption
(
index
)
{
if
(
index
==
0
)
{
this
.
data
[
2
].
push
({
Name
:
""
,
Content
:
"A"
,
});
}
this
.
data
[
index
].
push
({
Name
:
""
,
Content
:
""
,
});
this
.
calcOptionTitle
();
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle
()
{
if
(
this
.
data
&&
this
.
data
.
length
>
0
)
{
this
.
data
.
forEach
((
item
,
index
)
=>
{
item
.
forEach
((
subItem
,
subIndex
)
=>
{
if
(
index
==
0
||
index
==
2
)
{
subItem
.
Name
=
subIndex
+
1
;
}
else
if
(
index
==
1
)
{
subItem
.
Name
=
this
.
optionTitleList
[
subIndex
];
}
})
})
}
},
//返回数据到父组件
returnDataToParent
()
{
this
.
getAnswer
();
...
...
@@ -234,15 +144,6 @@
this
.
setOption
.
Answer
=
answer
;
}
},
//点击切换输入
changeEdit
(
index
)
{
this
.
commonIndex
=
index
;
this
.
commonIndex2
=
-
1
;
},
changeEdit2
(
index
)
{
this
.
commonIndex2
=
index
;
this
.
commonIndex
=
-
1
;
}
},
mounted
()
{},
watch
:
{
...
...
@@ -254,5 +155,4 @@
},
}
};
</
script
>
</
script
>
\ 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