guhongwei 4 years ago
parent
commit
5fb216053f
3 changed files with 67 additions and 2 deletions
  1. 18 2
      src/layout/duijiehui/duijiedetail.vue
  2. 3 0
      src/store/index.js
  3. 46 0
      src/store/onlive/room.js

+ 18 - 2
src/layout/duijiehui/duijiedetail.vue

@@ -12,6 +12,11 @@
             <el-form-item label="对接会标题">
             <el-form-item label="对接会标题">
               <el-input v-model="form.title"></el-input>
               <el-input v-model="form.title"></el-input>
             </el-form-item>
             </el-form-item>
+            <el-form-item label="直播房间">
+              <el-select v-model="form.roomname" placeholder="请选择">
+                <el-option v-for="item in roomidList" :key="item.name" :label="item.name" :value="item.name"> </el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item label="开始时间">
             <el-form-item label="开始时间">
               <el-date-picker v-model="form.start_time" type="datetime" placeholder="请选择开始时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm">
               <el-date-picker v-model="form.start_time" type="datetime" placeholder="请选择开始时间" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm">
               </el-date-picker>
               </el-date-picker>
@@ -54,6 +59,8 @@
 
 
 <script>
 <script>
 import upload from '@/components/upload.vue';
 import upload from '@/components/upload.vue';
+import { createNamespacedHelpers, mapState } from 'vuex';
+const { mapActions: room } = createNamespacedHelpers('room');
 export default {
 export default {
   name: 'columnDetail',
   name: 'columnDetail',
   props: {
   props: {
@@ -64,10 +71,19 @@ export default {
   components: {
   components: {
     upload,
     upload,
   },
   },
-  data: () => ({}),
-  created() {},
+  data: () => ({
+    roomidList: [],
+  }),
+  created() {
+    this.searchInfo();
+  },
   computed: {},
   computed: {},
   methods: {
   methods: {
+    ...room(['query']),
+    async searchInfo() {
+      const res = await this.query();
+      this.$set(this, `roomidList`, res.data);
+    },
     onSubmit() {
     onSubmit() {
       this.$emit('submitDate', { data: this.form, id: this.form.id });
       this.$emit('submitDate', { data: this.form, id: this.form.id });
     },
     },

+ 3 - 0
src/store/index.js

@@ -22,6 +22,8 @@ import live from './live';
 // 地址
 // 地址
 import place from './place';
 import place from './place';
 import apply from './apply';
 import apply from './apply';
+// 直播
+import room from './onlive/room';
 Vue.use(Vuex);
 Vue.use(Vuex);
 
 
 export default new Vuex.Store({
 export default new Vuex.Store({
@@ -43,6 +45,7 @@ export default new Vuex.Store({
     apply, //对接会
     apply, //对接会
     role, //菜单分配权限
     role, //菜单分配权限
     authUser, //管理员
     authUser, //管理员
+    room, //直播房间
   },
   },
   state: { ...ustate },
   state: { ...ustate },
   mutations: { ...umutations },
   mutations: { ...umutations },

+ 46 - 0
src/store/onlive/room.js

@@ -0,0 +1,46 @@
+// 房间
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  roomInfo: `/api/onlive/room`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.roomInfo, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.roomInfo}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.roomInfo}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.roomInfo}/update/${id}`, {
+      ...info,
+    });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.roomInfo}/${payload}`);
+    return res;
+  },
+};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};