mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
2 lines
1.6 KiB
JavaScript
Vendored
2 lines
1.6 KiB
JavaScript
Vendored
import{m as i,a as n,n as l}from"./app.2ab5f89e.js";var r=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"task-menu-icon",on:{click:t.handleClick}},[t.loadIng?e("div",{staticClass:"loading"},[e("Loading")],1):[t.task.complete_at?e("Icon",{staticClass:"completed",attrs:{type:t.completedIcon}}):e("Icon",{staticClass:"uncomplete",attrs:{type:t.icon}})]],2)},d=[];const c={name:"TaskMenu",props:{task:{type:Object,default:()=>({})},loadStatus:{type:Boolean,default:!1},colorShow:{type:Boolean,default:!0},updateBefore:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"small"},icon:{type:String,default:"md-radio-button-off"},completedIcon:{type:String,default:"md-checkmark-circle"}},computed:{...i(["loads","taskFlows"]),...n(["isLoad"]),loadIng(){return this.loadStatus?!0:this.isLoad(`task-${this.task.id}`)}},methods:{handleClick(t){this.$store.state.taskOperation={event:t,task:this.task,loadStatus:this.loadStatus,colorShow:this.colorShow,updateBefore:this.updateBefore,disabled:this.disabled,size:this.size,onUpdate:s=>{this.$emit("on-update",s)}}},updateTask(t){if(this.loadIng)return;Object.keys(t).forEach(e=>this.$set(this.task,e,t[e]));const s=Object.assign(t,{task_id:this.task.id});this.$store.dispatch("taskUpdate",s).then(({data:e,msg:o})=>{$A.messageSuccess(o),this.$store.dispatch("saveTaskBrowse",s.task_id),this.$emit("on-update",e)}).catch(({msg:e})=>{$A.modalError(e),this.$store.dispatch("getTaskOne",s.task_id).catch(()=>{})})}}},a={};var u=l(c,r,d,!1,p,null,null,null);function p(t){for(let s in a)this[s]=a[s]}var m=function(){return u.exports}();export{m as T};
|