|
@@ -6,14 +6,28 @@
|
|
</div>
|
|
</div>
|
|
<div class="o_check_box" v-else>
|
|
<div class="o_check_box" v-else>
|
|
<div class="o_child" v-for="(item, index) in checkArray" :key="index">
|
|
<div class="o_child" v-for="(item, index) in checkArray" :key="index">
|
|
- <div class="o_child_title">
|
|
|
|
- <span class="drag"></span>
|
|
|
|
- <span class="title">{{item.content}}</span>
|
|
|
|
|
|
+ <div class="o_child_title" :class="{ active: checkType == index }" @click.stop="setCheckType(index)">
|
|
|
|
+ <span class="drag" v-if="editType == 2"></span>
|
|
|
|
+ <span class="order" v-else>{{ index + 1 }}、</span>
|
|
|
|
+ <span class="icon"
|
|
|
|
+ :class="{ icon_word: item.type == 'word', icon_sentence: item.type == 'sentence', icon_QA: item.type == 'QA' }"></span>
|
|
|
|
+ <span class="title">{{ item.content }}</span>
|
|
<div class="edit_btn">
|
|
<div class="edit_btn">
|
|
- <span class="edit"></span>
|
|
|
|
- <span class="delete"></span>
|
|
|
|
|
|
+ <div class="pic" v-if="editType == 2 && item.img && checkType != index">
|
|
|
|
+ <div class="pic_mask">
|
|
|
|
+ <span class="delete" @click.stop="deleteImg(index)"></span>
|
|
|
|
+ </div>
|
|
|
|
+ <img :src="item.img" alt="">
|
|
|
|
+ </div>
|
|
|
|
+ <span class="edit" v-if="editType == 2 && checkType != index"></span>
|
|
|
|
+ <span :class="{ delete: editType == 2, delete2: editType == 1 }" @click.stop="deleteJ(index)"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="o_edit_box" v-if="checkType == index && editType == 2">
|
|
|
|
+ <qa :cjson="item" v-if="item.type == 'QA'" @setJson="setJson"></qa>
|
|
|
|
+ <sentence :cjson="item" v-if="item.type == 'sentence'" @setJson="setJson"></sentence>
|
|
|
|
+ <word :cjson="item" v-if="item.type == 'word'" @setJson="setJson"></word>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -21,15 +35,26 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import minxin from '../minxins/minxin'
|
|
import minxin from '../minxins/minxin'
|
|
|
|
+import qa from './component/qa2.vue'
|
|
|
|
+import sentence from './component/sentence.vue'
|
|
|
|
+import word from './component/word.vue'
|
|
export default {
|
|
export default {
|
|
mixins: [minxin],
|
|
mixins: [minxin],
|
|
|
|
+ components: {
|
|
|
|
+ qa,
|
|
|
|
+ sentence,
|
|
|
|
+ word,
|
|
|
|
+ },
|
|
props: {
|
|
props: {
|
|
checkJson: {
|
|
checkJson: {
|
|
type: Array,
|
|
type: Array,
|
|
},
|
|
},
|
|
- editType:{
|
|
|
|
|
|
+ editType: {
|
|
type: Number,
|
|
type: Number,
|
|
default: 1
|
|
default: 1
|
|
|
|
+ },
|
|
|
|
+ checkType: {
|
|
|
|
+ type: Number
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
@@ -37,6 +62,23 @@ export default {
|
|
checkArray: []
|
|
checkArray: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ // selectType() {
|
|
|
|
+ // return function (item) {
|
|
|
|
+ // if (item.ttype == 1) {
|
|
|
|
+ // let className = "icon"
|
|
|
|
+ // if (item.type == 'word') {
|
|
|
|
+ // className += " icon_word"
|
|
|
|
+ // } else if (item.type == 'sentence') {
|
|
|
|
+ // className += " icon_sentence"
|
|
|
|
+ // } else if (item.type == 'QA') {
|
|
|
|
+ // className += " icon_QA"
|
|
|
|
+ // }
|
|
|
|
+ // return index + 1 + "、" + (this.editType != '2' ? `<span class='${className}'></span>` : `<span class='${className}'></span>` + item.content);
|
|
|
|
+ // }
|
|
|
|
+ // };
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
watch: {
|
|
watch: {
|
|
checkJson: {
|
|
checkJson: {
|
|
handler: function (newVal, oldVal) {
|
|
handler: function (newVal, oldVal) {
|
|
@@ -45,7 +87,47 @@ export default {
|
|
deep: true,
|
|
deep: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ setCheckType(index) {
|
|
|
|
+ console.log(index);
|
|
|
|
+ let _index = index
|
|
|
|
+ if (this.checkType == index) {
|
|
|
|
+ _index = -1
|
|
|
|
+ }
|
|
|
|
+ this.$emit('update:checkType', _index);
|
|
|
|
+ },
|
|
|
|
+ setJson(val) {
|
|
|
|
+ this.checkArray[this.checkType] = val
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ this.$emit('setJson', this.checkArray)
|
|
|
|
+ },
|
|
|
|
+ deleteJ(index) {
|
|
|
|
+ this.$confirm('确定删除该题目吗?', "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.checkArray.splice(index, 1)
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ this.$emit('setJson', this.checkArray)
|
|
|
|
+ })
|
|
|
|
+ .catch(() => { });
|
|
|
|
+ },
|
|
|
|
+ deleteImg(index){
|
|
|
|
+ this.$confirm('确定删除该题目的图片吗?', "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.checkArray[index].img = ''
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ this.$emit('setJson', this.checkArray)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
this.checkArray = this.depthCopy(this.checkJson);
|
|
this.checkArray = this.depthCopy(this.checkJson);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -57,7 +139,7 @@ export default {
|
|
height: auto;
|
|
height: auto;
|
|
}
|
|
}
|
|
|
|
|
|
-.o_none_box{
|
|
|
|
|
|
+.o_none_box {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 500px;
|
|
height: 500px;
|
|
background: #fff;
|
|
background: #fff;
|
|
@@ -67,16 +149,151 @@ export default {
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
|
|
-.o_none_box > img{
|
|
|
|
|
|
+.o_none_box>img {
|
|
width: 120px;
|
|
width: 120px;
|
|
height: 120px;
|
|
height: 120px;
|
|
object-fit: contain;
|
|
object-fit: contain;
|
|
}
|
|
}
|
|
|
|
|
|
-.o_none_box > span{
|
|
|
|
|
|
+.o_none_box>span {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
color: #00000066;
|
|
color: #00000066;
|
|
margin-top: 15px;
|
|
margin-top: 15px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.o_check_box {
|
|
|
|
+ width: 100%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child {
|
|
|
|
+ width: 100%;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title {
|
|
|
|
+ width: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 38px;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 0 16px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title.active {
|
|
|
|
+ background: #EFF0F1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.drag {
|
|
|
|
+ display: block;
|
|
|
|
+ background-image: url('../../../../assets/icon/test/drag_icon.png');
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ min-width: 16px;
|
|
|
|
+ min-height: 16px;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title.active>.drag {
|
|
|
|
+ background-image: url('../../../../assets/icon/test/drag_icon_active.png');
|
|
|
|
+}
|
|
|
|
+.o_child_title > .title{
|
|
|
|
+ width: 100%;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ max-width: 200px;
|
|
|
|
+}
|
|
|
|
+.o_child_title>.order {
|
|
|
|
+ line-height: 38px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.icon {
|
|
|
|
+ display: block;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ min-width: 16px;
|
|
|
|
+ min-height: 16px;
|
|
|
|
+ margin-right: 8px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.icon.icon_word {
|
|
|
|
+ background-image: url('../../../../assets/icon/englishVoice/icon_check_word.png');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.icon.icon_sentence {
|
|
|
|
+ background-image: url('../../../../assets/icon/englishVoice/icon_check_sentence.png');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.icon.icon_QA {
|
|
|
|
+ background-image: url('../../../../assets/icon/englishVoice/icon_check_qa.png');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn {
|
|
|
|
+ margin-left: auto;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn>.delete,
|
|
|
|
+.o_child_title>.edit_btn>.delete2,
|
|
|
|
+.o_child_title>.edit_btn>.edit {
|
|
|
|
+ display: block;
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
+ min-width: 16px;
|
|
|
|
+ min-height: 16px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ /* margin-right: 8px; */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn>.edit {
|
|
|
|
+ background-image: url('../../../../assets/icon/test/add_edit_icon.png');
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn>.delete {
|
|
|
|
+ background-image: url('../../../../assets/icon/englishVoice/icon_delete.png');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn>.delete2 {
|
|
|
|
+ background-image: url('../../../../assets/icon/test/delete_test_icon2.png');
|
|
|
|
+}
|
|
|
|
+.o_child_title>.edit_btn>.pic{
|
|
|
|
+ width: 50px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ height: 32px;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.o_child_title>.edit_btn>.pic > img{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ object-fit: cover;
|
|
|
|
+}
|
|
|
|
+.o_child_title>.edit_btn>.pic > .pic_mask {
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ background: rgba(0, 0, 0, .3);
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ color: #458dff;
|
|
|
|
+ display: none;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+}
|
|
|
|
+.o_child_title>.edit_btn>.pic:hover > .pic_mask {
|
|
|
|
+ display: flex;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.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>
|