Skip to content

Commit

Permalink
feat: #1076 #1077 优化发布配置、平台导入、插件商店使用体验 - 修复自定义添加失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 7, 2024
1 parent 04ffd42 commit d2c2730
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/components/set/publish/form/PlatformAddForm.vue
Expand Up @@ -165,7 +165,10 @@ const initForm = async (ptype: PlatformType, subtype: SubPlatformType) => {
? svgIcons.iconEPPlus
: `<img src="${platform.img}" alt="platform-icon" class="img-platform-icon" style="width: 32px;height: 32px;"/>`
if (pkey && subtype) {
const pkeyAvailable = !StrUtil.isEmptyString(pkey)
const subtypeAvailable = !StrUtil.isEmptyString(subtype)
if (pkeyAvailable && subtypeAvailable) {
formData.subtype = subtype
// 如果pkey对应的配置存在,初始化新的
Expand All @@ -187,7 +190,7 @@ const initForm = async (ptype: PlatformType, subtype: SubPlatformType) => {
formData.isPre = true
logger.debug("Initialized via pkey")
}
} else if (subtype) {
} else if (subtypeAvailable) {
// 子类型初始化
formData.subtype = subtype
const newKey = getNewPlatformKey(ptype, subtype)
Expand Down Expand Up @@ -275,7 +278,7 @@ initPage()
</el-form-item>

<el-form-item>
<el-button type="primary" @click="submitForm(formRef)">{{ t("dynamic.platform.opt.add") }} </el-button>
<el-button type="primary" @click="submitForm(formRef)">{{ t("dynamic.platform.opt.add") }}</el-button>
</el-form-item>
</el-form>
</back-page>
Expand All @@ -296,6 +299,7 @@ $icon_size = 32px
height $icon_size
margin-right -4px
vertical-align middle
:deep(.el-icon svg)
width $icon_size
height $icon_size
Expand Down
10 changes: 7 additions & 3 deletions src/components/set/publish/form/PlatformQuickAdd.vue
Expand Up @@ -111,8 +111,12 @@ const handleAddPlatform = (cfg?: DynamicConfig) => {
//
// router.push(query)
const url = `/setting/platform/add/${cfg?.platformType}?showBack=trye&key=${cfg?.platformKey}&sub=${cfg?.subPlatformType}`
goToPublisherDrawer(`添加 ${cfg?.platformName ?? cfg?.platformType} 平台`, url)
const platformGroup = cfg?.platformType ?? ""
const platformKey = cfg?.platformKey ?? ""
const subPlatformType = cfg?.subPlatformType ?? ""
const url = `/setting/platform/add/${platformGroup}?showBack=trye&key=${platformKey}&sub=${subPlatformType}`
const title = CrossPageUtils.longPlatformName(cfg?.platformName ?? cfg?.platformType ?? "")
goToPublisherDrawer(`添加 ${title} 平台`, url)
}
const initPage = () => {
Expand Down Expand Up @@ -157,7 +161,7 @@ onMounted(() => {
</div>
</div>
<div class="add-action" v-if="type !== 'all'">
<el-button type="primary" size="large" @click="handleAddPlatform({ platformType: type} as any)">
<el-button type="primary" size="large" @click="handleAddPlatform({ platformType: type } as any)">
添加自定义 {{ formData.platformGroup?.title ?? type }} 对接
</el-button>
</div>
Expand Down

0 comments on commit d2c2730

Please sign in to comment.