Commit 1cbdf063 authored by daniel's avatar daniel

fix(mainsite): 修复点位管理三个bug

- 图标上传增加格式限制和提示(PNG/JPG/SVG/WebP)
- 编辑点位方法判断从 isAddMode 改为 isEditMarker,修复编辑变新增
- 删除点位 finally 中 loading 重置为 false,修复删除后UI卡死
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent c6703378
...@@ -134,10 +134,12 @@ ...@@ -134,10 +134,12 @@
:max="1" :max="1"
v-model:file-list="fileList" v-model:file-list="fileList"
list-type="image-card" list-type="image-card"
accept=".png,.jpg,.jpeg,.svg,.webp"
@finish="uploadFinish" @finish="uploadFinish"
> >
点击上传 点击上传
</n-upload> </n-upload>
<span style="color:#999;font-size:12px;">支持 PNG/JPG/SVG/WebP 格式,推荐 PNG 透明背景</span>
</n-form-item> </n-form-item>
<n-form-item label="排序" path="sortOrder"> <n-form-item label="排序" path="sortOrder">
<n-input-number v-model:value="formData.sortOrder" placeholder="请输入排序" /> <n-input-number v-model:value="formData.sortOrder" placeholder="请输入排序" />
...@@ -492,7 +494,7 @@ ...@@ -492,7 +494,7 @@
message.error(data.msg) message.error(data.msg)
} }
}).finally(() => { }).finally(() => {
loading.value = true loading.value = false
messageReactive.destroy() messageReactive.destroy()
showDelModal.value = false showDelModal.value = false
}) })
......
...@@ -229,11 +229,12 @@ ...@@ -229,11 +229,12 @@
:max="1" :max="1"
v-model:file-list="fileList" v-model:file-list="fileList"
list-type="image-card" list-type="image-card"
accept=".png,.jpg,.jpeg,.svg,.webp"
@finish="uploadFinish" @finish="uploadFinish"
> >
点击上传 点击上传
</n-upload> </n-upload>
<span>推荐像素50x50px</span> <span style="color:#999;font-size:12px;">支持 PNG/JPG/SVG/WebP,推荐50x50px PNG 透明背景</span>
</n-form-item> </n-form-item>
<n-form-item label="描述" path="description"> <n-form-item label="描述" path="description">
<n-input v-model:value="markerForm.description" placeholder="请输入描述" /> <n-input v-model:value="markerForm.description" placeholder="请输入描述" />
...@@ -1397,7 +1398,7 @@ ...@@ -1397,7 +1398,7 @@
message.error(data.msg) message.error(data.msg)
} }
}).finally(() => { }).finally(() => {
loading.value = true loading.value = false
messageReactive.destroy() messageReactive.destroy()
refreshLiveMap() refreshLiveMap()
}) })
...@@ -1424,7 +1425,7 @@ ...@@ -1424,7 +1425,7 @@
}) })
// 发起请求 // 发起请求
const [err, data] = await to(fetch("/gk/location-point", { const [err, data] = await to(fetch("/gk/location-point", {
method: isAddMode.value ? 'POST' : 'PUT', method: isEditMarker.value ? 'PUT' : 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment