Files
laws_weilai/jero-web/src/views/system/TenantList.vue
T
2022-01-11 23:11:08 +08:00

166 lines
4.9 KiB
Java

<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">{{$t('add')}}</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>
{{$t('delete')}}</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> {{$t('batchOperation')}} <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> {{$t('selected')}} <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>{{$t('term')}}
<a style="margin-left: 24px" @click="onClearSelected">{{$t('empty')}}</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">{{$t('NoPicture')}}</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">{{$t('noFile')}}</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="uploadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">{{$t('edit')}}</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">{{$t('more')}} <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">{{$t('details')}}</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm :title="$t('areYouSure')" @confirm="() => handleDelete(record.id)">
<a>{{$t('delete')}}</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tenant-modal ref="modalForm" @ok="modalFormOk"></tenant-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import TenantModal from './modules/TenantModal'
export default {
name: "TenantList",
mixins:[JeroListMixin, mixinDevice],
components: {
TenantModal
},
data () {
return {
description: this.$t('adadManagementPage'),
// 表头
columns: [
{
title:this.$t('TenantName'),
align:"center",
dataIndex: 'name'
},{
title:this.$t('TenantNumber'),
align:"center",
dataIndex: 'id'
},
{
title:this.$t('startTime'),
align:"center",
dataIndex: 'beginDate'
},
{
title:this.$t('endtime'),
align:"center",
dataIndex: 'endDate'
},
{
title:this.$t('status'),
align:"center",
dataIndex: 'status_dictText'
},
{
title: this.$t('operation'),
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/sys/tenant/page",
delete: "/sys/tenant/delete",
deleteBatch: "/sys/tenant/deleteBatch"
},
dictOptions:{},
}
},
created() {
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>