| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978 | 
							- 'use strict';
 
- /**
 
-  *
 
-  *
 
-  * @author Zhong
 
-  * @date 2018/6/28
 
-  * @version
 
-  */
 
- const pmShare = (function () {
 
-     const spreadDom = $('#shareSpread');
 
-     let spreadObj = {workBook: null, sheet: null};
 
-     //项目分享类型,由别人分享给自己的,和自己分享给别人的
 
-     const shareType = {receive: 'receive', shareTo: 'shareTo'};
 
-     //操作类型
 
-     const oprType = {copy: 'copy', cancel: 'cancel'};
 
-     let tree = null;
 
-     const treeCol = 0;
 
-     const treeSetting = {
 
-         tree: {
 
-             id: 'ID',
 
-             pid: 'ParentID',
 
-             nid: 'NextSiblingID',
 
-             rootId: -1,
 
-             autoUpdate: false
 
-         }
 
-     };
 
-     const headers = [
 
-         {name: '工程列表', dataCode: 'name', width: 300, rateWidth: 0.55, vAlign: 'center', hAlign: 'left'},
 
-         {name: '由...分享', dataCode: 'from', width: 100, rateWidth: 0.15, vAlign: 'center', hAlign: 'left'},
 
-         {name: '拷贝工程', dataCode: 'copy', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},
 
-         {name: '清除', dataCode: 'cancel', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},
 
-         {name: '工程造价', dataCode: 'engineeringCost', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '分部分项合计', dataCode: 'subEngineering', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '措施项目合计', dataCode: 'measure', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '其他项目合计', dataCode: 'other', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '规费', dataCode: 'charge', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '税金', dataCode: 'tax', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '占造价比例(%)', dataCode: 'rate', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '建筑面积', dataCode: 'buildingArea', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '单方造价', dataCode: 'perCost', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
 
-         {name: '工程专业', dataCode: 'feeStandardName', width: 100, vAlign: 'center', hAlign: 'left'},
 
-     ];
 
-     const spreadOpts = {
 
-         workBook: {
 
-             tabStripVisible:  false,
 
-             allowContextMenu: false,
 
-             allowCopyPasteExcelStyle : false,
 
-             allowExtendPasteRange: false,
 
-             allowUserDragDrop : false,
 
-             allowUserDragFill: false,
 
-             scrollbarMaxAlign : true
 
-         },
 
-         sheet: {
 
-             isProtected: true,
 
-             protectionOptions: {allowResizeRows: true, allowResizeColumns: true},
 
-             clipBoardOptions: GC.Spread.Sheets.ClipboardPasteOptions.values
 
-         }
 
-     };
 
-     const spreadEvents = {
 
-         SelectionChanging: function (sender, info) {
 
-             initSelection(info.newSelections[0], info.oldSelections[0]);
 
-         }
 
-     };
 
-     //设置选中行底色
 
-     //@param
 
-     function setSelStyle(sel, backColor,sheet) {
 
-         sel.row = sel.row === -1 ? 0 : sel.row;
 
-         renderSheetFunc(sheet, function () {
 
-             let style = projTreeObj.getSelStyle(backColor);
 
-             for(let i = 0; i < sel.rowCount; i++){
 
-                 let row = i + sel.row;
 
-                 sheet.setStyle(row, -1, style);
 
-             }
 
-         });
 
-     }
 
-     //初始化焦点
 
-     //@param {Object}newSel {Object}oldSel @return {void}
 
-     function initSelection(newSel, oldSel = null) {
 
-         let node = tree.items[newSel.row];
 
-         tree.selected = node;
 
-         shareSeleted = node;
 
-         //恢复底色
 
-         if(oldSel){
 
-             setSelStyle(oldSel, projTreeObj.setting.style.defalutBackColor, spreadObj.sheet);
 
-         }
 
-         //设置选中行底色
 
-         if(newSel){
 
-             setSelStyle(newSel, projTreeObj.setting.style.selectedColor, spreadObj.sheet);
 
-         }
 
-     }
 
-     //渲染时方法,停止渲染
 
-     //@param {Object}sheet {Function}func @return {void}
 
-     function renderSheetFunc(sheet, func){
 
-         sheet.suspendEvent();
 
-         sheet.suspendPaint();
 
-         if(func){
 
-             func();
 
-         }
 
-         sheet.resumeEvent();
 
-         sheet.resumePaint();
 
-     }
 
-     //设置表选项
 
-     //@param {Object}workBook {Object}opts @return {void}
 
-     function setSpreadOptions (workBook, opts) {
 
-         for(let opt in opts.workBook){
 
-             workBook.options[opt] = opts.workBook[opt];
 
-         }
 
-         for(let opt in opts.sheet){
 
-             workBook.getActiveSheet().options[opt] = opts.sheet[opt];
 
-         }
 
-     }
 
-     //建表头
 
-     //@param {Object}sheet {Array}headers @return {void}
 
-     function buildHeader(sheet, headers) {
 
-         let fuc = function () {
 
-             sheet.setColumnCount(headers.length);
 
-             sheet.setRowHeight(0, 40, GC.Spread.Sheets.SheetArea.colHeader);
 
-             //let spreadWidth = getWorkBookWidth();
 
-             for(let i = 0, len = headers.length; i < len; i++){
 
-                 sheet.setColumnWidth(i, headers[i].width, GC.Spread.Sheets.SheetArea.colHeader);
 
-                 if(headers[i].formatter){
 
-                     sheet.setFormatter(-1, i, headers[i].formatter);
 
-                 }
 
-                 if(headers[i].dataCode === oprType.copy){
 
-                     //合并列
 
-                     sheet.addSpan(0, i, 1, 2, GC.Spread.Sheets.SheetArea.colHeader);
 
-                     sheet.setValue(0, i, '操作', GC.Spread.Sheets.SheetArea.colHeader);
 
-                     continue;
 
-                 }
 
-                 if(headers[i].dataCode === '' || headers[i].dataCode === 'feeRateFile_delete'){
 
-                     continue;
 
-                 }
 
-                 sheet.setValue(0, i, headers[i].name, GC.Spread.Sheets.SheetArea.colHeader);
 
-                 sheet.getRange(-1, i, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[headers[i]['hAlign']]);
 
-                 sheet.getRange(-1, i, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[headers[i]['vAlign']]);
 
-             }
 
-         };
 
-         renderSheetFunc(sheet, fuc);
 
-     }
 
-     //表监听事件
 
-     //@param {Object}workBook @return {void}
 
-     function bindEvent(workBook, events) {
 
-         if(Object.keys(events).length === 0){
 
-             return;
 
-         }
 
-         const Events = GC.Spread.Sheets.Events;
 
-         for(let event in events){
 
-             workBook.bind(Events[event], events[event]);
 
-         }
 
-     }
 
-     //建表
 
-     //
 
-     function buildSheet(){
 
-         spreadObj.workBook = new GC.Spread.Sheets.Workbook(spreadDom[0], {sheetCount: 1});
 
-         sheetCommonObj.spreadDefaultStyle(spreadObj.workBook);
 
-         spreadObj.sheet = spreadObj.workBook.getActiveSheet();
 
-         setSpreadOptions(spreadObj.workBook, spreadOpts);
 
-         bindEvent(spreadObj.workBook, spreadEvents);
 
-         buildHeader(spreadObj.sheet, headers);
 
-         //全表不可编辑
 
-         spreadObj.sheet.getRange(-1, -1, -1, -1).locked(true);
 
-     }
 
-     //此项目是否可以拷贝
 
-     //@param {String}userID {Object}project @return {Boolean}
 
-     function isAllowCopy(userID, project){
 
-         for(let shareData of project.shareInfo){
 
-             if(shareData.userID === userID){
 
-                 return shareData.allowCopy;
 
-             }
 
-         }
 
-         return false;
 
-     }
 
-     //
 
-     //
 
-     function getTreeNodeCell(tree){
 
-         let indent = 20;
 
-         let levelIndent = -5;
 
-         let halfBoxLength = 5;
 
-         let halfExpandLength = 3;
 
-         let imgWidth = 18;
 
-         let imgHeight = 14;
 
-         let TreeNodeCellType = function () {
 
-         };
 
-         TreeNodeCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
 
-         TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
 
-             if (style.backColor) {
 
-                 ctx.save();
 
-                 ctx.fillStyle = style.backColor;
 
-                 ctx.fillRect(x, y, w, h);
 
-                 ctx.restore();
 
-             } else {
 
-                 ctx.clearRect(x, y, w, h);
 
-             }
 
-             let drawLine = function (canvas, x1, y1, x2, y2, color) {
 
-                 ctx.save();
 
-                 ctx.translate(0.5, 0.5);
 
-                 ctx.beginPath();
 
-                 ctx.moveTo(x1, y1);
 
-                 ctx.lineTo(x2, y2);
 
-                 ctx.strokeStyle = color;
 
-                 ctx.stroke();
 
-                 ctx.restore();
 
-             };
 
-             let drawExpandBox = function (ctx, x, y, w, h, centerX, centerY, expanded) {
 
-                 let rect = {}, h1, h2, offset = 1;
 
-                 rect.top = centerY - halfBoxLength;
 
-                 rect.bottom = centerY + halfBoxLength;
 
-                 rect.left = centerX - halfBoxLength;
 
-                 rect.right = centerX + halfBoxLength;
 
-                 if (rect.left < x + w) {
 
-                     rect.right = Math.min(rect.right, x + w);
 
-                     ctx.save();
 
-                     ctx.translate(0.5, 0.5);
 
-                     ctx.strokeStyle = 'black';
 
-                     ctx.beginPath();
 
-                     ctx.moveTo(rect.left, rect.top);
 
-                     ctx.lineTo(rect.left, rect.bottom);
 
-                     ctx.lineTo(rect.right, rect.bottom);
 
-                     ctx.lineTo(rect.right, rect.top);
 
-                     ctx.lineTo(rect.left, rect.top);
 
-                     ctx.stroke();
 
-                     ctx.fillStyle = 'white';
 
-                     ctx.fill();
 
-                     ctx.restore();
 
-                     // Draw Horizontal Line
 
-                     h1 = centerX - halfExpandLength;
 
-                     h2 = Math.min(centerX + halfExpandLength, x + w);
 
-                     if (h2 > h1) {
 
-                         drawLine(ctx, h1, centerY, h2, centerY, 'black');
 
-                     }
 
-                     // Draw Vertical Line
 
-                     if (!expanded && (centerX < x + w)) {
 
-                         drawLine(ctx, centerX, centerY - halfExpandLength, centerX, centerY + halfExpandLength, 'black');
 
-                     }
 
-                 }
 
-             }
 
-             let node = tree.items[options.row];
 
-             let showTreeLine = true;
 
-             if (!node) { return; }
 
-             let centerX = Math.floor(x) + node.depth() * indent + node.depth() * levelIndent + indent / 2;
 
-             let x1 = centerX + indent / 2;
 
-             let centerY = Math.floor((y + (y + h)) / 2);
 
-             let y1;
 
-             // Draw Sibling Line
 
-             if (showTreeLine) {
 
-                 // Draw Horizontal Line
 
-                 if (centerX < x + w) {
 
-                     drawLine(ctx, centerX, centerY, Math.min(x1, x + w), centerY, 'gray');
 
-                     let img;
 
-                     if(node.data.projType === projectType.folder){
 
-                         img = document.getElementById('folder_open_pic');
 
-                         imgWidth = 15;
 
-                     }
 
-                     else if(node.data.projType === projectType.project){
 
-                         img = document.getElementById('proj_pic');
 
-                         imgWidth = 18;
 
-                     }
 
-                     else if(node.data.projType === projectType.engineering){
 
-                         img = document.getElementById('eng_pic');
 
-                         imgWidth = 14;
 
-                     }
 
-                     else if(node.data.projType === projectType.tender){
 
-                         img = document.getElementById('tender_pic');
 
-                         imgWidth = 14;
 
-                     }
 
-                     ctx.drawImage(img, centerX+indent/2+3, centerY - 7, imgWidth,imgHeight);
 
-                 }
 
-                 // Draw Vertical Line
 
-                 if (centerX < x + w) {
 
-                     y1 = node.isLast() ? centerY : y + h;
 
-                     if (node.isFirst() && !node.parent.parent) {
 
-                         drawLine(ctx, centerX, centerY, centerX, y1, 'gray');
 
-                     } else {
 
-                         drawLine(ctx, centerX, y, centerX, y1, 'gray');
 
-                     }
 
-                 }
 
-             }
 
-             // Draw Expand Box
 
-             if (node.children.length > 0) {
 
-                 drawExpandBox(ctx, x, y, w, h, centerX, centerY, node.expanded);
 
-             }
 
-             // Draw Parent Line
 
-             if (showTreeLine) {
 
-                 var parent = node.parent, parentCenterX = centerX - indent - levelIndent;
 
-                 while (parent.parent) {
 
-                     if (!parent.isLast()) {
 
-                         if (parentCenterX < x + w) {
 
-                             drawLine(ctx, parentCenterX, y, parentCenterX, y + h, 'gray');
 
-                         }
 
-                     }
 
-                     parent = parent.parent;
 
-                     parentCenterX -= (indent + levelIndent);
 
-                 }
 
-             };
 
-             // Draw Text
 
-             arguments[2] = x + (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3;
 
-             arguments[4] = w - (node.depth() + 1) * indent - node.depth() * levelIndent - imgWidth - 3;
 
-             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
 
-         };
 
-         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
 
-             let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};
 
-             let node = tree.items[info.row];
 
-             let offset = -1;
 
-             let centerX = info.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
 
-             let text = context.sheet.getText(info.row, info.col);
 
-             let value = context.sheet.getValue(info.row, info.col);
 
-             let acStyle = context.sheet.getActualStyle(info.row, info.col),
 
-                 zoom = context.sheet.zoom();
 
-             let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: context.sheet, row: info.row, col: info.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
 
-             if(info.x > centerX + halfBoxLength && info.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength){
 
-                 info.isReservedLocation = true;
 
-             }
 
-             return info;
 
-         };
 
-         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
 
-             let offset = -1;
 
-             let node = tree.items[hitinfo.row];
 
-             let centerX = hitinfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
 
-             let centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
 
-             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
 
-             let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
 
-             let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
 
-                 zoom = hitinfo.sheet.zoom();
 
-             let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
 
-             //(图标+名字)区域
 
-             function withingClickArea(){
 
-                 return hitinfo.x > centerX + halfBoxLength && hitinfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength;
 
-             }
 
-             //点击单位工程
 
-             if(node.data.projType === projectType.tender && withingClickArea()){
 
-                 let newTab = window.open('about:blank');
 
-                 //打开项目的实际ID
 
-                 BeforeOpenProject(node.data.actualTreeInfo.ID, {'fullFolder': GetFullFolder(node.parent)}, function () {
 
-                     let mainUrl = `/main?project=${node.data.actualTreeInfo.ID}`;
 
-                     CommonAjax.get(mainUrl, [], function () {
 
-                         newTab.location.href = mainUrl;
 
-                     });
 
-                 });
 
-             }
 
-             if (!node || node.children.length === 0) { return; }
 
-             if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
 
-                 node.setExpanded(!node.expanded);
 
-                 TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
 
-                     let iCount = node.posterityCount(), i, child;
 
-                     for (i = 0; i < iCount; i++) {
 
-                         child = tree.items[hitinfo.row + i + 1];
 
-                         hitinfo.sheet.setRowVisible(hitinfo.row + i + 1, child.visible, hitinfo.sheetArea);
 
-                     }
 
-                     hitinfo.sheet.invalidateLayout();
 
-                 });
 
-                 hitinfo.sheet.repaint();
 
-             }
 
-         };
 
-         TreeNodeCellType.prototype.processMouseMove = function (hitInfo) {
 
-             let sheet = hitInfo.sheet;
 
-             let div = sheet.getParent().getHost();
 
-             let canvasId = div.id + "vp_vp";
 
-             let canvas = $(`#${canvasId}`)[0];
 
-             //改变鼠标图案
 
-             if (sheet && hitInfo.isReservedLocation) {
 
-                 canvas.style.cursor='pointer';
 
-                 return true;
 
-             }else{
 
-                 canvas.style.cursor='default';
 
-             }
 
-             return false;
 
-         };
 
-         TreeNodeCellType.prototype.processMouseEnter = function (hitinfo) {
 
-             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
 
-             let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
 
-             let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
 
-             let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
 
-                 zoom = hitinfo.sheet.zoom();
 
-             let node = tree.items[hitinfo.row];
 
-             let nodeIndent = node ? (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3 : 0;
 
-             let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
 
-             let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
 
-             if(textLength > cellWidth - nodeIndent){
 
-                 TREE_SHEET_HELPER.showTipsDiv(text,{pos: {}},hitinfo);
 
-             }
 
-         };
 
-         TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
 
-             TREE_SHEET_HELPER.tipDiv = 'hide';
 
-             if (TREE_SHEET_HELPER._toolTipElement) {
 
-                 $(TREE_SHEET_HELPER._toolTipElement).hide();
 
-                 TREE_SHEET_HELPER._toolTipElement = null;
 
-             };
 
-             TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
 
-         }
 
-         return new TreeNodeCellType();
 
-     }
 
-     //互动单元格
 
-     function getInteractionCell() {
 
-         let InteractionCell = function () {
 
-         };
 
-         InteractionCell.prototype = new GC.Spread.Sheets.CellTypes.Text();
 
-         InteractionCell.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
 
-             return {
 
-                 x: x,
 
-                 y: y,
 
-                 row: context.row,
 
-                 col: context.col,
 
-                 cellStyle: cellStyle,
 
-                 cellRect: cellRect,
 
-                 sheetArea: context.sheetArea,
 
-                 isReservedLocation: true
 
-             };
 
-         };
 
-         InteractionCell.prototype.processMouseDown = function (hitinfo) {
 
-             let dataCode = headers[hitinfo.col]['dataCode'];
 
-             let node = tree.items[hitinfo.row];
 
-             let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
 
-             let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
 
-             let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
 
-                 zoom = hitinfo.sheet.zoom();
 
-             let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
 
-             if(hitinfo.x - hitinfo.cellRect.x > 0 && hitinfo.x - hitinfo.cellRect.x < textLength){
 
-                 //由..分享,弹出分享者信息
 
-                 if(dataCode === 'from'){
 
-                     if(node.data.shareType === shareType.receive){
 
-                         $('#userinfo').find('h4').text(node.data.userInfo.name);
 
-                         $('#userinfo').find('h6').text(node.data.userInfo.company);
 
-                         let mobileHtml = `<i class="fa fa-tablet"> ${node.data.userInfo.mobile ? node.data.userInfo.mobile : ''}</i>`;
 
-                         $('#userinfo').find('li:first-child').html(mobileHtml);
 
-                         let emailHtml = `<i class="fa fa-envelope-o"> ${node.data.userInfo.email ? node.data.userInfo.email : ''}</i>`;
 
-                         $('#userinfo').find('li:last-child').html(emailHtml);
 
-                         $('#userinfo').modal('show');
 
-                     }
 
-                 }
 
-                 //分享给
 
-                 else if(dataCode === 'to'){
 
-                     if(node.data.shareType === shareType.shareTo){
 
-                         setShareToModal(node);
 
-                         $('#shareTo').modal('show');
 
-                     }
 
-                 }
 
-                 //操作
 
-                 else if(dataCode === oprType.copy){
 
-                    /* if(node.data.copy === '添加分享'){
 
-                         $('#sharePhone').val('');
 
-                         $('#share-info').hide();
 
-                         $('#share').find('.card').hide();
 
-                         $('#share').modal('show');
 
-                         $('#allowCopy').prop('checked', false);
 
-                         $('#allowCopyHint').hide();
 
-                     }
 
-                     else*/
 
-                     if(node.data.copy === '拷贝工程'){
 
-                         $('#copyShare').modal('show');
 
-                     }
 
-                 }
 
-                 else if (dataCode === oprType.cancel) {
 
-                     if (node.data.cancel === '清除') {
 
-                         let $p = $('<p>').text(`点“确定”按钮,确认清除分享文件 “${node.data.name}”。`);
 
-                         $('#cancelShare').find('.modal-body').empty();
 
-                         $('#cancelShare').find('.modal-body').append($p);
 
-                         $('#cancelShare').modal('show');
 
-                     }
 
-                 }
 
-             }
 
-         };
 
-         InteractionCell.prototype.processMouseMove = function (hitInfo) {
 
-             let dataCode = headers[hitInfo.col]['dataCode'];
 
-             let node = tree.items[hitInfo.row];
 
-             let sheet = hitInfo.sheet;
 
-             let div = sheet.getParent().getHost();
 
-             let canvasId = div.id + "vp_vp";
 
-             let canvas = $(`#${canvasId}`)[0];
 
-             //改变鼠标图案
 
-             let text = hitInfo.sheet.getText(hitInfo.row, hitInfo.col);
 
-             let value = hitInfo.sheet.getValue(hitInfo.row, hitInfo.col);
 
-             let acStyle = hitInfo.sheet.getActualStyle(hitInfo.row, hitInfo.col),
 
-                 zoom = hitInfo.sheet.zoom();
 
-             let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitInfo.sheet, row: hitInfo.row, col: hitInfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
 
-             if (sheet && hitInfo.x - hitInfo.cellRect.x >  0 && hitInfo.x - hitInfo.cellRect.x < textLength) {
 
-                 canvas.style.cursor='pointer';
 
-                 return true;
 
-             }else{
 
-                 canvas.style.cursor='default';
 
-             }
 
-             return false;
 
-         };
 
-         return new InteractionCell();
 
-     }
 
-     //设置分享给界面数据
 
-     //@param {Object}selected @return {void}
 
-     function setShareToModal(selected){
 
-         $('#shareToInfo').empty();
 
-         if(!selected){
 
-             return;
 
-         }
 
-         let userIDs = [];
 
-         for(let user of selected.data.shareInfo){
 
-             userIDs.push(user.userID);
 
-         }
 
-         CommonAjax.post('/user/getUsers', {userIDs: userIDs}, function (rstData) {
 
-             for(let userInfo of rstData){
 
-                 for(let user of selected.data.shareInfo){
 
-                     if(user.userID === userInfo._id){
 
-                         user.name = userInfo.real_name;
 
-                         user.company = userInfo.company;
 
-                         user.mobile = userInfo.mobile;
 
-                         user.email = userInfo.email;
 
-                     }
 
-                 }
 
-             }
 
-             let infoArr = [];
 
-             for(let user of selected.data.shareInfo){
 
-                 let infoHtml = `<tr>
 
-                                           <td style="width: 106px;">${user.name}</td>
 
-                                           <td style="width: 146px;">${user.company}</td>
 
-                                           <td style="width: 146px;">${user.mobile}</td>
 
-                                           <td style="width: 156px;">${user.email}</td>
 
-                                           <td style="width: 70px;text-align: center"><input value="allowCopy" ${user.allowCopy ? 'checked' : ''} type="checkbox"></td>
 
-                                           <td style="width: 70px;text-align: center"><input value="cancelShare" type="checkbox"></td>
 
-                                </tr>`;
 
-                 infoArr.push(infoHtml);
 
-             }
 
-             let infoHtml = infoArr.join('');
 
-             $('#shareToInfo').html(infoHtml);
 
-         });
 
-     }
 
-     //更新项目分享信息
 
-     //@param {Object}selected
 
-     function updateShareInfo(selected){
 
-         if(!selected){
 
-             return;
 
-         }
 
-         let usersTr = $('#shareToInfo').find('tr');
 
-         let newShareInfo = [];
 
-         for(let i = 0; i < usersTr.length; i++){
 
-             let userTr = usersTr[i];
 
-             let allowCopy = $(userTr).find('input:first').prop('checked');
 
-             let cancelShare = $(userTr).find('input:last').prop('checked');
 
-             selected.data.shareInfo[i].allowCopy = allowCopy;
 
-             if(!cancelShare){
 
-                 newShareInfo.push(selected.data.shareInfo[i]);
 
-             }
 
-         }
 
-         CommonAjax.post('/pm/api/updateProjects', {user_id: userID, updateData: [{updateType: 'update', updateData: {ID: selected.data.ID, shareInfo: newShareInfo}}]}, function () {
 
-             selected.data.shareInfo = newShareInfo;
 
-             if(newShareInfo.length === 0){
 
-                 renderSheetFunc(spreadObj.sheet, function () {
 
-                     let rIdx = selected.serialNo();
 
-                     tree.removeNode(selected);
 
-                     spreadObj.sheet.deleteRows(rIdx, 1);
 
-                     spreadObj.sheet.setRowCount(tree.items);
 
-                     initSelection({row: spreadObj.sheet.getActiveRowIndex(), rowCount: 1},null);
 
-                 });
 
-             }
 
-         });
 
-     }
 
-     const foreColor = '#007bff';
 
-     const cancelForeColor = 'red';
 
-     //显示树结构数据
 
-     //@param {Array}nodes {Array}headers @return {void}
 
-     function showTreeData(nodes, headers){
 
-         let sheet = spreadObj.workBook.getActiveSheet();
 
-         let fuc = function(){
 
-             sheet.setRowCount(nodes.length);
 
-             for(let i = 0; i < nodes.length; i++){
 
-                 let treeNodeCell = getTreeNodeCell(tree);
 
-                 sheet.getCell(i, treeCol).cellType(treeNodeCell);
 
-                 for(let j = 0; j < headers.length; j++){
 
-                     sheet.getRange(-1, j, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[headers[j]['hAlign']]);
 
-                     sheet.getRange(-1, j, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[headers[j]['vAlign']]);
 
-                     let dataCode = headers[j].dataCode;
 
-                     if(dataCode === oprType.copy){
 
-                         let style = new GC.Spread.Sheets.Style();
 
-                         style.foreColor = foreColor;
 
-                         sheet.setStyle(i, j, style);
 
-                         sheet.getCell(i, j).cellType(getInteractionCell());
 
-                     }
 
-                     else if (dataCode === oprType.cancel) {
 
-                         let style = new GC.Spread.Sheets.Style();
 
-                         style.foreColor = cancelForeColor;
 
-                         sheet.setStyle(i, j, style);
 
-                         sheet.getCell(i, j).cellType(getInteractionCell());
 
-                     }
 
-                     else if(dataCode === 'from'){
 
-                         if(nodes[i].data.shareType && nodes[i].data.shareType === shareType.receive){
 
-                             let style = new GC.Spread.Sheets.Style();
 
-                             style.foreColor = foreColor;
 
-                             sheet.setStyle(i, j, style);
 
-                             sheet.getCell(i, j).cellType(getInteractionCell());
 
-                         }
 
-                     }
 
-                     else if(dataCode === 'to'){
 
-                         if(nodes[i].data.shareType && nodes[i].data.shareType === shareType.shareTo){
 
-                             let style = new GC.Spread.Sheets.Style();
 
-                             style.foreColor = foreColor;
 
-                             sheet.setStyle(i, j, style);
 
-                             sheet.getCell(i, j).cellType(getInteractionCell());
 
-                         }
 
-                     }
 
-                     sheet.setValue(i, j, nodes[i].data[dataCode] !== null && typeof nodes[i].data[dataCode] !== 'undefined' ? nodes[i].data[dataCode] : '');
 
-                 }
 
-             }
 
-         };
 
-         renderSheetFunc(sheet, fuc);
 
-     }
 
-     //同一棵树,可能存在相同数据显示多条的问题(传入的datas中不存在相同数据),将真实树结构数据存在actualTreeInfo中,外部树结构数据用uuid重置。
 
-     //@param {Array}datas
 
-     function setTreeInfo(datas) {
 
-         let IDMapping = {};
 
-         for (let data of datas) {
 
-             IDMapping[data.ID] = uuid.v1();
 
-         }
 
-         for (let data of datas) {
 
-             data.actualTreeInfo = {ID: data.ID, ParentID: data.ParentID, NextSiblingID: data.NextSiblingID};
 
-             data.ID = IDMapping[data.ID];
 
-             data.NextSiblingID = IDMapping[data.NextSiblingID] ? IDMapping[data.NextSiblingID] : -1;
 
-             data.ParentID = IDMapping[data.ParentID] ? IDMapping[data.ParentID] : -1;
 
-         }
 
-     }
 
-     //整理同层数据的NextSiblingID,ParentID
 
-     //@param {Array}datas {Number || String}pid @return {void}
 
-     function sortSameDepthData(datas, pid) {
 
-         for (let i = 0; i < datas.length; i++) {
 
-             let data = datas[i],
 
-                 nextData = datas[i + 1];
 
-             data.NextSiblingID = nextData ? nextData.ID : -1;
 
-             data.ParentID = pid;
 
-         }
 
-     }
 
-     //给项目设置分享信息:由xx分享、分享给我、可进行的操作,含有userInfo信息的文件为他人直接分享的文件,他人分享父级文件,子文件不含有userInfo信息
 
-     //@param {Array}datas @return {void}
 
-     function setShareInfo(datas) {
 
-         for (let data of datas) {
 
-             if (data.userInfo) {
 
-                 data.from = `由 ${data.userInfo.name} 分享`;
 
-                 data.to = '分享给 我';
 
-                 data.cancel = '清除'
 
-                 //拷贝操作只允许到单位工程级
 
-                 let tendersCanCopy = isAllowCopy(userID, data);
 
-                 let tenders = data.projType === projectType.tender ? [data] : _.filter(data.children, {projType: projectType.tender});
 
-                 for (let tender of tenders) {
 
-                     tender.copy = tendersCanCopy ? '拷贝工程' : '';
 
-                 }
 
-             }
 
-         }
 
-     }
 
-     //给项目设置汇总信息
 
-     //@param {Array}projs {Object}summaryInfo
 
-     function setSummaryInfo(grouped, summaryInfo) {
 
-         let allDatas = [];
 
-         for (let data of grouped) {
 
-             allDatas.push(data);
 
-             if (data.children && data.children.length > 0) {
 
-                 allDatas = allDatas.concat(data.children);
 
-             }
 
-         }
 
-         for(let proj of allDatas){
 
-             let summaryProj = summaryInfo[proj.ID];
 
-             if(summaryProj){
 
-                 proj.engineeringCost = summaryProj.engineeringCost;
 
-                 proj.subEngineering = summaryProj.subEngineering;
 
-                 proj.measure = summaryProj.measure;
 
-                 proj.safetyConstruction = summaryProj.safetyConstruction;
 
-                 proj.other = summaryProj.other;
 
-                 proj.charge = summaryProj.charge;
 
-                 proj.tax = summaryProj.tax;
 
-                 proj.rate = summaryProj.rate;
 
-                 proj.buildingArea = summaryProj.buildingArea;
 
-                 proj.perCost = summaryProj.perCost;
 
-             }
 
-         }
 
-     }
 
-     //获取可成树的数据
 
-     //@param {Array}datas @return {Array}
 
-     function getTreeDatas(groupedDatas, ungroupedDatas){
 
-         //设置新的树结构数据
 
-         for (let data of groupedDatas) {
 
-             setTreeInfo([data].concat(data.children));
 
-         }
 
-         let engs = _.filter(ungroupedDatas, {projType: projectType.engineering}),
 
-             tenders = _.filter(ungroupedDatas, {projType: projectType.tender});
 
-         for (let data of engs) {
 
-             setTreeInfo([data].concat(data.children));
 
-         }
 
-         setTreeInfo(tenders);
 
-         let rst = [];
 
-         //整理树结构
 
-         sortSameDepthData(groupedDatas, -1);
 
-         //新建未分类建设项目及单项工程
 
-         let ungroupedProj = {ID: uuid.v1(), ParentID: -1, NextSiblingID: -1, name: '未分类建设项目', projType: projectType.project};
 
-         let ungroupedEng = {ID: uuid.v1(), ParentID: ungroupedProj.ID, NextSiblingID: -1, name: '未分类单项工程', projType: projectType.engineering};
 
-         if (groupedDatas.length > 0) {
 
-             groupedDatas[groupedDatas.length - 1].NextSiblingID = ungroupedProj.ID;
 
-         }
 
-         //将未分类的数据归类
 
-         sortSameDepthData(engs, ungroupedProj.ID);
 
-         sortSameDepthData(tenders, ungroupedEng.ID);
 
-         //未分类单项工程处于同层第一个节点
 
-         ungroupedEng.NextSiblingID = engs[0] ? engs[0].ID : ungroupedEng.NextSiblingID;
 
-         let allDatas = groupedDatas.concat(ungroupedDatas);
 
-         //设置分享信息及操作信息
 
-         setShareInfo(allDatas);
 
-         for (let data of allDatas) {
 
-             rst.push(data);
 
-             if (data.children) {
 
-                 rst = rst.concat(data.children);
 
-             }
 
-         }
 
-         rst.push(ungroupedProj);
 
-         rst.push(ungroupedEng);
 
-         return rst;
 
-     }
 
-     //按照时间排序
 
-     //@param {Array}datas @return {void}
 
-     function sortByDate(datas){
 
-         datas.sort(function (a, b) {
 
-             let shareInfoA = _.find(a.shareInfo, {userID}),
 
-                 shareInfoB = _.find(b.shareInfo, {userID});
 
-             let aV = shareInfoA ? Date.parse(shareInfoA.shareDate) : 0,
 
-                 bV = shareInfoB ? Date.parse(shareInfoB.shareDate) : 0;
 
-             //时间越晚越靠前
 
-             if (aV > bV) {
 
-                 return -1;
 
-             } else if (aV < bV) {
 
-                 return 1;
 
-             }
 
-             return 0;
 
-         });
 
-     }
 
-     //建立树
 
-     //@return void
 
-     function initShareTree(){
 
-         $.bootstrapLoading.start();
 
-         //获取分享数据
 
-         CommonAjax.post('/pm/api/receiveProjects', {user_id: userID}, function (rstData) {
 
-             // 排序 --分享的文件按照时间先后顺序排序,分享文件下的子文件,按照原本树结构显示,不需要排序
 
-             sortByDate(rstData.grouped);
 
-             sortByDate(rstData.ungrouped);
 
-             //设置汇总信息
 
-             setSummaryInfo(rstData.grouped, rstData.summaryInfo.grouped);
 
-             setSummaryInfo(rstData.ungrouped, rstData.summaryInfo.ungrouped);
 
-             let treeDatas = getTreeDatas(rstData.grouped, rstData.ungrouped);
 
-             tree = pmTree.createNew(treeSetting, treeDatas);
 
-             tree.selected = tree.items[0];
 
-             showTreeData(tree.items, headers);
 
-             //初始选择
 
-             let initSel = spreadObj.sheet.getSelections()[0] ? spreadObj.sheet.getSelections()[0] : {row: 0, rowCount: 1};
 
-             initSelection(initSel);
 
-             autoFlashHeight();
 
-             spreadObj.sheet.frozenColumnCount(4);
 
-             spreadObj.workBook.refresh();
 
-             $.bootstrapLoading.end();
 
-         });
 
-     }
 
-     //初始化视图
 
-     //@return void
 
-     function initView(){
 
-         if(tree){
 
-             tree = null;
 
-         }
 
-         if(spreadObj.workBook){
 
-             spreadObj.workBook.destroy();
 
-             spreadObj.workBook = null;
 
-         }
 
-         buildSheet();
 
-         initShareTree();
 
-     }
 
-     //根据建设项目获取单项工程
 
-     //@param {Number}projID @return {void}
 
-     function setEng(projID){
 
-         let engQuery = {$or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], projType: projectType.engineering, userID: userID, ParentID: projID};
 
-         CommonAjax.post('/pm/api/getProjectsByQuery', {user_id: userID, query: engQuery, options: '-_id -property'}, function (rstData) {
 
-             $('#copyShare_selectEng').empty();
 
-             for(let eng of rstData){
 
-                 let opt = $('<option>').val(eng.ID).text(eng.name);
 
-                 $('#copyShare_selectEng').append(opt);
 
-             }
 
-         });
 
-     }
 
-     //从其他建设项目中复制中,建设项目的文件层次结构名称和顺序
 
-     //@param {Array}treeData @return {Array}
 
-     function getFileHierarchyInfo(treeData){
 
-         let tree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1});
 
-         tree.loadDatas(treeData);
 
-         let items = tree.items;
 
-         let rst = [];
 
-         function getFileHierarchyName(node){
 
-             let nodeName = node.data.name;
 
-             let name = [];
 
-             while (node.parent){
 
-                 name.push(node.parent.data.name ? node.parent.data.name : '');
 
-                 node = node.parent;
 
-             }
 
-             name = name.reverse();
 
-             name.push(nodeName);
 
-             return name.join('\\');
 
-         }
 
-         for(let node of items){
 
-             if(node.children.length === 0 ){//project
 
-                 rst.push({ID: node.data.ID, fileHierarchyName: getFileHierarchyName(node)})
 
-             }
 
-         }
 
-         return rst;
 
-     }
 
-     //设置拷贝工程下拉选择
 
-     //@return {void}
 
-     function setCopyModal(){
 
-         //获取建设项目
 
-         let projQuery = {$or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], projType: {$in: [projectType.project, projectType.folder]}, userID: userID};
 
-         CommonAjax.post('/pm/api/getProjectsByQuery', {user_id: userID, query: projQuery, options: '-_id -property'}, function (rstData) {
 
-             let fileHierarchyData = getFileHierarchyInfo(rstData);
 
-             $('#copyShare_selectProj').empty();
 
-             for(let proj of fileHierarchyData){
 
-                 let opt = $('<option>').val(proj.ID).text(proj.fileHierarchyName);
 
-                 $('#copyShare_selectProj').append(opt);
 
-             }
 
-             //初始选择
 
-             if(fileHierarchyData.length > 0){
 
-                 setEng(fileHierarchyData[0].ID);
 
-             }
 
-         });
 
-     }
 
-     //拷贝分享的工程
 
-     //@param {Object}selected {Number}parentID @return {void}
 
-     function copyShareProject(selected, projID, engID){
 
-         if(!engID || !selected){
 
-             return;
 
-         }
 
-         let copyMap = {copy: null, update: null};
 
-         let newName = getCopyName(selected);
 
-         //获取单项工程的单位工程
 
-         let tenderQuery = {$or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], userID: userID, ParentID: engID};
 
-         CommonAjax.post('/pm/api/getProjectsByQuery', {user_id: userID, query: tenderQuery, options: '-_id -property'}, function (rstData) {
 
-             let updateTender = null;
 
-             for(let tender of rstData){
 
-                 if(tender.name === newName){
 
-                     $('#copyShare_name').text('已存在此单位工程。');
 
-                     $('#copyShare_name').addClass('text-danger');
 
-                     return;
 
-                 }
 
-                 if(tender.NextSiblingID == -1){
 
-                     updateTender = tender;
 
-                 }
 
-             }
 
-             //更新前节点
 
-             if(updateTender){
 
-                 copyMap.update = {query: {ID: updateTender.ID}};
 
-             }
 
-             //拷贝
 
-             let copyData = {
 
-                 userID: userID,
 
-                 ID: selected.data.actualTreeInfo.ID,
 
-                 NextSiblingID: -1,
 
-                 ParentID: engID,
 
-                 name: newName,
 
-                 shareInfo: [],
 
-                 compilation: selected.data.compilation,
 
-                 createDateTime: selected.data.createDateTime,
 
-                 fileVer: selected.data.fileVer ? selected.data.fileVer : '',
 
-                 projType: selected.data.projType,
 
-                 property: {},
 
-                 recentDateTime: selected.data.recentDateTime,
 
-                 fullFolder: selected.data.fullFolder
 
-             };
 
-             copyData.property.rootProjectID = projID;
 
-             copyMap.copy = {document: copyData};
 
-             $('#copyShare').modal('hide');
 
-             $.bootstrapLoading.start();
 
-             CommonAjax.post('/pm/api/copyProjects', {projectMap: copyMap, user_id: userID}, function (rstData) {
 
-                 $.bootstrapLoading.end();
 
-             }, function () {
 
-                 $.bootstrapLoading.end();
 
-             });
 
-         });
 
-     }
 
-     //获取拷贝后的名称
 
-     //@param {Object}node @return {String}
 
-     function getCopyName(node) {
 
-         //当前单位工程可能没有分享的用户信息,可能他人分享的是父级文件,userInfo在父级文件中
 
-         let orgName = node.data.name,
 
-             userInfo = node.data.userInfo;
 
-         while (node && !userInfo) {
 
-             node = node.parent;
 
-             userInfo = node.data.userInfo;
 
-         }
 
-         return `${orgName} (${userInfo.name}分享拷贝)`;
 
-     }
 
-     //事件监听器
 
-     //@return void
 
-     function eventListener(){
 
-         //tab
 
-         $('#tab_pm_share').on('shown.bs.tab', function () {
 
-             //侧滑隐藏
 
-             $('.slide-sidebar').removeClass('open');
 
-             $('.slide-sidebar').css('width', '0');
 
-             projTreeObj.tree = null;
 
-             if(projTreeObj.workBook){
 
-                 projTreeObj.workBook.destroy();
 
-                 projTreeObj.workBook = null;
 
-             }
 
-             gcTreeObj.tree = null;
 
-             if(gcTreeObj.workBook){
 
-                 gcTreeObj.workBook.destroy();
 
-                 gcTreeObj.workBook = null;
 
-             }
 
-             initView();
 
-         });
 
-         //关闭拷贝工程
 
-         $('#copyShare').on('hidden.bs.modal', function () {
 
-             $('#copyShareProj-info').hide();
 
-             $('#copyShareEng-info').hide();
 
-         });
 
-         //打开拷贝工程
 
-         $('#copyShare').on('shown.bs.modal', function () {
 
-             setCopyModal();
 
-             //更改显示名称
 
-             let newName = getCopyName(shareSeleted);
 
-             $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
 
-             $('#copyShare_name').removeClass('text-danger');
 
-         });
 
-         //拷贝工程改变选择建设项目
 
-         $('#copyShare_selectProj').change(function () {
 
-             //更改显示名称
 
-             let newName = getCopyName(shareSeleted);
 
-             $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
 
-             $('#copyShare_name').removeClass('text-danger');
 
-             $('#copyShareProj-info').hide();
 
-             $('#copyShareEng-info').hide();
 
-             let curSelID = $(this).select().val();
 
-             setEng(parseInt(curSelID));
 
-         });
 
-         //拷贝工程改变选择单项工程
 
-         $('#copyShare_selectEng').change(function () {
 
-             //更改显示名称
 
-             let newName = getCopyName(shareSeleted);
 
-             $('#copyShare_name').html(`拷贝后,工程将重命名为 "<b>${newName}</b>"`);
 
-             $('#copyShare_name').removeClass('text-danger');
 
-         });
 
-         //确认拷贝
 
-         $('#copyShare_confirm').click(function () {
 
-             let selProj = $('#copyShare_selectProj').select().val();
 
-             if(!selProj){
 
-                 $('#copyShareProj-info').show();
 
-                 return;
 
-             }
 
-             let selEng = $('#copyShare_selectEng').select().val();
 
-             if(!selEng){
 
-                 $('#copyShareEng-info').show();
 
-                 return;
 
-             }
 
-             copyShareProject(tree.selected, parseInt(selProj), parseInt(selEng));
 
-         });
 
-         //清除分享
 
-         $('#cancelShareConfirm').click(function () {
 
-             $.bootstrapLoading.start();
 
-             CommonAjax.post('/pm/api/share', {user_id: userID, type: oprType.cancel,  projectID: tree.selected.data.actualTreeInfo.ID, shareData:[{userID: userID}]}, function (rstData) {
 
-                 $.bootstrapLoading.end();
 
-                 tree.removeNode(tree.selected);
 
-                 showTreeData(tree.items, headers);
 
-             }, function () {
 
-                 $.bootstrapLoading.end();
 
-             });
 
-         });
 
-     }
 
-     return {spreadObj, headers, initView, eventListener}
 
- })();
 
- $(document).ready(function () {
 
-     pmShare.eventListener();
 
- });
 
 
  |