You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
15 KiB
1 line
15 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-74e7"],{"+D+8":function(t,e,a){"use strict";var s=a("M6Gn");a.n(s).a},"/esw":function(t,e,a){"use strict";var s=a("Flj7"),i={name:"TaskCell",components:{},mixins:[a("kK4T").a],props:{data:Object,dataIndex:Number,dataSection:Number},data:function(){return{}},computed:{priority:function(){return 0!=this.data.priority&&this.data.priority?this.getPriorityColor(this.data.priority):this.priorityList[3]},showLabels:function(){return this.data.lableList.length>3?this.data.lableList.slice(0,3):this.data.lableList},hideShowLabels:function(){return this.data.lableList.length>3?this.data.lableList.slice(3):[]}},watch:{},mounted:function(){},methods:{taskOverClick:function(t){var e=this;Object(s.n)({task_id:t.task_id,status:t.checked?5:1}).then(function(t){e.$emit("on-handle","complete",e.data,e.dataIndex,e.dataSection)}).catch(function(){t.checked=!1})},rowFun:function(t){this.$emit("on-handle","view",this.data,this.dataIndex,this.dataSection)},onmouseoverFun:function(t){this.$refs.itemSpan.offsetWidth>this.$refs.listLeft.offsetWidth-21?this.$set(t,"show",!0):this.$set(t,"show",!1)}}},l=(a("+D+8"),a("KHd+")),o=Object(l.a)(i,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"taskRow",staticClass:"list task-cell",on:{click:function(e){t.rowFun(t.data)}}},[a("div",{ref:"listLeft",staticClass:"list-left"},[a("div",{class:t.data.checked?"title title-active":"title",on:{click:function(t){t.stopPropagation()}}},[a("el-checkbox",{on:{change:function(e){t.taskOverClick(t.data)}},model:{value:t.data.checked,callback:function(e){t.$set(t.data,"checked",e)},expression:"data.checked"}})],1),t._v(" "),a("span",{staticClass:"priority",style:{backgroundColor:t.priority.color}},[t._v(t._s(t.priority.label))]),t._v(" "),a("el-tooltip",{attrs:{placement:"bottom",effect:"light","popper-class":"task-tooltip tooltip-change-border"}},[a("div",{attrs:{slot:"content"},slot:"content"},[a("span",[t._v(t._s(t.data.task_name||t.data.name))])]),t._v(" "),a("span",{ref:"itemSpan",class:t.data.checked?"item-name-active":"item-name"},[t._v("\n "+t._s(t.data.task_name||t.data.name)+"\n ")])])],1),t._v(" "),a("div",{staticClass:"list-right"},[t.data.lableList&&t.data.lableList.length>0?a("div",{staticClass:"tag-box"},[t._l(t.showLabels,function(e,s){return a("span",{key:s,staticClass:"k-name",style:{background:e.color}},[t._v(t._s(e.name))])}),t._v(" "),t.hideShowLabels.length?a("el-tooltip",{attrs:{placement:"top",effect:"light","popper-class":"tooltip-change-border"}},[a("div",{staticClass:"tooltip-content",attrs:{slot:"content"},slot:"content"},t._l(t.hideShowLabels,function(e,s){return a("div",{key:s,staticClass:"item-label",staticStyle:{display:"inline-block","margin-right":"10px"}},[a("span",{staticClass:"k-name",staticStyle:{"border-radius":"3px",color:"#FFF",padding:"3px 10px"},style:{background:e.color||"#ccc"}},[t._v(t._s(e.name))])])})),t._v(" "),a("el-button",{staticClass:"more-btn",attrs:{icon:"el-icon-more"}})],1):t._e()],2):t._e(),t._v(" "),t.data.stop_time||t.data.stopTime?a("span",{class:["due-time",{"is-past":1==t.data.is_end}]},[t._v("\n 截止时间"+t._s(t.data.stop_time||t.data.stopTime)+"\n ")]):t._e(),t._v(" "),a("div",{staticClass:"img-group"},[t.data.relationCount?a("div",{staticClass:"img-box"},[a("i",{staticClass:"wukong wukong-relevance"}),t._v(" "),a("span",[t._v(t._s(t.data.relationCount))])]):t._e(),t._v(" "),t.data.subdonecount>0||t.data.subcount?a("div",{staticClass:"img-box"},[a("i",{staticClass:"wukong wukong-sub-task"}),t._v(" "),a("span",[t._v(t._s(t.data.subdonecount)+"/"+t._s(t.data.subdonecount+t.data.subcount))])]):t._e(),t._v(" "),t.data.filecount?a("div",{staticClass:"img-box"},[a("i",{staticClass:"wukong wukong-file"}),t._v(" "),a("span",[t._v(t._s(t.data.filecount))])]):t._e(),t._v(" "),t.data.commentcount||t.data.commentCount?a("div",{staticClass:"img-box"},[a("i",{staticClass:"wukong wukong-comment-task"}),t._v(" "),a("span",[t._v(t._s(t.data.commentcount||t.data.commentCount))])]):t._e()]),t._v(" "),t.data.main_user&&t.data.main_user.id?a("xr-avatar",{staticClass:"user-img",attrs:{name:t.data.main_user.realname,id:t.data.main_user.id,size:24,src:t.data.main_user.img,disabled:!1,trigger:"hover"},on:{click:function(t){t.stopPropagation()}}}):t._e()],1)])},[],!1,null,"679b456d",null);o.options.__file="TaskCell.vue";e.a=o.exports},M6Gn:function(t,e,a){},PGSE:function(t,e,a){"use strict";var s=a("UjUI");a.n(s).a},UjDL:function(t,e,a){"use strict";a.r(e);var s=a("QbLZ"),i=a.n(s),l=a("hSIE"),o=a("LWkM"),n=a("Ajln"),r=a("XAon"),c=a("ZlIc"),d=a("rRnC"),u=a("/esw"),h=a("pKm3"),f={name:"ProjectSearch",components:{WkUserSelect:r.a,ProjectCell:c.a,AddProject:d.a,TaskCell:u.a,TaskDetail:h.a},data:function(){return{loading:!1,tabName:"project",tabList:[{label:"项目",name:"project",list:[]},{label:"任务",name:"task",list:[]}],filterObj:{},filterList:[{label:"按最早创建",value:1},{label:"按最近创建",value:2},{label:"按最近更新",value:3}],taskFilterObj:{},taskFilterList:[{label:"按最近创建",value:1},{label:"按最近截止",value:2},{label:"按最近更新",value:3},{label:"按最高优先级",value:4}],projectList:[],labelList:[],timeIntervalType:[{label:"任意时间",value:"all"},{label:"今天",value:1},{label:"上周",value:2},{label:"上月",value:3},{label:"去年",value:4},{label:"自定义时间",value:5}],timeIndex:1,form:{workSort:1,sort:1,type:"all",search:"",userList:[],workIdList:[],labelIdList:[]},isCreate:!1,editId:null,taskDetailShow:!1}},computed:{emptyValue:function(){return"project"===this.tabName?0===this.tabList[0].list.length:0===this.tabList[1].list.length}},created:function(){var t=this;this.filterList.forEach(function(e){t.filterObj[e.value]=e.label}),this.taskFilterList.forEach(function(e){t.taskFilterObj[e.value]=e.label}),this.form.search=this.$route.query.search,this.form.workSort=this.$route.query.sort,this.refreshList(),this.getProjectOption(),this.getTagOption()},methods:{searcClick:function(){this.refreshList()},filterClick:function(t){this.form.workSort=t,this.refreshList()},taskFilterClick:function(t){this.form.sort=t,this.refreshList()},typeClick:function(t){this.form.type=t.value,this.refreshList()},userListChange:function(t){this.form.userList=t,this.refreshList()},refreshList:function(){var t={search:this.form.search};"all"!=this.form.type&&(t.type=this.form.type,5==this.form.type&&(t.start_time=this.form.startTime,t.end_time=this.form.endTime)),this.form.userList&&this.form.userList.length&&(t.owner_user_id=this.form.userList),this.getProjectList(t),this.getTaskList(t)},getProjectList:function(t){var e=this;this.loading=!0,Object(l.b)(i()({},t,{sort_type:this.form.workSort})).then(function(t){e.tabList[0].list=t.data||[],e.loading=!1}).catch(function(){e.loading=!1})},getTaskList:function(t){var e=this;this.loading=!0,Object(l.d)(i()({},t,{sort_type:this.form.sort,work_id:this.form.workIdList,label_id:this.form.labelIdList})).then(function(t){var a=t.data||[];a.forEach(function(t){t.checked=5==t.status}),e.tabList[1].list=a,e.loading=!1}).catch(function(){e.loading=!1})},getProjectOption:function(){var t=this;Object(l.b)().then(function(e){t.projectList=e.data||[]}).catch(function(){})},getTagOption:function(){var t=this;Object(n.c)().then(function(e){t.labelList=e.data.list||[]}).catch(function(){})},enterDetail:function(t){this.$router.push({name:"project-list",params:{id:t.work_id}})},projectCellHandle:function(t,e){var a=this;"edit"===t?(this.editId=e.work_id,this.isCreate=!0):"delete"===t?this.deleteProject(e):Object(o.q)(e.work_id).then(function(t){a.refreshList()}).catch(function(){})},deleteProject:function(t){var e=this;this.$confirm("确定要删除项目吗?删除后此项目中的所有任务将一并彻底删除,无法恢复","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(o.r)({work_id:t.work_id}).then(function(t){e.$message({type:"success",message:"删除成功!"}),e.getList()}).catch(function(){})}).catch(function(){})},taskCellHandle:function(t,e){"view"==t?(this.editId=e.task_id,this.taskDetailShow=!0):this.refreshList()}}},m=(a("V349"),a("KHd+")),v=Object(m.a)(f,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"search-container"},[a("flexbox",{staticClass:"search-header"},[a("el-button",{staticClass:"btn-back",attrs:{type:"text",icon:"el-icon-arrow-left"},on:{click:function(e){t.$router.go(-1)}}},[t._v("\n 返回\n ")]),t._v(" "),a("flexbox-item",{attrs:{align:"center",justify:"center"}},[a("el-input",{attrs:{maxlength:50,placeholder:"请输入关键字"},model:{value:t.form.search,callback:function(e){t.$set(t.form,"search",e)},expression:"form.search"}},[a("el-button",{staticClass:"btn-search",attrs:{slot:"append"},on:{click:t.searcClick},slot:"append"},[t._v("\n 搜索\n ")])],1)],1)],1),t._v(" "),a("div",{staticClass:"search-tabs"},[a("el-tabs",{model:{value:t.tabName,callback:function(e){t.tabName=e},expression:"tabName"}},t._l(t.tabList,function(t,e){return a("el-tab-pane",{key:e,attrs:{label:t.label+(t.list.length>0?"("+t.list.length+")":""),name:t.name}})})),t._v(" "),"task"===t.tabName?a("el-dropdown",{attrs:{trigger:"click"},on:{command:t.taskFilterClick}},[a("div",{staticClass:"el-dropdown-link el-dropdown-filter"},[t._v("\n "+t._s(t.taskFilterObj[t.form.sort])),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("div",{staticClass:"el-dropdown-title"},[t._v("排序")]),t._v(" "),t._l(t.taskFilterList,function(e,s){return a("el-dropdown-item",{key:s,attrs:{command:e.value}},[t._v(t._s(e.label))])})],2)],1):a("el-dropdown",{attrs:{trigger:"click"},on:{command:t.filterClick}},[a("div",{staticClass:"el-dropdown-link el-dropdown-filter"},[t._v("\n "+t._s(t.filterObj[t.form.workSort])),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("div",{staticClass:"el-dropdown-title"},[t._v("排序")]),t._v(" "),t._l(t.filterList,function(e,s){return a("el-dropdown-item",{key:s,attrs:{command:e.value}},[t._v(t._s(e.label))])})],2)],1)],1),t._v(" "),a("el-container",{staticClass:"search-body"},[a("el-aside",[a("div",{staticClass:"filter-sec"},[a("div",{staticClass:"input-box"},[a("div",{staticClass:"label"},[t._v("\n 成员\n ")]),t._v(" "),a("wk-user-select",{staticStyle:{width:"100%"},attrs:{value:t.form.userList,radio:!1},on:{change:t.userListChange}})],1),t._v(" "),"task"===t.tabName?[a("div",{staticClass:"input-box"},[a("div",{staticClass:"label"},[t._v("\n 在下面项目中\n ")]),t._v(" "),a("el-select",{attrs:{filterable:"",multiple:"",clearable:""},on:{change:t.refreshList},model:{value:t.form.workIdList,callback:function(e){t.$set(t.form,"workIdList",e)},expression:"form.workIdList"}},t._l(t.projectList,function(t){return a("el-option",{key:t.work_id,attrs:{label:t.name,value:t.work_id}})}))],1),t._v(" "),a("div",{staticClass:"input-box"},[a("div",{staticClass:"label"},[t._v("\n 标签\n ")]),t._v(" "),a("el-select",{attrs:{filterable:"",multiple:"",clearable:""},on:{change:t.refreshList},model:{value:t.form.labelIdList,callback:function(e){t.$set(t.form,"labelIdList",e)},expression:"form.labelIdList"}},t._l(t.labelList,function(t){return a("el-option",{key:t.lable_id,attrs:{label:t.name,value:t.lable_id}})}))],1)]:t._e()],2),t._v(" "),a("div",{staticClass:"filter-sec"},[a("div",{staticClass:"sec-title"},[t._v("\n 最近更新\n ")]),t._v(" "),a("div",{staticClass:"sec-body"},[a("ul",{staticClass:"options"},t._l(t.timeIntervalType,function(e,s){return a("li",{key:s,staticClass:"option-item",class:{active:t.form.type===e.value},on:{click:function(a){t.typeClick(e)}}},[t._v("\n "+t._s(e.label)+"\n ")])})),t._v(" "),5===t.form.type?a("div",{staticClass:"time-select"},[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",placeholder:"开始时间"},on:{change:t.refreshList},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}}),t._v(" "),a("div",{staticClass:"line"}),t._v(" "),a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",placeholder:"结束时间"},on:{change:t.refreshList},model:{value:t.form.endTime,callback:function(e){t.$set(t.form,"endTime",e)},expression:"form.endTime"}})],1):t._e()])])]),t._v(" "),a("el-main",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[a("div",{directives:[{name:"empty",rawName:"v-empty",value:t.emptyValue,expression:"emptyValue"}],staticClass:"search-res"},["task"===t.tabName?t._l(t.tabList[1].list,function(e,s){return a("task-cell",{key:s,attrs:{data:e},on:{"on-handle":t.taskCellHandle}})}):t._l(t.tabList[0].list,function(e,s){return a("project-cell",{key:s,attrs:{data:e,"edit-show":e.authList&&e.authList.project&&e.authList.project.setWork,"delete-show":e.authList&&e.authList.project&&e.authList.project.setWork},on:{handle:function(a){t.projectCellHandle(a,e)}},nativeOn:{click:function(a){t.enterDetail(e)}}})})],2)])],1),t._v(" "),t.isCreate?a("add-project",{attrs:{id:t.editId},on:{"save-success":t.refreshList,close:function(e){t.isCreate=!1}}}):t._e(),t._v(" "),t.taskDetailShow?a("task-detail",{attrs:{id:t.editId,"no-listener-class":["search-res"]},on:{"on-handle":t.refreshList,close:function(e){t.taskDetailShow=!1}}}):t._e()],1)},[],!1,null,"ea374846",null);v.options.__file="Search.vue";e.default=v.exports},UjUI:function(t,e,a){},V349:function(t,e,a){"use strict";var s=a("sFj6");a.n(s).a},ZlIc:function(t,e,a){"use strict";var s={name:"ProjectCell",components:{},props:{data:Object,editShow:{type:Boolean,default:!0},deleteShow:{type:Boolean,default:!0},collectShow:{type:Boolean,default:!0}},data:function(){return{}},computed:{},watch:{},created:function(){},mounted:function(){},beforeDestroy:function(){},methods:{handleClick:function(t){this.$emit("handle",t)}}},i=(a("PGSE"),a("KHd+")),l=Object(i.a)(s,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("flexbox",{staticClass:"project-cell"},[t.$slots.header?a("div",{staticClass:"project-cell__header"},[t._t("header")],2):a("img",{directives:[{name:"src",rawName:"v-src",value:t.data.cover_url||t.defaultCorverUrl,expression:"data.cover_url || defaultCorverUrl"}],staticClass:"project-cell__header"}),t._v(" "),a("div",{staticClass:"project-cell__body"},[t.$slots.body?t._t("body"):[a("div",{staticClass:"label text-one-line"},[t._v(t._s(t.data.name))]),t._v(" "),a("div",{staticClass:"des text-one-line"},[t._v(t._s(t.data.description))])]],2),t._v(" "),a("div",{staticClass:"project-cell__footer"},[t.deleteShow?a("i",{staticClass:"wk wk-s-delete",attrs:{title:"移至回收站"},on:{click:function(e){e.stopPropagation(),t.handleClick("delete")}}}):t._e(),t._v(" "),t.editShow?a("i",{staticClass:"wk wk-circle-edit",attrs:{title:"编辑"},on:{click:function(e){e.stopPropagation(),t.handleClick("edit")}}}):t._e(),t._v(" "),t.collectShow?a("i",{staticClass:"wk wk-focus-on",class:{"is-collect":1==t.data.is_follow},attrs:{title:"收藏"},on:{click:function(e){e.stopPropagation(),t.handleClick("collect")}}}):t._e()])])},[],!1,null,"03ab043c",null);l.options.__file="ProjectCell.vue";e.a=l.exports},sFj6:function(t,e,a){}}]); |