Files
laws_weilai/jero-web/src/components/frameAssembly/index.vue
T
2022-05-11 20:02:29 +08:00

255 lines
6.8 KiB
Java

<template>
<a-drawer
:title="title"
:maskClosable="true"
:width="drawerWidth"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<div v-for="(item,index) in searchList" :key="index" style="line-height: 48px;display: inline-block">
<div class="box-title-text" v-if="item.field_show_type == 'text'">
<div class="title-text" :title="item.db_field_txt">
{{item.db_field_txt}}
</div>
<a-input class="box-input" :placeholder="item.placeholder"
v-model="queryParam[item.db_field_name]"></a-input>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list_multi'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'date'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker class="box-input" v-model="queryParam[item.db_field_name]"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == 'list'">
<div class="title-text" :title="item.db_field_txt">
{{item.db_field_txt}}
</div>
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
</div>
<span class="table-page-search-submitButtons button">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</span>
</a-form>
<div style="height: 100%">
<div class="box">
<a-table
v-if="visible"
class="table"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
:pagination="false"
:data-source="dataSource"
:loading="loading"
>
</a-table>
</div>
<div class="page" v-if="dataSource.length > 0">
<a-pagination
:show-total="total => `共 ${total} 条`"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction } from '@/api/manage'
export default {
name: 'index',
props:{
url: {
type: Object,
default: {}
},
},
data() {
return {
title: '调取已入库文件',
drawerWidth: 800,
visible: false,
confirmLoading: false,
queryParam: {},
selectedRowKeys: [],
searchList: [
{
field_show_type: 'text',
db_field_name: 'name',
db_field_txt: '标题'
},
{
field_show_type: 'text',
db_field_name: 'name',
db_field_txt: '标题'
},
{
field_show_type: 'text',
db_field_name: 'name',
db_field_txt: '标题dsfdsfds'
},
{
field_show_type: 'text',
db_field_name: 'name',
db_field_txt: '标题1111'
}
],
columns: [],
dataSource: [],
loading: false,
pageSize: 10,
total: 0,
pageNo: 1
}
},
mounted() {
},
watch:{
visible:function(val) {
if (val){
this.queryParam = {}
this.getData()
this.getTableList()
}
}
},
methods: {
handleCancel() {
this.visible = false
},
handleSubmit() {
},
searchQuery() {
this.getTableList()
},
searchReset() {
this.queryParam = {}
this.getTableList()
},
onSelectChange() {
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getTableList()
},
onChange(page, pageSize) {
this.pageNo = page
this.getTableList()
},
getData() {
let params = {
flag:'1',
}
getAction(this.url.tableHeader, params).then((res) => {
if (res.success) {
var jsonHead = res.result
this.columns = []
jsonHead.forEach(res => {
this.columns.push({
title: res.db_field_txt,
dataIndex: res.db_field_name,
align: 'center'
})
})
}
})
},
getTableList() {
let params = {
...this.queryParam,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.loading = true
getAction(this.url.tableList, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records
this.total = res.result.total
this.loading = false
}
})
},
}
}
</script>
<style lang="less" scoped>
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 50px;
display: inline-block;
font-weight: bold;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index:100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.button {
margin-left: 18px;
}
.page {
text-align: right;
margin-top: 20px;
}
</style>