修改禅道已知bug

This commit is contained in:
范强强
2022-09-02 18:27:43 +08:00
parent bb6b238ec9
commit 0931166532
6 changed files with 537 additions and 501 deletions
@@ -106,7 +106,7 @@
}
},
mounted() {
eventBUs.$on('searchQuery', search => {
eventBUs.$on('searchQueryOne', search => {
Object.keys(search).forEach(res => {
if (search[res] instanceof Array) {
search[res] = search[res].join(',')
@@ -116,7 +116,7 @@
this.getData()
this.getTableList()
})
eventBUs.$on('searchReset', target => {
eventBUs.$on('searchResetOne', target => {
this.searchParmes = {}
this.selectedRowKeys = []
this.getData()
@@ -126,8 +126,8 @@
this.getTableList()
},
beforeDestroy(){
eventBUs.$off('searchQuery')
eventBUs.$off('searchReset')
eventBUs.$off('searchQueryOne')
eventBUs.$off('searchResetOne')
},
methods: {
@@ -179,11 +179,11 @@ export default {
},
methods: {
searchQuery() {
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
eventBUs.$emit('searchQueryOne', JSON.parse(JSON.stringify(this.queryParam)))
},
searchReset() {
this.queryParam = {}
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
eventBUs.$emit('searchQueryOne', JSON.parse(JSON.stringify(this.queryParam)))
},
getSeach() {
let params = {
@@ -96,10 +96,10 @@
{{!record.releaseStatus || record.releaseStatus == 'Draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
v-if="record.releaseStatus == 'Draft'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
v-if="record.releaseStatus == 'Draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
@@ -279,8 +279,7 @@
let idList = []
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if (selectedRowKeysRecord[i].createBy == _this.userInfo().username &&
selectedRowKeysRecord[i].releaseStatus == 'Draft') {
if (selectedRowKeysRecord[i].releaseStatus == 'Draft') {
idList.push(selectedRowKeysRecord[i].id)
}
}
@@ -1,39 +1,39 @@
<template>
<div class="splitting">
<a-card :bordered="false">
<div class="splitting-search-wrapper">
<searchalonesplit :flag="'3'" :url="url" :searchalonesplit='serialnumber'/>
</div>
<div class="table-operator">
<div class="operator-text" @click="handleModule" v-has="'split:sarFileSplitInfo:splitFile'">
<a-icon type="plus" />
{{ $t('SplitText') }}
</div>
<div class="operator-text" @click="handleExport" v-has="'split:sarFileSplitInfo:splitResult'">
<a-icon type="export" />
{{ $t('ImportResults') }}
</div>
<div class="operator-text" @click="handleDel" v-has="'split:sarFileSplitInfo:deleteBatch'">
<a-icon type="delete" />
{{ $t('BatchDelete') }}
</div>
<div class="splitting">
<a-card :bordered="false">
<div class="splitting-search-wrapper">
<searchalonesplit :flag="'3'" :url="url" :searchalonesplit='serialnumber'/>
</div>
<div class="table-operator">
<div class="operator-text" @click="handleModule" v-has="'split:sarFileSplitInfo:splitFile'">
<a-icon type="plus"/>
{{ $t('SplitText') }}
</div>
<div class="splitting-table">
<table-data
:url="url"
:flag="'3'"
:OperationList="OperationList"
showAction
@onSelectChange="onSelectChange"
@backDocument="backDocument"
@deleteDetail="deleteDetail"
@detailClick="detailClick"
></table-data>
<div class="operator-text" @click="handleExport" v-has="'split:sarFileSplitInfo:splitResult'">
<a-icon type="export"/>
{{ $t('ImportResults') }}
</div>
<split-text v-if="splitVisible" :splitVisible="splitVisible" @visible="sVisible"></split-text>
<import-result v-if="importsVisible" :importsVisible="importsVisible" @visible="iVisible"></import-result>
</a-card>
</div>
<div class="operator-text" @click="handleDel" v-has="'split:sarFileSplitInfo:deleteBatch'">
<a-icon type="delete"/>
{{ $t('BatchDelete') }}
</div>
</div>
<div class="splitting-table">
<table-data
:url="url"
:flag="'3'"
:OperationList="OperationList"
showAction
@onSelectChange="onSelectChange"
@backDocument="backDocument"
@deleteDetail="deleteDetail"
@detailClick="detailClick"
></table-data>
</div>
<split-text v-if="splitVisible" :splitVisible="splitVisible" @visible="sVisible"></split-text>
<import-result v-if="importsVisible" :importsVisible="importsVisible" @visible="iVisible"></import-result>
</a-card>
</div>
</template>
<script>
@@ -55,51 +55,51 @@
SplitText,
ImportResult
},
data(){
return{
splitVisible:false,
importsVisible:false,
selectedRowKeys:[],
loading:false,
total:0,
ids:[],
tableData:[],
columns:[
data() {
return {
splitVisible: false,
importsVisible: false,
selectedRowKeys: [],
loading: false,
total: 0,
ids: [],
tableData: [],
columns: [
{
title: this.$t('standard'),
align: "center",
dataIndex: 'serialNumber',
align: 'center',
dataIndex: 'serialNumber'
},
{
title: this.$t('title'),
align: "center",
dataIndex: 'title',
align: 'center',
dataIndex: 'title'
},
{
title: this.$t('TextStatus'),
align: "center",
dataIndex: 'fileType_dictText',
align: 'center',
dataIndex: 'fileType_dictText'
},
{
title: this.$t('fileName'),
align: "center",
align: 'center',
dataIndex: 'fileName'
},
{
title: this.$t('splitTime'),
align: "center",
align: 'center',
dataIndex: 'createTime'
},
{
title: this.$t('splitResult'),
align: "center",
align: 'center',
dataIndex: 'splitResult_dictText'
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
scopedSlots: { customRender: 'action' },
align: 'center',
width: 170
}
],
@@ -117,69 +117,67 @@
ClickEvent: 'deleteDetail'
} //删除
],
url:{
url: {
tableHeader: 'split/sarFileSplitInfo/getHeader', //表格头部字段
seachList: 'split/sarFileSplitInfo/queryCondition', //搜索字段
tableList: 'split/sarFileSplitInfo/page', //表格数据
tableList: 'split/sarFileSplitInfo/page' //表格数据
// getAddForm: 'ocr/ocrRecord/getForm', // 表单的字段
// addInfo: 'ocr/OcrRestful/addOcrRecord', //新增
},
queryParams:{
pageNo:1,
pageSize:10
queryParams: {
pageNo: 1,
pageSize: 10
},
token:Vue.ls.get(ACCESS_TOKEN),
serialnumber: '',
token: Vue.ls.get(ACCESS_TOKEN),
serialnumber: ''
}
},
props:{
},
props: {},
created() {
},
mounted() {
if(this.$route.query.serial_number !== undefined) {
if (this.$route.query.serial_number !== undefined) {
this.serialnumber = this.$route.query.serial_number
}
},
methods:{
methods: {
//获取列表数据
loadData(){
this.loading=true
let params={
loadData() {
this.loading = true
let params = {
...this.queryParams
}
getAction(`split/sarFileSplitInfo/page`,params).then(res=>{
if(res.success){
getAction(`split/sarFileSplitInfo/page`, params).then(res => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length == 0) {
this.queryParams.pageNo = res.result.current - 1
this.loadData()
return
}
this.tableData=[...res.result.records]
this.loading=false
this.total=res.result.total
}else{
this.loading=false
this.tableData = [...res.result.records]
this.loading = false
this.total = res.result.total
} else {
this.loading = false
}
})
},
//拆分已入库文本
handleModule(){
this.splitVisible=true
handleModule() {
this.splitVisible = true
},
//导入拆分结果
handleExport(){
this.importsVisible=true
handleExport() {
this.importsVisible = true
},
//批量删除
handleDel(){
let params={
ids:this.selectedRowKeys.join(',')
handleDel() {
let params = {
ids: this.selectedRowKeys.join(',')
}
if(this.selectedRowKeys&&this.selectedRowKeys.length>0){
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$confirm({
title: this.$t('ConfirmDelete'),
content: '',
@@ -192,7 +190,7 @@
url: '/jero-boot/split/sarFileSplitInfo/deleteBatch',
method: 'post',
data: params,
transformRequest: [function (data) {
transformRequest: [function(data) {
// Do whatever you want to transform the data
let ret = ''
for (let it in data) {
@@ -202,31 +200,30 @@
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':this.token
'X-Access-Token': this.token
}
}).then(res => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
// if(this.selectedRowKeys&&this.selectedRowKeys.length==this.tableData.length){
// this.queryParams.pageNo=this.queryParams.pageNo-1
// }
this.selectedRowKeys=[]
eventBUs.$emit('searchGetData')
// this.loadData()
}else{
this.$message.success(this.$t('OperationSuccessful'))
// if(this.selectedRowKeys&&this.selectedRowKeys.length==this.tableData.length){
// this.queryParams.pageNo=this.queryParams.pageNo-1
// }
this.selectedRowKeys = []
eventBUs.$emit('searchGetData')
// this.loadData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
}
else{
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//删除
deleteDetail(val){
deleteDetail(val) {
this.$confirm({
content: this.$t('confirmDeletion'),
onOk:
@@ -247,81 +244,80 @@
})
},
sVisible(val){
this.splitVisible=val
sVisible(val) {
this.splitVisible = false
},
iVisible(val){
this.importsVisible=val
iVisible(val) {
this.importsVisible = val
},
//查询
searchQuery(){
searchQuery() {
},
//清空
searchReset(){
searchReset() {
},
onSelectChange(selKeys){
this.selectedRowKeys=selKeys
onSelectChange(selKeys) {
this.selectedRowKeys = selKeys
},
handleTableChange(){
handleTableChange() {
},
//点击页数
onChangePage(page,pageSize){
onChangePage(page, pageSize) {
this.queryParams.pageNo = page
this.$emit('queryParams',this.queryParams)
this.$emit('queryParams', this.queryParams)
},
//一页显示条数
SizeChange(page,pageSize){
SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize
this.queryParams.pageNo = 1
this.$emit('queryParams',this.queryParams)
this.$emit('queryParams', this.queryParams)
},
//回传至文档库
backDocument(val){
backDocument(val) {
this.$confirm({
content: this.$t('backDocument'),
onOk:
async () =>
{
let params={
id:val.id,
fileName:val.fileName,
connectId:val.connectId
onOk:
async () => {
let params = {
id: val.id,
fileName: val.fileName,
connectId: val.connectId
}
axios({
url: '/jero-boot/split/sarFileSplitInfo/bindToDocumentLibrary',
method: 'get',
params: params,
headers: {
// 'Content-Type': 'multipart/form-data',
'X-Access-Token': this.token
}
axios({
url: '/jero-boot/split/sarFileSplitInfo/bindToDocumentLibrary',
method: 'get',
params:params,
headers: {
// 'Content-Type': 'multipart/form-data',
'X-Access-Token':this.token
}
}).then(res => {
// console.log('res,res',res)
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchGetData')
} else {
this.$message.warning(res.data.message)
}
})
}).then(res => {
// console.log('res,res',res)
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchGetData')
} else {
this.$message.warning(res.data.message)
}
})
}
})
},
//查看
detailClick(val){
detailClick(val) {
this.$router.push({
path:'/docManage/splitting/splitDetail',
path: '/docManage/splitting/splitDetail',
query: {
infoId:val.id,
infoNumber:val.serialNumber,
createBy:val.createBy
infoId: val.id,
infoNumber: val.serialNumber,
createBy: val.createBy
}
})
},
}
}
}
@@ -332,20 +328,22 @@
</style>
<style lang="less" scoped>
.splitting{
.splitting-search-wrapper {
margin-bottom: 20px;
.splitting {
.splitting-search-wrapper {
margin-bottom: 20px;
}
.splitting-table{
.action-margin{
margin-right: 10px;
}
.splitting-table {
.action-margin {
margin-right: 10px;
}
}
}
}
.splitting-table{
.page{
.splitting-table {
.page {
margin-top: 20px;
text-align: right;
}
@@ -360,7 +358,8 @@
display: flex;
}
}
.ant-col-sm-8{
.ant-col-sm-8 {
min-width: 300px;
}
}
@@ -16,12 +16,13 @@
</div>
<div class="table-operator">
<div class="operator-text">
<!-- <a-icon type="copy" />-->
<!-- 拆分文件-->
<split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'" @uploadSuccess="uploadSuccess"></split-upload>
<!-- <a-icon type="copy" />-->
<!-- 拆分文件-->
<split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'"
@uploadSuccess="uploadSuccess"></split-upload>
</div>
<div class="operator-text" @click="downLoad" v-has="'split:sarFileSplitItems:template'">
<a-icon type="download" />
<a-icon type="download"/>
{{$t('templateDownload')}}
</div>
</div>
@@ -38,8 +39,12 @@
<div class="imports-footer" style='display: flex;justify-content: flex-end'>
<div class="imports-footer-wrap">
<a-button class="imports-btn" style='background-color: #f5222d;border: none;margin-right: 15px' type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit" v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('submit')}}</a-button>
<a-button class="imports-btn" style='background-color: #f5222d;border: none;margin-right: 15px' type="primary"
@click="cancleImports">{{$t('cancel')}}
</a-button>
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit"
v-has="'split:sarFileSplitItems:importSplitResult'">{{$t('submit')}}
</a-button>
</div>
</div>
<a-modal
@@ -50,9 +55,10 @@
:footer="false"
>
<div class="err-value" v-html="errValue"></div>
<!-- <span class="err-value">{{errValue}}</span>-->
<!-- <span class="err-value">{{errValue}}</span>-->
</a-modal>
<!-- <split-upload ref="uploadFile" :disabled="disabled" :title="upload1" :accept="accept" @uploadSuccess="uploadSuccess"></split-upload>-->
<JLoading :loading="loading">{{$t('Submitting')}}</JLoading>
<!-- <split-upload ref="uploadFile" :disabled="disabled" :title="upload1" :accept="accept" @uploadSuccess="uploadSuccess"></split-upload>-->
</a-drawer>
</div>
</template>
@@ -66,96 +72,98 @@
import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../../../common/event'
import Vue from 'vue'
export default {
name: 'import',
components:{
components: {
SplitUpload,
search,
TableData
},
data(){
return{
labelCol: { span:4 },
data() {
return {
labelCol: { span: 4 },
wrapperCol: { span: 18 },
visible:false,
contentVisible:true,
disabled:false,
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
loading: false,
visible: false,
contentVisible: true,
disabled: false,
tableSource: [], //列表数据
selectedRowKeys: [],
queryParams: {
pageNo: 1,
pageSize: 10
}, //搜索条件
total:0,
total: 0,
columns: [
{
title:this.$t('standard'),
title: this.$t('standard'),
key: 'standNumber',
align:"center",
align: 'center',
dataIndex: 'standNumber',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('title'),
title: this.$t('title'),
key: 'standName',
align:"center",
align: 'center',
dataIndex: 'standName',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('fileName'),
title: this.$t('fileName'),
key: 'fileName',
align:"center",
align: 'center',
dataIndex: 'fileName',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('TextStatus'),
title: this.$t('TextStatus'),
key: 'fileType_dictText',
align:"center",
align: 'center',
dataIndex: 'fileType_dictText',
ellipsis: true,
},
ellipsis: true
}
],
file:'',
form:{},
rules:{
file:[
{ required: true, message: this.$t('pleaseUploadFile'), trigger: 'change' },
],
file: '',
form: {},
rules: {
file: [
{ required: true, message: this.$t('pleaseUploadFile'), trigger: 'change' }
]
},
spinning:false, //loading标识
type:'pdfdoc',
url:{
spinning: false, //loading标识
type: 'pdfdoc',
url: {
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //表格头部字段
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //搜索字段
tableList: 'split/sarFileSplitInfo/splitResultPageInfo', //表格数据
tableList: 'split/sarFileSplitInfo/splitResultPageInfo' //表格数据
},
OperationList:[],
upload1:this.$t('upload1'),
OperationList: [],
upload1: this.$t('upload1'),
// accept:'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword',
accept:'application/x-zip-compressed,application/zip',
rows:[],
token:Vue.ls.get(ACCESS_TOKEN),
flag:false, //提交表单标识
cut:'',
preErrVisible:false,
errValue:'',
titleItem: '', // 错误标题
accept: 'application/x-zip-compressed,application/zip',
rows: [],
token: Vue.ls.get(ACCESS_TOKEN),
flag: false, //提交表单标识
cut: '',
preErrVisible: false,
errValue: '',
titleItem: '' // 错误标题
}
},
props:{
importsVisible:Boolean
props: {
importsVisible: Boolean
},
watch:{
'form.file'(val){
watch: {
'form.file'(val) {
// console.log('val111',val)
},
}
},
mounted() {
this.visible=this.importsVisible
this.visible = this.importsVisible
let long = localStorage.getItem('language')
this.cut = ''
if (long && long === 'zh-cn') {
@@ -167,63 +175,61 @@
}
// console.log('visibleSplit',this.visible)
},
methods:{
methods: {
//获取列表数据
loadData(){
this.spinning=true
let params={
loadData() {
this.spinning = true
let params = {}
getAction(``, params).then(res => {
}
getAction(``,params).then(res=>{
}).finally(()=>{
this.spinning=false
}).finally(() => {
this.spinning = false
})
},
afterVisibleChange(val) {
// console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
this.visible = false
this.$emit('visible', false)
},
onSelectChange(keys,rows){
onSelectChange(keys, rows) {
// console.log('keys',keys,rows)
this.selectedRowKeys=keys
this.rows=rows
this.selectedRowKeys = keys
this.rows = rows
},
//搜索
searchQuery(){
searchQuery() {
},
//清空
searchReset(){
searchReset() {
},
//点击页数
onChangePage(page,pageSize){
onChangePage(page, pageSize) {
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize
this.queryParams.pageNo = 1
this.loadData()
},
cancleImports(){
this.$emit('visible',false)
cancleImports() {
this.$emit('visible', false)
},
fileUpload(){
this.$refs.uploadFile.visible=true
fileUpload() {
this.$refs.uploadFile.visible = true
},
//上传文件
uploadSuccess(data) {
// console.log('updata',data)
let attIdList = []
if(data && data.length>0) {
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
@@ -234,72 +240,76 @@
},
//模板下载
downLoad(){
let name = this.$t('documentSplitTemplate')+'.xlsx'
downloadFile('split/sarFileSplitItems/exportTemplate',name, {})
downLoad() {
let name = this.$t('documentSplitTemplate') + '.xlsx'
downloadFile('split/sarFileSplitItems/exportTemplate', name, {})
},
//保存
handleSubmit(){
handleSubmit() {
// console.log('seleced',this.selectedRowKeys,this.rows)
// console.log('this.form.file,',this.form.file)
if(this.rows.length===0){
if (this.rows.length === 0) {
this.$message.warning(this.$t('PleaseSelectData'))
}else if(this.rows&&this.rows.length>1){
} else if (this.rows && this.rows.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
}else if(!this.form.file) {
} else if (!this.form.file) {
this.$message.warning(this.$t('pleaseUploadSplitFile'))
}else if(this.rows&&this.rows.length===1){
let params={
connectId:this.rows[0].connect_id,
splitFileId:this.form.file,
fileName:this.rows[0].file_name,
serialNumber:this.rows[0].serial_number,
title:this.rows[0].title,
titleEn:this.rows[0].title_en,
} else if (this.rows && this.rows.length === 1) {
let params = {
connectId: this.rows[0].connect_id,
splitFileId: this.form.file,
fileName: this.rows[0].file_name,
serialNumber: this.rows[0].serial_number,
title: this.rows[0].title,
titleEn: this.rows[0].title_en
}
params.fileType=this.rows[0].text_info_id
params.cut=this.cut
params.fileType = this.rows[0].text_info_id
params.cut = this.cut
let formData = new FormData()
Object.keys(params).forEach((key) => {
// console.log('key',key,params[key])
formData.append(key, params[key]);
});
formData.append(key, params[key])
})
// console.log('formData',params,formData.getAll)
if(this.form.file) {
if (this.form.file) {
// this.$refs.ruleForm.validate(valid => {
// if (valid) {
if (!this.flag) {
this.flag = true
axios({
url: '/jero-boot/split/sarFileSplitItems/importSplitResult',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
// 'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': this.token
}
}).then(res => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchGetData')
this.visible = false;
this.$emit('visible',false)
}else{
// this.$message.warning(res.data.message)
if(res.data.code==1){
this.$message.error(res.data.message);
}else{
this.titleItem = '失败'
this.preErrVisible=true
this.errValue=res.data.message
}
}
}).finally(() => [
this.flag = false
])
if (!this.flag) {
this.flag = true
this.loading = true
axios({
url: '/jero-boot/split/sarFileSplitItems/importSplitResult',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
// 'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': this.token
}
}).then(res => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchGetData')
this.visible = false
this.loading = false
this.$emit('visible', false)
} else {
this.loading = false
// this.$message.warning(res.data.message)
if (res.data.code == 1) {
this.$message.error(res.data.message)
} else {
this.titleItem = '失败'
this.preErrVisible = true
this.errValue = res.data.message
}
}
}).finally(() => {
this.flag = false
this.loading = false
})
}
// }
// })
}
@@ -331,42 +341,47 @@
// }
}
},
handleErrCancel(){
this.preErrVisible=false
},
handleErrCancel() {
this.preErrVisible = false
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.imports-table-content{
.imports-header{
.imports-table-content {
.imports-header {
margin-bottom: 20px;
}
}
.imports-table-detail{
.page{
.imports-table-detail {
.page {
margin: 20px 0;
text-align: right;
}
}
.imports-files{
.imports-files {
position: relative;
margin:20px 0;
.file-down{
margin: 20px 0;
.file-down {
position: absolute;
left: 320px;
top: 5px;
}
}
.imports-footer{
.imports-footer-wrap{
margin:20px 0;
.imports-footer {
.imports-footer-wrap {
margin: 20px 0;
text-align: center;
.imports-sub{
.imports-sub {
margin-right: 20px;
}
}
@@ -375,21 +390,23 @@
<style lang="less">
.imports-table-content {
.imports-header {
.ant-col-sm-24{
.ant-col-sm-24 {
display: flex;
}
}
}
.imports-table-drawer{
.table-operator{
display: flex;
justify-content: end;
text-align: right;
margin-bottom: 20px;
span{
color:#040B29;
.imports-table-drawer {
.table-operator {
display: flex;
justify-content: end;
text-align: right;
margin-bottom: 20px;
span {
color: #040B29;
}
}
}
}
</style>
@@ -1,76 +1,81 @@
<template>
<div class="split">
<a-drawer
class="split-table-drawer"
:title="$t('SplitText')"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="split-table-content">
<div class="split-header">
<searchAlone :url="url" :flag="'condition'"></searchAlone>
</div>
<div class="split">
<a-drawer
class="split-table-drawer"
:title="$t('SplitText')"
placement="right"
:visible="visible"
@close="onClose"
width="1100"
>
<div class="split-table-content">
<div class="split-header">
<searchAlone :url="url" :flag="'condition'"></searchAlone>
</div>
<div class="table-operator operator-select">
<div class="operator-text">
<!-- <a-icon type="download" />-->
<!-- 模板下载-->
</div>
<div class="table-operator operator-select">
<div class="operator-text">
<!-- <a-icon type="download" />-->
<!-- 模板下载-->
<div class="operator-select-type">
<span class="operator-file-type"><i class="operator-i">*</i>{{$t('fileType')}}</span>
<a-select v-model="fileGroup" style='min-width: 295px' :placeholder="$t('selectFileType')" class="file-type-select">
<a-select-option value="GSO" key="GSO" :title="$t('GSO')">
{{$t('GSO')}}
</a-select-option>
<a-select-option value="KMVSS_Table" key="KMVSS_Table" :title="$t('KMVSS_Table')">
{{$t('KMVSS_Table')}}
</a-select-option>
<a-select-option value="KMVSS_Article" key="KMVSS_Article" :title="$t('KMVSS_Article')">
{{$t('KMVSS_Article')}}
</a-select-option>
<a-select-option value="CFR" key="CFR" :title="$t('CFR')">
{{$t('CFR')}}
</a-select-option>
<a-select-option value="UNECE" key="UNECE" :title="$t('UNECE')">
{{$t('UNECE')}}
</a-select-option>
<a-select-option value="JPN_Attachment" key="JPN_Attachment" :title="$t('JPN_Attachment')">
{{$t('JPN_Attachment')}}
</a-select-option>
<a-select-option value="JPN_Article" key="JPN_Article" :title="$t('JPN_Article')">
{{$t('JPN_Article')}}
</a-select-option>
<a-select-option value="GB" key="GB" :title="$t('GB')">
{{$t('GB')}}
</a-select-option>
<a-select-option value="GBT" key="GBT" :title="$t('GBT')">
{{$t('GBT')}}
</a-select-option>
</a-select>
</div>
<div class="operator-select-type">
<span class="operator-file-type"><i class="operator-i">*</i>{{$t('fileType')}}</span>
<a-select v-model="fileGroup" style='min-width: 295px' :placeholder="$t('selectFileType')"
class="file-type-select">
<a-select-option value="GSO" key="GSO" :title="$t('GSO')">
{{$t('GSO')}}
</a-select-option>
<a-select-option value="KMVSS_Table" key="KMVSS_Table" :title="$t('KMVSS_Table')">
{{$t('KMVSS_Table')}}
</a-select-option>
<a-select-option value="KMVSS_Article" key="KMVSS_Article" :title="$t('KMVSS_Article')">
{{$t('KMVSS_Article')}}
</a-select-option>
<a-select-option value="CFR" key="CFR" :title="$t('CFR')">
{{$t('CFR')}}
</a-select-option>
<a-select-option value="UNECE" key="UNECE" :title="$t('UNECE')">
{{$t('UNECE')}}
</a-select-option>
<a-select-option value="JPN_Attachment" key="JPN_Attachment" :title="$t('JPN_Attachment')">
{{$t('JPN_Attachment')}}
</a-select-option>
<a-select-option value="JPN_Article" key="JPN_Article" :title="$t('JPN_Article')">
{{$t('JPN_Article')}}
</a-select-option>
<a-select-option value="GB" key="GB" :title="$t('GB')">
{{$t('GB')}}
</a-select-option>
<a-select-option value="GBT" key="GBT" :title="$t('GBT')">
{{$t('GBT')}}
</a-select-option>
</a-select>
</div>
</div>
<div class="split-table-detail">
<tableData
:flag="'header'"
:url="url"
:type="type"
:showAction="false"
:OperationList="OperationList"
@onSelectChange="onSelectChange"
/>
</div>
<div class="split-table-detail">
<tableData
:flag="'header'"
:url="url"
:type="type"
:showAction="false"
:OperationList="OperationList"
@onSelectChange="onSelectChange"
/>
</div>
<div class="split-footer" style='display: flex;justify-content: flex-end'>
<div class="split-footer-wrap">
<a-button class="split-btn" type="primary" @click="cancelSplit"
style='background-color: #f5222d;border: none;margin-right: 15px'>{{$t('cancel')}}
</a-button>
<a-button class="split-btn split-chai" type="primary" @click="submitSplit"
v-has="'split:sarFileSplitInfo:add'">{{$t('submit')}}
</a-button>
</div>
<div class="split-footer" style='display: flex;justify-content: flex-end'>
<div class="split-footer-wrap">
<a-button class="split-btn" type="primary" @click="cancelSplit" style='background-color: #f5222d;border: none;margin-right: 15px'>{{$t('cancel')}}</a-button>
<a-button class="split-btn split-chai" type="primary" @click="submitSplit" v-has="'split:sarFileSplitInfo:add'">{{$t('submit')}}</a-button>
</div>
</div>
</a-drawer>
</div>
</div>
<JLoading :loading="loading">{{$t('Submitting')}}</JLoading>
</a-drawer>
</div>
</template>
<script>
@@ -85,203 +90,210 @@
export default {
name: 'split',
components:{
components: {
SearchAlone,
TableData,
TableData
},
data(){
return{
visible:false,
fileGroup:'',
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
data() {
return {
visible: false,
loading: false,
fileGroup: '',
tableSource: [], //列表数据
selectedRowKeys: [],
queryParams: {
pageNo: 1,
pageSize: 10
}, //搜索条件
total:0,
total: 0,
columns: [
{
title:this.$t('standard'),
title: this.$t('standard'),
key: 'standNumber',
align:"center",
align: 'center',
dataIndex: 'standNumber',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('title'),
title: this.$t('title'),
key: 'standName',
align:"center",
align: 'center',
dataIndex: 'standName',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('fileName'),
title: this.$t('fileName'),
key: 'fileName',
align:"center",
align: 'center',
dataIndex: 'fileName',
ellipsis: true,
ellipsis: true
},
{
title:this.$t('TextStatus'),
title: this.$t('TextStatus'),
key: 'fileType_dictText',
align:"center",
align: 'center',
dataIndex: 'fileType_dictText',
ellipsis: true,
},
ellipsis: true
}
],
spinning:false, //loading标识
url:{
spinning: false, //loading标识
url: {
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //表格头部字段
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //搜索字段
tableList: 'split/sarFileSplitInfo/splitFilePageInfo', //表格数据
tableList: 'split/sarFileSplitInfo/splitFilePageInfo' //表格数据
},
type:'pdfdoc',
OperationList:[],
token:Vue.ls.get(ACCESS_TOKEN),
cut:'',
submitFlag:false
type: 'pdfdoc',
OperationList: [],
token: Vue.ls.get(ACCESS_TOKEN),
cut: '',
submitFlag: false
}
},
props:{
splitVisible:{
type:Boolean,
default:false
},
props: {
splitVisible: {
type: Boolean,
default: false
}
},
mounted() {
this.visible=this.splitVisible
this.visible = this.splitVisible
// console.log('visibleSplit',this.visible)
},
methods:{
methods: {
//获取列表数据
loadData(){
this.spinning=true
let params={
loadData() {
this.spinning = true
let params = {}
getAction(``, params).then(res => {
}
getAction(``,params).then(res=>{
}).finally(()=>{
this.spinning=false
}).finally(() => {
this.spinning = false
})
},
afterVisibleChange(val) {
console.log('visible', val);
console.log('visible', val)
},
onClose() {
this.visible = false;
this.$emit('visible',false)
this.visible = false
this.$emit('visible', false)
},
onSelectChange(keys,rows){
this.selectedRowKeys=keys
if(keys.length>1){
onSelectChange(keys, rows) {
this.selectedRowKeys = keys
if (keys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
}else{
this.rowId=keys[0]
} else {
this.rowId = keys[0]
}
this.rows=[...rows]
this.rows = [...rows]
},
//搜索
searchQuery(){
searchQuery() {
},
//清空
searchReset(){
searchReset() {
},
//点击页数
onChangePage(page,pageSize){
onChangePage(page, pageSize) {
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize
this.queryParams.pageNo = 1
this.loadData()
},
cancelSplit(){
this.$emit('visible',false)
cancelSplit() {
this.visible = false
this.$emit('visible', false)
},
//拆分
submitSplit(){
if(this.fileGroup.length == 0||this.fileGroup==undefined){
submitSplit() {
if (this.fileGroup.length == 0 || this.fileGroup == undefined) {
this.$message.warning(this.$t('selectFileType'))
}else if(this.rows&&this.rows.length>1){
} else if (this.rows && this.rows.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
}else if(this.rows==undefined||this.rows.length===0){
} else if (this.rows == undefined || this.rows.length === 0) {
this.$message.warning(this.$t('selectLeastOne'))
}else if(this.rows&&this.rows.length==1) {
} else if (this.rows && this.rows.length == 1) {
let file = this.rows[0]
if (file.file_name) {
let name = file.file_name.split('.')
let nameSuffix = name[name.length - 1]
if(this.fileGroup === 'GSO') {
if (nameSuffix.toLowerCase() === 'doc'||nameSuffix.toLowerCase() === 'docx'||nameSuffix.toLowerCase() === 'pdf') {
if (this.fileGroup === 'GSO') {
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx' || nameSuffix.toLowerCase() === 'pdf') {
let params = {
attId: file.id,
title: file.title,
titleEn:file.title_en,
fileName:file.file_name,
titleEn: file.title_en,
fileName: file.file_name,
serialNumber: file.serial_number,
connectId: file.connect_id,
fileGroup: this.fileGroup,
fileType:file.text_info_id
fileType: file.text_info_id
}
if(!this.submitFlag){
this.submitFlag=true
if (!this.submitFlag) {
this.submitFlag = true
this.loading = true
postAction(`split/sarFileSplitInfo/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchGetData')
this.visible = false;
this.visible = false
this.loading = false
this.$emit('visible', false)
} else {
this.loading = false
this.$message.warning(res.message)
}
}).finally(()=>{
this.submitFlag =false
}).finally(() => {
this.loading = false
this.submitFlag = false
})
this.$emit('exportVisible',true)
this.$emit('exportVisible', true)
}
} else {
this.$message.warning(this.$t('OnlyWord'))
}
} else {
if (nameSuffix.toLowerCase() === 'doc'||nameSuffix.toLowerCase() === 'docx') {
if (nameSuffix.toLowerCase() === 'doc' || nameSuffix.toLowerCase() === 'docx') {
let params = {
attId: file.id,
title: file.title,
fileName:file.file_name,
titleEn:file.title_en,
fileName: file.file_name,
titleEn: file.title_en,
serialNumber: file.serial_number,
connectId: file.connect_id,
fileGroup: this.fileGroup,
fileType:file.text_info_id
fileType: file.text_info_id
}
if(!this.submitFlag){
this.submitFlag=true
if (!this.submitFlag) {
this.submitFlag = true
this.loading = true
postAction(`split/sarFileSplitInfo/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
this.visible = false;
eventBUs.$emit('searchGetData')
this.visible = false
this.loading = false
this.$emit('visible', false)
} else {
this.loading = false
this.$message.warning(res.message)
}
}).finally(()=>{
this.submitFlag =false
}).finally(() => {
this.submitFlag = false
this.loading = false
})
this.$emit('exportVisible',true)
this.$emit('exportVisible', true)
}
} else {
this.$message.warning(this.$t('OnlyWordItem'))
@@ -291,59 +303,66 @@
}
}
}
}
</script>
<style lang="less" scoped>
.split-table-content{
.split-header{
margin-bottom: 20px;
.split-item{
display: flex;
}
.split-table-content {
.split-header {
margin-bottom: 20px;
.split-item {
display: flex;
}
}
.split-table-detail{
.page{
}
}
.split-table-detail {
.page {
margin: 20px 0;
text-align: right;
}
}
.split-footer{
.split-footer-wrap{
margin:20px 0;
.split-footer {
.split-footer-wrap {
margin: 20px 0;
text-align: center;
.split-chai{
.split-chai {
margin-right: 20px;
}
}
}
.operator-select{
.operator-select {
margin-bottom: 20px;
/*margin-left: 60px;*/
.operator-file-type{
.operator-file-type {
/*width: 100px;*/
min-width: 110px;
text-align: right;
line-height: 32px;
display: inline-block;
margin-right: 16px;
.operator-i{
.operator-i {
display: inline-block;
width: 10px;
height: 38px;
line-height: 38px;
text-align: center;
color:#f5222d;
color: #f5222d;
}
}
.operator-select-type{
.operator-select-type {
display: flex;
justify-content: start;
.file-type-select{
.file-type-select {
min-width: 120px;
}
@@ -354,15 +373,17 @@
<style lang="less">
.split-table-content {
.split-header {
.ant-col-sm-24{
.ant-col-sm-24 {
display: flex;
}
}
}
.operator-select-type{
.ant-select-selection{
.operator-select-type {
.ant-select-selection {
height: 38px;
.ant-select-selection__rendered{
.ant-select-selection__rendered {
height: 38px;
line-height: 38px;
}