mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 新增代码生成页面
This commit is contained in:
25
src/components/advanced/table-column-check-alert.vue
Normal file
25
src/components/advanced/table-column-check-alert.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: 'TableColumnCheckAlert'
|
||||
});
|
||||
|
||||
const checkedRowKeys = defineModel<CommonType.IdType[]>('columns', { required: true });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NAlert type="info">
|
||||
<span v-if="checkedRowKeys.length">
|
||||
已选择{{ checkedRowKeys.length }}条记录
|
||||
<NButton class="pl-6px" text type="primary" @click="() => (checkedRowKeys = [])">清空</NButton>
|
||||
</span>
|
||||
<span v-else>未选中任何记录</span>
|
||||
</NAlert>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.n-alert {
|
||||
--n-padding: 5px 13px !important;
|
||||
--n-icon-margin: 6px 8px 0 12px !important;
|
||||
--n-icon-size: 20px !important;
|
||||
}
|
||||
</style>
|
@ -9,9 +9,15 @@ interface Props {
|
||||
itemAlign?: NaiveUI.Align;
|
||||
disabledDelete?: boolean;
|
||||
loading?: boolean;
|
||||
showAdd?: boolean;
|
||||
showDelete?: boolean;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
withDefaults(defineProps<Props>(), {
|
||||
itemAlign: undefined,
|
||||
showAdd: true,
|
||||
showDelete: true
|
||||
});
|
||||
|
||||
interface Emits {
|
||||
(e: 'add'): void;
|
||||
@ -42,13 +48,13 @@ function refresh() {
|
||||
<NSpace :align="itemAlign" wrap justify="end" class="lt-sm:w-200px">
|
||||
<slot name="prefix"></slot>
|
||||
<slot name="default">
|
||||
<NButton size="small" ghost type="primary" @click="add">
|
||||
<NButton v-if="showAdd" size="small" ghost type="primary" @click="add">
|
||||
<template #icon>
|
||||
<icon-ic-round-plus class="text-icon" />
|
||||
</template>
|
||||
{{ $t('common.add') }}
|
||||
</NButton>
|
||||
<NPopconfirm @positive-click="batchDelete">
|
||||
<NPopconfirm v-if="showDelete" @positive-click="batchDelete">
|
||||
<template #trigger>
|
||||
<NButton size="small" ghost type="error" :disabled="disabledDelete">
|
||||
<template #icon>
|
||||
|
Reference in New Issue
Block a user