mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-26 08:16:47 +08:00
加入删除任务功能
This commit is contained in:
parent
bab4e8063e
commit
d98f579512
19
public/components/dev/deleteJob/deleteJob.html
Normal file
19
public/components/dev/deleteJob/deleteJob.html
Normal 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">×</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>
|
||||
54
public/components/dev/deleteJob/deleteJob.js
Normal file
54
public/components/dev/deleteJob/deleteJob.js
Normal 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);
|
||||
@ -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>
|
||||
Loading…
Reference in New Issue
Block a user