拆分详情增加

This commit is contained in:
caoyang
2022-03-30 15:57:45 +08:00
parent 33326162f9
commit d3696b6567
10 changed files with 485 additions and 175 deletions
@@ -79,6 +79,10 @@
showAction: {
type: Boolean,
default: false
},
type:{
type:String,
default:''
}
},
data() {
@@ -190,6 +194,7 @@
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
let params = {
...this.searchParmes,
type:this.type,
orderBy: this.orderBy,
orderByField: this.orderByField,
pageNo: pageNo + '',
@@ -13,8 +13,19 @@
@change="tableOnChange"
>
<span slot="showContent" slot-scope="text, record">
<a class="content-show" href="javascript:;" :title="record.iterms_conditions" @click="showContent">{{record.iterms_conditions}}</a>
<a-tooltip placement="top">
<template slot="title">
<span v-html="record.iterms_conditions"></span>
</template>
<span class="content-show" href="javascript:;" @click="showContent">{{record.iterms_conditions&&record.iterms_conditions!=='null'?record.iterms_conditions.replace(/<.*?>/ig, ' ') : ''}}</span>
</a-tooltip>
</span>
<!-- <span slot="showContent" slot-scope="text, record">-->
<!-- <span class="content-show" href="javascript:;" :title="record.iterms_conditions" @click="showContent">{{record.iterms_conditions?record.iterms_conditions.replace(/<.*?>/ig, ' ') : '1111'}}</span>-->
<!-- </span>-->
<span slot="operation" slot-scope="record">
<a v-for="(ol,index) in OperationList"
@click="OperationClick(ol,record)">
@@ -92,6 +103,12 @@
orderByField: ''
}
},
watch:{
menuId(oldValue,newValue){
// console.log('oldnew',oldValue,newValue)
this.getTableList()
}
},
mounted() {
eventBUs.$on('searchQuery', search => {
Object.keys(search).forEach(res => {
@@ -140,15 +157,9 @@
})
if(res.db_field_name=='iterms_conditions'){
this.columns[index].width='35%'
}
if (res.click) {
this.columns[index].scopedSlots = {
customRender: 'showContent'
}
} else {
this.columns[index].scopedSlots = {
customRender: 'detailText'
}
}
})
// console.log('columns',this.columns)
@@ -167,6 +178,7 @@
scopedSlots: { customRender: 'operation' }
})
}
}
})
},
@@ -245,15 +257,7 @@
height: calc(100% - 100px);
overflow: auto;
.content-show{
width: 500px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
height: 60px;
line-height: 20px;
white-space: pre-wrap;
/*text-align: center;*/
}
}
@@ -0,0 +1,193 @@
<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'
:data="uploadData"
:showUploadList="false"
@change="handleChange">
<!-- <p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>-->
<a-icon type="import" :rotate="-90" />{{ $t('import') }}
<!-- <a-button type="primary" ghost class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{$t('clickUpload')}}</a-button>-->
</a-upload>
<!-- </a-modal>-->
</div>
</template>
<script>
import Vue from 'vue'
// import store from '@/store'
import { ACCESS_TOKEN } from "@/store/mutation-types"
export default {
name: 'SplitImport',
props:['disableds','disabled','thisFileUploadUrl','readonly','thisFileType','title','listType','infoId','menuId'],
data(){
return{
visible:false,
// uploadAction:"http://10.0.1.25:8080/split/sarFileSplitItems/importSplitItems",
uploadAction:window._CONFIG['domianURL']+"/split/sarFileSplitItems/importSplitItems",
downLoadFileUrl:window._CONFIG['domianURL']+'/sys/common/static',
myfileList:[],
fileList:[],
fileTypeSatus:false,
headers:{},
accept:'application/zip',
uploadData:{
},
cut:''
}
},
computed:{
},
watch:{
menuId(val1,val2){
// console.log('val1111',val1,val2)
}
},
created(){
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token};
this.containerId = 'container-ty-'+new Date().getTime();
},
mounted(){
let long = localStorage.getItem('language')
this.cut = ''
if (long && long === 'zh-cn') {
this.cut = 'cn'
this.uploadData.cut='cn'
} else if (long && long === 'en-us') {
this.cut = 'en'
this.uploadData.cut='en'
}
this.uploadData.menuId=this.menuId
this.uploadData.infoId=this.infoId
// console.log('uplod',this.uploadAction,this.uploadData)
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
},
methods:{
beforeUpload(file,fileList) {
if(this.myfileList&&this.myfileList.length>=1){
this.$message.warning('只能上传一个文件')
return false
}else{
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
console.log('typeee',file.type)
if(file.type==this.accept){
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 } = 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)
}
})
if(this.myfileList.length > 0){
this.$emit('uploadSuccess', this.fileList)
this.$message.destroy()
this.$message.success(`${info.file.name} 文件上传成功。`);
}
} 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>