|
@@ -101,7 +101,6 @@ const colorDict = {
|
|
|
'黄': '#FDD835'
|
|
|
}
|
|
|
|
|
|
-const inputType = ref('text')
|
|
|
const isEdit = ref(false)
|
|
|
const date = ref(null)
|
|
|
const notes = ref(null) // 手账内容
|
|
@@ -142,7 +141,6 @@ const getCalendarData = async (month_key) => {
|
|
|
// 没有手账记录的时候,默认为编辑状态展示输入框
|
|
|
if (!journal.value?.notes) {
|
|
|
isEdit.value = true
|
|
|
- inputType.value = 'text'
|
|
|
}
|
|
|
} catch {}
|
|
|
}
|
|
@@ -181,17 +179,11 @@ onUnload(async () => {
|
|
|
|
|
|
const handleUpdateJournal = () => {
|
|
|
isEdit.value = true
|
|
|
- inputType.value = 'textarea'
|
|
|
notes.value = journal.value?.notes || ''
|
|
|
}
|
|
|
|
|
|
-const handleInput = () => {
|
|
|
- if (!notes.value) inputType.value = 'textarea'
|
|
|
-}
|
|
|
-
|
|
|
const handleCancel = () => {
|
|
|
isEdit.value = !journal.value?.notes ? true : false
|
|
|
- inputType.value = 'text'
|
|
|
notes.value = null
|
|
|
}
|
|
|
|
|
@@ -250,7 +242,8 @@ const handleSubmit = async () => {
|
|
|
await saveCalendarRecord(params)
|
|
|
uni.showToast({ title: '保存成功', icon: 'none', duration: 2000 })
|
|
|
disabled.value = false
|
|
|
- handleCancel()
|
|
|
+ isEdit.value = false
|
|
|
+ notes.value = null
|
|
|
getCalendarData(date.value.slice(0, 7))
|
|
|
} catch {
|
|
|
disabled.value = false
|