|
@@ -5,7 +5,7 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<div class="row-item">
|
|
<div class="row-item">
|
|
|
<span>邀请码:</span>
|
|
<span>邀请码:</span>
|
|
|
- <span @click="copy(relateCode)">{{relateCode}}</span>
|
|
|
|
|
|
|
+ <span @click="copy(relateCode)" class="cursor">{{relateCode}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="row-item">
|
|
<div class="row-item">
|
|
|
<span>
|
|
<span>
|
|
@@ -22,7 +22,7 @@
|
|
|
<el-row class="row-item title">
|
|
<el-row class="row-item title">
|
|
|
<h4>关联其他项目</h4>
|
|
<h4>关联其他项目</h4>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-row style="row-item">
|
|
|
|
|
|
|
+ <el-row class="row-item">
|
|
|
<el-input v-model="targetCode" placeholder="请输入要关联的项目生成的邀请码" style="width: 270px"></el-input>
|
|
<el-input v-model="targetCode" placeholder="请输入要关联的项目生成的邀请码" style="width: 270px"></el-input>
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="relate()"
|
|
@click="relate()"
|
|
@@ -33,6 +33,22 @@
|
|
|
关联
|
|
关联
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-divider></el-divider>
|
|
|
|
|
+ <el-row class="row-item title">
|
|
|
|
|
+ <h4>已关联的项目</h4>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <div class="project-list">
|
|
|
|
|
+ <div v-if="relatedProjects.length === 0">
|
|
|
|
|
+ 暂无关联的项目!
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ProjectCard
|
|
|
|
|
+ v-for="project in relatedProjects"
|
|
|
|
|
+ :key="project.id"
|
|
|
|
|
+ v-bind="project"
|
|
|
|
|
+ @click="handleChange(project.id)"
|
|
|
|
|
+ style="cursor: pointer"
|
|
|
|
|
+ ></ProjectCard>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -41,14 +57,23 @@ import { ProjectAPI } from '@/api';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
|
|
|
import { copy } from '@/utils/clipboard';
|
|
import { copy } from '@/utils/clipboard';
|
|
|
|
|
+import ProjectCard from '@/components/ProjectCard.vue';
|
|
|
|
|
+import { WorkspaceDispatcher } from '@/store/dispatchers';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ ProjectCard,
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
relateCode: '',
|
|
relateCode: '',
|
|
|
targetCode: '',
|
|
targetCode: '',
|
|
|
|
|
+ relatedProjects: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ async mounted() {
|
|
|
|
|
+ this.relatedProjects = await ProjectAPI.getRelatedProjects(this.$store.state.workspace.currentProjectId);
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
copy,
|
|
copy,
|
|
|
async generateRelateCode() {
|
|
async generateRelateCode() {
|
|
@@ -69,6 +94,10 @@ export default {
|
|
|
});
|
|
});
|
|
|
this.targetCode = '';
|
|
this.targetCode = '';
|
|
|
},
|
|
},
|
|
|
|
|
+ handleChange(projectId) {
|
|
|
|
|
+ WorkspaceDispatcher.changeProject(projectId);
|
|
|
|
|
+ this.$router.push(`/project/${projectId}/schedule`);
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -76,7 +105,7 @@ export default {
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.container {
|
|
.container {
|
|
|
margin: 50px 100px;
|
|
margin: 50px 100px;
|
|
|
- width: 30%
|
|
|
|
|
|
|
+ width: 80%
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.row-item {
|
|
.row-item {
|
|
@@ -85,8 +114,14 @@ export default {
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+.cursor {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
.title {
|
|
.title {
|
|
|
color: #333333
|
|
color: #333333
|
|
|
}
|
|
}
|
|
|
|
|
+.project-list {
|
|
|
|
|
+ display:flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|