龚成明 3 жил өмнө
parent
commit
392949309f

+ 11 - 1
src/components/Config.vue

@@ -83,6 +83,7 @@
         </v-card-actions>
       </v-card>
     </v-dialog>
+    <!-- 删除确定框 -->
     <v-dialog v-model="dialogDelete" max-width="500px">
       <v-card>
         <v-card-title class="headline">你要删掉它吗?</v-card-title>
@@ -95,6 +96,7 @@
       </v-card>
     </v-dialog>
 
+    <!-- 数据表格 -->
     <v-data-table
       dense
       hide-default-footer
@@ -157,6 +159,7 @@ export default {
       // 组织日期格式并返回
       return this.dateFormat('YYYY-mm-dd HH:MM:SS:sss', new Date(timestamp * 1000))
     },
+    // 时间格式化
     dateFormat(fmt, date) {
       let ret;
       const opt = {
@@ -177,7 +180,7 @@ export default {
       }
       return fmt;
     },
-    // 最后四位
+    // 取字符串开头8位与最后四位
     getSimpleStr (str) {
       if (str && str.indexOf('x') !== -1) {
         return str.substr(0, 7) + '...' + str.substr(-4)
@@ -185,21 +188,26 @@ export default {
         return ''
       }
     },
+    // 跳转到指定地址
     jump (pairAddress) {
       window.open('https://etherscan.io/address/' + pairAddress)
     },
+
+    // 编辑项
     editItem (item) {
       this.editedIndex = this.tableData.indexOf(item)
       this.editedItem = Object.assign({}, item)
       this.dialog = true
     },
 
+    // 删除项
     deleteItem (item) {
       this.editedIndex = this.tableData.indexOf(item)
       this.editedItem = Object.assign({}, item)
       this.dialogDelete = true
     },
 
+    // 删除前确认
     async deleteItemConfirm () {
       this.loading = true
       const { data: rst } = await axios.get(this.url + '/config/delete', { params: {
@@ -233,6 +241,7 @@ export default {
       })
     },
 
+    // 新增项
     async save () {
       this.editedItem.o = this.editedItem.o.replaceAll('[', '【').replaceAll(']', '】')
       this.loading = true
@@ -263,6 +272,7 @@ export default {
       this.loading = false
     },
 
+    // 拉取项目
     async get () {
       this.loading = true
       const { data: rst } = await axios.get(this.url + '/config/get')