master
yuan 7 years ago
parent d30c1b7312
commit 2bc68b8456

@ -48,6 +48,7 @@ public class AppActServiceImp implements AppActService {
Assert.notNull(act);
JSONObject params = appActBean.toJsonParam();
params.put("act_id",act_id);
params.put("update_time",new Date());
actAppMapper.updateAct(params);
}

@ -47,7 +47,16 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}]);
app.controller('appActNewCtrl', ['$rootScope', '$scope', '$http', 'commonDialog','$state', function ($rootScope, $scope, $http, commonDialog,$state) {
$scope.actDetail = {};
$scope.submit = function () {
$scope.submit = function (form) {
$scope.errmsg = null;
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
$http.put('/manager/app/act/new', $scope.actDetail).then(function (resp) {
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true});

@ -18,29 +18,37 @@
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-horizontal">
<div class="form-group">
<form novalidate class="form-horizontal" name="appActForm">
<div class="form-group"
ng-class="{'has-error':appActForm.act_name.$invalid && appActForm.act_name.$dirty}">
<label class="control-label col-xs-4 col-sm-2"
for="actDetail.act_name">Title</label>
for="actDetail.act_name">Title *</label>
<div class="col-xs-8 col-sm-4">
<input type="text" class="form-control" id="actDetail.act_name"
ng-model="actDetail.act_name">
<input type="text" class="form-control" id="actDetail.act_name" name="act_name"
ng-model="actDetail.act_name" required>
<div ng-messages="appActForm.act_name.$error" ng-if="appActForm.act_name.$dirty">
<p class="small text-danger" ng-message="required">Title is required</p>
</div>
<div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.desc">ACT
Desc</label>
</div>
<div class="form-group"
ng-class="{'has-error':appActForm.desc.$invalid && appActForm.desc.$dirty}">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.desc">ACT Desc *</label>
<div class="col-xs-8 col-sm-4">
<input type="text" class="form-control" id="actDetail.desc"
ng-model="actDetail.desc">
<textarea class="form-control" id="actDetail.desc" name="desc"
ng-model="actDetail.desc" required></textarea>
<div ng-messages="appActForm.desc.$error" ng-if="appActForm.desc.$dirty">
<p class="small text-danger" ng-message="required">Desc is required</p>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.parms_json">Parms
Json</label>
<div class="col-xs-8 col-sm-4">
<input type="text" class="form-control" id="actDetail.parms_json"
ng-model="actDetail.parms_json">
<textarea class="form-control" id="actDetail.parms_json"
ng-model="actDetail.parms_json"></textarea>
</div>
</div>
<div class="form-group">
@ -72,11 +80,11 @@
<div class="col-xs-8 col-sm-4">
<label class="radio-inline">
<input type="radio" name="optionsRadiosinline" id="optionsRadios3" value="0" checked
ng-model="actDetail.show_type"> Act Url
ng-model="actDetail.show_type"> Url
</label>
<label class="radio-inline">
<input type="radio" name="optionsRadiosinline" id="optionsRadios4" value="1"
ng-model="actDetail.show_type"> Act Content
ng-model="actDetail.show_type"> Content
</label>
</div>
</div>
@ -98,17 +106,17 @@
</div>
<div class="col-xs-12">
<div class="btn-group">
<button class="btn btn-success" type="button" ng-click="submit()">
<button class="btn btn-success" type="button" ng-click="submit(appActForm)">
Submit
</button>
</div>
<div class="btn-group">
<button class="btn btn-danger" type="button" ng-click="$dismiss()">
<button class="btn btn-danger" type="button" ui-sref="appAct">
Cancel
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>

@ -20,7 +20,7 @@
<button class="btn btn-success" type="button" ui-sref=".new"><i class="fa fa-plus"></i> New ACT</button>
<div class="checkbox">
<label>
<input type="checkbox" ng-click="loadActAppList()" ng-model="params.is_valid">Published
<input type="checkbox" ng-click="loadActAppList(1)" ng-model="params.is_valid">Published
</label>
</div>
</div>

Loading…
Cancel
Save