对接文档翻译

This commit is contained in:
qq787203167
2022-07-26 11:24:16 +08:00
parent 663316d75e
commit 34af7e002f
7 changed files with 193 additions and 159 deletions
@@ -26,19 +26,10 @@
<div class="title-text" :title="$t('translationResults')">
<span>{{$t('translationResults')}}</span>
</div>
<a-select :placeholder="$t('PleaseSelect')+$t('translationResults')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="queryParam.translationResult">
<a-select-option v-for="(item, key) in translationResultsList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<j-dict-select-tag class="box-input" v-model="queryParam.translationResult"
:placeholder="$t('PleaseSelect')+$t('translationResults')"
:type="'select'"
:triggerChange="false" dictCode="translation_result"/>
</div>
</a-col>
<template v-if="toggleSearchStatus">
@@ -47,19 +38,10 @@
<div class="title-text" :title="$t('releaseSituation')">
<span>{{$t('releaseSituation')}}</span>
</div>
<a-select :placeholder="$t('PleaseSelect')+$t('releaseSituation')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="queryParam.releaseCondition">
<a-select-option v-for="(item, key) in gatherResultList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
<j-dict-select-tag class="box-input" v-model="queryParam.releaseCondition"
:placeholder="$t('PleaseSelect')+$t('releaseSituation')"
:type="'select'"
:triggerChange="false" dictCode="release_condition"/>
</div>
</a-col>
</template>
@@ -106,12 +88,17 @@
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="viewClick(record)">{{$t('view')}}</a>
<!-- <a class="text-operation" @click="checkClick(record)">{{$t('check')}}</a>-->
<a class="text-operation"
@click="subscribe(record)">
{{!record.state || record.state == 0 ? $t('release') :$t('withdraw')}}
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username"
@click="subscribe(record)">
{{!record.releaseCondition || record.releaseCondition == 'draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation" @click="downloadData(record)">{{$t('download')}}</a>
<a class="text-operation" @click="deleteData(record)">{{$t('delete')}}</a>
<a class="text-operation"
v-if="record.translationResult == 'Translation done'"
@click="downloadData(record)">{{$t('download')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseCondition == 'draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
<div class="page" v-if="dataSource && dataSource.length > 0">
@@ -133,9 +120,11 @@
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import addModel from './components/addModel'
import RetrieveFilesList from './components/RetrieveFilesList'
import eventBUs from '../../../common/event'
import { mapGetters } from 'vuex'
export default {
name: 'index',
@@ -147,8 +136,8 @@
return {
//url传参严格按照当前命名
url: {
list: '',
deleteBatch: ''
list: '/docTranslation/docTranslationEO/page',
deleteBatch: '/docTranslation/docTranslationEO/deleteBatch'
},
toggleSearchStatus: false,
loading: false,
@@ -158,30 +147,7 @@
pageSize: 10,
pageNo: 1,
queryParam: {},
gatherResultList: [
{
value: '1',
name: this.$t('draft')
},
{
value: '2',
name: this.$t('Published')
}
],
translationResultsList: [
{
value: '1',
name: this.$t('Converting')
},
{
value: '2',
name: this.$t('convertNetwork')
},
{
value: '3',
name: this.$t('convertFailed')
}
],
userInfoQuery: {},
columns: [
{
title: this.$t('standard'),
@@ -200,7 +166,7 @@
align: 'center',
width: 170,
ellipsis: true,
dataIndex: 'textStatus'
dataIndex: 'textStatus_dictText'
},
{
title: this.$t('fileName'),
@@ -212,13 +178,13 @@
{
title: this.$t('translationLanguage'),
align: 'center',
dataIndex: 'targetLanguage',
dataIndex: 'targetLanguage_dictText',
width: 170
},
{
title: this.$t('translationResults'),
align: 'center',
dataIndex: 'translationResult',
dataIndex: 'translationResult_dictText',
width: 170
},
{
@@ -233,7 +199,7 @@
align: 'center',
width: 170,
ellipsis: true,
dataIndex: 'releaseCondition'
dataIndex: 'releaseCondition_dictText'
},
{
title: this.$t('operation'),
@@ -247,9 +213,12 @@
},
mounted() {
this.getList()
this.userInfoQuery = this.userInfo()
},
methods: {
...mapGetters(['userInfo']),
addModelForm() {
this.pageNo = 1
this.getList()
},
RetrieveFilesListForm() {
@@ -311,11 +280,34 @@
// checkClick(row) {
//
// },
downloadData() {
downloadData(fileQuery) {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.targetFileId })
},
subscribe() {
subscribe(record) {
let _this = this
this.$confirm({
content: record.releaseCondition == 'draft' ? _this.$t('confirmRelease') : _this.$t('confirmWithdraw'),
onOk() {
let releaseCondition = ''
if (record.releaseCondition == 'draft') {
releaseCondition = 'published'
} else {
releaseCondition = 'draft'
}
let query = {
releaseCondition: releaseCondition,
ids: record.id
}
postAction('/docTranslation/docTranslationEO/updateRleaseConditionBatch', query).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
uploadClick() {
this.$refs.addModelRef.add()
@@ -324,14 +316,33 @@
this.$refs.RetrieveFilesListRef.addModel()
},
BatchDelete() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
deleteData(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()