chore: lint
This commit is contained in:
@@ -27,9 +27,7 @@
|
||||
<div>
|
||||
<h1 class="text-h6 font-weight-black">{{ station.name }}</h1>
|
||||
|
||||
<span class="text-caption text-white-70"
|
||||
>第 {{ currentStationIndex }} 站 / 共 11 站</span
|
||||
>
|
||||
<span class="text-caption text-white-70">第 {{ currentStationIndex }} 站 / 共 11 站</span>
|
||||
</div>
|
||||
</div>
|
||||
</v-card-item>
|
||||
@@ -361,22 +359,22 @@ const formValues = reactive<Record<string, any>>({})
|
||||
// 監聽 code 改變,初始化表單預設值
|
||||
watch(
|
||||
code,
|
||||
(newCode) => {
|
||||
newCode => {
|
||||
if (stationsSpec[newCode]) {
|
||||
// 優先從 store 中讀取已有的測量數據
|
||||
const existing = store.measurements[newCode]
|
||||
for (const field of stationsSpec[newCode].fields) {
|
||||
formValues[field.key] =
|
||||
existing && existing.completed && existing.values[field.key] !== undefined
|
||||
formValues[field.key]
|
||||
= existing && existing.completed && existing.values[field.key] !== undefined
|
||||
? existing.values[field.key]
|
||||
: field.defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function handleSave() {
|
||||
function handleSave () {
|
||||
// 將數據儲存到 store
|
||||
store.saveMeasurement(code.value, { ...formValues })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user