Commit dfcca34c authored by eddie.woo's avatar eddie.woo

去掉workflow老接口

parent 8f6e1f5e
...@@ -591,7 +591,7 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location' ...@@ -591,7 +591,7 @@ citModule.controller('citLayoutController', ['$scope', '$rootScope', '$location'
function initStatus(dbName, id, month) { function initStatus(dbName, id, month) {
$q.all([ $q.all([
projectService.getProjectStatus(dbName, id, month), projectService.getProjectStatus(dbName, id, month),
vatWorkflowService.getWorkflowDetailByDb(dbName, month) // vatWorkflowService.getWorkflowDetailByDb(dbName, month)
]).then(function (result) { ]).then(function (result) {
var statusData = result[0].data; var statusData = result[0].data;
var workflowData = result[1].data; var workflowData = result[1].data;
......
...@@ -312,59 +312,59 @@ ...@@ -312,59 +312,59 @@
//数据导入,数据预览,数据整理layout: vat-import-layout.ctl.js //数据导入,数据预览,数据整理layout: vat-import-layout.ctl.js
isLayoutMenuShow: function (dbName, month, nodeDicKeyValue, linkShort, menus) { isLayoutMenuShow: function (dbName, month, nodeDicKeyValue, linkShort, menus) {
$log.debug("start to isLayoutMenuShow"); $log.debug("start to isLayoutMenuShow");
$q.all([vatWorkflowService.getWorkflowDetailByDb(dbName, month)]).then(function (result) { // $q.all([vatWorkflowService.getWorkflowDetailByDb(dbName, month)]).then(function (result) {
var wfData = result[0].data; // var wfData = result[0].data;
if (wfData.result) { // if (wfData.result) {
var wf = wfData.data; // var wf = wfData.data;
if (_.isNull(wf) || _.isUndefined(wf)) {//当前项目没有配置workflow,就忽略workflow的配置,全部显示 // if (_.isNull(wf) || _.isUndefined(wf)) {//当前项目没有配置workflow,就忽略workflow的配置,全部显示
$.each(menus, function (index, m) { m.show = true; }); // $.each(menus, function (index, m) { m.show = true; });
} // }
else { // else {
var wfNodesList = wf.workflowNodeList; // var wfNodesList = wf.workflowNodeList;
var nodeDto = _.where(wfNodesList, { dictionaryKey: constant.DictionaryDictKey[nodeDicKeyValue] })[0]; // var nodeDto = _.where(wfNodesList, { dictionaryKey: constant.DictionaryDictKey[nodeDicKeyValue] })[0];
if (!_.isNull(nodeDto) && !_.isUndefined(nodeDto)) { // if (!_.isNull(nodeDto) && !_.isUndefined(nodeDto)) {
if (nodeDto.isActive === false) { //Node不可用,全部隐藏 // if (nodeDto.isActive === false) { //Node不可用,全部隐藏
$.each(menus, function (index, m) { m.show = false; }); // $.each(menus, function (index, m) { m.show = false; });
} // }
else { // else {
var taskMenus = [];//存放已经处理过的menu name // var taskMenus = [];//存放已经处理过的menu name
$.each(nodeDto.workflowTaskList, function (index, item) { // $.each(nodeDto.workflowTaskList, function (index, item) {
var menu = _.where(menus, { name: enums.dictionaryKeyMenusMap[item.dictionaryKey] })[0]; // var menu = _.where(menus, { name: enums.dictionaryKeyMenusMap[item.dictionaryKey] })[0];
if (!_.isNull(menu) && !_.isUndefined(menu)) { // if (!_.isNull(menu) && !_.isUndefined(menu)) {
menu.show = item.isActive; // menu.show = item.isActive;
taskMenus.push(menu.name); // taskMenus.push(menu.name);
} // }
}); // });
//
//没有配置过的Task对应的menu需要隐藏 // //没有配置过的Task对应的menu需要隐藏
$.each(menus, function (index, item) { // $.each(menus, function (index, item) {
var findResult = _.find(taskMenus, function (n) { // var findResult = _.find(taskMenus, function (n) {
return _.isEqual(n, item.name); // return _.isEqual(n, item.name);
}); // });
//
if (!findResult) { // if (!findResult) {
item.show = false; // item.show = false;
} // }
}); // });
} // }
//
//上一个节点未完成的话,弹出提示框 // //上一个节点未完成的话,弹出提示框
var lastNodeDto = _.where(wfNodesList, { orderIndex: nodeDto.orderIndex - 1 })[0]; // var lastNodeDto = _.where(wfNodesList, { orderIndex: nodeDto.orderIndex - 1 })[0];
if (!_.isNull(lastNodeDto) && !_.isUndefined(lastNodeDto)) { // if (!_.isNull(lastNodeDto) && !_.isUndefined(lastNodeDto)) {
//debug: only for debug // //debug: only for debug
//lastNodeDto.isDone = false; // //lastNodeDto.isDone = false;
if (!lastNodeDto.isDone) { // if (!lastNodeDto.isDone) {
SweetAlert.warning($translate.instant('LastNodeIsNotFinished')); // SweetAlert.warning($translate.instant('LastNodeIsNotFinished'));
} // }
} // }
} // }
else { // else {
//
$log.debug("nodeDto is undefined"); // $log.debug("nodeDto is undefined");
} // }
} // }
} // }
}); // });
$log.debug("menus before return"); $log.debug("menus before return");
$log.debug(menus); $log.debug(menus);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment