Просмотр исходного кода

feat: 项目关联页美化,添加侧栏图标

Jinyao 5 лет назад
Родитель
Сommit
1606d51697

+ 1 - 0
src/assets/icon/link-hover.svg

@@ -0,0 +1 @@
+<svg t="1621414539761" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2375" width="200" height="200"><path d="M612.266667 162.133333c36.266667 0 66.133333 12.8 91.733333 38.4l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 91.733333 0 14.933333-4.266667 34.133333-14.933334 53.333334s-21.333333 36.266667-36.266666 49.066666l-17.066667 17.066667c-12.8-19.2-25.6-38.4-44.8-55.466667l-10.666667-10.666666 53.333334-53.333334-140.8-140.8-221.866667 221.866667 121.6 121.6-59.733333 59.733333-10.666667-10.666666-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-89.6 0-36.266667 12.8-66.133333 38.4-89.6l160-160c25.6-29.866667 55.466667-42.666667 91.733334-42.666667z m-100.266667 290.133334l59.733333-59.733334c4.266667 2.133333 6.4 6.4 10.666667 10.666667l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 89.6 0 36.266667-12.8 66.133333-38.4 89.6l-160 160c-25.6 25.6-55.466667 38.4-89.6 38.4-36.266667 0-66.133333-12.8-89.6-38.4l-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-91.733333 0-36.266667 12.8-66.133333 38.4-91.733334l32-32c10.666667 21.333333 25.6 40.533333 42.666667 57.6l10.666666 10.666667-53.333333 53.333333 140.8 140.8 221.866667-221.866666-125.866667-115.2z" p-id="2376" fill="#8a8a8a"></path></svg>

+ 1 - 0
src/assets/icon/link-using.svg

@@ -0,0 +1 @@
+<svg t="1621414539761" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2375" width="200" height="200"><path d="M612.266667 162.133333c36.266667 0 66.133333 12.8 91.733333 38.4l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 91.733333 0 14.933333-4.266667 34.133333-14.933334 53.333334s-21.333333 36.266667-36.266666 49.066666l-17.066667 17.066667c-12.8-19.2-25.6-38.4-44.8-55.466667l-10.666667-10.666666 53.333334-53.333334-140.8-140.8-221.866667 221.866667 121.6 121.6-59.733333 59.733333-10.666667-10.666666-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-89.6 0-36.266667 12.8-66.133333 38.4-89.6l160-160c25.6-29.866667 55.466667-42.666667 91.733334-42.666667z m-100.266667 290.133334l59.733333-59.733334c4.266667 2.133333 6.4 6.4 10.666667 10.666667l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 89.6 0 36.266667-12.8 66.133333-38.4 89.6l-160 160c-25.6 25.6-55.466667 38.4-89.6 38.4-36.266667 0-66.133333-12.8-89.6-38.4l-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-91.733333 0-36.266667 12.8-66.133333 38.4-91.733334l32-32c10.666667 21.333333 25.6 40.533333 42.666667 57.6l10.666666 10.666667-53.333333 53.333333 140.8 140.8 221.866667-221.866666-125.866667-115.2z" p-id="2376" fill="#1296db"></path></svg>

+ 1 - 0
src/assets/icon/link.svg

@@ -0,0 +1 @@
+<svg t="1621414539761" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2375" width="200" height="200"><path d="M612.266667 162.133333c36.266667 0 66.133333 12.8 91.733333 38.4l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 91.733333 0 14.933333-4.266667 34.133333-14.933334 53.333334s-21.333333 36.266667-36.266666 49.066666l-17.066667 17.066667c-12.8-19.2-25.6-38.4-44.8-55.466667l-10.666667-10.666666 53.333334-53.333334-140.8-140.8-221.866667 221.866667 121.6 121.6-59.733333 59.733333-10.666667-10.666666-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-89.6 0-36.266667 12.8-66.133333 38.4-89.6l160-160c25.6-29.866667 55.466667-42.666667 91.733334-42.666667z m-100.266667 290.133334l59.733333-59.733334c4.266667 2.133333 6.4 6.4 10.666667 10.666667l81.066667 81.066667c25.6 25.6 38.4 55.466667 38.4 89.6 0 36.266667-12.8 66.133333-38.4 89.6l-160 160c-25.6 25.6-55.466667 38.4-89.6 38.4-36.266667 0-66.133333-12.8-89.6-38.4l-81.066667-81.066667c-25.6-25.6-38.4-55.466667-38.4-91.733333 0-36.266667 12.8-66.133333 38.4-91.733334l32-32c10.666667 21.333333 25.6 40.533333 42.666667 57.6l10.666666 10.666667-53.333333 53.333333 140.8 140.8 221.866667-221.866666-125.866667-115.2z" p-id="2376" fill="#cdcdcd"></path></svg>

+ 3 - 3
src/components/SideBar.vue

@@ -105,12 +105,12 @@ export default {
   }
 }
 .icon[target=invite]{
-   background-image: url("../assets/icon/test.svg");
+   background-image: url("../assets/icon/link.svg");
   .el-menu-item:hover & {
-    background-image: url("../assets/icon/test-hover.svg");
+    background-image: url("../assets/icon/link-hover.svg");
   }
   .el-menu-item.is-active & {
-    background-image: url("../assets/icon/test-using.svg");
+    background-image: url("../assets/icon/link-using.svg");
   }
 }
 </style>

+ 43 - 15
src/views/Project/Invite.vue

@@ -1,25 +1,37 @@
 <template>
-<div>
-  <el-row  style="display: flex;flex-direction: row;align-items: center;margin-bottom: 10px;color: #333333">
+<div class="container">
+  <el-row class="row-item title">
     <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">
+  <div class="row-item">
+    <span>邀请码:</span>
+    <span>{{relateCode}}</span>
+  </div>
+  <div class="row-item">
+    <span>
+      <el-button
+        @click="generateRelateCode()"
+        type="primary"
+        size="small"
+      >
+        生成
+      </el-button>
+    </span>
+  </div>
+  <el-divider content-position="left">或</el-divider>
+  <el-row class="row-item title">
     <h4>关联其他项目</h4>
   </el-row>
-  <el-row style="display: flex;flex-direction: row;align-items: center;margin-top: 20px;">
+  <el-row style="row-item">
     <el-input v-model="targetCode" placeholder="请输入要关联的项目生成的邀请码" style="width: 270px"></el-input>
     <el-button
       @click="relate()"
-      type="text"
-      size="large">点击关联</el-button>
+      type="primary"
+      size="small"
+      style="margin-left: 16px"
+    >
+      关联
+    </el-button>
   </el-row>
 </div>
 </template>
@@ -38,10 +50,11 @@ export default {
   methods: {
     async generateRelateCode() {
       this.relateCode = await ProjectAPI.generateRelateCode(this.$store.state.workspace.currentProjectId);
+      ElMessage.success('邀请码将在5分钟后失效,请及时完成操作!');
     },
     async relate() {
       await ProjectAPI.relateProject(this.$store.state.workspace.currentProjectId, this.targetCode);
-      ElMessage.success('关联成功');
+      ElMessage.success('关联成功');
       this.targetCode = '';
     },
   },
@@ -49,4 +62,19 @@ export default {
 </script>
 
 <style scoped>
+.container {
+  margin: 50px 100px;
+  width: 30%
+}
+
+.row-item {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-bottom: 10px;
+}
+
+.title {
+  color: #333333
+}
 </style>