|
|
@@ -60,9 +60,9 @@
|
|
|
<div
|
|
|
v-for="(value, key) in myProjectList"
|
|
|
:key="key"
|
|
|
- v-if="key !== '总数量'"
|
|
|
+ v-if="key !== '总数量' && value != 0"
|
|
|
class="overview-bottom-item"
|
|
|
- @click="handleTo(key)"
|
|
|
+ @click="handleToPro(key)"
|
|
|
>
|
|
|
<div class="overview-bottom-item-name">{{ key }}</div>
|
|
|
<div class="overview-bottom-item-count">{{ value || 0 }}</div>
|
|
|
@@ -84,7 +84,7 @@
|
|
|
<div
|
|
|
v-for="(value, key) in myWorkOrderList"
|
|
|
:key="key"
|
|
|
- v-if="key !== '总数量'"
|
|
|
+ v-if="key !== '总数量' && value != 0"
|
|
|
class="overview-bottom-item"
|
|
|
@click="handleTo(key)"
|
|
|
>
|
|
|
@@ -108,7 +108,7 @@
|
|
|
<div
|
|
|
v-for="(value, key) in myTaskList"
|
|
|
:key="key"
|
|
|
- v-if="key !== '总数量'"
|
|
|
+ v-if="key !== '总数量' && value != 0"
|
|
|
class="overview-bottom-item"
|
|
|
@click="handleTo(key)"
|
|
|
>
|
|
|
@@ -171,7 +171,7 @@
|
|
|
</div>
|
|
|
<div class="notification-date">{{ item.createTime }}</div>
|
|
|
</div>
|
|
|
- <div class="notification-more" @click="loadMoreNotifications">
|
|
|
+ <div v-if="hasMore" class="notification-more" @click="loadMoreNotifications">
|
|
|
更多......
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -230,6 +230,9 @@
|
|
|
:common-dialog-flag.sync="commonDialogFlag"
|
|
|
@reload="getCommonFunctionsList"
|
|
|
></commonDialog>
|
|
|
+ <noticeIssuanceDetail
|
|
|
+ ref="noticeIssuanceDetailRef"
|
|
|
+ ></noticeIssuanceDetail>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -249,11 +252,13 @@ import { mapGetters } from 'vuex';
|
|
|
import vuedraggable from 'vuedraggable';
|
|
|
import commonDialog from '@/views/home/common-dialog.vue';
|
|
|
import { noticeDocumentPageV1API } from '@/api/documents/noticeIssuance/index.js';
|
|
|
+import noticeIssuanceDetail from '@/views/bpm/documents/noticeIssuance/components/addOrEditDraw.vue';
|
|
|
export default {
|
|
|
name: 'HomePage',
|
|
|
components: {
|
|
|
vuedraggable,
|
|
|
- commonDialog
|
|
|
+ commonDialog,
|
|
|
+ noticeIssuanceDetail
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -264,6 +269,7 @@ export default {
|
|
|
notifications: [],
|
|
|
currentPage: 1,
|
|
|
pageSize: 4,
|
|
|
+ hasMore: true,
|
|
|
portals: [],
|
|
|
calendarShowMore: false,
|
|
|
isDelFlag: false,
|
|
|
@@ -329,14 +335,19 @@ export default {
|
|
|
handleNotificationsClick(item) {
|
|
|
console.log('item~~~', item);
|
|
|
if(this.activeTab === 'system') return;
|
|
|
- this.$router.push({
|
|
|
- path: '/documents/noticeIssuance/add-or-edit',
|
|
|
- // query
|
|
|
- query: {
|
|
|
- id: item.id,
|
|
|
- type: 'detail'
|
|
|
- }
|
|
|
+
|
|
|
+ this.$refs.noticeIssuanceDetailRef.openDrawer({
|
|
|
+ id: item.id,
|
|
|
+ type: 'view'
|
|
|
});
|
|
|
+
|
|
|
+ // this.$router.push({
|
|
|
+ // // query
|
|
|
+ // query: {
|
|
|
+ // id: item.id,
|
|
|
+ // type: 'detail'
|
|
|
+ // }
|
|
|
+ // });
|
|
|
},
|
|
|
async getMyWorkCalendar() {
|
|
|
const res = await getMyWorkCalendar({
|
|
|
@@ -416,6 +427,9 @@ export default {
|
|
|
}
|
|
|
return [];
|
|
|
},
|
|
|
+ handleToPro() {
|
|
|
+ this.handelRouterTo('/page-pro/project-initiation')
|
|
|
+ },
|
|
|
handleTo(key) {
|
|
|
switch(key) {
|
|
|
case '测试项目':
|
|
|
@@ -452,13 +466,15 @@ export default {
|
|
|
},
|
|
|
async getMessageList() {
|
|
|
let list = [];
|
|
|
+ let total = 0;
|
|
|
if(this.activeTab === 'notice') {
|
|
|
const res = await noticeDocumentPageV1API({
|
|
|
- pageNum: 1,
|
|
|
+ pageNum: this.currentPage,
|
|
|
size: 5,
|
|
|
approvalStatus: 2
|
|
|
})
|
|
|
console.log('noticeDocumentPageV1API~~~', res);
|
|
|
+ total = res.count || 0;
|
|
|
list = (res.list || []).map((item) => {
|
|
|
// 提取 HTML 中的图片地址
|
|
|
const images = [];
|
|
|
@@ -468,9 +484,9 @@ export default {
|
|
|
while ((match = imgRegex.exec(content)) !== null) {
|
|
|
images.push(match[1]);
|
|
|
}
|
|
|
- // 提取纯文本内容(去除 HTML 标签)
|
|
|
- const textContent = content.replace(/<[^>]+>/g, '').trim();
|
|
|
-
|
|
|
+ // 提取纯文本内容(去除 HTML 标签和空格)
|
|
|
+ const textContent = content.replace(/<[^>]+>/g, '').replace(/\s+/g, '').trim();
|
|
|
+
|
|
|
return {
|
|
|
id: item.id,
|
|
|
title: item.title,
|
|
|
@@ -485,11 +501,12 @@ export default {
|
|
|
list = []
|
|
|
} else if(this.activeTab === 'system') {
|
|
|
const res = await notifyMessagePageAPI({
|
|
|
- pageNum: 1,
|
|
|
+ pageNum: this.currentPage,
|
|
|
size: 5,
|
|
|
// userId: this.user.info.userId,
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
+ total = res.count || 0;
|
|
|
list = (res.list || []).map((item) => {
|
|
|
return {
|
|
|
title: item.templateName,
|
|
|
@@ -500,9 +517,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- this.notifications = list;
|
|
|
- console.log('notifications~~~', this.notifications);
|
|
|
+
|
|
|
+ // 如果是第一页,直接赋值;否则拼接到后面
|
|
|
+ if (this.currentPage === 1) {
|
|
|
+ this.notifications = list;
|
|
|
+ } else {
|
|
|
+ this.notifications = [...this.notifications, ...list];
|
|
|
+ }
|
|
|
+ // 判断是否还有更多数据
|
|
|
+ this.hasMore = this.notifications.length < total;
|
|
|
+ console.log('notifications~~~', this.notifications, 'hasMore:', this.hasMore);
|
|
|
},
|
|
|
async getMyProjectTotal() {
|
|
|
this.myProjectList = await getMyProjectTotal({});
|
|
|
@@ -573,24 +597,27 @@ export default {
|
|
|
this.getMyWorkCalendar();
|
|
|
},
|
|
|
handleTabClick() {
|
|
|
- // 切换标签页时重置页码
|
|
|
- // this.currentPage = 1;
|
|
|
+ // 切换标签页时重置页码和hasMore
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.hasMore = true;
|
|
|
+ this.notifications = [];
|
|
|
this.getMessageList();
|
|
|
},
|
|
|
loadMoreNotifications() {
|
|
|
// 加载更多通知(增加页码)
|
|
|
- // this.currentPage++;
|
|
|
- switch(this.activeTab) {
|
|
|
- case 'notice':
|
|
|
- this.handelRouterTo('/page-wt/documents/noticeIssuance');
|
|
|
- break;
|
|
|
- case 'industry':
|
|
|
- this.handelRouterTo('/industry');
|
|
|
- break;
|
|
|
- case 'system':
|
|
|
- this.handelRouterTo('/page-wt/message');
|
|
|
- break;
|
|
|
- }
|
|
|
+ this.currentPage++;
|
|
|
+ this.getMessageList();
|
|
|
+ // switch(this.activeTab) {
|
|
|
+ // case 'notice':
|
|
|
+ // this.handelRouterTo('/page-wt/documents/noticeIssuance');
|
|
|
+ // break;
|
|
|
+ // case 'industry':
|
|
|
+ // this.handelRouterTo('/industry');
|
|
|
+ // break;
|
|
|
+ // case 'system':
|
|
|
+ // this.handelRouterTo('/page-wt/message');
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
},
|
|
|
// 获取当天所在周的范围,周一开头
|
|
|
getWeekRange() {
|
|
|
@@ -837,6 +864,8 @@ export default {
|
|
|
display: grid;
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
grid-gap: 10px;
|
|
|
+ max-height: 45px;
|
|
|
+ overflow-y: auto;
|
|
|
.overview-bottom-item {
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
@@ -1080,7 +1109,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.notification-text {
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 14px;
|
|
|
// color: #333;
|
|
|
line-height: 1.4;
|
|
|
flex: 1;
|
|
|
@@ -1118,7 +1147,7 @@ export default {
|
|
|
.notification-more {
|
|
|
text-align: right;
|
|
|
margin-top: 12px;
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 15px;
|
|
|
color: #1890ff;
|
|
|
cursor: pointer;
|
|
|
&:hover {
|