diff --git a/src/api/model/system.ts b/src/api/model/system.ts index 09c91a9..34d45ca 100644 --- a/src/api/model/system.ts +++ b/src/api/model/system.ts @@ -235,4 +235,33 @@ export default { return await http.get("translations", data); } }, + message: { + list: async function (data = {}) { + return await http.get("message/list", data); + }, + add: async function (data = {}) { + return await http.post("message/add", data); + }, + edit: async function (data = {}) { + return await http.put("message/edit", data); + }, + del: async function (data = {}) { + return await http.delete("message/del", data); + }, + recalled: async function (data = {}) { + return await http.put("message/recalled", data); + }, + mine: async function (data = {}) { + return await http.get("message/mine", data); + }, + read: async function (data = {}) { + return await http.post("message/read", data); + }, + detail: async function (data = {}) { + return await http.get("message/detail", data); + }, + remove: async function (data = {}) { + return await http.delete("message/remove", data); + }, + }, } diff --git a/src/assets/images/404.png b/src/assets/images/404.png new file mode 100644 index 0000000..d406f04 Binary files /dev/null and b/src/assets/images/404.png differ diff --git a/src/components/piEditor/index.vue b/src/components/piEditor/index.vue index 3cc2018..dcbc5c5 100644 --- a/src/components/piEditor/index.vue +++ b/src/components/piEditor/index.vue @@ -66,10 +66,10 @@ let html = ref("") watch(() => props.modelValue, () => { html.value = props.modelValue -}, {deep: true}) - -onMounted(() => { +}, {immediate: true}) +watch(html, () => { + emit("update:modelValue", html.value) }) onUnmounted(() => { diff --git a/src/layout/components/tasks.vue b/src/layout/components/attach.vue similarity index 100% rename from src/layout/components/tasks.vue rename to src/layout/components/attach.vue diff --git a/src/layout/components/msg.vue b/src/layout/components/msg.vue new file mode 100644 index 0000000..97dec54 --- /dev/null +++ b/src/layout/components/msg.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 35c93ed..e3bade1 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -14,18 +14,11 @@ -
- - - - - -
-
- +
+
+
+ + + + + +
{{ nicknameF }} @@ -90,8 +66,8 @@ - - + + @@ -100,9 +76,10 @@ defineOptions({ name: "userBar" }) import {ref, onMounted, getCurrentInstance} from "vue" -import search from './search.vue' -import setting from './setting.vue' -import tasks from './tasks.vue' +import search from './search' +import setting from './setting' +import attach from './attach' +import msg from './msg' import websocket from "@/utils/websocket" import {ElNotification} from 'element-plus' import tools from "@/utils/tools" @@ -116,14 +93,11 @@ const {t} = useI18n() const msgVisible = ref(false); let searchVisible = ref(false) -let msg = ref(false) -let msgNum = ref(2) -let msgList = ref([]) -const tasksVisible = ref(false) -let taskNum = ref(0) +let newMsg = ref(false) +const attachVisible = ref(false) +let newTask = ref(false) const settingDialog = ref(false) const userInfo = tools.data.get("USER_INFO"); -let msgTab = ref("notice") let nickname = userInfo.nickname || userInfo.username; let nicknameF = nickname.substring(0, 1); @@ -132,7 +106,6 @@ let avatar = userInfo.avatar // mounted onMounted(() => { initWebSocket() - loadData() }) function initWebSocket() { @@ -142,16 +115,16 @@ function initWebSocket() { } function messageHandle(message) { - if (message.data == "connection successful" || message.data == "pong") { + if (message.data === "connection successful" || message.data === "pong") { return; } const data = JSON.parse(message.data) if (!data) { return; } - if (data.code == 200) { + if (data.code === 200) { ElNotification.success({ - title: 'Success', + title: '新信息通知', message: data['msg'] }) } else { @@ -160,12 +133,11 @@ function messageHandle(message) { message: data['msg'] }) } - if (data.type == "message") { - msgNum.value++ - } else if (data.type == "task") { - taskNum.value++ + if (data.type === "system" || data.type === "business" || data.type === "approval") { + newMsg.value = true + } else if (data.type === "attach") { + newTask.value = true } - return; } function closeHandle() { @@ -218,48 +190,6 @@ function handleUser(command) { function screen() { tools.screen(document.documentElement) } - -async function loadData() { - // let res = await this.$API.home.message.newCount() - // this.msgNum = res.data.count - msgNum.value = 5 - msgList.value.push({ - title: '您有一笔新的订单请及时处理。您有一笔新的订单请及时处理', - time: '2025-06-17 17:59:21' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。您有一笔新的订单请及时处理', - time: '2025-06-16 10:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2025-06-15 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2025-05-15 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2025-01-16 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2024-06-15 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2024-06-15 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2015-06-15 12:29:30' - }) - msgList.value.push({ - title: '您有一笔新的订单请及时处理。', - time: '2025-06-15 12:29:30' - }) -} diff --git a/src/views/dashboard/message/index.vue b/src/views/dashboard/message/index.vue deleted file mode 100644 index a735510..0000000 --- a/src/views/dashboard/message/index.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/src/views/system/account/index.vue b/src/views/system/account/index.vue index 2c5241e..3fa4a2f 100644 --- a/src/views/system/account/index.vue +++ b/src/views/system/account/index.vue @@ -6,11 +6,15 @@ - + - + @@ -27,17 +31,22 @@ + +