1)主頁面 addNewCombine.jsp
創(chuàng)新互聯(lián)長期為上千余家客戶提供的網(wǎng)站建設服務,團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為婁煩企業(yè)提供專業(yè)的網(wǎng)站制作、做網(wǎng)站,婁煩網(wǎng)站改版等技術(shù)服務。擁有十多年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。
<%@ include file="../common/h.jsp"%>
<body ng-controller="addCombineCtrl" class="ng-cloak">
<div id="content">
<div class="container-fluid">
<form name="addNewProdCombineForm">
<div id="combineProdBaseInfoDiv" ng-show="ctrl.combineProdBaseInfoCtrl" ng-controller="CombineProdBaseInfoCtrl">
<%@ include file="./combineProdBaseInfo.jsp"%>
</div>
<div id="combineProdPackageDiv" ng-show="ctrl.combineProdPackageCtrl" ng-controller="CombineProdPackageCtrl">
<%@ include file="./combineProdPackage.jsp"%>
</div>
<div id="combineProdRuleDiv" ng-show="ctrl.combineProdRuleCtrl" ng-controller="CombineProdRuleCtrl">
<%@ include file="./combineProdRule.jsp"%>
</div>
<div id="combineProdDepartmentDiv" ng-show="ctrl.combineProdDepartmentCtrl" ng-controller="CombineProdDepartmentCtrl">
<%@ include file="./combineProdDepartment.jsp"%>
</div>
</form>
</div>
</div>
<%@ include file="../common/script.jsp" %>
<!-- 這里是加載對應的js資源 -->
<script type="text/javascript" src="../../js/product/combineProdBaseInfo.js"></script>
<script type="text/javascript" src="../../js/product/combineProdPackage.js"></script>
<script type="text/javascript" src="../../js/product/combineProdRule.js"></script>
<script type="text/javascript" src="../../js/product/combineProdDepartment.js"></script>
<script language="javascript">
//加載模塊
seajs.use("../../js/product/addNewCombine");
</script>
</body>
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 = [];//有無的產(chǎn)品大類列表
//刪除產(chǎn)品
$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
};
//顯示產(chǎn)品類型描述
$scope.getProductTypeDesc = function(productType){
var desc = productType;
if("1" == productType){
desc = "標準產(chǎn)品";
}else if("2" == productType){
desc = "自選產(chǎn)品";
}
return desc;
};
});
};
});
3)其他相關(guān)的js同combineProdBaseInfo.js內(nèi)容相同,不再敘述
分享題目:angularjs復雜頁面如何構(gòu)建
文章地址:http://www.rwnh.cn/article0/jgpsio.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計公司、小程序開發(fā)、營銷型網(wǎng)站建設、靜態(tài)網(wǎng)站、網(wǎng)站維護、用戶體驗
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)