Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

# Conflicts:
#	jero-web/src/common/lang/en-us.js
#	jero-web/src/common/lang/zh-cn.js
This commit is contained in:
zyx.net
2022-07-26 12:24:27 +08:00
11 changed files with 306 additions and 161 deletions
@@ -4,6 +4,8 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.modules.docTranslation.entity.DocTranslationEO; import com.jero.modules.docTranslation.entity.DocTranslationEO;
import com.jero.modules.docTranslation.service.IDocTranslationEOService; import com.jero.modules.docTranslation.service.IDocTranslationEOService;
@@ -162,4 +164,27 @@ public class DocTranslationEOController extends JeroController<DocTranslationEO,
return super.importExcel(request, response, DocTranslationEO.class); return super.importExcel(request, response, DocTranslationEO.class);
} }
/**
* 批量更新文档翻译表发布情况
* @param json
* @return
*/
@AutoLog(value = "文档翻译表-批量更新发布情况")
@ApiOperation(value="文档翻译表-批量更新发布情况", notes="文档翻译表-批量更新发布情况")
@PostMapping(value = "/updateRleaseConditionBatch")
public Result<?> updateRleaseConditionBatch(@RequestBody JSONObject json) {
return this.docTranslationEOService.updateRleaseConditionBatch(json);
}
/**
* 批量更新文档翻译表状态
* @return
*/
@AutoLog(value = "文档翻译表-查询文本状态下拉选项")
@ApiOperation(value="文档翻译表-查询文本状态下拉选项", notes="文档翻译表-查询文本状态下拉选项")
@GetMapping(value = "/queryTextStatusVal")
public Result<?> queryTextStatusVal() {
return this.docTranslationEOService.queryTextStatusVal();
}
} }
@@ -2,6 +2,7 @@ package com.jero.modules.docTranslation.entity;
import java.io.Serializable; import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@@ -73,10 +74,12 @@ public class DocTranslationEO implements Serializable {
private String title; private String title;
/**文本状态*/ /**文本状态*/
@Dict(dicCode = "state") //@Dict(dicCode = "state")
@Excel(name = "文本状态", width = 15) @Excel(name = "文本状态", width = 15)
@ApiModelProperty(value = "文本状态") @ApiModelProperty(value = "文本状态")
private java.lang.String textStatus; private java.lang.String textStatus;
@TableField(exist = false)
private String textStatus_dictText;
/**文件名称*/ /**文件名称*/
@Excel(name = "文件名称", width = 15) @Excel(name = "文件名称", width = 15)
@@ -1,6 +1,8 @@
package com.jero.modules.docTranslation.service; package com.jero.modules.docTranslation.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.modules.docTranslation.entity.DocTranslationEO; import com.jero.modules.docTranslation.entity.DocTranslationEO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@@ -72,4 +74,17 @@ public interface IDocTranslationEOService extends IService<DocTranslationEO> {
* @return * @return
*/ */
IPage<DocTranslationEO> queryPageList(DocTranslationEO docTranslationEO, Integer pageNo, Integer pageSize, String cut, HttpServletRequest req); IPage<DocTranslationEO> queryPageList(DocTranslationEO docTranslationEO, Integer pageNo, Integer pageSize, String cut, HttpServletRequest req);
/**
* 批量更新发布情况
* @param json
* @return
*/
Result<?> updateRleaseConditionBatch(JSONObject json);
/**
* 查询文本状态下拉选项(文档库中,文件类型字段)
* @return
*/
Result<?> queryTextStatusVal();
} }
@@ -1,22 +1,33 @@
package com.jero.modules.docTranslation.service.impl; package com.jero.modules.docTranslation.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.docTranslation.entity.DocTranslationEO; import com.jero.modules.docTranslation.entity.DocTranslationEO;
import com.jero.modules.docTranslation.enums.ReleaseConditionEnum; import com.jero.modules.docTranslation.enums.ReleaseConditionEnum;
import com.jero.modules.docTranslation.enums.TranslationResultEnum; import com.jero.modules.docTranslation.enums.TranslationResultEnum;
import com.jero.modules.docTranslation.mapper.DocTranslationEOMapper; import com.jero.modules.docTranslation.mapper.DocTranslationEOMapper;
import com.jero.modules.docTranslation.service.IDocTranslationEOService; import com.jero.modules.docTranslation.service.IDocTranslationEOService;
import com.jero.modules.docTranslation.utils.TranslationDocumentUtils; import com.jero.modules.docTranslation.utils.TranslationDocumentUtils;
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.entity.OSSFile;
import me.zhyd.oauth.utils.StringUtils;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@@ -34,6 +45,8 @@ import javax.servlet.http.HttpServletRequest;
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class DocTranslationEOServiceImpl extends ServiceImpl<DocTranslationEOMapper, DocTranslationEO> implements IDocTranslationEOService { public class DocTranslationEOServiceImpl extends ServiceImpl<DocTranslationEOMapper, DocTranslationEO> implements IDocTranslationEOService {
@Autowired
private OnlCgformFieldServiceImpl onlCgformFieldService;
/** /**
* 保存 * 保存
* *
@@ -130,6 +143,62 @@ public class DocTranslationEOServiceImpl extends ServiceImpl<DocTranslationEOMap
}); });
}); });
IPage<DocTranslationEO> result = this.page(page, queryWrapper); IPage<DocTranslationEO> result = this.page(page, queryWrapper);
disposeData(result.getRecords(),cut);
return result; return result;
} }
/**
* 处理数据
* @param datas
* @param cut
*/
public void disposeData(List<DocTranslationEO> datas,String cut){
if(CollectionUtils.isNotEmpty(datas)){
for (DocTranslationEO data : datas) {
String textStatus_dictText = "";
OnlCgformField fileTypeField = this.onlCgformFieldService.queryById(data.getTextStatus());
if (ObjectUtil.isNotEmpty(fileTypeField)) {
if (CutEnum.CN.getValue().equals(cut)) {
textStatus_dictText = fileTypeField.getDbFieldTxt();
} else {
textStatus_dictText = fileTypeField.getDbFieldEnName();
}
}
data.setTextStatus_dictText(textStatus_dictText);
}
}
}
@Override
public Result<?> updateRleaseConditionBatch(JSONObject json) {
String ids = json.getString("ids");
// 值对应枚举类 ReleaseConditionEnum 发布published 或撤回draft
String releaseCondition = json.getString("releaseCondition");
if (StringUtils.isNotEmpty(ids)) {
List<DocTranslationEO> docTranslationEOList = new ArrayList<>();
List<String> idList = Arrays.asList(ids.split(","));
idList.forEach(id -> {
DocTranslationEO docTranslationEO = new DocTranslationEO();
docTranslationEO.setId(id);
docTranslationEO.setReleaseCondition(releaseCondition);
docTranslationEOList.add(docTranslationEO);
});
this.updateBatchById(docTranslationEOList);
}
return new Result<>().success("操作成功!");
}
@Override
public Result<?> queryTextStatusVal() {
List<OnlCgformField> fieldList = this.onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
List<OnlCgformField> result = fieldList.stream().filter(field -> {
boolean flag = false;
if(org.apache.commons.lang3.StringUtils.equals(field.getFieldShowType(), FieldTypeEnum.FILE.getValue())){
flag = true;
}
return flag;
}).collect(Collectors.toList());
return Result.OK(result);
}
} }
+1
View File
@@ -1186,6 +1186,7 @@ module.exports = {
translatedText:'Translated Text', translatedText:'Translated Text',
Administrativeprivileges:'Administrativ Pprivileges', Administrativeprivileges:'Administrativ Pprivileges',
Checkthepermissions:'Check The Permissions', Checkthepermissions:'Check The Permissions',
onlyFilesUploaded:'Only.Docx,.Doc files can be uploaded',
selectDirectorylocation: 'Please select the directory location to add the folder', selectDirectorylocation: 'Please select the directory location to add the folder',
Fileuploaded:'File uploaded, please wait', Fileuploaded:'File uploaded, please wait',
uploadedbyyourself:'You can only delete files and data uploaded by yourself', uploadedbyyourself:'You can only delete files and data uploaded by yourself',
+1 -1
View File
@@ -917,7 +917,6 @@ module.exports = {
startMonth: '开始日期', startMonth: '开始日期',
endMonth: '结束日期', endMonth: '结束日期',
Importing: '导入中...', Importing: '导入中...',
Fileuploaded:'文件上传中,请稍后',
projectDeliveryDescription: '工程交付说明', projectDeliveryDescription: '工程交付说明',
cancelConfirm: '取消确认', cancelConfirm: '取消确认',
currentInformation: '当前信息', currentInformation: '当前信息',
@@ -1192,5 +1191,6 @@ module.exports = {
translatedText:'译文', translatedText:'译文',
Administrativeprivileges:'管理权限', Administrativeprivileges:'管理权限',
Checkthepermissions:'查看权限', Checkthepermissions:'查看权限',
onlyFilesUploaded:'只能上传.docx、.doc文件',
uploadedbyyourself:'只能删除自己上传的文件数据', uploadedbyyourself:'只能删除自己上传的文件数据',
} }
+19 -4
View File
@@ -2,7 +2,7 @@
<div> <div>
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title"> <a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
<a-upload-dragger <a-upload-dragger
accept='*.*' :accept='accept'
:disabled="disabled" :disabled="disabled"
class="ant-upload-list" class="ant-upload-list"
:class="{'uploadFile':isUploadFile}" :class="{'uploadFile':isUploadFile}"
@@ -34,7 +34,7 @@
export default { export default {
name: 'file', name: 'file',
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple'], props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads'],
data() { data() {
return { return {
visible: false, visible: false,
@@ -48,7 +48,8 @@
myfileList: [], myfileList: [],
isLoding: false, isLoding: false,
cut: '', cut: '',
multiple: true multiple: true,
accept: ''
} }
}, },
created() { created() {
@@ -67,6 +68,7 @@
if (this.isMultiple) { if (this.isMultiple) {
this.multiple = false this.multiple = false
} }
this.accept = this.restrictUploads ? '.docx,.doc' : '*.*'
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods: { methods: {
@@ -84,10 +86,23 @@
}, },
beforeUpload(file, fileList) { beforeUpload(file, fileList) {
// let thisFileType = this.thisFileType.replace(/\s+/g, ""); // let thisFileType = this.thisFileType.replace(/\s+/g, "");
console.log(file)
this.fileTypeSatus = true this.fileTypeSatus = true
if (this.isMultiple) { if (this.isMultiple) {
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) { if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
this.$message.warning('只能上传一个文件') this.$message.warning(this.$t('onlyOnefileUploaded'))
return false
}
}
if (this.restrictUploads) {
let fileName = file.name
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.docx' || fileSuffix == '.doc') {
} else {
this.$message.warning(this.$t('onlyFilesUploaded'))
return false return false
} }
} }
@@ -42,10 +42,10 @@
<a-table <a-table
:columns="columns" :columns="columns"
rowKey="id" rowKey="id"
:scroll="{x: '100%'}" :scroll="{x: '100%',y:'calc(100vh - 430px)'}"
:data-source="dataList" :data-source="dataList"
:pagination="false" :pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }"
:loading="loading"> :loading="loading">
</a-table> </a-table>
@@ -69,37 +69,21 @@
<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="translationLanguage">
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')" <j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage"
class="box-input-One" @input="handleInput('sourceLanguage')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
allowClear :type="'select'"
v-model="formInline.sourceLanguage"> :triggerChange="false" dictCode="source_language"/>
<a-select-option v-for="(item, key) in LanguageList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
<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="translationLanguageOne">
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')" <j-dict-select-tag class="box-input" v-model="formInline.targetLanguage"
class="box-input-One" @input="handleInput('targetLanguage')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
allowClear :type="'select'"
v-model="formInline.targetLanguage"> :triggerChange="false" dictCode="target_language"/>
<a-select-option v-for="(item, key) in LanguageList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -166,19 +150,19 @@
}, },
{ {
title: this.$t('TextStatus'), title: this.$t('TextStatus'),
dataIndex: 'TextStatus', dataIndex: 'state',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('fileName'), title: this.$t('fileName'),
dataIndex: 'fileName', dataIndex: 'file_name',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
}, },
{ {
title: this.$t('textInformation'), title: this.$t('textInformation'),
dataIndex: 'textInformation', dataIndex: 'text_info',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
} }
@@ -189,19 +173,24 @@
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
fieldList: [], selectedRowKeysRecord: []
queryConditionVOList: []
} }
}, },
mounted() { mounted() {
}, },
methods: { methods: {
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
addModel() { addModel() {
this.visible = true this.visible = true
this.queryParam = {} this.queryParam = {}
this.selectedRowKeys = [] this.selectedRowKeys = []
// this.replacePage() this.replacePage()
}, },
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
@@ -222,13 +211,16 @@
this.replacePage() this.replacePage()
}, },
replacePage() { replacePage() {
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
let query = { let query = {
pageNo: this.pageNo, pageNo: pageNo + '',
pageSize: this.pageSize, pageSize: pageSize + '',
type: 'pdf',
...this.queryParam ...this.queryParam
} }
this.loading = true this.loading = true
postAction('', query).then((res) => { postAction('document/bussDocumentLibraryEO/ocrPageInfo', query).then((res) => {
if (res.success) { if (res.success) {
this.dataList = res.result.records || [] this.dataList = res.result.records || []
this.total = res.result.total this.total = res.result.total
@@ -240,8 +232,15 @@
} }
}) })
}, },
onSelectChange(value) { onSelectChange(value, record) {
this.selectedRowKeys = value this.selectedRowKeys = value
if (this.selectedRowKeys.length > 1) {
this.selectedRowKeys.shift()
}
this.selectedRowKeysRecord = record.filter(res => {
return res.id == this.selectedRowKeys[0]
})
this.selectedRowKeysRecord = [...this.selectedRowKeysRecord]
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
@@ -34,7 +34,7 @@
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('standard')">{{$t('standard')}}</span> <span class="title-text-text" :title="$t('standard')">{{$t('standard')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="standard"> <a-form-model-item class="itemModel" prop="serialNumber">
<a-input class="box-input" <a-input class="box-input"
readonly readonly
v-model="formInline.serialNumber" v-model="formInline.serialNumber"
@@ -49,7 +49,7 @@
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('TextStatus')">{{$t('TextStatus')}}</span> <span class="title-text-text" :title="$t('TextStatus')">{{$t('TextStatus')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="translationResults"> <a-form-model-item class="itemModel" prop="textStatus">
<a-select :placeholder="$t('PleaseSelect')+$t('TextStatus')" <a-select :placeholder="$t('PleaseSelect')+$t('TextStatus')"
class="box-input" class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :getPopupContainer="triggerNode=> triggerNode.parentNode"
@@ -57,9 +57,9 @@
v-model="formInline.textStatus"> v-model="formInline.textStatus">
<a-select-option v-for="(item, key) in translationResultsList" <a-select-option v-for="(item, key) in translationResultsList"
:key="key" :key="key"
:value="item.value"> :value="item.id">
<span style="display: inline-block;width: 100%" :title=" item.name"> <span style="display: inline-block;width: 100%" :title=" item.dbFieldTxt">
{{ item.name }} {{ item.dbFieldTxt }}
</span> </span>
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -72,45 +72,29 @@
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span> <span class="title-text-text" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span>
</div> </div>
<a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="translationLanguage"> <a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="sourceLanguage">
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')" <j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage"
class="box-input" @input="handleInput('sourceLanguage')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
allowClear :type="'select'"
v-model="formInline.sourceLanguage"> :triggerChange="false" dictCode="source_language"/>
<a-select-option v-for="(item, key) in LanguageList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
<span class="text-icon"> <span class="text-icon">
<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" style="width: calc(50% - 20px)" prop="translationLanguageOne"> <a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="targetLanguage">
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')" <j-dict-select-tag class="box-input" v-model="formInline.targetLanguage"
class="box-input" @input="handleInput('targetLanguage')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
allowClear :type="'select'"
v-model="formInline.targetLanguage"> :triggerChange="false" dictCode="target_language"/>
<a-select-option v-for="(item, key) in LanguageList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
</a-modal> </a-modal>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/> <uploadFile ref="uploadFile" :restrictUploads="true" :isMultiple="true" @uploadSuccess="uploadSuccess"/>
<standardData ref="standardDataRef" @standardDataForm="standardDataForm"/> <standardData ref="standardDataRef" @standardDataForm="standardDataForm"/>
</div> </div>
</template> </template>
@@ -140,28 +124,28 @@
trigger: 'change' trigger: 'change'
} }
], ],
standard: [ serialNumber: [
{ {
required: true, required: true,
message: this.$t('standard') + this.$t('cannotEmpty'), message: this.$t('standard') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
], ],
translationResults: [ textStatus: [
{ {
required: true, required: true,
message: this.$t('TextStatus') + this.$t('cannotEmpty'), message: this.$t('TextStatus') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
], ],
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'),
@@ -175,8 +159,18 @@
} }
}, },
mounted() { mounted() {
this.getTextStatus()
}, },
methods: { methods: {
getTextStatus() {
getAction('/docTranslation/docTranslationEO/queryTextStatusVal', {}).then((res) => {
if (res.success) {
this.translationResultsList = res.result || []
} else {
this.translationResultsList = []
}
})
},
add() { add() {
this.visible = true this.visible = true
this.formInline = {} this.formInline = {}
@@ -193,18 +187,16 @@
handleOk() { handleOk() {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
let ids = JSON.parse(JSON.stringify(this.ids))
let query = { let query = {
ids: ids.join(','),
...this.formInline ...this.formInline
} }
this.confirmLoading = true this.confirmLoading = true
postAction(this.url.setBatch, query).then((res) => { postAction('/docTranslation/docTranslationEO/add', query).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.visible = false this.visible = false
this.confirmLoading = false this.confirmLoading = false
this.$emit('batSettingList') this.$emit('addModelForm')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false this.confirmLoading = false
@@ -232,20 +224,36 @@
/** 上传文件的回调 */ /** 上传文件的回调 */
uploadSuccess(data) { uploadSuccess(data) {
let attIdList = [] let attIdList = []
let fileName = []
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
attIdList.push(item.id || data.name) attIdList.push(item.id || data.name)
fileName.push(item.fileName)
}) })
} }
/** 赋值给当前对应的表单文件 */ /** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',') this.formInline[this.uploadName] = attIdList.join(',')
this.formInline.fileName = fileName.join(',')
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.$nextTick(() => {
if (this.formInline[this.uploadName]) {
this.$refs.ruleForm.validateField([this.uploadName])
}
})
}, },
standardClick() { standardClick() {
this.$refs.standardDataRef.addModel() this.$refs.standardDataRef.addModel()
}, },
standardDataForm() { standardDataForm(row) {
this.formInline.serialNumber = row.serial_number
this.formInline.title = row.title
this.formInline.bussDocumentLibraryId = row.id
this.formInline = { ...this.formInline }
this.$nextTick(() => {
if (this.formInline.serialNumber) {
this.$refs.ruleForm.validateField(['serialNumber'])
}
})
} }
} }
} }
@@ -157,7 +157,7 @@
total: 0, total: 0,
fieldList: [], fieldList: [],
queryConditionVOList: [], queryConditionVOList: [],
selectedRowKeysRecord:[], selectedRowKeysRecord: []
} }
}, },
mounted() { mounted() {
@@ -214,12 +214,12 @@
} }
}) })
}, },
onSelectChange(value) { onSelectChange(value,record) {
this.selectedRowKeys = value this.selectedRowKeys = value
if (this.selectedRowKeys.length > 1) { if (this.selectedRowKeys.length > 1) {
this.selectedRowKeys.shift() this.selectedRowKeys.shift()
} }
this.selectedRowKeysRecord = record.filter(res=>{ this.selectedRowKeysRecord = record.filter(res => {
return res.id == this.selectedRowKeys[0] return res.id == this.selectedRowKeys[0]
}) })
this.selectedRowKeysRecord = [...this.selectedRowKeysRecord] this.selectedRowKeysRecord = [...this.selectedRowKeysRecord]
@@ -229,8 +229,7 @@
}, },
handleSubmit() { handleSubmit() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true this.$emit('standardDataForm', this.selectedRowKeysRecord[0])
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.visible = false this.visible = false
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
@@ -26,19 +26,10 @@
<div class="title-text" :title="$t('translationResults')"> <div class="title-text" :title="$t('translationResults')">
<span>{{$t('translationResults')}}</span> <span>{{$t('translationResults')}}</span>
</div> </div>
<a-select :placeholder="$t('PleaseSelect')+$t('translationResults')" <j-dict-select-tag class="box-input" v-model="queryParam.translationResult"
class="box-input" :placeholder="$t('PleaseSelect')+$t('translationResults')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :type="'select'"
allowClear :triggerChange="false" dictCode="translation_result"/>
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>
</div> </div>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <template v-if="toggleSearchStatus">
@@ -47,19 +38,10 @@
<div class="title-text" :title="$t('releaseSituation')"> <div class="title-text" :title="$t('releaseSituation')">
<span>{{$t('releaseSituation')}}</span> <span>{{$t('releaseSituation')}}</span>
</div> </div>
<a-select :placeholder="$t('PleaseSelect')+$t('releaseSituation')" <j-dict-select-tag class="box-input" v-model="queryParam.releaseCondition"
class="box-input" :placeholder="$t('PleaseSelect')+$t('releaseSituation')"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :type="'select'"
allowClear :triggerChange="false" dictCode="release_condition"/>
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>
</div> </div>
</a-col> </a-col>
</template> </template>
@@ -106,12 +88,17 @@
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="viewClick(record)">{{$t('view')}}</a> <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="checkClick(record)">{{$t('check')}}</a>-->
<a class="text-operation" <a class="text-operation"
@click="subscribe(record)"> v-if="record.createBy == userInfoQuery.username"
{{!record.state || record.state == 0 ? $t('release') :$t('withdraw')}} @click="subscribe(record)">
{{!record.releaseCondition || record.releaseCondition == 'draft' ? $t('release') :$t('withdraw')}}
</a> </a>
<a class="text-operation" @click="downloadData(record)">{{$t('download')}}</a> <a class="text-operation"
<a class="text-operation" @click="deleteData(record)">{{$t('delete')}}</a> 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> </span>
</a-table> </a-table>
<div class="page" v-if="dataSource && dataSource.length > 0"> <div class="page" v-if="dataSource && dataSource.length > 0">
@@ -133,9 +120,11 @@
</template> </template>
<script> <script>
import { getAction, postAction } from '@/api/manage' import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import addModel from './components/addModel' import addModel from './components/addModel'
import RetrieveFilesList from './components/RetrieveFilesList' import RetrieveFilesList from './components/RetrieveFilesList'
import eventBUs from '../../../common/event'
import { mapGetters } from 'vuex'
export default { export default {
name: 'index', name: 'index',
@@ -147,8 +136,8 @@
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
list: '', list: '/docTranslation/docTranslationEO/page',
deleteBatch: '' deleteBatch: '/docTranslation/docTranslationEO/deleteBatch'
}, },
toggleSearchStatus: false, toggleSearchStatus: false,
loading: false, loading: false,
@@ -158,30 +147,7 @@
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
queryParam: {}, queryParam: {},
gatherResultList: [ userInfoQuery: {},
{
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')
}
],
columns: [ columns: [
{ {
title: this.$t('standard'), title: this.$t('standard'),
@@ -200,7 +166,7 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'textStatus' dataIndex: 'textStatus_dictText'
}, },
{ {
title: this.$t('fileName'), title: this.$t('fileName'),
@@ -212,13 +178,13 @@
{ {
title: this.$t('translationLanguage'), title: this.$t('translationLanguage'),
align: 'center', align: 'center',
dataIndex: 'targetLanguage', dataIndex: 'targetLanguage_dictText',
width: 170 width: 170
}, },
{ {
title: this.$t('translationResults'), title: this.$t('translationResults'),
align: 'center', align: 'center',
dataIndex: 'translationResult', dataIndex: 'translationResult_dictText',
width: 170 width: 170
}, },
{ {
@@ -233,7 +199,7 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'releaseCondition' dataIndex: 'releaseCondition_dictText'
}, },
{ {
title: this.$t('operation'), title: this.$t('operation'),
@@ -247,9 +213,12 @@
}, },
mounted() { mounted() {
this.getList() this.getList()
this.userInfoQuery = this.userInfo()
}, },
methods: { methods: {
...mapGetters(['userInfo']),
addModelForm() { addModelForm() {
this.pageNo = 1
this.getList() this.getList()
}, },
RetrieveFilesListForm() { RetrieveFilesListForm() {
@@ -311,11 +280,34 @@
// checkClick(row) { // 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() { uploadClick() {
this.$refs.addModelRef.add() this.$refs.addModelRef.add()
@@ -324,14 +316,33 @@
this.$refs.RetrieveFilesListRef.addModel() this.$refs.RetrieveFilesListRef.addModel()
}, },
BatchDelete() { 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) { deleteData(val) {
let _this = this let _this = this
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
onOk() { onOk() {
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
_this.getList() _this.getList()