|
@@ -1696,6 +1696,61 @@ function getWorkBookWidth(){
|
|
|
return workBookWidth = $(window).width() - $('.pm-side').width() - 90;
|
|
|
}
|
|
|
|
|
|
+function prepareInitialTimer() {
|
|
|
+ $('#progressBar').css('width', `0%`);
|
|
|
+ let outer = setInterval(function () {
|
|
|
+ let curWidth = parseInt($('#progressBar')[0].style.width.replace('%', ''));
|
|
|
+ curWidth = parseInt(curWidth + 2);
|
|
|
+ $('#progressBar').css('width', `${curWidth}%`);
|
|
|
+ if (curWidth >= 80) {
|
|
|
+ clearInterval(outer);
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ let inner = setInterval(function () {
|
|
|
+ let curWidth = parseFloat($('#progressBar')[0].style.width.replace('%', ''));
|
|
|
+ if (curWidth >= 80) {
|
|
|
+ curWidth = parseFloat(curWidth + 0.1);
|
|
|
+ $('#progressBar').css('width', `${curWidth}%`);
|
|
|
+ if (curWidth >= 95) {
|
|
|
+ clearInterval(inner);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ return {outer, inner};
|
|
|
+}
|
|
|
+
|
|
|
+function initProjects(callback) {
|
|
|
+ GetAllProjectData(function (datas) {
|
|
|
+ //设置工程专业
|
|
|
+ for (let data of datas) {
|
|
|
+ if (data.projType === projectType.tender) {
|
|
|
+ data.feeStandardName = data.property.feeStandardName || '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ CommonAjax.post('/options/getOptions', [], function (rstData) {
|
|
|
+ projTreeObj.setting.style.selectedColor = rstData.COLOROPTS.SELECTED.backColor;
|
|
|
+ projTreeObj.tree = pmTree.createNew(projTreeObj.setting, datas);
|
|
|
+ projTreeObj.tree.selected = projTreeObj.tree.items[0];
|
|
|
+ projTreeObj.workBook = projTreeObj.buildSheet(projTreeObj.workBook,'projSpread',projTreeObj.setting);
|
|
|
+ projTreeObj.workBook.getSheet(0).frozenColumnCount(2);
|
|
|
+ sheetCommonObj.spreadDefaultStyle(projTreeObj.workBook);
|
|
|
+ projTreeObj.sumEngineeringCost();
|
|
|
+ projTreeObj.showTreeData(projTreeObj.tree.items, projTreeObj.setting.header, projTreeObj.workBook.getActiveSheet());
|
|
|
+ //初始选择
|
|
|
+ let initSel = projTreeObj.workBook.getSheet(0).getSelections()[0] ? projTreeObj.workBook.getSheet(0).getSelections()[0] : {row: 0, rowCount: 1};
|
|
|
+ projTreeObj.initSelection(initSel,null,projTreeObj.workBook.getActiveSheet());
|
|
|
+ // $.bootstrapLoading.end();
|
|
|
+ autoFlashHeight();
|
|
|
+ projTreeObj.workBook.refresh();
|
|
|
+ if (callback) {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ }, function () {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 初始化数据
|
|
|
*
|
|
@@ -1706,8 +1761,28 @@ function init() {
|
|
|
rationValuation = rationValuation.replace(/\n/g, '\\n');
|
|
|
//init spread and pmTree
|
|
|
socketObject.connect('pm');//socket 连接;
|
|
|
- $.bootstrapLoading.start();
|
|
|
- GetAllProjectData(function (datas) {
|
|
|
+ if (isFirst) {
|
|
|
+ $('#progress').modal('show');
|
|
|
+ let intervalTime = prepareInitialTimer();
|
|
|
+ CommonAjax.post('/pm/api/prepareInitialData', {user_id: userID}, function () {
|
|
|
+ initProjects(function () {
|
|
|
+ clearInterval(intervalTime.outer);
|
|
|
+ clearInterval(intervalTime.inner);
|
|
|
+ $('#progressBar').css('width', '100%');
|
|
|
+ setTimeout(function () {
|
|
|
+ $('#progress').modal('hide');
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ initProjects(function () {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //return;
|
|
|
+ //$.bootstrapLoading.start();
|
|
|
+ /*GetAllProjectData(function (datas) {
|
|
|
//设置工程专业
|
|
|
for (let data of datas) {
|
|
|
if (data.projType === projectType.tender) {
|
|
@@ -1730,7 +1805,7 @@ function init() {
|
|
|
autoFlashHeight();
|
|
|
projTreeObj.workBook.refresh();
|
|
|
});
|
|
|
- });
|
|
|
+ });*/
|
|
|
engineering = engineeringList !== null && engineeringList !== undefined ? JSON.parse(engineeringList) : [];
|
|
|
}
|
|
|
|