|
|
@@ -59,35 +59,79 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="pagination-box">
|
|
|
- <Pagination size="small" v-model:current="pageData.page" :total="pageData.total" @change="changeSize" />
|
|
|
+ <div class="read-all">
|
|
|
+ <div class="read-btn" v-if="currentBtn.code !== 'todo' && readTitle === 0" @click="readAllMsg">一键已读
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Pagination simple v-model:current="pageData.page" :total="pageData.total" @change="changeSize" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Modal :visible="ifShowDialog" centered title="消息详情" :maskClosable="false" :footer="null" @cancel="closeDialog"
|
|
|
- :width="400">
|
|
|
+ :width="600">
|
|
|
<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>
|
|
|
- <div class="value">{{ item.value }}</div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">消息名称:</div>
|
|
|
+ <div class="value">{{ formItemData.msgTitle }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">消息描述:</div>
|
|
|
+ <div class="value">{{ formItemData.msgDescrible }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">消息时间:</div>
|
|
|
+ <div class="value">{{ formItemData.msgTime }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">资源名称:</div>
|
|
|
+ <div class="value">{{ formItemData.serviceName }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">审核状态:</div>
|
|
|
+ <div class="value">{{ formItemData.shzt }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="msg-item">
|
|
|
+ <div class="label">审核详情:</div>
|
|
|
+ </div>
|
|
|
+ <!-- 审核流程相关列表 -->
|
|
|
+ <div class="audit-list">
|
|
|
+ <div class="audit" v-for="(item, index) in formItemData.lcxx" :key="index">
|
|
|
+ <div class="check">
|
|
|
+ <div class="name">人员:{{ item.nodeName }}</div>
|
|
|
+ <div class="ispass">审核:{{ item.nodeIsPass }}</div>
|
|
|
+ <div class="time">时间:{{ item.nodeTime }}</div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="check-info">意见:{{ item.nodeInfo || '未填写' }}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { defineComponent, reactive, ref, toRefs, computed, onMounted, watch } from 'vue';
|
|
|
+import { defineComponent, reactive, ref, toRefs, computed, onMounted, watch, createVNode } from 'vue';
|
|
|
import { useAppStore } from '/@/store/modules/app';
|
|
|
import { Modal, Pagination } from 'ant-design-vue';
|
|
|
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
import { getSmsByUserId, editSmsById } from '/@/api/sys/tips';
|
|
|
+import { queryBussInfoById } from '/@/api/resource/examine';
|
|
|
import { router } from '/@/router';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'tips',
|
|
|
- components: { Modal, Pagination },
|
|
|
+ components: { Modal, Pagination, ExclamationCircleOutlined },
|
|
|
setup() {
|
|
|
const appStore = useAppStore();
|
|
|
// const router = useRouter();
|
|
|
const tipsDomRef = ref(null)
|
|
|
|
|
|
+ const sourceTypes = [
|
|
|
+ { SERVICETYPE: 'MR', name: '地图资源上传' },
|
|
|
+ { SERVICETYPE: 'ER', name: '场景资源上传' },
|
|
|
+ { SERVICETYPE: 'DR', name: '文件资源上传' },
|
|
|
+ { SERVICETYPE: 'SR', name: '组件资源上传' },
|
|
|
+ ]
|
|
|
+
|
|
|
const navBtns = reactive([
|
|
|
{
|
|
|
name: `待办信息`,
|
|
|
@@ -107,34 +151,24 @@ export default defineComponent({
|
|
|
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)
|
|
|
+ item.code === 'todo' && (pageData.total = todoData.value.length)
|
|
|
+ item.code === 'message' && (pageData.total = msgData.value.filter(msg => msg.read === readTitle.value).length)
|
|
|
+ currentTodo.value = todoData.value.slice(0, 10)
|
|
|
+ currentMsg.value = msgData.value.filter(msg => msg.read === readTitle.value).slice(0, 10)
|
|
|
}
|
|
|
- const todoData = reactive([])
|
|
|
- const msgData = reactive([])
|
|
|
+ const todoData = ref([])
|
|
|
+ const msgData = ref([])
|
|
|
const currentTodo = ref([])
|
|
|
const currentMsg = ref([])
|
|
|
const ifShowDialog = ref(false)
|
|
|
- const formItemData = ref([
|
|
|
- {
|
|
|
- label: '消息名称',
|
|
|
- value: ''
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作说明',
|
|
|
- value: ''
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作状态',
|
|
|
- value: ''
|
|
|
- },
|
|
|
- {
|
|
|
- label: '操作时间',
|
|
|
- value: ''
|
|
|
- }
|
|
|
- ])
|
|
|
+ const formItemData = reactive({
|
|
|
+ msgTitle: "",
|
|
|
+ msgDescrible: "",
|
|
|
+ msgTime: "",
|
|
|
+ serviceName: "",
|
|
|
+ shzt: "",
|
|
|
+ lcxx: []
|
|
|
+ })
|
|
|
const pageData = reactive({
|
|
|
page: 1,
|
|
|
total: 10
|
|
|
@@ -153,6 +187,12 @@ export default defineComponent({
|
|
|
// deep: true
|
|
|
// }
|
|
|
// )
|
|
|
+ watch(
|
|
|
+ () => appStore.tipsShowFlag,
|
|
|
+ (val) => {
|
|
|
+ getAllData()
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
// 关闭弹窗
|
|
|
const closeTips = () => {
|
|
|
@@ -162,60 +202,119 @@ export default defineComponent({
|
|
|
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;
|
|
|
+ currentMsg.value = msgData.value.filter(msg => msg.read === readTitle.value).slice((pageData.page - 1) * 10, pageData.page * 10);
|
|
|
+ pageData.total = msgData.value.filter(msg => msg.read === readTitle.value).length;
|
|
|
}
|
|
|
// 读取消息详情
|
|
|
const readMsg = (item) => {
|
|
|
- formItemData.value = [
|
|
|
- {
|
|
|
- label: '消息名称',
|
|
|
- value: item.title
|
|
|
- },
|
|
|
- {
|
|
|
- label: '消息说明',
|
|
|
- value: item.opt
|
|
|
- },
|
|
|
- {
|
|
|
- label: '创建时间',
|
|
|
- value: item.time
|
|
|
+ formItemData.msgTitle = item.title;
|
|
|
+ formItemData.msgDescrible = item.opt;
|
|
|
+ formItemData.msgTime = item.time;
|
|
|
+ let params = {
|
|
|
+ bussid: item.bussid,
|
|
|
+ page: 1,
|
|
|
+ rows: 1000
|
|
|
+ }
|
|
|
+ queryBussInfoById(params).then(res => {
|
|
|
+ if (res.resp_code === 0) {
|
|
|
+ formItemData.serviceName = res.datas.pageData[0].NAME;
|
|
|
+ formItemData.shzt = res.datas.pageData[0].SHZT;
|
|
|
+ res.datas.lzxx.pageData.forEach((lc) => {
|
|
|
+ formItemData.lcxx.push({
|
|
|
+ nodeName: lc.CHECKUSERNAEM,
|
|
|
+ nodeTime: lc.CHECKTIME,
|
|
|
+ nodeInfo: lc.CHECKINFO,
|
|
|
+ nodeIsPass: lc.ISPASS==='0'?'不通过':'通过'
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
- ]
|
|
|
+ })
|
|
|
ifShowDialog.value = true
|
|
|
if (!readTitle.value) {
|
|
|
- msgData.forEach(msg => {
|
|
|
+ msgData.value.forEach(msg => {
|
|
|
if (msg.id === item.id) {
|
|
|
msg.read = 1
|
|
|
let params = { smid: msg.id }
|
|
|
- editSmsById(params).then(res => {
|
|
|
- })
|
|
|
+ editSmsById(params)
|
|
|
}
|
|
|
})
|
|
|
- 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;
|
|
|
+ currentMsg.value = msgData.value.filter(msg => msg.read === readTitle.value).slice((pageData.page - 1) * 10, pageData.page * 10);
|
|
|
+ pageData.total = msgData.value.filter(msg => msg.read === readTitle.value).length;
|
|
|
}
|
|
|
}
|
|
|
+ // 一键读取所有消息
|
|
|
+ const readAllMsg = () => {
|
|
|
+ if (!currentMsg.value.length) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除提示',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ content: '确定将所有消息改为已读?',
|
|
|
+ centered: true,
|
|
|
+ okText: '确定',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: (() => {
|
|
|
+ let ids = [];
|
|
|
+ currentMsg.value.forEach(msg => {
|
|
|
+ ids.push(msg.id)
|
|
|
+ })
|
|
|
+ let params = { smid: ids.join(',') }
|
|
|
+ editSmsById(params).then(res => {
|
|
|
+ if (res.resp_code === 0) {
|
|
|
+ msgData.value.forEach(msg => {
|
|
|
+ msg.read = 1
|
|
|
+ })
|
|
|
+ currentMsg.value = [];
|
|
|
+ pageData.total = 0;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ });
|
|
|
+ };
|
|
|
// 跳转待办页面
|
|
|
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 } })
|
|
|
+ let path = item.title.indexOf('授权') > -1 ? '/authorize/empower' : '/resource/examine';
|
|
|
+ let type = 'MR';
|
|
|
+ let t = new Date().getTime()
|
|
|
+ appStore.setRouterPushAuditFlag(true)
|
|
|
+ if (path === '/resource/examine') {
|
|
|
+ sourceTypes.forEach(source => {
|
|
|
+ source.name === item.title && (type = source.SERVICETYPE)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ router.push({ path: path, query: { bussid: item.bussid, type: type, t: t } })
|
|
|
closeTips()
|
|
|
}
|
|
|
// 关闭消息详情弹窗
|
|
|
const closeDialog = () => {
|
|
|
ifShowDialog.value = false
|
|
|
+ formItemData.msgTitle = "";
|
|
|
+ formItemData.msgDescrible = "";
|
|
|
+ formItemData.msgTime = "";
|
|
|
+ formItemData.serviceName = "";
|
|
|
+ formItemData.shzt = "";
|
|
|
+ formItemData.lcxx = [];
|
|
|
}
|
|
|
// 切换分页
|
|
|
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))
|
|
|
+ currentBtn.code === 'todo' && (currentTodo.value = todoData.value.slice((page - 1) * pageSize, page * pageSize))
|
|
|
+ currentBtn.code === 'message' && (currentMsg.value = msgData.value.filter(msg => msg.read === readTitle.value).slice((page - 1) * pageSize, page * pageSize))
|
|
|
}
|
|
|
-
|
|
|
- onMounted(() => {
|
|
|
+ // 获取所有数据
|
|
|
+ const getAllData = () => {
|
|
|
+ todoData.value = []
|
|
|
+ msgData.value = []
|
|
|
+ currentTodo.value = []
|
|
|
+ currentMsg.value = []
|
|
|
+ pageData.page = 1
|
|
|
+ currentBtn.name = "待办信息"
|
|
|
+ currentBtn.code = "todo"
|
|
|
+ readTitle.value = 0
|
|
|
let params = {
|
|
|
keyStr: "",
|
|
|
page: 1,
|
|
|
@@ -226,7 +325,7 @@ export default defineComponent({
|
|
|
res.datas.records.forEach(item => {
|
|
|
// 待办
|
|
|
if (item.message.indexOf('请及时处理') > -1) {
|
|
|
- todoData.push({
|
|
|
+ todoData.value.push({
|
|
|
title: item.message.substring(item.message.indexOf('【') + 1, item.message.indexOf('】')),
|
|
|
opt: item.message,
|
|
|
// status: item.status,
|
|
|
@@ -236,7 +335,7 @@ export default defineComponent({
|
|
|
}
|
|
|
// 消息
|
|
|
else {
|
|
|
- msgData.push({
|
|
|
+ msgData.value.push({
|
|
|
title: item.message.substring(item.message.indexOf('【') + 1, item.message.indexOf('】')),
|
|
|
opt: item.message,
|
|
|
// status: item.status,
|
|
|
@@ -246,12 +345,16 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- currentTodo.value = todoData.slice(0, 10)
|
|
|
- currentMsg.value = msgData.filter(msg => msg.read === readTitle.value).slice(0, 10)
|
|
|
+ currentTodo.value = todoData.value.slice(0, 10)
|
|
|
+ currentMsg.value = msgData.value.filter(msg => msg.read === readTitle.value).slice(0, 10)
|
|
|
pageData.page = 1;
|
|
|
- pageData.total = todoData.length;
|
|
|
+ pageData.total = todoData.value.length;
|
|
|
}
|
|
|
})
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ getAllData()
|
|
|
})
|
|
|
|
|
|
return {
|
|
|
@@ -272,6 +375,7 @@ export default defineComponent({
|
|
|
closeTips,
|
|
|
choseRead,
|
|
|
readMsg,
|
|
|
+ readAllMsg,
|
|
|
closeDialog,
|
|
|
changeSize,
|
|
|
gotoTodo
|
|
|
@@ -495,7 +599,17 @@ export default defineComponent({
|
|
|
height: 30px;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .read-all {
|
|
|
+ .read-btn {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ color: #0671DD;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -514,5 +628,40 @@ export default defineComponent({
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
-</style>
|
|
|
+
|
|
|
+ .audit-list {
|
|
|
+ .audit {
|
|
|
+ padding: 0 10px;
|
|
|
+ border-bottom: 1px solid rgba(182, 173, 173, 0.6);
|
|
|
+ .check {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ height: 30px;
|
|
|
+ // width: 60%;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ width: 30%;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ // flex: 1;
|
|
|
+ // margin-right: 20px;
|
|
|
+ }
|
|
|
+ .time{
|
|
|
+ // margin-right: 20px;
|
|
|
+ // flex:1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ispass{
|
|
|
+ // flex:1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .check-info {
|
|
|
+ height: 30px;
|
|
|
+ // width: 60%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}</style>
|