|
@@ -66,11 +66,12 @@
|
|
<i class="el-icon-d-arrow-left" ></i>
|
|
<i class="el-icon-d-arrow-left" ></i>
|
|
</span> -->
|
|
</span> -->
|
|
|
|
|
|
- <!--可删除 -->
|
|
|
|
- <!-- <div class="div2">
|
|
|
|
- <span class="sapn2" @click="ok()"></span>
|
|
|
|
- </div> -->
|
|
|
|
- <!--可删除 -->
|
|
|
|
|
|
+ <!-- 增加侧边栏的点击效果 -->
|
|
|
|
+ <div class="sidebar" @click="retract()">
|
|
|
|
+ <div class="etui">
|
|
|
|
+ <i class="el-icon-arrow-left" ref="box"></i>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
|
|
<el-main style="background:#f7f7f7;padding:0px;">
|
|
<el-main style="background:#f7f7f7;padding:0px;">
|
|
<el-row style="color:#999;margin-top:10px;padding: 0px 10px;">
|
|
<el-row style="color:#999;margin-top:10px;padding: 0px 10px;">
|
|
@@ -491,13 +492,21 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
},
|
|
},
|
|
taskRules : {
|
|
taskRules : {
|
|
name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入任务内容", trigger: "blur" }],
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ sleectId: null,
|
|
|
|
+ sleectProjectId: null,
|
|
|
|
+ sidebarIndex: null, // 侧边栏索引
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 可刪除
|
|
|
|
- ok() {
|
|
|
|
- console.log(123)
|
|
|
|
|
|
+ // 侧边栏的点击事件
|
|
|
|
+ retract() {
|
|
|
|
+ if (this.$refs.box.className == 'el-icon-arrow-left') {
|
|
|
|
+ this.$refs.box.className = 'el-icon-arrow-right'
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.box.className = 'el-icon-arrow-left'
|
|
|
|
+ }
|
|
|
|
+ // this.$refs.box.className === 'el-icon-arrow-left' ? this.$refs.box.className = 'el-icon-arrow-right' || this.$refs.box.className = 'el-icon-arrow-left'
|
|
this.toggleGroup()
|
|
this.toggleGroup()
|
|
},
|
|
},
|
|
//
|
|
//
|
|
@@ -505,6 +514,7 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
this.groupTemplateList.forEach(g=>{
|
|
this.groupTemplateList.forEach(g=>{
|
|
g.selected = false;
|
|
g.selected = false;
|
|
})
|
|
})
|
|
|
|
+ this.sidebarIndex = tIndex
|
|
this.groupTemplateList[tIndex].selected = true;
|
|
this.groupTemplateList[tIndex].selected = true;
|
|
},
|
|
},
|
|
//获取分组模板列表
|
|
//获取分组模板列表
|
|
@@ -989,11 +999,30 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
|
|
var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
|
|
delete param.stagesList;
|
|
delete param.stagesList;
|
|
param.projectId = this.curProjectId;
|
|
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.http.post('/task-group/createFromTemplate',param,
|
|
this.http.post('/task-group/createFromTemplate',param,
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
|
|
+ this.selectedGroup = res.data
|
|
|
|
+ this.sleectId = res.data.id
|
|
|
|
+ this.sleectProjectId = res.data.projectId
|
|
|
|
+
|
|
this.addGroupDialog = false;
|
|
this.addGroupDialog = false;
|
|
- this.getTaskGroups();
|
|
|
|
|
|
+ // this.getTaskGroups();
|
|
|
|
+ this.getTaskGroup();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -1008,16 +1037,47 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- addGroup() {
|
|
|
|
|
|
+
|
|
|
|
+ // addGroup() {
|
|
|
|
+ // this.http.post('/task-group/save',this.groupForm,
|
|
|
|
+ // res => {
|
|
|
|
+ // if (res.code == "ok") {
|
|
|
|
+ // this.groupList = res.data;
|
|
|
|
+ // this.addGroupDialog = false;
|
|
|
|
+ // this.modGroupDialog = false;
|
|
|
|
+ // if (this.selectedGroup.id == this.groupForm.id) {
|
|
|
|
+ // this.selectedGroup = this.groupForm;
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: res.msg,
|
|
|
|
+ // type: "error"
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // error => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: error,
|
|
|
|
+ // type: "error"
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
+
|
|
|
|
+ // 重新定义了 addGroup 方法
|
|
|
|
+ addGroup() {
|
|
this.http.post('/task-group/save',this.groupForm,
|
|
this.http.post('/task-group/save',this.groupForm,
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.groupList = res.data;
|
|
this.groupList = res.data;
|
|
this.addGroupDialog = false;
|
|
this.addGroupDialog = false;
|
|
this.modGroupDialog = 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.selectedGroup = this.groupForm;
|
|
}
|
|
}
|
|
|
|
+ this.defaultGroupId = this.groupList[this.groupList.length - 1].id
|
|
|
|
+ // this.getTaskGroup();
|
|
|
|
+ this.getStageList()
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -1032,6 +1092,7 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
createGroup() {
|
|
createGroup() {
|
|
this.addGroupDialog = true;
|
|
this.addGroupDialog = true;
|
|
this.groupForm = {projectId: this.curProjectId};
|
|
this.groupForm = {projectId: this.curProjectId};
|
|
@@ -1070,6 +1131,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() {
|
|
onProjectChange() {
|
|
let path = this.$route.path;
|
|
let path = this.$route.path;
|
|
@@ -1431,25 +1527,43 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
|
|
margin:20px 0px;
|
|
margin:20px 0px;
|
|
}
|
|
}
|
|
|
|
|
|
-/* 可删除 */
|
|
|
|
-.div2 {
|
|
|
|
- width: 2px;
|
|
|
|
- background: #e5e5e5;
|
|
|
|
- position: relative;
|
|
|
|
|
|
+/* 项目阶段侧边栏样式 */
|
|
|
|
+.sidebar {
|
|
|
|
+ width: 2px;
|
|
|
|
+ background: #dddddd;
|
|
|
|
+ position: relative;
|
|
}
|
|
}
|
|
-.div2:hover {
|
|
|
|
- background: blue;
|
|
|
|
|
|
+.sidebar:hover {
|
|
|
|
+ background: #20a0ff;
|
|
}
|
|
}
|
|
-.div2:hover .sapn2 {
|
|
|
|
- border: 1px solid blue;
|
|
|
|
- background: blue;
|
|
|
|
|
|
+.sidebar:hover .etui {
|
|
|
|
+ background: #20a0ff;
|
|
|
|
+ border: #20a0ff;
|
|
|
|
+ color: #fff;
|
|
}
|
|
}
|
|
-.sapn2 {
|
|
|
|
- width: 14px;
|
|
|
|
- height: 30px;
|
|
|
|
|
|
+.etui {
|
|
|
|
+ width: 24px;
|
|
|
|
+ height: 40px;
|
|
background: #fff;
|
|
background: #fff;
|
|
- border: 1px solid #e5e5e5;
|
|
|
|
|
|
+ border: 1px solid #dddddd;
|
|
position: absolute;
|
|
position: absolute;
|
|
- top: 49%;
|
|
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 0%;
|
|
|
|
+ transform: translate(6%, -50%);
|
|
|
|
+ color: rgb(192, 191, 191);
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+}
|
|
|
|
+.etui i {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ padding-top: 50%;
|
|
|
|
+ padding-left: 15%;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* bug问题 */
|
|
|
|
+.task {
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding-left: 10px;
|
|
|
|
+ padding-right: 5px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|