|
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3261285a"],{"04c4":function(e,t,a){"use strict";var r=a("14d6"),s=a.n(r);s.a},"14d6":function(e,t,a){},a341:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"new-proj"},[a("AppHeader",{staticClass:"new-proj-header",attrs:{theme:"basis",showBackBtn:"",isShowTopBar:!0,backBtnTitle:"取消项目创建"}}),a("div",{staticClass:"proj_manage"},[a("div",{staticClass:"proj_manage_content"},[a("div",{staticClass:"projModule adjust-top-radius"},[e.isProjName?a("div",{staticClass:"projName_input"},[a("div",{staticClass:"newProj_header "},[a("div",{staticClass:"newProj_title"},[e._v(" 输入项目名称 ")]),a("div",{staticClass:"nextbtn",attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),e.enterTemplateSelect()}}},[e._v("下一步")])]),a("div",{staticClass:"newProj_content"},[a("div",{staticClass:"upload_img"},[a("div",{staticClass:"upload_imgBox",style:e.showBackground(e.coverSrc)},[a("file-uploader",{staticClass:"listUpdateBtn editCoverBtn",attrs:{"on-success":e.coverUploadSuccess}},[a("span",[e._v("编辑")])]),a("span",{staticClass:"faceBtn",on:{click:function(t){return t.stopPropagation(),e.setSystemCoverRandom(t)}}},[e._v("使用随机封面")])],1)]),a("div",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.newProjData.projectData.projName,expression:"newProjData.projectData.projName"}],staticClass:"input_projname",attrs:{type:"text",placeholder:"点击输入 请输入32个字之内的字符"},domProps:{value:e.newProjData.projectData.projName},on:{input:function(t){t.target.composing||e.$set(e.newProjData.projectData,"projName",t.target.value)}}})])])]):e._e(),e.isTemSelect?a("div",{staticClass:"template_select"},[a("TopHeader",{ref:"projdesc",staticClass:"set_position header-wrap",class:{"header-bottom-shadow":e.isProjDescScroll},attrs:{theme:"basis",showBackBtn:"",backBtnTitle:"修改项目名称",onBackBtnClick:e.enterProjNameInput,title:"选择项目模板"}},[a("div",{staticClass:"slot_btn",attrs:{slot:"right"},on:{click:function(t){return t.stopPropagation(),e.enterTemplateImprove()}},slot:"right"},[e._v("选定模板")])]),a("div",{staticClass:"template_select_content"},e._l(e.templateList,(function(t,r){return a("div",{key:t.Id,staticClass:"template_info",on:{click:function(a){return a.stopPropagation(),e.isChecked(r,t)}}},[a("div",{staticClass:"check_box",class:{checked:e.checkedIndex==r}},[a("i",{staticClass:"el-icon-check"})]),a("span",{staticClass:"template_info_name"},[e._v(e._s(t.TempName))])])})),0)],1):e._e(),e.isTemImprove?a("div",{staticClass:"template_improve"},[a("TopHeader",{staticClass:"set_position header-wrap",attrs:{theme:"basis",showBackBtn:"",backBtnTitle:"选择模板",onBackBtnClick:e.enterTemplateSelect,title:"完善模板信息"}},[a("div",{staticClass:"slot_btn",attrs:{slot:"right",type:"primary"},on:{click:function(t){return t.stopPropagation(),e.createProject()}},slot:"right"},[e._v("创建")])]),a("div",{staticClass:"template_improve_content"},[a("div",{staticClass:"template_improve_info"},[a("div",{staticClass:"template_title"},[e._v("模板名称:")]),a("div",{staticClass:"template_title_info"},[e._v(e._s(e.selectTemplate.TempName))])]),a("div",{staticClass:"template_improve_info"},[a("div",{staticClass:"template_title"},[e._v("创建时间:")]),a("div",{staticClass:"template_title_info"},[e._v(e._s(e.createDate))])]),e._l(e.checkNewProjData.CustomProps,(function(t){return a("div",{key:t.Id,staticClass:"template_improve_info template_improve_infoInput"},[a("div",{staticClass:"template_title"},[e._v(e._s((t.PropertyName?t.PropertyName:"自定义字段")+":"))]),a("div",{staticClass:"template_title_info"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.PropValue,expression:"prop.PropValue"}],staticClass:"input_projname",attrs:{type:"text",placeholder:"点击输入"},domProps:{value:t.PropValue},on:{input:function(a){a.target.composing||e.$set(t,"PropValue",a.target.value)}}})])])}))],2)],1):e._e()])])])],1)},s=[],o=(a("4160"),a("159b"),a("96cf"),a("1da1")),c=a("5530"),i=a("2909"),n=a("b1f3"),l=a("f96e"),p=a("b0f9"),m=(a("93d6"),a("5ab9")),d=a("9e5b"),u=a("b775"),h={components:{AppHeader:l["a"],TopHeader:n["a"],FileUploader:d["a"]},props:{},data:function(){return{isProjName:!0,isTemSelect:!1,isTemImprove:!1,templateId:sessionStorage.templateID,listTempNodeTree:[],NestTemplateList:[],otherTemplateList:[],tempNodeList:[],nestNodeId:"",title:"",checkedIndex:NaN,selectTemplate:{},srcIndex:2,coverSrc:"static/img/faceImg/face01.png",templateList:[],isProjDescScroll:!1,projDescEl:null,plastScrollTime:null,createDate:(new Date).toLocaleDateString(),checkNewProjData:{Proj:{ProjName:"",CompanyId:"",Notice:"",ShowImgUrl:"",TemplateId:"",CreateUserId:"",ModifyUserId:""},Node:{},CustomProps:[]},newProjData:{projectData:{projID:"",projName:"",projCode:"",folderID:"",scale:"",address:"",showImgUrl:"",templateID:"",createUserID:"",modifyUserID:"",deleted:0,listProjManager:[]},listFolder:[],listProjProp:[],userId:""}}},methods:{showBackground:function(e){var t=this.$options.filters["resolveImg"],a=t(e);return{background:"center/cover no-repeat url(".concat(a,")")}},enterTemplateSelect:function(){if(void 0!=this.newProjData.projectData.projName&&null!=this.newProjData.projectData.projName&&""!=this.newProjData.projectData.projName){var e=/[/\\]{1,}/g;e.test(this.newProjData.projectData.projName)?this.$notify({message:"项目名称请不要包含'/' '\\'等字符。",type:["warning"]}):this.newProjData.projectData.projName.length>32?this.$notify({message:"项目名称不得超出32个字符。",type:"warning"}):(this.isProjName=!1,this.isTemSelect=!0,this.isTemImprove=!1,this.isTemNest=!1,this.getSelectTemplateData())}else this.$notify({message:"请输入项目名称。",type:["warning"]})},enterProjNameInput:function(){this.isProjName=!0,this.isTemSelect=!1},enterTemplateImprove:function(){this.isTemSelect=!1,this.isTemImprove=!0,this.getTempProps(this.selectTemplate.Id)},getTempProps:function(e){var t=this;p["m"](e).then((function(e){e.Data.propertys.forEach((function(e,a){t.checkNewProjData.CustomProps[a]={},t.checkNewProjData.CustomProps[a]["TempPropId"]=e.Id,t.checkNewProjData.CustomProps[a]["PropertyName"]=e.PropertyName,t.checkNewProjData.CustomProps[a]["PropValue"]="";var r=t.checkNewProjData.CustomProps;t.checkNewProjData.CustomProps=Object(i["a"])(r)})),t.checkNewProjData=Object(c["a"])({},t.checkNewProjData)}))},isChecked:function(e,t){this.checkedIndex=e,this.selectTemplate=t},setSystemCoverRandom:function(){var e=Math.ceil(10*Math.random());while(this.srcIndex===e)e=Math.ceil(10*Math.random());this.srcIndex=e,10===this.srcIndex?this.coverSrc="static/img/faceImg/face"+this.srcIndex+".png":this.coverSrc="static/img/faceImg/face0"+this.srcIndex+".png",this.newProjData.projectData.showImgUrl=this.coverSrc},coverUploadSuccess:function(e){var t=Object(m["c"])(e.ossUrl);this.coverSrc=t,this.newProjData.projectData.showImgUrl=t},getSelectTemplateData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,p["n"]();case 2:a=t.sent,r=a.Data||[],e.templateList=r,e.templateList&&e.templateList.length&&"{}"===JSON.stringify(e.selectTemplate)&&(e.selectTemplate=r[0],e.checkedIndex=0);case 6:case"end":return t.stop()}}),t)})))()},getSelectTemplateList:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function a(){var r,s,o;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,p["o"](e);case 2:r=a.sent,s=r.Data,o=s.children||[],t.newProjData.listFolder=[],o.forEach((function(e){var a={folderID:"",projID:"",superID:"",levelID:"",firstFolderID:"",tempNodeID:e.id,folderName:e.topic,fileCount:0,childCount:0,modifyUserID:"",deleted:0,default:!0,listUser:[],manageUser:[]};t.newProjData.listFolder.push(a)}));case 7:case"end":return a.stop()}}),a)})))()},createProject:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isDisableCreate=!0,e.newProjData.userId=sessionStorage.userId,e.newProjData.projectData.templateID=e.selectTemplate.Id,e.newProjData.projectData.showImgUrl=e.coverSrc,a=e,e.checkNewProjData.Proj.ProjName=e.newProjData.projectData.projName,e.checkNewProjData.Proj.CompanyId=e.$store.state.currentCompanyId,e.checkNewProjData.Proj.ShowImgUrl=String(e.newProjData.projectData.showImgUrl),e.checkNewProjData.Proj.TemplateId=e.selectTemplate.Id,e.checkNewProjData.Proj.CreateUserId=sessionStorage.userId,e.checkNewProjData.Proj.ModifyUserId=sessionStorage.userId,t.next=13,p["o"](e.selectTemplate.Id);case 13:r=t.sent,e.checkNewProjData.Node=r.Data,e.$fetchApi("project/createProject",e.checkNewProjData).then((function(t){0===t.Code?(a.$notify({message:"新项目创建成功。",type:["success"]}),sessionStorage.projId=t.Data,sessionStorage.createUserID=sessionStorage.userId,sessionStorage.templateID=e.selectTemplate.Id,sessionStorage.allocated=0,e.$router.push({name:"projdetail",query:{isShowDistworkPage:!0}}).catch((function(e){console.log(e)}))):a.$notify.error({message:"项目创建失败, 请稍后重试。",offset:100,duration:5e3})})).catch((function(e){return console.log(e)})),s={API:"project/createProject",Action:"创建项目",CompanyName:sessionStorage.CompanyName,Subject:e.checkNewProjData.Proj.ProjName,Source:sessionStorage.client,ProjectName:e.checkNewProjData.Proj.ProjName},Object(u["b"])("operation/record",s);case 18:case"end":return t.stop()}}),t)})))()},loadTempNodeTree:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.templateId,t.next=3,p["o"](a);case 3:if(r=t.sent,e.listTempNodeTree=r.Data?[r.Data]:[],r.Data){t.next=7;break}return t.abrupt("return");case 7:e.nodeClick(r.Data);case 8:case"end":return t.stop()}}),t)})))()},watchProjDescScroll:function(){this.isProjDescScroll=this.projDescEl.scrollTop>0}},watch:{isProjDescScroll:function(e){var t=this;e&&setTimeout((function(){t.projDescEl=t.$refs.projdesc,t.projDescEl&&t.projDescEl.addEventListener("scroll",t.watchProjDescScroll)}),50)}},mounted:function(){this.projDescEl&&this.projDescEl.addEventListener("scroll",this.watchProjDescScroll)},beforeDestroy:function(){this.projDescEl&&this.projDescEl.removeEventListener("scroll",this.watchProjDescScroll)}},j=h,v=(a("04c4"),a("2877")),D=Object(v["a"])(j,r,s,!1,null,null,null);t["default"]=D.exports}}]);
- //# sourceMappingURL=chunk-3261285a.3bb0dc90.js.map
|