|
|
@@ -8,7 +8,7 @@
|
|
|
>
|
|
|
<a-form :model="form">
|
|
|
<a-form-item field="name" label="ID">
|
|
|
- <a-input v-model="form.id" />
|
|
|
+ <a-input v-model="form.id" placeholder="ID" />
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
|
@@ -19,6 +19,10 @@ import { reactive, ref, shallowRef, watch, getCurrentInstance } from 'vue';
|
|
|
import { fetchCheckIn } from '@/api/record';
|
|
|
import dayjs from 'dayjs';
|
|
|
const this_ = getCurrentInstance()?.appContext.config.globalProperties;
|
|
|
+interface CheckIn {
|
|
|
+ id: string;
|
|
|
+ time: string;
|
|
|
+}
|
|
|
interface CheckInPageProps {
|
|
|
modelValue: boolean;
|
|
|
}
|
|
|
@@ -37,16 +41,16 @@ watch(
|
|
|
visible.value = value;
|
|
|
}
|
|
|
);
|
|
|
-let form = reactive({
|
|
|
+const form = ref<CheckIn>({
|
|
|
id: '',
|
|
|
time: '',
|
|
|
});
|
|
|
|
|
|
const handleBeforeOk = (done: (closed: boolean) => void) => {
|
|
|
- form.time = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
- fetchCheckIn(form)
|
|
|
+ form.value.time = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ fetchCheckIn(form.value)
|
|
|
.then(res => {
|
|
|
- this_?.$message?.success('签到成功');
|
|
|
+ this_?.$message.success('签到成功');
|
|
|
done(true); // 关闭模态框
|
|
|
handleCancel();
|
|
|
})
|
|
|
@@ -55,7 +59,7 @@ const handleBeforeOk = (done: (closed: boolean) => void) => {
|
|
|
});
|
|
|
};
|
|
|
const handleCancel = () => {
|
|
|
- form = {
|
|
|
+ form.value = {
|
|
|
id: '',
|
|
|
time: '',
|
|
|
};
|