Files
certd/packages/ui/certd-client/src/views/sys/plugin/index.vue
T

62 lines
1.7 KiB
Vue
Raw Normal View History

2024-10-13 01:27:08 +08:00
<template>
2025-06-29 14:09:09 +08:00
<fs-page class="page-cert">
<template #header>
<div class="title">
{{ t("certd.pluginManagement") }}
<span class="sub">{{ t("certd.pluginBetaWarning") }}</span>
</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<!-- <template #pagination-left>-->
<!-- <a-tooltip :title="t('certd.batchDelete')">-->
<!-- <fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>-->
<!-- </a-tooltip>-->
<!-- </template>-->
</fs-crud>
</fs-page>
2024-10-13 01:27:08 +08:00
</template>
<script lang="ts" setup>
2025-04-08 23:36:50 +08:00
import { onActivated, onMounted } from "vue";
2024-10-13 01:27:08 +08:00
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "/src/locales";
2025-06-27 01:31:31 +02:00
const { t } = useI18n();
2024-10-13 01:27:08 +08:00
defineOptions({
2025-06-29 14:09:09 +08:00
name: "SysPlugin",
2024-10-13 01:27:08 +08:00
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
2025-04-08 23:36:50 +08:00
onActivated(async () => {
2025-06-29 14:09:09 +08:00
await crudExpose.doRefresh();
2025-04-08 23:36:50 +08:00
});
2024-10-13 01:27:08 +08:00
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
2025-06-29 14:09:09 +08:00
if (selectedRowKeys.value?.length > 0) {
Modal.confirm({
title: t("certd.confirm"),
content: t("certd.batchDeleteConfirm", { count: selectedRowKeys.value.length }),
async onOk() {
await DeleteBatch(selectedRowKeys.value);
message.info(t("certd.deleteSuccess"));
crudExpose.doRefresh();
selectedRowKeys.value = [];
},
});
} else {
message.error(t("certd.pleaseSelectRecord"));
}
2024-10-13 01:27:08 +08:00
};
// 页面打开后获取列表数据
onMounted(() => {
2025-06-29 14:09:09 +08:00
crudExpose.doRefresh();
2024-10-13 01:27:08 +08:00
});
</script>
<style lang="less"></style>