This commit is contained in:
sjl
2024-11-06 21:07:44 +08:00
parent 6abac988c7
commit 07ccde9f59
2 changed files with 13 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
<ProTable <ProTable
ref='proTable' ref='proTable'
:columns='columns' :columns='columns'
:init-param="initParam"
:request-api='getPqDevList' :request-api='getPqDevList'
> >
<!-- :requestApi="getRoleList" --> <!-- :requestApi="getRoleList" -->
@@ -49,6 +50,7 @@
const includedUnits = ['日', '周', '月', '自定义']; // 可以根据需要包含的单位 const includedUnits = ['日', '周', '月', '自定义']; // 可以根据需要包含的单位
const excludedUnits = ['季度','年']; // 要排除的单位 const excludedUnits = ['季度','年']; // 要排除的单位
const defaultUnits = '日'; // 默认的单位 const defaultUnits = '日'; // 默认的单位
// 表格配置项 // 表格配置项
const columns = reactive<ColumnProps<Device.ResPqDev>[]>([ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{ type: 'selection', fixed: 'left', width: 70 }, { type: 'selection', fixed: 'left', width: 70 },
@@ -100,6 +102,7 @@ const defaultUnits = '日'; // 默认的单位
include={includedUnits} include={includedUnits}
exclude={excludedUnits} exclude={excludedUnits}
default={defaultUnits} default={defaultUnits}
onUpdate-dates={handleDateChange}
/> />
</div> </div>
) )
@@ -109,6 +112,15 @@ const defaultUnits = '日'; // 默认的单位
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 }, { prop: 'operation', label: '操作', fixed: 'right', width: 200 },
]) ])
// 处理日期变化的回调函数
const handleDateChange = (startDate: Date, endDate: Date) => {
console.log('Start Date:', startDate)
console.log('End Date:', endDate)
// 这里可以添加更多的逻辑处理
}
// 打开 drawer(新增、编辑) // 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => { const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
devicePopup.value?.open(titleType, row) devicePopup.value?.open(titleType, row)