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 180eea5 commit bf2d8e2
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/set/publish/form/PlatformQuickAdd.vue
Expand Up @@ -236,9 +236,9 @@ $icon_size = 32px
text-align center

:deep(.el-drawer)
--el-drawer-padding-primary: var(--el-dialog-padding-primary, 0);
--el-drawer-padding-primary var(--el-dialog-padding-primary, 0)

:deep(.el-drawer__header)
padding: 20px;
padding: 20px
margin-bottom 0
</style>
68 changes: 65 additions & 3 deletions src/components/set/publish/platform/PublishPlatformImport.vue
Expand Up @@ -27,7 +27,7 @@
import { DynamicConfig, DynamicJsonCfg, isDynamicKeyExists, setDynamicJsonCfg } from "~/src/platforms/dynamicConfig.ts"
import { DYNAMIC_CONFIG_KEY } from "~/src/utils/constants.ts"
import { DateUtil, JsonUtil } from "zhi-common"
import { markRaw, onMounted, reactive } from "vue"
import { markRaw, onMounted, reactive, ref } from "vue"
import { SypConfig } from "~/syp.config.ts"
import _ from "lodash-es"
import { pre } from "~/src/platforms/pre.ts"
Expand All @@ -43,6 +43,13 @@ const logger = createAppLogger("publish-platform-import")
const { t } = useVueI18n()
const { getSetting, updateSetting, deleteKey } = usePublishSettingStore()
// 自定义导入
const showCustomImportDrawer = ref(false)
const customImportDrawerTitle = ref("")
// 挂件 v0.8.1 导入
const showWidgetImportDrawer = ref(false)
const widgetImportDrawerTitle = ref("")
// datas
const formData = reactive({
setting: {} as typeof SypConfig,
Expand Down Expand Up @@ -130,6 +137,16 @@ const doImportAll = async () => {
}
}
const handleImportCustom = () => {
showCustomImportDrawer.value = true
customImportDrawerTitle.value = "自定义导入"
}
const handleImportLegencySypWidget = () => {
showWidgetImportDrawer.value = true
widgetImportDrawerTitle.value = "从「挂件版」 v0.8.1 导入"
}
// init
const initPage = async () => {
formData.setting = await getSetting()
Expand All @@ -150,8 +167,14 @@ onMounted(async () => {
<template>
<div class="flex flex-wrap gap-4 import-select">
<el-card shadow="always" class="select-item" @click="handleImportAll"> 一键全部导入</el-card>
<el-card shadow="hover" class="select-item">自定义导入</el-card>
<el-card shadow="hover" class="select-item">从旧版 v0.8.1 版本「思源笔记挂件」导入</el-card>
<el-card shadow="hover" class="select-item" @click="handleImportCustom">自定义导入</el-card>
<el-card shadow="hover" class="select-item" @click="handleImportLegencySypWidget">
从旧版 v0.8.1 版本「思源笔记挂件」导入
</el-card>

<!--
-----------------------------------------------------------------------------
-->

<div class="log-message-box">
<el-input
Expand All @@ -162,6 +185,35 @@ onMounted(async () => {
placeholder="日志信息"
></el-input>
</div>

<!--
-----------------------------------------------------------------------------
-->

<!-- 抽屉占位 -->
<el-drawer
v-model="showCustomImportDrawer"
size="85%"
:title="customImportDrawerTitle"
direction="rtl"
:destroy-on-close="true"
>
<div class="import-panel">
<el-button>aaaaa</el-button>
</div>
</el-drawer>

<el-drawer
v-model="showWidgetImportDrawer"
size="85%"
:title="widgetImportDrawerTitle"
direction="rtl"
:destroy-on-close="true"
>
<div class="import-panel">
<el-button>bbbb</el-button>
</div>
</el-drawer>
</div>
</template>

Expand All @@ -174,4 +226,14 @@ onMounted(async () => {
.log-message-box
margin 10px 20px
:deep(.el-drawer)
--el-drawer-padding-primary var(--el-dialog-padding-primary, 0)
:deep(.el-drawer__header)
padding: 20px
margin-bottom 0
.import-panel
padding 0 16px
</style>
6 changes: 2 additions & 4 deletions src/components/set/publish/platform/PublishPlatformStore.vue
Expand Up @@ -31,15 +31,13 @@ import { onMounted, reactive, ref } from "vue"
import { SypConfig } from "~/syp.config.ts"
import { usePublishSettingStore } from "~/src/stores/usePublishSettingStore.ts"
import { createAppLogger } from "~/src/utils/appLogger.ts"
import { useVueI18n } from "~/src/composables/useVueI18n.ts"
import { usePlatformDefine } from "~/src/composables/usePlatformDefine.ts"
const logger = createAppLogger("publish-platform-import")
// uses
const { t } = useVueI18n()
const { getSetting, updateSetting, deleteKey } = usePublishSettingStore()
const { getPrePlatformKeys, platformTypeList, getPrePlatformList } = usePlatformDefine()
const { getSetting } = usePublishSettingStore()
const { platformTypeList } = usePlatformDefine()
// datas
const selectPlatformGroup = ref("all")
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Admin.vue
Expand Up @@ -609,9 +609,9 @@ onBeforeMount(async () => {
padding-left 2px
:deep(.el-drawer)
--el-drawer-padding-primary: var(--el-dialog-padding-primary, 0);
--el-drawer-padding-primary var(--el-dialog-padding-primary, 0)
:deep(.el-drawer__header)
padding: 20px;
padding: 20px
margin-bottom 0
</style>

0 comments on commit bf2d8e2

Please sign in to comment.