You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
5.8 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<a-card :bordered="false">
<!-- -->
<div class="table-page-search-wrapper">
<a-form-model layout="inline" :model="queryParam" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-model-item label="规则名称" prop="ruleName">
<a-input placeholder="请输入规则名称" v-model="queryParam.ruleName"></a-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-model-item label="规则Code" prop="ruleCode">
<a-input placeholder="请输入规则Code" v-model="queryParam.ruleCode"></a-input>
</a-form-model-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"></a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px"></a-button>
</span>
</a-col>
</a-row>
</a-form-model>
</div>
<!-- -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus"></a-button>
<a-button type="primary" icon="download" @click="handleExportXls('填值规则')"></a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import"></a-button>
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table-begin -->
<a-alert type="info" showIcon style="margin-bottom: 16px;">
<template slot="message">
<span></span>
<a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
<span></span>
<template v-if="selectedRowKeys.length>0">
<a-divider type="vertical"/>
<a @click="onClearSelected"></a>
</template>
</template>
</a-alert>
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<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 @click="handleTest(record)">
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a></a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
<!-- table-end -->
<!-- -->
<sys-fill-rule-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import { getAction } from '@/api/manage'
import SysFillRuleModal from './modules/SysFillRuleModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: 'SysFillRuleList',
mixins: [JeecgListMixin],
components: { SysFillRuleModal },
data() {
return {
description: '',
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: (t, r, index) => 1 + index
},
{
title: '',
align: 'center',
dataIndex: 'ruleName'
},
{
title: 'Code',
align: 'center',
dataIndex: 'ruleCode'
},
{
title: '',
align: 'center',
dataIndex: 'ruleClass'
},
{
title: '',
align: 'center',
dataIndex: 'ruleParams'
},
{
title: '',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/fillRule/list',
test: '/sys/fillRule/testFillRule',
delete: '/sys/fillRule/delete',
deleteBatch: '/sys/fillRule/deleteBatch',
exportXlsUrl: '/sys/fillRule/exportXls',
importExcelUrl: '/sys/fillRule/importExcel',
},
}
},
computed: {
importExcelUrl() {
return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`
}
},
methods: {
handleTest(record) {
let closeLoading = this.$message.loading('...', 0)
getAction(this.url.test, {
ruleCode: record.ruleCode
}).then(res => {
if (res.success) {
this.$info({
title: '',
content: '' + res.result
})
} else {
this.$message.warn(res.message)
}
}).finally(() => {
closeLoading()
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>