From c0e9160e4c72255e15b87177ba339ca43a37dca2 Mon Sep 17 00:00:00 2001 From: revive <1664535558@qq.com> Date: Wed, 30 Dec 2020 14:07:53 +0800 Subject: [PATCH] xycommit --- public/static/css/main.css | 4 + src/components/notification/index.js | 1 - src/components/notification/notification.vue | 36 +- src/services/template.js | 8 + src/utils/request.js | 3 +- .../projDetail/components/personnel-list.vue | 4 +- .../components/plain-folder-list.vue | 4 +- .../components_web/projDetail/projDetail.vue | 15 +- src/views/components_web/project/nestTemp.vue | 307 ++++++++++++++++++ src/views/components_web/project/newProj.vue | 204 ++++-------- src/views/manage_system/template/index.vue | 137 -------- vue.config.js | 9 +- 12 files changed, 432 insertions(+), 300 deletions(-) create mode 100644 src/views/components_web/project/nestTemp.vue diff --git a/public/static/css/main.css b/public/static/css/main.css index 4a07f2b3..8918f007 100644 --- a/public/static/css/main.css +++ b/public/static/css/main.css @@ -8926,6 +8926,8 @@ h5.dulilabel{ .proj-detail .right-part .part-wrap::-webkit-scrollbar, .proj-detail .proj-desc-wrap::-webkit-scrollbar, .proj-detail .summary-wrap::-webkit-scrollbar, + .template_nest .template_select_content::-webkit-scrollbar, + .template_improve .template_improve_content::-webkit-scrollbar, .new-proj .template_select_content::-webkit-scrollbar { width: 8px; height: 8px; @@ -8938,6 +8940,8 @@ h5.dulilabel{ .right-part .part-wrap::-webkit-scrollbar-thumb, .proj-detail .proj-desc-wrap::-webkit-scrollbar-thumb, .proj-detail .summary-wrap::-webkit-scrollbar-thumb, + .template_nest .template_select_content::-webkit-scrollbar-thumb, + .template_improve .template_improve_content::-webkit-scrollbar-thumb, .new-proj .template_select_content::-webkit-scrollbar-thumb { -webkit-border-radius: 4px; border-radius: 4px; diff --git a/src/components/notification/index.js b/src/components/notification/index.js index 1bf43985..ced1e7d1 100644 --- a/src/components/notification/index.js +++ b/src/components/notification/index.js @@ -17,7 +17,6 @@ const notify =(options) =>{ }) instance.vm = instance.$mount() notifyWrap.appendChild(instance.vm.$el); - //return instance.vm; } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index db3318f4..f83f89dd 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -78,23 +78,26 @@ export default { timer:'', } }, - // watch: { - // // 监听是否关闭 - // show(newVal) { - // // 关闭 - // if (!newVal) { - // //this.$el.addEventListener('transitionend', this.destroyElement); - // // this.destroyElement(); - // } - // } - // }, + watch: { + //监听是否关闭 + show(newVal) { + // 关闭 + if (!newVal) { + //this.$el.addEventListener('transitionend', this.destroyElement); + setTimeout(()=>{ + this.destroyElement(); + },1000) + //this.destroyElement(); + } + } + }, methods:{ - // destroyElement() { - // // 移除transitionend事件 - // //this.$el.removeEventListener('transitionend', this.destroyElement); - // this.$destroy(true); - // this.$el.parentNode.removeChild(this.$el); - // }, + destroyElement() { + // 移除transitionend事件 + //this.$el.removeEventListener('transitionend', this.destroyElement); + this.$destroy(true); + this.$el.parentNode.removeChild(this.$el); + }, handleClose () { //this.closed = true; this.show=false; @@ -111,6 +114,7 @@ export default { }, beforeDestroy() { clearTimeout(this.timer); + //this.destroyElement(); } } diff --git a/src/services/template.js b/src/services/template.js index 5d29ea17..d7f19320 100644 --- a/src/services/template.js +++ b/src/services/template.js @@ -76,6 +76,14 @@ export async function queryNestTemplateByNodeId(templateId){ const res = await fetchApi('template/queryNestTemplateByNodeId', {id:templateId}); return wrapErrorHint(res); } +/** + * 增加嵌套模板 + * + */ +export async function connectNestTemplateFolder(params){ + const res = await fetchApi('template/connectNestTemplateFolder', params); + return wrapErrorHint(res); +} /* jsmind节点树接口 */ export async function queryTemplateNodeByTemplateId(templateId) { diff --git a/src/utils/request.js b/src/utils/request.js index 549b94ce..c9ac6bc3 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -122,6 +122,7 @@ function mapApiPathToFullPath(path) { case 'template/addTemplateNodeModelFile': case 'template/createNestedRelevance': case 'template/deleteNestedRelevance': + case 'template/connectNestTemplateFolder': case "folder/createSubfolder": case "project/createProject": case "project/editProject": @@ -129,7 +130,7 @@ function mapApiPathToFullPath(path) { case "file/addArchMilesStone": case "file/addFile": case "file/updateFile": - case "file/fileCoordinationChange": + case "file/fileCoordinationChange": case "operation/record": // case 'template/deleteTemplateNodeModelFile': method = 'POST'; diff --git a/src/views/components_web/projDetail/components/personnel-list.vue b/src/views/components_web/projDetail/components/personnel-list.vue index 86b16031..06df84f7 100644 --- a/src/views/components_web/projDetail/components/personnel-list.vue +++ b/src/views/components_web/projDetail/components/personnel-list.vue @@ -202,7 +202,9 @@ \ No newline at end of file diff --git a/src/views/components_web/project/newProj.vue b/src/views/components_web/project/newProj.vue index 38491c04..926f434c 100644 --- a/src/views/components_web/project/newProj.vue +++ b/src/views/components_web/project/newProj.vue @@ -1,26 +1,22 @@ @@ -132,26 +103,13 @@ export default { FileUploader }, props:{ - nestNodeFolder:Object, - isProjName:{ - type:Boolean, - default:true - }, - isTemSelect:{ - type:Boolean, - default:false - }, - isTemImprove:{ - type:Boolean, - default:false - }, - isTemNest:{ - type:Boolean, - default:false - }, + }, data(){ return{ + isProjName:true, + isTemSelect:false, + isTemImprove:false, templateId:sessionStorage.templateID, listTempNodeTree:[], NestTemplateList:[],//嵌套模板列表 @@ -160,9 +118,7 @@ export default { nestNodeId:'',//传入的nestNodeId title:'', checkedIndex:NaN, - checkedIndexList:[], selectTemplate:{}, - selectTemplateList:[],//选中的嵌套模板列表 srcIndex: 2, // 封面切换Index coverSrc: 'static/img/faceImg/face01.png', templateList:[], @@ -247,8 +203,11 @@ export default { // 完善模板信息 enterTemplateImprove(){ this.isTemSelect = false; - this.isTemImprove = true; - templateService.queryTemplateById(this.selectTemplate.Id).then(res => { + this.isTemImprove = true; + this.getTempProps(this.selectTemplate.Id); + }, + getTempProps(id){ + templateService.queryTemplateById(id).then(res => { res.Data.propertys.forEach((item, index) => { this.checkNewProjData.CustomProps[index] = {}; this.checkNewProjData.CustomProps[index]['TempPropId'] = item.Id; @@ -258,21 +217,11 @@ export default { this.checkNewProjData.CustomProps = [...temp]; }) this.checkNewProjData = {...this.checkNewProjData}; - }) + }) }, isChecked(index,item){ this.checkedIndex = index; this.selectTemplate = item; - //console.log(id); - }, - isNodeChecked(index,item){ - if(this.checkedIndexList.includes(index)){ - this.checkedIndexList = this.checkedIndexList.filter(ele=>{ return ele != index}); - // this.selectTemplateList = this.selectTemplateList.filter(ele =>{return ele != item}); - } - this.checkedIndexList = this.checkedIndexList.push(index); - this.selectTemselectTemplateList = this.selectTemselectTemplateList.push(item); - //console.log(id); }, /** * 设置随机封面 @@ -306,7 +255,6 @@ export default { const templateListRes = await templateService.queryTemplateList(); const templateList = templateListRes.Data || []; this.templateList = templateList; - //debugger; if(this.templateList && this.templateList.length && JSON.stringify(this.selectTemplate) ==='{}') { this.selectTemplate = templateList[0]; @@ -340,42 +288,13 @@ export default { this.newProjData.listFolder.push(folder); }); }, - /** - * 获取嵌套模板列表 - */ - async getNestTemplate(nestNodeId){ - this.NestTemplateList = await templateService.queryNestTemplateByNodeId(nestNodeId); - }, - /** - * 获取嵌套模板 - */ - // async getNestTemplate(nodeId){ - // this.NestTemplateList = await templateService.queryTemplateNodeByTemplateId(templateId); + // /** + // * 获取嵌套模板列表 + // */ + // async getNestTemplate(nestNodeId){ + // const res= await templateService.queryNestTemplateByNodeId(nestNodeId); + // this.NestTemplateList = res.Data; // }, - /** - * 选定嵌套模板 - */ - // async getNestTemplate(templateId){ - // this.NestTemplateList = await templateService.queryNestTemplateByNodeId(templateId); - // }, - async selectNestTemplate(){ - //在tempNodeList 插入 选中的template - // 根据nodeId查询 找到相应的id在它的children里加入 template - this.insertNestNode(this.nestNodeId,this.tempNodeList); - this.isTemImprove = true; - this.isTemNest = false; - }, - insertNestNode(nodeId,nodeList){ - if(this.selectTemplate.parentId == nodeId){ - nodeList.children = [], - nodeList.children.push(this.selectTemplate); - return; - } - if(nodeList.children == undefined) return; - nodeList.children.forEach(item=>{ - this.insertNestNode(nodeId,item); - }) - }, /** * 新建项目 @@ -446,32 +365,36 @@ export default { if(!res.Data) return; this.nodeClick(res.Data); }, - /** - * 节点点击事件 - */ - // async nodeClick(node) { - // this.title = node.topic + "-"; - // this.currentNode = node; - // const res = await templateService.queryAllTemplateNodeModelFile(node.id); - // if (res.Code !== 0) return; - // this.listNodeFile = res.Data || []; - // }, }, - watch:{ - isTemNest:{ - handler(value){ - if(value){ - this.getNestTemplate(this.nestNodeFolder.nodeId); - } - }, - immediate: true - } - } + // watch:{ + // isTemNestInProp:{ + // handler(value){ + // this.isTemNest = value; + // if(value){ + // this.getNestTemplate(this.nestNodeFolder.nodeId); + // } + // }, + // immediate: true + // } + // } }