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.
wkcrm/static/js/chunk-0052.2fa07e12.js

1 line
11 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0052"],{"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:4,filterList:[{label:"按最早创建",value:1},{label:"按最近创建",value:2},{label:"按最近更新",value:3},{label:"按手动拖动",value:4}],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("znrn"),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("showTypeName")(t.tabShowType))),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",{attrs:{command:"board"}},[t._v("卡片视图")]),t._v(" "),i("el-dropdown-item",{attrs:{command:"list"}},[t._v("列表视图")])],1)],1),t._v(" "),i("el-dropdown",{attrs:{trigger:"click"},on:{command:t.filterClick}},[i("div",{staticClass:"el-dropdown-link el-dropdown-filter"},[t._v("\n "+t._s(t.filterObj[t.filterValue])),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("div",{staticClass:"el-dropdown-title"},[t._v("排序")]),t._v(" "),t._l(t.filterList,function(e,a){return i("el-dropdown-item",{key:a,attrs:{command:e.value}},[t._v(t._s(e.label))])})],2)],1)],1),t._v(" "),i("el-tabs",{model:{value:t.tabName,callback:function(e){t.tabName=e},expression:"tabName"}},t._l(t.tabList,function(e,a){return i("el-tab-pane",{key:a,attrs:{label:e.label,name:e.name}},[i("draggable",{staticClass:"cover-content",attrs:{options:{forceFallback:!1,disabled:"star"==t.tabName}},on:{end:t.moveItem},model:{value:e.list,callback:function(i){t.$set(e,"list",i)},expression:"item.list"}},["board"==t.tabShowType?[t._l(e.list,function(e,a){return i("div",{key:a,staticClass:"cover-content-item",on:{click:function(i){t.enterDetail(e)}}},[i("div",{directives:[{name:"src",rawName:"v-src:background-image",value:e.cover_url||t.defaultCorverUrl,expression:"childItem.cover_url || defaultCorverUrl",arg:"background-image"}],staticClass:"cover-content-item__content"},[i("div",{staticClass:"handle-bar"},[i("div",{staticClass:"title text-one-line",attrs:{title:e.name}},[t._v(t._s(e.name))]),t._v(" "),e.authList&&e.authList.project&&e.authList.project.setWork?i("i",{staticClass:"wk wk-circle-edit",on:{click:function(i){i.stopPropagation(),t.editProjectClick(e)}}}):t._e(),t._v(" "),i("i",{staticClass:"wk wk-focus-on",class:{"is-collect":1==e.is_follow},on:{click:function(i){i.stopPropagation(),t.collectClick(e)}}})]),t._v(" "),i("div",{staticClass:"cover-content-item__content-shadow"})])])}),t._v(" "),t.permissonProject?i("div",{staticClass:"cover-content-item content-cross",on:{click:t.createProjectClick}},[i("div",{staticClass:"content-cross__content"},[i("flexbox",{attrs:{justify:"center",align:"center",orient:"vertical"}},[i("i",{staticClass:"wk wk-l-plus"}),t._v(" "),i("div",[t._v("创建项目")])])],1)]):t._e()]:[t._l(e.list,function(e,a){return i("project-cell",{key:a,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(i){t.cellHandle(i,e)}},nativeOn:{click:function(i){t.enterDetail(e)}}})}),t._v(" "),t.permissonProject?i("project-cell",{attrs:{"edit-show":!1,"delete-show":!1,"collect-show":!1},nativeOn:{click:function(e){return t.createProjectClick(e)}}},[i("div",{staticClass:"project-cell__add",attrs:{slot:"header"},slot:"header"},[i("i",{staticClass:"wk wk-l-plus"})]),t._v(" "),i("span",{staticClass:"project-cell__add--title",attrs:{slot:"body"},slot:"body"},[t._v("创建新项目")])]):t._e()]],2)],1)}))],1),t._v(" "),t.isCreate?i("add-project",{attrs:{id:t.editId},on:{"save-success":t.createSuccess,close:function(e){t.isCreate=!1}}}):t._e()],1)},[],!1,null,"77b424d4",null);v.options.__file="Corver.vue";e.default=v.exports},"7mY3":function(t,e,i){"use strict";var a=i("2f65");i.n(a).a},"9GgJ":function(t,e,i){"use strict";var a={name:"XrHeader",components:{},props:{iconClass:[String,Array],iconColor:String,label:String,showSearch:{type:Boolean,default:!1},searchIconType:{type:String,default:"text"},placeholder:{type:String,default:"请输入内容"},ftTop:{type:String,default:"15px"},content:[String,Number],inputAttr:{type:Object,default:function(){}}},data:function(){return{search:""}},computed:{},watch:{content:{handler:function(){this.search!=this.content&&(this.search=this.content)},immediate:!0}},mounted:function(){},beforeDestroy:function(){},methods:{inputChange:function(){this.$emit("update:content",this.search)},searchClick:function(){this.$emit("search",this.search)}}},o=(i("7mY3"),i("KHd+")),s=Object(o.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("flexbox",{staticClass:"xr-header"},[t.iconClass?i("div",{staticClass:"xr-header__icon",style:{backgroundColor:t.iconColor}},[i("i",{class:t.iconClass})]):t._e(),t._v(" "),i("div",{staticClass:"xr-header__label"},[t.$slots.label?t._t("label"):[t._v(t._s(t.label))]],2),t._v(" "),t.showSearch?i("el-input",t._b({staticClass:"xr-header__search",class:{"is-text":"text"===t.searchIconType},style:{"margin-top":t.ftTop},attrs:{placeholder:t.placeholder},on:{input:t.inputChange},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.searchClick(e):null}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},"el-input",t.inputAttr,!1),["text"===t.searchIconType?i("el-button",{attrs:{slot:"append",type:"primary"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"},[t._v("搜索")]):i("el-button",{attrs:{slot:"append",icon:"el-icon-search"},nativeOn:{click:function(e){return t.searchClick(e)}},slot:"append"})],1):t._e(),t._v(" "),i("div",{staticClass:"xr-header__ft",style:{top:t.ftTop}},[t._t("ft")],2)],1)},[],!1,null,"acb6d756",null);s.options.__file="index.vue";e.a=s.exports},NF4H:function(t,e,i){},PGSE:function(t,e,i){"use strict";var a=i("UjUI");i.n(a).a},UjUI:function(t,e,i){},ZlIc:function(t,e,i){"use strict";var a={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)}}},o=(i("PGSE"),i("KHd+")),s=Object(o.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("flexbox",{staticClass:"project-cell"},[t.$slots.header?i("div",{staticClass:"project-cell__header"},[t._t("header")],2):i("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(" "),i("div",{staticClass:"project-cell__body"},[t.$slots.body?t._t("body"):[i("div",{staticClass:"label text-one-line"},[t._v(t._s(t.data.name))]),t._v(" "),i("div",{staticClass:"des text-one-line"},[t._v(t._s(t.data.description))])]],2),t._v(" "),i("div",{staticClass:"project-cell__footer"},[t.deleteShow?i("i",{staticClass:"wk wk-s-delete",attrs:{title:"移至回收站"},on:{click:function(e){e.stopPropagation(),t.handleClick("delete")}}}):t._e(),t._v(" "),t.editShow?i("i",{staticClass:"wk wk-circle-edit",attrs:{title:"编辑"},on:{click:function(e){e.stopPropagation(),t.handleClick("edit")}}}):t._e(),t._v(" "),t.collectShow?i("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);s.options.__file="ProjectCell.vue";e.a=s.exports},znrn:function(t,e,i){"use strict";var a=i("NF4H");i.n(a).a}}]);