1 line
31 KiB
PHP
1 line
31 KiB
PHP
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d24496b2"],{3312:function(t,e,a){},"752d":function(t,e,a){"use strict";a("3312")},d96ec:function(t,e,a){"use strict";a.r(e);a("7f7f");var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"project-space-task",class:"".concat(t.project.task_board_theme," ").concat(t.viewType)},[e("div",{staticClass:"project-navigation"},[e("div",{staticClass:"project-nav-header"},[e("a-breadcrumb",[e("a-breadcrumb-item",[e("a",{on:{click:t.toHome}},[e("a-icon",{attrs:{type:"home"}}),t._v(" 首页 ")],1)]),e("a-breadcrumb-item",[e("project-select",{staticClass:"nav-title",staticStyle:{display:"inline-block"},attrs:{code:t.code}}),e("span",{staticClass:"actions"},[e("a-tooltip",{attrs:{mouseEnterDelay:.3,title:t.project.collected?"取消收藏":"加入收藏"},on:{click:t.collectProject}},[e("a-icon",{directives:[{name:"show",rawName:"v-show",value:!t.project.collected,expression:"!project.collected"}],staticStyle:{color:"grey"},attrs:{type:"star",theme:"filled"}}),e("a-icon",{directives:[{name:"show",rawName:"v-show",value:t.project.collected,expression:"project.collected"}],staticStyle:{color:"#ffaf38"},attrs:{type:"star",theme:"filled"}})],1)],1),0===t.project.private?e("span",{staticClass:"label label-normal"},[e("a-icon",{attrs:{type:"global"}}),t._v(" 公开")],1):t._e()],1)],1)],1),e("section",{staticClass:"nav-body"},[e("ul",{staticClass:"nav-wrapper nav nav-underscore pull-left"},[t._m(0),e("li",{},[e("a",{staticClass:"app",attrs:{"data-app":"works"},on:{click:function(e){return t.$router.push("/project/space/files/"+t.code)}}},[t._v("\n 文件")])]),e("li",{},[e("a",{staticClass:"app",attrs:{"data-app":"build"},on:{click:function(e){return t.$router.push("/project/space/overview/"+t.code)}}},[t._v("\n 概览")])]),e("li",[e("a",{staticClass:"app",attrs:{"data-app":"build"},on:{click:function(e){return t.$router.push("/project/space/copy/"+t.code)}}},[t._v("\n 抄送")])])])]),e("div",{staticClass:"project-nav-footer"},[4!=t.userInfo.authorize?e("a",{staticClass:"footer-item",on:{click:function(e){return e.stopPropagation(),t.addTask()}}},[e("a-icon",{attrs:{type:"plus-circle"}}),e("span",[t._v(" 创建任务")])],1):t._e(),e("a",{staticClass:"footer-item",on:{click:function(e){return t.visibleDraw("taskSearch")}}},[e("a-icon",{attrs:{type:"search"}}),e("span",[t._v(" 筛选")])],1),e("a",{staticClass:"footer-item",class:{active:"member"==t.slideMenuKey},on:{click:function(e){return t.visibleDraw("member")}}},[e("a-icon",{attrs:{type:"user"}}),e("span",[t._v(" "+t._s(t.projectMembers.length))])],1),e("a",{staticClass:"footer-item",class:{active:"config"==t.slideMenuKey},on:{click:function(e){return t.visibleDraw("config")}}},[e("a-icon",{attrs:{type:"menu"}}),e("span",[t._v(" 菜单")])],1)])]),e("wrapper-content",{attrs:{showHeader:!1}},[e("div",{directives:[{name:"show",rawName:"v-show",value:"task-board"==t.viewType,expression:"viewType == 'task-board'"}],staticClass:"board-scrum-stages",attrs:{e:"",options:{group:"stages",filter:".undraggables",handle:".ui-sortable-handle",ghostClass:"stage-ghost",animation:200,forceFallback:!1},id:"board-scrum-stages"},on:{end:t.stageSort}},[t._l(t.taskStages,(function(a,s){return e("div",{key:s,staticClass:"scrum-stage",class:{"fixed-creator":1==a.fixedCreator},staticStyle:{width:"32vw","min-width":"400px"},attrs:{id:a.code}},[e("header",{directives:[{name:"show",rawName:"v-show",value:!a.tasksLoading,expression:"!stage.tasksLoading"}],staticClass:"scrum-stage-header ui-sortable-handle"},[e("div",{staticClass:"stage-name hinted"},[t._v("\n "+t._s(a.name)+"\n "),a.tasks.length>0?e("span",{staticClass:"task-count"},[t._v("\n · "+t._s(a.tasks.length))]):t._e()]),e("div",{staticClass:"stage-menu-toggler popover"},[e("a-dropdown",{attrs:{trigger:["click"],placement:"bottomCenter"}},[e("a-tooltip",{attrs:{placement:"top"}},[e("template",{slot:"title"},[e("span",[t._v("编辑任务列表")])]),e("a",{staticClass:"menu-toggler-title",attrs:{href:"javascript:void(0)"}},[e("a-icon",{staticStyle:{"font-size":"18px"},attrs:{type:"ellipsis"}})],1)],2),e("a-menu",{attrs:{slot:"overlay",selectable:!1},on:{click:t.doStage},slot:"overlay"},[e("a-menu-item",{key:"setExecutor_"+a.code+"_"+s},[e("a-icon",{attrs:{size:"14",type:"user"}}),t._v("\n 设置本列所有任务执行者\n ")],1),e("a-menu-item",{key:"recycleBatch_"+a.code+"_"+s},[e("a-icon",{attrs:{size:"14",type:"delete"}}),t._v("\n 本列所有任务移到回收站\n ")],1)],1)],1)],1)]),e("div",{staticClass:"scrum-stage-wrap ui-sortable",class:{"hidden-creator-bottom":a.showTaskCard}},[e("vue-scroll",{ref:s+"-stage",refInFor:!0,attrs:{ops:t.scrollOps}},[e("section",{staticClass:"scrum-stage-content thin-scroll",attrs:{id:a.code,"task-type-index":s}},[e("a-spin",{attrs:{wrapperClassName:"tasks-loading",spinning:a.tasksLoading}},[e("div",{staticClass:"scrum-stage-tasks",attrs:{options:{group:"task",ghostClass:"task-ghost",dragClass:"task-drag",fallbackClass:"task-drag",forceFallback:!1}},on:{end:t.taskSort}},[t._l(a.unDoneTasks,(function(a,i){return[!a.done&&a.canRead?e("div",{key:a.code,staticClass:"task task-card ui-sortable-handle",class:t.showTaskPri(a.pri),attrs:{index:i,id:a.code},on:{click:function(e){return e.stopPropagation(),t.taskDetail(a.code,s)}}},[e("div",{staticClass:"task-priority bg-priority-0"}),e("a-tooltip",{attrs:{placement:s>0?"top":"right"}},[e("template",{slot:"title"},[a.hasUnDone?e("span",{staticStyle:{"font-size":"12px"}},[t._v("子任务尚未全部完成,无法完成父任务")]):t._e()]),e("div",{staticClass:"check-box-wrapper"})],2),e("div",{staticClass:"task-content-set open-detail"},[e("div",{staticClass:"task-content-wrapper"},[e("div",{staticClass:"task-content",style:{overflowWrap:"anywhere"}},[t._v("\n "+t._s(a.name)+"\n ")]),a.executor&&a.executor.avatar?e("a-tooltip",{attrs:{placement:"top"}},[e("template",{slot:"title"},[e("span",[t._v(t._s(a.executor.name))])]),e("img",{staticClass:"avatar img-circle img-24 hinted",attrs:{src:a.executor.avatar,title:a.executor.name}})],2):t._e()],1),e("div",{staticClass:"task-info-wrapper clearfix"},[e("div",{staticClass:"task-infos"},[a.status?e("span",{staticClass:"icon-wrapper",style:{color:t.getStatusColor(a.status),fontSize:"12px"}},[t._v(t._s(a.statusText))]):t._e(),a.end_time?e("span",{staticClass:"label",class:t.showTimeLabel(a.end_time)},[e("span",{attrs:{title:a.end_time}},[t._v("\n "+t._s(t.showTaskTime(a.begin_time,a.end_time))+"\n ")])]):t._e(),a.description?e("span",{staticClass:"icon-wrapper muted"},[e("a-icon",{attrs:{type:"file-text"}})],1):t._e(),a.hasSource?e("span",{staticClass:"icon-wrapper muted"},[e("a-icon",{attrs:{type:"link"}})],1):t._e(),a.hasComment?e("span",{staticClass:"icon-wrapper muted"},[e("a-icon",{attrs:{type:"message"}})],1):t._e(),a.childCount[0]>0?e("span",{staticClass:"icon-wrapper muted"},[e("a-icon",{attrs:{type:"bars"}}),e("span",[t._v(t._s(a.childCount[1])+"/"+t._s(a.childCount[0]))])],1):t._e(),t._l(a.tags,(function(a){return e("span",{key:a.code,staticClass:"tag muted"},[e("a-badge",{class:"badge-".concat(a.tag.color),attrs:{status:"success"}}),t._v("\n "+t._s(a.tag.name)+"\n ")],1)})),a.execute_state>0?e("span",{class:"icon-wrapper text text-"+a.task_execute.color},[t._v(t._s(a.task_execute_name))]):t._e(),a.like?e("span",{staticClass:"icon-wrapper muted"},[e("a-icon",{attrs:{type:"like"}}),e("span",[t._v(t._s(a.like))])],1):t._e()],2)]),t.project.prefix&&t.project.open_prefix?e("footer",{staticClass:"task-info-footer"},[e("span",{staticClass:"task-id-number"},[t._v("\n "+t._s(t.project.prefix)+"-"+t._s(a.id_num)+"\n ")])]):t._e()])],1):t._e()]}))],2),e("div",{directives:[{name:"show",rawName:"v-show",value:a.showTaskCard,expression:"stage.showTaskCard"}],staticClass:"task-creator-wrap card",attrs:{id:"card"+s}},[e("form",{staticClass:"task-creator"},[e("a-input",{ref:"inputTaskName".concat(s),refInFor:!0,staticClass:"task-content-input",attrs:{type:"textarea",rows:3,placeholder:"任务内容"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.createTask(a.code,s)}},model:{value:t.task.name,callback:function(e){t.$set(t.task,"name",e)},expression:"task.name"}}),e("div",{staticClass:"handler-wrap"},[e("a-dropdown",{attrs:{trigger:["click"]}},[e("a",{staticClass:"executor-handler"},[e("img",{staticClass:"avatar img-circle img-24 hinted",attrs:{src:t.defaultExecutor.avatar}}),e("span",{staticClass:"creator-handler-text name"},[t._v(t._s(t.defaultExecutor.name))])]),e("a-menu",{staticClass:"executor-handler-menu",attrs:{slot:"overlay"},on:{click:t.selectExecutor},slot:"overlay"},t._l(t.projectMembers,(function(a,s){return e("a-menu-item",{key:s},[e("img",{staticClass:"avatar img-circle img-32 pull-left m-r-sm",attrs:{src:a.avatar}}),e("span",{staticClass:"muted",staticStyle:{"line-height":"25px"}},[t._v(t._s(a.name))]),a.code==t.defaultExecutor.code?e("a-icon",{staticClass:"muted",attrs:{type:"check"}}):t._e()],1)})),1)],1)],1),e("div",{staticClass:"submit-set"},[e("a-button",{staticClass:"middle-btn",attrs:{type:"default",size:"large"},on:{click:function(e){return e.stopPropagation(),t.showTaskCard(s,!1)}}},[t._v("取消\n ")]),e("a-button",{staticClass:"middle-btn",class:{"disabled-btn":!t.task.name},attrs:{loading:t.createTaskLoading,disabled:!t.task.name,type:"primary",size:"large"},on:{click:function(e){return e.stopPropagation(),t.createTask(a.code,s)}}},[t._v("创建\n ")])],1)],1)]),e("div",{staticClass:"scrum-stage-tasks-done",attrs:{options:{group:"task-done",ghostClass:"task-ghost",dragClass:"task-drag",fallbackClass:"task-drag",forceFallback:!1}},on:{end:t.taskSort}},[t._l(a.doneTasks,(function(a,i){return[a.canRead?e("div",{key:a.code,staticClass:"task done task-card ui-sortable-handle",attrs:{index:i,id:a.code},on:{click:function(e){return e.stopPropagation(),t.taskDetail(a.code,s)}}},[e("div",{staticClass:"task-priority bg-priority-0"}),e("span",{staticClass:"check-box-wrapper"}),e("div",{staticClass:"task-content-set open-detail"},[e("div",{staticClass:"task-content-wrapper"},[e("div",{staticClass:"task-content",style:{overflowWrap:"anywhere"}},[t._v("\n "+t._s(a.name)+"\n ")]),a.executor&&a.executor.avatar?e("a-tooltip",{attrs:{placement:"top"}},[e("template",{slot:"title"},[e("span",[t._v(t._s(a.executor.name))])]),a.executor&&a.executor.avatar?e("img",{staticClass:"avatar img-circle img-24 hinted",attrs:{src:a.executor.avatar,title:a.executor.name}}):t._e()],2):t._e()],1),e("div",{staticClass:"task-info-wrapper clearfix"},[e("div",{staticClass:"task-infos"},t._l(a.task_tag_item_list,(function(a,s){return e("span",{key:a.code,staticClass:"tag muted",class:"tag-color-"+a.color},[t._v("\n "+t._s(a.name)+"\n ")])})),0)])])]):t._e()]}))],2),e("div",{directives:[{name:"show",rawName:"v-show",value:a.canNotReadCount,expression:"stage.canNotReadCount"}],staticClass:"scrum-stage-tasks-done"},[e("li",{staticClass:"task muted",staticStyle:{margin:"0 10px 8px"}},[e("span",[e("a-icon",{attrs:{type:"lock"}}),t._v(" 有\n "+t._s(a.canNotReadCount)+"\n 个任务被隐藏(因为设置了仅参与者可见)")],1)])]),(a.showTaskCard,t._e())])],1)])],1)])})),t._e()],2),"task-table"!=t.viewType||t.loading?t._e():e("task-table",{attrs:{"project-code":this.code}}),e("router-view")],1),e("a-modal",{attrs:{width:360,title:t.stageModal.modalTitle,bodyStyle:{paddingBottom:"1px"},footer:null},model:{value:t.stageModal.modalStatus,callback:function(e){t.$set(t.stageModal,"modalStatus",e)},expression:"stageModal.modalStatus"}},[e("a-form",{attrs:{form:t.stageModal.form},on:{submit:function(e){return e.preventDefault(),t.editStage.apply(null,arguments)}}},[e("a-form-item",[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"请输入列表标题"}]}],expression:"[\n 'name',\n { rules: [{ required: true, message: '请输入列表标题' }] },\n ]"}],ref:"inputStageTitle",attrs:{placeholder:"列表标题"}})],1),e("a-form-item",[e("div",{staticClass:"action-btn pull-right"},[e("a",{staticClass:"cancel-text muted",attrs:{type:"text"},on:{click:function(e){t.stageModal.modalStatus=!1}}},[t._v("\n 取消\n ")]),e("a-button",{staticClass:"middle-btn",attrs:{type:"primary",htmlType:"submit"}},[t._v("保存")])],1)])],1)],1),e("a-drawer",{attrs:{wrapClassName:"info-drawer",title:"项目成员",width:"350",placement:"right",visible:t.inviteMemberDraw.visible},on:{close:function(e){t.inviteMemberDraw.visible=!1}}},[e("div",{staticClass:"search-content"},[e("a-input",{attrs:{size:"large",placeholder:"输入昵称或邮箱查找"},model:{value:t.inviteMemberDraw.keyword,callback:function(e){t.$set(t.inviteMemberDraw,"keyword",e)},expression:"inviteMemberDraw.keyword"}},[e("a-icon",{attrs:{slot:"prefix",type:"search"},slot:"prefix"})],1)],1),e("div",{staticClass:"member-list"},[e("div",{staticClass:"member-list-item ant-list-item header-action"},[e("div",{staticClass:"ant-list-item-meta",on:{click:function(e){t.showInviteMember=!0}}},[e("div",{staticClass:"ant-list-item-meta-avatar"},[e("a-avatar",{attrs:{icon:"plus"}})],1),e("div",{staticClass:"ant-list-item-meta-content"},[e("h4",{staticClass:"ant-list-item-meta-title"},[e("span",[t._v("邀请新成员")])])])])]),e("a-list",{attrs:{itemLayout:"horizontal",loading:t.inviteMemberDraw.searching,dataSource:t.projectMembers,locale:{emptyText:t.inviteMemberDraw.keyword&&t.inviteMemberDraw.keyword.length>1?"没有搜索到相关成员":""}},scopedSlots:t._u([{key:"renderItem",fn:function(a,s){return e("a-list-item",{staticClass:"member-list-item"},[a.is_owner?t._e():e("span",{attrs:{slot:"actions"},slot:"actions"},[e("a",{staticClass:"muted",on:{click:function(e){return t.removeMember(a,s)}}},[e("a-icon",{attrs:{type:"user-delete"}}),t._v(" 移除")],1)]),e("a-list-item-meta",{attrs:{description:a.email}},[e("span",{attrs:{slot:"title"},slot:"title"},[t._v(t._s(a.name))]),e("a-avatar",{attrs:{slot:"avatar",icon:"user",src:a.avatar},slot:"avatar"})],1)],1)}}])})],1)]),e("a-drawer",{attrs:{wrapClassName:"info-drawer",title:"项目设置",width:"350",placement:"right",visible:t.configDraw.visible},on:{close:function(e){t.configDraw.visible=!1}}},[e("div",{staticClass:"config-wrapper"},[e("ul",{staticClass:"config-menus"},[e("li",{staticClass:"menu-item"},[e("a",{on:{click:function(e){t.projectModal.modalStatus=!0}}},[e("a-icon",{attrs:{type:"setting"}}),t._v("\n 项目设置\n ")],1)]),e("li",{staticClass:"menu-item"},[e("a",{on:{click:function(e){t.recycleModal.modalStatus=!0}}},[e("a-icon",{attrs:{type:"delete"}}),t._v("\n 查看回收站\n ")],1)]),e("li",{staticClass:"menu-item"},[e("a",[e("a-icon",{attrs:{type:"logout"}}),t._v("\n 导出任务 *\n ")],1)]),e("li",{staticClass:"menu-item"},[e("a",[e("a-icon",{attrs:{type:"copy"}}),t._v("\n 复制项目 *\n ")],1)]),e("li",{staticClass:"menu-item"},[e("a",[e("a-icon",{attrs:{type:"block"}}),t._v("\n 保存为项目模板 *\n ")],1)])])])]),e("a-modal",{staticClass:"project-config-modal",attrs:{destroyOnClose:"",width:800,title:t.projectModal.modalTitle,footer:null},model:{value:t.projectModal.modalStatus,callback:function(e){t.$set(t.projectModal,"modalStatus",e)},expression:"projectModal.modalStatus"}},[e("project-config",{attrs:{code:t.code},on:{update:t.updateProject,complete:function(e){t.projectModal.modalStatus=!1}}})],1),e("a-modal",{staticClass:"recycle-bin-modal",attrs:{width:800,title:t.recycleModal.modalTitle,footer:null},model:{value:t.recycleModal.modalStatus,callback:function(e){t.$set(t.recycleModal,"modalStatus",e)},expression:"recycleModal.modalStatus"}},[t.recycleModal.modalStatus?e("recycle-bin",{attrs:{code:t.code},on:{update:t.init}}):t._e()],1),e("a-modal",{staticClass:"task-tag-modal",attrs:{width:800,title:t.taskTagModal.modalTitle,footer:null},model:{value:t.taskTagModal.modalStatus,callback:function(e){t.$set(t.taskTagModal,"modalStatus",e)},expression:"taskTagModal.modalStatus"}},[t.taskTagModal.modalStatus?e("task-tag",{attrs:{code:t.code},on:{update:t.init}}):t._e()],1),e("a-modal",{staticClass:"invite-project-member",attrs:{width:360,title:t.projectMemberModal.modalTitle,footer:null},model:{value:t.projectMemberModal.modalStatus,callback:function(e){t.$set(t.projectMemberModal,"modalStatus",e)},expression:"projectMemberModal.modalStatus"}},[e("div",{staticClass:"member-list"},[e("a-list",{staticClass:"project-list",attrs:{itemLayout:"horizontal",loading:t.loading,dataSource:t.projectMembers},scopedSlots:t._u([{key:"renderItem",fn:function(a){return e("a-list-item",{},[e("span",{attrs:{slot:"actions"},slot:"actions"},[e("a-button",{attrs:{size:"small",type:"dashed",icon:"user-add"},on:{click:function(e){return t.setExecutor(a)}}},[t._v("设置")])],1),e("a-list-item-meta",{attrs:{description:a.email}},[e("span",{attrs:{slot:"title"},slot:"title"},[t._v(t._s(a.name))]),e("a-avatar",{attrs:{slot:"avatar",icon:"user",src:a.avatar},slot:"avatar"})],1)],1)}}])})],1)]),e("a-drawer",{attrs:{wrapClassName:"info-drawer task-search",title:"任务筛选",width:"350",placement:"right",visible:t.taskSearch.visible},on:{close:function(e){t.taskSearch.visible=!1}}},[e("task-search",{attrs:{"project-code":t.code},on:{search:t.taskSearchAction}})],1),t.showInviteMember?e("invite-project-member",{attrs:{"project-code":t.code},model:{value:t.showInviteMember,callback:function(e){t.showInviteMember=e},expression:"showInviteMember"}}):t._e()],1)},i=[function(){var t=this,e=t._self._c;return e("li",{staticClass:"actives"},[e("a",{staticClass:"app",attrs:{"data-app":"tasks"}},[t._v("任务")])])}],o=(a("8e6e"),a("456d"),a("7514"),a("20d6"),a("28a5"),a("55dd"),a("ac6a"),a("ade3")),r=a("2f62"),n=a("2ef0"),c=a.n(n),l=a("c1df"),d=a.n(l),u=a("f93e"),p=a("b76a"),m=a.n(p),h=a("f8c7"),f=a("d3a1"),g=a("58bf"),k=a("51e2"),v=a("b83b"),b=a("e3cc"),w=a("1d80"),C=a("e507"),y=a("24d2"),_=a("9f5d"),j=a("b199"),S=a("2f14"),T=a("81fe"),M=a("4200"),x=a("97a8");function O(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function D(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?O(Object(a),!0).forEach((function(e){Object(o["a"])(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):O(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var $={name:"project-space-task",components:{RecycleBin:k["a"],TaskTag:b["a"],draggable:m.a,projectSelect:h["a"],TaskSearch:w["a"],TaskTable:v["a"],inviteProjectMember:f["a"],projectConfig:g["a"]},data:function(){return{viewType:"task-board",code:this.$route.params.code,loading:!0,project:{task_board_theme:"simple"},stageName:"",task:{},taskStatusList:u["a"].TASK_STATUS,taskStages:[],defaultExecutor:{},projectMembers:[],projectMembersCopy:[],createTaskLoading:!1,showCreateStage:!1,preCode:"",nextCode:"",preTaskCode:"",nextTaskCode:"",taskSearchParams:{},stageKeys:[],stageModal:{form:this.$form.createForm(this),stageCode:"",stageIndex:0,modalStatus:!1,confirmLoading:!1,modalTitle:"编辑列表"},slideMenuKey:"",showInviteMember:!1,inviteMemberDraw:{visible:!1,keyword:"",searching:!1,list:[]},configDraw:{visible:!1},taskSearch:{visible:!1},downLoadUrl:Object(S["h"])("project/task/_downloadTemplate"),uploadLoading:!1,uploadAction:Object(S["c"])("project/task/uploadFile"),projectModal:{modalStatus:!1,modalTitle:"项目设置"},recycleModal:{modalStatus:!1,modalTitle:"查看回收站"},taskTagModal:{modalStatus:!1,modalTitle:"任务标签"},projectMemberModal:{loading:!1,currentStageIndex:0,modalStatus:!1,modalTitle:"设置任务执行者"}}},computed:D(D({},Object(r["c"])({userInfo:function(t){return t.userInfo},viewRefresh:function(t){return t.common.viewRefresh},socketAction:function(t){return t.socketAction}})),{},{headers:function(){return Object(S["d"])()},scrollOps:function(){return{mode:"slide",rail:{background:"#e5e5e5",opacity:1},bar:{keepShow:!0},pushLoad:{enable:!0,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"},auto:!0,autoLoadDistance:0}}}}),watch:{$route:function(t,e){var a=this;if(this.code!=t.params.code&&(this.code=t.params.code,this.defaultExecutor=this.userInfo,this.getProject(),this.getProjectMembers(),this.init()),"taskdetail"==e.name){var s=e.query.from;if(void 0!=s){var i=this.taskSearchParams,o=Object.assign({stageCode:this.taskStages[s].code},i);Object(C["h"])(o).then((function(t){a.taskStages[s].tasksLoading=!1,a.taskStages[s].tasks=t.data;var e=a.taskStages[s].doneTasks=[],i=a.taskStages[s].unDoneTasks=[];t.data.forEach((function(t){t.done?e.push(t):i.push(t)}))}))}}1==t.query.re&&this.init()},socketAction:function(t){if("organization:task"===t.action){var e=t.data.data;e.projectCode==this.code&&this.getTaskStages(!1)}},viewRefresh:function(){console.log("viewRefresh")},inviteMemberDraw:{handler:function(t){t.visible?this.slideMenuKey="member":this.slideMenuKey=!1,t.keyword&&this.searchInviteMember()},deep:!0},configDraw:{handler:function(t){t.visible?this.slideMenuKey="config":this.slideMenuKey=!1},deep:!0},showInviteMember:function(t){t||this.getProjectMembers()}},created:function(){this.defaultExecutor=this.userInfo,this.getProject(),this.getProjectMembers(),this.init()},directives:{dragscroll2:function(t){}},methods:{init:function(){this.getTaskStages()},getProject:function(){var t=this;this.loading=!0,Object(y["h"])(this.code).then((function(e){t.loading=!1,t.project=e.data}))},getProjectMembers:function(){var t=this;Object(_["d"])({projectCode:this.code,pageSize:100}).then((function(e){t.projectMembers=e.data.list,t.projectMembersCopy=e.data.list}))},getTaskStages:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],a=this;Object(C["d"])({projectCode:this.code,pageSize:30}).then((function(s){var i=[];if(e?t.taskStages=i=s.data.list:s.data.list.forEach((function(t){t.tasksLoading=!1,i.push(t)})),i){a.taskSearchParams;i.forEach((function(t,s){t.page=1,a.getTasks(t,s,e)}))}}))},getTasks:function(t,e,a){var s=this,i=this.taskSearchParams,o={};o={stageCode:t.code},o=Object.assign(o,i),Object(C["h"])(o).then((function(i){var o=0;i.data.forEach((function(e){e.canRead||o++,e.done?t.doneTasks.push(e):t.unDoneTasks.push(e)})),t.canNotReadCount=o,t.tasksLoading=!1,t.tasks=i.data,a||s.$set(s.taskStages,e,t)}))},filterTask:function(t,e){return t.filter((function(t){return t.done==e}))},taskSearchAction:function(t){console.log(t),this.taskSearchParams=t,this.getTaskStages()},showTaskCard:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.taskStages.forEach((function(t){t.showTaskCard=!1})),!1===e)return!1;this.taskStages[e].showTaskCard=a,this.$nextTick((function(){t.$refs[e+"-stage"][0].scrollIntoView("#card"+e),t.$refs["inputTaskName".concat(e)][0].focus()}))},selectExecutor:function(t){var e=t.key;this.defaultExecutor=this.projectMembers[e]},addTask:function(){if(!this.taskStages[0].code)return Object(x["b"])({title:"请先创建任务列表"},"error",5e3);this.$router.push("".concat(this.$route.path,"/add/").concat(this.code,"?name=").concat(this.project.name,"&from=",0,"&stage_code=").concat(this.taskStages[0].code))},createTask:function(t,e){if(!this.task.name)return this.$message.warning("任务内容不能为空",2),!1;this.task.stage_code=t,this.task.project_code=this.code,this.task.assign_to=this.defaultExecutor.code,this.confirmCreateTask(e)},confirmCreateTask:function(t){var e=this,a=this;if(a.createTaskLoading)return a.$message.warning("正在添加任务,请稍后...",2),!1;setTimeout((function(){!0===a.createTaskLoading&&a.$message.loading({content:"正在添加任务,请稍后...",duration:5})}),2e3),a.createTaskLoading=!0,Object(j["s"])(a.task).then((function(s){a.createTaskLoading=!1;var i=Object(S["a"])(s);if(i){a.$message.destroy();var o=a.taskStages[t];o.tasks.push(s.data),a.taskStages[t].unDoneTasks.push(s.data),a.task={},e.taskDetail(s.data.code,t),console.log(D({},s.data))}})).catch((function(){a.createTaskLoading=!1}))},taskDone:function(t,e,a,s){var i=this,o=null,r=this.taskStages[e].unDoneTasks,n=this.taskStages[e].doneTasks;if(o=s?r[a]:n[a],o.hasUnDone)return!1;o.done=s,s?(r.splice(a,1),n.push(o),n=n.sort((function(t,e){return t.sort===e.sort?t.id_num-e.id_num:t.sort-e.sort}))):(n.splice(a,1),r.push(o),r=r.sort((function(t,e){return t.sort===e.sort?t.id_num-e.id_num:t.sort-e.sort}))),Object(j["z"])(t,s).then((function(t){var e=Object(S["a"])(t);if(!e)return!1;i.getTaskStages(!1)}))},showInputStrageName:function(){var t=this;this.showCreateStage=!this.showCreateStage,this.$nextTick((function(){t.$refs.inputStageName.focus()}))},doStage:function(t){var e=this,a=this,s=t.key.split("_"),i=s[s.length-2],o=s[s.length-1],r=s[0];switch(r){case"editStage":this.stageModal.stageCode=i,this.stageModal.stageIndex=o,this.$nextTick((function(){e.stageModal.form.setFieldsValue({name:e.taskStages[o].name}),e.$refs.inputStageTitle.focus()})),this.stageModal.modalStatus=!0;break;case"recycleBatch":this.$confirm({title:"移到回收站",content:"您确定要把列表下的所有任务移到回收站吗?",okText:"移到回收站",okType:"danger",cancelText:"再想想",onOk:function(){return a.taskStages[o].tasks=[],a.$set(a.taskStages[o],"doneTasks",[]),Object(j["r"])({stageCode:i}).then((function(t){var e=Object(S["a"])(t);if(!e)return!1;a.$set(a.taskStages[o],"doneTasks",[]),a.$set(a.taskStages[o],"unDoneTasks",[])})),Promise.resolve()}});break;case"setEndTime":this.set_type_endTime_modal=!0;break;case"setExecutor":this.projectMemberModal.currentStageIndex=o,this.projectMemberModal.modalStatus=!0;break;case"delStage":if(this.taskStages[o].tasks.length>0)return this.$warning({title:"删除列表",content:"请先清空此列表上的任务,然后再删除这个列表",okText:"确定"}),!1;this.$confirm({title:"删除列表",content:"您确定要永远删除这个列表吗?",okText:"删除",okType:"danger",cancelText:"再想想",onOk:function(){return Object(C["b"])(i),a.taskStages.splice(o,1),Promise.resolve()}});break}},creteStage:function(){var t=this;if(!this.stageName)return this.$message.warning("请输入列表名称",2),!1;Object(C["e"])({name:this.stageName,projectCode:this.code}).then((function(e){var a=Object(S["a"])(e);if(!a)return!1;var s=e.data;t.taskStages.push(s),t.stageName="",t.$nextTick((function(){document.getElementById("board-scrum-stages").scrollLeft=1e4}))}))},editStage:function(){var t=this,e=this.stageModal.form.getFieldsValue();if(!e.name)return this.$message.warning("请输入列表名称",2),!1;Object(C["c"])({name:e.name,stageCode:this.stageModal.stageCode}).then((function(a){var s=Object(S["a"])(a);if(!s)return!1;t.taskStages[t.stageModal.stageIndex].name=e.name,t.stageModal.modalStatus=!1}))},setExecutor:function(t){var e=this,a=this.taskStages[this.projectMemberModal.currentStageIndex],s=[];a.tasks.forEach((function(t){t.canRead&&s.push(t.code)})),s?Object(j["c"])({taskCodes:JSON.stringify(s),executorCode:t.code}).then((function(t){if(e.projectMemberModal.modalStatus=!1,!Object(S["a"])(t))return!1;Object(C["h"])({stageCode:a.code}).then((function(t){var e=0;t.data.forEach((function(t){t.canRead||e++})),a.canNotReadCount=e,a.tasksLoading=!1,a.tasks=t.data}))})):this.projectMemberModal.modalStatus=!1},showTaskPri:function(t){return{warning:1==t,error:2==t}},showTimeLabel:function(t){var e="label-primary";if(null==t)return e;var a=d()(d()(t).format("YYYY-MM-DD")).diff(d()().format("YYYY-MM-DD"),"days");return a<0?e="label-danger":0==a?e="label-warning":a>7&&(e="label-normal"),e},showTaskTime:function(t,e){return Object(T["a"])(t,e)},taskDetail:function(t,e){var a=this;this.$router.push("".concat(this.$route.path,"/detail/").concat(t,"?from=").concat(e)),this.$nextTick((function(){setTimeout((function(){a.showTaskCard(e,!1)}),700)}))},stageSort:function(t){var e=this.getPreAndNextCode(t);Object(C["f"])(e[0],e[1],this.code)},getPreAndNextCode:function(t){for(var e=t.clone.getAttribute("id"),a=[],s="",i=0,o=t.to.children.length;i<o;i++)a.push(t.to.children[i].getAttribute("id"));var r=a.findIndex((function(t){return t===e}));return r<a.length&&(s=a[r+1]),[e,s]},taskSort:function(t){var e=this.getPreAndNextCode(t);console.log(e);var a=t.to.parentNode.parentNode.parentNode.getAttribute("id");Object(j["x"])({preTaskCode:e[0],nextTaskCode:e[1],toStageCode:a})},handleResize:function(t,e){t.barSize&&(this.taskStages[e].fixedCreator=!0)},visibleDraw:function(t){"member"==t?(this.configDraw.visible=!1,this.taskSearch.visible=!1,this.inviteMemberDraw.visible=!this.inviteMemberDraw.visible):"taskSearch"==t?(this.taskSearch.visible=!this.taskSearch.visible,this.configDraw.visible=!1,this.inviteMemberDraw.visible=!1):(this.inviteMemberDraw.visible=!1,this.taskSearch.visible=!1,this.configDraw.visible=!this.configDraw.visible)},changeViewType:function(){"task-board"===this.viewType?this.viewType="task-table":this.viewType="task-board"},removeMember:function(t,e){var a=this;this.$confirm({title:"您确定要将「".concat(t.name,"」从项目中移除吗?"),content:"移除后该成员将不能查看任何关于该项目的信息",okText:"移除",okType:"danger",cancelText:"再想想",onOk:function(){return Object(_["e"])(t.code,a.code).then((function(t){Object(S["a"])(t)&&(a.projectMembers.splice(e,1),Object(x["b"])({title:"移除成功"},"notice","success"))})),Promise.resolve()}})},inviteMember:function(t){Object(_["c"])(t.memberCode,this.projectCode).then((function(e){var a=Object(S["a"])(e);a&&(t.joined=!0)}))},searchInviteMember:c.a.debounce((function(){var t=this;if(this.inviteMemberDraw.keyword||(this.projectMembers=JSON.parse(JSON.stringify(this.projectMembersCopy))),this.inviteMemberDraw.keyword.length<=1)return!1;this.searching=!0,this.projectMembers=this.projectMembers.filter((function(e){return-1!=e.name.indexOf(t.inviteMemberDraw.keyword)}))}),500),updateProject:function(t){this.project=t},collectProject:function(){var t=this,e=this.project.collected?"cancel":"collect";Object(M["a"])(this.project.code,e).then((function(e){Object(S["a"])(e)&&(t.project.collected=!t.project.collected)}))},handleChange:function(t){if("uploading"===t.file.status)return Object(x["b"])("正在导入,请稍后...","message","loading",0),void(this.uploadLoading=!0);if("done"===t.file.status&&(console.log(t),this.uploadLoading=!1,Object(S["a"])(t.file.response,!0))){var e=t.file.response.data;e?Object(x["b"])("成功导入".concat(e,"个任务"),"message","success"):Object(x["b"])("没有成功导入任何任务","message","warning"),this.getTaskStages(!1)}},beforeUpload:function(t){var e=t.size/1024/1024<2;return e||this.$message.error("文件不能超过2MB!"),e},getStatusColor:function(t){var e=this.taskStatusList.find((function(e){return e.id==t}));return e?e.color:""}}},P=$,N=(a("752d"),a("2877")),L=Object(N["a"])(P,s,i,!1,null,null,null);e["default"]=L.exports}}]); |