Compare commits

...

2 Commits

Author SHA1 Message Date
fyy
3cad95d185 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
/ Explore-Gitea-Actions (push) Failing after 5m51s
2025-08-22 13:03:57 +08:00
fyy
060fd5485e feat: 处理权限 2025-08-22 12:59:03 +08:00
4 changed files with 50 additions and 25 deletions

View File

@ -276,7 +276,7 @@ defineExpose({
</div>
</div>
<div>
<Button type="primary" @click="handleAdd">新增排班</Button>
<Button type="primary" @click="handleAdd" v-access:code="['Property:arrangement:add']">新增排班</Button>
</div>
</div>
<div class="flex-1 p-1">
@ -295,12 +295,16 @@ defineExpose({
<a
style="margin-left: 4px; color: #1890ff; cursor: pointer"
@click.stop="handleEdit(item.item, current)"
v-access:code="['Property:arrangement:edit']"
>
编辑
</a>
<a
style="margin-left: 4px; color: #ff4d4f; cursor: pointer"
@click.stop="handleDelete(item.item)"
v-access:code="['Property:arrangement:remove']"
>
删除
</a>
@ -311,6 +315,7 @@ defineExpose({
v-if="getListData2(current).length > 0"
style="margin-left: 4px; color: #1890ff; cursor: pointer"
@click.stop="handleViewDateDetails(current)"
v-access:code="['Property:userGroup:queryScheduleView']"
>
详情
</a>

View File

@ -6,7 +6,7 @@ import { $t } from '@vben/locales';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
orderChargeList,
@ -51,7 +51,7 @@ const gridOptions: VxeGridProps = {
rowConfig: {
keyField: 'id',
},
id: 'property-orderCharge-index'
id: 'property-orderCharge-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
@ -112,7 +112,8 @@ function handleMultiDelete() {
danger
type="primary"
v-access:code="['property:orderCharge:remove']"
@click="handleMultiDelete">
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
@ -128,6 +129,7 @@ function handleMultiDelete() {
<Space>
<ghost-button
@click.stop="handleInfo(row)"
v-access:code="['property:orderCharge:query']"
>
{{ $t('pages.common.info') }}
</ghost-button>

View File

@ -12,7 +12,7 @@ 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, {
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)"

View File

@ -1,5 +1,4 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
@ -8,7 +7,7 @@ import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
@ -62,7 +61,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id',
},
//
id: 'property-rentalOrder-index'
id: 'property-rentalOrder-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
@ -108,9 +107,14 @@ function handleMultiDelete() {
}
function handleDownloadExcel() {
commonDownloadExcel(rentalOrderExport, '绿植租赁-订单管理数据', tableApi.formApi.form.values, {
commonDownloadExcel(
rentalOrderExport,
'绿植租赁-订单管理数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
});
},
);
}
</script>
@ -130,7 +134,8 @@ function handleDownloadExcel() {
danger
type="primary"
v-access:code="['property:rentalOrder:remove']"
@click="handleMultiDelete">
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button
@ -146,7 +151,8 @@ function handleDownloadExcel() {
<Space>
<ghost-button
v-access:code="['property:rentalOrder:query']"
@click.stop="handleInfo(row)">
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<Popconfirm