feat: 处理权限
This commit is contained in:
@@ -6,13 +6,13 @@ import { ref } from 'vue';
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space,Tag } from 'ant-design-vue';
|
||||
import { Modal, Popconfirm, Space, Tag } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
@@ -76,7 +76,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-rentalPlan-index'
|
||||
id: 'property-rentalPlan-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@@ -103,7 +103,7 @@ async function handleDelete(row: Required<RentalPlanForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
async function handleView(row: Required<RentalPlanForm>) {
|
||||
modalApi.setData({ id: row.id, readonly: true,});
|
||||
modalApi.setData({ id: row.id, readonly: true });
|
||||
modalApi.open();
|
||||
}
|
||||
function handleMultiDelete() {
|
||||
@@ -121,11 +121,15 @@ function handleMultiDelete() {
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(rentalPlanExport, '绿植租赁-租赁方案数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
commonDownloadExcel(
|
||||
rentalPlanExport,
|
||||
'绿植租赁-租赁方案数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -144,7 +148,8 @@ function handleDownloadExcel() {
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:rentalPlan:remove']"
|
||||
@click="handleMultiDelete">
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
@@ -158,7 +163,9 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #rentalPeriod="{ row }">
|
||||
<div>
|
||||
{{ row.rentalPeriod == 0?'月':row.rentalPeriod == 1 ? '季度':'年' }}
|
||||
{{
|
||||
row.rentalPeriod == 0 ? '月' : row.rentalPeriod == 1 ? '季度' : '年'
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
<template #state="{ row }">
|
||||
@@ -167,7 +174,12 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button>
|
||||
<ghost-button
|
||||
@click.stop="handleView(row)"
|
||||
v-access:code="['property:rentalPlan:query']"
|
||||
>
|
||||
查看
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:rentalPlan:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
|
Reference in New Issue
Block a user