修改bug

This commit is contained in:
caoyang
2022-03-18 14:09:42 +08:00
parent 109c2db9a2
commit 3279309a01
25 changed files with 87 additions and 168 deletions
@@ -0,0 +1,252 @@
<template>
<div class="imports">
<a-drawer
class="imports-table-drawer"
:title="$t('ImportResults')"
placement="right"
:visible="visible"
:after-visible-change="afterVisibleChange"
@close="onClose"
width="1100"
>
<div class="imports-table-content">
<div class="imports-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item :label="$t('standard')">
<j-input :placeholder="$t('enterNumber')" v-model="queryParams.standNumber"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item :label="$t('title')">
<j-input :placeholder="$t('enterTitle')" v-model="queryParams.standName"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</div>
<div class="imports-table-detail">
<a-spin :spinning="spinning">
<a-table :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
</a-table>
</a-spin>
<div class="page" v-if="tableSource.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+ $t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</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">
<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>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn imports-chai" type="primary">{{$t('preservation')}}</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
</div>
</div>
<ocr-upload ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></ocr-upload>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, downFile } from '@/api/manage'
import OcrUpload from '@/components/OcrUpload/index'
export default {
name: 'import',
components:{
OcrUpload
},
data(){
return{
labelCol: { span:4 },
wrapperCol: { span: 18 },
visible:false,
contentVisible:true,
disabled:false,
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
}, //搜索条件
total:0,
columns: [
{
title:this.$t('standard'),
key: 'standNumber',
align:"center",
dataIndex: 'standNumber',
ellipsis: true,
},
{
title:this.$t('title'),
key: 'standName',
align:"center",
dataIndex: 'standName',
ellipsis: true,
},
{
title:this.$t('fileName'),
key: 'fileName',
align:"center",
dataIndex: 'fileName',
ellipsis: true,
},
{
title:this.$t('TextStatus'),
key: 'fileType_dictText',
align:"center",
dataIndex: 'fileType_dictText',
ellipsis: true,
},
],
file:'',
form:{},
rules:{
file:[
{ required: true, message: this.$t('noFile'), trigger: 'change' },
],
},
spinning:false, //loading标识
}
},
props:{
importsVisible:Boolean
},
mounted() {
this.visible=this.importsVisible
// console.log('visibleSplit',this.visible)
},
methods:{
//获取列表数据
loadData(){
this.spinning=true
let params={
}
getAction(``,params).then(res=>{
}).finally(()=>{
this.spinning=false
})
},
afterVisibleChange(val) {
console.log('visible', val);
},
onClose() {
this.visible = false;
this.$emit('visible',false)
},
onSelectChange(keys){
this.selectedRowKeys=keys
},
//搜索
searchQuery(){
},
//清空
searchReset(){
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.queryParams.pageNo = 1
this.loadData()
},
cancleImports(){
this.$emit('visible',false)
},
fileUpload(){
this.$refs.uploadFile.visible=true
},
//上传文件
uploadSuccess(data) {
console.log('updata',data)
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
})
// /** 赋值给当前对应的表单文件 */
this.form.file = attIdList.join(',')
},
//模板下载
downLoad(){
}
}
}
</script>
<style lang="less" scoped>
.imports-table-content{
.imports-header{
margin-bottom: 20px;
}
}
.imports-table-detail{
.page{
margin: 20px 0;
text-align: right;
}
}
.imports-files{
position: relative;
margin:20px 0;
.file-down{
position: absolute;
left: 260px;
top: 5px;
}
}
.imports-footer{
.imports-footer-wrap{
margin:20px 0;
text-align: center;
.imports-chai{
margin-right: 20px;
}
}
}
</style>