|
@@ -49,17 +49,18 @@
|
|
v-model="articleForm.articleEn"
|
|
v-model="articleForm.articleEn"
|
|
@blur="handleTrim('articleForm', 'articleEn')"
|
|
@blur="handleTrim('articleForm', 'articleEn')"
|
|
></el-input> -->
|
|
></el-input> -->
|
|
- <el-form :model="articleRecourseForm" ref="articleResourceForm" label-width="80px" class="registerForm" style="margin-top:16px">
|
|
|
|
|
|
+ <el-form :model="articleRecourseForm" ref="articleResourceForm" label-width="40px" class="registerForm" style="margin-top:16px">
|
|
<el-form-item label="生词" prop="newWordList">
|
|
<el-form-item label="生词" prop="newWordList">
|
|
<el-button type="primary" size="small" plain class="add-btn" @click="handleAddWords()"><i class="el-icon-plus"></i> 添加生词</el-button>
|
|
<el-button type="primary" size="small" plain class="add-btn" @click="handleAddWords()"><i class="el-icon-plus"></i> 添加生词</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <new-word-list :list="wordLit" :colorObj="colorObj" @handleAddWords="handleAddWords"></new-word-list>
|
|
|
|
|
|
+ <new-word-list :list="wordLit" :colorObj="colorObj" @handleAddWords="handleAddWords" v-if="wordLit.length>0"></new-word-list>
|
|
<el-form-item label="短语" prop="newWordList">
|
|
<el-form-item label="短语" prop="newWordList">
|
|
<el-button type="primary" size="small" plain class="add-btn"><i class="el-icon-plus"></i> 添加短语</el-button>
|
|
<el-button type="primary" size="small" plain class="add-btn"><i class="el-icon-plus"></i> 添加短语</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="注释" prop="newWordList">
|
|
<el-form-item label="注释" prop="newWordList">
|
|
<el-button type="primary" size="small" plain class="add-btn" @click="handleAddExplain()"><i class="el-icon-plus"></i> 添加注释</el-button>
|
|
<el-button type="primary" size="small" plain class="add-btn" @click="handleAddExplain()"><i class="el-icon-plus"></i> 添加注释</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <annotation-list class="newWord-list" :list="annotationList" :colorObj="colorObj" @handleAddExplain="handleAddExplain" v-if="annotationList.length>0"></annotation-list>
|
|
<el-form-item label="图片" prop="pictureList">
|
|
<el-form-item label="图片" prop="pictureList">
|
|
<upload :datafileList="articleRecourseForm.pictureList" :changeFillId="handleAvatarSuccess" :uploadType="'image'" :fileName="'pictureList'" :filleNumber="99" tips="支持上传jpg、png格式图片,单张大小不超过2mb" :showList="true" />
|
|
<upload :datafileList="articleRecourseForm.pictureList" :changeFillId="handleAvatarSuccess" :uploadType="'image'" :fileName="'pictureList'" :filleNumber="99" tips="支持上传jpg、png格式图片,单张大小不超过2mb" :showList="true" />
|
|
<ul v-if="articleRecourseForm.pictureList.length>0" class="resource-list">
|
|
<ul v-if="articleRecourseForm.pictureList.length>0" class="resource-list">
|
|
@@ -125,6 +126,16 @@
|
|
v-if="newWordFlag">
|
|
v-if="newWordFlag">
|
|
<new-words @closeDialog="closeDialog" :itemData="newWordObj" :articleId="id||articleId" :vlInfo="vlInfo" :sentenceList="sentenceList"></new-words>
|
|
<new-words @closeDialog="closeDialog" :itemData="newWordObj" :articleId="id||articleId" :vlInfo="vlInfo" :sentenceList="sentenceList"></new-words>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="explainFlag"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ width="510px"
|
|
|
|
+ class="login-dialog"
|
|
|
|
+ v-if="explainFlag">
|
|
|
|
+ <explain @closeDialog="closeDialog" :itemData="explainObj" :articleId="id||articleId" :sentenceList="sentenceList"></explain>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -163,10 +174,12 @@ import { mapState } from 'vuex';
|
|
import { getToken } from '@/utils/auth'
|
|
import { getToken } from '@/utils/auth'
|
|
import NewWords from "./NewWords.vue"
|
|
import NewWords from "./NewWords.vue"
|
|
import NewWordList from './components/NewWordList.vue';
|
|
import NewWordList from './components/NewWordList.vue';
|
|
|
|
+import Explain from "./Explain.vue"
|
|
|
|
+import AnnotationList from './components/AnnotationList.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
//import引入的组件需要注入到对象中才能使用
|
|
//import引入的组件需要注入到对象中才能使用
|
|
- components: { Header, Breadcrumb, Editor, Upload, NewWords, NewWordList },
|
|
|
|
|
|
+ components: { Header, Breadcrumb, Editor, Upload, NewWords, NewWordList, Explain, AnnotationList },
|
|
props: {},
|
|
props: {},
|
|
data() {
|
|
data() {
|
|
//这里存放数据
|
|
//这里存放数据
|
|
@@ -298,7 +311,8 @@ export default {
|
|
audiobg:'#FFFFFF',
|
|
audiobg:'#FFFFFF',
|
|
audioBorder:'#EBEBEB'
|
|
audioBorder:'#EBEBEB'
|
|
},
|
|
},
|
|
- wordLit:[]
|
|
|
|
|
|
+ wordLit:[],
|
|
|
|
+ annotationList: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
@@ -555,6 +569,9 @@ export default {
|
|
this.wordLit.push(obj)
|
|
this.wordLit.push(obj)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ if(res.data.art.art_explain_data&&res.data.art.art_explain_data.length>0){
|
|
|
|
+ this.annotationList = res.data.art.art_explain_data
|
|
|
|
+ }
|
|
this.subtitleLoading = false
|
|
this.subtitleLoading = false
|
|
}
|
|
}
|
|
}).catch(()=>{
|
|
}).catch(()=>{
|
|
@@ -578,11 +595,16 @@ export default {
|
|
// 添加注释
|
|
// 添加注释
|
|
handleAddExplain(obj){
|
|
handleAddExplain(obj){
|
|
if(obj){
|
|
if(obj){
|
|
- this.newWordObj = obj
|
|
|
|
|
|
+ this.explainObj = obj
|
|
|
|
+ this.explainFlag = true
|
|
}else{
|
|
}else{
|
|
- this.newWordObj = null
|
|
|
|
|
|
+ if(this.id||this.articleId){
|
|
|
|
+ this.explainObj = null
|
|
|
|
+ this.explainFlag = true
|
|
|
|
+ }else{
|
|
|
|
+ this.handleSaveArticle('articleForm','explain')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- this.newWordFlag = true
|
|
|
|
},
|
|
},
|
|
closeDialog(flag){
|
|
closeDialog(flag){
|
|
this[flag] = false
|
|
this[flag] = false
|