<template>
|
<a-card :bordered="false">
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row :gutter="24">
|
<a-col :md="6" :sm="12">
|
<a-form-item label="模板名称">
|
<j-input placeholder="输入模板名称模糊查询" v-model="queryParam.name"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :md="6" :sm="12">
|
<a-form-item label="模板类型">
|
<j-input placeholder="输入模板类型模糊查询" v-model="queryParam.fileType"></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :md="6" :sm="12">
|
<a-form-item label="创建人">
|
<j-input placeholder="输入模板创建人模糊查询" v-model="queryParam.createBy"></j-input>
|
</a-form-item>
|
</a-col>
|
|
|
<template v-if="toggleSearchStatus">
|
|
</template>
|
|
<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">查询</a-button>
|
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
<a @click="handleToggleSearch" style="margin-left: 8px">
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
|
</a>
|
</span>
|
</a-col>
|
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 操作按钮区域 -->
|
<div class="table-operator" style="border-top: 5px">
|
<a-button @click="handleAdd" type="primary" icon="plus" >上传</a-button>
|
<!-- <a-button type="primary" icon="download" @click="handleExportXls('模板信息')">导出</a-button>-->
|
<!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">回收站</a-button>-->
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-menu slot="overlay" @click="handleMenuClick">
|
<a-menu-item key="1">
|
<a-icon type="delete" @click="batchDel" />
|
删除
|
</a-menu-item>
|
|
</a-menu>
|
<a-button style="margin-left: 8px">
|
批量操作
|
<a-icon type="down" />
|
</a-button>
|
</a-dropdown>
|
|
|
<j-super-query :fieldList="superQueryFieldList" @handleSuperQuery="handleSuperQuery" />
|
</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> 已选择 <a
|
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
</div>
|
|
<a-table
|
size="middle"
|
:scroll="{x: 1500}"
|
rowKey="id"
|
:columns="columns"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
@change="handleTableChange">
|
|
|
<!-- 字符串超长截取省略号显示-->
|
<span slot="esContent" slot-scope="text">
|
<j-ellipsis :value="text" :length="32" />
|
</span>
|
|
<span slot="esContent2" slot-scope="text">
|
<j-ellipsis :value="text" :length="18" />
|
</span>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
<a @click="download(record)">下载</a>
|
|
<a-divider type="vertical" />
|
<a @click="handleEdit(record)">编辑</a>
|
|
<a-divider type="vertical" />
|
|
<a-dropdown>
|
<a class="ant-dropdown-link">
|
更多 <a-icon type="down" />
|
</a>
|
<a-menu slot="overlay">
|
|
<a-menu-item>
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
|
</a-menu>
|
</a-dropdown>
|
|
|
</span>
|
|
</a-table>
|
</div>
|
<!-- table区域-end -->
|
|
<upload-template-modal ref="modalForm" @ok="modalFormOk"></upload-template-modal>
|
</a-card>
|
</template>
|
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import UploadTemplateModal from '@views/pro/modules/UploadTemplateModal'
|
|
export default {
|
name: 'TemplateList',
|
components: { UploadTemplateModal },
|
mixins: [JeecgListMixin],
|
data() {
|
return {
|
description: '模板管理页面',
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '名称',
|
align: 'center',
|
dataIndex: 'name',
|
width: 200,
|
scopedSlots: { customRender: 'esContent' }
|
},
|
|
{
|
title: '模板类型',
|
align: 'center',
|
dataIndex: 'fileType',
|
width: 100,
|
scopedSlots: { customRender: 'esContent' }
|
},
|
{
|
title: '模板描述',
|
align: 'center',
|
dataIndex: 'description',
|
width: 200,
|
scopedSlots: { customRender: 'esContent2' }
|
},
|
{
|
title: '创建人',
|
align: 'center',
|
dataIndex: 'createBy',
|
width: 100
|
|
},
|
{
|
title: '创建时间',
|
align: 'center',
|
dataIndex: 'createTime',
|
width: 160,
|
sorter: true
|
|
},
|
,
|
{
|
title: '更新人',
|
align: 'center',
|
dataIndex: 'updateBy',
|
width: 100
|
|
},
|
{
|
title: '更新时间',
|
align: 'center',
|
dataIndex: 'updateTime',
|
width: 160,
|
sorter: true
|
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
fixed: 'right',
|
scopedSlots: { customRender: 'action' },
|
align: 'center',
|
width: 200
|
}
|
],
|
superQueryFieldList: [
|
{ type: 'input', value: 'name', text: '模板名称' },
|
{ type: 'input', value: 'createBy', text: '创建人' }
|
],
|
url: {
|
list: '/pro/template/list',
|
delete: '/pro/template/delete',
|
deleteBatch: '/pro/template/deleteBatch'
|
}
|
}
|
},
|
methods: {
|
handleMenuClick(e) {
|
if (e.key == 1) {
|
this.batchDel()
|
}
|
},
|
download(record){
|
this.downloadFile(record.filePath)
|
|
}
|
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|