|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
|
|
|
<BasicTable @register="registerTable" :rowSelection="rowSelection" @change="handleTableChange">
|
|
|
|
<template #tableTitle>
|
|
|
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined">新增</a-button>
|
|
|
|
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>-->
|
|
|
|
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls">导出</a-button>-->
|
|
|
|
<a-button type="primary" preIcon="ant-design:import-outlined" @click="handleOpenImportModal">导入ZIP</a-button>
|
|
|
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
|
<template #overlay>
|
|
...
|
...
|
@@ -44,7 +44,7 @@ |
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref, reactive } from 'vue';
|
|
|
|
import { ref, reactive, watch } from 'vue';
|
|
|
|
import { UploadOutlined } from '@ant-design/icons-vue';
|
|
|
|
import { BasicTable, TableAction } from '/@/components/Table';
|
|
|
|
import { BasicModal } from '/@/components/Modal';
|
|
...
|
...
|
@@ -68,6 +68,24 @@ |
|
|
|
const progressColor = ref('#1890ff');
|
|
|
|
const uploadStatus = ref<'normal' | 'exception' | 'active' | 'success'>('normal');
|
|
|
|
|
|
|
|
// 分页信息
|
|
|
|
const pagination = ref({
|
|
|
|
current: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
total: 0,
|
|
|
|
});
|
|
|
|
|
|
|
|
// 处理表格变化事件(包括分页变化)
|
|
|
|
function handleTableChange(pag) {
|
|
|
|
if (pag) {
|
|
|
|
pagination.value = {
|
|
|
|
current: pag.current,
|
|
|
|
pageSize: pag.pageSize,
|
|
|
|
total: pag.total
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 知识库选择表单
|
|
|
|
const [registerImportForm] = useForm({
|
|
|
|
labelWidth: 100,
|
|
...
|
...
|
@@ -101,6 +119,7 @@ |
|
|
|
autoSubmitOnEnter: true,
|
|
|
|
showAdvancedButton: true,
|
|
|
|
},
|
|
|
|
pagination: pagination.value, // 传递分页配置
|
|
|
|
actionColumn: {
|
|
|
|
width: 120,
|
|
|
|
fixed: 'right',
|
|
...
|
...
|
@@ -113,7 +132,11 @@ |
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
|
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys, pagination: tablePagination }] = tableContext;
|
|
|
|
|
|
|
|
watch(tablePagination, (newVal) => {
|
|
|
|
pagination.value = newVal;
|
|
|
|
});
|
|
|
|
|
|
|
|
function handleOpenImportModal() {
|
|
|
|
importModalVisible.value = true;
|
...
|
...
|
|