|
@@ -13,7 +13,8 @@
|
|
|
:class="{ icon_word: item.type == 'word', icon_sentence: item.type == 'sentence', icon_QA: item.type == 'QA', icon_theme: item.type == 'theme', icon_createRole: item.type == 'createRole' }"></span>
|
|
|
<span class="title">{{ getTitle(item) }}</span>
|
|
|
<div class="edit_btn">
|
|
|
- <button class="c_pub_button_add" @click.stop="openTest(item)" style="margin-right: 15px;" v-if="editType == 2 && item.type == 'createRole' && checkType != index">角色测试</button>
|
|
|
+ <button class="c_pub_button_add" @click.stop="openTest(item)" style="margin-right: 15px;"
|
|
|
+ v-if="editType == 2 && item.type == 'createRole' && checkType != index">角色测试</button>
|
|
|
<div class="pic" v-if="editType == 2 && item.img && checkType != index">
|
|
|
<div class="pic_mask">
|
|
|
<span class="delete" @click.stop="deleteImg(index)"></span>
|
|
@@ -90,19 +91,19 @@ export default {
|
|
|
// }
|
|
|
// };
|
|
|
// },
|
|
|
- getTitle(){
|
|
|
- return function(item){
|
|
|
- if(item.type == 'word' && !item.content){
|
|
|
+ getTitle() {
|
|
|
+ return function (item) {
|
|
|
+ if (item.type == 'word' && !item.content) {
|
|
|
return '单词/词组'
|
|
|
- }else if(item.type == 'sentence' && !item.content){
|
|
|
+ } else if (item.type == 'sentence' && !item.content) {
|
|
|
return '句子/短文'
|
|
|
- } else if(item.type == 'QA' && !item.content){
|
|
|
+ } else if (item.type == 'QA' && !item.content) {
|
|
|
return '问题'
|
|
|
- } else if(item.type == 'theme' && !item.content){
|
|
|
+ } else if (item.type == 'theme' && !item.content) {
|
|
|
return '主题陈述'
|
|
|
- } else if(item.type == 'createRole' && !item.content){
|
|
|
+ } else if (item.type == 'createRole' && !item.content) {
|
|
|
return '角色对话'
|
|
|
- } else{
|
|
|
+ } else {
|
|
|
return item.content
|
|
|
}
|
|
|
}
|
|
@@ -143,7 +144,7 @@ export default {
|
|
|
})
|
|
|
.catch(() => { });
|
|
|
},
|
|
|
- deleteImg(index){
|
|
|
+ deleteImg(index) {
|
|
|
this.$confirm('确定删除该题目的图片吗?', "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -155,7 +156,22 @@ export default {
|
|
|
this.$emit('setJson', this.checkArray)
|
|
|
})
|
|
|
},
|
|
|
- openTest(json){
|
|
|
+ openTest(json) {
|
|
|
+ if (json.content == '') {
|
|
|
+ this.$message.error(`请输入角色名字`);
|
|
|
+ type = 2
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (json.content2 == '') {
|
|
|
+ this.$message.error(`请输入角色定义`);
|
|
|
+ type = 2
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (json.content3 == '') {
|
|
|
+ this.$message.error(`请输入角色问候`);
|
|
|
+ type = 2
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.dataDialog = true
|
|
|
this.Json = json
|
|
|
}
|
|
@@ -229,13 +245,15 @@ export default {
|
|
|
.o_child_title.active>.drag {
|
|
|
background-image: url('../../../../assets/icon/test/drag_icon_active.png');
|
|
|
}
|
|
|
-.o_child_title > .title{
|
|
|
+
|
|
|
+.o_child_title>.title {
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
max-width: 200px;
|
|
|
}
|
|
|
+
|
|
|
.o_child_title>.order {
|
|
|
line-height: 38px;
|
|
|
}
|
|
@@ -297,22 +315,24 @@ export default {
|
|
|
.o_child_title>.edit_btn>.delete2 {
|
|
|
background-image: url('../../../../assets/icon/test/delete_test_icon2.png');
|
|
|
}
|
|
|
-.o_child_title>.edit_btn>.pic{
|
|
|
+
|
|
|
+.o_child_title>.edit_btn>.pic {
|
|
|
width: 50px;
|
|
|
- overflow: hidden;
|
|
|
- height: 32px;
|
|
|
- margin-right: 15px;
|
|
|
- border-radius: 5px;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ height: 32px;
|
|
|
+ margin-right: 15px;
|
|
|
+ border-radius: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
|
|
|
-.o_child_title>.edit_btn>.pic > img{
|
|
|
+.o_child_title>.edit_btn>.pic>img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|
|
|
}
|
|
|
-.o_child_title>.edit_btn>.pic > .pic_mask {
|
|
|
+
|
|
|
+.o_child_title>.edit_btn>.pic>.pic_mask {
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
@@ -325,16 +345,16 @@ export default {
|
|
|
display: none;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
-.o_child_title>.edit_btn>.pic:hover > .pic_mask {
|
|
|
+
|
|
|
+.o_child_title>.edit_btn>.pic:hover>.pic_mask {
|
|
|
display: flex;
|
|
|
}
|
|
|
|
|
|
-.o_child_title>.edit_btn>.pic > .pic_mask > .delete{
|
|
|
+.o_child_title>.edit_btn>.pic>.pic_mask>.delete {
|
|
|
width: 15px;
|
|
|
height: 15px;
|
|
|
background-image: url('../../../../assets/icon/englishVoice/icon_delete2.png');
|
|
|
background-size: 100% 100%;
|
|
|
display: block;
|
|
|
cursor: pointer;
|
|
|
-}
|
|
|
-</style>
|
|
|
+}</style>
|