|
|
@@ -3444,14 +3444,13 @@ $('#share-confirm').click(function(){
|
|
|
$('#shareToInfo').height(tbodyTotalHeight);
|
|
|
$('#shareToInfo').append($tr);
|
|
|
//更新缓存
|
|
|
- // if (shareSeleted.data.shareInfo.length === 0) {
|
|
|
- shareSeleted.data.shareInfo = shareSeleted.data.shareInfo.concat(shareData);
|
|
|
- let sheet = projTreeObj.workBook.getSheet(0);
|
|
|
- projTreeObj.renderSheetFuc(sheet, function () {
|
|
|
- sheet.invalidateLayout();
|
|
|
- sheet.repaint();
|
|
|
- });
|
|
|
- // }
|
|
|
+ shareSeleted.data.shareInfo = shareSeleted.data.shareInfo.concat(shareData);
|
|
|
+ let sheet = projTreeObj.workBook.getSheet(0);
|
|
|
+ projTreeObj.renderSheetFuc(sheet, function () {
|
|
|
+ sheet.invalidateLayout();
|
|
|
+ sheet.repaint();
|
|
|
+ });
|
|
|
+ bindCancelShareCheck(shareSeleted);
|
|
|
$.bootstrapLoading.end();
|
|
|
$('#shareFindDiv').hide();
|
|
|
$('#share-confirm').addClass('disabled');
|
|
|
@@ -3460,16 +3459,6 @@ $('#share-confirm').click(function(){
|
|
|
$('#share-confirm').removeClass('disabled');
|
|
|
});
|
|
|
});
|
|
|
-//允许拷贝
|
|
|
-/*$('#allowCopy').change(function () {
|
|
|
- let checked = $(this).prop('checked');
|
|
|
- if(checked){
|
|
|
- $('#allowCopyHint').show();
|
|
|
- }
|
|
|
- else{
|
|
|
- $('#allowCopyHint').hide();
|
|
|
- }
|
|
|
-});*/
|
|
|
|
|
|
//批量替换文件,切换建设项目
|
|
|
$('#otherProject').change(function(){
|
|
|
@@ -3550,6 +3539,29 @@ function setShareToModal(selected){
|
|
|
$('#shareToInfo').height(tbodyTotalHeight);
|
|
|
let infoHtml = infoArr.join('');
|
|
|
$('#shareToInfo').html(infoHtml);
|
|
|
+ bindCancelShareCheck(selected);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//取消分享的勾选操作
|
|
|
+//@param {Object}selected(选中项目节点) @return {void}
|
|
|
+function bindCancelShareCheck(selected) {
|
|
|
+ $('#shareToInfo input[value="cancelShare"]').unbind('click');
|
|
|
+ $('#shareToInfo input[value="cancelShare"]').click(function () {
|
|
|
+ let index = $(this).parent().parent().index() - 1,
|
|
|
+ $coo = $(this).parent().prev().children(),
|
|
|
+ $copy = $(this).parent().prev().prev().children();
|
|
|
+ let isCancel = $(this).prop('checked');
|
|
|
+ if (isCancel) {//取消分享,取消拷贝、协作勾选
|
|
|
+ $coo.prop('checked', false);
|
|
|
+ $copy.prop('checked', false);
|
|
|
+ } else {//取消取消分享,恢复原本的拷贝、协作勾选状态
|
|
|
+ let shareData = selected.data.shareInfo[index];
|
|
|
+ if (shareData) {
|
|
|
+ $coo.prop('checked', shareData.allowCooperate);
|
|
|
+ $copy.prop('checked', shareData.allowCopy);
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
//更新项目分享信息
|
|
|
@@ -3566,7 +3578,7 @@ function updateShareInfo(selected){
|
|
|
orgShareInfo = [];
|
|
|
//数据不同才提交
|
|
|
for (let shareData of selected.data.shareInfo) {
|
|
|
- orgShareInfo.push({userID: shareData.userID, allowCopy: shareData.allowCopy, allowCooperate: shareData.allowCooperate})
|
|
|
+ orgShareInfo.push({userID: shareData.userID, allowCopy: shareData.allowCopy, allowCooperate: shareData.allowCooperate});
|
|
|
}
|
|
|
for(let i = 0; i < usersTr.length; i++){
|
|
|
let userTr = usersTr[i];
|
|
|
@@ -3591,15 +3603,6 @@ function updateShareInfo(selected){
|
|
|
sheet.repaint();
|
|
|
});
|
|
|
});
|
|
|
- /*CommonAjax.post('/pm/api/updateProjects', {user_id: userID, updateData: [{updateType: 'update', updateData: {ID: selected.data.ID, shareInfo: newShareInfo}}]}, function () {
|
|
|
- //todo 更新
|
|
|
- selected.data.shareInfo = newShareInfo;
|
|
|
- let sheet = projTreeObj.workBook.getSheet(0);
|
|
|
- projTreeObj.renderSheetFuc(sheet, function () {
|
|
|
- sheet.invalidateLayout();
|
|
|
- sheet.repaint();
|
|
|
- });
|
|
|
- });*/
|
|
|
}
|
|
|
|
|
|
//刷新建设项目汇总金额信息
|