|
@@ -84,6 +84,77 @@
|
|
|
:is-hide-py-position="true"
|
|
|
/>
|
|
|
</template>
|
|
|
+
|
|
|
+ <template v-else-if="cellData.type === 'mulText'">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">题干部分:</span>
|
|
|
+ <el-button type="primary" @click="setOptionDetail()"
|
|
|
+ >添加句子</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="cellData.mulText.detail.length > 0"
|
|
|
+ style="padding: 10px 0px 10px 86px"
|
|
|
+ >
|
|
|
+ <ul
|
|
|
+ class="option-detail-detail"
|
|
|
+ v-for="(dItem, dIndex) in cellData.mulText.detail"
|
|
|
+ :key="'ddItem' + dIndex"
|
|
|
+ >
|
|
|
+ <li
|
|
|
+ v-for="(ddItem, ddIndex) in dItem.detail"
|
|
|
+ :key="'ddItem' + dIndex + ddIndex"
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ :class="[
|
|
|
+ ddItem.config.wordPadding.indexOf('left') > -1
|
|
|
+ ? 'dleft'
|
|
|
+ : '',
|
|
|
+ ddItem.config.wordPadding.indexOf('right') > -1
|
|
|
+ ? 'dright'
|
|
|
+ : '',
|
|
|
+ !ddItem.sentence ? 'placeholder' : '',
|
|
|
+ ]"
|
|
|
+ >{{ ddItem.sentence }}</span
|
|
|
+ >
|
|
|
+ </li>
|
|
|
+ <i
|
|
|
+ class="el-icon-edit"
|
|
|
+ @click.prevent="
|
|
|
+ setOptionDetail('edit', dItem, dIndex)
|
|
|
+ "
|
|
|
+ style="margin-left: 14px"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ class="el-icon-delete"
|
|
|
+ @click.prevent="deleteOptionDetail(cellData.mulText.detail, dIndex)"
|
|
|
+ style="margin-left: 14px"
|
|
|
+ ></i>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="correct-box">
|
|
|
+ <div
|
|
|
+ style="width: 600px"
|
|
|
+ >
|
|
|
+ <div style="padding-top: 10px">
|
|
|
+ <span style="display: block; margin-bottom: 10px"
|
|
|
+ >句子填空答案:<b style="font-size: 12px"
|
|
|
+ >请输入本题答案,答案用换行符隔开;如果有的输入框没有答案,答案请输入??</b
|
|
|
+ ></span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ v-model="cellData.mulText.correct.completeInput"
|
|
|
+ placeholder="请输入句子填空答案"
|
|
|
+ @blur="onBlur"
|
|
|
+ maxlength="200"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template v-if="cellData.isCross">
|
|
|
<div>勾叉答案</div>
|
|
|
<CrossTick :cellData="cellData" />
|
|
@@ -92,15 +163,30 @@
|
|
|
<div slot="footer">
|
|
|
<el-button type="primary" @click="confirm">确定</el-button>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ title="添加句子"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="addStemVisible"
|
|
|
+ width="50%"
|
|
|
+ >
|
|
|
+ <SentenceSegTemp :detail="optionItemDetail" :segModel="'words'" :type="'config_table'" />
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="addStemVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveOptionDetail">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import SentenceSegwordChs from "@/components/Adult/inputModules/SentenceSegwordChs/index.vue";
|
|
|
import CrossTick from "./CrossTick.vue";
|
|
|
+import SentenceSegTemp from "../../../common/SentenceSegTemp";
|
|
|
|
|
|
export default {
|
|
|
- components: { SentenceSegwordChs, CrossTick },
|
|
|
+ components: { SentenceSegwordChs, CrossTick, SentenceSegTemp },
|
|
|
props: {
|
|
|
visible: {
|
|
|
type: Boolean,
|
|
@@ -138,7 +224,13 @@ export default {
|
|
|
label: "前缀 + 拼音",
|
|
|
value: "prePinyin",
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "多行文本/句子填空",
|
|
|
+ value: "mulText",
|
|
|
+ },
|
|
|
],
|
|
|
+ addStemVisible: false,
|
|
|
+ optionItemDetail: null,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -154,6 +246,67 @@ export default {
|
|
|
confirm() {
|
|
|
this.$emit("close");
|
|
|
},
|
|
|
+ //添加句子
|
|
|
+ setOptionDetail( type, dItem, dIndex) {
|
|
|
+ let _this = this;
|
|
|
+ _this.addStemVisible = true;
|
|
|
+ if (type == "edit") {
|
|
|
+ this.optionItemDetail = JSON.parse(JSON.stringify(dItem));
|
|
|
+ } else {
|
|
|
+ let obj = {
|
|
|
+ hengLeg: -1,
|
|
|
+ detail: [
|
|
|
+ {
|
|
|
+ pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
|
|
|
+ sentence: "", //句子
|
|
|
+ segList: [], //分词结果
|
|
|
+ seg_words: "",
|
|
|
+ wordsList: [],
|
|
|
+ hengList: [],
|
|
|
+ config: {
|
|
|
+ fontSize: "16px",
|
|
|
+ fontColor: "#000",
|
|
|
+ fontFamily: "FZJCGFKTK",
|
|
|
+ wordPadding: [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ fn_check_list: {
|
|
|
+ record_check: "",
|
|
|
+ },
|
|
|
+ };
|
|
|
+ this.optionItemDetail = JSON.parse(JSON.stringify(obj));
|
|
|
+ }
|
|
|
+ this.datailIndex = dIndex;
|
|
|
+ this.detailSelectType = type;
|
|
|
+ },
|
|
|
+ //删除句子
|
|
|
+ deleteOptionDetail(detail, dIndex) {
|
|
|
+ this.$confirm("确定要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ detail.splice(dIndex, 1);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //保存句子
|
|
|
+ saveOptionDetail() {
|
|
|
+ let _this = this;
|
|
|
+ _this.addStemVisible = false;
|
|
|
+ if (_this.detailSelectType == "edit") {
|
|
|
+ let optionItem = JSON.parse(JSON.stringify(_this.optionItemDetail));
|
|
|
+ _this.cellData.mulText.detail[_this.datailIndex] =
|
|
|
+ optionItem;
|
|
|
+ } else {
|
|
|
+ let optionItem = JSON.parse(JSON.stringify(_this.optionItemDetail));
|
|
|
+ _this.cellData.mulText.detail.push(optionItem);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onBlur(item, field) {
|
|
|
+ item[field] = item[field] ? item[field].trim() : "";
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -169,6 +322,26 @@ export default {
|
|
|
width: 70px;
|
|
|
}
|
|
|
}
|
|
|
+.option-detail-detail {
|
|
|
+ clear: both;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ > li {
|
|
|
+ float: left;
|
|
|
+ > span {
|
|
|
+ float: left;
|
|
|
+ &.dleft {
|
|
|
+ padding-left: 4px;
|
|
|
+ }
|
|
|
+ &.dright{
|
|
|
+ padding-right: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > i {
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|