|
|
@ -24,11 +24,11 @@ |
|
|
|
import { list } from './api'; |
|
|
|
import { formSchemas, columns } from './data'; |
|
|
|
import detailDrawer from './detailDrawer.vue'; |
|
|
|
import { ref, onMounted } from 'vue'; |
|
|
|
import { ref } from 'vue'; |
|
|
|
import faultModal from './faultModal.vue'; |
|
|
|
import dayjs from 'dayjs'; |
|
|
|
defineOptions({ name: 'WaitPatrol' }); |
|
|
|
const [registerTable, { reload, getForm }] = useTable({ |
|
|
|
const [registerTable, { reload, getForm}] = useTable({ |
|
|
|
rowSelection: { |
|
|
|
type: 'checkbox', |
|
|
|
}, |
|
|
@ -55,16 +55,6 @@ |
|
|
|
fixed: 'right', |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
//抽屉 |
|
|
|
const detailDrawerRef = ref(); |
|
|
|
const handleDetail = () => { |
|
|
|
detailDrawerRef.value.showDrawer(); |
|
|
|
}; |
|
|
|
const faultModalRef = ref(); |
|
|
|
const handleReport = () => { |
|
|
|
faultModalRef.value.showModal(); |
|
|
|
}; |
|
|
|
let selectDateRange = ref<any>([]); |
|
|
|
const changeDate = async (type: any) => { |
|
|
|
const today = dayjs().format('YYYY-MM-DD'); |
|
|
@ -76,25 +66,28 @@ |
|
|
|
}); |
|
|
|
reload(); |
|
|
|
localStorage.setItem( |
|
|
|
'currentDate', |
|
|
|
JSON.stringify({ scheduleStartDate: today, scheduleEndDate: selectDay }), |
|
|
|
); |
|
|
|
'currentType',type); |
|
|
|
}; |
|
|
|
const beforDateSearch = async (date: any) => { |
|
|
|
await getForm().setFieldsValue({ |
|
|
|
scheduleStartDate: date[0], |
|
|
|
scheduleEndDate: date[1], |
|
|
|
}); |
|
|
|
reload(); |
|
|
|
const lastType = localStorage.getItem('currentType') |
|
|
|
setTimeout(()=>{ |
|
|
|
if(lastType){ |
|
|
|
changeDate(lastType) |
|
|
|
} |
|
|
|
},1000) |
|
|
|
|
|
|
|
|
|
|
|
//抽屉 |
|
|
|
const detailDrawerRef = ref(); |
|
|
|
const handleDetail = () => { |
|
|
|
detailDrawerRef.value.showDrawer(); |
|
|
|
}; |
|
|
|
onMounted(async () => { |
|
|
|
const currentDate = JSON.parse(localStorage.getItem('currentDate')); |
|
|
|
console.log(currentDate) |
|
|
|
await getForm().setFieldsValue({ |
|
|
|
scheduleStartDate: currentDate[0], |
|
|
|
scheduleEndDate: currentDate[1], |
|
|
|
}); |
|
|
|
}); |
|
|
|
const faultModalRef = ref(); |
|
|
|
const handleReport = () => { |
|
|
|
faultModalRef.value.showModal(); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped></style> |
|
|
|