更新标题
This commit is contained in:
parent
9b0298c3bd
commit
fdff68fe92
@ -1,11 +1,11 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title>蜂快 · 运营管理系统</title>
|
||||||
<script>
|
<script>
|
||||||
window._AMapSecurityConfig = {
|
window._AMapSecurityConfig = {
|
||||||
securityJsCode: '6c7f5a402a13bf2dee1a4bbe0d8023c7'
|
securityJsCode: '6c7f5a402a13bf2dee1a4bbe0d8023c7'
|
||||||
|
|||||||
@ -81,6 +81,9 @@ router.beforeEach((to, from, next) => {
|
|||||||
next('/login')
|
next('/login')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = to.meta.title ? `${to.meta.title} - 蜂快 · 运营管理系统` : '蜂快 · 运营管理系统'
|
||||||
|
next()
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
@ -480,12 +480,31 @@ export default defineComponent({
|
|||||||
|
|
||||||
// 取消添加
|
// 取消添加
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
// 重置表单数据
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
addModalVisible.value = false
|
|
||||||
|
// 重置表单状态
|
||||||
|
formState.value = {
|
||||||
|
name: '',
|
||||||
|
business_hours: '',
|
||||||
|
address: '',
|
||||||
|
longitude: null,
|
||||||
|
latitude: null,
|
||||||
|
phone: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置搜索相关数据
|
||||||
|
searchAddress.value = ''
|
||||||
|
searchOptions.value = []
|
||||||
|
|
||||||
|
// 清除地图标记
|
||||||
if (addMarker.value) {
|
if (addMarker.value) {
|
||||||
addMarker.value.setMap(null)
|
addMarker.value.setMap(null)
|
||||||
addMarker.value = null
|
addMarker.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关闭模态框
|
||||||
|
addModalVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 图片管理相关
|
// 图片管理相关
|
||||||
@ -575,17 +594,23 @@ export default defineComponent({
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清空图片管理相关数据
|
||||||
|
const resetImageManager = () => {
|
||||||
|
fileList.value = []
|
||||||
|
currentMerchant.value = null
|
||||||
|
imageModalVisible.value = false
|
||||||
|
previewVisible.value = false
|
||||||
|
previewImage.value = ''
|
||||||
|
previewTitle.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
// 保存图片列表
|
// 保存图片列表
|
||||||
const handleSaveImages = async () => {
|
const handleSaveImages = async () => {
|
||||||
try {
|
try {
|
||||||
imagesSaving.value = true
|
imagesSaving.value = true
|
||||||
|
|
||||||
// 构造符合接口要求的数据格式
|
|
||||||
const data = {
|
const data = {
|
||||||
images: fileList.value.map((file, index) => {
|
images: fileList.value.map((file, index) => {
|
||||||
// 获取图片 URL 的优先级:
|
|
||||||
// 1. 如果是新上传的图片,从 response.urls[0] 获取
|
|
||||||
// 2. 如果是已有的图片,使用 url 字段
|
|
||||||
const imageUrl = file.response?.urls?.[0] || file.url
|
const imageUrl = file.response?.urls?.[0] || file.url
|
||||||
return {
|
return {
|
||||||
image_url: imageUrl,
|
image_url: imageUrl,
|
||||||
@ -594,13 +619,12 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打印检查数据
|
|
||||||
console.log('Saving data:', data)
|
console.log('Saving data:', data)
|
||||||
|
|
||||||
const res = await request.put(`/api/merchant/${currentMerchant.value.id}`, data)
|
const res = await request.put(`/api/merchant/${currentMerchant.value.id}`, data)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
message.success('保存成功')
|
message.success('保存成功')
|
||||||
imageModalVisible.value = false
|
resetImageManager() // 使用重置函数
|
||||||
fetchData()
|
fetchData()
|
||||||
} else {
|
} else {
|
||||||
throw new Error(res.message || '保存失败')
|
throw new Error(res.message || '保存失败')
|
||||||
@ -615,8 +639,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
// 取消图片管理
|
// 取消图片管理
|
||||||
const handleCancelImages = () => {
|
const handleCancelImages = () => {
|
||||||
fileList.value = []
|
resetImageManager() // 使用重置函数
|
||||||
imageModalVisible.value = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user