liuyu 4 년 전
부모
커밋
97828f2db3
3개의 변경된 파일80개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      src/layout/layout-part/menus.vue
  2. 66 2
      src/layout/live/detailInfo.vue
  3. 13 0
      src/store/room.js

+ 1 - 1
src/layout/layout-part/menus.vue

@@ -63,7 +63,7 @@ export default {
       if (this.user.role == '1') {
         menu.push(index, user, role, room, question);
       } else {
-        menu.push(index, live, question);
+        menu.push(index, live);
       }
       this.$set(this, `menu`, menu);
     },

+ 66 - 2
src/layout/live/detailInfo.vue

@@ -22,6 +22,16 @@
               <p>聊天</p>
             </el-col>
           </el-col>
+          <el-col :span="24" class="leftDown">
+            <el-col :span="8" class="btn" @click.native="queBtn()">
+              <i class="el-icon-user"></i>
+              <p>问卷</p>
+            </el-col>
+            <el-col :span="16" class="btn" @click.native="queCloseBtn()">
+              <i class="el-icon-user"></i>
+              <p>关闭问卷</p>
+            </el-col>
+          </el-col>
         </el-col>
         <el-col :span="20" class="right">
           <el-col :span="24" class="rightTop">
@@ -71,6 +81,20 @@
         </el-col>
       </el-row>
     </el-dialog>
+    <el-dialog title="问卷" :visible.sync="queDia" width="50%" :before-close="handleClose">
+      <el-row>
+        <el-col :span="24">
+          <el-select v-model="queid" filterable placeholder="请选择问卷">
+            <el-option v-for="item in questList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="24">
+          <el-col :span="5" class="btn">
+            <el-button type="primary" size="mini" @click="queCreate">发送</el-button>
+          </el-col>
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
 </template>
 
@@ -96,12 +120,14 @@ export default {
       // 麦克风
       tianchongDia: false,
       chatDia: false,
+      queDia: false,
+      questList: [],
+      queid: '',
       microphoneId: '',
       microphones: [],
       client_: '',
       localStream_: '',
       sdkAppId_: '1400380125',
-
       userId_: '1111',
       open_: false,
       content: '',
@@ -121,7 +147,20 @@ export default {
   methods: {
     ...gensign(['gensignFetch']),
     ...chat(['query', 'create', 'fetch']),
-    ...room(['startrecord', 'stoprecord']),
+    ...room(['startrecord', 'stoprecord', 'roomquest', 'roomquestclose', 'questquery']),
+    async queCreate() {
+      const data = {};
+      data.roomid = this.id;
+      data.queid = this.queid;
+      const res = await this.roomquest(data);
+      if (this.$checkRes(res)) {
+        console.log(res.data);
+        this.$message({
+          message: '操作成功',
+          type: 'success',
+        });
+      }
+    },
     async recordclick() {
       console.log(this.isrecord);
       if (this.isrecord) {
@@ -137,6 +176,15 @@ export default {
       let res = await this.query({ skip, limit, ...info });
       this.$set(this, `dataList`, res.data);
     },
+    async questSearch({ skip = 0, limit = 1000 } = {}) {
+      // const info = { status: '1' };
+      const info = {};
+      let res = await this.questquery({ skip, limit, ...info });
+      console.log(res);
+      if (this.$checkRes(res)) {
+        this.$set(this, `questList`, res.data);
+      }
+    },
     async chatCreate() {
       let data = {};
       data.roomid = this.id;
@@ -277,6 +325,22 @@ export default {
     chatBtn() {
       this.chatDia = true;
     },
+    async queBtn() {
+      this.queDia = true;
+      this.questSearch();
+    },
+    async queCloseBtn() {
+      // 关闭问卷
+      const data = {};
+      data.roomid = this.id;
+      const res = await this.roomquestclose(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '操作成功',
+          type: 'success',
+        });
+      }
+    },
     // 关闭摄像头&麦克风
     handleClose(done) {
       done();

+ 13 - 0
src/store/room.js

@@ -5,11 +5,16 @@ import _ from 'lodash';
 Vue.use(Vuex);
 const api = {
   roomInfo: `/api/onlive/room`,
+  interface: `/api/onlive/questionnaire`,
 };
 const state = () => ({});
 const mutations = {};
 
 const actions = {
+  async questquery({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, { skip, limit, ...info });
+    return res;
+  },
   async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
     const res = await this.$axios.$get(api.roomInfo, {
       skip,
@@ -48,6 +53,14 @@ const actions = {
     const res = await this.$axios.$get(`${api.roomInfo}/deletefile`, info);
     return res;
   },
+  async roomquest({ commit }, info) {
+    const res = await this.$axios.$post(`${api.roomInfo}/roomquest`, info);
+    return res;
+  },
+  async roomquestclose({ commit }, info) {
+    const res = await this.$axios.$post(`${api.roomInfo}/roomquestclose`, info);
+    return res;
+  },
 };
 
 export default {