拆分结果导入修改
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="showContent" slot-scope="text, record">
|
||||
<span slot="showContent" slot-scope="text, record" class="item-solt">
|
||||
<a-tooltip placement="top" class="item-content-tooltip" >
|
||||
<template slot="title" class="item-content-title">
|
||||
<span class="item-content-show" v-html="record.iterms_conditions"></span>
|
||||
@@ -184,7 +184,7 @@
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
console.log('columns',this.columns)
|
||||
// console.log('columns',this.columns)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="ocr-upload">
|
||||
<!-- <a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title" class="ocr-upload-modal">-->
|
||||
<a-upload
|
||||
:accept='accept'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
:list-type="listType"
|
||||
:file-list="myfileList"
|
||||
:multiple="false"
|
||||
:action = 'uploadAction'
|
||||
:headers="headers"
|
||||
:before-upload="beforeUpload"
|
||||
:remove='remove'
|
||||
:showUploadList="false"
|
||||
@change="handleChange">
|
||||
<!-- <p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>-->
|
||||
<a-icon type="export" :rotate="-90" />
|
||||
拆分文件
|
||||
</a-upload>
|
||||
<!-- </a-modal>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
export default {
|
||||
name: 'importSplitUpload',
|
||||
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType','accept','title','listType','module'],
|
||||
data(){
|
||||
return{
|
||||
visible:false,
|
||||
uploadAction:window._CONFIG['domianURL']+"/sys/common/upload",
|
||||
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
|
||||
myfileList:[],
|
||||
fileList:[],
|
||||
fileTypeSatus:false,
|
||||
headers:{},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.headers = {"X-Access-Token":token};
|
||||
this.containerId = 'container-ty-'+new Date().getTime();
|
||||
},
|
||||
mounted(){
|
||||
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
|
||||
},
|
||||
methods:{
|
||||
beforeUpload(file,fileList) {
|
||||
// console.log('file',this.accept,file,fileList)
|
||||
this.fileTypeSatus=false
|
||||
// if(this.myfileList&&this.myfileList.length>=1){
|
||||
// this.$message.warning('只能上传一个文件')
|
||||
// return false
|
||||
// }else{
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
if(file.type==this.accept){
|
||||
// console.log('111111')
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
}
|
||||
// }
|
||||
},
|
||||
remove(){
|
||||
this.fileTypeSatus = true;
|
||||
// console.log('rrr',this.myfileList)
|
||||
},
|
||||
handleChange(info) {
|
||||
// console.log('info',info)
|
||||
|
||||
let { file,fileList } = info;
|
||||
const status = info.file.status;
|
||||
info.fileList.forEach((val,index)=>{
|
||||
if(val.response && !val.response.result){
|
||||
this.$message.error(val.response.message);
|
||||
info.fileList.splice(index,1)
|
||||
}
|
||||
})
|
||||
if (this.fileTypeSatus) {
|
||||
if (file.size > 100000000) {
|
||||
this.$message.error(this.errorMessage)
|
||||
return
|
||||
}else {
|
||||
if (status === 'error') {
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.error(`${info.file.name} 文件上传失败。`);
|
||||
} else if (status === 'removed') {
|
||||
this.myfileList = info.fileList;
|
||||
this.fileList = []
|
||||
this.myfileList.forEach((res) => {
|
||||
if (res.response) {
|
||||
this.fileList.push(res.response.result)
|
||||
} else {
|
||||
this.fileList.push(res)
|
||||
}
|
||||
})
|
||||
// console.log('remove',this.fileList)
|
||||
this.$emit('uploadSuccess', this.fileList)
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} 删除成功。`);
|
||||
} else if (status === 'done') {
|
||||
this.fileList = []
|
||||
this.myfileList = info.fileList;
|
||||
// console.log('file3333',info.fileList)
|
||||
// if (info.fileList.length > 1) {
|
||||
// info.fileList.splice(1)
|
||||
// // this.myfileList = info.fileList;
|
||||
//
|
||||
// this.myfileList.forEach((res) => {
|
||||
// if (res.response) {
|
||||
// this.fileList.push(res.response.result)
|
||||
// } else {
|
||||
// this.fileList.push(res)
|
||||
// }
|
||||
// })
|
||||
// // console.log('file1111',this.fileList)
|
||||
// this.$emit('uploadSuccess', this.fileList)
|
||||
// this.$message.destroy()
|
||||
// this.$message.error('最多只能上传一个文件');
|
||||
// return
|
||||
// }
|
||||
// console.log('my222',this.myfileList)
|
||||
this.myfileList.forEach((res) => {
|
||||
if (res.response) {
|
||||
this.fileList.push(res.response.result)
|
||||
// console.log('flist',res.response)
|
||||
} else {
|
||||
this.fileList.push(res)
|
||||
}
|
||||
})
|
||||
let fileList1=[]
|
||||
fileList1[0]=this.fileList[this.fileList.length-1]
|
||||
if(this.myfileList.length > 0){
|
||||
this.$emit('uploadSuccess', fileList1)
|
||||
this.$message.destroy()
|
||||
this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
// console.log('fileList111',file,this.fileList,fileList1)
|
||||
}
|
||||
} else if (status === 'uploading') {
|
||||
this.myfileList = info.fileList;
|
||||
this.$emit('uploadSuccess')
|
||||
// this.$message.success(`${info.file.name} 文件上传成功。`);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.$message.warning('不支持上传该类型的文件!')
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<style lang="less">
|
||||
.ocr-upload-modal{
|
||||
.ant-modal-wrap{
|
||||
z-index: 1002;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -292,22 +292,15 @@
|
||||
'X-Access-Token':this.token
|
||||
}
|
||||
}).then(res => {
|
||||
// console.log('res,res',res)
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.$message.warning(res.data.message)
|
||||
}
|
||||
})
|
||||
|
||||
// getAction(`split/sarFileSplitInfo/bindToDocumentLibrary`, params).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(res.message)
|
||||
// this.loadData()
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -14,6 +14,17 @@
|
||||
<search :url="url" :flag="'condition'"></search>
|
||||
</div>
|
||||
</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>
|
||||
</div>
|
||||
<div class="operator-text" @click="downLoad">
|
||||
<a-icon type="download" />
|
||||
模板下载
|
||||
</div>
|
||||
</div>
|
||||
<div class="imports-table-detail">
|
||||
<tableData
|
||||
:flag="'header'"
|
||||
@@ -24,29 +35,29 @@
|
||||
@onSelectChange="onSelectChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="imports-files">
|
||||
<a-form-model
|
||||
class="imports-content"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-model-item ref="file" :label="$t('splitFile')" prop="file">
|
||||
<split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'" @uploadSuccess="uploadSuccess"></split-upload>
|
||||
<!-- <a-input v-model="form.file" >{{form.file}}</a-input>-->
|
||||
<!-- <a-button type="primary" class="button-text"-->
|
||||
<!-- @click="fileUpload()">-->
|
||||
<!-- <div class="imports-files">-->
|
||||
<!-- <a-form-model-->
|
||||
<!-- class="imports-content"-->
|
||||
<!-- ref="ruleForm"-->
|
||||
<!-- :model="form"-->
|
||||
<!-- :rules="rules"-->
|
||||
<!-- :label-col="labelCol"-->
|
||||
<!-- :wrapper-col="wrapperCol"-->
|
||||
<!-- >-->
|
||||
<!-- <a-form-model-item ref="file" :label="$t('splitFile')" prop="file">-->
|
||||
<!-- <split-upload ref="uploadFile" :accept="accept" :disabled="disabled" :module="'split'" @uploadSuccess="uploadSuccess"></split-upload>-->
|
||||
<!--<!– <a-input v-model="form.file" >{{form.file}}</a-input>–>-->
|
||||
<!--<!– <a-button type="primary" class="button-text"–>-->
|
||||
<!--<!– @click="fileUpload()">–>-->
|
||||
|
||||
<!-- {{ (form.file === 'null' || form.file === '' ||-->
|
||||
<!-- form.file == null) ? $t('upload1') : $t('viewUploadedFiles')-->
|
||||
<!-- }}-->
|
||||
<!-- </a-button>-->
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<a-button class="file-down" type="primary" @click="downLoad">{{$t('templateDownload')}}</a-button>
|
||||
</div>
|
||||
<!--<!– {{ (form.file === 'null' || form.file === '' ||–>-->
|
||||
<!--<!– form.file == null) ? $t('upload1') : $t('viewUploadedFiles')–>-->
|
||||
<!--<!– }}–>-->
|
||||
<!--<!– </a-button>–>-->
|
||||
<!-- </a-form-model-item>-->
|
||||
<!-- </a-form-model>-->
|
||||
<!-- <a-button class="file-down" type="primary" @click="downLoad">{{$t('templateDownload')}}</a-button>-->
|
||||
<!-- </div>-->
|
||||
<div class="imports-footer">
|
||||
<div class="imports-footer-wrap">
|
||||
|
||||
@@ -61,7 +72,7 @@
|
||||
|
||||
<script>
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
import SplitUpload from '@/components/OcrUpload/index'
|
||||
import SplitUpload from '@/components/importSplitUpload/index'
|
||||
import search from '@/components/search/index'
|
||||
import TableData from '@/components/SplitTable/DocTable'
|
||||
import axios from 'axios'
|
||||
@@ -137,10 +148,11 @@
|
||||
OperationList:[],
|
||||
upload1:this.$t('upload1'),
|
||||
// accept:'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword',
|
||||
accept:'application/x-zip-compressed',
|
||||
accept:'application/zip',
|
||||
rows:[],
|
||||
token:Vue.ls.get(ACCESS_TOKEN),
|
||||
flag:false, //提交表单标识
|
||||
cut:''
|
||||
}
|
||||
},
|
||||
props:{
|
||||
@@ -154,6 +166,15 @@
|
||||
},
|
||||
mounted() {
|
||||
this.visible=this.importsVisible
|
||||
let long = localStorage.getItem('language')
|
||||
this.cut = ''
|
||||
if (long && long === 'zh-cn') {
|
||||
this.cut = 'cn'
|
||||
|
||||
} else if (long && long === 'en-us') {
|
||||
this.cut = 'en'
|
||||
|
||||
}
|
||||
// console.log('visibleSplit',this.visible)
|
||||
},
|
||||
methods:{
|
||||
@@ -210,6 +231,7 @@
|
||||
//上传文件
|
||||
uploadSuccess(data) {
|
||||
// console.log('updata',data)
|
||||
|
||||
let attIdList = []
|
||||
if(data && data.length>0) {
|
||||
data.map(item => {
|
||||
@@ -219,6 +241,7 @@
|
||||
// /** 赋值给当前对应的表单文件 */
|
||||
this.form.file = attIdList.join(',')
|
||||
// console.log('this.form.file',this.form.file)
|
||||
|
||||
},
|
||||
//模板下载
|
||||
downLoad(){
|
||||
@@ -233,6 +256,8 @@
|
||||
this.$message.warning(this.$t('PleaseSelectData'))
|
||||
}else if(this.rows&&this.rows.length>1){
|
||||
this.$message.warning(this.$t('OnlyOneSelected'))
|
||||
}else if(!this.form.file) {
|
||||
this.$message.warning('请上传拆分文件')
|
||||
}else if(this.rows&&this.rows.length===1){
|
||||
let params={
|
||||
connectId:this.rows[0].connect_id,
|
||||
@@ -243,28 +268,16 @@
|
||||
|
||||
}
|
||||
params.fileType=this.rows[0].text_info
|
||||
// if(this.rows[0].text_info=='发布稿(必读)'){
|
||||
// params.fileType='1'
|
||||
// }else if(this.rows[0].text_info=='增补件(必读)'){
|
||||
// params.fileType='2'
|
||||
// }else if(this.rows[0].text_info=='报批稿'){
|
||||
// params.fileType='3'
|
||||
// }else if(this.rows[0].text_info=='征求意见稿'){
|
||||
// params.fileType='4'
|
||||
// }else if(this.rows[0].text_info=='测试程序'){
|
||||
// params.fileType='5'
|
||||
// }else if(this.rows[0].text_info=='相关资料'){
|
||||
// params.fileType='6'
|
||||
// }
|
||||
params.cut=this.cut
|
||||
let formData = new FormData()
|
||||
Object.keys(params).forEach((key) => {
|
||||
// console.log('key',key,params[key])
|
||||
formData.append(key, params[key]);
|
||||
});
|
||||
// console.log('formData',params,formData.getAll)
|
||||
if(!this.form.file) {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
if(this.form.file) {
|
||||
// this.$refs.ruleForm.validate(valid => {
|
||||
// if (valid) {
|
||||
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
@@ -281,6 +294,8 @@
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
eventBUs.$emit('searchReset')
|
||||
this.visible = false;
|
||||
this.$emit('visible',false)
|
||||
}else{
|
||||
this.$message.warning(res.data.message)
|
||||
}
|
||||
@@ -288,34 +303,35 @@
|
||||
this.flag = false
|
||||
])
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {
|
||||
|
||||
this.$refs.ruleForm.clearValidate()
|
||||
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('searchReset')
|
||||
}else{
|
||||
this.$message.warning(res.data.message)
|
||||
}
|
||||
}).finally(() => [
|
||||
this.flag = false
|
||||
])
|
||||
}
|
||||
// }
|
||||
// })
|
||||
}
|
||||
// else {
|
||||
//
|
||||
// this.$refs.ruleForm.clearValidate()
|
||||
// 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('searchReset')
|
||||
// }else{
|
||||
// this.$message.warning(res.data.message)
|
||||
// }
|
||||
// }).finally(() => [
|
||||
// this.flag = false
|
||||
// ])
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,10 +339,12 @@
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
.imports-table-content{
|
||||
.imports-header{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.imports-table-detail{
|
||||
@@ -361,6 +379,15 @@
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.imports-table-drawer{
|
||||
.table-operator{
|
||||
text-align: right;
|
||||
margin-bottom: 20px;
|
||||
span{
|
||||
color:#040B29;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -252,7 +252,7 @@
|
||||
<a-row :gutter="24" class="split-content" id="split-content" v-for="(item, index) in contentList" :key="index">
|
||||
<div class="split-row">
|
||||
<div class="row-left">
|
||||
<a-textarea v-if="item.type==='TEXT'" v-model="item.itemContent" :placeholder="$t('pleaseEnter')+$t('content')" />
|
||||
<a-textarea v-if="item.type==='TEXT'" v-model="item.itemContent" :auto-size="true" :show-count="true" :maxlength="1000" :placeholder="$t('pleaseEnter')+$t('content')" />
|
||||
<img v-if="item.type==='IMG'" :src="item.thumbUrl?item.thumbUrl:item.itemContent" alt="" @click="preImg(item)">
|
||||
<div v-if="item.type==='TABLE'" v-html="item.itemContent" class="item-table"></div>
|
||||
</div>
|
||||
|
||||
@@ -287,7 +287,8 @@
|
||||
selectedKeys:[],
|
||||
deleteNode:false,
|
||||
fullWidth:'',
|
||||
parameter:{}
|
||||
parameter:{},
|
||||
widthBrown:''
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@@ -300,9 +301,9 @@
|
||||
},
|
||||
mounted() {
|
||||
|
||||
let widthBrown = document.documentElement.offsetWidth || document.body.offsetWidth
|
||||
this.widthBrown = document.documentElement.offsetWidth || document.body.offsetWidth
|
||||
let client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
|
||||
let width = widthBrown - client.left
|
||||
let width = this.widthBrown - client.left
|
||||
document.querySelector('.split-detail-table .ant-table-content').style.width = width - 20 + 'px'
|
||||
|
||||
this.infoId=this.$route.query.infoId
|
||||
|
||||
Reference in New Issue
Block a user