Переглянути джерело

协作群组-后台-管理列表页-M

zweizhao 7 роки тому
батько
коміт
60cf5ec872
1 змінених файлів з 15 додано та 6 видалено
  1. 15 6
      pages/main/index/group_list.vue

+ 15 - 6
pages/main/index/group_list.vue

@@ -92,9 +92,15 @@ export default {
       // 列表头字段
       tableProps,
       // 列表数据
-      tableData: []
+      tableData: [],
+      env: `test`,
     };
   },
+  computed: {
+    isTest() {
+      return this.env === `test`
+    }
+  },
   mounted() {
     this.getTableData()
   },
@@ -102,14 +108,16 @@ export default {
     changeSelect(status) {
       this.getTableData()
     },
-    // 点击重试
+    // 点击超管
     async clickSuper(row) {
-      console.log(row.uid)
+      if(this.isTest) window.open(`https://dev.test.proginn.com/group/${row.id}`)
+      else window.open(`https://www.proginn.com/group/${row.id}`)
     },
     // 点击用户的 uid
     clickUID(row) {
       // todo...
-      window.open(`https://www.proginn.com/rooter/user/${row.uid}`)
+      if(this.isTest) window.open(`https://dev.test.proginn.com/rooter/user/${row.uid}`)
+      else window.open(`https://www.proginn.com/rooter/user/${row.uid}`)
     },
     // 根据状态显示图表样式
     tableRowClassName({ row, rowIndex }) {
@@ -134,8 +142,9 @@ export default {
     async getTableData(page = this.currentPage) {
       this.tableData = []
       const res = await this.$post("/api/admin/group/list", { page, page_size: 20 })
-      const data = res.data
-      this.tableData = this.formatTableData(res.data.list)
+      const data = res.data && res.data[0]
+      this.env = res.data.current_env
+      this.tableData = this.formatTableData(data.list)
       this.totalCount = Number(data.total)
       this.totalPage = data.totalPage
     }