|
|
@@ -23,26 +23,25 @@
|
|
|
</div>
|
|
|
<!-- 消息列表 -->
|
|
|
<div class="tips-item" style="height: calc(100% - 60px);" v-if="currentBtn.code !== 'todo'">
|
|
|
- <div class="msg-list list" v-for="(item, index) in msgData.filter(msg => msg.read === readTitle)"
|
|
|
- :key="index" @click="readMsg(item)">
|
|
|
+ <div class="msg-list list" v-for="(item, index) in currentMsg" :key="index" @click="readMsg(item)">
|
|
|
<div class="list-header">
|
|
|
<div class="title">
|
|
|
<div class="msg-icon"></div>
|
|
|
- {{ item.opt }}
|
|
|
+ 【{{ item.title }}】
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="list-content">
|
|
|
<div class="left-box">
|
|
|
- <div class="item-info">审核人:{{ item.user }}</div>
|
|
|
+ <div class="item-info">{{ item.opt }}</div>
|
|
|
<div class="item-info">时间:{{ item.time }}</div>
|
|
|
</div>
|
|
|
- <div class="status" :class="[item.status === 1 ? 'passed' : 'nopassed']"></div>
|
|
|
+ <!-- <div class="status" :class="[item.status === 1 ? 'passed' : 'nopassed']"></div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 待处理 -->
|
|
|
<div class="tips-item" v-else>
|
|
|
- <div class="todo-list list" v-for="(item, index) in todoData" :key="index">
|
|
|
+ <div class="todo-list list" v-for="(item, index) in currentTodo" :key="index" @click="gotoTodo(item)">
|
|
|
<div class="list-header">
|
|
|
<div class="title">【{{ item.title }}】</div>
|
|
|
<div class="more-btn"></div>
|
|
|
@@ -50,19 +49,22 @@
|
|
|
<div class="list-content">
|
|
|
<div class="left-box">
|
|
|
<div class="item-info">{{ item.opt }}</div>
|
|
|
- <div class="item-info">发起人:{{ item.user }}</div>
|
|
|
+ <!-- <div class="item-info">发起人:{{ item.user }}</div> -->
|
|
|
<div class="item-info">时间:{{ item.time }}</div>
|
|
|
</div>
|
|
|
- <div class="status" :class="[item.status === 1 ? 'passed' : 'nopassed']"></div>
|
|
|
+ <!-- <div class="status" :class="[item.status === 1 ? 'passed' : 'nopassed']"></div> -->
|
|
|
+ <div class="status nopassed"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div class="pagination-box">
|
|
|
+ <Pagination size="small" v-model:current="pageData.page" :total="pageData.total" @change="changeSize" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Modal :visible="ifShowDialog" centered title="消息详情" :maskClosable="false" :footer="null"
|
|
|
- @cancel="closeDialog">
|
|
|
+ <Modal :visible="ifShowDialog" centered title="消息详情" :maskClosable="false" :footer="null" @cancel="closeDialog"
|
|
|
+ :width="400">
|
|
|
<div class="content" style="padding: 20px 20px 20px;font-size: 16px;">
|
|
|
<div class="msg-item" v-for="(item, index) in formItemData" :key="index">
|
|
|
<div class="label">{{ item.label }}:</div>
|
|
|
@@ -74,14 +76,16 @@
|
|
|
<script>
|
|
|
import { defineComponent, reactive, ref, toRefs, computed, onMounted, watch } from 'vue';
|
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
|
-import { Modal } from 'ant-design-vue';
|
|
|
-import { getSmsByUserId } from '/@/api/sys/tips';
|
|
|
+import { Modal, Pagination } from 'ant-design-vue';
|
|
|
+import { getSmsByUserId, editSmsById } from '/@/api/sys/tips';
|
|
|
+import { router } from '/@/router';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'tips',
|
|
|
- components: { Modal },
|
|
|
+ components: { Modal, Pagination },
|
|
|
setup() {
|
|
|
const appStore = useAppStore();
|
|
|
+ // const router = useRouter();
|
|
|
const tipsDomRef = ref(null)
|
|
|
|
|
|
const navBtns = reactive([
|
|
|
@@ -99,165 +103,19 @@ export default defineComponent({
|
|
|
name: "待办信息",
|
|
|
code: "todo"
|
|
|
})
|
|
|
- const ifShowTop = ref(true)
|
|
|
const handleBtnClick = (item) => {
|
|
|
currentBtn.code = item.code
|
|
|
currentBtn.name = item.name
|
|
|
+ pageData.page = 1
|
|
|
+ item.code === 'todo' && (pageData.total = todoData.length)
|
|
|
+ item.code === 'message' && (pageData.total = msgData.filter(msg => msg.read === readTitle.value).length)
|
|
|
+ currentTodo.value = todoData.slice(0, 10)
|
|
|
+ currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice(0, 10)
|
|
|
}
|
|
|
- const todoData = reactive([
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 0,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00"
|
|
|
- }
|
|
|
- ])
|
|
|
- const msgData = reactive([
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 1
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 0
|
|
|
- },
|
|
|
- {
|
|
|
- title: "资源申请",
|
|
|
- opt: "xx地图资源授权申请",
|
|
|
- status: 1,
|
|
|
- user: "张某某",
|
|
|
- time: "2023-07-06 14:30:00",
|
|
|
- read: 1
|
|
|
- }
|
|
|
- ])
|
|
|
+ const todoData = reactive([])
|
|
|
+ const msgData = reactive([])
|
|
|
+ const currentTodo = ref([])
|
|
|
+ const currentMsg = ref([])
|
|
|
const ifShowDialog = ref(false)
|
|
|
const formItemData = ref([
|
|
|
{
|
|
|
@@ -272,37 +130,42 @@ export default defineComponent({
|
|
|
label: '操作状态',
|
|
|
value: ''
|
|
|
},
|
|
|
- {
|
|
|
- label: '操作人',
|
|
|
- value: ''
|
|
|
- },
|
|
|
{
|
|
|
label: '操作时间',
|
|
|
value: ''
|
|
|
}
|
|
|
])
|
|
|
-
|
|
|
- watch(
|
|
|
- () => [todoData, msgData],
|
|
|
- (newVal, oldVal) => {
|
|
|
- let totalNum = newVal[0].length + newVal[1].filter(msg => msg.read === 0).length
|
|
|
- let num = totalNum <= 99 ? totalNum === 0 ? '' : totalNum : `99+`
|
|
|
- appStore.setTipsTotalNum(num)
|
|
|
- },
|
|
|
- {
|
|
|
- immediate: true,
|
|
|
- deep: true
|
|
|
- }
|
|
|
- )
|
|
|
-
|
|
|
-
|
|
|
+ const pageData = reactive({
|
|
|
+ page: 1,
|
|
|
+ total: 10
|
|
|
+ })
|
|
|
+ // const pageSizeOptions = ['10','20','50']
|
|
|
+ // 实时计算总数
|
|
|
+ // watch(
|
|
|
+ // () => [todoData, msgData],
|
|
|
+ // (newVal, oldVal) => {
|
|
|
+ // let totalNum = newVal[0].length + newVal[1].filter(msg => msg.read === 0).length
|
|
|
+ // let num = totalNum <= 99 ? totalNum === 0 ? '' : totalNum : `99+`
|
|
|
+ // appStore.setTipsTotalNum(num)
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // immediate: true,
|
|
|
+ // deep: true
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+
|
|
|
+ // 关闭弹窗
|
|
|
const closeTips = () => {
|
|
|
appStore.setTipsShowFlag(false)
|
|
|
}
|
|
|
-
|
|
|
+ // 切换已读未读
|
|
|
const choseRead = (flag) => {
|
|
|
readTitle.value = flag
|
|
|
+ pageData.page = 1
|
|
|
+ currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice((pageData.page - 1) * 10, pageData.page * 10);
|
|
|
+ pageData.total = msgData.filter(msg => msg.read === readTitle.value).length;
|
|
|
}
|
|
|
+ // 读取消息详情
|
|
|
const readMsg = (item) => {
|
|
|
formItemData.value = [
|
|
|
{
|
|
|
@@ -310,32 +173,84 @@ export default defineComponent({
|
|
|
value: item.title
|
|
|
},
|
|
|
{
|
|
|
- label: '操作说明',
|
|
|
+ label: '消息说明',
|
|
|
value: item.opt
|
|
|
},
|
|
|
{
|
|
|
- label: '操作状态',
|
|
|
- value: item.status?'已通过':'未通过'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作人',
|
|
|
- value: item.user
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作时间',
|
|
|
+ label: '创建时间',
|
|
|
value: item.time
|
|
|
}
|
|
|
]
|
|
|
ifShowDialog.value = true
|
|
|
- item.read = 1
|
|
|
+ if (!readTitle.value) {
|
|
|
+ msgData.forEach(msg => {
|
|
|
+ if (msg.id === item.id) {
|
|
|
+ msg.read = 1
|
|
|
+ let params = { smid: msg.id }
|
|
|
+ editSmsById(params).then(res => {
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice((pageData.page - 1) * 10, pageData.page * 10);
|
|
|
+ pageData.total = msgData.filter(msg => msg.read === readTitle.value).length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 跳转待办页面
|
|
|
+ const gotoTodo = (item) => {
|
|
|
+ // console.log(router);
|
|
|
+ // console.log(item);
|
|
|
+ let path = item.title.indexOf('授权') > -1 ? '/authorize/empower' : '/resource/examine'
|
|
|
+ router.push({ path: path, query: { bussid: item.bussid } })
|
|
|
+ closeTips()
|
|
|
}
|
|
|
+ // 关闭消息详情弹窗
|
|
|
const closeDialog = () => {
|
|
|
ifShowDialog.value = false
|
|
|
}
|
|
|
+ // 切换分页
|
|
|
+ const changeSize = (page, pageSize) => {
|
|
|
+ // console.log(page);
|
|
|
+ // console.log(pageSize);
|
|
|
+ currentBtn.code === 'todo' && (currentTodo.value = todoData.slice((page - 1) * pageSize, page * pageSize))
|
|
|
+ currentBtn.code === 'message' && (currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice((page - 1) * pageSize, page * pageSize))
|
|
|
+ }
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getSmsByUserId().then(res=>{
|
|
|
- console.log(res);
|
|
|
+ let params = {
|
|
|
+ keyStr: "",
|
|
|
+ page: 1,
|
|
|
+ rows: 1000000
|
|
|
+ }
|
|
|
+ getSmsByUserId(params).then(res => {
|
|
|
+ if (res.datas?.records?.length) {
|
|
|
+ res.datas.records.forEach(item => {
|
|
|
+ // 待办
|
|
|
+ if (item.message.indexOf('请及时处理') > -1) {
|
|
|
+ todoData.push({
|
|
|
+ title: item.message.substring(item.message.indexOf('【') + 1, item.message.indexOf('】')),
|
|
|
+ opt: item.message,
|
|
|
+ // status: item.status,
|
|
|
+ time: item.createtime,
|
|
|
+ ...item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 消息
|
|
|
+ else {
|
|
|
+ msgData.push({
|
|
|
+ title: item.message.substring(item.message.indexOf('【') + 1, item.message.indexOf('】')),
|
|
|
+ opt: item.message,
|
|
|
+ // status: item.status,
|
|
|
+ time: item.createtime,
|
|
|
+ read: item.status,
|
|
|
+ ...item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ currentTodo.value = todoData.slice(0, 10)
|
|
|
+ currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice(0, 10)
|
|
|
+ pageData.page = 1;
|
|
|
+ pageData.total = todoData.length;
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
|
|
|
@@ -346,24 +261,26 @@ export default defineComponent({
|
|
|
tipsDomRef,
|
|
|
navBtns,
|
|
|
currentBtn,
|
|
|
- ifShowTop,
|
|
|
todoData,
|
|
|
msgData,
|
|
|
+ pageData,
|
|
|
+ currentTodo,
|
|
|
+ currentMsg,
|
|
|
+ // pageSizeOptions,
|
|
|
//func
|
|
|
handleBtnClick,
|
|
|
closeTips,
|
|
|
choseRead,
|
|
|
readMsg,
|
|
|
- closeDialog
|
|
|
+ closeDialog,
|
|
|
+ changeSize,
|
|
|
+ gotoTodo
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.tips {
|
|
|
- // position: fixed;
|
|
|
- // left: calc(100% - 106px);
|
|
|
- // top: calc(100% - 80px);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: flex-end;
|
|
|
@@ -391,7 +308,7 @@ export default defineComponent({
|
|
|
.btn {
|
|
|
display: flex;
|
|
|
margin-right: 32px;
|
|
|
- width: 100px;
|
|
|
+ // width: 100px;
|
|
|
height: 50px;
|
|
|
font-family: Source Han Sans CN;
|
|
|
font-size: 16px;
|
|
|
@@ -431,7 +348,7 @@ export default defineComponent({
|
|
|
.tips-list {
|
|
|
padding-top: 18px;
|
|
|
width: 100%;
|
|
|
- height: 750px;
|
|
|
+ height: 700px;
|
|
|
|
|
|
.tips-item {
|
|
|
height: 100%;
|
|
|
@@ -510,6 +427,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
.status {
|
|
|
+ flex-shrink: 0;
|
|
|
width: 56px;
|
|
|
height: 56px;
|
|
|
}
|
|
|
@@ -571,44 +489,28 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- // .bottom-panel {
|
|
|
- // position: relative;
|
|
|
- // width: 60px;
|
|
|
- // height: 60px;
|
|
|
- // border-radius: 6px;
|
|
|
- // background: #FFFFFF;
|
|
|
- // box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2);
|
|
|
- // cursor: pointer;
|
|
|
-
|
|
|
- // .icon {
|
|
|
- // position: absolute;
|
|
|
- // left: 14px;
|
|
|
- // top: 15px;
|
|
|
- // width: 33px;
|
|
|
- // height: 31px;
|
|
|
- // background: url('/@/assets/images/tips.png') no-repeat;
|
|
|
- // background-size: 100% 100%;
|
|
|
- // }
|
|
|
-
|
|
|
- // .msg-num {
|
|
|
- // position: absolute;
|
|
|
- // top: 5px;
|
|
|
- // right: 5px;
|
|
|
- // color: #F8252C;
|
|
|
- // font-family: Source Han Sans CN;
|
|
|
- // font-size: 14px;
|
|
|
- // font-weight: bold;
|
|
|
- // line-height: 18.72px;
|
|
|
- // }
|
|
|
- // }
|
|
|
+ .pagination-box {
|
|
|
+ margin-top: 20px;
|
|
|
+ height: 30px;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-.content{
|
|
|
- .msg-item{
|
|
|
+
|
|
|
+.content {
|
|
|
+ .msg-item {
|
|
|
margin: 10px 0;
|
|
|
display: flex;
|
|
|
- .value{
|
|
|
+
|
|
|
+ .label {
|
|
|
+ width: 80px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
}
|