1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
| /**
| * Created by wisestone on 2019-02-19.
| */
| 'use strict';
|
| define([
| 'app'
| ],
| function (app) {
| app.controller('workflowStatusModifyController', ['$scope', '$rootScope', '$log', '$resourceProvider','$uibModalInstance', 'WorkflowStatus', 'parameter', 'SweetAlert', '$state',
| function ($scope, $rootScope, $log, $resourceProvider, $uibModalInstance, WorkflowStatus, parameter, SweetAlert, $state) {
|
| $scope.fn = {
| cancel : cancel, // 팝업창 닫기
| formSubmit : formSubmit, // 폼 전송
| formCheck : formCheck, // 폼 체크
| detail : detail // 상세 정보 조회
| };
|
| $scope.vm = {
| form : {
| id : parameter.id,
| projectId : "",
| name : "",
| color : ""
| }
| };
|
| // 폼 체크
| function formCheck(formInvalid) {
| if (formInvalid) {
| return true;
| }
|
| return false;
| }
|
| // 폼 전송
| function formSubmit() {
| WorkflowStatus.modify($resourceProvider.getContent(
| $scope.vm.form,
| $resourceProvider.getPageContent(0, 10))).then(function (result) {
|
| if (result.data.message.status == "success") {
| $scope.fn.cancel();
| $state.go($state.current, {}, {reload : true});
| }
| else {
| SweetAlert.swal("상태 수정 실패", result.data.message.message, "error");
| }
| });
| }
|
| // 팝업 창 닫기
| function cancel() {
| $uibModalInstance.dismiss('cancel');
| }
|
| // 상세 정보
| function detail() {
| WorkflowStatus.detail($resourceProvider.getContent(
| $scope.vm.form,
| $resourceProvider.getPageContent(0, 10))).then(function (result) {
|
| if (result.data.message.status == "success") {
| $scope.vm.form.name = result.data.data.name;
| $scope.vm.form.color = result.data.data.color;
| }
| else {
| SweetAlert.swal("상태 상세 정보 조회 실패", result.data.message.message, "error");
| }
| });
| }
|
| $scope.fn.detail();
|
| }]);
| });
|
|