|
@@ -495,7 +495,11 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
},
|
|
|
taskRules : {
|
|
|
name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
|
|
|
- }
|
|
|
+ },
|
|
|
+ sleectId: null,
|
|
|
+ sleectProjectId: null,
|
|
|
+ sidebarIndex: null, // 侧边栏索引
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -514,6 +518,7 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
this.groupTemplateList.forEach(g=>{
|
|
|
g.selected = false;
|
|
|
})
|
|
|
+ this.sidebarIndex = tIndex
|
|
|
this.groupTemplateList[tIndex].selected = true;
|
|
|
},
|
|
|
//获取分组模板列表
|
|
@@ -938,12 +943,22 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
this.getViewTaskList();
|
|
|
this.displayTable = true;
|
|
|
} ,
|
|
|
+ // groupChange(index, indexPath) {
|
|
|
+ // console.log(index);
|
|
|
+ // this.groupType = 0;
|
|
|
+ // this.order = "seq";
|
|
|
+ // this.isDesc = false;
|
|
|
+ // this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
|
|
|
+ // this.getStageList();
|
|
|
+ // this.displayTable = false;
|
|
|
+ // },
|
|
|
groupChange(index, indexPath) {
|
|
|
console.log(index);
|
|
|
this.groupType = 0;
|
|
|
this.order = "seq";
|
|
|
this.isDesc = false;
|
|
|
this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
|
|
|
+ console.log(this.selectedGroup);
|
|
|
this.getStageList();
|
|
|
this.displayTable = false;
|
|
|
},
|
|
@@ -996,11 +1011,34 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
|
|
|
delete param.stagesList;
|
|
|
param.projectId = this.curProjectId;
|
|
|
+ var k = this.groupTemplateList[this.sidebarIndex].name
|
|
|
+ var s = null;
|
|
|
+ var xmz = this.groupList.forEach(function(a, b, c){
|
|
|
+ if (a.name == k) {
|
|
|
+ s = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (s){
|
|
|
+ this.addGroupDialog = false;
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // // this.selectedGroup = this.groupTemplateList[this.sidebarIndex]
|
|
|
+ // this.groupList = this.groupTemplateList
|
|
|
+ // console.log(this.groupTemplateList)
|
|
|
+ // // // this.defaultGroupId = this.groupTemplateList[this.sidebarIndex].id
|
|
|
+ // // // this.groupChange(this.sidebarIndex);
|
|
|
+ // this.groupChange(this.groupTemplateList[this.sidebarIndex].id)
|
|
|
+
|
|
|
this.http.post('/task-group/createFromTemplate',param,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
+ this.selectedGroup = res.data
|
|
|
+ this.sleectId = res.data.id
|
|
|
+ this.sleectProjectId = res.data.projectId
|
|
|
this.addGroupDialog = false;
|
|
|
- this.getTaskGroups();
|
|
|
+ // this.getTaskGroups();
|
|
|
+ this.getTaskGroup();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -1022,9 +1060,11 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
this.groupList = res.data;
|
|
|
this.addGroupDialog = false;
|
|
|
this.modGroupDialog = false;
|
|
|
- if (this.selectedGroup.id == this.groupForm.id) {
|
|
|
+ console.log(this.selectedGroup.id);
|
|
|
+ if (this.selectedGroup.id !== this.groupForm.id) {
|
|
|
this.selectedGroup = this.groupForm;
|
|
|
}
|
|
|
+ this.defaultGroupId = this.groupList[this.groupList.length - 1].id
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -1077,6 +1117,41 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 额外加的
|
|
|
+ getTaskGroup() {
|
|
|
+ this.http.post('/task-group/list',{projectId: this.curProjectId},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ console.log(res);
|
|
|
+ console.log(res.data.length)
|
|
|
+ this.allGroupData = res.data;
|
|
|
+ this.groupList = res.data;
|
|
|
+ if (this.groupList.length > 0) {
|
|
|
+ this.defaultGroupId = this.sleectId;
|
|
|
+ this.selectedGroup = this.groupList[res.data.length - 1];
|
|
|
+ this.getStageList();
|
|
|
+ } else {
|
|
|
+ //清空任务列表
|
|
|
+ this.defaultGroupId = null;
|
|
|
+ this.selectedGroup = null;
|
|
|
+ this.stageList = [];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
//切换项目
|
|
|
onProjectChange() {
|
|
|
let path = this.$route.path;
|