From ce06847ca899d51a8f963c37c06a25f1028abc49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com>
Date: Wed, 18 Dec 2024 18:05:06 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/user.ts | 10 ++++
src/views/system/user/edit.vue | 1 -
src/views/system/user/index.vue | 35 ++++++++++-
src/views/system/user/sendMsg.vue | 98 +++++++++++++++++++++++++++++++
4 files changed, 142 insertions(+), 2 deletions(-)
create mode 100644 src/views/system/user/sendMsg.vue
diff --git a/src/api/system/user.ts b/src/api/system/user.ts
index 4574219..b28417a 100644
--- a/src/api/system/user.ts
+++ b/src/api/system/user.ts
@@ -239,3 +239,13 @@ export function getCityByList(pid: any) {
method: 'get',
});
}
+/**
+ * @description: 发送消息
+ */
+export function sendMsg(data) {
+ return http.request({
+ url: '/websocket/sendMsg',
+ method: 'post',
+ data,
+ });
+}
diff --git a/src/views/system/user/edit.vue b/src/views/system/user/edit.vue
index a2806fe..1f7aa3c 100644
--- a/src/views/system/user/edit.vue
+++ b/src/views/system/user/edit.vue
@@ -353,7 +353,6 @@
* 执行提交表单
*/
const handleSubmit = () => {
- console.log(formData);
formRef.value
.validate()
.then(async () => {
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index a88c56a..bfeafd0 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -61,6 +61,14 @@
导出
+
+
+
+
+
+
+ 发送消息
+
@@ -74,6 +82,13 @@
/>
+
+
@@ -99,8 +114,10 @@
PrinterOutlined,
ToTopOutlined,
FormOutlined,
+ CommentOutlined,
} from '@vicons/antd';
import editDialog from './edit.vue';
+ import sendMsgDialog from './sendMsg.vue';
import userUpload from './userUpload.vue';
import { downloadByData } from '@/utils/file/download';
import { schemas } from './querySchemas';
@@ -114,7 +131,10 @@
const dialog = useDialog();
const basicTableRef = ref();
const createModalRef = ref();
+ const sendModalRef = ref();
+ const receiveId = ref('');
const editVisible = ref(false);
+ const sendMsgVisible = ref(false);
const userId = ref(0);
const rowKeys = ref([]);
const importVisible = ref(false);
@@ -245,7 +265,6 @@
* @param id 参数
*/
const handleResetPassword = (record) => {
- console.log(rowKeys.value);
dialog.warning({
title: '提示',
content: '确定重置密码?',
@@ -319,6 +338,20 @@
showModal: true,
});
};
+ /**
+ * 发送消息
+ * 此处写的是Socket消息发送案例,实际业务研发时根据实际需求自行接入模板消息
+ */
+ const sendMessage = async () => {
+ if (rowKeys.value.length == 0) {
+ message.error('请选择数据');
+ return;
+ }
+ receiveId.value = rowKeys.value.join();
+ sendMsgVisible.value = true;
+ await nextTick();
+ sendModalRef.value.openModal();
+ };
diff --git a/src/views/system/user/sendMsg.vue b/src/views/system/user/sendMsg.vue
new file mode 100644
index 0000000..f2eec96
--- /dev/null
+++ b/src/views/system/user/sendMsg.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+