diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/router/modules/benchList.ts b/src/router/modules/benchList.ts deleted file mode 100644 index f5280fa..0000000 --- a/src/router/modules/benchList.ts +++ /dev/null @@ -1,147 +0,0 @@ -import type { Route } from '@/global' - -const Layout = () => import('@/layouts/index.vue') - -const routes: Route.recordRaw[] = [ - { - path: '/customer', - component: Layout, - redirect: '/customer/bench', - name: 'CustomerBench', - meta: { - title: '工作台', - icon: 'ep:key', - auth: '/customer/bench', - }, - children: [ - { - path: 'bench', - name: 'CustomerBenchPage', - component: () => import('@/views/customer/bench/bench.vue'), - meta: { - title: '工作台', - auth: '/customer/bench', - sidebar: false, - breadcrumb: true, - activeMenu: '/customer', - }, - }, - ], - }, - { - path: '/sample', - component: Layout, - redirect: '/sample/list', - name: 'Sample', - meta: { - title: '样品库', - icon: 'ep:key', - auth: '/sample', - }, - children: [ - { - path: 'list', - name: 'SampleList', - component: () => import('@/views/customer/sample/list/list.vue'), - meta: { - title: '样品列表', - icon: 'ep:key', - auth: '/sample/list', - }, - }, - { - path: ':type/:id?', - name: 'SampleDetail', - component: () => import('@/views/customer/sample/list/edit.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/list', - }, - }, - { - path: 'overtime', - name: 'OvertimeSample', - component: () => import('@/views/customer/sample/overTime/list.vue'), - meta: { - title: '到期样品', - icon: 'ep:key', - auth: '/sample/overtime', - }, - }, - { - path: 'overtime/:type/:id?', - name: 'OverTimeDetail', - component: () => import('@/views/customer/sample/overTime/detail.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/overtime', - }, - }, - ], - }, - { - path: '/customerManage', - component: Layout, - redirect: '/customerManage/list', - name: 'Customer', - meta: { - title: '客户管理', - icon: 'ep:key', - auth: '/customer/manage', - }, - children: [ - { - path: 'list', - name: 'CustomerList', - component: () => import('@/views/customer/customerInfo/customerList.vue'), - meta: { - title: '客户列表', - icon: 'ep:key', - auth: '/customer/list', - }, - }, - { - path: ':type/:id?', - name: 'CustomerDetail', - component: () => import('@/views/customer/customerInfo/customerEdit.vue'), - meta: { - title: '客户详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/customerManage/list', - }, - }, - { - path: 'advice', - name: 'CustomerAdvice', - component: () => import('@/views/customer/advice/adviceList.vue'), - meta: { - title: '客户关系', - icon: 'ep:key', - auth: '/customer/advice', - }, - }, - { - path: 'advice/:type/:id?', - name: 'CustomerAdviceDetail', - component: () => import('@/views/customer/advice/adviceEdit.vue'), - meta: { - title: '客户关系详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/source/approve', - }, - }, - ], - }, -] - -export default routes diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/router/modules/benchList.ts b/src/router/modules/benchList.ts deleted file mode 100644 index f5280fa..0000000 --- a/src/router/modules/benchList.ts +++ /dev/null @@ -1,147 +0,0 @@ -import type { Route } from '@/global' - -const Layout = () => import('@/layouts/index.vue') - -const routes: Route.recordRaw[] = [ - { - path: '/customer', - component: Layout, - redirect: '/customer/bench', - name: 'CustomerBench', - meta: { - title: '工作台', - icon: 'ep:key', - auth: '/customer/bench', - }, - children: [ - { - path: 'bench', - name: 'CustomerBenchPage', - component: () => import('@/views/customer/bench/bench.vue'), - meta: { - title: '工作台', - auth: '/customer/bench', - sidebar: false, - breadcrumb: true, - activeMenu: '/customer', - }, - }, - ], - }, - { - path: '/sample', - component: Layout, - redirect: '/sample/list', - name: 'Sample', - meta: { - title: '样品库', - icon: 'ep:key', - auth: '/sample', - }, - children: [ - { - path: 'list', - name: 'SampleList', - component: () => import('@/views/customer/sample/list/list.vue'), - meta: { - title: '样品列表', - icon: 'ep:key', - auth: '/sample/list', - }, - }, - { - path: ':type/:id?', - name: 'SampleDetail', - component: () => import('@/views/customer/sample/list/edit.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/list', - }, - }, - { - path: 'overtime', - name: 'OvertimeSample', - component: () => import('@/views/customer/sample/overTime/list.vue'), - meta: { - title: '到期样品', - icon: 'ep:key', - auth: '/sample/overtime', - }, - }, - { - path: 'overtime/:type/:id?', - name: 'OverTimeDetail', - component: () => import('@/views/customer/sample/overTime/detail.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/overtime', - }, - }, - ], - }, - { - path: '/customerManage', - component: Layout, - redirect: '/customerManage/list', - name: 'Customer', - meta: { - title: '客户管理', - icon: 'ep:key', - auth: '/customer/manage', - }, - children: [ - { - path: 'list', - name: 'CustomerList', - component: () => import('@/views/customer/customerInfo/customerList.vue'), - meta: { - title: '客户列表', - icon: 'ep:key', - auth: '/customer/list', - }, - }, - { - path: ':type/:id?', - name: 'CustomerDetail', - component: () => import('@/views/customer/customerInfo/customerEdit.vue'), - meta: { - title: '客户详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/customerManage/list', - }, - }, - { - path: 'advice', - name: 'CustomerAdvice', - component: () => import('@/views/customer/advice/adviceList.vue'), - meta: { - title: '客户关系', - icon: 'ep:key', - auth: '/customer/advice', - }, - }, - { - path: 'advice/:type/:id?', - name: 'CustomerAdviceDetail', - component: () => import('@/views/customer/advice/adviceEdit.vue'), - meta: { - title: '客户关系详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/source/approve', - }, - }, - ], - }, -] - -export default routes diff --git a/src/router/modules/workbench.ts b/src/router/modules/workbench.ts index 94ee81a..a780d86 100644 --- a/src/router/modules/workbench.ts +++ b/src/router/modules/workbench.ts @@ -40,6 +40,15 @@ activeMenu: '/workbench', }, }, + { + path: 'noticeList', + name: 'NoticeList', + meta: { + title: '通知公告', + sidebar: true, + activeMenu: '/workbench', + }, + }, ], }, { diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/router/modules/benchList.ts b/src/router/modules/benchList.ts deleted file mode 100644 index f5280fa..0000000 --- a/src/router/modules/benchList.ts +++ /dev/null @@ -1,147 +0,0 @@ -import type { Route } from '@/global' - -const Layout = () => import('@/layouts/index.vue') - -const routes: Route.recordRaw[] = [ - { - path: '/customer', - component: Layout, - redirect: '/customer/bench', - name: 'CustomerBench', - meta: { - title: '工作台', - icon: 'ep:key', - auth: '/customer/bench', - }, - children: [ - { - path: 'bench', - name: 'CustomerBenchPage', - component: () => import('@/views/customer/bench/bench.vue'), - meta: { - title: '工作台', - auth: '/customer/bench', - sidebar: false, - breadcrumb: true, - activeMenu: '/customer', - }, - }, - ], - }, - { - path: '/sample', - component: Layout, - redirect: '/sample/list', - name: 'Sample', - meta: { - title: '样品库', - icon: 'ep:key', - auth: '/sample', - }, - children: [ - { - path: 'list', - name: 'SampleList', - component: () => import('@/views/customer/sample/list/list.vue'), - meta: { - title: '样品列表', - icon: 'ep:key', - auth: '/sample/list', - }, - }, - { - path: ':type/:id?', - name: 'SampleDetail', - component: () => import('@/views/customer/sample/list/edit.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/list', - }, - }, - { - path: 'overtime', - name: 'OvertimeSample', - component: () => import('@/views/customer/sample/overTime/list.vue'), - meta: { - title: '到期样品', - icon: 'ep:key', - auth: '/sample/overtime', - }, - }, - { - path: 'overtime/:type/:id?', - name: 'OverTimeDetail', - component: () => import('@/views/customer/sample/overTime/detail.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/overtime', - }, - }, - ], - }, - { - path: '/customerManage', - component: Layout, - redirect: '/customerManage/list', - name: 'Customer', - meta: { - title: '客户管理', - icon: 'ep:key', - auth: '/customer/manage', - }, - children: [ - { - path: 'list', - name: 'CustomerList', - component: () => import('@/views/customer/customerInfo/customerList.vue'), - meta: { - title: '客户列表', - icon: 'ep:key', - auth: '/customer/list', - }, - }, - { - path: ':type/:id?', - name: 'CustomerDetail', - component: () => import('@/views/customer/customerInfo/customerEdit.vue'), - meta: { - title: '客户详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/customerManage/list', - }, - }, - { - path: 'advice', - name: 'CustomerAdvice', - component: () => import('@/views/customer/advice/adviceList.vue'), - meta: { - title: '客户关系', - icon: 'ep:key', - auth: '/customer/advice', - }, - }, - { - path: 'advice/:type/:id?', - name: 'CustomerAdviceDetail', - component: () => import('@/views/customer/advice/adviceEdit.vue'), - meta: { - title: '客户关系详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/source/approve', - }, - }, - ], - }, -] - -export default routes diff --git a/src/router/modules/workbench.ts b/src/router/modules/workbench.ts index 94ee81a..a780d86 100644 --- a/src/router/modules/workbench.ts +++ b/src/router/modules/workbench.ts @@ -40,6 +40,15 @@ activeMenu: '/workbench', }, }, + { + path: 'noticeList', + name: 'NoticeList', + meta: { + title: '通知公告', + sidebar: true, + activeMenu: '/workbench', + }, + }, ], }, { diff --git a/src/router/routes.ts b/src/router/routes.ts index ed49855..6b79004 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -55,8 +55,9 @@ name: 'workbench', component: () => import('@/views/workbench.vue'), meta: { - title: '总工作台子组件', - breadcrumb: false, + title: '总工作台', + sidebar: true, + breadcrumb: true, }, }, { @@ -80,6 +81,17 @@ // activeMenu: '/comprehensive', }, }, + { + path: 'noticeList', + name: 'NoticeList', + component: () => import('@/views/workbench/notice/list.vue'), + meta: { + title: '通知公告', + sidebar: true, + breadcrumb: true, + // activeMenu: '/comprehensive', + }, + }, ], }, { diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/router/modules/benchList.ts b/src/router/modules/benchList.ts deleted file mode 100644 index f5280fa..0000000 --- a/src/router/modules/benchList.ts +++ /dev/null @@ -1,147 +0,0 @@ -import type { Route } from '@/global' - -const Layout = () => import('@/layouts/index.vue') - -const routes: Route.recordRaw[] = [ - { - path: '/customer', - component: Layout, - redirect: '/customer/bench', - name: 'CustomerBench', - meta: { - title: '工作台', - icon: 'ep:key', - auth: '/customer/bench', - }, - children: [ - { - path: 'bench', - name: 'CustomerBenchPage', - component: () => import('@/views/customer/bench/bench.vue'), - meta: { - title: '工作台', - auth: '/customer/bench', - sidebar: false, - breadcrumb: true, - activeMenu: '/customer', - }, - }, - ], - }, - { - path: '/sample', - component: Layout, - redirect: '/sample/list', - name: 'Sample', - meta: { - title: '样品库', - icon: 'ep:key', - auth: '/sample', - }, - children: [ - { - path: 'list', - name: 'SampleList', - component: () => import('@/views/customer/sample/list/list.vue'), - meta: { - title: '样品列表', - icon: 'ep:key', - auth: '/sample/list', - }, - }, - { - path: ':type/:id?', - name: 'SampleDetail', - component: () => import('@/views/customer/sample/list/edit.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/list', - }, - }, - { - path: 'overtime', - name: 'OvertimeSample', - component: () => import('@/views/customer/sample/overTime/list.vue'), - meta: { - title: '到期样品', - icon: 'ep:key', - auth: '/sample/overtime', - }, - }, - { - path: 'overtime/:type/:id?', - name: 'OverTimeDetail', - component: () => import('@/views/customer/sample/overTime/detail.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/overtime', - }, - }, - ], - }, - { - path: '/customerManage', - component: Layout, - redirect: '/customerManage/list', - name: 'Customer', - meta: { - title: '客户管理', - icon: 'ep:key', - auth: '/customer/manage', - }, - children: [ - { - path: 'list', - name: 'CustomerList', - component: () => import('@/views/customer/customerInfo/customerList.vue'), - meta: { - title: '客户列表', - icon: 'ep:key', - auth: '/customer/list', - }, - }, - { - path: ':type/:id?', - name: 'CustomerDetail', - component: () => import('@/views/customer/customerInfo/customerEdit.vue'), - meta: { - title: '客户详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/customerManage/list', - }, - }, - { - path: 'advice', - name: 'CustomerAdvice', - component: () => import('@/views/customer/advice/adviceList.vue'), - meta: { - title: '客户关系', - icon: 'ep:key', - auth: '/customer/advice', - }, - }, - { - path: 'advice/:type/:id?', - name: 'CustomerAdviceDetail', - component: () => import('@/views/customer/advice/adviceEdit.vue'), - meta: { - title: '客户关系详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/source/approve', - }, - }, - ], - }, -] - -export default routes diff --git a/src/router/modules/workbench.ts b/src/router/modules/workbench.ts index 94ee81a..a780d86 100644 --- a/src/router/modules/workbench.ts +++ b/src/router/modules/workbench.ts @@ -40,6 +40,15 @@ activeMenu: '/workbench', }, }, + { + path: 'noticeList', + name: 'NoticeList', + meta: { + title: '通知公告', + sidebar: true, + activeMenu: '/workbench', + }, + }, ], }, { diff --git a/src/router/routes.ts b/src/router/routes.ts index ed49855..6b79004 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -55,8 +55,9 @@ name: 'workbench', component: () => import('@/views/workbench.vue'), meta: { - title: '总工作台子组件', - breadcrumb: false, + title: '总工作台', + sidebar: true, + breadcrumb: true, }, }, { @@ -80,6 +81,17 @@ // activeMenu: '/comprehensive', }, }, + { + path: 'noticeList', + name: 'NoticeList', + component: () => import('@/views/workbench/notice/list.vue'), + meta: { + title: '通知公告', + sidebar: true, + breadcrumb: true, + // activeMenu: '/comprehensive', + }, + }, ], }, { diff --git a/src/views/system/notice/noteAdd.vue b/src/views/system/notice/noteAdd.vue index 9f56b80..e9cce80 100644 --- a/src/views/system/notice/noteAdd.vue +++ b/src/views/system/notice/noteAdd.vue @@ -29,6 +29,16 @@ noticeContent: [{ required: true, message: '发布内容必填', trigger: 'blur' }], }) // 表单验证规则 const dialogVisible = ref(false) // 弹窗显示 + +// 重置 +const resetDialog = () => { + ruleForm.noticeTime = '' + ruleForm.noticeSketch = '' + ruleForm.noticeContent = '' + ruleForm.minioFileName = '' + ruleForm.noticeTitle = '' +} + // 弹窗初始化 const initDialog = (row: any) => { dialogVisible.value = true @@ -37,6 +47,7 @@ ruleForm.noticePublisher = userInfo.$state.name ruleForm.noticeCompany = userInfo.$state.deptName ruleForm.noticeTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + resetDialog() } else { // 获取详情信息 @@ -62,14 +73,7 @@ } } defineExpose({ initDialog }) -// 重置 -const resetDialog = () => { - ruleForm.noticeTime = '' - ruleForm.noticeSketch = '' - ruleForm.noticeContent = '' - ruleForm.minioFileName = '' - ruleForm.noticeTitle = '' -} + // 关闭弹窗 const close = () => { resetDialog() @@ -146,7 +150,83 @@ // 富文本实例对象 const editorRef = shallowRef() // 菜单配置 -const toolbarConfig = ref({}) +const toolbarConfig = { + /* 工具栏配置 */ + toolbarKeys: [ + 'bold', + 'underline', + 'italic', + 'clearStyle', + 'color', + 'bgColor', + '|', + // 菜单组,包含多个菜单 + // { + // key: 'group-link', + // title: '链接', + // menuKeys: ['insertLink', 'editLink', 'unLink', 'viewLink'], + // }, + 'fontSize', + 'fontFamily', + 'lineHeight', + { + key: 'group-justify', + title: '对齐', + iconSvg: '', + menuKeys: [ + 'justifyLeft', + 'justifyRight', + 'justifyCenter', + 'justifyJustify', + ], + }, + { + key: 'group-indent', + title: '缩进', + iconSvg: '', + menuKeys: [ + 'indent', + 'delIndent', + ], + }, + { + key: 'group-more-style', + title: '更多', + iconSvg: '', + menuKeys: [ + 'through', + 'code', + 'sup', + 'sub', + 'clearStyle', + ], + }, + '|', + 'bulletedList', + 'numberedList', + 'todo', + + { + key: 'group-table', + title: '表格', + menuKeys: ['insertTable', + 'deleteTable', + 'insertTableRow', + 'deleteTableRow', + 'insertTableCol', + 'deleteTableCol', + 'tableHeader', + 'tableFullWidth'], + }, + 'divider', + // 'emotion', 表情 + 'blockquote', + 'headerSelect', + 'redo', + 'undo', + 'fullScreen', + ], +} // 编辑器配置 const editorConfig = ref({ placeholder: '请输入内容...', diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 94fae4a..38680cc 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -9,6 +9,16 @@ data, }) } + +// 审批提醒状态变更 +export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/approvalMessage/updateStatus', + method: 'post', + data, + }) +} + // 工作提醒列表 export function getWorkMessageList(data: { offset: number; limit: number }) { return request({ @@ -18,6 +28,14 @@ }) } +// 通知公告已读状态修改 +export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { + return request({ + url: '/system/notice/read', + method: 'post', + data, + }) +} // -----------------------------------------日历------------------------------------------ // 新增日程 export function addSchedule(data: object) { diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index af46b92..9abe8b4 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -4,6 +4,7 @@ import dayjs from 'dayjs' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' +import { changeWorkbenchApproveStatus } from '@/api/workbench/workbench' /** * 审批弹窗 */ @@ -67,6 +68,10 @@ if (formData.type) { submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') + // 改变总工作台审批提醒的已处理状态 + if (sessionStorage.getItem('workbenchApproveId')) { + changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + } btnLoading.value = false dialogVisible.value = false emit('onSuccess') diff --git a/src/layouts/components/workBenchHeader/index.vue b/src/layouts/components/workBenchHeader/index.vue index bb31ccf..906f7a8 100644 --- a/src/layouts/components/workBenchHeader/index.vue +++ b/src/layouts/components/workBenchHeader/index.vue @@ -5,7 +5,6 @@ import useSettingsStore from '@/store/modules/settings' import useMenuStore from '@/store/modules/menu' import headerImage from '@/assets/images/header-image.png' -import benchListRoute from '@/router/modules/benchList' const settingsStore = useSettingsStore() const menuStore = useMenuStore() diff --git a/src/layouts/workBenchLayouts.vue b/src/layouts/workBenchLayouts.vue index 21d5ba3..c7946df 100644 --- a/src/layouts/workBenchLayouts.vue +++ b/src/layouts/workBenchLayouts.vue @@ -3,7 +3,7 @@ import NewHeader from './components/workBenchHeader/index.vue' import MainSidebar from './components/MainSidebar/index.vue' import SubSidebar from './components/SubSidebar/workbenchSiderBar.vue' -// import Topbar from './components/Topbar/index.vue' +import Topbar from './components/Topbar/index.vue' import Search from './components/Search/index.vue' import AppSetting from './components/AppSetting/index.vue' import HotkeysIntro from './components/HotkeysIntro/index.vue' diff --git a/src/router/modules/benchList.ts b/src/router/modules/benchList.ts deleted file mode 100644 index f5280fa..0000000 --- a/src/router/modules/benchList.ts +++ /dev/null @@ -1,147 +0,0 @@ -import type { Route } from '@/global' - -const Layout = () => import('@/layouts/index.vue') - -const routes: Route.recordRaw[] = [ - { - path: '/customer', - component: Layout, - redirect: '/customer/bench', - name: 'CustomerBench', - meta: { - title: '工作台', - icon: 'ep:key', - auth: '/customer/bench', - }, - children: [ - { - path: 'bench', - name: 'CustomerBenchPage', - component: () => import('@/views/customer/bench/bench.vue'), - meta: { - title: '工作台', - auth: '/customer/bench', - sidebar: false, - breadcrumb: true, - activeMenu: '/customer', - }, - }, - ], - }, - { - path: '/sample', - component: Layout, - redirect: '/sample/list', - name: 'Sample', - meta: { - title: '样品库', - icon: 'ep:key', - auth: '/sample', - }, - children: [ - { - path: 'list', - name: 'SampleList', - component: () => import('@/views/customer/sample/list/list.vue'), - meta: { - title: '样品列表', - icon: 'ep:key', - auth: '/sample/list', - }, - }, - { - path: ':type/:id?', - name: 'SampleDetail', - component: () => import('@/views/customer/sample/list/edit.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/list', - }, - }, - { - path: 'overtime', - name: 'OvertimeSample', - component: () => import('@/views/customer/sample/overTime/list.vue'), - meta: { - title: '到期样品', - icon: 'ep:key', - auth: '/sample/overtime', - }, - }, - { - path: 'overtime/:type/:id?', - name: 'OverTimeDetail', - component: () => import('@/views/customer/sample/overTime/detail.vue'), - meta: { - title: '样品详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/sample/overtime', - }, - }, - ], - }, - { - path: '/customerManage', - component: Layout, - redirect: '/customerManage/list', - name: 'Customer', - meta: { - title: '客户管理', - icon: 'ep:key', - auth: '/customer/manage', - }, - children: [ - { - path: 'list', - name: 'CustomerList', - component: () => import('@/views/customer/customerInfo/customerList.vue'), - meta: { - title: '客户列表', - icon: 'ep:key', - auth: '/customer/list', - }, - }, - { - path: ':type/:id?', - name: 'CustomerDetail', - component: () => import('@/views/customer/customerInfo/customerEdit.vue'), - meta: { - title: '客户详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/customerManage/list', - }, - }, - { - path: 'advice', - name: 'CustomerAdvice', - component: () => import('@/views/customer/advice/adviceList.vue'), - meta: { - title: '客户关系', - icon: 'ep:key', - auth: '/customer/advice', - }, - }, - { - path: 'advice/:type/:id?', - name: 'CustomerAdviceDetail', - component: () => import('@/views/customer/advice/adviceEdit.vue'), - meta: { - title: '客户关系详情', - icon: 'ep:key', - sidebar: false, - breadcrumb: true, - activeMenu: '/source/approve', - }, - }, - ], - }, -] - -export default routes diff --git a/src/router/modules/workbench.ts b/src/router/modules/workbench.ts index 94ee81a..a780d86 100644 --- a/src/router/modules/workbench.ts +++ b/src/router/modules/workbench.ts @@ -40,6 +40,15 @@ activeMenu: '/workbench', }, }, + { + path: 'noticeList', + name: 'NoticeList', + meta: { + title: '通知公告', + sidebar: true, + activeMenu: '/workbench', + }, + }, ], }, { diff --git a/src/router/routes.ts b/src/router/routes.ts index ed49855..6b79004 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -55,8 +55,9 @@ name: 'workbench', component: () => import('@/views/workbench.vue'), meta: { - title: '总工作台子组件', - breadcrumb: false, + title: '总工作台', + sidebar: true, + breadcrumb: true, }, }, { @@ -80,6 +81,17 @@ // activeMenu: '/comprehensive', }, }, + { + path: 'noticeList', + name: 'NoticeList', + component: () => import('@/views/workbench/notice/list.vue'), + meta: { + title: '通知公告', + sidebar: true, + breadcrumb: true, + // activeMenu: '/comprehensive', + }, + }, ], }, { diff --git a/src/views/system/notice/noteAdd.vue b/src/views/system/notice/noteAdd.vue index 9f56b80..e9cce80 100644 --- a/src/views/system/notice/noteAdd.vue +++ b/src/views/system/notice/noteAdd.vue @@ -29,6 +29,16 @@ noticeContent: [{ required: true, message: '发布内容必填', trigger: 'blur' }], }) // 表单验证规则 const dialogVisible = ref(false) // 弹窗显示 + +// 重置 +const resetDialog = () => { + ruleForm.noticeTime = '' + ruleForm.noticeSketch = '' + ruleForm.noticeContent = '' + ruleForm.minioFileName = '' + ruleForm.noticeTitle = '' +} + // 弹窗初始化 const initDialog = (row: any) => { dialogVisible.value = true @@ -37,6 +47,7 @@ ruleForm.noticePublisher = userInfo.$state.name ruleForm.noticeCompany = userInfo.$state.deptName ruleForm.noticeTime = dayjs().format('YYYY-MM-DD HH:mm:ss') + resetDialog() } else { // 获取详情信息 @@ -62,14 +73,7 @@ } } defineExpose({ initDialog }) -// 重置 -const resetDialog = () => { - ruleForm.noticeTime = '' - ruleForm.noticeSketch = '' - ruleForm.noticeContent = '' - ruleForm.minioFileName = '' - ruleForm.noticeTitle = '' -} + // 关闭弹窗 const close = () => { resetDialog() @@ -146,7 +150,83 @@ // 富文本实例对象 const editorRef = shallowRef() // 菜单配置 -const toolbarConfig = ref({}) +const toolbarConfig = { + /* 工具栏配置 */ + toolbarKeys: [ + 'bold', + 'underline', + 'italic', + 'clearStyle', + 'color', + 'bgColor', + '|', + // 菜单组,包含多个菜单 + // { + // key: 'group-link', + // title: '链接', + // menuKeys: ['insertLink', 'editLink', 'unLink', 'viewLink'], + // }, + 'fontSize', + 'fontFamily', + 'lineHeight', + { + key: 'group-justify', + title: '对齐', + iconSvg: '', + menuKeys: [ + 'justifyLeft', + 'justifyRight', + 'justifyCenter', + 'justifyJustify', + ], + }, + { + key: 'group-indent', + title: '缩进', + iconSvg: '', + menuKeys: [ + 'indent', + 'delIndent', + ], + }, + { + key: 'group-more-style', + title: '更多', + iconSvg: '', + menuKeys: [ + 'through', + 'code', + 'sup', + 'sub', + 'clearStyle', + ], + }, + '|', + 'bulletedList', + 'numberedList', + 'todo', + + { + key: 'group-table', + title: '表格', + menuKeys: ['insertTable', + 'deleteTable', + 'insertTableRow', + 'deleteTableRow', + 'insertTableCol', + 'deleteTableCol', + 'tableHeader', + 'tableFullWidth'], + }, + 'divider', + // 'emotion', 表情 + 'blockquote', + 'headerSelect', + 'redo', + 'undo', + 'fullScreen', + ], +} // 编辑器配置 const editorConfig = ref({ placeholder: '请输入内容...', diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue index e20a565..39e1eed 100644 --- a/src/views/system/notice/noteList.vue +++ b/src/views/system/notice/noteList.vue @@ -251,7 +251,7 @@