Browse Source

fix: 小红点、上传项目刷新项目列表

小红点、上传项目刷新项目列表、项目状态、交付物历史记录、lwbs跳转之后关闭其他页面
test2
xuesinan 3 years ago
parent
commit
02d933e62b
  1. 3
      CHANGELOG.md
  2. 2
      components/Projects/ProjectItem.vue
  3. 2
      components/Title/Title.vue
  4. 3
      components/Upload/Upload.vue
  5. 4
      pages/business/business.vue
  6. 8
      pages/index/index.vue
  7. 74
      pages/project/project.vue
  8. 22
      plugins/p-deliver-check/p-deliver-check.vue
  9. 2
      plugins/p-deliver-upload/p-deliver-upload.vue
  10. 2
      plugins/p-task-to-detail/p-task-to-detail.vue
  11. 4
      store/project/mutations.js
  12. 1
      store/project/state.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 1.0.0 (2022-03-23)
# 1.0.0 (2022-03-24)
### 🌟 新功能
范围|描述|commitId
@ -38,6 +38,7 @@
- | 刻度模式时间轴 | [a9bc53a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a9bc53a)
- | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6)
- | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91)
- | 删除项目 | [f43d4ba](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/f43d4ba)
- | 上传新项目结果提示 | [2625734](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/2625734)
- | 设置项目域名 | [1a835f1](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1a835f1)
- | 设置状态栏 | [9871356](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9871356)

2
components/Projects/ProjectItem.vue

@ -8,7 +8,7 @@
<view class="flex items-center" :class="{'mb-1': index > 0}">
<view class="mr-2">{{ item.name }}</view>
<!-- 状态 TODO:-->
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full flex-shrink-0">进行中</view>
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full flex-shrink-0">{{item.status === 1 ? '进行中' : item.status === 2 ? '已结束' : item.status === 0 ? '未开始' : '暂停'}}</view>
</view>
<view v-if="index > 0" class="flex items-center text-xs text-gray-400">

2
components/Title/Title.vue

@ -103,7 +103,7 @@ function onBack() {
} else {
// this.$u.route('/', { u: this.userId });
// uni.reLaunch({ url: `/pages/index/index?u=${userId.value}` });
uni.reLaunch({ url: `/pages/index/index` });
uni.reLaunch({ url: `/pages/index/index` });
}
}

3
components/Upload/Upload.vue

@ -50,6 +50,9 @@
const { apiUrl } = Config;
let defaultwbs = `${apiUrl}/defaultwbs`;
res.url && (defaultwbs = res.url);
store.commit('project/setIsRefresh', 1);
setTimeout(() => {
uni.navigateTo({ url: `/pages/project/project?u=${user.value.id}&p=${res.id}&pname=${res.name}&url=${encodeURIComponent(res.url)}` });
}, 2000);

4
pages/business/business.vue

@ -58,7 +58,9 @@ async function toUpload(url) {
const { apiUrl } = Config;
let defaultwbs = `${apiUrl}/defaultwbs`;
res.url && (defaultwbs = res.url);
store.commit('project/setIsRefresh', 1);
setTimeout(() => {
uni.navigateTo({ url: `/pages/project/project?u=${user.value.id}&p=${res.id}&pname=${res.name}&url=${encodeURIComponent(res.url)}` });
}, 2000);

8
pages/index/index.vue

@ -56,6 +56,7 @@
const isOpenApp = computed(() => store.state.isOpenApp); // APP true false
const userInfo = computed(() => store.state.user.user);
const remindData = computed(() => store.state.socket.remindData); //
const isRefresh = computed(() => store.state.project.isRefresh); //
const data = reactive({
calendar: null,
@ -67,7 +68,12 @@
if (!userInfo.value && user) {
store.commit('user/setUser', JSON.parse(user));
}
watch(isRefresh, () => {
getProjects();
store.commit('project/setIsRefresh', 0);
})
/**
* 下拉刷新
*/

74
pages/project/project.vue

@ -86,10 +86,11 @@ onUnmounted(() => {
watch(remindData, () => {
console.log('remindData', remindData.value)
if (remindData.value && visibleRoles.value) {
if (remindData.value) {
if (visibleRoles.value) {
visibleRoles.value.forEach(role => {
role.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (projectId.value === remind_data.data.projectId && remind_data.data.roleId === role.id) {
@ -101,17 +102,57 @@ watch(remindData, () => {
if (allTasks.value.length) {
allTasks.value.forEach(data => {
console.log(data);
if (data.global) {
data.global.forEach(global => {
global.remindNum = 0;
renderRemindData(global, remindData.value);
if (global.plugins && global.plugins.length) {
global.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (remind_data.data.projectId === projectId.value && remind_data.data.roleId === roleId.value) {
if (remind_data.data.taskId === global.id) {
global.remindNum++;
}
if (remind_data.data.taskId === global.id && remind_data.data.pluginId === plugin.pluginTaskId) {
plugin.remindNum++;
}
}
})
})
})
}
})
}
if (data.task) {
data.task.forEach(task => {
renderRemindData(task, remindData.value);
task.remindNum = 0;
if (task.plugins && task.plugins.length) {
task.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (remind_data.data.projectId === projectId.value && remind_data.data.roleId === roleId.value) {
if (remind_data.data.taskId === task.id) {
task.remindNum++;
}
if (remind_data.data.taskId === task.id && remind_data.data.pluginId === plugin.pluginTaskId) {
plugin.remindNum++;
}
}
})
})
})
}
})
}
})
@ -329,31 +370,6 @@ function changeModal() {
const params = { pageNum: 1, taskId: currLocationTaskId.value };
getTasksHook.getTasks(params);
}
function renderRemindData(data, remind) {
data.remindNum = 0;
if (data.plugins && data.plugins.length) {
data.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remind.forEach(item => {
const remind_data = JSON.parse(item.data);
if (remind_data.data.projectId === projectId.value && remind_data.data.projectId === roleId.value) {
if (remind_data.data.taskId === global.id) {
data.remindNum++;
}
if (remind_data.data.taskId === global.id && remind_data.data.pluginId === plugin.pluginTaskId) {
plugin.remindNum++;
}
}
})
})
})
}
}
</script>
<style lang="scss" scoped>

22
plugins/p-deliver-check/p-deliver-check.vue

@ -24,11 +24,14 @@
</view>
<view v-show="collapsed" class="mt-1">
<!-- 提交人和时间信息 -->
<view class="text-gray-400 text-xs">
上传人<text class="mr-4" v-if="deliverData.submitMemberName">{{ deliverData.submitMemberName }}</text>
上传时间
<text v-if="deliverData.submitTime"> {{ dayjs(+deliverData.submitTime).format('MM-DD HH:mm') }}</text>
<view class="flex justify-between items-center">
<!-- 提交人和时间信息 -->
<view class="text-gray-400 text-xs">
<text class="mr-4" v-if="deliverData.submitMemberName">{{ deliverData.submitMemberName }}</text>
<text v-if="deliverData.submitTime"> {{ dayjs(+deliverData.submitTime).format('MM-DD HH:mm') }}</text>
</view>
<text class="text-blue-400 text-xs text-right my-2" @click="openDeliverHistory">历史交付物</text>
</view>
<!-- 提交的链接信息 -->
@ -37,7 +40,7 @@
<!-- 审核人 标题 -->
<view class="text-gray-400 flex justify-between mt-3">
<text>审核</text>
<text class="text-blue-400 text-xs" @click="openMoreRecords">更多记录</text>
<text class="text-blue-400 text-xs" @click="openMoreRecords">更多审核记录</text>
</view>
<!-- 审核人 列表 -->
@ -99,6 +102,13 @@ const checkModal = reactive({
deliverRecordId: () => (deliverData.value ? deliverData.value.deliverRecordId : ''), // id
});
//
function openDeliverHistory() {
const { deliverId } = deliverData.value;
// console.log(deliverId)
uni.navigateTo({ url: `/pages/submitLog/submitLog?deliverId=${deliverId}` });
}
//
function openMoreRecords() {
const { deliverRecordId } = deliverData.value;

2
plugins/p-deliver-upload/p-deliver-upload.vue

@ -29,7 +29,7 @@
</u-button>
<!-- 查看提交历史的按钮 -->
<u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon>
<!-- <u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon> -->
</view>
<!-- 插件上传方式 -->

2
plugins/p-task-to-detail/p-task-to-detail.vue

@ -23,7 +23,7 @@
store.commit('role/setRoleId', '');
const { id, projectId, executorRoleId, businessUrl, businessCode } = task;
uni.navigateTo({ url: `/pages/project/project?p=${projectId}&url=${encodeURIComponent(businessUrl)}&businessCode=${businessCode}&taskId=${id}&roleId=${executorRoleId}` });
uni.reLaunch({ url: `/pages/project/project?p=${projectId}&url=${encodeURIComponent(businessUrl)}&businessCode=${businessCode}&taskId=${id}&roleId=${executorRoleId}` });
}
</script>

4
store/project/mutations.js

@ -57,6 +57,10 @@ const mutations = {
setDotList(state, data) {
state.dotList = data;
},
setIsRefresh(state, data) {
state.isRefresh = data;
}
};
export default mutations;

1
store/project/state.js

@ -3,6 +3,7 @@ const state = {
project: { name: '加载中...' }, // 当前项目信息
projects: [], // 项目列表
dotList: [], // 小红点
isRefresh: 0, // 是否刷新页面
};
export default state;

Loading…
Cancel
Save