|
|
@@ -0,0 +1,52 @@
|
|
|
+<template>
|
|
|
+<div>
|
|
|
+ <el-row style="display: flex;flex-direction: row;align-items: center;margin-bottom: 10px;color: #333333">
|
|
|
+ <h4>生成邀请码</h4>
|
|
|
+ </el-row>
|
|
|
+ <span>邀请码:</span>{{relateCode}}
|
|
|
+ <span v-if="relateCode !== ''">(邀请码在5分钟后会失效,请及时填写!)</span>
|
|
|
+ <el-row style="display: flex;flex-direction: row;align-items: center">
|
|
|
+ <el-button
|
|
|
+ @click="generateRelateCode()"
|
|
|
+ type="text"
|
|
|
+ size="large">点击生成</el-button>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="display: flex;flex-direction: row;align-items: center;margin-top: 20px;color: #333333">
|
|
|
+ <h4>关联其他项目</h4>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="display: flex;flex-direction: row;align-items: center;margin-top: 20px;">
|
|
|
+ <el-input v-model="targetCode" placeholder="请输入要关联的项目生成的邀请码" style="width: 270px"></el-input>
|
|
|
+ <el-button
|
|
|
+ @click="relate()"
|
|
|
+ type="text"
|
|
|
+ size="large">点击关联</el-button>
|
|
|
+ </el-row>
|
|
|
+</div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { ProjectAPI } from '@/api';
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ relateCode: '',
|
|
|
+ targetCode: '',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async generateRelateCode() {
|
|
|
+ this.relateCode = await ProjectAPI.generateRelateCode(this.$store.state.workspace.currentProjectId);
|
|
|
+ },
|
|
|
+ async relate() {
|
|
|
+ await ProjectAPI.relateProject(this.$store.state.workspace.currentProjectId, this.targetCode);
|
|
|
+ ElMessage.success('关联成功!');
|
|
|
+ this.targetCode = '';
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+</style>
|