|
@@ -520,14 +520,15 @@ const pmShare = (function () {
|
|
const col = headers.findIndex(item => item.dataCode === 'shareDate');
|
|
const col = headers.findIndex(item => item.dataCode === 'shareDate');
|
|
const sheet = spreadObj.workBook.getActiveSheet();
|
|
const sheet = spreadObj.workBook.getActiveSheet();
|
|
const style = new GC.Spread.Sheets.Style();
|
|
const style = new GC.Spread.Sheets.Style();
|
|
- //style.foreColor = foreColor;
|
|
|
|
- markReadProjectIDs.forEach(projectID => {
|
|
|
|
- SHARE_TO.removeUnread(projectID, unreadList);
|
|
|
|
- tree.items.forEach(node => {
|
|
|
|
- if (node.data && node.data.actualTreeInfo && node.data.actualTreeInfo.ID === projectID) {
|
|
|
|
- const row = node.serialNo();
|
|
|
|
- sheet.setStyle(row, col, style);
|
|
|
|
- }
|
|
|
|
|
|
+ projTreeObj.renderSheetFuc(sheet, function () {
|
|
|
|
+ markReadProjectIDs.forEach(projectID => {
|
|
|
|
+ SHARE_TO.removeUnread(projectID, unreadList);
|
|
|
|
+ tree.items.forEach(node => {
|
|
|
|
+ if (node.data && node.data.actualTreeInfo && node.data.actualTreeInfo.ID === projectID) {
|
|
|
|
+ const row = node.serialNo();
|
|
|
|
+ sheet.setStyle(row, col, style);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -985,7 +986,7 @@ const pmShare = (function () {
|
|
showTreeData(tree.items, headers);
|
|
showTreeData(tree.items, headers);
|
|
}
|
|
}
|
|
// 处理清除
|
|
// 处理清除
|
|
- function handleCancelShare(cancelProjID, callback) {
|
|
|
|
|
|
+ /* function handleCancelShare(cancelProjID, callback) {
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
CommonAjax.post('/pm/api/share', {user_id: userID, type: oprType.cancel, projectID: cancelProjID, shareData:[{userID: userID}]}, function (rstData) {
|
|
CommonAjax.post('/pm/api/share', {user_id: userID, type: oprType.cancel, projectID: cancelProjID, shareData:[{userID: userID}]}, function (rstData) {
|
|
const node = tree.items.find(item => item.data.actualTreeInfo && item.data.actualTreeInfo.ID === cancelProjID);
|
|
const node = tree.items.find(item => item.data.actualTreeInfo && item.data.actualTreeInfo.ID === cancelProjID);
|
|
@@ -1019,6 +1020,32 @@ const pmShare = (function () {
|
|
}, function () {
|
|
}, function () {
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
});
|
|
});
|
|
|
|
+ } */
|
|
|
|
+ function handleCancelShare(cancelProjID) {
|
|
|
|
+ const node = tree.items.find(item => item.data.actualTreeInfo && item.data.actualTreeInfo.ID === cancelProjID);
|
|
|
|
+ if (node) {
|
|
|
|
+ tree.removeNode(node);
|
|
|
|
+ }
|
|
|
|
+ //更新与清除节点数据相同,且未被清除缓存分享信息
|
|
|
|
+ updateAfterCancel(userID, cancelProjID);
|
|
|
|
+ //重新设置actualIDShareInfo,以正确更新权限(清除了分享信息后,可能会导致权限变化 eg:清除了新的分享,则存留的分享项目采用旧的)
|
|
|
|
+ actualIDShareInfo = {};
|
|
|
|
+ let treeDatas = [];
|
|
|
|
+ for (let item of tree.items) {
|
|
|
|
+ treeDatas.push(item.data);
|
|
|
|
+ let actualTreeInfo = item.data.actualTreeInfo;
|
|
|
|
+ if (actualTreeInfo && !actualIDShareInfo[actualTreeInfo.ID]) {
|
|
|
|
+ actualIDShareInfo[actualTreeInfo.ID] = {
|
|
|
|
+ ID: actualTreeInfo.ID,
|
|
|
|
+ ParentID: actualTreeInfo.ParentID,
|
|
|
|
+ NextSiblingID: actualTreeInfo.NextSiblingID,
|
|
|
|
+ shareInfo: item.data.shareInfo
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //重新设置权限
|
|
|
|
+ setPermissionsInfo(treeDatas);
|
|
|
|
+ showTreeData(tree.items, headers);
|
|
}
|
|
}
|
|
//事件监听器
|
|
//事件监听器
|
|
//@return void
|
|
//@return void
|
|
@@ -1095,12 +1122,20 @@ const pmShare = (function () {
|
|
});
|
|
});
|
|
//清除分享
|
|
//清除分享
|
|
$('#cancelShareConfirm').click(function (data) {
|
|
$('#cancelShareConfirm').click(function (data) {
|
|
|
|
+ $.bootstrapLoading.start();
|
|
const cancelProjID = tree.selected.data.actualTreeInfo.ID;
|
|
const cancelProjID = tree.selected.data.actualTreeInfo.ID;
|
|
- handleCancelShare(cancelProjID, () => {
|
|
|
|
|
|
+ const permissionType = commonConstants.SharePermissionChangeType.CANCEL;
|
|
|
|
+ CommonAjax.post('/pm/api/share', { user_id: userID, type: oprType.cancel, permissionType, projectID: cancelProjID, shareData: [{ userID: userID }] }, function (rstData) {
|
|
|
|
+ handleCancelShare(cancelProjID);
|
|
|
|
+
|
|
// 推送已打开的项目,通知已取消分享
|
|
// 推送已打开的项目,通知已取消分享
|
|
- SHARE_TO.emitPermissionChange(commonConstants.SharePermissionChangeType.CANCEL, userID, cancelProjID, data.emitTenders);
|
|
|
|
|
|
+ SHARE_TO.emitPermissionChange(permissionType, userID, cancelProjID, rstData.emitTenders);
|
|
// 清除已读
|
|
// 清除已读
|
|
SHARE_TO.removeUnread(cancelProjID, unreadShareList);
|
|
SHARE_TO.removeUnread(cancelProjID, unreadShareList);
|
|
|
|
+
|
|
|
|
+ $.bootstrapLoading.end();
|
|
|
|
+ }, function () {
|
|
|
|
+ $.bootstrapLoading.end();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|