1)主页面 addNewCombine.jsp
创新互联长期为上千余家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为娄烦企业提供专业的网站制作、做网站,娄烦网站改版等技术服务。拥有十多年丰富建站经验和众多成功案例,为您定制开发。
<%@ include file="../common/h.jsp"%>
<%@ include file="../common/script.jsp" %>
//加载模块
seajs.use("../../js/product/addNewCombine");
1.1)主页面对应的js
define(function (require) {
var Utils = require('utils');
require('../../js/common/ums.base').init();
require('../../js/common/ums.view').init();
var addNewCombine = angular.module('addNewCombine', ['ng.ui','ums.base','ums.view']);
//这样就可以解耦,将对应的子页面的js引入进来,所有的js都定义在同一个module中;
//加载子controller
require('combineProdBaseInfo').extend(addNewCombine);
require('combineProdPackage').extend(addNewCombine);
require('combineProdRule').extend(addNewCombine);
require('combineProdDepartment').extend(addNewCombine);
addNewCombine.controller('addCombineCtrl', function ($scope, uiValid,uiPortalUtils,umsBaseService,uiTips,safeApply) {
$scope.ctrl={
combineProdBaseInfoCtrl : true,
combineProdPackageCtrl : false,
combineProdRuleCtrl : false,
combineProdDepartmentCtrl : false,
showCurrPackageDiv : false,
showPlanDutyInfoCol : false
};
$scope.showCurrentDiv = function(curCtrl){
};
});
window.angular.bootstrap(document,['addNewCombine']);
});
2)子module,combineProdBaseInfo对应的js文件
define('combineProdBaseInfo', function(require, exports, module){
var PFConstants = require('../../js/componentDefine/productConstants.js');
//向外部提供接口
exports.extend = function(md){
md.controller('CombineProdBaseInfoCtrl', function($scope, uiValid,uiPortalUtils,uiTips,safeApply){
$scope.tecProductList = [];
$scope.marketProductList = [];
$scope.idMarketProduct = '';
$scope.productList = [];
var productDescMap = PFConstants.MANAGE_TYPE_MAP;
$scope.productClass00List = [];//有无的产品大类列表
//删除产品
$scope.deleteMarketProduct = function(obj){
if(obj){
var selectObj = _.findWhere($scope.combindProduct.productList,{id : obj.id});
if(selectObj){
$scope.combindProduct.productList.splice($scope.combindProduct.productList.indexO(selectObj),1);
}//if
}//if
};
//显示产品类型描述
$scope.getProductTypeDesc = function(productType){
var desc = productType;
if("1" == productType){
desc = "标准产品";
}else if("2" == productType){
desc = "自选产品";
}
return desc;
};
});
};
});
3)其他相关的js同combineProdBaseInfo.js内容相同,不再叙述