Commit 98affeeb authored by Mccoy Z Xia's avatar Mccoy Z Xia

calendar action 页面调整

parent a1553a9a
......@@ -68,10 +68,13 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
private boolean insertAction(CalendarActionDto dto) {
Date createTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setStatus((byte) 1);
action.setId(idService.nextId());
action.setCreateTime(createTime);
action.setUpdateTime(createTime);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
List<CalendarActionJurisdictionRelationship> relationshipList = new ArrayList<>();
......@@ -108,7 +111,6 @@ public class CalendarActionServiceImpl extends BaseService implements ICalendarA
Date updateTime = new Date();
CalendarAction action = actionTMapper.toCalendarAction(dto);
action.setUpdateTime(updateTime);
action.setStatus((byte) 1);
List<CalendarJurisdictionDto> list = dto.getJurisdictionDtoList();
List<CalendarJurisdiction> jurisdictionList = new ArrayList<>();
......
......@@ -193,7 +193,26 @@
};
$scope.deleteAction = function (action) {
// 删除确认
$scope.confirmDelete = function (action) {
SweetAlert.swal({
title: $translate.instant('Confirm') + " " + $translate.instant('Delete') + '?',
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
deleteAction(action);
}
});
}
var deleteAction = function (action) {
calendarActionService.deleteCalendarAction(action.id).success(function (result) {
if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess'));
......@@ -202,11 +221,31 @@
} else {
SweetAlert.warning($translate.instant('SystemException'));
}
}).error(function () {
SweetAlert.warning($translate.instant('SystemException'));
});
};
$scope.addAction = function () {
var newAction = {
status: 0,
jurisdictionDtoList: [
{
area: 1,
logicNum: 0,
logicUnit: 0
}, {
area: 2,
logicNum: 0,
logicUnit: 0
}, {
area: 3,
logicNum: 0,
logicUnit: 0
}
]
};
$scope.editAction(newAction, "Add");
};
//action detail 弹框相关
......@@ -216,19 +255,17 @@
$scope.cancelActionText = textConfig.cancelText;
$scope.saveActionText = textConfig.createText;
var actionModel = {};
actionModel = angular.copy(action);
if (type === "Edit") {
$scope.title = action ? "Edit Action" : "Add Action";
actionModel = angular.copy(action);
$scope.title = "Edit Action";
$scope.saveActionText = textConfig.saveText;
} else if (type === "Show") {
actionModel = angular.copy(action);
$scope.title = "Action Details";
$scope.actionReadOnly = true;
$scope.cancelActionText = textConfig.confirmText;
} else if (type === "Add") {
actionModel = angular.copy(action);
$scope.title = "Create Action";
$scope.cancelActionText = textConfig.createText;
} else {
return;
}
......@@ -237,9 +274,15 @@
return;
}
var formInstance;
$scope.formOptions = {
formData: actionModel,
readOnly: $scope.actionReadOnly,
showColonAfterLabel: true,
validationGroup: "actionData",
onInitialized: function(e) {
formInstance = e.component;
},
items: [
{
colSpan: 2,
......@@ -395,7 +438,15 @@
};
$scope.saveAction = function () {
actionModel.status = actionModel.status ? "1" : "0";
var dxResult = DevExpress.validationEngine.validateGroup("actionData").isValid;
if (!dxResult) {
return;
}
actionModel.jurisdictionDtoList.forEach(function (value) {
value.status = value.status ? "1" : "0";
});
calendarActionService.saveCalendarAction(actionModel).success(function (result) {
if (result.result) {
SweetAlert.success($translate.instant('CommonSuccess'));
......@@ -423,7 +474,9 @@
refreshTaskTypeList();
};
$scope.refreshAll = {};
$scope.refreshAll = function () {
refreshAll();
};
var textConfig = {
confirmText: $translate.instant('ButtonConfirm'),
......@@ -434,7 +487,6 @@
};
(function () {
$scope.refreshAll = refreshAll();
refreshAll();
})();
......
......@@ -32,6 +32,38 @@
font-size: larger;
}
.action-title {
width: 96%;
margin: 2% 2%;
padding-bottom: 15px;
}
.new-action {
display: block;
margin: 15px 25px;
font-size: inherit;
color: red;
outline: none;
}
.action-refresh {
float: right;
color: rgba(0, 0, 0, 0.66);
border: 2px solid rgba(0, 0, 0, 0.4);
border-radius: 8px;
height: 45px;
width: 120px;
font-size: 19px;
text-align: center;
line-height: 45px;
outline: none;
}
.action-refresh i {
margin-right: 7px;
font-size: 23px;
}
#table-body {
background-color: #ffffff;
}
......@@ -45,7 +77,7 @@
}
#table-body .dx-checkbox-icon {
background: #bbb;
border-color: #bbb;
}
#table-body .logic-num {
......
......@@ -1741,6 +1741,9 @@ constant.trigger = {
logicUnit: [
{
id: 0,
name: "N/A"
}, {
id: 1,
name: "Calendar Day"
}, {
......@@ -1750,7 +1753,7 @@ constant.trigger = {
id: 3,
name: "Month"
}, {
id: 3,
id: 4,
name: "Year"
}
]
......
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