Browse Source

fix: 没有新消息双击按照上一个角色的任务id跳转的问题

test2
xuesinan 4 years ago
parent
commit
eade2dde8d
  1. 1
      CHANGELOG.md
  2. 26
      components/Roles/Roles.vue
  3. 31
      pages/project/project.vue

1
CHANGELOG.md

@ -113,6 +113,7 @@
- | 广告页不显示 | [d749dfb](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/d749dfb)
- | 获取c插件信息 | [7b02efc](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/7b02efc)
- | 交付物未上传显示小红点 | [b07621e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b07621e)
- | 交付物消息提示 | [880023a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/880023a)
交付物 | 修复检查人选择组件之间相互影响的bug | [435c0bd](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/435c0bd)
交付物 | 重构交付物审核部分,修复审核bug | [5fd8889](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5fd8889)
- | 解决默认角色不是第一个时显示出错问题 | [8dba578](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dba578)

26
components/Roles/Roles.vue

@ -22,7 +22,9 @@
<view class="tab-children relative u-skeleton-fillet u-font-14">
{{ item.name }}
</view>
<view class="remind-box absolute bg-red-500 text-white text-xs" v-if="item.remindNum">{{ item.remindNum > 99 ? '99+' : item.remindNum }}</view>
<view class="remind-box absolute bg-red-500 text-white text-xs" v-if="item.remindNum">{{
item.remindNum > 99 ? '99+' : item.remindNum
}}</view>
</view>
</view>
</scroll-view>
@ -42,11 +44,14 @@ const data = reactive({
tabList: [], // tab dom
scrollLeft: 0, // scrollview
loading: false, //
roles: [{ id: 1, name: '项目经理', mine: 0, pm: 1, sequence: 1 }, { id: 2, name: '运维', mine: 0, pm: 0, sequence: 2 }],
roles: [
{ id: 1, name: '项目经理', mine: 0, pm: 1, sequence: 1 },
{ id: 2, name: '运维', mine: 0, pm: 0, sequence: 2 },
],
roleLeft: 0,
clickNum: 0,
firstClickTime: 0,
secClickTime: 0
secClickTime: 0,
});
const store = useStore();
@ -66,8 +71,8 @@ watchEffect(() => {
if (remind_data.data.roleId === role.id) {
role.remindNum++;
}
})
})
});
});
}
if (visibleRoles.value && visibleRoles.value.length) {
@ -164,12 +169,12 @@ function changeRole(id, index) {
setTimeout(() => {
data.clickNum = data.firstClickTime = data.secClickTime = 0;
}, 500)
}, 500);
} else if (data.clickNum === 2) {
data.secClickTime = new Date().getTime();
if (data.secClickTime - data.firstClickTime < 500) {
let arr = [];
const arr = [];
remindData.value.forEach(item => {
const remind_data = JSON.parse(item.data);
if (remind_data.data.taskType === 1) {
@ -193,7 +198,7 @@ function changeRole(id, index) {
if (i === arr.length - 1) {
nextLocationTaskId = first_option.data.taskId;
} else {
const next_option = JSON.parse(arr[i+1].data);
const next_option = JSON.parse(arr[i + 1].data);
nextLocationTaskId = next_option.data.taskId;
}
}
@ -205,10 +210,13 @@ function changeRole(id, index) {
store.commit('task/setUpNextPage', 1);
store.commit('task/setDownNextPage', 1);
// store.commit('task/setTimeLineType', timeLineType.value === 1 ? 2 : 1);
let params = { pageNum: 1, taskId: nextLocationTaskId };
if (nextLocationTaskId) {
const params = { pageNum: 1, taskId: nextLocationTaskId };
getTasksHook.getTasks(params);
}
}
}
data.clickNum = data.firstClickTime = data.secClickTime = 0;
}

31
pages/project/project.vue

@ -28,7 +28,9 @@
<!-- <u-button @click="$store.commit('setTheme', 'theme-test')">测试切换主题</u-button> -->
</view>
<u-button style="position: fixed; bottom: 100px;" @click="changeModal">{{timeLineType === 1 ? '切换到任务模式' : '切换到时间轴模式'}}</u-button>
<u-button style="position: fixed; bottom: 100px" @click="changeModal">{{
timeLineType === 1 ? '切换到任务模式' : '切换到时间轴模式'
}}</u-button>
</theme>
</template>
@ -94,10 +96,10 @@ watch([allTasks, remindData], () => {
plugin.remindNum++;
}
}
})
})
})
})
});
});
});
});
}
if (item.task) {
@ -120,14 +122,13 @@ watch([allTasks, remindData], () => {
plugin.remindNum++;
}
}
})
})
})
});
});
});
}
})
});
}
})
});
}
store.commit('task/setAllTasks', allTasks.value);
@ -151,7 +152,8 @@ watch(roleId, () => {
store.commit('task/setTimeNode', Date.now());
let currRoleRealTasks = [], currRoleShowTasks = [];
let currRoleRealTasks = [];
let currRoleShowTasks = [];
if (allTasks.value.length) {
const index = visibleRoles.value.findIndex(role => role.id === roleId.value);
currRoleRealTasks = allTasks.value[index].realTasks || [];
@ -266,11 +268,12 @@ function tabsChange(e) {
const index = visibleRoles.value.findIndex(role => role.id === id);
const arr = [...allTasks.value];
store.commit('task/updateTasks', arr[index].task || []); // store
store.commit('task/updateRealTasks', arr[index].realTasks || []);// store
store.commit('task/updateRealTasks', arr[index].realTasks || []); // store
store.commit('task/setCurrRoleRealTasks', arr[index].realTasks || []); //
store.commit('task/setCurrRoleShowTasks', arr[index].task || []); //
store.commit('task/setUpNextPage', arr[index].upNextPage || 1); //
store.commit('task/setDownNextPage', arr[index].downNextPage || 1); //
store.commit('socket/setCurrLocationTaskId', '');
}
//
@ -305,7 +308,7 @@ function changeModal() {
store.commit('task/setUpNextPage', 1);
store.commit('task/setDownNextPage', 1);
store.commit('task/setTimeLineType', timeLineType.value === 1 ? 2 : 1);
let params = { pageNum: 1, taskId: currLocationTaskId.value };
const params = { pageNum: 1, taskId: currLocationTaskId.value };
getTasksHook.getTasks(params);
}
</script>

Loading…
Cancel
Save