|
@@ -10,11 +10,11 @@
|
|
|
:model="fileForm"
|
|
|
:rules="fileFormRules"
|
|
|
>
|
|
|
- <el-form-item label-width="118px" :label="ChineseEcnglish.document_name" prop="Title">
|
|
|
+ <el-form-item label-width="118px" :label="$t('SemanticsManage.DocumentComparison.document_name')" prop="Title">
|
|
|
<el-input
|
|
|
v-model="fileForm.Title"
|
|
|
style="width: 240px"
|
|
|
- :placeholder="ChineseEcnglish.select_documents_input"
|
|
|
+ :placeholder="$t('SemanticsManage.DocumentComparison.select_documents_input')"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="文档主题" prop="Theme">
|
|
@@ -24,8 +24,8 @@
|
|
|
placeholder="请输入文档主题"
|
|
|
/>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label-width="80px" :label="ChineseEcnglish.select_category" prop="ClassifyId">
|
|
|
- <el-select :placeholder="ChineseEcnglish.please_select_category" v-model="fileForm.ClassifyId">
|
|
|
+ <el-form-item label-width="80px" :label="$t('SemanticsManage.DocumentComparison.select_category')" prop="ClassifyId">
|
|
|
+ <el-select :placeholder="$t('SemanticsManage.DocumentComparison.please_select_category')" v-model="fileForm.ClassifyId">
|
|
|
<el-option
|
|
|
v-for="item in classifyOptions" :key="item.SaDocClassifyId"
|
|
|
:label="item.ClassifyName"
|
|
@@ -41,14 +41,14 @@
|
|
|
<froala :id="`froala-editor-documentContent`"
|
|
|
:ref="`froalaEditorDocumentContent`"
|
|
|
:tag="'textarea'"
|
|
|
- :config="{...froalaConfig,placeholderText:'请输入文章内容'}"
|
|
|
+ :config="{...froalaConfig,placeholderText:$t('SemanticsManage.DocumentComparison.article_content_enter')}"
|
|
|
v-model="documentContent"></froala>
|
|
|
</div>
|
|
|
<div class="document-content page-block-wrap overflow-hide-scrollbar" v-else>
|
|
|
<div class="content-block">
|
|
|
<div class="block-item" v-for="(item,index) in fileBlockArr" :key="index">
|
|
|
<!-- 若段落内有选定文字被打标签 item.UsePartNum 则不允许编辑段落内容 -->
|
|
|
- <textarea v-model="item.innerText" placeholder="请输入段落内容" :disabled="item.UsePartNum!==0"></textarea>
|
|
|
+ <textarea v-model="item.innerText" :placeholder="$t('SemanticsManage.DocumentComparison.paragraph_content_ipt')" :disabled="item.UsePartNum!==0"></textarea>
|
|
|
<div class="block-item-tool">
|
|
|
<div class="add-btn" @click="addBlock(index)">
|
|
|
<img
|
|
@@ -56,7 +56,7 @@
|
|
|
alt=""
|
|
|
style="width: 14px; height: 14px; margin-right: 10px"
|
|
|
/>
|
|
|
- <span>{{ChineseEcnglish.add_next_section}}</span>
|
|
|
+ <span>{{$t('SemanticsManage.DocumentComparison.add_next_section')}}</span>
|
|
|
</div>
|
|
|
<div class="dele-btn" style="margin-left:30px;margin-right:auto;"
|
|
|
v-if="item.UseNum+item.UsePartNum===0" @click="deleteBlock(index)">
|
|
@@ -67,7 +67,7 @@
|
|
|
/>
|
|
|
<span>{{$t('Table.delete_btn')}}</span>
|
|
|
</div>
|
|
|
- <p class="hint-text">{{ChineseEcnglish.number_tags_attached}}:{{item.UseNum+item.UsePartNum}}</p>
|
|
|
+ <p class="hint-text">{{$t('SemanticsManage.DocumentComparison.number_tags_attached')}}:{{item.UseNum+item.UsePartNum}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -88,17 +88,7 @@ export default {
|
|
|
fileForm:{Title:'',/* Theme:'', */ClassifyId:''},//文档信息
|
|
|
classifyOptions:[],//分类列表
|
|
|
fileBlockArr:[],//文档段落列表
|
|
|
- fileFormRules:{
|
|
|
- Title: [
|
|
|
- { required: true, message: "文档名称不能为空"}
|
|
|
- ],
|
|
|
- /* Theme:[
|
|
|
- { required: true, message: "文档主题不能为空"}
|
|
|
- ], */
|
|
|
- ClassifyId:[
|
|
|
- { required: true, message: "请选择文档分类"}
|
|
|
- ]
|
|
|
- },
|
|
|
+
|
|
|
fileId:0,//为0时是新增 不为0时是文档id
|
|
|
};
|
|
|
},
|
|
@@ -143,7 +133,7 @@ export default {
|
|
|
//删除一段
|
|
|
deleteBlock(index){
|
|
|
if(index===0&&this.fileBlockArr.length===1){
|
|
|
- this.$message.warning('请至少保留一段')
|
|
|
+ this.$message.warning(this.$t('SemanticsManage.DocumentComparison.least_one_paragraph_msg') )
|
|
|
return
|
|
|
}
|
|
|
this.fileBlockArr.splice(index,1)
|
|
@@ -154,7 +144,7 @@ export default {
|
|
|
if(!this.checkBlock()) return
|
|
|
//文章有内容
|
|
|
if(!this.fileId&&!this.documentContent.length){
|
|
|
- this.$message.warning('请输入文章内容')
|
|
|
+ this.$message.warning(this.$t('SemanticsManage.DocumentComparison.article_content_enter') )
|
|
|
return
|
|
|
}
|
|
|
let flag = false
|
|
@@ -214,7 +204,7 @@ export default {
|
|
|
checkBlock(){
|
|
|
for(let i=0;i<this.fileBlockArr.length;i++){
|
|
|
if(!this.fileBlockArr[i].innerText.length){
|
|
|
- this.$message.warning('请输入段落内容')
|
|
|
+ this.$message.warning(this.$t('SemanticsManage.DocumentComparison.paragraph_content_ipt') )
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
@@ -226,11 +216,17 @@ export default {
|
|
|
this.getFileData()
|
|
|
this.getClassifyList()
|
|
|
},
|
|
|
- computed:{
|
|
|
- ChineseEcnglish(){
|
|
|
- return this.$t('SemanticsManage.DocumentComparison')
|
|
|
- }
|
|
|
- }
|
|
|
+ computed: {
|
|
|
+ fileFormRules() {
|
|
|
+ return {
|
|
|
+ Title: [{ required: true, message: this.$t('SemanticsManage.DocumentComparison.document_name_no_empty') }],
|
|
|
+ /* Theme:[
|
|
|
+ { required: true, message: "文档主题不能为空"}
|
|
|
+ ], */
|
|
|
+ ClassifyId: [{ required: true, message: this.$t('SemanticsManage.DocumentManagement.select_document_category_msg') }],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|