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

@@ -66,7 +66,7 @@
<script setup lang="ts">
import { ref ,onMounted, defineProps, defineEmits } from 'vue';
import { ref ,onMounted, defineProps, defineEmits } from 'vue';
// 定义时间单位的类型
interface TimeUnit {

View File

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