-
@@ -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
+ // }
+ // }
}