杂务:整理文档并收口 YumiNail 修复

This commit is contained in:
xiaowang
2026-05-21 18:43:59 +08:00
parent 3797938616
commit 9227ec6175
362 changed files with 8358 additions and 19928 deletions
@@ -10,11 +10,23 @@
<a-card title="地图服务配置" :bordered="false">
<a-form layout="vertical">
<a-form-item label="腾讯位置服务 Key">
<a-input-password v-model:value="mapForm.configValue" placeholder="请输入腾讯位置服务 Key" />
<a-form-item label="当前地图渠道">
<a-radio-group v-model:value="mapProvider">
<a-radio-button value="TENCENT">腾讯地图</a-radio-button>
<a-radio-button value="AMAP">高德地图</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item label="腾讯 Web Key">
<a-input-password v-model:value="mapForms.tencentWeb.configValue" placeholder="用于后台腾讯地图选点和 Web 展示" />
</a-form-item>
<a-form-item label="高德 Web Key">
<a-input-password v-model:value="mapForms.amapWeb.configValue" placeholder="用于后台高德地图选点和 Web 展示" />
</a-form-item>
<a-form-item label="高德小程序 Key">
<a-input-password v-model:value="mapForms.amapMini.configValue" placeholder="用于后续小程序端高德 SDK / API 调用" />
</a-form-item>
<a-form-item label="备注">
<a-textarea v-model:value="mapForm.remark" :rows="2" placeholder="例如:用于后台店铺选点和腾讯地图展示" />
<a-textarea v-model:value="mapRemark" :rows="2" placeholder="例如:默认使用腾讯地图,高德小程序 Key 单独申请填写" />
</a-form-item>
<a-form-item>
<a-space>
@@ -46,7 +58,7 @@
<div class="muted">通道ID:{{ record.channelId || '由 MessageHub 自动选择' }}</div>
</template>
<template v-else-if="column.key === 'enabled'">
<a-switch :checked="record.enabled === 1" @change="checked => toggleStatus(record as MessageHubPushConfigVO, Boolean(checked))" />
<a-switch :checked="record.enabled === 1" @change="(checked: any) => toggleStatus(record as MessageHubPushConfigVO, Boolean(checked))" />
</template>
<template v-else-if="column.key === 'action'">
<a-space>
@@ -122,13 +134,21 @@ const testPhone = ref('')
const configs = ref<MessageHubPushConfigVO[]>([])
const savingMap = ref(false)
const mapEnabled = ref(true)
const mapForm = reactive({
const mapProvider = ref<'TENCENT' | 'AMAP'>('TENCENT')
const mapRemark = ref('地图渠道由平台管理员选择;高德 Web Key 与高德小程序 Key 分开填写。')
const createMapForm = (configKey: string, configName: string, remark: string) => ({
configGroup: 'MAP',
configKey: 'TENCENT_MAP_KEY',
configName: '腾讯位置服务 Key',
configKey,
configName,
configValue: '',
enabled: 1,
remark: '用于后台店铺选点和腾讯地图展示'
remark
})
const mapForms = reactive({
provider: createMapForm('MAP_PROVIDER', '当前地图渠道', 'TENCENT 或 AMAP;决定后台店铺选点默认使用哪个地图渠道'),
tencentWeb: createMapForm('TENCENT_MAP_KEY', '腾讯 Web Key', '用于后台腾讯地图选点和 Web 展示'),
amapWeb: createMapForm('AMAP_WEB_KEY', '高德 Web Key', '用于后台高德地图选点和 Web 展示'),
amapMini: createMapForm('AMAP_MINI_KEY', '高德小程序 Key', '用于后续小程序端高德 SDK / API 调用')
})
const sceneOptions = [
@@ -177,11 +197,18 @@ const load = async () => {
adminSystemParameterConfigApi.listConfigs('MAP')
])
configs.value = messageConfigs
const providerConfig = mapConfigs.find(item => item.configKey === 'MAP_PROVIDER')
const tencentMapConfig = mapConfigs.find(item => item.configKey === 'TENCENT_MAP_KEY')
if (tencentMapConfig) {
Object.assign(mapForm, tencentMapConfig)
mapEnabled.value = tencentMapConfig.enabled === 1
const amapWebConfig = mapConfigs.find(item => item.configKey === 'AMAP_WEB_KEY')
const amapMiniConfig = mapConfigs.find(item => item.configKey === 'AMAP_MINI_KEY')
if (providerConfig?.configValue) {
mapProvider.value = providerConfig.configValue === 'AMAP' ? 'AMAP' : 'TENCENT'
mapEnabled.value = providerConfig.enabled === 1
Object.assign(mapForms.provider, providerConfig)
}
if (tencentMapConfig) Object.assign(mapForms.tencentWeb, tencentMapConfig)
if (amapWebConfig) Object.assign(mapForms.amapWeb, amapWebConfig)
if (amapMiniConfig) Object.assign(mapForms.amapMini, amapMiniConfig)
} finally {
loading.value = false
}
@@ -191,7 +218,20 @@ const saveMapConfig = async () => {
savingMap.value = true
try {
await adminSystemParameterConfigApi.saveConfig({
...mapForm,
...mapForms.provider,
configValue: mapProvider.value,
enabled: mapEnabled.value ? 1 : 0
})
await adminSystemParameterConfigApi.saveConfig({
...mapForms.tencentWeb,
enabled: mapEnabled.value ? 1 : 0
})
await adminSystemParameterConfigApi.saveConfig({
...mapForms.amapWeb,
enabled: mapEnabled.value ? 1 : 0
})
await adminSystemParameterConfigApi.saveConfig({
...mapForms.amapMini,
enabled: mapEnabled.value ? 1 : 0
})
message.success('地图配置已保存')