fix: 🧩 修复消息接受内容
This commit is contained in:
parent
cd3cd8bc5a
commit
f8dbd402e8
|
@ -21,7 +21,7 @@ export const fetchDeleteMenuIcon = (data: any) => {
|
||||||
return http.request<BaseResult<object>>('delete', 'menuIcon/deleteMenuIcon', { data });
|
return http.request<BaseResult<object>>('delete', 'menuIcon/deleteMenuIcon', { data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 系统菜单图标---根据iconName搜索menuIc */
|
/** 系统菜单图标---根据iconName搜索menuIcon */
|
||||||
export const fetchGetIconNameList = (data: any) => {
|
export const fetchGetIconNameList = (data: any) => {
|
||||||
return http.request<BaseResult<object>>('get', 'menuIcon/noManage/getIconNameList', { params: data });
|
return http.request<BaseResult<object>>('get', 'menuIcon/noManage/getIconNameList', { params: data });
|
||||||
};
|
};
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { http } from '@/api/service/request';
|
||||||
|
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||||
|
|
||||||
|
/** 管理员操作用户消息---获取系统管理消息列表 */
|
||||||
|
export const fetchGetMessageReceivedList = (data: any) => {
|
||||||
|
return http.request<BaseResult<ResultTable>>('get', `messageReceived/getMessageReceivedList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 管理员操作用户消息---将用户消息标为已读 */
|
||||||
|
export const fetchMarkMessageReceivedAsRead = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('put', 'messageReceived/markMessageReceivedAsRead', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 管理员操作用户消息---管理删除用户消息 */
|
||||||
|
export const fetchDeleteMessageReceivedByIds = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('delete', 'messageReceived/deleteMessageReceivedByIds', { data });
|
||||||
|
};
|
|
@ -30,18 +30,3 @@ export const fetchDeleteMessage = (data: any) => {
|
||||||
export const fetchGetMessageDetailById = (data: any) => {
|
export const fetchGetMessageDetailById = (data: any) => {
|
||||||
return http.request<BaseResult<any>>('get', `message/noManage/getMessageDetailById`, { params: data });
|
return http.request<BaseResult<any>>('get', `message/noManage/getMessageDetailById`, { params: data });
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 用户系统消息---用户获取系统消息列表 */
|
|
||||||
export const fetchGetUserMessageList = (data: any) => {
|
|
||||||
return http.request<BaseResult<ResultTable>>('get', `message/noManage/getUserMessageList/${data.currentPage}/${data.pageSize}`, { params: data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 系统消息---用户将消息标为已读 */
|
|
||||||
export const fetchUpdateUserMarkAsRead = (data: any) => {
|
|
||||||
return http.request<BaseResult<object>>('put', 'messageReceived/noManage/updateUserMarkAsRead', { data });
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 系统消息---用户删除系统消息 */
|
|
||||||
export const fetchDeleteUserMessageByIds = (data: any) => {
|
|
||||||
return http.request<BaseResult<object>>('delete', 'message/noManage/deleteUserMessageByIds', { data });
|
|
||||||
};
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { http } from '@/api/service/request';
|
||||||
|
import type { BaseResult, ResultTable } from '@/api/service/types';
|
||||||
|
|
||||||
|
/** 用户系统消息---用户获取系统消息列表 */
|
||||||
|
export const fetchGetUserMessageList = (data: any) => {
|
||||||
|
return http.request<BaseResult<ResultTable>>('get', `message/noManage/getUserMessageList/${data.currentPage}/${data.pageSize}`, { params: data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 系统消息---用户将消息标为已读 */
|
||||||
|
export const fetchUpdateUserMarkAsRead = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('put', 'messageReceived/noManage/updateUserMarkAsRead', { data });
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 系统消息---用户删除系统消息 */
|
||||||
|
export const fetchDeleteUserMessageByIds = (data: any) => {
|
||||||
|
return http.request<BaseResult<object>>('delete', 'message/noManage/deleteUserMessageByIds', { data });
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
import { fetchGetMenuIconList } from '@/api/v1/menuIcon';
|
import { fetchGetMenuIconList } from '@/api/v1/menu/menuIcon';
|
||||||
import { FormProps } from '@/components/SelectIcon/types';
|
import { FormProps } from '@/components/SelectIcon/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { fetchGetUserinfoById } from '@/api/v1/adminUser';
|
import { fetchGetUserinfoById } from '@/api/v1/system/adminUser';
|
||||||
import userAvatarIcon from '@/assets/svg/user_avatar.svg?component';
|
import userAvatarIcon from '@/assets/svg/user_avatar.svg?component';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { Plus } from '@element-plus/icons-vue';
|
||||||
import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus';
|
import { ElMessage, UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { SystemEnum } from '@/enums/upload';
|
import { SystemEnum } from '@/enums/upload';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
imageUrl: String,
|
imageUrl: String,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { fetchGetUserMessageList } from '@/api/v1/message';
|
import { fetchGetUserMessageList } from '@/api/v1/message/messageUser';
|
||||||
import { throttle } from '@pureadmin/utils';
|
import { throttle } from '@pureadmin/utils';
|
||||||
import { useWebNotification } from '@vueuse/core';
|
import { useWebNotification } from '@vueuse/core';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { type menuType, routerArrays } from '@/layout/types';
|
||||||
import { useMultiTagsStoreHook } from '@/store/multiTags';
|
import { useMultiTagsStoreHook } from '@/store/multiTags';
|
||||||
import { usePermissionStoreHook } from '@/store/permission';
|
import { usePermissionStoreHook } from '@/store/permission';
|
||||||
// 动态路由
|
// 动态路由
|
||||||
import { getRouterAsync } from '@/api/v1/system';
|
import { getRouterAsync } from '@/api/v1/system/system';
|
||||||
// import { getAsyncRoutes } from '@/api/routes';
|
// import { getAsyncRoutes } from '@/api/routes';
|
||||||
|
|
||||||
const IFrame = () => import('@/layout/frame.vue');
|
const IFrame = () => import('@/layout/frame.vue');
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddEmailTemplate, fetchDeleteEmailTemplate, fetchGetEmailTemplateList, fetchGetEmailTypes, fetchUpdateEmailTemplate } from '@/api/v1/emailTemplate';
|
import { fetchAddEmailTemplate, fetchDeleteEmailTemplate, fetchGetEmailTemplateList, fetchGetEmailTypes, fetchUpdateEmailTemplate } from '@/api/v1/email/emailTemplate';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
import { fetchGetAllMailboxConfigurationUsers } from '@/api/v1/emailUsers';
|
import { fetchGetAllMailboxConfigurationUsers } from '@/api/v1/email/emailUsers';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮件模板表 Store
|
* 邮件模板表 Store
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddEmailUsers, fetchDeleteEmailUsers, fetchGetEmailUsersList, fetchUpdateEmailUsers, fetchUpdateEmailUserStatus } from '@/api/v1/emailUsers';
|
import { fetchAddEmailUsers, fetchDeleteEmailUsers, fetchGetEmailUsersList, fetchUpdateEmailUsers, fetchUpdateEmailUserStatus } from '@/api/v1/email/emailUsers';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddMenuIcon, fetchDeleteMenuIcon, fetchGetMenuIconList, fetchUpdateMenuIcon } from '@/api/v1/menuIcon';
|
import { fetchAddMenuIcon, fetchDeleteMenuIcon, fetchGetIconNameList, fetchGetMenuIconList, fetchUpdateMenuIcon } from '@/api/v1/menu/menuIcon';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
@ -12,6 +12,8 @@ export const useMenuIconStore = defineStore('menuIconStore', {
|
||||||
return {
|
return {
|
||||||
// 系统菜单图标列表
|
// 系统菜单图标列表
|
||||||
datalist: [],
|
datalist: [],
|
||||||
|
// 图标名称列表
|
||||||
|
iconNameList: [],
|
||||||
// 查询表单
|
// 查询表单
|
||||||
form: {
|
form: {
|
||||||
// icon 名称
|
// icon 名称
|
||||||
|
@ -32,9 +34,7 @@ export const useMenuIconStore = defineStore('menuIconStore', {
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
actions: {
|
actions: {
|
||||||
/**
|
/** 获取系统菜单图标 */
|
||||||
* * 获取系统菜单图标
|
|
||||||
*/
|
|
||||||
async getMenuIconList() {
|
async getMenuIconList() {
|
||||||
const data = { ...this.pagination, ...this.form };
|
const data = { ...this.pagination, ...this.form };
|
||||||
delete data.pageSizes;
|
delete data.pageSizes;
|
||||||
|
@ -47,25 +47,25 @@ export const useMenuIconStore = defineStore('menuIconStore', {
|
||||||
return pagination(response);
|
return pagination(response);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/** 根据iconName搜索menuIcon */
|
||||||
* * 添加系统菜单图标
|
async getIconNameList(data: any) {
|
||||||
*/
|
const result = await fetchGetIconNameList(data);
|
||||||
|
this.iconNameList = result.data;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 添加系统菜单图标 */
|
||||||
async addMenuIcon(data: any) {
|
async addMenuIcon(data: any) {
|
||||||
const result = await fetchAddMenuIcon(data);
|
const result = await fetchAddMenuIcon(data);
|
||||||
return storeMessage(result);
|
return storeMessage(result);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/** 修改系统菜单图标 */
|
||||||
* * 修改系统菜单图标
|
|
||||||
*/
|
|
||||||
async updateMenuIcon(data: any) {
|
async updateMenuIcon(data: any) {
|
||||||
const result = await fetchUpdateMenuIcon(data);
|
const result = await fetchUpdateMenuIcon(data);
|
||||||
return storeMessage(result);
|
return storeMessage(result);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/** 删除系统菜单图标 */
|
||||||
* * 删除系统菜单图标
|
|
||||||
*/
|
|
||||||
async deleteMenuIcon(data: any) {
|
async deleteMenuIcon(data: any) {
|
||||||
const result = await fetchDeleteMenuIcon(data);
|
const result = await fetchDeleteMenuIcon(data);
|
||||||
return storeMessage(result);
|
return storeMessage(result);
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
import { fetchDeleteMessageReceivedByIds, fetchGetMessageReceivedList, fetchMarkMessageReceivedAsRead } from '@/api/v1/message/messageReceived';
|
||||||
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
|
import { storeMessage } from '@/utils/message';
|
||||||
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统消息 Store
|
||||||
|
*/
|
||||||
|
export const useMessageReceivedStore = defineStore('messageReceivedStore', {
|
||||||
|
state() {
|
||||||
|
return {
|
||||||
|
// 系统消息列表
|
||||||
|
datalist: [],
|
||||||
|
// 查询表单
|
||||||
|
form: {
|
||||||
|
// 消息标题
|
||||||
|
title: undefined,
|
||||||
|
// 接收人用户ID
|
||||||
|
receivedUserIds: undefined,
|
||||||
|
// 发送人用户ID
|
||||||
|
sendUserId: undefined,
|
||||||
|
// 发送人昵称
|
||||||
|
sendNickname: undefined,
|
||||||
|
// 消息类型
|
||||||
|
messageType: undefined,
|
||||||
|
// 消息内容
|
||||||
|
content: undefined,
|
||||||
|
// 编辑器类型
|
||||||
|
editorType: undefined,
|
||||||
|
// 消息等级
|
||||||
|
level: undefined,
|
||||||
|
// 消息等级详情
|
||||||
|
extra: undefined,
|
||||||
|
// 0:未读 1:已读
|
||||||
|
status: undefined,
|
||||||
|
},
|
||||||
|
// 分页查询结果
|
||||||
|
pagination: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 150,
|
||||||
|
total: 100,
|
||||||
|
pageSizes,
|
||||||
|
},
|
||||||
|
// 加载
|
||||||
|
loading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
getters: {},
|
||||||
|
actions: {
|
||||||
|
/** 管理员操作用户消息---获取系统管理消息列表 */
|
||||||
|
async getMessageReceivedList() {
|
||||||
|
// 整理请求参数
|
||||||
|
const data = { ...this.pagination, ...this.form };
|
||||||
|
delete data.pageSizes;
|
||||||
|
delete data.total;
|
||||||
|
delete data.background;
|
||||||
|
|
||||||
|
// 获取系统消息列表
|
||||||
|
const result = await fetchGetMessageReceivedList(data);
|
||||||
|
|
||||||
|
// 公共页面函数hook
|
||||||
|
const pagination = storePagination.bind(this);
|
||||||
|
return pagination(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 管理员操作用户消息---将用户消息标为已读 */
|
||||||
|
async markMessageReceivedAsRead(data: any) {
|
||||||
|
const result = await fetchMarkMessageReceivedAsRead(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 删除系统消息 */
|
||||||
|
async deleteMessageReceivedByIds(data: any) {
|
||||||
|
const result = await fetchDeleteMessageReceivedByIds(data);
|
||||||
|
return storeMessage(result);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,13 +1,10 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddMessage, fetchDeleteMessage, fetchGetMessageList, fetchUpdateMessage } from '@/api/v1/message';
|
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { fetchAddMessage, fetchDeleteMessage, fetchGetMessageList, fetchUpdateMessage } from '@/api/v1/message/messageSend';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
import { storeMessage } from '@/utils/message';
|
||||||
|
|
||||||
/**
|
export const useMessageSendStore = defineStore('messageSendStore', {
|
||||||
* 系统消息 Store
|
|
||||||
*/
|
|
||||||
export const useMessageStore = defineStore('messageStore', {
|
|
||||||
state() {
|
state() {
|
||||||
return {
|
return {
|
||||||
// 系统消息列表
|
// 系统消息列表
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddMessageType, fetchDeleteMessageType, fetchGetAllMessageTypes, fetchGetMessageTypeList, fetchUpdateMessageType } from '@/api/v1/messageType';
|
import { fetchAddMessageType, fetchDeleteMessageType, fetchGetAllMessageTypes, fetchGetMessageTypeList, fetchUpdateMessageType } from '@/api/v1/message/messageType';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchDeleteUserMessageByIds, fetchGetUserMessageList, fetchUpdateUserMarkAsRead } from '@/api/v1/message';
|
import { fetchDeleteUserMessageByIds, fetchGetUserMessageList, fetchUpdateUserMarkAsRead } from '@/api/v1/message/messageUser';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchDeleteQuartzExecuteLog, fetchGetQuartzExecuteLogList } from '@/api/v1/quartzExecuteLog';
|
import { fetchDeleteQuartzExecuteLog, fetchGetQuartzExecuteLogList } from '@/api/v1/log/quartzExecuteLog';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchDeleteUserLoginLog, fetchGetUserLoginLogList, fetchGetUserLoginLogListByLocalUser } from '@/api/v1/userLoginLog';
|
import { fetchDeleteUserLoginLog, fetchGetUserLoginLogList, fetchGetUserLoginLogListByLocalUser } from '@/api/v1/log/userLoginLog';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddSchedulers, fetchDeleteSchedulers, fetchGetAllScheduleJobList, fetchGetSchedulersList, fetchPauseSchedulers, fetchResumeSchedulers, fetchUpdateSchedulers } from '@/api/v1/schedulers';
|
import {
|
||||||
|
fetchAddSchedulers,
|
||||||
|
fetchDeleteSchedulers,
|
||||||
|
fetchGetAllScheduleJobList,
|
||||||
|
fetchGetSchedulersList,
|
||||||
|
fetchPauseSchedulers,
|
||||||
|
fetchResumeSchedulers,
|
||||||
|
fetchUpdateSchedulers,
|
||||||
|
} from '@/api/v1/schedulers/schedulers';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddSchedulersGroup, fetchDeleteSchedulersGroup, fetchGetAllSchedulersGroup, fetchGetSchedulersGroupList, fetchUpdateSchedulersGroup } from '@/api/v1/schedulersGroup';
|
import { fetchAddSchedulersGroup, fetchDeleteSchedulersGroup, fetchGetAllSchedulersGroup, fetchGetSchedulersGroupList, fetchUpdateSchedulersGroup } from '@/api/v1/schedulers/schedulersGroup';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
fetchUpdateUserPasswordByAdmin,
|
fetchUpdateUserPasswordByAdmin,
|
||||||
fetchUpdateUserPasswordByLocalUser,
|
fetchUpdateUserPasswordByLocalUser,
|
||||||
fetchUpdateUserStatusByAdmin,
|
fetchUpdateUserStatusByAdmin,
|
||||||
} from '@/api/v1/adminUser';
|
} from '@/api/v1/system/adminUser';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息 Store
|
* 用户信息 Store
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddDept, fetchDeleteDept, fetchGetAllDeptList, fetchGetDeptList, fetchUpdateDept } from '@/api/v1/dept';
|
import { fetchAddDept, fetchDeleteDept, fetchGetAllDeptList, fetchGetDeptList, fetchUpdateDept } from '@/api/v1/system/dept';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
fetchGetRoleListByRouterId,
|
fetchGetRoleListByRouterId,
|
||||||
fetchUpdateMenu,
|
fetchUpdateMenu,
|
||||||
fetchUpdateMenuByIdWithRank,
|
fetchUpdateMenuByIdWithRank,
|
||||||
} from '@/api/v1/menu';
|
} from '@/api/v1/menu/menu';
|
||||||
import { isAllEmpty } from '@pureadmin/utils';
|
import { isAllEmpty } from '@pureadmin/utils';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddPower, fetchDeletePower, fetchGetAllPowers, fetchGetPowerList, fetchUpdateBatchByPowerWithParentId, fetchUpdatePower } from '@/api/v1/power';
|
import { fetchAddPower, fetchDeletePower, fetchGetAllPowers, fetchGetPowerList, fetchUpdateBatchByPowerWithParentId, fetchUpdatePower } from '@/api/v1/system/power';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { fetchAddRole, fetchAssignPowersToRole, fetchDeleteRole, fetchGetAllRoles, fetchGetRoleList, fetchUpdateRole } from '@/api/v1/role';
|
import { fetchAddRole, fetchAssignPowersToRole, fetchDeleteRole, fetchGetAllRoles, fetchGetRoleList, fetchUpdateRole } from '@/api/v1/system/role';
|
||||||
import { pageSizes } from '@/enums/baseConstant';
|
import { pageSizes } from '@/enums/baseConstant';
|
||||||
import { storeMessage } from '@/utils/message';
|
import { storeMessage } from '@/utils/message';
|
||||||
import { storePagination } from '@/store/useStorePagination';
|
import { storePagination } from '@/store/useStorePagination';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { resetRouter, router, routerArrays, storageLocal, store, type userType } from '../utils';
|
import { resetRouter, router, routerArrays, storageLocal, store, type userType } from '../utils';
|
||||||
import { fetchAssignRolesToUsers, fetchGetUserinfo, fetchLogin, fetchLogout, fetchPostEmailCode, refreshTokenApi } from '@/api/v1/adminUser';
|
import { fetchAssignRolesToUsers, fetchGetUserinfo, fetchLogin, fetchLogout, fetchPostEmailCode, refreshTokenApi } from '@/api/v1/system/adminUser';
|
||||||
import { useMultiTagsStoreHook } from '../multiTags';
|
import { useMultiTagsStoreHook } from '../multiTags';
|
||||||
import { type DataInfo, removeToken, setToken, userKey } from '@/utils/auth';
|
import { type DataInfo, removeToken, setToken, userKey } from '@/utils/auth';
|
||||||
import { message, storeMessage } from '@/utils/message';
|
import { message, storeMessage } from '@/utils/message';
|
||||||
import { fetchGetRoleListByUserId } from '@/api/v1/role';
|
import { fetchGetRoleListByUserId } from '@/api/v1/system/role';
|
||||||
|
|
||||||
export const useUserStore = defineStore({
|
export const useUserStore = defineStore({
|
||||||
id: 'system-user',
|
id: 'system-user',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useUserStore } from '@/store/system/user';
|
import { useUserStore } from '@/store/system/user';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { createFormData } from '@pureadmin/utils';
|
import { createFormData } from '@pureadmin/utils';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
import { message } from '@/utils/message';
|
import { message } from '@/utils/message';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { fetchGetIconNameList } from '@/api/v1/menuIcon';
|
|
||||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
import LoadingSvg from '@/assets/svg/loading.svg';
|
||||||
import { FormProps } from '@/views/configuration/menuIcon/utils/types';
|
import { FormProps } from '@/views/configuration/menuIcon/utils/types';
|
||||||
|
import { useMenuIconStore } from '@/store/configuration/menuIcon';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<FormProps>(), {
|
const props = withDefaults(defineProps<FormProps>(), {
|
||||||
formInline: () => ({
|
formInline: () => ({
|
||||||
|
@ -13,20 +13,17 @@ const props = withDefaults(defineProps<FormProps>(), {
|
||||||
});
|
});
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const iconNameList = ref();
|
|
||||||
const form = ref(props.formInline);
|
const form = ref(props.formInline);
|
||||||
|
const menuIconStore = useMenuIconStore();
|
||||||
|
|
||||||
/**
|
/** 搜索 */
|
||||||
* * 搜索
|
|
||||||
*/
|
|
||||||
const onRequestIconName = async (iconName: string) => {
|
const onRequestIconName = async (iconName: string) => {
|
||||||
const data = { currentPage: 1, pageSize: 20, iconName };
|
const data = { currentPage: 1, pageSize: 20, iconName };
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
if (iconName) {
|
if (iconName) {
|
||||||
const result = await fetchGetIconNameList(data);
|
await menuIconStore.getIconNameList(data);
|
||||||
if (result.code === 200) iconNameList.value = result.data;
|
} else menuIconStore.iconNameList = [];
|
||||||
} else iconNameList.value = [];
|
|
||||||
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
@ -44,7 +41,7 @@ const onRequestIconName = async (iconName: string) => {
|
||||||
remote
|
remote
|
||||||
remote-show-suffix
|
remote-show-suffix
|
||||||
>
|
>
|
||||||
<el-option v-for="menuIcon in iconNameList" :key="menuIcon.id" :label="menuIcon.iconName" :value="menuIcon.iconName" />
|
<el-option v-for="menuIcon in menuIconStore.iconNameList" :key="menuIcon.id" :label="menuIcon.iconName" :value="menuIcon.iconName" />
|
||||||
<template #loading>
|
<template #loading>
|
||||||
<el-icon class="is-loading">
|
<el-icon class="is-loading">
|
||||||
<LoadingSvg />
|
<LoadingSvg />
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { useRoute } from 'vue-router';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import 'plus-pro-components/es/components/check-card-group/style/css';
|
import 'plus-pro-components/es/components/check-card-group/style/css';
|
||||||
import MarkdownPreview from '@/components/Editor/MarkdownPreview.vue';
|
import MarkdownPreview from '@/components/Editor/MarkdownPreview.vue';
|
||||||
import { fetchGetMessageDetailById } from '@/api/v1/message';
|
import { fetchGetMessageDetailById } from '@/api/v1/message/messageReceived';
|
||||||
import { decode } from 'js-base64';
|
import { decode } from 'js-base64';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { MdEditor } from 'md-editor-v3';
|
import { MdEditor } from 'md-editor-v3';
|
||||||
import 'md-editor-v3/lib/style.css';
|
import 'md-editor-v3/lib/style.css';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
import { formState } from '@/views/message-management/message-editing/utils/hooks';
|
import { formState } from '@/views/message-management/message-editing/utils/hooks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,21 +4,20 @@ import { onMounted, ref, toRaw } from 'vue';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { messageLevel, rules } from '@/views/message-management/message-editing/utils/columns';
|
import { messageLevel, rules } from '@/views/message-management/message-editing/utils/columns';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { editorTypeList } from '@/views/message-management/message/utils/columns';
|
import { editorTypeList } from '@/views/message-management/message-send/utils/columns';
|
||||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
import LoadingSvg from '@/assets/svg/loading.svg';
|
||||||
import { useMessageTypeStore } from '@/store/message/messageType';
|
import { useMessageTypeStore } from '@/store/message/messageType';
|
||||||
import { encode } from 'js-base64';
|
import { encode } from 'js-base64';
|
||||||
import { message } from '@/utils/message';
|
import { message } from '@/utils/message';
|
||||||
import { useMessageStore } from '@/store/message/message';
|
import { useMessageSendStore } from '@/store/message/messageSend';
|
||||||
import { usePublicHooks } from '@/views/hooks';
|
import { usePublicHooks } from '@/views/hooks';
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
import { Plus } from '@element-plus/icons-vue';
|
||||||
import { graphlib } from 'dagre';
|
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
// 用户是否停用样式
|
// 用户是否停用样式
|
||||||
const { switchStyle } = usePublicHooks();
|
const { switchStyle } = usePublicHooks();
|
||||||
const messageTypeStore = useMessageTypeStore();
|
const messageTypeStore = useMessageTypeStore();
|
||||||
const messageStore = useMessageStore();
|
const messageSendStore = useMessageSendStore();
|
||||||
|
|
||||||
/** 提交消息 */
|
/** 提交消息 */
|
||||||
const submitForm = (formEl: FormInstance | undefined) => {
|
const submitForm = (formEl: FormInstance | undefined) => {
|
||||||
|
@ -36,13 +35,12 @@ const submitForm = (formEl: FormInstance | undefined) => {
|
||||||
const data = toRaw(formState);
|
const data = toRaw(formState);
|
||||||
data.content = encode(formState.content);
|
data.content = encode(formState.content);
|
||||||
|
|
||||||
console.log(data);
|
// 添加消息
|
||||||
// // 添加消息
|
const result = await messageSendStore.addMessage(data);
|
||||||
// const result = await messageStore.addMessage(data);
|
if (!result) return;
|
||||||
// if (!result) return;
|
|
||||||
//
|
// 清除数据
|
||||||
// // 清除数据
|
resetForm(formEl);
|
||||||
// resetForm(formEl);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { reactive, ref } from 'vue';
|
||||||
import type { UploadRawFile, UploadRequestOptions } from 'element-plus';
|
import type { UploadRawFile, UploadRequestOptions } from 'element-plus';
|
||||||
import { SystemEnum } from '@/enums/upload';
|
import { SystemEnum } from '@/enums/upload';
|
||||||
import { message } from '@/utils/message';
|
import { message } from '@/utils/message';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||||
|
|
||||||
// 用户信息列表
|
// 用户信息列表
|
||||||
|
|
|
@ -0,0 +1,158 @@
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { columns } from '@/views/message-management/message-received/utils/columns';
|
||||||
|
import PureTableBar from '@/components/TableBar/src/bar';
|
||||||
|
import PureTable from '@pureadmin/table';
|
||||||
|
import { markMessageReceivedAsRead, onDeleteBatch, onSearch, selectIds } from '@/views/message-management/message-received/utils/hooks';
|
||||||
|
import Delete from '@iconify-icons/ep/delete';
|
||||||
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
|
import { FormInstance } from 'element-plus';
|
||||||
|
import { messageLevel } from '@/views/message-management/message-editing/utils/columns';
|
||||||
|
import { isReadStatus } from '@/enums/baseConstant';
|
||||||
|
import { useMessageReceivedStore } from '@/store/message/messageReceived';
|
||||||
|
|
||||||
|
const tableRef = ref();
|
||||||
|
const formRef = ref();
|
||||||
|
const messageReceivedStore = useMessageReceivedStore();
|
||||||
|
|
||||||
|
/** 当前页改变时 */
|
||||||
|
const onCurrentPageChange = async (value: number) => {
|
||||||
|
messageReceivedStore.pagination.currentPage = value;
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 当分页发生变化
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
const onPageSizeChange = async (value: number) => {
|
||||||
|
messageReceivedStore.pagination.pageSize = value;
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* * 选择多行
|
||||||
|
* @param rows
|
||||||
|
*/
|
||||||
|
const onSelectionChange = (rows: Array<any>) => {
|
||||||
|
selectIds.value = rows.map((row: any) => row.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置表单
|
||||||
|
* @param formEl
|
||||||
|
*/
|
||||||
|
const resetForm = async (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
onSearch();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="main">
|
||||||
|
<el-form ref="formRef" :inline="true" :model="messageReceivedStore.form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto">
|
||||||
|
<!-- 消息标题 -->
|
||||||
|
<el-form-item :label="$t('title')" prop="title">
|
||||||
|
<el-input v-model="messageReceivedStore.form.title" :placeholder="`${$t('input')}${$t('title')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 消息类型 -->
|
||||||
|
<el-form-item :label="$t('messageType')" prop="messageType">
|
||||||
|
<el-input v-model="messageReceivedStore.form.messageType" :placeholder="`${$t('input')}${$t('messageType')}`" class="!w-[180px]" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 消息等级 -->
|
||||||
|
<el-form-item :label="$t('level')" prop="level">
|
||||||
|
<el-select v-model="messageReceivedStore.form.level" :placeholder="$t('level')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||||
|
<el-option v-for="item in messageLevel" :key="item" :label="$t(item)" :value="item" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 消息等级简介 -->
|
||||||
|
<el-form-item :label="$t('extra')" prop="extra">
|
||||||
|
<el-input v-model="messageReceivedStore.form.extra" class="!w-[180px]" maxlength="20" minlength="10" show-word-limit type="text" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 0:未读 1:已读 -->
|
||||||
|
<el-form-item :label="$t('status')" prop="status">
|
||||||
|
<el-select v-model="messageReceivedStore.form.status" :placeholder="$t('status')" class="!w-[180px]" clearable filterable remote remote-show-suffix>
|
||||||
|
<el-option v-for="(item, index) in isReadStatus" :key="index" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button :icon="useRenderIcon('ri:search-line')" :loading="messageReceivedStore.loading" type="primary" @click="onSearch"> {{ $t('search') }} </el-button>
|
||||||
|
<el-button :icon="useRenderIcon(Refresh)" @click="resetForm(formRef)"> {{ $t('buttons.reset') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<PureTableBar :columns="columns" title="系统消息" @fullscreen="tableRef.setAdaptive()" @refresh="onSearch">
|
||||||
|
<template #buttons>
|
||||||
|
<!-- 标为已读 -->
|
||||||
|
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon('octicon:read-24')" type="primary" @click="markMessageReceivedAsRead">
|
||||||
|
{{ $t('markAsRead') }}
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<!-- 批量删除按钮 -->
|
||||||
|
<el-button :disabled="!(selectIds.length > 0)" :icon="useRenderIcon(Delete)" type="danger" @click="onDeleteBatch">
|
||||||
|
{{ $t('delete_batches') }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot="{ size, dynamicColumns }">
|
||||||
|
<pure-table
|
||||||
|
ref="tableRef"
|
||||||
|
:adaptiveConfig="{ offsetBottom: 96 }"
|
||||||
|
:columns="dynamicColumns"
|
||||||
|
:data="messageReceivedStore.datalist"
|
||||||
|
:header-cell-style="{ background: 'var(--el-fill-color-light)', color: 'var(--el-text-color-primary)' }"
|
||||||
|
:loading="messageReceivedStore.loading"
|
||||||
|
:pagination="messageReceivedStore.pagination"
|
||||||
|
:size="size"
|
||||||
|
adaptive
|
||||||
|
align-whole="center"
|
||||||
|
border
|
||||||
|
highlight-current-row
|
||||||
|
row-key="id"
|
||||||
|
showOverflowTooltip
|
||||||
|
table-layout="auto"
|
||||||
|
@page-size-change="onPageSizeChange"
|
||||||
|
@selection-change="onSelectionChange"
|
||||||
|
@page-current-change="onCurrentPageChange"
|
||||||
|
>
|
||||||
|
<template #cover="{ row }">
|
||||||
|
<el-image :initial-index="0" :preview-src-list="[row.cover]" :src="row.cover" class="w-[50px] h-[50px]" fit="cover" loading="lazy" preview-teleported />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #extra="{ row }">
|
||||||
|
<el-text type="danger">{{ row.extra }}</el-text>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #messageType="{ row }">
|
||||||
|
<el-tag effect="plain" round>{{ row.messageType }}</el-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #createUser="{ row }">
|
||||||
|
<el-button v-show="row.createUser" link type="primary" @click="selectUserinfo(row.createUser)">
|
||||||
|
{{ row.createUsername }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #updateUser="{ row }">
|
||||||
|
<el-button v-show="row.updateUser" link type="primary" @click="selectUserinfo(row.updateUser)">
|
||||||
|
{{ row.updateUsername }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</pure-table>
|
||||||
|
</template>
|
||||||
|
</PureTableBar>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -0,0 +1,58 @@
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
import { ElTag } from 'element-plus';
|
||||||
|
|
||||||
|
// 表格列
|
||||||
|
export const columns: TableColumnList = [
|
||||||
|
{ type: 'selection', align: 'left' },
|
||||||
|
{ type: 'index', index: (index: number) => index + 1, label: '序号', width: 60 },
|
||||||
|
// 消息标题
|
||||||
|
{ label: $t('title'), prop: 'title' },
|
||||||
|
// 消息简介
|
||||||
|
{ label: $t('summary'), prop: 'summary' },
|
||||||
|
// 发送人昵称
|
||||||
|
{ label: $t('sendNickname'), prop: 'sendNickname' },
|
||||||
|
// 接受人昵称
|
||||||
|
{ label: $t('receivedUserNickname'), prop: 'receivedUserNickname' },
|
||||||
|
// 消息类型
|
||||||
|
{ label: $t('messageType'), prop: 'messageType', slot: 'messageType' },
|
||||||
|
// 编辑器类型
|
||||||
|
{ label: $t('editorType'), prop: 'editorType' },
|
||||||
|
// 封面
|
||||||
|
{ label: $t('cover'), prop: 'cover', slot: 'cover', width: 80 },
|
||||||
|
// 消息等级
|
||||||
|
{
|
||||||
|
label: $t('level'),
|
||||||
|
prop: 'level',
|
||||||
|
formatter({ level }) {
|
||||||
|
return (
|
||||||
|
<ElTag type={level} effect={'plain'} round>
|
||||||
|
{$t(level)}
|
||||||
|
</ElTag>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
// 消息等级详情
|
||||||
|
{ label: $t('extra'), prop: 'extra', slot: 'extra' },
|
||||||
|
// 0:未读 1:已读
|
||||||
|
{
|
||||||
|
label: $t('status'),
|
||||||
|
prop: 'status',
|
||||||
|
formatter({ status }) {
|
||||||
|
return status ? (
|
||||||
|
<ElTag type={'info'} effect={'plain'}>
|
||||||
|
{$t('readAlready')}
|
||||||
|
</ElTag>
|
||||||
|
) : (
|
||||||
|
<ElTag type={'danger'} effect={'plain'}>
|
||||||
|
{$t('unread')}
|
||||||
|
</ElTag>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
width: 80,
|
||||||
|
},
|
||||||
|
{ label: $t('table.updateTime'), prop: 'updateTime', sortable: true, width: 160 },
|
||||||
|
{ label: $t('table.createTime'), prop: 'createTime', sortable: true, width: 160 },
|
||||||
|
{ label: $t('table.createUser'), prop: 'createUser', slot: 'createUser', width: 130 },
|
||||||
|
{ label: $t('table.updateUser'), prop: 'updateUser', slot: 'updateUser', width: 130 },
|
||||||
|
];
|
|
@ -0,0 +1,64 @@
|
||||||
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
|
import { h, ref } from 'vue';
|
||||||
|
import { message, messageBox } from '@/utils/message';
|
||||||
|
import { $t } from '@/plugins/i18n';
|
||||||
|
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||||
|
import { useMessageReceivedStore } from '@/store/message/messageReceived';
|
||||||
|
|
||||||
|
// 删除ids
|
||||||
|
export const selectIds = ref([]);
|
||||||
|
const messageReceivedStore = useMessageReceivedStore();
|
||||||
|
|
||||||
|
/** 搜索初始化系统消息 */
|
||||||
|
export async function onSearch() {
|
||||||
|
messageReceivedStore.loading = true;
|
||||||
|
await messageReceivedStore.getMessageReceivedList();
|
||||||
|
messageReceivedStore.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 管理员操作用户消息---将用户消息标为已读 */
|
||||||
|
export const markMessageReceivedAsRead = async () => {
|
||||||
|
// 是否确认标为已读
|
||||||
|
let result = await messageBox({
|
||||||
|
title: $t('markAsRead'),
|
||||||
|
showMessage: false,
|
||||||
|
confirmMessage: undefined,
|
||||||
|
cancelMessage: $t('cancel'),
|
||||||
|
});
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
result = await messageReceivedStore.markMessageReceivedAsRead(selectIds.value);
|
||||||
|
if (!result) return;
|
||||||
|
await onSearch();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 批量删除 */
|
||||||
|
export const onDeleteBatch = async () => {
|
||||||
|
const ids = selectIds.value;
|
||||||
|
const formDeletedBatchRef = ref();
|
||||||
|
|
||||||
|
addDialog({
|
||||||
|
title: $t('deleteBatchTip'),
|
||||||
|
width: '30%',
|
||||||
|
props: { formInline: { confirmText: '' } },
|
||||||
|
draggable: true,
|
||||||
|
fullscreenIcon: true,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
contentRenderer: () => h(DeleteBatchDialog, { ref: formDeletedBatchRef }),
|
||||||
|
beforeSure: (done, { options }) => {
|
||||||
|
formDeletedBatchRef.value.formDeletedBatchRef.validate(async (valid: any) => {
|
||||||
|
if (!valid) return;
|
||||||
|
|
||||||
|
const text = options.props.formInline.confirmText.toLowerCase();
|
||||||
|
if (text === 'yes' || text === 'y') {
|
||||||
|
// 删除数据
|
||||||
|
const result = await messageReceivedStore.deleteMessageReceivedByIds(ids);
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
await onSearch();
|
||||||
|
done();
|
||||||
|
} else message($t('deleteBatchTip'), { type: 'warning' });
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,27 +1,27 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { columns } from '@/views/message-management/message/utils/columns';
|
import { columns } from '@/views/message-management/message-send/utils/columns';
|
||||||
import PureTableBar from '@/components/TableBar/src/bar';
|
import PureTableBar from '@/components/TableBar/src/bar';
|
||||||
import PureTable from '@pureadmin/table';
|
import PureTable from '@pureadmin/table';
|
||||||
import { deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-management/message/utils/hooks';
|
import { deleteIds, onDelete, onDeleteBatch, onSearch, onUpdate } from '@/views/message-management/message-send/utils/hooks';
|
||||||
import Delete from '@iconify-icons/ep/delete';
|
import Delete from '@iconify-icons/ep/delete';
|
||||||
import EditPen from '@iconify-icons/ep/edit-pen';
|
import EditPen from '@iconify-icons/ep/edit-pen';
|
||||||
import Refresh from '@iconify-icons/ep/refresh';
|
import Refresh from '@iconify-icons/ep/refresh';
|
||||||
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { useMessageStore } from '@/store/message/message';
|
|
||||||
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
import { useRenderIcon } from '@/components/CommonIcon/src/hooks';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { messageLevel } from '@/views/message-management/message-editing/utils/columns';
|
import { messageLevel } from '@/views/message-management/message-editing/utils/columns';
|
||||||
import { isReadStatus } from '@/enums/baseConstant';
|
import { isReadStatus } from '@/enums/baseConstant';
|
||||||
|
import { useMessageSendStore } from '@/store/message/messageSend';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const messageStore = useMessageStore();
|
const messageSendStore = useMessageSendStore();
|
||||||
|
|
||||||
/** 当前页改变时 */
|
/** 当前页改变时 */
|
||||||
const onCurrentPageChange = async (value: number) => {
|
const onCurrentPageChange = async (value: number) => {
|
||||||
messageStore.pagination.currentPage = value;
|
messageSendStore.pagination.currentPage = value;
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ const onCurrentPageChange = async (value: number) => {
|
||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
const onPageSizeChange = async (value: number) => {
|
const onPageSizeChange = async (value: number) => {
|
||||||
messageStore.pagination.pageSize = value;
|
messageSendStore.pagination.pageSize = value;
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { MdEditor } from 'md-editor-v3';
|
import { MdEditor } from 'md-editor-v3';
|
||||||
import 'md-editor-v3/lib/style.css';
|
import 'md-editor-v3/lib/style.css';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
import { updateMessage } from '@/views/message-management/message/utils/hooks';
|
import { updateMessage } from '@/views/message-management/message-send/utils/hooks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * 上传图片
|
* * 上传图片
|
|
@ -1,18 +1,18 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { FormInstance } from 'element-plus';
|
import { FormInstance } from 'element-plus';
|
||||||
import { editorTypeList, rules } from '@/views/message-management/message/utils/columns';
|
import { editorTypeList, rules } from '@/views/message-management/message-send/utils/columns';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { usePublicHooks } from '@/views/hooks';
|
import { usePublicHooks } from '@/views/hooks';
|
||||||
import { useMessageTypeStore } from '@/store/message/messageType';
|
import { useMessageTypeStore } from '@/store/message/messageType';
|
||||||
import LoadingSvg from '@/assets/svg/loading.svg';
|
import LoadingSvg from '@/assets/svg/loading.svg';
|
||||||
import { coverUrl, loading, onSearchUserinfo, onUpload, updateMessage, userDataList } from '@/views/message-management/message/utils/hooks';
|
import { coverUrl, loading, onSearchUserinfo, onUpload, updateMessage, userDataList } from '@/views/message-management/message-send/utils/hooks';
|
||||||
import { messageLevel, settingLR } from '@/views/message-management/message-editing/utils/columns';
|
import { messageLevel, settingLR } from '@/views/message-management/message-editing/utils/columns';
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
import { Plus } from '@element-plus/icons-vue';
|
||||||
import { beforeUpload } from '@/views/message-management/message-editing/utils/hooks';
|
import { beforeUpload } from '@/views/message-management/message-editing/utils/hooks';
|
||||||
import SplitPane from '@/components/SplitPane';
|
import SplitPane from '@/components/SplitPane';
|
||||||
import RichEditor from '@/views/message-management/message/rich-editor.vue';
|
import RichEditor from '@/views/message-management/message-send/rich-editor.vue';
|
||||||
import MarkdownEditor from '@/views/message-management/message/markdown-editor.vue';
|
import MarkdownEditor from '@/views/message-management/message-send/markdown-editor.vue';
|
||||||
|
|
||||||
// 用户是否停用样式
|
// 用户是否停用样式
|
||||||
const { switchStyle } = usePublicHooks();
|
const { switchStyle } = usePublicHooks();
|
||||||
|
@ -90,7 +90,7 @@ defineExpose({ formRef });
|
||||||
<el-upload :auto-upload="true" :before-upload="beforeUpload" :http-request="onUpload" :show-file-list="false" accept="image/*" drag>
|
<el-upload :auto-upload="true" :before-upload="beforeUpload" :http-request="onUpload" :show-file-list="false" accept="image/*" drag>
|
||||||
<el-image v-if="coverUrl" :src="coverUrl" fit="cover" lazy>
|
<el-image v-if="coverUrl" :src="coverUrl" fit="cover" lazy>
|
||||||
<template #placeholder>
|
<template #placeholder>
|
||||||
<img alt="" src="@/assets/images/tip/loading.gif" />
|
<img alt="" src="../../../assets/images/tip/loading.gif" />
|
||||||
</template>
|
</template>
|
||||||
</el-image>
|
</el-image>
|
||||||
<el-icon v-else size="36">
|
<el-icon v-else size="36">
|
|
@ -3,7 +3,7 @@ import { onBeforeUnmount, ref, shallowRef } from 'vue';
|
||||||
import '@wangeditor/editor/dist/css/style.css';
|
import '@wangeditor/editor/dist/css/style.css';
|
||||||
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
|
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { updateMessage } from '@/views/message-management/message/utils/hooks';
|
import { updateMessage } from '@/views/message-management/message-send/utils/hooks';
|
||||||
|
|
||||||
const mode = 'default';
|
const mode = 'default';
|
||||||
// 编辑器实例,必须用 shallowRef
|
// 编辑器实例,必须用 shallowRef
|
|
@ -1,15 +1,14 @@
|
||||||
import { addDialog } from '@/components/BaseDialog/index';
|
import { addDialog } from '@/components/BaseDialog/index';
|
||||||
import MessageDialog from '@/views/message-management/message/message-dialog.vue';
|
import MessageDialog from '@/views/message-management/message-send/message-dialog.vue';
|
||||||
import { useMessageStore } from '@/store/message/message';
|
|
||||||
import { h, reactive, ref, toRaw } from 'vue';
|
import { h, reactive, ref, toRaw } from 'vue';
|
||||||
import { message, messageBox } from '@/utils/message';
|
import { message, messageBox } from '@/utils/message';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||||
import { useAdminUserStore } from '@/store/system/adminUser';
|
import { useAdminUserStore } from '@/store/system/adminUser';
|
||||||
import { fetchGetReceivedUserinfoByMessageId } from '@/api/v1/message';
|
|
||||||
import { decode, encode } from 'js-base64';
|
import { decode, encode } from 'js-base64';
|
||||||
import type { UploadRequestOptions } from 'element-plus';
|
import type { UploadRequestOptions } from 'element-plus';
|
||||||
import { fetchUploadFile } from '@/api/v1/system';
|
import { fetchUploadFile } from '@/api/v1/system/system';
|
||||||
|
import { useMessageSendStore } from '@/store/message/messageSend';
|
||||||
|
|
||||||
export const formRef = ref();
|
export const formRef = ref();
|
||||||
// 删除ids
|
// 删除ids
|
||||||
|
@ -46,14 +45,14 @@ export const updateMessage = reactive({
|
||||||
// 0:未读 1:已读
|
// 0:未读 1:已读
|
||||||
status: undefined,
|
status: undefined,
|
||||||
});
|
});
|
||||||
const messageStore = useMessageStore();
|
const messageSendStore = useMessageSendStore();
|
||||||
const adminUserStore = useAdminUserStore();
|
const adminUserStore = useAdminUserStore();
|
||||||
|
|
||||||
/** 搜索初始化系统消息 */
|
/** 搜索初始化系统消息 */
|
||||||
export async function onSearch() {
|
export async function onSearch() {
|
||||||
messageStore.loading = true;
|
messageSendStore.loading = true;
|
||||||
await messageStore.getMessageList();
|
await messageSendStore.getMessageList();
|
||||||
messageStore.loading = false;
|
messageSendStore.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索 */
|
/** 搜索 */
|
||||||
|
@ -75,7 +74,7 @@ export async function onUpdate(row: any) {
|
||||||
updateMessage.content = decode(updateMessage.content);
|
updateMessage.content = decode(updateMessage.content);
|
||||||
|
|
||||||
// 获取当前消息内容和接收者信息
|
// 获取当前消息内容和接收者信息
|
||||||
const result = await fetchGetReceivedUserinfoByMessageId({ messageId: row.id });
|
const result = messageSendStore.updateMessage({ messageId: row.id });
|
||||||
userDataList.value = result.data.map((item: any) => ({
|
userDataList.value = result.data.map((item: any) => ({
|
||||||
id: item.receivedUserId,
|
id: item.receivedUserId,
|
||||||
nickname: item.nickname,
|
nickname: item.nickname,
|
||||||
|
@ -102,7 +101,7 @@ export async function onUpdate(row: any) {
|
||||||
data.content = encode(data.content);
|
data.content = encode(data.content);
|
||||||
|
|
||||||
// 更新消息内容
|
// 更新消息内容
|
||||||
const result = await messageStore.updateMessage({ ...data, id: row.id });
|
const result = await messageSendStore.updateMessage({ ...data, id: row.id });
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
Object.assign(updateMessage, {});
|
Object.assign(updateMessage, {});
|
||||||
done();
|
done();
|
||||||
|
@ -126,7 +125,7 @@ export const onDelete = async (row: any) => {
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
|
||||||
// 删除数据
|
// 删除数据
|
||||||
await messageStore.deleteMessage([id]);
|
await messageSendStore.deleteMessage([id]);
|
||||||
await onSearch();
|
await onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -150,7 +149,7 @@ export const onDeleteBatch = async () => {
|
||||||
const text = options.props.formInline.confirmText.toLowerCase();
|
const text = options.props.formInline.confirmText.toLowerCase();
|
||||||
if (text === 'yes' || text === 'y') {
|
if (text === 'yes' || text === 'y') {
|
||||||
// 删除数据
|
// 删除数据
|
||||||
await messageStore.deleteMessage(ids);
|
await messageSendStore.deleteMessage(ids);
|
||||||
await onSearch();
|
await onSearch();
|
||||||
|
|
||||||
done();
|
done();
|
|
@ -11,7 +11,7 @@ import { deviceDetection, handleTree } from '@pureadmin/utils';
|
||||||
import CropperPreview from '@/components/CropperPreview';
|
import CropperPreview from '@/components/CropperPreview';
|
||||||
import AssignUserToRole from '@/views/system/adminUser/assign-roles-to-user.vue';
|
import AssignUserToRole from '@/views/system/adminUser/assign-roles-to-user.vue';
|
||||||
import userAvatar from '@/assets/user.jpg';
|
import userAvatar from '@/assets/user.jpg';
|
||||||
import { fetchForcedOffline, fetchUploadAvatarByAdmin } from '@/api/v1/adminUser';
|
import { fetchForcedOffline, fetchUploadAvatarByAdmin } from '@/api/v1/system/adminUser';
|
||||||
import { useUserStore } from '@/store/system/user';
|
import { useUserStore } from '@/store/system/user';
|
||||||
import { useDeptStore } from '@/store/system/dept';
|
import { useDeptStore } from '@/store/system/dept';
|
||||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { h, ref } from 'vue';
|
||||||
import { message, messageBox } from '@/utils/message';
|
import { message, messageBox } from '@/utils/message';
|
||||||
import type { FormItemProps } from '@/views/system/role/utils/types';
|
import type { FormItemProps } from '@/views/system/role/utils/types';
|
||||||
import { $t } from '@/plugins/i18n';
|
import { $t } from '@/plugins/i18n';
|
||||||
import { fetchGetPowerListByRoleId } from '@/api/v1/power';
|
import { fetchGetPowerListByRoleId } from '@/api/v1/system/power';
|
||||||
import { isAllEmpty } from '@pureadmin/utils';
|
import { isAllEmpty } from '@pureadmin/utils';
|
||||||
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
import DeleteBatchDialog from '@/components/Table/DeleteBatchDialog.vue';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue