Преглед на файлове

Merge branch 'master' of http://git.cc-lotus.info/live-platform/live-cms

guhongwei преди 4 години
родител
ревизия
981f874cc1
променени са 3 файла, в които са добавени 15 реда и са изтрити 7 реда
  1. 5 3
      src/views/anchor/detail.vue
  2. 6 2
      src/views/room/detail.vue
  3. 4 2
      src/views/room/index.vue

+ 5 - 3
src/views/anchor/detail.vue

@@ -64,9 +64,11 @@ export default {
   methods: {
     ...roomuser(['query', 'delete', 'update', 'create', 'fetch']),
     async search() {
-      let res = await this.fetch(this.id);
-      console.log(res.data);
-      this.$set(this, `form`, res.data);
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        console.log(res.data);
+        this.$set(this, `form`, res.data);
+      }
     },
 
     // 创建&修改

+ 6 - 2
src/views/room/detail.vue

@@ -37,17 +37,21 @@ export default {
     ...room({ roomquery: 'query', roomfetch: 'fetch', roomupdate: 'update', roomcreate: 'create' }),
     async search() {
       const res = await this.roomuserquery();
-      console.log(res.data);
-
+      const val = await this.roomfetch(this.id);
+      this.$set(this, `form`, val.data);
       this.$set(this, `newlist`, res.data);
     },
     async onSubmit({ data }) {
       if (this.id) {
+        console.log(data);
+        let res = this.roomupdate(data);
+        this.$checkRes(res, '修改房间成功', '创建房间失败');
       } else {
         console.log(data);
         let res = this.roomcreate(data);
         this.$checkRes(res, '创建房间成功', '创建房间失败');
       }
+      this.$router.push({ path: './index' });
     },
   },
   computed: {

+ 4 - 2
src/views/room/index.vue

@@ -51,7 +51,7 @@ export default {
       },
     ],
     fields: [
-      { label: '房间名称', prop: 'name' },
+      { label: '房间名称', prop: 'name', filter: 'index' },
       { label: '房间类型', prop: 'type', format: i => (i == '0' ? '直播' : i == '1' ? '会议' : '临时用户') },
       {
         label: '主播',
@@ -71,7 +71,9 @@ export default {
     ...room(['query', 'delete', 'update', 'fetch']),
     ...roomuser({ roomuserquery: 'query' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query();
+      console.log();
+
+      let res = await this.query({ skip, limit, ...info });
       console.log(res.data);
       this.$set(this, `list`, res.data);
       this.$set(this, `total`, res.total);