加入删除任务功能

This commit is contained in:
java110 2020-06-03 17:47:00 +08:00
parent bab4e8063e
commit d98f579512
3 changed files with 75 additions and 2 deletions

View File

@ -0,0 +1,19 @@
<div class="modal fade" id="deleteJobModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<tr align="center"><th>确定删除任务</th></tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteJobModel()">点错了</button>
<button type="button" class="btn btn-primary" v-on:click="deleteJob()">确认删除</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,54 @@
(function(vc,vm){
vc.extends({
data:{
deleteJobInfo:{
}
},
_initMethod:function(){
},
_initEvent:function(){
vc.on('deleteJob','openDeleteJobModal',function(_params){
vc.component.deleteJobInfo = _params;
$('#deleteJobModel').modal('show');
});
},
methods:{
deleteJob:function(){
//vc.component.deleteJobInfo.communityId=vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'task.deleteTask',
JSON.stringify(vc.component.deleteJobInfo),
{
emulateJSON:true
},
function(json,res){
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
//let data = res.data;
if (_json.code == 200) {
//关闭model
$('#deleteJobModel').modal('hide');
vc.component.clearAddJobInfo();
vc.emit('jobManage', 'listJob', {});
return;
}
vc.toast(_json.msg);
},
function(errInfo,error){
console.log('请求失败处理');
vc.toast(json);
});
},
closeDeleteJobModel:function(){
$('#deleteJobModel').modal('hide');
}
}
});
})(window.vc,window.vc.component);

View File

@ -115,7 +115,7 @@
</div>
<vc:create path="dev/addJob"></vc:create>
<!-- <vc:create path="dev/editJob"></vc:create>
<vc:create path="dev/deleteJob"></vc:create> -->
<!-- <vc:create path="dev/editJob"></vc:create>-->
<vc:create path="dev/deleteJob"></vc:create>
</div>