-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db5a4fd
commit 412c969
Showing
4 changed files
with
245 additions
and
245 deletions.
There are no files selected for viewing
132 changes: 66 additions & 66 deletions
132
src/app/app-portal/pages/theme-import/components/theme-import-cultures/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
app.component("themeImportCultures", { | ||
templateUrl: | ||
"/mix-app/views/app-portal/pages/theme-import/components/theme-import-cultures/view.html", | ||
controller: [ | ||
"$rootScope", | ||
"$scope", | ||
"ngAppSettings", | ||
function ($rootScope, $scope, ngAppSettings) { | ||
var ctrl = this; | ||
var service = $rootScope.getRestService("mix-culture"); | ||
ctrl.selectAllContent = false; | ||
ctrl.request = angular.copy(ngAppSettings.request); | ||
ctrl.$onInit = async () => { | ||
ctrl.getList(); | ||
}; | ||
ctrl.getList = async (cultureIndex) => { | ||
if (cultureIndex !== undefined) { | ||
ctrl.request.cultureIndex = cultureIndex; | ||
} | ||
if (ctrl.request.fromDate !== null) { | ||
var d = new Date(ctrl.request.fromDate); | ||
ctrl.request.fromDate = d.toISOString(); | ||
} | ||
if (ctrl.request.toDate !== null) { | ||
var d = new Date(ctrl.request.toDate); | ||
ctrl.request.toDate = d.toISOString(); | ||
} | ||
let getData = await service.getList(ctrl.request); | ||
if (getData.success) { | ||
ctrl.data = getData.data; | ||
} | ||
}; | ||
ctrl.selectContent = (culture, selected) => { | ||
ctrl.selectAllContent = ctrl.selectAllContent && selected; | ||
ctrl.selectAllData = ctrl.selectAllData && selected; | ||
culture.isImportData = selected && culture.isImportData; | ||
ctrl.updateContent([culture.id], selected); | ||
}; | ||
ctrl.updateContent = function (arr, selected) { | ||
if (selected) { | ||
ctrl.importThemeDto.cultureIds = ctrl.unionArray( | ||
ctrl.importThemeDto.cultureIds, | ||
arr | ||
); | ||
} else { | ||
ctrl.importThemeDto.cultureIds = | ||
ctrl.importThemeDto.cultureIds.filter((m) => arr.indexOf(m) < 0); | ||
ctrl.updateData(arr, false); | ||
} | ||
}; | ||
ctrl.selectAll = function (arr) { | ||
// ctrl.selectedList.data = []; | ||
var ids = arr.map(function (obj) { | ||
return obj.id; | ||
}); | ||
ctrl.updateContent(ids, ctrl.selectAllContent); | ||
angular.forEach(arr, function (e) { | ||
e.isActived = ctrl.selectAllContent; | ||
}); | ||
}; | ||
ctrl.unionArray = (a, b) => { | ||
return [...new Set([...a, ...b])]; | ||
}; | ||
templateUrl: | ||
"/mix-app/views/app-portal/pages/theme-import/components/theme-import-cultures/view.html", | ||
controller: [ | ||
"$rootScope", | ||
"$scope", | ||
"ngAppSettings", | ||
function ($rootScope, $scope, ngAppSettings) { | ||
var ctrl = this; | ||
var service = $rootScope.getRestService("culture"); | ||
ctrl.selectAllContent = false; | ||
ctrl.request = angular.copy(ngAppSettings.request); | ||
ctrl.$onInit = async () => { | ||
ctrl.getList(); | ||
}; | ||
ctrl.getList = async (cultureIndex) => { | ||
if (cultureIndex !== undefined) { | ||
ctrl.request.cultureIndex = cultureIndex; | ||
} | ||
if (ctrl.request.fromDate !== null) { | ||
var d = new Date(ctrl.request.fromDate); | ||
ctrl.request.fromDate = d.toISOString(); | ||
} | ||
if (ctrl.request.toDate !== null) { | ||
var d = new Date(ctrl.request.toDate); | ||
ctrl.request.toDate = d.toISOString(); | ||
} | ||
let getData = await service.getList(ctrl.request); | ||
if (getData.success) { | ||
ctrl.data = getData.data; | ||
} | ||
}; | ||
ctrl.selectContent = (culture, selected) => { | ||
ctrl.selectAllContent = ctrl.selectAllContent && selected; | ||
ctrl.selectAllData = ctrl.selectAllData && selected; | ||
culture.isImportData = selected && culture.isImportData; | ||
ctrl.updateContent([culture.id], selected); | ||
}; | ||
ctrl.updateContent = function (arr, selected) { | ||
if (selected) { | ||
ctrl.importThemeDto.cultureIds = ctrl.unionArray( | ||
ctrl.importThemeDto.cultureIds, | ||
arr | ||
); | ||
} else { | ||
ctrl.importThemeDto.cultureIds = | ||
ctrl.importThemeDto.cultureIds.filter((m) => arr.indexOf(m) < 0); | ||
ctrl.updateData(arr, false); | ||
} | ||
}; | ||
ctrl.selectAll = function (arr) { | ||
// ctrl.selectedList.data = []; | ||
var ids = arr.map(function (obj) { | ||
return obj.id; | ||
}); | ||
ctrl.updateContent(ids, ctrl.selectAllContent); | ||
angular.forEach(arr, function (e) { | ||
e.isActived = ctrl.selectAllContent; | ||
}); | ||
}; | ||
ctrl.unionArray = (a, b) => { | ||
return [...new Set([...a, ...b])]; | ||
}; | ||
}, | ||
], | ||
bindings: { | ||
importThemeDto: "=", | ||
}, | ||
], | ||
bindings: { | ||
importThemeDto: "=", | ||
}, | ||
}); |
132 changes: 66 additions & 66 deletions
132
src/app/app-portal/pages/theme/components/theme-export-cultures/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
app.component("themeExportCultures", { | ||
templateUrl: | ||
"/mix-app/views/app-portal/pages/theme/components/theme-export-cultures/view.html", | ||
controller: [ | ||
"$rootScope", | ||
"$scope", | ||
"ngAppSettings", | ||
function ($rootScope, $scope, ngAppSettings) { | ||
var ctrl = this; | ||
var service = $rootScope.getRestService("mix-culture"); | ||
ctrl.selectAllContent = false; | ||
ctrl.request = angular.copy(ngAppSettings.request); | ||
ctrl.$onInit = async () => { | ||
ctrl.getList(); | ||
}; | ||
ctrl.getList = async (cultureIndex) => { | ||
if (cultureIndex !== undefined) { | ||
ctrl.request.cultureIndex = cultureIndex; | ||
} | ||
if (ctrl.request.fromDate !== null) { | ||
var d = new Date(ctrl.request.fromDate); | ||
ctrl.request.fromDate = d.toISOString(); | ||
} | ||
if (ctrl.request.toDate !== null) { | ||
var d = new Date(ctrl.request.toDate); | ||
ctrl.request.toDate = d.toISOString(); | ||
} | ||
let getData = await service.getList(ctrl.request); | ||
if (getData.success) { | ||
ctrl.data = getData.data; | ||
} | ||
}; | ||
ctrl.selectContent = (culture, selected) => { | ||
ctrl.selectAllContent = ctrl.selectAllContent && selected; | ||
ctrl.selectAllData = ctrl.selectAllData && selected; | ||
culture.isExportData = selected && culture.isExportData; | ||
ctrl.updateContent([culture.id], selected); | ||
}; | ||
ctrl.updateContent = function (arr, selected) { | ||
if (selected) { | ||
ctrl.exportThemeDto.cultureIds = ctrl.unionArray( | ||
ctrl.exportThemeDto.cultureIds, | ||
arr | ||
); | ||
} else { | ||
ctrl.exportThemeDto.cultureIds = | ||
ctrl.exportThemeDto.cultureIds.filter((m) => arr.indexOf(m) < 0); | ||
ctrl.updateData(arr, false); | ||
} | ||
}; | ||
ctrl.selectAll = function (arr) { | ||
// ctrl.selectedList.data = []; | ||
var ids = arr.map(function (obj) { | ||
return obj.id; | ||
}); | ||
ctrl.updateContent(ids, ctrl.selectAllContent); | ||
angular.forEach(arr, function (e) { | ||
e.isActived = ctrl.selectAllContent; | ||
}); | ||
}; | ||
ctrl.unionArray = (a, b) => { | ||
return [...new Set([...a, ...b])]; | ||
}; | ||
templateUrl: | ||
"/mix-app/views/app-portal/pages/theme/components/theme-export-cultures/view.html", | ||
controller: [ | ||
"$rootScope", | ||
"$scope", | ||
"ngAppSettings", | ||
function ($rootScope, $scope, ngAppSettings) { | ||
var ctrl = this; | ||
var service = $rootScope.getRestService("culture"); | ||
ctrl.selectAllContent = false; | ||
ctrl.request = angular.copy(ngAppSettings.request); | ||
ctrl.$onInit = async () => { | ||
ctrl.getList(); | ||
}; | ||
ctrl.getList = async (cultureIndex) => { | ||
if (cultureIndex !== undefined) { | ||
ctrl.request.cultureIndex = cultureIndex; | ||
} | ||
if (ctrl.request.fromDate !== null) { | ||
var d = new Date(ctrl.request.fromDate); | ||
ctrl.request.fromDate = d.toISOString(); | ||
} | ||
if (ctrl.request.toDate !== null) { | ||
var d = new Date(ctrl.request.toDate); | ||
ctrl.request.toDate = d.toISOString(); | ||
} | ||
let getData = await service.getList(ctrl.request); | ||
if (getData.success) { | ||
ctrl.data = getData.data; | ||
} | ||
}; | ||
ctrl.selectContent = (culture, selected) => { | ||
ctrl.selectAllContent = ctrl.selectAllContent && selected; | ||
ctrl.selectAllData = ctrl.selectAllData && selected; | ||
culture.isExportData = selected && culture.isExportData; | ||
ctrl.updateContent([culture.id], selected); | ||
}; | ||
ctrl.updateContent = function (arr, selected) { | ||
if (selected) { | ||
ctrl.exportThemeDto.cultureIds = ctrl.unionArray( | ||
ctrl.exportThemeDto.cultureIds, | ||
arr | ||
); | ||
} else { | ||
ctrl.exportThemeDto.cultureIds = | ||
ctrl.exportThemeDto.cultureIds.filter((m) => arr.indexOf(m) < 0); | ||
ctrl.updateData(arr, false); | ||
} | ||
}; | ||
ctrl.selectAll = function (arr) { | ||
// ctrl.selectedList.data = []; | ||
var ids = arr.map(function (obj) { | ||
return obj.id; | ||
}); | ||
ctrl.updateContent(ids, ctrl.selectAllContent); | ||
angular.forEach(arr, function (e) { | ||
e.isActived = ctrl.selectAllContent; | ||
}); | ||
}; | ||
ctrl.unionArray = (a, b) => { | ||
return [...new Set([...a, ...b])]; | ||
}; | ||
}, | ||
], | ||
bindings: { | ||
exportThemeDto: "=", | ||
}, | ||
], | ||
bindings: { | ||
exportThemeDto: "=", | ||
}, | ||
}); |
Oops, something went wrong.