Skip to content

Commit

Permalink
feat: #276 新窗口打开时操作按钮fixed不随页面滑动
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 27, 2023
1 parent f68d567 commit 1a094b2
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 164 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -47,6 +47,9 @@
- 【文章绑定】操作非配置项,也是可选功能,放在发布页面容易造成误解,现将操作移入详情页,仅在需要将平台文章与思源笔记建立联系时候使用。新增文章无需操作,新增会自动进行绑定
- 修复浏览器插件不能使用http,只能用https问题
- 修复typecho发布文章未成功解析文章id
- 文章列表图标添加tooltip
- 插槽按钮添加文字提示
- 新窗口打开时操作按钮fixed不随页面滑动

### 开发者相关

Expand Down
78 changes: 39 additions & 39 deletions components.d.ts
Expand Up @@ -28,50 +28,50 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import "@vue/runtime-core";
import '@vue/runtime-core'

export {}

declare module "@vue/runtime-core" {
declare module '@vue/runtime-core' {
export interface GlobalComponents {
ElAlert: typeof import("element-plus/es")["ElAlert"]
ElAutocomplete: typeof import("element-plus/es")["ElAutocomplete"]
ElButton: typeof import("element-plus/es")["ElButton"]
ElButtonGroup: typeof import("element-plus/es")["ElButtonGroup"]
ElCard: typeof import("element-plus/es")["ElCard"]
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"]
ElCheckboxGroup: typeof import("element-plus/es")["ElCheckboxGroup"]
ElCol: typeof import("element-plus/es")["ElCol"]
ElColorPicker: typeof import("element-plus/es")["ElColorPicker"]
ElContainer: typeof import("element-plus/es")["ElContainer"]
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"]
ElDialog: typeof import("element-plus/es")["ElDialog"]
ElDivider: typeof import("element-plus/es")["ElDivider"]
ElForm: typeof import("element-plus/es")["ElForm"]
ElFormItem: typeof import("element-plus/es")["ElFormItem"]
ElHeader: typeof import("element-plus/es")["ElHeader"]
ElIcon: typeof import("element-plus/es")["ElIcon"]
ElInput: typeof import("element-plus/es")["ElInput"]
ElMain: typeof import("element-plus/es")["ElMain"]
ElOption: typeof import("element-plus/es")["ElOption"]
ElPageHeader: typeof import("element-plus/es")["ElPageHeader"]
ElPagination: typeof import("element-plus/es")["ElPagination"]
ElPopover: typeof import("element-plus/es")["ElPopover"]
ElRadio: typeof import("element-plus/es")["ElRadio"]
ElRadioGroup: typeof import("element-plus/es")["ElRadioGroup"]
ElRow: typeof import("element-plus/es")["ElRow"]
ElSelect: typeof import("element-plus/es")["ElSelect"]
ElSkeleton: typeof import("element-plus/es")["ElSkeleton"]
ElSwitch: typeof import("element-plus/es")["ElSwitch"]
ElTable: typeof import("element-plus/es")["ElTable"]
ElTableColumn: typeof import("element-plus/es")["ElTableColumn"]
ElTabPane: typeof import("element-plus/es")["ElTabPane"]
ElTabs: typeof import("element-plus/es")["ElTabs"]
ElTag: typeof import("element-plus/es")["ElTag"]
ElTooltip: typeof import("element-plus/es")["ElTooltip"]
ElTreeSelect: typeof import("element-plus/es")["ElTreeSelect"]
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
}
export interface ComponentCustomProperties {
vLoading: typeof import("element-plus/es")["ElLoadingDirective"]
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
133 changes: 85 additions & 48 deletions components/blog/BlogMain.vue
Expand Up @@ -92,34 +92,69 @@
<div style="text-align: center">操作</div>
</template>
<template #default="scope">
<!-- 预览 -->
<el-button
size="small"
@click="handleView(scope.$index, scope.row)"
>
<font-awesome-icon icon="fa-solid fa-book-open-reader" />
</el-button>
<!-- 发布 -->
<el-button
size="small"
@click="handleEdit(scope.$index, scope.row)"
<el-tooltip
:content="$t('siyuan.browser.menu.publish.btn')"
class="box-item"
effect="light"
placement="right"
popper-class="publish-menu-tooltip"
>
<el-button
size="small"
@click="handleEdit(scope.$index, scope.row)"
>
<font-awesome-icon icon="fa-solid fa-upload" />
</el-button>
</el-tooltip>

<!-- 预览 -->
<el-tooltip
:content="$t('siyuan.browser.menu.preview.btn')"
class="box-item"
effect="light"
placement="right"
popper-class="publish-menu-tooltip"
>
<font-awesome-icon icon="fa-solid fa-upload" />
</el-button>
<el-button
size="small"
@click="handleView(scope.$index, scope.row)"
>
<font-awesome-icon icon="fa-solid fa-book-open-reader" />
</el-button>
</el-tooltip>

<!-- anki -->
<el-button
size="small"
@click="handleAnki(scope.$index, scope.row)"
<el-tooltip
:content="$t('siyuan.browser.menu.anki.btn')"
class="box-item"
effect="light"
placement="right"
popper-class="publish-menu-tooltip"
>
<font-awesome-icon icon="fa-solid fa-credit-card" />
</el-button>
<el-button
size="small"
@click="handleAnki(scope.$index, scope.row)"
>
<font-awesome-icon icon="fa-solid fa-credit-card" />
</el-button>
</el-tooltip>

<!-- picgo -->
<el-button
size="small"
@click="handlePicgo(scope.$index, scope.row)"
<el-tooltip
:content="$t('siyuan.browser.menu.picture.btn')"
class="box-item"
effect="light"
placement="right"
popper-class="publish-menu-tooltip"
>
<font-awesome-icon icon="fa-solid fa-image" />
</el-button>
<el-button
size="small"
@click="handlePicgo(scope.$index, scope.row)"
>
<font-awesome-icon icon="fa-solid fa-image" />
</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
Expand Down Expand Up @@ -180,25 +215,25 @@
</template>

<script lang="ts" setup>
import { useI18n } from "vue-i18n"
import { onMounted, ref } from "vue"
import { LogFactory } from "~/utils/logUtil"
import { Post } from "~/utils/models/post"
import { goToPage } from "~/utils/otherlib/ChromeUtil"
import { getPageId, isInSiyuanWidget } from "~/utils/platform/siyuan/siyuanUtil"
import { SiYuanApiAdaptor } from "~/utils/platform/siyuan/siYuanApiAdaptor"
import { mdToHtml, removeTitleNumber } from "~/utils/htmlUtil"
import { getByLength } from "~/utils/strUtil"
import { CONSTANTS } from "~/utils/constants/constants"
import { formatIsoToZhDate } from "~/utils/dateUtil"
import { ElMessage, ElMessageBox } from "element-plus"
import SingleBlogDetail from "~/components/blog/singleWin/SingleBlogDetail.vue"
import SinglePublish from "~/components/blog/singleWin/singlePublish.vue"
import { getPublishCfg } from "~/utils/publishUtil"
import { isEmptyString, parseBoolean } from "~/utils/util"
import { isInSiyuanNewWinBrowser } from "~/utils/otherlib/siyuanBrowserUtil"
import SingleAnki from "~/components/blog/singleWin/SingleAnki.vue"
import SinglePicgo from "~/components/blog/singleWin/SinglePicgo.vue"
import { useI18n } from "vue-i18n";
import { onMounted, ref, toRaw } from "vue";
import { LogFactory } from "~/utils/logUtil";
import { Post } from "~/utils/models/post";
import { goToPage } from "~/utils/otherlib/ChromeUtil";
import { getPageId, isInSiyuanWidget } from "~/utils/platform/siyuan/siyuanUtil";
import { SiYuanApiAdaptor } from "~/utils/platform/siyuan/siYuanApiAdaptor";
import { mdToHtml, removeTitleNumber } from "~/utils/htmlUtil";
import { getByLength } from "~/utils/strUtil";
import { CONSTANTS } from "~/utils/constants/constants";
import { formatIsoToZhDate } from "~/utils/dateUtil";
import { ElMessage, ElMessageBox } from "element-plus";
import SingleBlogDetail from "~/components/blog/singleWin/SingleBlogDetail.vue";
import SinglePublish from "~/components/blog/singleWin/singlePublish.vue";
import { getPublishCfg } from "~/utils/publishUtil";
import { isEmptyString, parseBoolean } from "~/utils/util";
import { isInSiyuanNewWinBrowser } from "~/utils/otherlib/siyuanBrowserUtil";
import SingleAnki from "~/components/blog/singleWin/SingleAnki.vue";
import SinglePicgo from "~/components/blog/singleWin/SinglePicgo.vue";
const logger = LogFactory.getLogger()
const { t } = useI18n()
Expand Down Expand Up @@ -322,16 +357,18 @@ const emitPublishPageFn = (post) => {
}
const handleEdit = (index, row) => {
console.log(toRaw(row));
return;
if (isNewWin.value) {
handleNewWinEdit(index, row)
handleNewWinEdit(index, row);
} else {
const post = new Post()
post.postid = row.postid
post.title = row.title
publishData.value = post
const post = new Post();
post.postid = row.postid;
post.title = row.title;
publishData.value = post;
showPublish.value = true
showHome.value = false
showPublish.value = true;
showHome.value = false;
showDetail.value = false
showAnki.value = false
showPicgo.value = false
Expand Down

0 comments on commit 1a094b2

Please sign in to comment.