Browse Source

fix: 时间轴小红点、导出

test2
xuesinan 4 years ago
parent
commit
5ed569182a
  1. 1
      CHANGELOG.md
  2. 190
      components/PrettyExchange/PrettyExchange.vue
  3. 40
      components/Projects/ProjectItem.vue
  4. 61
      components/Roles/Roles.vue
  5. 60
      pages/project/project.vue
  6. 3
      plugins/p-deliver-check/check-form-modal.vue

1
CHANGELOG.md

@ -118,6 +118,7 @@
交付物 | 重构交付物审核部分,修复审核bug | [5fd8889](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/5fd8889) 交付物 | 重构交付物审核部分,修复审核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) - | 解决默认角色不是第一个时显示出错问题 | [8dba578](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dba578)
- | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079) - | 解决warning | [dcb0079](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/dcb0079)
- | 没有新消息双击按照上一个角色的任务id跳转的问题 | [eade2dd](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/eade2dd)
- | 拍照上传交付物 | [1cbb2ac](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1cbb2ac) - | 拍照上传交付物 | [1cbb2ac](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1cbb2ac)
- | 切换项目存储的任务id未清空 | [77fe17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/77fe17f) - | 切换项目存储的任务id未清空 | [77fe17f](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/77fe17f)
- | 切换项目任务清空 | [1dd3b4b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1dd3b4b) - | 切换项目任务清空 | [1dd3b4b](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1dd3b4b)

190
components/PrettyExchange/PrettyExchange.vue

@ -26,7 +26,6 @@
class="cu-item flex-col" class="cu-item flex-col"
v-for="(item, index) in data.itemList" v-for="(item, index) in data.itemList"
> >
<view class="border-100 bg-blue-500" v-if="item.showTopBorder"></view> <view class="border-100 bg-blue-500" v-if="item.showTopBorder"></view>
<!-- 内容区 --> <!-- 内容区 -->
@ -53,8 +52,20 @@
<!-- 箭头 --> <!-- 箭头 -->
<view v-if="item.sonProjectList && item.sonProjectList.length"> <view v-if="item.sonProjectList && item.sonProjectList.length">
<u-icon @click="openSubProject(item.sonProjectList.length, index)" class="text-gray-400" name="arrow-up" size="14px" v-if="item.show"></u-icon> <u-icon
<u-icon @click="openSubProject(item.sonProjectList.length, index)" class="text-gray-400" name="arrow-down" size="14px" v-else></u-icon> @click="openSubProject(item.sonProjectList.length, index)"
class="text-gray-400"
name="arrow-up"
size="14px"
v-if="item.show"
></u-icon>
<u-icon
@click="openSubProject(item.sonProjectList.length, index)"
class="text-gray-400"
name="arrow-down"
size="14px"
v-else
></u-icon>
</view> </view>
<u-icon class="text-gray-400" name="arrow-right" size="14px" v-else></u-icon> <u-icon class="text-gray-400" name="arrow-right" size="14px" v-else></u-icon>
</view> </view>
@ -67,10 +78,10 @@
:key="subIndex" :key="subIndex"
@touchend.stop.prevent="stops($event, index + '-' + subIndex, item.sonProjectList.length)" @touchend.stop.prevent="stops($event, index + '-' + subIndex, item.sonProjectList.length)"
@touchmove.stop.prevent="move($event, item.sonProjectList.length)" @touchmove.stop.prevent="move($event, item.sonProjectList.length)"
@touchstart.stop.prevent="start($event, index + '-' + subIndex)" class="cu-item flex-col" @touchstart.stop.prevent="start($event, index + '-' + subIndex)"
class="cu-item flex-col"
v-for="(subItem, subIndex) in item.sonProjectList" v-for="(subItem, subIndex) in item.sonProjectList"
> >
<view class="flex items-center justify-between p-3 w-full"> <view class="flex items-center justify-between p-3 w-full">
<u-icon class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon> <u-icon class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon>
@ -88,7 +99,8 @@
? 'text-red-400 bg-red-100' ? 'text-red-400 bg-red-100'
: 'text-gray-400 bg-gray-100' : 'text-gray-400 bg-gray-100'
" "
class="px-2 text-xs text-gray-400 bg-gray-100 rounded-full flex-shrink-0"> class="px-2 text-xs text-gray-400 bg-gray-100 rounded-full flex-shrink-0"
>
{{ subItem.status === 0 ? '未开始' : subItem.status === 1 ? '进行中' : subItem.status === 2 ? '暂停' : '已完成' }} {{ subItem.status === 0 ? '未开始' : subItem.status === 1 ? '进行中' : subItem.status === 2 ? '暂停' : '已完成' }}
</view> </view>
</view> </view>
@ -123,9 +135,9 @@
<script setup> <script setup>
import { reactive, onMounted, watch, computed } from 'vue'; import { reactive, onMounted, watch, computed } from 'vue';
import ProjectItem from '@/components/Projects/ProjectItem.vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import ProjectItem from '@/components/Projects/ProjectItem.vue';
const store = useStore(); const store = useStore();
const projects = computed(() => store.state.project.projects); const projects = computed(() => store.state.project.projects);
@ -148,9 +160,12 @@
setSubItem: false, // setSubItem: false, //
changeEvent: false, // changeEvent: false, //
showMenu: false, showMenu: false,
tips: { text: '', color: '#909399', fontSize: 28, }, tips: { text: '', color: '#909399', fontSize: 28 },
clickProject: {},
projectId: 0, projectId: 0,
menuList: [{ text: '复制' }, { text: '编辑' }, { text: '删除' }, { text: '置顶' }, { text: '排序' }], // menuList: [{ text: '' }, { text: '' }, { text: '' }, { text: '' }, { text: '' }],
menuList: [{ text: '导出' }, { text: '删除' }],
// show: false, // show: false,
// border: 'border border-blue-500 shadow rounded-md', // border: 'border border-blue-500 shadow rounded-md',
showBorder: false, // showBorder: false, //
@ -175,11 +190,11 @@
if (remind_data.data.projectId === item.id) { if (remind_data.data.projectId === item.id) {
item.remindNum++; item.remindNum++;
} }
}) });
} }
}); });
} }
}) });
onMounted(() => { onMounted(() => {
data.itemList = projects.value; data.itemList = projects.value;
@ -192,7 +207,7 @@
// //
function openSubProject(length, index) { function openSubProject(length, index) {
store.commit('project/setProjectItemShow', { index, show: data.itemList[index].show ? false : true }); store.commit('project/setProjectItemShow', { index, show: !data.itemList[index].show });
if (length && index) { if (length && index) {
emit('changeHeight', length, index); emit('changeHeight', length, index);
} }
@ -201,27 +216,36 @@
// //
function getDate() { function getDate() {
const query = uni.createSelectorQuery().select(`#cu-0`).fields({ const query = uni
.createSelectorQuery()
.select('#cu-0')
.fields(
{
id: true, id: true,
dataset: true, dataset: true,
rect: true, rect: true,
size: true size: true,
}, res => { },
res => {
data.begintop = res.top; data.begintop = res.top;
data.beginleft = res.left; data.beginleft = res.left;
}).exec(); },
)
.exec();
} }
function setData(flag, projectId, tips) { function setData(flag, project, tips) {
data.showMenu = flag; data.showMenu = flag;
data.projectId = projectId; data.projectId = project.id;
data.tips = tips; data.tips = tips;
data.clickProject = project;
} }
function chooseAction(e) { function chooseAction(e) {
let obj = { const obj = {
index: e, index: e,
projectId: data.projectId projectId: data.projectId,
url: data.clickProject.url,
}; };
// emit('chooseAction', data); // emit('chooseAction', data);
actionFun(obj); actionFun(obj);
@ -229,7 +253,7 @@
// //
function actionFun(obj) { function actionFun(obj) {
let action = data.menuList[obj.index].text; const action = data.menuList[obj.index].text;
if (action === '排序') { if (action === '排序') {
data.changeEvent = true; data.changeEvent = true;
uni.$ui.showToast('请移动进行排序'); uni.$ui.showToast('请移动进行排序');
@ -240,10 +264,15 @@
delProject(obj.projectId); delProject(obj.projectId);
} }
if (action === '导出') {
data.changeEvent = false;
exportProject(obj.projectId, obj.url);
}
if (data.showItemIndex !== undefined) { if (data.showItemIndex !== undefined) {
store.commit('project/setProjectItemShow', { store.commit('project/setProjectItemShow', {
index: data.showItemIndex, index: data.showItemIndex,
show: true show: true,
}); });
} }
} }
@ -258,46 +287,67 @@
getDate(); getDate();
}, 300); }, 300);
if (isNumber(index)) { // if (isNumber(index)) {
//
data.setSubItem = false; data.setSubItem = false;
const query = uni.createSelectorQuery().select(`#cu-${index}`).fields({ const query = uni
.createSelectorQuery()
.select(`#cu-${index}`)
.fields(
{
id: true, id: true,
dataset: true, dataset: true,
rect: true, rect: true,
size: true size: true,
}, res => { },
res => {
data.moveTop = res.top; data.moveTop = res.top;
data.moveLeft = res.left; data.moveLeft = res.left;
data.moveItem = data.itemList[index]; data.moveItem = data.itemList[index];
data.itemWidth = res.width; data.itemWidth = res.width;
data.itemHeight = res.height; data.itemHeight = res.height;
}).exec(); },
} else { // )
let arr = index.split('-'); .exec();
} else {
//
const arr = index.split('-');
data.setSubItem = true; data.setSubItem = true;
const query = uni.createSelectorQuery(); const query = uni.createSelectorQuery();
query.select(`#cu-${arr[0] - 0}`).fields({ query
.select(`#cu-${arr[0] - 0}`)
.fields(
{
id: true, id: true,
dataset: true, dataset: true,
rect: true, rect: true,
size: true size: true,
}, res => { },
res => {
data.itemHeight = res.height; data.itemHeight = res.height;
}).exec(); },
)
.exec();
query.select(`#cu-${index}`).fields({ query
.select(`#cu-${index}`)
.fields(
{
id: true, id: true,
dataset: true, dataset: true,
rect: true, rect: true,
size: true size: true,
}, res => { },
res => {
data.moveTop = res.top; data.moveTop = res.top;
data.moveLeft = res.left; data.moveLeft = res.left;
data.moveItem = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0]; data.moveItem = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0];
data.itemWidth = res.width; data.itemWidth = res.width;
data.subItemHeight = res.height; data.subItemHeight = res.height;
}).exec(); },
)
.exec();
} }
} }
@ -313,7 +363,7 @@
data.moveLeft = touch.pageX - data.deltaLeft; data.moveLeft = touch.pageX - data.deltaLeft;
data.moveTop = touch.pageY - data.deltaTop; data.moveTop = touch.pageY - data.deltaTop;
let lastIndex = findOverIndex(touch.pageY, length); const lastIndex = findOverIndex(touch.pageY, length);
// 线 // 线
for (let i = 0; i < data.itemList.length; i++) { for (let i = 0; i < data.itemList.length; i++) {
if (data.moveLeft > 35) { if (data.moveLeft > 35) {
@ -324,8 +374,7 @@
} else { } else {
data.itemList[i].showSubBorder = false; data.itemList[i].showSubBorder = false;
} }
} else { } else if (lastIndex === -1) {
if (lastIndex === -1) {
data.itemList[0].showTopBorder = true; data.itemList[0].showTopBorder = true;
data.itemList[i].showSubBorder = false; data.itemList[i].showSubBorder = false;
data.itemList[i].showBorder = false; data.itemList[i].showBorder = false;
@ -340,24 +389,23 @@
} }
} }
} }
}
function stops(e, index, length) { function stops(e, index, length) {
console.log('结束'); console.log('结束');
const touch = e.changedTouches[0]; const touch = e.changedTouches[0];
let lastIndex = findOverIndex(touch.pageY, length); const lastIndex = findOverIndex(touch.pageY, length);
// //
for (let i = 0; i < data.itemList.length; i++) { for (let i = 0; i < data.itemList.length; i++) {
// //
if (data.itemList[i].showTopBorder) { if (data.itemList[i].showTopBorder) {
if (isNumber(index)) { if (isNumber(index)) {
let Value = data.itemList[index]; const Value = data.itemList[index];
data.itemList.unshift(Value); data.itemList.unshift(Value);
data.itemList.splice(index + 1, 1); data.itemList.splice(index + 1, 1);
} else { } else {
let arr = index.split('-'); const arr = index.split('-');
let Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0]; const Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0];
data.itemList.unshift(Value); data.itemList.unshift(Value);
data.itemList[arr[0] - 0].sonProjectList.splice([arr[1] - 0], 1); data.itemList[arr[0] - 0].sonProjectList.splice([arr[1] - 0], 1);
const options = { const options = {
@ -374,7 +422,7 @@
// //
if (data.itemList[i].showBorder) { if (data.itemList[i].showBorder) {
if (isNumber(index)) { if (isNumber(index)) {
let Value = data.itemList[index]; const Value = data.itemList[index];
data.itemList.splice(i + 1, 0, Value); data.itemList.splice(i + 1, 0, Value);
if (i < index) { if (i < index) {
data.itemList.splice(index + 1, 1); data.itemList.splice(index + 1, 1);
@ -382,8 +430,8 @@
data.itemList.splice(index, 1); data.itemList.splice(index, 1);
} }
} else { } else {
let arr = index.split('-'); const arr = index.split('-');
let Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0]; const Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0];
data.itemList.splice(i + 1, 0, Value); data.itemList.splice(i + 1, 0, Value);
data.itemList[arr[0] - 0].sonProjectList.splice([arr[1] - 0], 1); data.itemList[arr[0] - 0].sonProjectList.splice([arr[1] - 0], 1);
const options = { const options = {
@ -400,7 +448,7 @@
// //
if (data.itemList[i].showSubBorder) { if (data.itemList[i].showSubBorder) {
if (isNumber(index)) { if (isNumber(index)) {
let Value = data.itemList[index]; const Value = data.itemList[index];
if (data.itemList[lastIndex - 1].sonProjectList && data.itemList[lastIndex - 1].sonProjectList.length) { if (data.itemList[lastIndex - 1].sonProjectList && data.itemList[lastIndex - 1].sonProjectList.length) {
data.itemList[lastIndex - 1].sonProjectList.push(Value); data.itemList[lastIndex - 1].sonProjectList.push(Value);
} else { } else {
@ -415,8 +463,8 @@
}; };
emit('change', options); emit('change', options);
} else { } else {
let arr = index.split('-'); const arr = index.split('-');
let Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0]; const Value = data.itemList[arr[0] - 0].sonProjectList[arr[1] - 0];
if (data.itemList[lastIndex].sonProjectList && data.itemList[lastIndex].sonProjectList.length) { if (data.itemList[lastIndex].sonProjectList && data.itemList[lastIndex].sonProjectList.length) {
data.itemList[lastIndex].sonProjectList.push(Value); data.itemList[lastIndex].sonProjectList.push(Value);
} else { } else {
@ -457,13 +505,13 @@
// //
function findOverIndex(posY) { function findOverIndex(posY) {
// //
let leng = data.itemList.length * data.itemHeight; // const leng = data.itemList.length * data.itemHeight; //
if (posY < data.begintop) { if (posY < data.begintop) {
return -1; return -1;
} }
for (var i = 0; i < data.itemList.length; i++) { for (let i = 0; i < data.itemList.length; i++) {
let begin = data.itemHeight * i + data.begintop; const begin = data.itemHeight * i + data.begintop;
let end = data.itemHeight * i + data.begintop + data.itemHeight; const end = data.itemHeight * i + data.begintop + data.itemHeight;
if (begin <= posY && end >= posY) { if (begin <= posY && end >= posY) {
return i; return i;
} }
@ -471,7 +519,8 @@
if (posY > leng) { if (posY > leng) {
// //
return data.itemList.length - 1; return data.itemList.length - 1;
} else if (posY < data.begintop) { }
if (posY < data.begintop) {
return 0; return 0;
} }
} }
@ -482,9 +531,7 @@
title: '', title: '',
content: '是否删除项目?', content: '是否删除项目?',
showCancel: true, showCancel: true,
success: async ({ success: async ({ confirm }) => {
confirm
}) => {
if (confirm) { if (confirm) {
await uni.$u.api.delProject(id); await uni.$u.api.delProject(id);
let flag_index = 0; let flag_index = 0;
@ -501,11 +548,24 @@
}); });
} }
function exportProject(id, url) {
uni.showModal({
title: '',
content: '是否导出项目?',
showCancel: true,
success: async ({ confirm }) => {
if (confirm) {
const data = await uni.$u.post(`${url}/tall/project/exportWbs`, { projectId: id });
// console.log('data', data);
window.location.href = data.url;
}
},
});
}
// //
function toWorkbench() { function toWorkbench() {
uni.navigateTo({ uni.navigateTo({ url: '/pages/workbench/workbench' });
url: '/pages/workbench/workbench'
})
} }
</script> </script>
@ -535,10 +595,10 @@
line-height: 36px; line-height: 36px;
border-radius: 18px; border-radius: 18px;
overflow: hidden; overflow: hidden;
border: 1px solid #2B85E4; border: 1px solid #2b85e4;
background-color: #1890FF; background-color: #1890ff;
font-size: 12px; font-size: 12px;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
} }
</style> </style>

40
components/Projects/ProjectItem.vue

@ -2,7 +2,7 @@
<view class="w-full"> <view class="w-full">
<!-- 有子项目 父项目 --> <!-- 有子项目 父项目 -->
<view class="flex items-center justify-between p-3"> <view class="flex items-center justify-between p-3">
<u-icon @click="openMenu(item)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon> <u-icon @click="openMenu(item, index)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon>
<view @click="openProject(item)" class="flex-1 px-3"> <view @click="openProject(item)" class="flex-1 px-3">
<view class="flex items-center mb-1"> <view class="flex items-center mb-1">
@ -24,15 +24,32 @@
<!-- 箭头 --> <!-- 箭头 -->
<view v-if="item.sonProjectList && item.sonProjectList.length"> <view v-if="item.sonProjectList && item.sonProjectList.length">
<u-icon @click="emit('openSubProject', item.sonProjectList.length, index)" class="text-gray-400" name="arrow-up" size="14px" v-if="item.show"></u-icon> <u-icon
<u-icon @click="emit('openSubProject', item.sonProjectList.length, index)" class="text-gray-400" name="arrow-down" size="14px" v-else></u-icon> @click="emit('openSubProject', item.sonProjectList.length, index)"
class="text-gray-400"
name="arrow-up"
size="14px"
v-if="item.show"
></u-icon>
<u-icon
@click="emit('openSubProject', item.sonProjectList.length, index)"
class="text-gray-400"
name="arrow-down"
size="14px"
v-else
></u-icon>
</view> </view>
<u-icon @click="openProject(item)" class="text-gray-400" name="arrow-right" size="14px" v-else></u-icon> <u-icon @click="openProject(item)" class="text-gray-400" name="arrow-right" size="14px" v-else></u-icon>
</view> </view>
<!-- 子项目 --> <!-- 子项目 -->
<view class="ml-8" v-if="item.show"> <view class="ml-8" v-if="item.show">
<view :id="'cu-' + index + '-' + subIndex" :key="subIndex" class="cu-item flex-col" v-for="(subItem, subIndex) in item.sonProjectList"> <view
:id="'cu-' + index + '-' + subIndex"
:key="subIndex"
class="cu-item flex-col"
v-for="(subItem, subIndex) in item.sonProjectList"
>
<!-- <view :key="subItem.id" v-for="subItem in item.sonProjectList"> --> <!-- <view :key="subItem.id" v-for="subItem in item.sonProjectList"> -->
<view class="flex items-center justify-between p-3"> <view class="flex items-center justify-between p-3">
<u-icon @click="openMenu(subItem)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon> <u-icon @click="openMenu(subItem)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon>
@ -106,9 +123,7 @@ const data = reactive({
// //
function toWorkbench() { function toWorkbench() {
uni.navigateTo({ uni.navigateTo({ url: '/pages/workbench/workbench' });
url: '/pages/workbench/workbench'
});
} }
// //
@ -127,12 +142,13 @@ function openProject(project) {
/** /**
* 弹出项目操作面板 * 弹出项目操作面板
*/ */
function openMenu(project) { function openMenu(project, index) {
if (index === 0) return;
data.showMenu = true; data.showMenu = true;
data.projectId = project.id; data.projectId = project.id;
data.tips.text = project.name; data.tips.text = project.name;
emit('setData', data.showMenu, data.projectId, data.tips); emit('setData', data.showMenu, project, data.tips);
} }
</script> </script>
@ -154,10 +170,10 @@ function openMenu(project) {
line-height: 36px; line-height: 36px;
border-radius: 18px; border-radius: 18px;
overflow: hidden; overflow: hidden;
border: 1px solid #2B85E4; border: 1px solid #2b85e4;
background-color: #1890FF; background-color: #1890ff;
font-size: 12px; font-size: 12px;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
} }

61
components/Roles/Roles.vue

@ -58,7 +58,8 @@ const store = useStore();
const getTasksHook = useGetTasks(); const getTasksHook = useGetTasks();
const visibleRoles = computed(() => store.state.role.visibleRoles); const visibleRoles = computed(() => store.state.role.visibleRoles);
const roleId = computed(() => store.state.role.roleId); const roleId = computed(() => store.state.role.roleId);
const tasks = computed(() => store.state.task.tasks); // const tasks = computed(() => store.state.task.tasks);
const allTasks = computed(() => store.state.task.allTasks); //
const remindData = computed(() => store.state.socket.remindData); // const remindData = computed(() => store.state.socket.remindData); //
const currLocationTaskId = computed(() => store.state.socket.currLocationTaskId); // id const currLocationTaskId = computed(() => store.state.socket.currLocationTaskId); // id
@ -79,6 +80,64 @@ watchEffect(() => {
data.roles = visibleRoles.value; data.roles = visibleRoles.value;
data.loading = false; data.loading = false;
} }
if (allTasks.value.length > 0) {
allTasks.value.forEach(item => {
if (item.global) {
item.global.forEach(global => {
global.remindNum = 0;
global.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (item.role.id === remind_data.data.roleId) {
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 (item.task) {
item.task.forEach(task => {
task.remindNum = 0;
if (task.plugins) {
task.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (item.role.id === remind_data.data.roleId) {
if (remind_data.data.taskId === task.id) {
task.remindNum++;
}
if (remind_data.data.taskId === task.id && remind_data.data.pluginId === plugin.pluginTaskId) {
plugin.remindNum++;
}
}
});
});
});
}
});
}
});
}
store.commit('task/setAllTasks', allTasks.value);
}); });
onMounted(() => { onMounted(() => {

60
pages/project/project.vue

@ -74,66 +74,6 @@ if (!userInfo.value) {
} }
} }
watch([allTasks, remindData], () => {
if (allTasks.value.length > 0) {
allTasks.value.forEach(item => {
if (item.global) {
item.global.forEach(global => {
global.remindNum = 0;
global.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (item.role.id === remind_data.data.roleId) {
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 (item.task) {
item.task.forEach(task => {
task.remindNum = 0;
if (task.plugins) {
task.plugins.forEach(pluginArr => {
pluginArr.forEach(plugin => {
plugin.remindNum = 0;
remindData.value.forEach(remind => {
const remind_data = JSON.parse(remind.data);
if (item.role.id === remind_data.data.roleId) {
if (remind_data.data.taskId === task.id) {
task.remindNum++;
}
if (remind_data.data.taskId === task.id && remind_data.data.pluginId === plugin.pluginTaskId) {
plugin.remindNum++;
}
}
});
});
});
}
});
}
});
}
store.commit('task/setAllTasks', allTasks.value);
});
/** /**
* 当角色发生变化时 * 当角色发生变化时
* 重新查询永久日常任务和普通日常任务 * 重新查询永久日常任务和普通日常任务

3
plugins/p-deliver-check/check-form-modal.vue

@ -57,7 +57,6 @@ watch(remindData, () => {
if (remind_data.data.taskId === task.id) { if (remind_data.data.taskId === task.id) {
msgId.value = remind.id; msgId.value = remind.id;
console.log('交付物检查弹框', msgId.value)
} }
}) })
}) })
@ -79,7 +78,7 @@ async function handleSubmit(mode) {
score: mode === 'RESOLVE' ? score.value : '', score: mode === 'RESOLVE' ? score.value : '',
msgId: msgId.value msgId: msgId.value
}; };
console.log('交付物审核', param, msgId.value)
await uni.$u.api.checkDeliver(param); await uni.$u.api.checkDeliver(param);
handleHide(); // + handleHide(); // +
uni.$ui.showToast('审核信息提交成功'); uni.$ui.showToast('审核信息提交成功');

Loading…
Cancel
Save