您好,登錄后才能下訂單哦!
1)主頁面 addNewCombine.jsp
<%@ 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 = [];//有無的產品大類列表
//刪除產品
$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內容相同,不再敘述
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。