|
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a3fe"],{"2f65":function(t,e,i){},"39TU":function(t,e,i){"use strict";i.r(e);var a=i("QbLZ"),o=i.n(a),s=i("hSIE"),n=i("LWkM"),c=i("9GgJ"),l=i("rRnC"),r=i("ZlIc"),d=i("t2rG"),u=i.n(d),h=i("L2JU"),p={name:"Corver",components:{XrHeader:c.a,AddProject:l.a,Draggable:u.a,ProjectCell:r.a},filters:{showTypeName:function(t){return{board:"卡片视图",list:"列表视图"}[t]}},props:{},data:function(){return{loading:!0,tabShowType:"board",search:"",filterObj:{},filterValue:1,filterList:[{label:"按最早创建",value:1},{label:"按最近创建",value:2},{label:"按最近更新",value:3}],isCreate:!1,list:[],defaultCorverUrl:"https://file.72crm.com/static/pc/images/pm/project-cover-1.jpg",tabName:"all",tabList:[{label:"全部项目",name:"all",list:[]},{label:"我关注的",name:"star",list:[]}],editId:null}},computed:o()({},Object(h.b)(["project"]),{permissonProject:function(){return this.project&&this.project.projectManage&&this.project.projectManage.save}}),watch:{},created:function(){var t=this;this.filterList.forEach(function(e){t.filterObj[e.value]=e.label}),this.$route.query.type&&(this.tabShowType="board"!=this.$route.query.type?"list":"board"),this.getList(),this.$bus.on("add-project",function(){t.getList()})},beforeRouteUpdate:function(t,e,i){t.query.type&&(this.tabShowType="board"!=t.query.type?"list":"board"),i()},beforeDestroy:function(){this.$bus.off("add-project")},methods:{searchClick:function(t){this.search=t,this.getList(),this.$router.push("/project/search?search="+(t||"")+"&sort="+this.filterValue)},filterClick:function(t){this.filterValue=t,this.getList()},getList:function(){var t=this;this.loading=!0,Object(s.b)({sort_type:this.filterValue,name:this.search}).then(function(e){t.loading=!1,t.list=e.data||[];var i=t.tabList[0];i.list=e.data||[],i.label="全部项目("+i.list.length+")";var a=t.tabList[1];a.list=t.list.filter(function(t){return 1==t.is_follow}),a.label="我关注的("+a.list.length+")"}).catch(function(){t.loading=!1})},collectClick:function(t){var e=this;Object(n.q)({work_id:t.work_id,follow:t.is_follow?0:1}).then(function(t){e.getList()}).catch(function(){})},moveItem:function(t){if(t){if(t.oldIndex==t.newIndex)return;Object(n.A)({workIds:this.tabList[0].list.map(function(t){return t.work_id})}).then(function(t){}).catch(function(){})}},enterDetail:function(t){this.$router.push({name:"project-list",params:{id:t.work_id}})},createProjectClick:function(){this.editId=null,this.isCreate=!0},editProjectClick:function(t){this.editId=t.work_id,this.isCreate=!0},createSuccess:function(){this.getList()},showTypeChange:function(t){this.$router.push("/project/list?type="+t)},cellHandle:function(t,e){"edit"===t?this.editProjectClick(e):"delete"===t?this.deleteProject(e):this.collectClick(e)},deleteProject:function(t){var e=this;this.$confirm("确定要删除项目吗?删除后此项目中的所有任务将一并彻底删除,无法恢复","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(n.r)({work_id:t.work_id}).then(function(t){e.$message({type:"success",message:"删除成功!"}),e.getList()}).catch(function(){})}).catch(function(){})}}},f=(i("9Jur"),i("KHd+")),v=Object(f.a)(p,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"corver"},[i("xr-header",{attrs:{"icon-class":"wk wk-project","icon-color":"#4AB8B8",placeholder:"请输入项目/任务/描述",label:"项目","show-search":"","ft-top":"0"},on:{search:t.searchClick}},[i("div",{attrs:{slot:"ft"},slot:"ft"},[i("el-button",{staticClass:"xr-btn--orange",attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.createProjectClick}},[t._v("\n 创建项目\n ")])],1)]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"content"},[i("span",{staticClass:"dropdown-handle"},[i("el-dropdown",{attrs:{trigger:"click"},on:{command:t.showTypeChange}},[i("div",{staticClass:"el-dropdown-link"},[t._v("\n "+t._s(t._f("showType
|