|
@@ -4,13 +4,26 @@
|
|
|
<div class="select-drag-configure">
|
|
|
<span>拼音位置:</span>
|
|
|
<el-radio-group v-model="curQue.pyPosition">
|
|
|
- <el-radio v-for="{type, label} in pyPositionList" :key="type" :label="type">{{ label }}</el-radio>
|
|
|
+ <el-radio
|
|
|
+ v-for="{ type, label } in pyPositionList"
|
|
|
+ :key="type"
|
|
|
+ :label="type"
|
|
|
+ >{{ label }}</el-radio
|
|
|
+ >
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
<!-- 选项 -->
|
|
|
<div class="select-drag-options">
|
|
|
- <div v-for="(item, i) in curQue.options" :key="i" class="select-drag-options-item">
|
|
|
- <sentence-segword-chs :cur-que="item" type="adultinput" :is-hide-py-position="true" />
|
|
|
+ <div
|
|
|
+ v-for="(item, i) in curQue.options"
|
|
|
+ :key="i"
|
|
|
+ class="select-drag-options-item"
|
|
|
+ >
|
|
|
+ <sentence-segword-chs
|
|
|
+ :cur-que="item"
|
|
|
+ type="adultinput"
|
|
|
+ :is-hide-py-position="true"
|
|
|
+ />
|
|
|
<div>
|
|
|
<el-button type="danger" @click="deleteOption(i)">删除</el-button>
|
|
|
</div>
|
|
@@ -20,25 +33,51 @@
|
|
|
</div>
|
|
|
<!-- 句子 -->
|
|
|
<div class="select-drag-sentences">
|
|
|
- <div v-for="(item, i) in curQue.sentences" :key="`sentences-${i}`" class="select-drag-sentences-item">
|
|
|
+ <div
|
|
|
+ v-for="(item, i) in curQue.sentences"
|
|
|
+ :key="`sentences-${i}`"
|
|
|
+ class="select-drag-sentences-item"
|
|
|
+ >
|
|
|
<span>{{ i + 1 }}.</span>
|
|
|
- <div v-for="(x, j) in item" :key="`segmentation-${j}`" class="segmentation">
|
|
|
+ <div
|
|
|
+ v-for="(x, j) in item"
|
|
|
+ :key="`segmentation-${j}`"
|
|
|
+ class="segmentation"
|
|
|
+ >
|
|
|
<div>
|
|
|
<template v-if="x.isSpace">
|
|
|
- <el-input class="space-placeholder" disabled />
|
|
|
+ <!-- <el-input class="space-placeholder" disabled /> -->
|
|
|
+ <span>答案</span>
|
|
|
+ <el-select v-model="x.answer" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="(items, indexs) in curQue.options"
|
|
|
+ :key="indexs"
|
|
|
+ :label="items.sentence"
|
|
|
+ :value="items.sentence"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <sentence-segword-chs :cur-que="x" type="adultinput" :is-hide-py-position="true" />
|
|
|
+ <sentence-segword-chs
|
|
|
+ :cur-que="x"
|
|
|
+ type="adultinput"
|
|
|
+ :is-hide-py-position="true"
|
|
|
+ />
|
|
|
</template>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-button type="danger" @click="deleteSegmentation(i, j)">删除</el-button>
|
|
|
+ <el-button type="danger" @click="deleteSegmentation(i, j)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-button @click="addSentenceSeg(i)">添加分句</el-button>
|
|
|
<el-button @click="addSentenceSeg(i, true)">添加空格</el-button>
|
|
|
- <el-button type="danger" @click="deleteSentenceSeg(i)">删除分句</el-button>
|
|
|
+ <el-button type="danger" @click="deleteSentenceSeg(i)"
|
|
|
+ >删除分句</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -52,7 +91,7 @@ import SentenceSegwordChs from "@/components/Adult/inputModules/SentenceSegwordC
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- SentenceSegwordChs
|
|
|
+ SentenceSegwordChs,
|
|
|
},
|
|
|
props: {
|
|
|
curQue: {
|
|
@@ -64,27 +103,27 @@ export default {
|
|
|
pyPosition: "top",
|
|
|
options: [],
|
|
|
sentences: [],
|
|
|
- isFirst: true
|
|
|
+ isFirst: true,
|
|
|
};
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
changeCurQue: {
|
|
|
type: Function,
|
|
|
- required: true
|
|
|
- }
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
pyPositionList: [
|
|
|
{
|
|
|
type: "top",
|
|
|
- label: "拼音在上"
|
|
|
+ label: "拼音在上",
|
|
|
},
|
|
|
{
|
|
|
type: "bottom",
|
|
|
- label: "拼音在下"
|
|
|
- }
|
|
|
- ]
|
|
|
+ label: "拼音在下",
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -102,19 +141,18 @@ export default {
|
|
|
sentence: "", // 句子
|
|
|
segList: [], // 分词结果
|
|
|
seg_words: "",
|
|
|
- wordsList: []
|
|
|
+ wordsList: [],
|
|
|
});
|
|
|
},
|
|
|
|
|
|
deleteOption(i) {
|
|
|
- this.$confirm("确定要删除吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.curQue.options.splice(i, 1);
|
|
|
- })
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.curQue.options.splice(i, 1);
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
addSentence() {
|
|
@@ -127,7 +165,8 @@ export default {
|
|
|
if (isSpace) {
|
|
|
sentences.push({
|
|
|
isSpace,
|
|
|
- dragList: []
|
|
|
+ answer: "",
|
|
|
+ dragList: [],
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
@@ -140,32 +179,30 @@ export default {
|
|
|
sentence: "", // 句子
|
|
|
segList: [], // 分词结果
|
|
|
seg_words: "",
|
|
|
- wordsList: []
|
|
|
+ wordsList: [],
|
|
|
});
|
|
|
},
|
|
|
|
|
|
deleteSentenceSeg(i) {
|
|
|
- this.$confirm("确定要删除吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.curQue.sentences.splice(i, 1);
|
|
|
- })
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.curQue.sentences.splice(i, 1);
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
deleteSegmentation(i, j) {
|
|
|
- this.$confirm("确定要删除吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.curQue.sentences[i].splice(j, 1);
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.curQue.sentences[i].splice(j, 1);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|