|
|
@@ -22,28 +22,55 @@
|
|
|
<el-button @click="identify(item)">识别</el-button>
|
|
|
</div>
|
|
|
<div class="content-items" v-for="(items, indexs) in item.content_list" :key="indexs">
|
|
|
- <template v-if="items"> <label>内容:</label>{{ items.con }} </template>
|
|
|
+ <template v-if="items">
|
|
|
+ <label>内容:{{ items.con }} </label>
|
|
|
+ <UploadFile
|
|
|
+ v-if="items.type === 'img'"
|
|
|
+ :type="data.type"
|
|
|
+ :file-list="items.file_list"
|
|
|
+ :file-id-list="items.file_id_list"
|
|
|
+ :label-text="'图片'"
|
|
|
+ :accept-file-type="acceptFileType"
|
|
|
+ :index="index"
|
|
|
+ :indexs="indexs"
|
|
|
+ :limit="1"
|
|
|
+ @updateFileList="updateFileList"
|
|
|
+ />
|
|
|
+ <div class="option-item">
|
|
|
+ <span v-if="isEnable(data.property.is_enable_pinyin)">拼音</span>
|
|
|
+ <el-input v-model="items.pinyin" v-if="isEnable(data.property.is_enable_pinyin)"></el-input>
|
|
|
+ <span>答案</span>
|
|
|
+ <el-input v-model="items.answer"></el-input>
|
|
|
+ <span>例子</span>
|
|
|
+ <el-radio-group v-model="items.is_example">
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-button icon="el-icon-plus" style="margin: 24px 0" @click="addElement">增加一个</el-button>
|
|
|
+ <el-button icon="el-icon-plus" style="margin: 10px 0" @click="addElement">增加一个</el-button>
|
|
|
</template>
|
|
|
</ModuleBase>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
+import UploadFile from '../../base/common/UploadFile.vue';
|
|
|
|
|
|
import {
|
|
|
getNewWordTemplateData,
|
|
|
modelList,
|
|
|
answer_list,
|
|
|
getOption,
|
|
|
+ isEnable,
|
|
|
} from '@/views/book/courseware/data/newWordTemplate';
|
|
|
import { GetStaticResources } from '@/api/app';
|
|
|
|
|
|
export default {
|
|
|
name: 'NewWordTemplatePage',
|
|
|
- components: {},
|
|
|
+ components: { UploadFile },
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -51,12 +78,17 @@ export default {
|
|
|
modelList,
|
|
|
answer_list,
|
|
|
getOption,
|
|
|
+ acceptFileType: '.png,.jpg,.jpeg',
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
// 'data.option': 'handleMindMap',
|
|
|
},
|
|
|
methods: {
|
|
|
+ updateFileList({ file_list, file_id_list }, index, indexs) {
|
|
|
+ this.data.option_list[index].content_list[indexs].file_list = file_list;
|
|
|
+ this.data.option_list[index].content_list[indexs].file_id_list = file_id_list;
|
|
|
+ },
|
|
|
// 增加
|
|
|
addElement() {
|
|
|
this.data.option_list.push(getOption());
|
|
|
@@ -107,6 +139,10 @@ export default {
|
|
|
type: 'img',
|
|
|
file_list: [],
|
|
|
file_id_list: [],
|
|
|
+ pinyin: '',
|
|
|
+ shiyi: '',
|
|
|
+ answer: '',
|
|
|
+ is_example: false,
|
|
|
};
|
|
|
} else if (item === '#') {
|
|
|
// 书写
|
|
|
@@ -115,6 +151,10 @@ export default {
|
|
|
type: 'write',
|
|
|
img: '',
|
|
|
base64: '',
|
|
|
+ pinyin: '',
|
|
|
+ shiyi: '',
|
|
|
+ answer: '',
|
|
|
+ is_example: false,
|
|
|
};
|
|
|
} else if (regex.test(item)) {
|
|
|
// 汉字
|
|
|
@@ -131,12 +171,20 @@ export default {
|
|
|
con: item,
|
|
|
type: 'hanzi',
|
|
|
hz_info: hz_list,
|
|
|
+ pinyin: cnchar.spell(item, 'array', 'low', 'tone').join(' '),
|
|
|
+ shiyi: '',
|
|
|
+ answer: '',
|
|
|
+ is_example: false,
|
|
|
};
|
|
|
} else {
|
|
|
// 连字符
|
|
|
objs = {
|
|
|
con: item,
|
|
|
type: 'lian',
|
|
|
+ pinyin: '',
|
|
|
+ shiyi: '',
|
|
|
+ answer: '',
|
|
|
+ is_example: false,
|
|
|
};
|
|
|
}
|
|
|
this.$set(items.content_list, index, objs);
|
|
|
@@ -216,4 +264,32 @@ export default {
|
|
|
max-width: 400px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.content-items {
|
|
|
+ margin: 10px 0;
|
|
|
+
|
|
|
+ label {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 34px;
|
|
|
+ color: #4e5969;
|
|
|
+ }
|
|
|
+
|
|
|
+ .option-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 5px;
|
|
|
+
|
|
|
+ span {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 40px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #4e5969;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-input {
|
|
|
+ max-width: 100px;
|
|
|
+ margin-right: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|