feat: oss-config
This commit is contained in:
parent
1ed659177a
commit
c3f7840fe0
@ -1,6 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useAccess } from '@vben/access';
|
import { useAccess } from '@vben/access';
|
||||||
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
|
||||||
@ -71,7 +73,20 @@ const gridOptions: VxeGridProps = {
|
|||||||
showOverflow: true,
|
showOverflow: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const [BasicTable, tableApi] = useVbenVxeGrid({ formOptions, gridOptions });
|
const checked = ref(false);
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxChange: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
checkboxAll: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const [OssConfigDrawer, drawerApi] = useVbenDrawer({
|
const [OssConfigDrawer, drawerApi] = useVbenDrawer({
|
||||||
connectedComponent: ossConfigDrawer,
|
connectedComponent: ossConfigDrawer,
|
||||||
});
|
});
|
||||||
@ -88,7 +103,7 @@ async function handleEdit(record: Recordable<any>) {
|
|||||||
|
|
||||||
async function handleDelete(row: Recordable<any>) {
|
async function handleDelete(row: Recordable<any>) {
|
||||||
await ossConfigRemove(row.ossConfigId);
|
await ossConfigRemove(row.ossConfigId);
|
||||||
await tableApi.reload();
|
await tableApi.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
@ -100,7 +115,7 @@ function handleMultiDelete() {
|
|||||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
await ossConfigRemove(ids);
|
await ossConfigRemove(ids);
|
||||||
await tableApi.reload();
|
await tableApi.query();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -117,6 +132,7 @@ const { hasAccessByCodes } = useAccess();
|
|||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
<a-button
|
<a-button
|
||||||
|
:disabled="!checked"
|
||||||
danger
|
danger
|
||||||
type="primary"
|
type="primary"
|
||||||
v-access:code="['system:ossConfig:remove']"
|
v-access:code="['system:ossConfig:remove']"
|
||||||
@ -138,11 +154,10 @@ const { hasAccessByCodes } = useAccess();
|
|||||||
v-model="row.status"
|
v-model="row.status"
|
||||||
:api="() => ossConfigChangeStatus(row)"
|
:api="() => ossConfigChangeStatus(row)"
|
||||||
:disabled="!hasAccessByCodes(['system:ossConfig:edit'])"
|
:disabled="!hasAccessByCodes(['system:ossConfig:edit'])"
|
||||||
:reload="() => tableApi.reload()"
|
:reload="() => tableApi.query()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
|
||||||
<a-button
|
<a-button
|
||||||
size="small"
|
size="small"
|
||||||
type="link"
|
type="link"
|
||||||
@ -166,9 +181,8 @@ const { hasAccessByCodes } = useAccess();
|
|||||||
{{ $t('pages.common.delete') }}
|
{{ $t('pages.common.delete') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</Space>
|
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<OssConfigDrawer @reload="tableApi.reload()" />
|
<OssConfigDrawer @reload="tableApi.query()" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user