mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
ad360e81cb
perf: 优化antdv4 示例授权页面tree的样式 build: publish success chore: 1 chore: 1 chore: 1 fix: getFileName支持item参数 https://github.com/fast-crud/fast-crud/issues/385 fix: fs-form独立使用支持插槽 https://github.com/fast-crud/fast-crud/issues/389 fix: 修复三级以上路由页面无法缓存的问题 https://github.com/fast-crud/fast-crud/issues/394 perf: form.wrapper.buttons支持compute动态计算 feat: 表单支持变更关闭前提醒保存,form.wrapper支持beforeClose事件 fix: 修复图片裁剪按钮上下和左右相反的bug https://github.com/fast-crud/fast-crud/issues/402 perf: alioss getAuthorization接口支持后台返回key https://github.com/fast-crud/fast-crud/issues/405 perf: alioss getAuthorization接口支持后台返回key https://github.com/fast-crud/fast-crud/issues/405 perf: fs-dict-tree支持插槽 https://github.com/fast-crud/fast-crud/issues/407 perf: 单选、多选、select、tree-select、table-select 都提供selected-change事件,可以获取选中的dict选项 feat: table-select 支持查看模式 https://github.com/fast-crud/fast-crud/issues/413 perf: 优化fs-admin可以在手机上操作 chore: pnpm workspace问题优化 docs: 1 chore: antdv4 支持主题色选择 ...
58 lines
1.7 KiB
Vue
58 lines
1.7 KiB
Vue
<template>
|
||
<fs-page>
|
||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||
<template #actionbar-right>
|
||
<span>示例说明:1、勾选记录,然后点击下方pagination左边的删除按钮进行批量删除。2、第一条记录配置为不可选</span>
|
||
</template>
|
||
<template #pagination-left>
|
||
<a-tooltip title="批量删除">
|
||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||
</a-tooltip>
|
||
</template>
|
||
</fs-crud>
|
||
</fs-page>
|
||
</template>
|
||
|
||
<script lang="ts">
|
||
import { defineComponent, onMounted } from "vue";
|
||
import createCrudOptions from "./crud";
|
||
import { useFs } from "@fast-crud/fast-crud";
|
||
import { message, Modal } from "ant-design-vue";
|
||
import { BatchDelete } from "./api";
|
||
|
||
export default defineComponent({
|
||
name: "FeatureSelection",
|
||
setup() {
|
||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||
const selectedRowKeys = context.selectedRowKeys;
|
||
// 页面打开后获取列表数据
|
||
onMounted(() => {
|
||
crudExpose.doRefresh();
|
||
});
|
||
|
||
const handleBatchDelete = () => {
|
||
if (selectedRowKeys.value?.length > 0) {
|
||
Modal.confirm({
|
||
title: "确认",
|
||
content: `确定要批量删除这${selectedRowKeys.value.length}条记录吗`,
|
||
async onOk() {
|
||
await BatchDelete(selectedRowKeys.value);
|
||
message.info("删除成功");
|
||
crudExpose.doRefresh();
|
||
selectedRowKeys.value = [];
|
||
}
|
||
});
|
||
} else {
|
||
message.error("请先勾选记录");
|
||
}
|
||
};
|
||
|
||
return {
|
||
crudBinding,
|
||
crudRef,
|
||
handleBatchDelete
|
||
};
|
||
}
|
||
});
|
||
</script>
|