1778 Refactor worker.phone
This commit is contained in:
parent
b78447bdd7
commit
85bcb356d4
|
@ -1,9 +1,8 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
class Controller {
|
||||
constructor($scope, $stateParams) {
|
||||
constructor($scope) {
|
||||
this.$scope = $scope;
|
||||
this.$stateParams = $stateParams;
|
||||
}
|
||||
|
||||
get worker() {
|
||||
|
@ -12,12 +11,15 @@ class Controller {
|
|||
|
||||
set worker(value) {
|
||||
this._worker = value;
|
||||
if (value) {
|
||||
this.$scope.$applyAsync(()=> {
|
||||
this.$scope.model.link = {userFk: value.userFk};
|
||||
this.$scope.model.refresh();
|
||||
});
|
||||
}
|
||||
if (value)
|
||||
this.setLink(value);
|
||||
}
|
||||
|
||||
setLink(value) {
|
||||
this.$scope.$applyAsync(()=> {
|
||||
this.$scope.model.link = {userFk: value.userFk};
|
||||
this.$scope.model.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
|
@ -34,7 +36,7 @@ class Controller {
|
|||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$scope', '$stateParams'];
|
||||
Controller.$inject = ['$scope'];
|
||||
|
||||
ngModule.component('vnWorkerPhones', {
|
||||
template: require('./index.html'),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{"state": "worker.card.pbx", "icon": "icon-pbx"},
|
||||
{"state": "worker.card.calendar", "icon": "icon-calendar"},
|
||||
{"state": "worker.card.timeControl", "icon": "access_time"},
|
||||
{"state": "worker.card.phones", "icon": "icon-pbx"}
|
||||
{"state": "worker.card.phones", "icon": "contact_phone"}
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue