对接文档翻译

This commit is contained in:
qq787203167
2022-07-26 16:43:04 +08:00
parent 4d523eddd8
commit 87de9dabe5
2 changed files with 28 additions and 8 deletions
@@ -42,7 +42,7 @@
<a-table <a-table
:columns="columns" :columns="columns"
rowKey="id" rowKey="id"
:scroll="{x: '100%',y:'calc(100vh - 430px)'}" :scroll="{x: '100%',y:'calc(100vh - 440px)'}"
:data-source="dataList" :data-source="dataList"
:pagination="false" :pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }"
@@ -68,7 +68,7 @@
<span class="Required-One">*</span> <span class="Required-One">*</span>
<span class="title-text-text-One" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span> <span class="title-text-text-One" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span>
</div> </div>
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="translationLanguage"> <a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="sourceLanguage">
<j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage" <j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage"
@input="handleInput('sourceLanguage')" @input="handleInput('sourceLanguage')"
:placeholder="$t('PleaseSelect')+$t('translationLanguage')" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
@@ -78,7 +78,7 @@
<span class="text-icon-One"> <span class="text-icon-One">
<a-icon type="arrow-right" style="font-size: 20px"/> <a-icon type="arrow-right" style="font-size: 20px"/>
</span> </span>
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="translationLanguageOne"> <a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="targetLanguage">
<j-dict-select-tag class="box-input" v-model="formInline.targetLanguage" <j-dict-select-tag class="box-input" v-model="formInline.targetLanguage"
@input="handleInput('targetLanguage')" @input="handleInput('targetLanguage')"
:placeholder="$t('PleaseSelect')+$t('translationLanguage')" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
@@ -111,14 +111,14 @@
selectedRowKeys: [], selectedRowKeys: [],
formInline: {}, formInline: {},
rules: { rules: {
translationLanguage: [ sourceLanguage: [
{ {
required: true, required: true,
message: this.$t('translationLanguage') + this.$t('cannotEmpty'), message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
], ],
translationLanguageOne: [ targetLanguage: [
{ {
required: true, required: true,
message: this.$t('translationLanguage') + this.$t('cannotEmpty'), message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
@@ -191,6 +191,9 @@
this.queryParam = {} this.queryParam = {}
this.selectedRowKeys = [] this.selectedRowKeys = []
this.replacePage() this.replacePage()
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
}, },
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
@@ -216,7 +219,7 @@
let query = { let query = {
pageNo: pageNo + '', pageNo: pageNo + '',
pageSize: pageSize + '', pageSize: pageSize + '',
type: 'pdf', type: 'doc',
...this.queryParam ...this.queryParam
} }
this.loading = true this.loading = true
@@ -249,9 +252,25 @@
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
let query = {
...this.formInline,
serialNumber: this.selectedRowKeysRecord[0].serial_number,
title: this.selectedRowKeysRecord[0].title,
fileName: this.selectedRowKeysRecord[0].file_name,
textStatus: this.selectedRowKeysRecord[0].text_info_id
}
this.confirmLoading = true this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) postAction('/docTranslation/docTranslationEO/add', query).then((res) => {
this.visible = false if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('RetrieveFilesListForm')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
} }
}) })
} else { } else {
@@ -222,6 +222,7 @@
this.getList() this.getList()
}, },
RetrieveFilesListForm() { RetrieveFilesListForm() {
this.pageNo = 1
this.getList() this.getList()
}, },
handleToggleSearch() { handleToggleSearch() {