Commit 1eca796d by lijiabin

【需求 20331】 perf: 用notivue替代elemenplus 的toast

parent 97fd95f2
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"element-plus": "^2.11.5", "element-plus": "^2.11.5",
"inquirer": "^13.0.2", "inquirer": "^13.0.2",
"notivue": "^2.4.5",
"pinia": "^3.0.3", "pinia": "^3.0.3",
"ssh2": "^1.17.0", "ssh2": "^1.17.0",
"vue": "^3.5.22", "vue": "^3.5.22",
......
...@@ -41,6 +41,9 @@ importers: ...@@ -41,6 +41,9 @@ importers:
inquirer: inquirer:
specifier: ^13.0.2 specifier: ^13.0.2
version: 13.0.2(@types/node@22.18.12) version: 13.0.2(@types/node@22.18.12)
notivue:
specifier: ^2.4.5
version: 2.4.5(defu@6.1.4)
pinia: pinia:
specifier: ^3.0.3 specifier: ^3.0.3
version: 3.0.3(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3)) version: 3.0.3(typescript@5.9.3)(vue@3.5.22(typescript@5.9.3))
...@@ -2879,6 +2882,20 @@ packages: ...@@ -2879,6 +2882,20 @@ packages:
normalize-wheel-es@1.2.0: normalize-wheel-es@1.2.0:
resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==}
notivue@2.4.5:
resolution: {integrity: sha512-7yBdaKesUZIwdcQP3nv1oWYyisI2bURkZ+D9KfLgeNqguHUzkQ1WdhGcTj59PBZa8mqa1/K5Mh8YsphSToMKcQ==}
peerDependencies:
'@nuxt/kit': '>=3.5.0'
'@nuxt/schema': '>=3.5.0'
defu: '>=6'
peerDependenciesMeta:
'@nuxt/kit':
optional: true
'@nuxt/schema':
optional: true
defu:
optional: true
npm-normalize-package-bin@4.0.0: npm-normalize-package-bin@4.0.0:
resolution: {integrity: sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==} resolution: {integrity: sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==}
engines: {node: ^18.17.0 || >=20.5.0} engines: {node: ^18.17.0 || >=20.5.0}
...@@ -6941,6 +6958,10 @@ snapshots: ...@@ -6941,6 +6958,10 @@ snapshots:
normalize-wheel-es@1.2.0: {} normalize-wheel-es@1.2.0: {}
notivue@2.4.5(defu@6.1.4):
optionalDependencies:
defu: 6.1.4
npm-normalize-package-bin@4.0.0: {} npm-normalize-package-bin@4.0.0: {}
npm-run-all2@8.0.4: npm-run-all2@8.0.4:
......
<template> <template>
<Notivue v-slot="item">
<NotivueSwipe :item="item">
<Notification :item="item">
<NotificationProgress :item="item" />
</Notification>
</NotivueSwipe>
</Notivue>
<el-config-provider :locale="locale"> <el-config-provider :locale="locale">
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<component :is="Component" /> <component :is="Component" />
...@@ -8,6 +15,7 @@ ...@@ -8,6 +15,7 @@
<script setup lang="ts"> <script setup lang="ts">
import zhCn from 'element-plus/es/locale/lang/zh-cn' import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { initWxConfig } from '@/utils/wxUtil/initWXConfig' import { initWxConfig } from '@/utils/wxUtil/initWXConfig'
import { Notivue, NotivueSwipe, Notification, NotificationProgress } from 'notivue'
const locale = ref(zhCn) const locale = ref(zhCn)
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { addComplaint } from '@/api' import { addComplaint } from '@/api'
import type { ArticleItemDto } from '@/api/article/types' import type { ArticleItemDto } from '@/api/article/types'
import { push } from 'notivue'
const { articleDetail } = defineProps<{ const { articleDetail } = defineProps<{
articleDetail: ArticleItemDto articleDetail: ArticleItemDto
...@@ -27,7 +28,7 @@ const handleMore = async (command: string) => { ...@@ -27,7 +28,7 @@ const handleMore = async (command: string) => {
inputErrorMessage: '举报原因不能为空', inputErrorMessage: '举报原因不能为空',
}) })
addComplaint({ articleId: articleDetail.id, reason: value }) addComplaint({ articleId: articleDetail.id, reason: value })
ElMessage.success('举报成功') push.success('举报成功')
} }
} }
</script> </script>
...@@ -365,6 +365,7 @@ import { useNavigation } from '@/hooks' ...@@ -365,6 +365,7 @@ import { useNavigation } from '@/hooks'
import { parseEmoji } from '@/utils/emoji' import { parseEmoji } from '@/utils/emoji'
import CommentBox from '../CommentBox/index.vue' import CommentBox from '../CommentBox/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { jumpToUserHomePage } = useNavigation() const { jumpToUserHomePage } = useNavigation()
const { const {
...@@ -474,11 +475,11 @@ const currentCommentId = ref(-1) ...@@ -474,11 +475,11 @@ const currentCommentId = ref(-1)
const handleLickComment = async (item: CommentItemDto) => { const handleLickComment = async (item: CommentItemDto) => {
await addOrCancelCommentLike(item.id) await addOrCancelCommentLike(item.id)
if (item.hasPraise === BooleanFlag.YES) { if (item.hasPraise === BooleanFlag.YES) {
ElMessage.success('取消点赞成功') push.success('取消点赞成功')
item.postPriseCount-- item.postPriseCount--
item.hasPraise = BooleanFlag.NO item.hasPraise = BooleanFlag.NO
} else { } else {
ElMessage.success('点赞成功') push.success('点赞成功')
item.postPriseCount++ item.postPriseCount++
item.hasPraise = BooleanFlag.YES item.hasPraise = BooleanFlag.YES
} }
...@@ -508,7 +509,7 @@ const handleMyComment = async () => { ...@@ -508,7 +509,7 @@ const handleMyComment = async () => {
...(commentId ? { pid: commentId } : {}), ...(commentId ? { pid: commentId } : {}),
imgUrl: myCommentImgStr.value, imgUrl: myCommentImgStr.value,
}) })
ElMessage.success('发表评论成功') push.success('发表评论成功')
refresh() refresh()
myComment.value = '' myComment.value = ''
myCommentImgStr.value = '' myCommentImgStr.value = ''
...@@ -530,7 +531,7 @@ const handleComment = async (index: number) => { ...@@ -530,7 +531,7 @@ const handleComment = async (index: number) => {
...(currentCommentId.value ? { pid: currentCommentId.value } : {}), ...(currentCommentId.value ? { pid: currentCommentId.value } : {}),
imgUrl: commentToOtherImgStr.value, imgUrl: commentToOtherImgStr.value,
}) })
ElMessage.success('发表评论成功') push.success('发表评论成功')
commentToOther.value = '' commentToOther.value = ''
commentToOtherImgStr.value = '' commentToOtherImgStr.value = ''
total.value++ total.value++
......
...@@ -36,6 +36,8 @@ import { useUserStore } from '@/stores' ...@@ -36,6 +36,8 @@ import { useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { addComment } from '@/api' import { addComment } from '@/api'
import CommentBox from '../CommentBox/index.vue' import CommentBox from '../CommentBox/index.vue'
import { push } from 'notivue'
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'commentSuccess'): void (e: 'commentSuccess'): void
}>() }>()
...@@ -79,7 +81,7 @@ const handleSubmit = async () => { ...@@ -79,7 +81,7 @@ const handleSubmit = async () => {
imgUrl: commentImgStr.value, imgUrl: commentImgStr.value,
}) })
console.log('评论内容:', commentStr.value) console.log('评论内容:', commentStr.value)
ElMessage.success('评论发表成功') push.success('评论发表成功')
handleClose() handleClose()
emit('commentSuccess') emit('commentSuccess')
} catch (error) { } catch (error) {
......
...@@ -236,6 +236,7 @@ import { usePageSearch } from '@/hooks' ...@@ -236,6 +236,7 @@ import { usePageSearch } from '@/hooks'
import { parseEmoji } from '@/utils/emoji' import { parseEmoji } from '@/utils/emoji'
import CommentBox from '../CommentBox/index.vue' import CommentBox from '../CommentBox/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { articleId, pid } = defineProps<{ const { articleId, pid } = defineProps<{
articleId: number articleId: number
...@@ -339,7 +340,7 @@ const submitReply = async (targetId: number | undefined) => { ...@@ -339,7 +340,7 @@ const submitReply = async (targetId: number | undefined) => {
imgUrl: imgStr, imgUrl: imgStr,
}) })
ElMessage.success('回复成功') push.success('回复成功')
// 清空输入框 // 清空输入框
if (isBottom) { if (isBottom) {
......
<!-- 导入excel按钮组件 前端传二进制文件 --> <!-- 导入excel按钮组件 前端传二进制文件 -->
<script setup lang="tsx" generic="T"> <script setup lang="tsx" generic="T">
import type { BackendServiceResult } from '@/utils/request/types' import type { BackendServiceResult } from '@/utils/request/types'
import { push } from 'notivue'
const props = defineProps<{ const props = defineProps<{
api: (file: File, onProgress?: (progress: number) => void) => Promise<BackendServiceResult<T[]>> api: (file: File, onProgress?: (progress: number) => void) => Promise<BackendServiceResult<T[]>>
}>() }>()
...@@ -38,7 +40,7 @@ const handleChange = async (e: Event) => { ...@@ -38,7 +40,7 @@ const handleChange = async (e: Event) => {
uploadProgress.value = progress uploadProgress.value = progress
}) })
setTimeout(() => { setTimeout(() => {
ElMessage.success('上传成功') push.success('上传成功')
}, 1000) }, 1000)
emit('success') emit('success')
} catch (error: any) { } catch (error: any) {
......
...@@ -137,6 +137,7 @@ import type { ElButton } from 'element-plus' ...@@ -137,6 +137,7 @@ import type { ElButton } from 'element-plus'
import { useAnimate } from '@vueuse/core' import { useAnimate } from '@vueuse/core'
import RichTextarea from '../RichTextarea/index.vue' import RichTextarea from '../RichTextarea/index.vue'
import UploadImgIcon from '../UploadImgIcon/index.vue' import UploadImgIcon from '../UploadImgIcon/index.vue'
import { push } from 'notivue'
// 暂时只有 问吧 和 实践 需要发布框 这俩都需要实名 // 暂时只有 问吧 和 实践 需要发布框 这俩都需要实名
type ArticleType = ArticleTypeEnum.QUESTION | ArticleTypeEnum.PRACTICE type ArticleType = ArticleTypeEnum.QUESTION | ArticleTypeEnum.PRACTICE
...@@ -237,7 +238,7 @@ const handleAddTag = () => { ...@@ -237,7 +238,7 @@ const handleAddTag = () => {
const validateForm = () => { const validateForm = () => {
if (!form.value.mainTagId) { if (!form.value.mainTagId) {
ElMessage.warning({ push.warning({
message: '请选择主标签', message: '请选择主标签',
offset: 200, offset: 200,
}) })
...@@ -269,7 +270,7 @@ const handlePublish = async (releaseStatus: ReleaseStatusTypeEnum) => { ...@@ -269,7 +270,7 @@ const handlePublish = async (releaseStatus: ReleaseStatusTypeEnum) => {
try { try {
await textMap[type].api(transformForm(releaseStatus)) await textMap[type].api(transformForm(releaseStatus))
loading.value = false loading.value = false
ElMessage.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功') push.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功')
resetForm() resetForm()
} catch (error) { } catch (error) {
console.error(error) console.error(error)
......
...@@ -5,6 +5,7 @@ import { storeToRefs } from 'pinia' ...@@ -5,6 +5,7 @@ import { storeToRefs } from 'pinia'
import type { TagItemDto } from '@/api/tag/types' import type { TagItemDto } from '@/api/tag/types'
import type { SelectTagProps } from './types' import type { SelectTagProps } from './types'
import { TagTypeEnum } from '@/constants' import { TagTypeEnum } from '@/constants'
import { push } from 'notivue'
const { const {
maxSelectedTags = 1, maxSelectedTags = 1,
...@@ -92,10 +93,10 @@ const filteredRecommendedTags = computed(() => { ...@@ -92,10 +93,10 @@ const filteredRecommendedTags = computed(() => {
const addTag = (tagId: number) => { const addTag = (tagId: number) => {
if (arryrOfModelValue.value.length >= maxSelectedTags) if (arryrOfModelValue.value.length >= maxSelectedTags)
return ElMessage.warning({ message: `最多只能选择 ${maxSelectedTags} 个标签`, plain: true }) return push.warning(`最多只能选择 ${maxSelectedTags} 个标签`)
// 不能直接push 触发不了computed 的 set // 不能直接push 触发不了computed 的 set
arryrOfModelValue.value = [...arryrOfModelValue.value, tagId] arryrOfModelValue.value = [...arryrOfModelValue.value, tagId]
ElMessage.success({ message: '标签添加成功', plain: true }) push.success('标签添加成功')
emit('selected', filterTags.value.find((tag) => tag.id === tagId)!) emit('selected', filterTags.value.find((tag) => tag.id === tagId)!)
} }
......
...@@ -28,6 +28,7 @@ import { Plus } from '@element-plus/icons-vue' ...@@ -28,6 +28,7 @@ import { Plus } from '@element-plus/icons-vue'
import { uploadFile as uploadFileApi } from '@/api' import { uploadFile as uploadFileApi } from '@/api'
import type { UploadProps, UploadUserFile } from 'element-plus' import type { UploadProps, UploadUserFile } from 'element-plus'
import type { UploadFileProps } from './types' import type { UploadFileProps } from './types'
import { push } from 'notivue'
const props = withDefaults(defineProps<UploadFileProps>(), { const props = withDefaults(defineProps<UploadFileProps>(), {
limit: 2, limit: 2,
...@@ -104,7 +105,7 @@ watch( ...@@ -104,7 +105,7 @@ watch(
const handleExceed: UploadProps['onExceed'] = (uploadFiles) => { const handleExceed: UploadProps['onExceed'] = (uploadFiles) => {
console.log('uploadFiles', uploadFiles) console.log('uploadFiles', uploadFiles)
if (uploadFiles.length > props.limit) { if (uploadFiles.length > props.limit) {
ElMessage.error(`最多上传 ${props.limit} 个文件`) push.error(`最多上传 ${props.limit} 个文件`)
return return
} }
} }
...@@ -112,7 +113,7 @@ const handleExceed: UploadProps['onExceed'] = (uploadFiles) => { ...@@ -112,7 +113,7 @@ const handleExceed: UploadProps['onExceed'] = (uploadFiles) => {
const handleChange: UploadProps['onChange'] = async (uploadFile, uploadFiles) => { const handleChange: UploadProps['onChange'] = async (uploadFile, uploadFiles) => {
console.log('uploadFiles', uploadFiles) console.log('uploadFiles', uploadFiles)
if (uploadFiles.length > props.limit) { if (uploadFiles.length > props.limit) {
ElMessage.error(`最多上传 ${props.limit} 个文件`) push.error(`最多上传 ${props.limit} 个文件`)
const index = fileList.value.findIndex((file) => file.uid === uploadFile.uid) const index = fileList.value.findIndex((file) => file.uid === uploadFile.uid)
if (index !== -1) { if (index !== -1) {
fileList.value.splice(index, 1) fileList.value.splice(index, 1)
...@@ -151,13 +152,13 @@ const handleChange: UploadProps['onChange'] = async (uploadFile, uploadFiles) => ...@@ -151,13 +152,13 @@ const handleChange: UploadProps['onChange'] = async (uploadFile, uploadFiles) =>
name, name,
status: 'success', status: 'success',
} }
ElMessage.success('上传成功') push.success('上传成功')
} else { } else {
console.warn('找不到对应的文件,uid:', uid) console.warn('找不到对应的文件,uid:', uid)
} }
} catch (error) { } catch (error) {
console.error('上传失败:', error) console.error('上传失败:', error)
ElMessage.error('上传失败,请重试') push.error('上传失败,请重试')
const fileIndex = fileList.value.findIndex((file) => file.uid === uid) const fileIndex = fileList.value.findIndex((file) => file.uid === uid)
if (fileIndex !== -1) { if (fileIndex !== -1) {
......
...@@ -75,6 +75,7 @@ import { uploadFile as uploadFileApi } from '@/api/common' ...@@ -75,6 +75,7 @@ import { uploadFile as uploadFileApi } from '@/api/common'
import type { UploadFile } from 'element-plus' import type { UploadFile } from 'element-plus'
import type { UploadVideoProps } from './types' import type { UploadVideoProps } from './types'
import { getVideoMetadata } from '@/utils' import { getVideoMetadata } from '@/utils'
import { push } from 'notivue'
interface VideoInfo { interface VideoInfo {
url: string url: string
...@@ -194,11 +195,11 @@ const startUpload = async () => { ...@@ -194,11 +195,11 @@ const startUpload = async () => {
url: videoData.url, url: videoData.url,
videoDuration: videoData.duration, videoDuration: videoData.duration,
}) })
ElMessage.success('视频上传成功!') push.success('视频上传成功!')
} catch (error) { } catch (error) {
uploading.value = false uploading.value = false
uploadError.value = error instanceof Error ? error.message : '上传失败,请重试' uploadError.value = error instanceof Error ? error.message : '上传失败,请重试'
ElMessage.error(uploadError.value) push.error(uploadError.value)
} }
} }
...@@ -207,7 +208,7 @@ const cancelUpload = () => { ...@@ -207,7 +208,7 @@ const cancelUpload = () => {
cancelUploadController() cancelUploadController()
uploading.value = false uploading.value = false
uploadProgress.value = 0 uploadProgress.value = 0
ElMessage.info('已取消上传') push.info('已取消上传')
} }
// 重新选择视频 // 重新选择视频
......
import { uploadFile } from '@/api' import { uploadFile } from '@/api'
import { push } from 'notivue'
// 类型定义 // 类型定义
type BaseReturn = { type BaseReturn = {
...@@ -38,7 +39,7 @@ export function useUploadImg(imgs: Ref<string> | Ref<string[]>) { ...@@ -38,7 +39,7 @@ export function useUploadImg(imgs: Ref<string> | Ref<string[]>) {
} }
} catch (error) { } catch (error) {
console.error('上传失败:', error) console.error('上传失败:', error)
ElMessage.error('上传失败,请重试') push.error('上传失败,请重试')
} finally { } finally {
uploadPercent.value = 0 uploadPercent.value = 0
// 重置input的value // 重置input的value
......
...@@ -8,6 +8,7 @@ import { useColumnStore } from '@/stores/column' ...@@ -8,6 +8,7 @@ import { useColumnStore } from '@/stores/column'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import SelectTags from '@/components/common/SelectTags/index.vue' import SelectTags from '@/components/common/SelectTags/index.vue'
import type { AddOrUpdateColumnForm, AddOrUpdateColumnDto } from '@/api/article/types' import type { AddOrUpdateColumnForm, AddOrUpdateColumnDto } from '@/api/article/types'
import { push } from 'notivue'
export default defineComponent((_, { expose }) => { export default defineComponent((_, { expose }) => {
const columnStore = useColumnStore() const columnStore = useColumnStore()
...@@ -64,7 +65,7 @@ export default defineComponent((_, { expose }) => { ...@@ -64,7 +65,7 @@ export default defineComponent((_, { expose }) => {
return transformForm(releaseStatus) return transformForm(releaseStatus)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
ElMessage.warning('请检查输入内容') push.warning('请检查输入内容')
return null return null
} }
} }
......
...@@ -7,6 +7,7 @@ import { useInterviewStore } from '@/stores/interview' ...@@ -7,6 +7,7 @@ import { useInterviewStore } from '@/stores/interview'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import type { AddOrUpdateInterviewDto, AddOrUpdateInterviewForm } from '@/api/article/types' import type { AddOrUpdateInterviewDto, AddOrUpdateInterviewForm } from '@/api/article/types'
import type { TagItemDto } from '@/api/tag/types' import type { TagItemDto } from '@/api/tag/types'
import { push } from 'notivue'
export default defineComponent((_, { expose }) => { export default defineComponent((_, { expose }) => {
const interviewStore = useInterviewStore() const interviewStore = useInterviewStore()
...@@ -61,7 +62,7 @@ export default defineComponent((_, { expose }) => { ...@@ -61,7 +62,7 @@ export default defineComponent((_, { expose }) => {
return transformForm(releaseStatus) return transformForm(releaseStatus)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
ElMessage.warning('请检查输入内容') push.warning('请检查输入内容')
return null return null
} }
} }
......
...@@ -2,6 +2,7 @@ import { ArticleTypeEnum, ReleaseStatusTypeEnum, SendTypeEnum } from '@/constant ...@@ -2,6 +2,7 @@ import { ArticleTypeEnum, ReleaseStatusTypeEnum, SendTypeEnum } from '@/constant
import UploadFile from '@/components/common/UploadFile/index.vue' import UploadFile from '@/components/common/UploadFile/index.vue'
import { useResetData } from '@/hooks' import { useResetData } from '@/hooks'
import type { AddOrUpdatePostDto } from '@/api' import type { AddOrUpdatePostDto } from '@/api'
import { push } from 'notivue'
export default defineComponent( export default defineComponent(
(_, { expose }) => { (_, { expose }) => {
...@@ -37,7 +38,7 @@ export default defineComponent( ...@@ -37,7 +38,7 @@ export default defineComponent(
return transformForm(releaseStatus) return transformForm(releaseStatus)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
ElMessage.warning('请检查输入内容') push.warning('请检查输入内容')
return null return null
} }
} }
......
...@@ -6,6 +6,7 @@ import SelectTags from '@/components/common/SelectTags/index.vue' ...@@ -6,6 +6,7 @@ import SelectTags from '@/components/common/SelectTags/index.vue'
import { useResetData } from '@/hooks' import { useResetData } from '@/hooks'
import type { TagItemDto } from '@/api/tag/types' import type { TagItemDto } from '@/api/tag/types'
import type { AddOrUpdatePracticeDto } from '@/api/practice/types' import type { AddOrUpdatePracticeDto } from '@/api/practice/types'
import { push } from 'notivue'
export default defineComponent((_, { expose }) => { export default defineComponent((_, { expose }) => {
const [form, resetForm] = useResetData<AddOrUpdatePracticeDto>({ const [form, resetForm] = useResetData<AddOrUpdatePracticeDto>({
...@@ -50,7 +51,7 @@ export default defineComponent((_, { expose }) => { ...@@ -50,7 +51,7 @@ export default defineComponent((_, { expose }) => {
return transformForm(releaseStatus) return transformForm(releaseStatus)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
ElMessage.warning('请检查输入内容') push.warning('请检查输入内容')
return null return null
} }
} }
......
...@@ -41,6 +41,7 @@ import type { Component } from 'vue' ...@@ -41,6 +41,7 @@ import type { Component } from 'vue'
import { addOrUpdateArticle, addOrUpdatePractice } from '@/api' import { addOrUpdateArticle, addOrUpdatePractice } from '@/api'
import { ArticleTypeEnum, ReleaseStatusTypeEnum } from '@/constants' import { ArticleTypeEnum, ReleaseStatusTypeEnum } from '@/constants'
import LoadingComponent from '@/components/common/LoadingComponent/index.vue' import LoadingComponent from '@/components/common/LoadingComponent/index.vue'
import { push } from 'notivue'
interface ApiMap { interface ApiMap {
[ArticleTypeEnum.VIDEO]: typeof addOrUpdateArticle [ArticleTypeEnum.VIDEO]: typeof addOrUpdateArticle
...@@ -168,7 +169,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => { ...@@ -168,7 +169,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
await typeMap[articleType.value].api?.({ await typeMap[articleType.value].api?.({
...formData, ...formData,
}) })
ElMessage.success('发布成功') push.success('发布成功')
// 这里可以添加发布逻辑 // 这里可以添加发布逻辑
close() close()
} catch (error) { } catch (error) {
......
...@@ -11,11 +11,25 @@ import 'virtual:uno.css' ...@@ -11,11 +11,25 @@ import 'virtual:uno.css'
import 'virtual:svg-icons-register' import 'virtual:svg-icons-register'
import SvgIcon from '@/components/common/SvgIcon/svgIcon.vue' import SvgIcon from '@/components/common/SvgIcon/svgIcon.vue'
// 注册notivue
import { createNotivue } from 'notivue'
import 'notivue/notification.css'
import 'notivue/animations.css'
if (import.meta.env.MODE === 'production') { if (import.meta.env.MODE === 'production') {
import('@/utils/version').then(({ loopGetVersion }) => loopGetVersion()) import('@/utils/version').then(({ loopGetVersion }) => loopGetVersion())
} }
const notivue = createNotivue({
notifications: {
global: {
duration: 2500,
},
},
})
const app = createApp(App) const app = createApp(App)
app.use(notivue)
app.use(createPinia()) app.use(createPinia())
app.use(router) app.use(router)
......
@import './reset.css'; @import './reset.css';
@import './element.scss'; @import './uiLib.scss';
/* 解决弹窗滚轮 */ /* 解决弹窗滚轮 */
// 重置 element-plus 样式 // 重置 element-plus 样式
:root { :root {
--el-color-primary: #3b82f6; --el-color-primary: #3b82f6;
--nv-z: 99999;
--nv-root-top: 4rem;
} }
.el-message.is-plain { .el-message.is-plain {
border: 1px solid rgb(238, 238, 238) !important; border: 1px solid rgb(238, 238, 238) !important;
......
import * as XLSX from 'xlsx' import * as XLSX from 'xlsx'
import { push } from 'notivue'
/** /**
* 导出 Excel * 导出 Excel
* @param {Object[]} data 数据源 * @param {Object[]} data 数据源
...@@ -27,7 +27,7 @@ export function exportExcel<T>({ ...@@ -27,7 +27,7 @@ export function exportExcel<T>({
fileName = '导出数据', fileName = '导出数据',
sheetName = 'Sheet1', sheetName = 'Sheet1',
}: ExportOptions<T>) { }: ExportOptions<T>) {
if (!data || !data.length) return ElMessage.warning('没有可导出的数据') if (!data || !data.length) return push.warning('没有可导出的数据')
const header = columns.map((col) => col.title) const header = columns.map((col) => col.title)
......
...@@ -10,9 +10,9 @@ import { ...@@ -10,9 +10,9 @@ import {
import type { BackendServiceResult, RequestServiceError } from './types' import type { BackendServiceResult, RequestServiceError } from './types'
import { showErrorMsg } from '@/utils/toast' import { showErrorMsg } from '@/utils/toast'
import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios' import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'
import type { MessageHandler } from 'element-plus'
import service from './index' import service from './index'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { push, type PushClearMethods } from 'notivue'
/** /**
* 后端逻辑code报错处理 * 后端逻辑code报错处理
...@@ -81,20 +81,16 @@ export function handleRequestError<T>(axiosError: AxiosError<BackendServiceResul ...@@ -81,20 +81,16 @@ export function handleRequestError<T>(axiosError: AxiosError<BackendServiceResul
if (axiosError.response?.data.code === 501) { if (axiosError.response?.data.code === 501) {
const message = axiosError.response?.data.message const message = axiosError.response?.data.message
if (message && JSON.parse(message)) { if (message && JSON.parse(message)) {
ElMessage({ push.error({
showClose: true,
message: `敏感词不可出现:${JSON.parse(message).join(',')}`, message: `敏感词不可出现:${JSON.parse(message).join(',')}`,
type: 'error',
duration: 0, duration: 0,
}) })
} }
} }
if (axiosError.response?.data.code === 502) { if (axiosError.response?.data.code === 502) {
// 502 企业微信登录错误 // 502 企业微信登录错误
ElMessage({ push.error({
showClose: true, message: `请从YA文件入口进入登录后,再点击该连接,如果有其他问题,请联系 李家彬 解决`,
message: `当前链接有问题,请从同事吧入口进入登录后,再点击该连接,如果有其他问题,请联系 张惠忠 解决`,
type: 'error',
duration: 0, duration: 0,
}) })
} else if (error.code === 401) { } else if (error.code === 401) {
...@@ -144,13 +140,12 @@ async function handleUnAuthorized(axiosError: AxiosError) { ...@@ -144,13 +140,12 @@ async function handleUnAuthorized(axiosError: AxiosError) {
} }
} }
let msgIns: MessageHandler | null = null let msgIns: PushClearMethods | null = null
function create401ErrorMsg() { function create401ErrorMsg() {
if (!msgIns) { if (!msgIns) {
msgIns = ElMessage({ msgIns = push.error({
message: '重新获取token失败,请关闭标签页,重新打开', message: '重新获取token失败,请关闭标签页,重新打开',
type: 'error',
duration: 0, duration: 0,
}) })
} }
......
import 'element-plus/es/components/message/style/css' import 'element-plus/es/components/message/style/css'
import type { RequestServiceError } from '@/utils/request/types' import type { RequestServiceError } from '@/utils/request/types'
import { NO_ERROR_MSG_CODE, ERROR_MSG_DURATION } from '@/utils/request/service' import { NO_ERROR_MSG_CODE, ERROR_MSG_DURATION } from '@/utils/request/service'
import { push } from 'notivue'
/** 错误消息栈,防止同一错误同时出现 */ /** 错误消息栈,防止同一错误同时出现 */
const errorMsgStack = new Map<string | number, string>([]) const errorMsgStack = new Map<string | number, string>([])
...@@ -24,7 +24,7 @@ export function showErrorMsg(error: RequestServiceError) { ...@@ -24,7 +24,7 @@ export function showErrorMsg(error: RequestServiceError) {
if (!hasErrorMsg(error)) { if (!hasErrorMsg(error)) {
addErrorMsg(error) addErrorMsg(error)
if (error.msg) { if (error.msg) {
ElMessage.error(error.msg) push.error(error.msg)
} }
setTimeout(() => { setTimeout(() => {
removeErrorMsg(error) removeErrorMsg(error)
......
...@@ -35,7 +35,7 @@ import type { ArticleItemDto } from '@/api' ...@@ -35,7 +35,7 @@ import type { ArticleItemDto } from '@/api'
import type { Component } from 'vue' import type { Component } from 'vue'
import { useScrollTop } from '@/hooks' import { useScrollTop } from '@/hooks'
import { addOrCanceArticlelCollect, addOrCanceArticlelLike } from '@/api' import { addOrCanceArticlelCollect, addOrCanceArticlelLike } from '@/api'
import { push } from 'notivue'
const modelValue = defineModel<ArticleItemDto>('modelValue', { required: true }) const modelValue = defineModel<ArticleItemDto>('modelValue', { required: true })
const emit = defineEmits<{ const emit = defineEmits<{
...@@ -72,7 +72,7 @@ const stats = computed(() => { ...@@ -72,7 +72,7 @@ const stats = computed(() => {
? modelValue.value.praiseCount + 1 ? modelValue.value.praiseCount + 1
: modelValue.value.praiseCount - 1 : modelValue.value.praiseCount - 1
ElMessage.success(isAdd ? '点赞成功' : '取消点赞成功') push.success(isAdd ? '点赞成功' : '取消点赞成功')
}, },
}, },
{ {
...@@ -91,7 +91,7 @@ const stats = computed(() => { ...@@ -91,7 +91,7 @@ const stats = computed(() => {
modelValue.value.collectionCount = isAdd modelValue.value.collectionCount = isAdd
? modelValue.value.collectionCount + 1 ? modelValue.value.collectionCount + 1
: modelValue.value.collectionCount - 1 : modelValue.value.collectionCount - 1
ElMessage.success(isAdd ? '收藏成功' : '取消收藏成功') push.success(isAdd ? '收藏成功' : '取消收藏成功')
}, },
}, },
{ {
......
...@@ -9,6 +9,7 @@ import type { AuctionItemDto } from '@/api' ...@@ -9,6 +9,7 @@ import type { AuctionItemDto } from '@/api'
import { useYaBiStore } from '@/stores' import { useYaBiStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { push } from 'notivue'
const yabiStore = useYaBiStore() const yabiStore = useYaBiStore()
const { yabiData } = storeToRefs(yabiStore) const { yabiData } = storeToRefs(yabiStore)
...@@ -172,10 +173,10 @@ const onBid = async (item: AuctionItemDto) => { ...@@ -172,10 +173,10 @@ const onBid = async (item: AuctionItemDto) => {
if (action !== 'confirm') { if (action !== 'confirm') {
done() done()
} else { } else {
if (val.value > yabiData.value.currentValue) return ElMessage.error('您的YA币余额不足') if (val.value > yabiData.value.currentValue) return push.error('您的YA币余额不足')
if (val.value < data.minIncrement + (data.currentPrice || data.startingPrice)) if (val.value < data.minIncrement + (data.currentPrice || data.startingPrice))
return ElMessage.error('出价必须大于等于前最高出价+最低加价幅度') return push.error('出价必须大于等于前最高出价+最低加价幅度')
instance.confirmButtonLoading = true instance.confirmButtonLoading = true
instance.confirmButtonText = 'Loading...' instance.confirmButtonText = 'Loading...'
......
...@@ -31,6 +31,7 @@ import { type ArticleItemDto } from '@/api' ...@@ -31,6 +31,7 @@ import { type ArticleItemDto } from '@/api'
import { getArticleDetail, auditArticle } from '@/api' import { getArticleDetail, auditArticle } from '@/api'
import { AuditStatusEnum } from '@/constants/enums' import { AuditStatusEnum } from '@/constants/enums'
import type { AuditArticleDto } from '@/api' import type { AuditArticleDto } from '@/api'
import { push } from 'notivue'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const id = route.params.id as string const id = route.params.id as string
...@@ -54,7 +55,7 @@ const handleAudit = async (auditStatus: AuditStatusEnum) => { ...@@ -54,7 +55,7 @@ const handleAudit = async (auditStatus: AuditStatusEnum) => {
auditData.auditRemark = value auditData.auditRemark = value
} }
await auditArticle(auditData) await auditArticle(auditData)
ElMessage.success('审核成功') push.success('审核成功')
router.replace('/') router.replace('/')
} }
......
...@@ -190,7 +190,7 @@ import type { ...@@ -190,7 +190,7 @@ import type {
import { ArticleTypeEnum, articleTypeListOptions } from '@/constants' import { ArticleTypeEnum, articleTypeListOptions } from '@/constants'
import { usePageSearch, useNavigation } from '@/hooks' import { usePageSearch, useNavigation } from '@/hooks'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const { jumpToArticleDetailPage } = useNavigation() const { jumpToArticleDetailPage } = useNavigation()
// 列表数据 // 列表数据
...@@ -267,11 +267,11 @@ const handleDelete = async (row: BackendCarouselListItemDto) => { ...@@ -267,11 +267,11 @@ const handleDelete = async (row: BackendCarouselListItemDto) => {
isRelease: 0, // 状态设置为0 isRelease: 0, // 状态设置为0
}) })
ElMessage.success('删除成功') push.success('删除成功')
getList() getList()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -288,7 +288,7 @@ const handleSubmit = async () => { ...@@ -288,7 +288,7 @@ const handleSubmit = async () => {
await addCarousel(form.value) await addCarousel(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
getList() getList()
} catch (error) { } catch (error) {
......
...@@ -6,7 +6,7 @@ import type { TagItemDto } from '@/api/tag/types' ...@@ -6,7 +6,7 @@ import type { TagItemDto } from '@/api/tag/types'
import { TagLevelEnum, TagTypeEnum } from '@/constants' import { TagLevelEnum, TagTypeEnum } from '@/constants'
import { selectDepOrUser } from '@/utils' import { selectDepOrUser } from '@/utils'
import { backendEditCase } from '@/api/backend' import { backendEditCase } from '@/api/backend'
import { push } from 'notivue'
const emit = defineEmits<{ const emit = defineEmits<{
refresh: [] refresh: []
}>() }>()
...@@ -97,7 +97,7 @@ const selcetDept = async () => { ...@@ -97,7 +97,7 @@ const selcetDept = async () => {
selectedDepartmentIds: form.value.departmentList.map((i) => i.id), selectedDepartmentIds: form.value.departmentList.map((i) => i.id),
}) })
if (departmentList.length > 3) { if (departmentList.length > 3) {
return ElMessage.warning('最多只能选择3个部门,请重新选择') return push.warning('最多只能选择3个部门,请重新选择')
} }
form.value.departmentList = departmentList form.value.departmentList = departmentList
} }
...@@ -186,7 +186,7 @@ const handleSave = async () => { ...@@ -186,7 +186,7 @@ const handleSave = async () => {
const data = transformData() const data = transformData()
const res = await backendEditCase(data) const res = await backendEditCase(data)
if (res.code === 200) { if (res.code === 200) {
ElMessage.success('编辑成功') push.success('编辑成功')
visible.value = false visible.value = false
} }
visible.value = false visible.value = false
......
...@@ -295,7 +295,7 @@ import ImportExcelBtn from '@/components/common/ImportExcelBtn/index.vue' ...@@ -295,7 +295,7 @@ import ImportExcelBtn from '@/components/common/ImportExcelBtn/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import ErrorListDialog from './components/errorListDialog.vue' import ErrorListDialog from './components/errorListDialog.vue'
import EditDialog from './components/editDialog.vue' import EditDialog from './components/editDialog.vue'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams } =
usePageSearch(getCaseList, { usePageSearch(getCaseList, {
defaultParams: {}, defaultParams: {},
...@@ -306,7 +306,7 @@ const editDialogRef = useTemplateRef<InstanceType<typeof EditDialog>>('editDialo ...@@ -306,7 +306,7 @@ const editDialogRef = useTemplateRef<InstanceType<typeof EditDialog>>('editDialo
// 编辑 // 编辑
const handleEdit = async (row: BackendCaseListItemDto) => { const handleEdit = async (row: BackendCaseListItemDto) => {
// 已使用的状态 不允许编辑 // 已使用的状态 不允许编辑
if (row.isUse === UsageStatusEnum.USED) return ElMessage.warning('已使用的状态 不允许编辑') if (row.isUse === UsageStatusEnum.USED) return push.warning('已使用的状态 不允许编辑')
// 审核通过再编辑 // 审核通过再编辑
if (row.isAudit === AuditStatusEnum.AGREED) { if (row.isAudit === AuditStatusEnum.AGREED) {
await ElMessageBox.confirm('案例库已审核通过,修改后需重新审核,点击确定继续编辑', '提示', { await ElMessageBox.confirm('案例库已审核通过,修改后需重新审核,点击确定继续编辑', '提示', {
...@@ -330,7 +330,7 @@ const handleBatchPublish = async () => { ...@@ -330,7 +330,7 @@ const handleBatchPublish = async () => {
await hideColumn(selectedRows.value.map((item) => item.id)) await hideColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('发布/隐藏成功') push.success('发布/隐藏成功')
} }
// 批量删除 // 批量删除
...@@ -338,7 +338,7 @@ const handleBatchDelete = async () => { ...@@ -338,7 +338,7 @@ const handleBatchDelete = async () => {
await deleteColumn(selectedRows.value.map((item) => item.id)) await deleteColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('删除成功') push.success('删除成功')
} }
const handleContent = (row: BackendCaseListItemDto) => { const handleContent = (row: BackendCaseListItemDto) => {
...@@ -352,7 +352,7 @@ const handleAuditStatusChange = async (row: BackendCaseListItemDto, value: numbe ...@@ -352,7 +352,7 @@ const handleAuditStatusChange = async (row: BackendCaseListItemDto, value: numbe
id: row.id, id: row.id,
isAudit: value, isAudit: value,
}) })
ElMessage.success('审核成功') push.success('审核成功')
row.isAudit = value row.isAudit = value
} }
...@@ -361,7 +361,7 @@ const handleUsageStatusChange = async (row: BackendCaseListItemDto, value: numbe ...@@ -361,7 +361,7 @@ const handleUsageStatusChange = async (row: BackendCaseListItemDto, value: numbe
id: row.id, id: row.id,
isUse: value, isUse: value,
}) })
ElMessage.success('使用状态修改成功') push.success('使用状态修改成功')
refresh() refresh()
row.isUse = value row.isUse = value
} }
......
...@@ -131,7 +131,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from ...@@ -131,7 +131,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend' import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(listOfCultureColumn, { usePageSearch(listOfCultureColumn, {
defaultParams: { defaultParams: {
...@@ -196,11 +196,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => { ...@@ -196,11 +196,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => {
await deleteColumn([row.id]) await deleteColumn([row.id])
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -218,7 +218,7 @@ const handleSubmit = async () => { ...@@ -218,7 +218,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
...@@ -241,7 +241,7 @@ const handleBatchPublish = async () => { ...@@ -241,7 +241,7 @@ const handleBatchPublish = async () => {
await hideColumn(selectedRows.value.map((item) => item.id)) await hideColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('发布/隐藏成功') push.success('发布/隐藏成功')
} }
// 批量删除 // 批量删除
...@@ -249,7 +249,7 @@ const handleBatchDelete = async () => { ...@@ -249,7 +249,7 @@ const handleBatchDelete = async () => {
await deleteColumn(selectedRows.value.map((item) => item.id)) await deleteColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('删除成功') push.success('删除成功')
} }
</script> </script>
......
...@@ -137,7 +137,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from ...@@ -137,7 +137,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend' import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(listOfCultureColumn, { usePageSearch(listOfCultureColumn, {
defaultParams: { defaultParams: {
...@@ -202,11 +202,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => { ...@@ -202,11 +202,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => {
await deleteColumn([row.id]) await deleteColumn([row.id])
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -224,7 +224,7 @@ const handleSubmit = async () => { ...@@ -224,7 +224,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
...@@ -247,7 +247,7 @@ const handleBatchPublish = async () => { ...@@ -247,7 +247,7 @@ const handleBatchPublish = async () => {
await hideColumn(selectedRows.value.map((item) => item.id)) await hideColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('发布/隐藏成功') push.success('发布/隐藏成功')
} }
// 批量删除 // 批量删除
...@@ -255,7 +255,7 @@ const handleBatchDelete = async () => { ...@@ -255,7 +255,7 @@ const handleBatchDelete = async () => {
await deleteColumn(selectedRows.value.map((item) => item.id)) await deleteColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('删除成功') push.success('删除成功')
} }
</script> </script>
......
...@@ -130,7 +130,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from ...@@ -130,7 +130,7 @@ import { listOfCultureColumn, addOrUpdateColumn, deleteColumn, hideColumn } from
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend' import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backend'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(listOfCultureColumn, { usePageSearch(listOfCultureColumn, {
defaultParams: { defaultParams: {
...@@ -195,11 +195,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => { ...@@ -195,11 +195,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => {
await deleteColumn([row.id]) await deleteColumn([row.id])
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -217,7 +217,7 @@ const handleSubmit = async () => { ...@@ -217,7 +217,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
...@@ -240,7 +240,7 @@ const handleBatchPublish = async () => { ...@@ -240,7 +240,7 @@ const handleBatchPublish = async () => {
await hideColumn(selectedRows.value.map((item) => item.id)) await hideColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('发布/隐藏成功') push.success('发布/隐藏成功')
} }
// 批量删除 // 批量删除
...@@ -248,7 +248,7 @@ const handleBatchDelete = async () => { ...@@ -248,7 +248,7 @@ const handleBatchDelete = async () => {
await deleteColumn(selectedRows.value.map((item) => item.id)) await deleteColumn(selectedRows.value.map((item) => item.id))
refresh() refresh()
selectedRows.value = [] selectedRows.value = []
ElMessage.success('删除成功') push.success('删除成功')
} }
</script> </script>
......
...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe ...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ArticleTypeEnum, BooleanFlag } from '@/constants' import { ArticleTypeEnum, BooleanFlag } from '@/constants'
import type { ArticleItemDto } from '@/api/article/types' import type { ArticleItemDto } from '@/api/article/types'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getArticleList, { usePageSearch(getArticleList, {
defaultParams: { defaultParams: {
...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) => ...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) =>
recommendSort: 0, // 默认传 0 recommendSort: 0, // 默认传 0
isRecommend: val, isRecommend: val,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => { ...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => {
recommendSort: Number(value), recommendSort: Number(value),
isRecommend: BooleanFlag.YES, isRecommend: BooleanFlag.YES,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -79,7 +79,7 @@ const handleSubmit = async () => { ...@@ -79,7 +79,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe ...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ArticleTypeEnum, BooleanFlag } from '@/constants' import { ArticleTypeEnum, BooleanFlag } from '@/constants'
import type { ArticleItemDto } from '@/api/article/types' import type { ArticleItemDto } from '@/api/article/types'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getArticleList, { usePageSearch(getArticleList, {
defaultParams: { defaultParams: {
...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) => ...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) =>
recommendSort: 0, // 默认传 0 recommendSort: 0, // 默认传 0
isRecommend: val, isRecommend: val,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => { ...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => {
recommendSort: Number(value), recommendSort: Number(value),
isRecommend: BooleanFlag.YES, isRecommend: BooleanFlag.YES,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -79,7 +79,7 @@ const handleSubmit = async () => { ...@@ -79,7 +79,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe ...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ArticleTypeEnum, BooleanFlag } from '@/constants' import { ArticleTypeEnum, BooleanFlag } from '@/constants'
import type { ArticleItemDto } from '@/api/article/types' import type { ArticleItemDto } from '@/api/article/types'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getArticleList, { usePageSearch(getArticleList, {
defaultParams: { defaultParams: {
...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) => ...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) =>
recommendSort: 0, // 默认传 0 recommendSort: 0, // 默认传 0
isRecommend: val, isRecommend: val,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => { ...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => {
recommendSort: Number(value), recommendSort: Number(value),
isRecommend: BooleanFlag.YES, isRecommend: BooleanFlag.YES,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -79,7 +79,7 @@ const handleSubmit = async () => { ...@@ -79,7 +79,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe ...@@ -8,7 +8,7 @@ import type { BackendColumnListItemDto, AddOrUpdateColumnDto } from '@/api/backe
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ArticleTypeEnum, BooleanFlag } from '@/constants' import { ArticleTypeEnum, BooleanFlag } from '@/constants'
import type { ArticleItemDto } from '@/api/article/types' import type { ArticleItemDto } from '@/api/article/types'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getArticleList, { usePageSearch(getArticleList, {
defaultParams: { defaultParams: {
...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) => ...@@ -44,7 +44,7 @@ const handleIsRecommendChange = async (val: BooleanFlag, row: ArticleItemDto) =>
recommendSort: 0, // 默认传 0 recommendSort: 0, // 默认传 0
isRecommend: val, isRecommend: val,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => { ...@@ -62,7 +62,7 @@ const handleEditSort = async (row: ArticleItemDto) => {
recommendSort: Number(value), recommendSort: Number(value),
isRecommend: BooleanFlag.YES, isRecommend: BooleanFlag.YES,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
...@@ -79,7 +79,7 @@ const handleSubmit = async () => { ...@@ -79,7 +79,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -174,7 +174,7 @@ import type { ...@@ -174,7 +174,7 @@ import type {
import dayjs from 'dayjs' import dayjs from 'dayjs'
import ExportExcelBtn from '@/components/common/ExportExcelBtn/index.vue' import ExportExcelBtn from '@/components/common/ExportExcelBtn/index.vue'
import type { ExportColumn } from '@/utils' import type { ExportColumn } from '@/utils'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getBackendExchangeList, { usePageSearch(getBackendExchangeList, {
defaultParams: {}, defaultParams: {},
...@@ -273,7 +273,7 @@ const handleCancelIssue = async (row: BackendColumnListItemDto) => { ...@@ -273,7 +273,7 @@ const handleCancelIssue = async (row: BackendColumnListItemDto) => {
id: row.id, id: row.id,
status: 0, status: 0,
}) })
ElMessage.success('取消发放成功') push.success('取消发放成功')
refresh() refresh()
} }
...@@ -289,7 +289,7 @@ const handleIssue = async (row: BackendColumnListItemDto) => { ...@@ -289,7 +289,7 @@ const handleIssue = async (row: BackendColumnListItemDto) => {
memo: memo.value, memo: memo.value,
status: 1, status: 1,
}) })
ElMessage.success('发放成功') push.success('发放成功')
refresh() refresh()
} }
...@@ -306,7 +306,7 @@ const handleSubmit = async () => { ...@@ -306,7 +306,7 @@ const handleSubmit = async () => {
await addOrUpdateColumn(form.value) await addOrUpdateColumn(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -225,7 +225,7 @@ import { auctionStatusListOptions } from '@/constants' ...@@ -225,7 +225,7 @@ import { auctionStatusListOptions } from '@/constants'
import UploadFile from '@/components/common/UploadFile/index.vue' import UploadFile from '@/components/common/UploadFile/index.vue'
import AuctionRecordDialog from './components/auctionRecordDialog.vue' import AuctionRecordDialog from './components/auctionRecordDialog.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getBackendAuctionList) usePageSearch(getBackendAuctionList)
...@@ -310,11 +310,11 @@ const handleDelete = async (row: BackendAuctionListItemDto) => { ...@@ -310,11 +310,11 @@ const handleDelete = async (row: BackendAuctionListItemDto) => {
await deleteAuction([row.id]) await deleteAuction([row.id])
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -333,7 +333,7 @@ const handleSubmit = async () => { ...@@ -333,7 +333,7 @@ const handleSubmit = async () => {
await addOrUpdateAuctionItem(form.value) await addOrUpdateAuctionItem(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
...@@ -366,7 +366,7 @@ const handleBatchShow = async () => { ...@@ -366,7 +366,7 @@ const handleBatchShow = async () => {
idList: selectedRows.value.map((item) => item.id), idList: selectedRows.value.map((item) => item.id),
isDisplay: show.value, isDisplay: show.value,
}) })
ElMessage.success('批量修改展示竞拍成功') push.success('批量修改展示竞拍成功')
refresh() refresh()
done() done()
} catch (error) { } catch (error) {
...@@ -390,7 +390,7 @@ const handleBatchDelete = async () => { ...@@ -390,7 +390,7 @@ const handleBatchDelete = async () => {
await deleteAuction(selectedRows.value.map((item) => item.id)) await deleteAuction(selectedRows.value.map((item) => item.id))
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
} }
const selectedRows = ref<BackendAuctionListItemDto[]>([]) const selectedRows = ref<BackendAuctionListItemDto[]>([])
......
...@@ -129,6 +129,7 @@ import type { BackendAuctionListItemDto, BackendAddOrUpdateLotteryPrizeDto } fro ...@@ -129,6 +129,7 @@ import type { BackendAuctionListItemDto, BackendAddOrUpdateLotteryPrizeDto } fro
import UploadFile from '@/components/common/UploadFile/index.vue' import UploadFile from '@/components/common/UploadFile/index.vue'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import LotteryConfig from './components/lotteryConfigDialog.vue' import LotteryConfig from './components/lotteryConfigDialog.vue'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getLotteryPrizeList) usePageSearch(getLotteryPrizeList)
...@@ -180,11 +181,11 @@ const handleDelete = async (row: BackendAuctionListItemDto) => { ...@@ -180,11 +181,11 @@ const handleDelete = async (row: BackendAuctionListItemDto) => {
await deleteLotteryPrize([row.id]) await deleteLotteryPrize([row.id])
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -203,7 +204,7 @@ const handleSubmit = async () => { ...@@ -203,7 +204,7 @@ const handleSubmit = async () => {
await addOrUpdateLotteryPrize(form.value) await addOrUpdateLotteryPrize(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -194,6 +194,7 @@ import dayjs from 'dayjs' ...@@ -194,6 +194,7 @@ import dayjs from 'dayjs'
import { BooleanFlag, ShopGoodsTypeEnum, regionListOptions } from '@/constants' import { BooleanFlag, ShopGoodsTypeEnum, regionListOptions } from '@/constants'
import UploadFile from '@/components/common/UploadFile/index.vue' import UploadFile from '@/components/common/UploadFile/index.vue'
import type { BackendShopItemDto } from '@/api/backend' import type { BackendShopItemDto } from '@/api/backend'
import { push } from 'notivue'
console.log('goodsManage', UploadFile) console.log('goodsManage', UploadFile)
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getShopItemList) usePageSearch(getShopItemList)
...@@ -251,11 +252,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => { ...@@ -251,11 +252,11 @@ const handleDelete = async (row: BackendColumnListItemDto) => {
await deleteShopItem(row.id) await deleteShopItem(row.id)
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -273,7 +274,7 @@ const handleSubmit = async () => { ...@@ -273,7 +274,7 @@ const handleSubmit = async () => {
await addOrUpdateShopItem(form.value) await addOrUpdateShopItem(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
...@@ -297,7 +298,7 @@ const handleEnableChange = async (row: BackendColumnListItemDto) => { ...@@ -297,7 +298,7 @@ const handleEnableChange = async (row: BackendColumnListItemDto) => {
id: row.id, id: row.id,
enable: row.enable === BooleanFlag.YES ? BooleanFlag.NO : BooleanFlag.YES, enable: row.enable === BooleanFlag.YES ? BooleanFlag.NO : BooleanFlag.YES,
}) })
ElMessage.success('修改成功') push.success('修改成功')
refresh() refresh()
} }
</script> </script>
......
...@@ -126,7 +126,7 @@ import { getTagList, addOrUpdateTag, deleteTag } from '@/api/backend' ...@@ -126,7 +126,7 @@ import { getTagList, addOrUpdateTag, deleteTag } from '@/api/backend'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import type { BackendTagListItemDto, AddOrUpdateTagDto } from '@/api/backend' import type { BackendTagListItemDto, AddOrUpdateTagDto } from '@/api/backend'
import { push } from 'notivue'
const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } = const { loading, list, total, reset, goToPage, changePageSize, refresh, searchParams, search } =
usePageSearch(getTagList) usePageSearch(getTagList)
...@@ -182,11 +182,11 @@ const handleDelete = async (row: BackendTagListItemDto) => { ...@@ -182,11 +182,11 @@ const handleDelete = async (row: BackendTagListItemDto) => {
await deleteTag(row.id) await deleteTag(row.id)
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} catch (error) { } catch (error) {
if (error !== 'cancel') { if (error !== 'cancel') {
ElMessage.error('删除失败') push.error('删除失败')
} }
} }
} }
...@@ -204,7 +204,7 @@ const handleSubmit = async () => { ...@@ -204,7 +204,7 @@ const handleSubmit = async () => {
await addOrUpdateTag(form.value) await addOrUpdateTag(form.value)
} }
ElMessage.success(form.value.id ? '编辑成功' : '新增成功') push.success(form.value.id ? '编辑成功' : '新增成功')
dialogVisible.value = false dialogVisible.value = false
if (form.value.id) { if (form.value.id) {
search() search()
......
...@@ -210,7 +210,7 @@ import { useQuestionStore } from '@/stores/question' ...@@ -210,7 +210,7 @@ import { useQuestionStore } from '@/stores/question'
import ActionMore from '@/components/common/ActionMore/index.vue' import ActionMore from '@/components/common/ActionMore/index.vue'
import CommentDialog from '@/components/common/CommentDialog/index.vue' import CommentDialog from '@/components/common/CommentDialog/index.vue'
import { parseEmoji } from '@/utils/emoji' import { parseEmoji } from '@/utils/emoji'
import { push } from 'notivue'
const { fetchUserQestionNum } = useQuestionStore() const { fetchUserQestionNum } = useQuestionStore()
const route = useRoute() const route = useRoute()
...@@ -249,7 +249,7 @@ const handleCollect = async (item: ArticleItemDto) => { ...@@ -249,7 +249,7 @@ const handleCollect = async (item: ArticleItemDto) => {
await addOrCanceArticlelCollect(item.id) await addOrCanceArticlelCollect(item.id)
item.hasCollect = !item.hasCollect item.hasCollect = !item.hasCollect
item.collectionCount = item.hasCollect ? item.collectionCount + 1 : item.collectionCount - 1 item.collectionCount = item.hasCollect ? item.collectionCount + 1 : item.collectionCount - 1
ElMessage.success(item.hasCollect ? '收藏成功' : '取消收藏') push.success(item.hasCollect ? '收藏成功' : '取消收藏')
refresh() refresh()
} }
...@@ -282,7 +282,7 @@ const handleAddQuestion = async (item: ArticleItemDto) => { ...@@ -282,7 +282,7 @@ const handleAddQuestion = async (item: ArticleItemDto) => {
await addOrCancelToAnswerList({ articleId: item.id }) await addOrCancelToAnswerList({ articleId: item.id })
item.hasAddQuestion = !item.hasAddQuestion item.hasAddQuestion = !item.hasAddQuestion
fetchUserQestionNum() fetchUserQestionNum()
ElMessage.success(item.hasAddQuestion ? '添加成功' : '取消添加') push.success(item.hasAddQuestion ? '添加成功' : '取消添加')
} }
const handleRefresh = () => { const handleRefresh = () => {
......
...@@ -96,18 +96,23 @@ ...@@ -96,18 +96,23 @@
</div> </div>
</div> </div>
<div class="flex flex-col sm:flex-row gap-2"> <div class="flex flex-col sm:flex-row gap-2">
<div ref="dailySignBtnRef"> <div ref="dailySignBtnRef" class="relative">
<el-button <el-button
class="bg-[linear-gradient(to_right,#FFD06A_0%,#FFB143_100%)] shadow-[0px_1px_8px_0_rgba(255,173,91,0.25)] border-none hover:-translate-y-1 hover:shadow-[0px_4px_10px_0_rgba(255,173,91,0.4)] hover:scale-105 active:scale-95 active:translate-y-0 transition-all duration-200 flex-1 text-xs sm:text-sm" class="bg-[linear-gradient(to_right,#FFD06A_0%,#FFB143_100%)] shadow-[0px_1px_8px_0_rgba(255,173,91,0.25)] border-none hover:-translate-y-1 hover:shadow-[0px_4px_10px_0_rgba(255,173,91,0.4)] hover:scale-105 active:scale-95 active:translate-y-0 transition-all duration-200 flex-1 text-xs sm:text-sm"
type="primary" type="primary"
@click="onDailySign" @click="onDailySign"
v-if="!userRecordData.isSign" v-if="!userRecordData.isSign"
> >
<!-- v-if="!userRecordData.isSign" -->
<svg-icon name="sign_in" size="24" class="mr-2 mb-1" /> <svg-icon name="sign_in" size="24" class="mr-2 mb-1" />
<span class="text-#333 text-xs sm:text-sm">立即签到</span> <span class="text-#333 text-xs sm:text-sm">立即签到</span>
</el-button> </el-button>
<!-- 双倍亚币角标 -->
<div
v-if="activityStore.isDoubleYabi && !userRecordData.isSign"
class="absolute -top-2.5 -right-2 px-1.5 py-0.5 rounded-full bg-gradient-to-r from-red-500 to-pink-500 text-white text-[10px] font-bold leading-none shadow-sm animate-bounce whitespace-nowrap z-1"
>
双倍亚币
</div>
</div> </div>
<el-button <el-button
class="bg-[linear-gradient(to_right,#ABB0FF_0%,#7495FF_100%)] shadow-[0_1px_8px_0_rgba(0,36,237,0.25)] border-none hover:-translate-y-1 transition-all duration-200 flex-1 text-xs sm:text-sm w-116px" class="bg-[linear-gradient(to_right,#ABB0FF_0%,#7495FF_100%)] shadow-[0_1px_8px_0_rgba(0,36,237,0.25)] border-none hover:-translate-y-1 transition-all duration-200 flex-1 text-xs sm:text-sm w-116px"
...@@ -364,7 +369,9 @@ import type { ...@@ -364,7 +369,9 @@ import type {
import { TABS_REF_KEY, levelListOptions } from '@/constants' import { TABS_REF_KEY, levelListOptions } from '@/constants'
import { useScrollTop } from '@/hooks' import { useScrollTop } from '@/hooks'
import { useQuestionStore } from '@/stores/question' import { useQuestionStore } from '@/stores/question'
import { useActivityStore } from '@/stores/activity'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { push } from 'notivue'
// import LuckyWheel from '@/components/common/LuckyWheel/index.vue' // import LuckyWheel from '@/components/common/LuckyWheel/index.vue'
const route = useRoute() const route = useRoute()
...@@ -377,6 +384,7 @@ const { handleBackTop } = useScrollTop(levelContainerRef) ...@@ -377,6 +384,7 @@ const { handleBackTop } = useScrollTop(levelContainerRef)
const questionStore = useQuestionStore() const questionStore = useQuestionStore()
const { userQestionNum } = storeToRefs(questionStore) const { userQestionNum } = storeToRefs(questionStore)
const activityStore = useActivityStore()
const getThirdLevelKey = (route: RouteLocationNormalizedLoadedGeneric) => { const getThirdLevelKey = (route: RouteLocationNormalizedLoadedGeneric) => {
// console.log(route.fullPath, '三级路由首页') // console.log(route.fullPath, '三级路由首页')
...@@ -468,7 +476,7 @@ const onDailySign = async () => { ...@@ -468,7 +476,7 @@ const onDailySign = async () => {
await dailySign() await dailySign()
refreshTaskData(true) refreshTaskData(true)
refreshUserAccountData() refreshUserAccountData()
ElMessage.success('签到成功') push.success(activityStore.isDoubleYabi ? '签到成功!活动期间双倍亚币已到账 🎉' : '签到成功')
open.value = false open.value = false
} }
...@@ -482,11 +490,11 @@ const getLotteryPrizesDetail = async () => { ...@@ -482,11 +490,11 @@ const getLotteryPrizesDetail = async () => {
// 参与抽奖 // 参与抽奖
const handleLottery = async () => { const handleLottery = async () => {
if (!lotteryPrizesDetail.value?.inRegistrationTime) if (!lotteryPrizesDetail.value?.inRegistrationTime)
return ElMessage.error(`抽奖通道将于${lotteryPrizesDetail.value?.registrationTimeDesc}开启`) return push.error(`抽奖通道将于${lotteryPrizesDetail.value?.registrationTimeDesc}开启`)
await userJoinLottery() await userJoinLottery()
getLotteryPrizesDetail() getLotteryPrizesDetail()
refreshUserAccountData() refreshUserAccountData()
ElMessage.success('参与每日抽奖成功!') push.success('参与每日抽奖成功!')
} }
const handleTask = async (item: TaskItemDto) => { const handleTask = async (item: TaskItemDto) => {
...@@ -499,7 +507,7 @@ const handleTask = async (item: TaskItemDto) => { ...@@ -499,7 +507,7 @@ const handleTask = async (item: TaskItemDto) => {
open.value = true open.value = true
} else if (item.svgName === 'valid_comments') { } else if (item.svgName === 'valid_comments') {
// 发布评论 // 发布评论
ElMessage.info('快去文章评论区去发表评论吧~') push.info('快去文章评论区去发表评论吧~')
} else if (item.svgName === 'topic_publish') { } else if (item.svgName === 'topic_publish') {
if (route.path.includes('/homePage/askTab')) { if (route.path.includes('/homePage/askTab')) {
// 同一个页面 需要加事件触发 watch // 同一个页面 需要加事件触发 watch
......
...@@ -243,7 +243,7 @@ import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue' ...@@ -243,7 +243,7 @@ import ExchangeYabiRecordDialog from './components/exchangeYabiRecordDilaog.vue'
import { useYaBiStore } from '@/stores' import { useYaBiStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { push } from 'notivue'
const yabiStore = useYaBiStore() const yabiStore = useYaBiStore()
const { yabiData } = storeToRefs(yabiStore) const { yabiData } = storeToRefs(yabiStore)
...@@ -321,13 +321,13 @@ const onExchangeGoods = async (item: BackendShopItemDto) => { ...@@ -321,13 +321,13 @@ const onExchangeGoods = async (item: BackendShopItemDto) => {
beforeClose: async (action, instance, done) => { beforeClose: async (action, instance, done) => {
if (action === 'cancel') return done() if (action === 'cancel') return done()
if (yabiData.value.currentValue < item.price * form.value.num) if (yabiData.value.currentValue < item.price * form.value.num)
return ElMessage.error( return push.error(
`您的YA币不足,兑换所需${item.price * form.value.num}YA币,当前YA币${yabiData.value.currentValue}`, `您的YA币不足,兑换所需${item.price * form.value.num}YA币,当前YA币${yabiData.value.currentValue}`,
) )
try { try {
instance.confirmButtonLoading = true instance.confirmButtonLoading = true
await exchangeGoods(form.value) await exchangeGoods(form.value)
ElMessage.success('兑换成功') push.success('兑换成功')
yabiStore.fetchYaBiData() yabiStore.fetchYaBiData()
item.stock -= form.value.num item.stock -= form.value.num
done() done()
......
...@@ -131,7 +131,7 @@ import { useUserStore } from '@/stores' ...@@ -131,7 +131,7 @@ import { useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import type { ISelectDept } from '@/utils/wxUtil' import type { ISelectDept } from '@/utils/wxUtil'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore) const { userInfo } = storeToRefs(userStore)
...@@ -163,7 +163,7 @@ const selcetDept = async () => { ...@@ -163,7 +163,7 @@ const selcetDept = async () => {
selectedDepartmentIds: form.value.departmentList.map((i) => i.id), selectedDepartmentIds: form.value.departmentList.map((i) => i.id),
}) })
if (departmentList.length > 3) { if (departmentList.length > 3) {
return ElMessage.warning('最多只能选择3个部门,请重新选择') return push.warning('最多只能选择3个部门,请重新选择')
} }
console.log('选中的部门等等', departmentList) console.log('选中的部门等等', departmentList)
form.value.departmentList = departmentList form.value.departmentList = departmentList
...@@ -248,7 +248,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => { ...@@ -248,7 +248,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
loading.value = true loading.value = true
try { try {
await addOrUpdateCase({ ...transformData(releaseStatus) }) await addOrUpdateCase({ ...transformData(releaseStatus) })
ElMessage.success('提交成功') push.success('提交成功')
resetForm() resetForm()
router.back() router.back()
} catch (error) { } catch (error) {
......
...@@ -267,7 +267,7 @@ import { useRouter, useRoute } from 'vue-router' ...@@ -267,7 +267,7 @@ import { useRouter, useRoute } from 'vue-router'
import { useUserStore } from '@/stores/user' import { useUserStore } from '@/stores/user'
import { selectDepOrUser } from '@/utils' import { selectDepOrUser } from '@/utils'
import type { FormItemRule } from 'element-plus' import type { FormItemRule } from 'element-plus'
import { push } from 'notivue'
const columnStore = useColumnStore() const columnStore = useColumnStore()
const { columnList } = storeToRefs(columnStore) const { columnList } = storeToRefs(columnStore)
const interviewStore = useInterviewStore() const interviewStore = useInterviewStore()
...@@ -450,7 +450,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => { ...@@ -450,7 +450,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
: await addOrUpdateArticle(transFormData(releaseStatus)) : await addOrUpdateArticle(transFormData(releaseStatus))
console.log(res) console.log(res)
drawerVisible.value = false drawerVisible.value = false
ElMessage.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功') push.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功')
resetForm() resetForm()
router.back() router.back()
// 发布成功后的逻辑... // 发布成功后的逻辑...
......
...@@ -354,7 +354,7 @@ import { useVideoStore, useUserStore } from '@/stores' ...@@ -354,7 +354,7 @@ import { useVideoStore, useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { selectDepOrUser } from '@/utils' import { selectDepOrUser } from '@/utils'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { push } from 'notivue'
const videoStore = useVideoStore() const videoStore = useVideoStore()
const { videoList } = storeToRefs(videoStore) const { videoList } = storeToRefs(videoStore)
...@@ -429,7 +429,7 @@ const videoDuration = ref(0) ...@@ -429,7 +429,7 @@ const videoDuration = ref(0)
const currentTime = ref(0) const currentTime = ref(0)
const handleOpenCoverDialog = () => { const handleOpenCoverDialog = () => {
if (!locationVideoBlolUrl.value) return ElMessage.warning('请先上传视频') if (!locationVideoBlolUrl.value) return push.warning('请先上传视频')
showCoverDialog.value = true showCoverDialog.value = true
} }
// 视频加载完成 // 视频加载完成
...@@ -478,7 +478,7 @@ const captureFrame = () => { ...@@ -478,7 +478,7 @@ const captureFrame = () => {
const { promise } = uploadFile(new File([blob], `video${Date.now()}.jpg`)) const { promise } = uploadFile(new File([blob], `video${Date.now()}.jpg`))
const data = await promise const data = await promise
form.value.faceUrl = data.filePath form.value.faceUrl = data.filePath
ElMessage.success('封面截取成功') push.success('封面截取成功')
} }
}, },
'image/jpeg', 'image/jpeg',
...@@ -492,7 +492,7 @@ const confirmCover = async () => { ...@@ -492,7 +492,7 @@ const confirmCover = async () => {
if (!form.value.faceUrl) return if (!form.value.faceUrl) return
showCoverDialog.value = false showCoverDialog.value = false
ElMessage.success('封面设置成功') push.success('封面设置成功')
} }
// 格式化时间 // 格式化时间
...@@ -557,7 +557,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => { ...@@ -557,7 +557,7 @@ const handleSubmit = async (releaseStatus: ReleaseStatusTypeEnum) => {
loading.value = true loading.value = true
try { try {
addOrUpdateArticle(tansformData(releaseStatus)) addOrUpdateArticle(tansformData(releaseStatus))
ElMessage.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功') push.success(releaseStatus === ReleaseStatusTypeEnum.PUBLISH ? '发布成功' : '存草稿成功')
resetPageData() resetPageData()
router.push('/') router.push('/')
// 重置数据 // 重置数据
......
...@@ -400,7 +400,7 @@ import { storeToRefs } from 'pinia' ...@@ -400,7 +400,7 @@ import { storeToRefs } from 'pinia'
import { useNavigation } from '@/hooks' import { useNavigation } from '@/hooks'
import { parseEmoji } from '@/utils/emoji' import { parseEmoji } from '@/utils/emoji'
import { ArticleTypeEnum } from '@/constants' import { ArticleTypeEnum } from '@/constants'
import { push } from 'notivue'
const userStore = useUserStore() const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore) const { userInfo } = storeToRefs(userStore)
const { jumpToUserHomePage } = useNavigation() const { jumpToUserHomePage } = useNavigation()
...@@ -464,7 +464,7 @@ const handleLikeArticle = async () => { ...@@ -464,7 +464,7 @@ const handleLikeArticle = async () => {
questionDetail.value.praiseCount = questionDetail.value.hasPraised questionDetail.value.praiseCount = questionDetail.value.hasPraised
? questionDetail.value.praiseCount + 1 ? questionDetail.value.praiseCount + 1
: questionDetail.value.praiseCount - 1 : questionDetail.value.praiseCount - 1
ElMessage.success(`${questionDetail.value.hasPraised ? '点赞该问题' : '取消点赞该问题'}`) push.success(`${questionDetail.value.hasPraised ? '点赞该问题' : '取消点赞该问题'}`)
} }
const handleCollectArticle = async () => { const handleCollectArticle = async () => {
...@@ -473,14 +473,14 @@ const handleCollectArticle = async () => { ...@@ -473,14 +473,14 @@ const handleCollectArticle = async () => {
questionDetail.value.collectionCount = questionDetail.value.hasCollect questionDetail.value.collectionCount = questionDetail.value.hasCollect
? questionDetail.value.collectionCount + 1 ? questionDetail.value.collectionCount + 1
: questionDetail.value.collectionCount - 1 : questionDetail.value.collectionCount - 1
ElMessage.success(`${questionDetail.value.hasCollect ? '收藏成功' : '取消收藏成功'}`) push.success(`${questionDetail.value.hasCollect ? '收藏成功' : '取消收藏成功'}`)
} }
const handleLikeAnswer = async (answer: any) => { const handleLikeAnswer = async (answer: any) => {
await addOrCancelCommentLike(answer.id) await addOrCancelCommentLike(answer.id)
answer.hasPraise = !answer.hasPraise answer.hasPraise = !answer.hasPraise
answer.postPriseCount = answer.hasPraise ? answer.postPriseCount + 1 : answer.postPriseCount - 1 answer.postPriseCount = answer.hasPraise ? answer.postPriseCount + 1 : answer.postPriseCount - 1
ElMessage.success(`${answer.hasPraise ? '点赞该回答' : '取消点赞该回答'}`) push.success(`${answer.hasPraise ? '点赞该回答' : '取消点赞该回答'}`)
} }
const handleComment = (answer: any, index: number) => { const handleComment = (answer: any, index: number) => {
......
...@@ -127,7 +127,7 @@ import { AuditStatusEnum } from '@/constants' ...@@ -127,7 +127,7 @@ import { AuditStatusEnum } from '@/constants'
import type { AuditComplaintDto } from '@/api' import type { AuditComplaintDto } from '@/api'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import { useNavigation } from '@/hooks' import { useNavigation } from '@/hooks'
import { push } from 'notivue'
const toggleTab = (key: TabPaneName) => { const toggleTab = (key: TabPaneName) => {
searchParams.value.status = key as AuditStatusEnum searchParams.value.status = key as AuditStatusEnum
refresh() refresh()
...@@ -156,7 +156,7 @@ const handleAudit = async (data: AuditComplaintDto) => { ...@@ -156,7 +156,7 @@ const handleAudit = async (data: AuditComplaintDto) => {
} }
await auditComplaint(data) await auditComplaint(data)
ElMessage.success('审核成功') push.success('审核成功')
refresh() refresh()
} }
......
...@@ -48,7 +48,7 @@ import UploadFile from '@/components/common/UploadFile/index.vue' ...@@ -48,7 +48,7 @@ import UploadFile from '@/components/common/UploadFile/index.vue'
import { updateUserInfo } from '@/api' import { updateUserInfo } from '@/api'
import type { UpdateUserInfoDto } from '@/api' import type { UpdateUserInfoDto } from '@/api'
import { useResetData } from '@/hooks' import { useResetData } from '@/hooks'
import { push } from 'notivue'
const dialogVisible = ref(false) const dialogVisible = ref(false)
const loading = ref(false) const loading = ref(false)
const formRef = useTemplateRef<FormInstance>('formRef') const formRef = useTemplateRef<FormInstance>('formRef')
...@@ -99,7 +99,7 @@ const handleConfirm = async () => { ...@@ -99,7 +99,7 @@ const handleConfirm = async () => {
await updateUserInfo(form.value) await updateUserInfo(form.value)
close() close()
ElMessage.success('保存成功') push.success('保存成功')
} catch (error) { } catch (error) {
console.error('表单验证失败:', error) console.error('表单验证失败:', error)
} finally { } finally {
......
...@@ -137,8 +137,9 @@ import { auditTypeListOptions, articleTypeListOptions } from '@/constants/option ...@@ -137,8 +137,9 @@ import { auditTypeListOptions, articleTypeListOptions } from '@/constants/option
import { AuditStatusEnum } from '@/constants' import { AuditStatusEnum } from '@/constants'
import type { AuditArticleDto } from '@/api' import type { AuditArticleDto } from '@/api'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const { jumpToArticleDetailPage } = useNavigation() const { jumpToArticleDetailPage } = useNavigation()
const toggleTab = (key: TabPaneName) => { const toggleTab = (key: TabPaneName) => {
...@@ -187,7 +188,7 @@ const handleAudit = async (data: AuditArticleDto) => { ...@@ -187,7 +188,7 @@ const handleAudit = async (data: AuditArticleDto) => {
} }
await auditArticle(data) await auditArticle(data)
ElMessage.success('审核成功') push.success('审核成功')
refresh() refresh()
} }
......
...@@ -116,6 +116,7 @@ import dayjs from 'dayjs' ...@@ -116,6 +116,7 @@ import dayjs from 'dayjs'
import { ReleaseStatusTypeEnum, AuditStatusEnum, UsageStatusEnum } from '@/constants' import { ReleaseStatusTypeEnum, AuditStatusEnum, UsageStatusEnum } from '@/constants'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import type { SelfCaseItemDto } from '@/api/user/types' import type { SelfCaseItemDto } from '@/api/user/types'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const caseTypeListOptions = [ const caseTypeListOptions = [
...@@ -251,7 +252,7 @@ const handleView = async (item: SelfCaseItemDto) => { ...@@ -251,7 +252,7 @@ const handleView = async (item: SelfCaseItemDto) => {
const handleEdit = async (item: SelfCaseItemDto) => { const handleEdit = async (item: SelfCaseItemDto) => {
if (item.isAudit === AuditStatusEnum.AGREED && item.isUse === UsageStatusEnum.USED) if (item.isAudit === AuditStatusEnum.AGREED && item.isUse === UsageStatusEnum.USED)
return ElMessage.warning('案例已使用,无法编辑') return push.warning('案例已使用,无法编辑')
router.push(`/publishCase?id=${item.id}`) router.push(`/publishCase?id=${item.id}`)
} }
...@@ -263,7 +264,7 @@ const handleDelete = async (item: SelfCaseItemDto) => { ...@@ -263,7 +264,7 @@ const handleDelete = async (item: SelfCaseItemDto) => {
type: 'warning', type: 'warning',
}) })
await deleteCase(item.id) await deleteCase(item.id)
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} }
......
...@@ -106,7 +106,7 @@ import { CommentTypeEnum, ArticleTypeEnum } from '@/constants/enums' ...@@ -106,7 +106,7 @@ import { CommentTypeEnum, ArticleTypeEnum } from '@/constants/enums'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import { IS_REAL_KEY } from '@/constants/symbolKey' import { IS_REAL_KEY } from '@/constants/symbolKey'
import { useNavigation } from '@/hooks' import { useNavigation } from '@/hooks'
import { push } from 'notivue'
const route = useRoute() const route = useRoute()
const isReal = inject(IS_REAL_KEY) const isReal = inject(IS_REAL_KEY)
...@@ -140,7 +140,7 @@ const handleDelete = async (id: number) => { ...@@ -140,7 +140,7 @@ const handleDelete = async (id: number) => {
type: 'warning', type: 'warning',
}) })
await deleteComment(id) await deleteComment(id)
ElMessage.success('删除成功') push.success('删除成功')
refresh() refresh()
} }
......
...@@ -88,7 +88,7 @@ import dayjs from 'dayjs' ...@@ -88,7 +88,7 @@ import dayjs from 'dayjs'
import { ArticleTypeEnum } from '@/constants/enums' import { ArticleTypeEnum } from '@/constants/enums'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import { IS_REAL_KEY } from '@/constants/symbolKey' import { IS_REAL_KEY } from '@/constants/symbolKey'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const isReal = inject(IS_REAL_KEY) const isReal = inject(IS_REAL_KEY)
...@@ -118,7 +118,7 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize } ...@@ -118,7 +118,7 @@ const { list, loading, searchParams, total, refresh, goToPage, changePageSize }
const handleEdit = (item: any) => { const handleEdit = (item: any) => {
if (item.type === ArticleTypeEnum.VIDEO) { if (item.type === ArticleTypeEnum.VIDEO) {
// router.push(`/publishVideo/${item.id}`) // router.push(`/publishVideo/${item.id}`)
ElMessage.warning('视频编辑功能暂未开放') push.warning('视频编辑功能暂未开放')
} else { } else {
router.push(`/publishLongArticle/${item.type}?id=${item.id}`) router.push(`/publishLongArticle/${item.type}?id=${item.id}`)
} }
...@@ -132,7 +132,7 @@ const handleDelete = async (item: any) => { ...@@ -132,7 +132,7 @@ const handleDelete = async (item: any) => {
}) })
await deleteArticle(item.id) await deleteArticle(item.id)
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
} }
onActivated(() => { onActivated(() => {
......
...@@ -95,7 +95,7 @@ import { ArticleTypeEnum } from '@/constants/enums' ...@@ -95,7 +95,7 @@ import { ArticleTypeEnum } from '@/constants/enums'
import type { TabPaneName } from 'element-plus' import type { TabPaneName } from 'element-plus'
import { IS_REAL_KEY } from '@/constants/symbolKey' import { IS_REAL_KEY } from '@/constants/symbolKey'
import { useNavigation } from '@/hooks' import { useNavigation } from '@/hooks'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const isReal = inject(IS_REAL_KEY) const isReal = inject(IS_REAL_KEY)
...@@ -134,7 +134,7 @@ const handleDelete = async (articleId: number) => { ...@@ -134,7 +134,7 @@ const handleDelete = async (articleId: number) => {
}) })
await deleteArticle(articleId) await deleteArticle(articleId)
refresh() refresh()
ElMessage.success('删除成功') push.success('删除成功')
} }
const jumpToEditPage = (item: { type: ArticleTypeEnum; id: number }) => { const jumpToEditPage = (item: { type: ArticleTypeEnum; id: number }) => {
......
...@@ -90,7 +90,7 @@ import type { TabPaneName } from 'element-plus' ...@@ -90,7 +90,7 @@ import type { TabPaneName } from 'element-plus'
import { TaskDateLimitTypeText } from '@/constants' import { TaskDateLimitTypeText } from '@/constants'
import type { TaskItemDto } from '@/api' import type { TaskItemDto } from '@/api'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { push } from 'notivue'
const router = useRouter() const router = useRouter()
const toggleTab = (key: TabPaneName) => { const toggleTab = (key: TabPaneName) => {
searchParams.value.taskType = key as TaskTypeEnum searchParams.value.taskType = key as TaskTypeEnum
...@@ -112,7 +112,7 @@ const handleTask = async (item: TaskItemDto) => { ...@@ -112,7 +112,7 @@ const handleTask = async (item: TaskItemDto) => {
router.push(`/homePage/homeTab#levelContainerRef`) router.push(`/homePage/homeTab#levelContainerRef`)
} else if (item.svgName === 'valid_comments') { } else if (item.svgName === 'valid_comments') {
// 发布评论 // 发布评论
ElMessage.info('快去文章评论区去发表评论吧~') push.info('快去文章评论区去发表评论吧~')
} else if (item.svgName === 'topic_publish') { } else if (item.svgName === 'topic_publish') {
router.push(`/homePage/askTab#tabsRef`) router.push(`/homePage/askTab#tabsRef`)
} else if (item.svgName === 'answer_ask') { } else if (item.svgName === 'answer_ask') {
......
...@@ -167,6 +167,7 @@ import type { TabPaneName } from 'element-plus' ...@@ -167,6 +167,7 @@ import type { TabPaneName } from 'element-plus'
import { IS_REAL_KEY } from '@/constants/symbolKey' import { IS_REAL_KEY } from '@/constants/symbolKey'
import { useOnlineTimeStore, useUserStore } from '@/stores' import { useOnlineTimeStore, useUserStore } from '@/stores'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { push } from 'notivue'
const { showOnlineTime } = storeToRefs(useOnlineTimeStore()) const { showOnlineTime } = storeToRefs(useOnlineTimeStore())
const router = useRouter() const router = useRouter()
...@@ -361,7 +362,7 @@ const handleSwitchAccount = async () => { ...@@ -361,7 +362,7 @@ const handleSwitchAccount = async () => {
customClass: 'min-w-740px', customClass: 'min-w-740px',
beforeClose: async (action, instance, done) => { beforeClose: async (action, instance, done) => {
if (action === 'confirm') { if (action === 'confirm') {
if (!selectedEmail.value) return ElMessage.warning('请选择要切换的账号') if (!selectedEmail.value) return push.warning('请选择要切换的账号')
instance.confirmButtonLoading = true instance.confirmButtonLoading = true
try { try {
const { data } = await generateLoginKey({ const { data } = await generateLoginKey({
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
import { addOrCancelArticleReward } from '@/api' import { addOrCancelArticleReward } from '@/api'
import { useYaBiStore } from '@/stores' import { useYaBiStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { push } from 'notivue'
const yabiStore = useYaBiStore() const yabiStore = useYaBiStore()
const { yabiData } = storeToRefs(yabiStore) const { yabiData } = storeToRefs(yabiStore)
...@@ -103,7 +103,7 @@ const selectAmount = (amount: number) => { ...@@ -103,7 +103,7 @@ const selectAmount = (amount: number) => {
// 确认打赏 // 确认打赏
const handleConfirm = async () => { const handleConfirm = async () => {
if (yabiData.value.currentValue < selectedAmount.value) { if (yabiData.value.currentValue < selectedAmount.value) {
ElMessage.warning('余额不足,请先充值') push.warning('余额不足,请先充值')
return return
} }
...@@ -111,7 +111,7 @@ const handleConfirm = async () => { ...@@ -111,7 +111,7 @@ const handleConfirm = async () => {
articleId: articleId, articleId: articleId,
ayabi: selectedAmount.value, ayabi: selectedAmount.value,
}) })
ElMessage.success('打赏成功!') push.success('打赏成功!')
dialogVisible.value = false dialogVisible.value = false
rewardNum.value += selectedAmount.value rewardNum.value += selectedAmount.value
yabiStore.fetchYaBiData() yabiStore.fetchYaBiData()
......
...@@ -325,7 +325,7 @@ import ActionMore from '@/components/common/ActionMore/index.vue' ...@@ -325,7 +325,7 @@ import ActionMore from '@/components/common/ActionMore/index.vue'
import BackButton from '@/components/common/BackButton/index.vue' import BackButton from '@/components/common/BackButton/index.vue'
import { useNavigation } from '@/hooks' import { useNavigation } from '@/hooks'
import { ArticleTypeEnum } from '@/constants' import { ArticleTypeEnum } from '@/constants'
import { push } from 'notivue'
const route = useRoute() const route = useRoute()
const videoId = Number(route.params.id) const videoId = Number(route.params.id)
const { jumpToUserHomePage } = useNavigation() const { jumpToUserHomePage } = useNavigation()
...@@ -360,7 +360,7 @@ const handleLike = async (item: ArticleItemDto) => { ...@@ -360,7 +360,7 @@ const handleLike = async (item: ArticleItemDto) => {
await addOrCanceArticlelLike(item.id) await addOrCanceArticlelLike(item.id)
item.hasPraised = !item.hasPraised item.hasPraised = !item.hasPraised
item.praiseCount = item.hasPraised ? item.praiseCount + 1 : item.praiseCount - 1 item.praiseCount = item.hasPraised ? item.praiseCount + 1 : item.praiseCount - 1
ElMessage.success(item.hasPraised ? '点赞成功' : '取消点赞') push.success(item.hasPraised ? '点赞成功' : '取消点赞')
} }
// 收藏 // 收藏
...@@ -368,7 +368,7 @@ const handleCollect = async (item: ArticleItemDto) => { ...@@ -368,7 +368,7 @@ const handleCollect = async (item: ArticleItemDto) => {
await addOrCanceArticlelCollect(item.id) await addOrCanceArticlelCollect(item.id)
item.hasCollect = !item.hasCollect item.hasCollect = !item.hasCollect
item.collectionCount = item.hasCollect ? item.collectionCount + 1 : item.collectionCount - 1 item.collectionCount = item.hasCollect ? item.collectionCount + 1 : item.collectionCount - 1
ElMessage.success(item.hasCollect ? '收藏成功' : '取消收藏') push.success(item.hasCollect ? '收藏成功' : '取消收藏')
} }
// 打赏 // 打赏
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment