明树Git Lab

Commit f71a1732 authored by yangyajing's avatar yangyajing

消息列表页

parent 3d224552
Pipeline #107751 passed with stage
in 20 seconds
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
<!-- <span class="city-name">123123</span> --> <!-- <span class="city-name">123123</span> -->
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="message-wrap" @click="toMessagePage">
<el-icon size="20">
<ChatDotSquare />
</el-icon>
<div class="count">{{ messageCount }}</div>
</div>
<div> <div>
<el-dropdown> <el-dropdown>
<span class="username"> <span class="username">
...@@ -62,8 +68,24 @@ const getResourceData = () => { ...@@ -62,8 +68,24 @@ const getResourceData = () => {
}, },
}); });
}; };
// 获取未读消息数量
let messageCount = ref(0);
const getMessageCount = () => {
proxy.$post({
url: "/api/message/getMesCount",
data: {},
callback: (data) => {
messageCount.value = data.count;
},
});
};
// 跳转消息列表页
const toMessagePage = () => {
router.push("/message");
}
onMounted(() => { onMounted(() => {
getResourceData(); getResourceData();
getMessageCount();
}); });
// 处理退出登录 // 处理退出登录
const handleLogout = () => { const handleLogout = () => {
...@@ -154,5 +176,24 @@ const handleLogout = () => { ...@@ -154,5 +176,24 @@ const handleLogout = () => {
} }
.header-right { .header-right {
display: flex; display: flex;
align-items: center;
.message-wrap{
position: relative;
margin-right: 10px;
cursor: pointer;
.count{
position: absolute;
top: -5px;
right: -5px;
min-width: 14px;
height: 14px;
border-radius: 50%;
background-color: red;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 14px;
}
}
} }
</style> </style>
...@@ -71,7 +71,7 @@ const routes = [ ...@@ -71,7 +71,7 @@ const routes = [
component: () => import("@/views/projectManage/projectAllPage.vue"), component: () => import("@/views/projectManage/projectAllPage.vue"),
}, },
{ {
path: "/addProject/:type", path: "/addProject",
name: "addProject", name: "addProject",
title: "新增项目", title: "新增项目",
component: () => import("@/views/projectManage/addProject.vue"), component: () => import("@/views/projectManage/addProject.vue"),
......
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
&-header{ &-header{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 10px;
} }
&-content{ &-content{
flex: 1; flex: 1;
...@@ -121,6 +122,12 @@ ...@@ -121,6 +122,12 @@
.tabs-content{ .tabs-content{
flex: 1; flex: 1;
height: 0; height: 0;
display: flex;
flex-direction: column;
&>.el-tabs{
flex: 1;
height: 0;
}
} }
.el-tabs{ .el-tabs{
height: 100%; height: 100%;
......
...@@ -338,7 +338,6 @@ ...@@ -338,7 +338,6 @@
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { useUserStore } from "@/stores/user.js"; import { useUserStore } from "@/stores/user.js";
import moment from "moment";
const userStore = useUserStore(); const userStore = useUserStore();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
......
This diff is collapsed.
...@@ -181,9 +181,6 @@ ...@@ -181,9 +181,6 @@
const previewProject = (item) => { const previewProject = (item) => {
router.push({ router.push({
name: "addProject", name: "addProject",
params: {
type: "xmlingxuan"
},
query: { query: {
isPreview: true, isPreview: true,
projectId: item.id projectId: item.id
......
...@@ -113,9 +113,6 @@ ...@@ -113,9 +113,6 @@
const fillProject = (item) => { const fillProject = (item) => {
router.push({ router.push({
name: "addProject", name: "addProject",
params: {
type: "xmlz"
},
query: { query: {
projectId: item.id projectId: item.id
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<template #operations="{ row, index }"> <template #operations="{ row, index }">
<el-button link type="primary" size="small" <el-button link type="primary" size="small"
:loading="row.loading" @click="getResult(row)" :loading="row.loading" @click="getResult(row)"
>查询决策结果</el-button> >查询</el-button>
</template> </template>
</common-table> </common-table>
</div> </div>
......
...@@ -113,14 +113,11 @@ ...@@ -113,14 +113,11 @@
getProjectData(); getProjectData();
} }
const addProject = () => { const addProject = () => {
router.push("/addProject/xmlingxuan"); router.push("/addProject");
}; };
const editProject = (item) => { const editProject = (item) => {
router.push({ router.push({
name: "addProject", name: "addProject",
params: {
type: "xmlingxuan"
},
query: { query: {
projectId: item.id projectId: item.id
} }
...@@ -129,9 +126,6 @@ ...@@ -129,9 +126,6 @@
const previewProject = (item) => { const previewProject = (item) => {
router.push({ router.push({
name: "addProject", name: "addProject",
params: {
type: "xmlingxuan"
},
query: { query: {
isPreview: true, isPreview: true,
projectId: item.id projectId: item.id
......
...@@ -22,16 +22,16 @@ ...@@ -22,16 +22,16 @@
@current-page-change="handleCurrentPageChange" @current-page-change="handleCurrentPageChange"
> >
<template #operations="{ row, index }"> <template #operations="{ row, index }">
<!-- 立项审批中 -->
<el-button link type="primary" size="small"
v-if="row.projectLzType === '3'"
:loading="row.loading" @click="getResult(row)"
>查询审批结果</el-button>
<!-- 已立项 --> <!-- 已立项 -->
<el-button link type="primary" size="small" <el-button link type="primary" size="small"
v-if="row.projectLzType === '5'" v-if="row.projectLzType === '5'"
@click="fillDecision(row)" @click="fillDecision(row)"
>决策填报</el-button> >决策填报</el-button>
<!-- 立项审批中 -->
<el-button link type="primary" size="small"
v-else
:loading="row.loading" @click="viewDecision(row)"
>查看</el-button>
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -116,33 +116,18 @@ ...@@ -116,33 +116,18 @@
currentPage.value = page; currentPage.value = page;
getProjectData(); getProjectData();
} }
const getResult = (item) => { const viewDecision = (item) => {
item.loading = true; router.push({
proxy.$post({ name: "addProject",
url: "/api/project/queryLixiangResult", query: {
data: { projectId: item.id,
id: item.id isPreview: true
},
callback: (data) => {
item.loading = false;
router.push({
name: "addProject",
params: {
type: "xmlx"
},
query: {
projectId: item.id
}
});
} }
}) });
}; };
const fillDecision = (item) => { const fillDecision = (item) => {
router.push({ router.push({
name: "addProject", name: "addProject",
params: {
type: "xmlx"
},
query: { query: {
projectId: item.id projectId: item.id
} }
......
...@@ -26,13 +26,40 @@ ...@@ -26,13 +26,40 @@
</template> </template>
</common-table> </common-table>
</div> </div>
<el-dialog v-model="messageDialogVisible" title="" width="500" align-center
@close="closeDialog"
>
<div class="message-wrap">
<div class="message-title">{{ messageInfo.title }}</div>
<div class="message-content">
<div class="label">消息类型:</div>
<div class="info">{{ messageInfo.type === 2 ? "项目初步审核" : messageInfo.type === 3 ? "项目终审" : "系统消息" }}</div>
</div>
<div class="message-content">
<div class="label">时间:</div>
<div class="info">{{ proxy.moment(messageInfo.createdAt).format("YYYY-MM-DD HH:mm:SS") }}</div>
</div>
<div class="message-content">
<div class="label">备注:</div>
<div class="info">{{ messageInfo.content }}</div>
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDialog">关闭</el-button>
<!-- <el-button type="primary" @click="toProjectPage">去处理</el-button> -->
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted, getCurrentInstance, computed, nextTick } from "vue"; import { ref, reactive, onMounted, getCurrentInstance, computed, nextTick } from "vue";
import { ElMessage, ElMessageBox } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
import CommonTable from "@/components/common/commonTable.vue"; import CommonTable from "@/components/common/commonTable.vue";
const router = useRouter();
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const loading = ref(false); const loading = ref(false);
// 表格数据 // 表格数据
...@@ -43,10 +70,37 @@ const pageSize = ref(10); ...@@ -43,10 +70,37 @@ const pageSize = ref(10);
// 表格列配置 // 表格列配置
const tableColumns = [ const tableColumns = [
{ {
prop: "name", prop: "title",
label: "标题", label: "标题",
minWidth: 100 minWidth: 100
}, },
{
prop: "type",
label: "消息类型",
width: 120,
align: "center",
formatter: (data) => {
return data.type === 2 ? "项目初步审核" : data.type === 3 ? "项目终审" : "系统消息";
}
},
{
prop: "isRead",
label: "状态",
width: 90,
align: "center",
formatter: (data) => {
return data.isRead ? "已读" : "未读";
}
},
{
prop: "createdAt",
label: "时间",
width: 180,
align: "center",
formatter: (data) => {
return proxy.moment(data.createdAt).format("YYYY-MM-DD HH:mm:SS");
}
},
{ {
prop: "operations", prop: "operations",
label: "操作", label: "操作",
...@@ -88,8 +142,81 @@ const handleCurrentPageChange = (page) => { ...@@ -88,8 +142,81 @@ const handleCurrentPageChange = (page) => {
onMounted(() => { onMounted(() => {
loadTableData(); loadTableData();
}); });
// 获取信息详情
let messageDialogVisible = ref(false);
let messageInfo = ref({});
const handlePreview = (item) => {
proxy.$post({
url: "/api/message/getMessageInfo",
data: {
id: item.id
},
callback: (data) => {
messageDialogVisible.value = true;
messageInfo.value = data;
},
error: (err) => {
ElMessage.error("加载数据失败");
},
});
}
const closeDialog = () => {
messageInfo.value = {};
messageDialogVisible.value = false;
}
// 跳转到对应项目
const toProjectPage = () => {
router.push({
name: "addProject",
query: {
projectId: messageInfo.value.projectId,
isPreview: true
}
});
}
// 删除
const handleDelete = (row) => {
ElMessageBox.confirm(`确定删除该条消息?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
proxy.$post({
url: "/api/message/deleteMessage",
data: { id: row.id },
callback: (data) => {
ElMessage.success("删除成功");
loadTableData();
},
error: (err) => {
ElMessage.error("删除失败:", err);
},
});
});
}
</script> </script>
<style lang="less"> <style lang="less">
@import "@/styles/manage.less"; @import "@/styles/manage.less";
.message-wrap{
.message-title{
font-size: 16px;
font-weight: 600;
margin: 10px 0;
}
.message-content{
display: flex;
align-items: flex-start;
margin-bottom: 10px;
.label{
width: 80px;
text-align: justify;
text-align-last: justify;
}
.info{
flex: 1;
width: 0;
}
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment