Commit 79b3eaa1 authored by Ken you's avatar Ken you

update gruntfile app to scripts---Ken

parent 7ef966a4
......@@ -339,12 +339,12 @@ grunt.initConfig({
dest: '<%= pkg.bundleTemp %>/taxDocumentManage.js'
},
appJs: {
src: ["app/app.js",
"app/app.config.js",
"app/module-part1.js",
"app/module-part2.js",
"app/module-part3.js",
"app/module-part4.js"
src: ["Scripts/app.js",
"Scripts/app.config.js",
"Scripts/module-part1.js",
"Scripts/module-part2.js",
"Scripts/module-part3.js",
"Scripts/module-part4.js"
],
dest: '<%= pkg.bundleTemp %>/app.js'
},
......
......@@ -120,6 +120,8 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
urlTemplate: '/app-resources/i18n/{lang}/{part}.json'
});
region = window.localStorage.langTemp || region;
$translateProvider
.preferredLanguage(region)
.fallbackLanguage(region);
......@@ -303,9 +305,9 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
return translation;
}
])
.controller('AppController', ['$scope', '$log', '$location', '$translate', '$translatePartialLoader',
.controller('AppController', ['$rootScope','$scope', '$log', '$location', '$translate', '$translatePartialLoader',
'$window', 'appRoute', 'application', 'appTranslation', '$timeout', '$uibModal', 'loginContext', '$ExceptionlessClient', 'signalRSvc',
'exceptionlessServerURL', function ($scope, $log, $location, $translate, $translatePartialLoader, $window, appRoute,
'exceptionlessServerURL', function ($rootScope,$scope, $log, $location, $translate, $translatePartialLoader, $window, appRoute,
application, appTranslation, $timeout, $uibModal, loginContext, $ExceptionlessClient, signalRSvc, exceptionlessServerURL) {
'use strict';
$log.debug('AppController.ctor()...');
......@@ -333,7 +335,29 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
$log.debug('$stateChangeSuccess: ');
});
var langs = {};
try {
var obj= JSON.parse(window.localStorage.lang);
if(typeof obj == 'object' && obj ){
langs = obj;
}
} catch(e) {}
var region = langs[loginContext.userName] || 'en-us';
var flag = window.localStorage.langTemp;
$rootScope.changeLanguage = function(lang){
$translate.use(lang);
appTranslation.loadAll();
$rootScope.currentLanguage = lang;
$rootScope.currentLanguageDesc = $rootScope.currentLanguage == 'en-us' ? 'Switch to Chinese':'切换至英文';
langs[loginContext.userName] = lang;
window.localStorage.lang = JSON.stringify(langs);
window.localStorage.langTemp = lang;
if(flag !== window.localStorage.langTemp){
window.location.reload();
}
};
$rootScope.changeLanguage(region);
// publish unbeforeunload event to child scopes
$scope.onbeforeunload = function () {
$scope.$broadcast(application.events.beforeUnload);
......
......@@ -792,6 +792,22 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.cashFlow',
url: '/cashFlow',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-cash-flow></vat-preview-cash-flow>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.offBalanceSheet',
......
......@@ -324,6 +324,40 @@ var vatDashboardModule = angular.module('app.vatDashboard', ['ui.grid', 'ui.grid
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'citAnalyzeOrganizeDashboard',
url: '/citAnalyzeOrganizeDashboard/{id}',
views: {
'@cit.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat, appTranslation.cit]);
}],
template: '<cit-organization-dashboard></cit-organization-dashboard>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'citAnalyzeOrganizeDashboardConfig',
url: '/citAnalyzeOrganizeDashboardConfig/{id}',
views: {
'@cit.analyzeLayout': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat, appTranslation.cit]);
}],
template: '<cit-report-analysis-dashboard-config></cit-report-analysis-dashboard-config>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
deepStateRedirect: true,
sticky: true
});
}]);
......
......@@ -1839,6 +1839,8 @@
"trialBalance": "科目余额表",
"TrialBalanceDDTitle": "科目余额表",
"cashFlow":"现金流量表",
"CashFlowDDTitle":"现金流量表",
"TBAccountCode": "科目编号",
......@@ -1869,6 +1871,10 @@
"YtdDrBeq": "本年借方发生额",
"YtdCrBeq": "本年贷方发生额",
"dateFormat4YearMonth": " yyyy 年 mm 月",
"dateFormat4YearMonthDay": "yyyy-mm-dd",
"dateFormat4YearMonthDayCh": "yyyy年mm月dd日",
"offlineBilling": "线下开票",
"vatInvoiceRecord": "已开增值税发票记录",
"ApplicationSector": "申请部门",
......
......@@ -482,6 +482,9 @@ constant.vatPermission = {
},
journal: {
queryCode: '02.002.018'
},
cashFlow: {
queryCode: '02.002.019'
}
},
dataManage: {
......
......@@ -55,6 +55,10 @@ function ($scope, $log, $translate, $location, loginContext, enums, vatSessionSe
{
name: 'journal', permission: constant.vatPermission.dataPreview.journal.queryCode,
text: $translate.instant('journal'), icon: 'fa fa-file-text-o', show: true
},
{
name: 'cashFlow', permission: constant.vatPermission.dataPreview.cashFlow.queryCode,
text: $translate.instant('cashFlow'), icon: 'fa fa-file-text-o', show: true
},
{
name: 'invoiceRecord', permission: constant.vatPermission.dataPreview.invoiceRecord.queryCode,
......
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