仲裁视频会议H5

room.vue 28KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  1. <template>
  2. <div class="page">
  3. <div class="iconImg" v-if="!modileFlag && rightType" @click="checkList(1)">
  4. <i class="el-icon-d-arrow-left" style="font-size: 30px;color: aqua;"></i>
  5. <!-- <i class="el-icon-d-arrow-right"></i> -->
  6. </div>
  7. <div class="roompage" @mouseover="mouseHover" v-if="modileFlag">
  8. <div class="txtContent">
  9. <el-tag type="danger" @click="txtContent" v-if="modileFlag">会议内容</el-tag>
  10. </div>
  11. <div class="content">
  12. <div class="screenShare" id="screenShare" v-show="screenShareFlag"></div>
  13. <div :class="videoList">
  14. <div :class="videoClass" id="localStream">
  15. <div class="userName">{{ userId }}</div>
  16. </div>
  17. <div :class="videoClass" v-for="(item, index) in userList" :key="index" :id="item">
  18. <div class="userName">{{ item }}</div>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="footerList">
  23. <roomFooter @exitRoom="exitRoom" @micClickOn="micClickOn" @micClickOff="micClickOff"
  24. @videoClickOn="videoClickOn" @videoClickOff="videoClickOff" @sharClickOn="sharClickOn"
  25. @sharClickOff="sharClickOff" @mediationPop="mediationPop" :roomId="roomId" :micFlag="micFlag"
  26. :videoFlag="videoFlag" :sharFlag="sharFlag"></roomFooter>
  27. </div>
  28. </div>
  29. <div class="roomPhone">
  30. <div class="videoPage">
  31. <div :class="sharingType">
  32. </div>
  33. <div :class="bodyPhoneType">
  34. <div :class="userClassPhone" id="localStream">
  35. <div class="userNamePhone">{{ userId }}</div>
  36. </div>
  37. <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
  38. <div class="userNamePhone">{{ item }}</div>
  39. </div>
  40. <i class="el-icon-d-arrow-right" style="font-size: 30px;color: aqua;" @click="checkList(2)" v-if="!rightType"></i>
  41. </div>
  42. <div class="footerPhone">
  43. <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
  44. </div>
  45. </div>
  46. <!-- <div class="header">
  47. <roomFooterPhone @exitRoom="exitRoom"></roomFooterPhone>
  48. </div>
  49. <div class="bodyVideo">
  50. <div :class="userClassPhone" id="localStream">
  51. <div class="userNamePhone">{{ userId }}</div>
  52. </div>
  53. <div :class="userClassPhone" v-for="(item, index) in userList" :key="index" :id="item">
  54. <div class="userNamePhone">{{ item }}</div>
  55. </div>
  56. </div> -->
  57. </div>
  58. <!-- 语音转文字弹窗 -->
  59. <el-drawer title="会议内容" :visible.sync="textVisible" :modal="false">
  60. <quill-editor ref="myQuillEditor" v-model="contentValue" :options="editorOption" @blur="onEditorBlur($event)"
  61. @focus="onEditorFocus($event)" @ready="onEditorReady($event)"></quill-editor>
  62. <el-button class="updataBtn" @click="updataClick" type="primary" :disabled="!updataFlag">确认修改内容</el-button>
  63. </el-drawer>
  64. <!-- 调解 -->
  65. <el-drawer :visible.sync="drawerMediatio" direction="ltr" title="调解内容">
  66. <div style="
  67. width: 100%;
  68. display: flex;
  69. justify-content: space-around;
  70. margin-bottom: 10px;
  71. margin-top: 20px;
  72. ">
  73. <el-upload ref="upload" :limit="1" :action="UploadUrl()" :headers="headers" :data="filedata"
  74. :on-change="beforeUpload" :on-success="handlSuccess" :file-list="fileList" v-if="appFlag">
  75. <el-button slot="trigger" size="small" type="primary">申请人上传证据</el-button>
  76. </el-upload>
  77. <el-upload ref="upload1" :limit="1" :action="UploadUrl()" :headers="headers1" :data="filedata1"
  78. :on-change="beforeUpload1" :on-success="handlSuccess1" :file-list="fileList1" v-if="resFlag">
  79. <el-button slot="trigger" size="small" type="primary">被申请人上传证据</el-button>
  80. </el-upload>
  81. <el-upload ref="upload3" :limit="1" :action="UploadUrl()" :headers="headers3" :data="filedata3"
  82. :on-change="beforeUpload3" :on-success="handlSuccess3" :file-list="fileList3" accept=".doc,.docx"
  83. v-if="updataFlag">
  84. <el-button slot="trigger" size="small" type="primary">上传调解书</el-button>
  85. </el-upload>
  86. </div>
  87. <div class="list">
  88. <div class="applicant" v-if="applicantFile.length > 0">
  89. <div>申请人证据</div>
  90. <div style="color: #104fad; cursor: pointer" v-for="(item, index) in applicantFile" :key="index"
  91. @click="preview(item, 0)">
  92. {{ item.annexName }}
  93. </div>
  94. </div>
  95. <div class="res" v-if="resFile.length > 0">
  96. <div>被申请人证据</div>
  97. <div style="color: #104fad; cursor: pointer" v-for="(item, index) in resFile" :key="index"
  98. @click="preview(item, 0)">
  99. {{ item.annexName }}
  100. </div>
  101. </div>
  102. <div class="mediate" v-if="mediateFile.length > 0">
  103. <div>调解书</div>
  104. <div style="color: #104fad; cursor: pointer" v-for="(item, index) in mediateFile" :key="index"
  105. @click="preview(item, 1)">
  106. {{ item.annexName }}
  107. </div>
  108. </div>
  109. </div>
  110. <div>
  111. <el-form label-width="100px">
  112. <el-col :span="24">
  113. <el-form-item label="调解结果:">
  114. <el-radio-group v-model="formData.mediaResult">
  115. <el-radio :label="1">达成调解</el-radio>
  116. <el-radio :label="2">未达成调解</el-radio>
  117. <el-radio :label="3">未达成调解但不在争议</el-radio>
  118. <el-radio :label="4">未达成调解但同意引入仲裁</el-radio>
  119. <el-radio :label="5">达成和解</el-radio>
  120. </el-radio-group>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="24">
  124. <el-form-item label="是否用印申请:">
  125. <el-radio-group v-model="formData.sealFlag">
  126. <el-radio :label="1">是</el-radio>
  127. <el-radio :label="0">否</el-radio>
  128. </el-radio-group>
  129. </el-form-item>
  130. </el-col>
  131. </el-form>
  132. </div>
  133. <div>
  134. <el-button style="width:100%;" type="primary" @click="determineMeeting" :disabled="!updataFlag">确定</el-button>
  135. </div>
  136. </el-drawer>
  137. </div>
  138. </template>
  139. <script>
  140. import { getUsersig, reserveConferenceList, confirmMeetingResult } from "@/api/home";
  141. import {
  142. secretaryRoleByUserId,
  143. htmlToPDF,
  144. selectById,
  145. selectRoleMenuByCaseId,
  146. getMenuPermsByUser,
  147. videoUpload,
  148. } from "@/api/room";
  149. import { getWidth, getHeight, getWidthPhone, getModile } from "@/utils/utils";
  150. import roomFooter from "./components/roomFooter.vue";
  151. import roomFooterPhone from "./components/footerPhone.vue";
  152. import ASR from "../utils/asr.esm.js";
  153. import TRTC from "trtc-sdk-v5";
  154. let trtc = null;
  155. import "quill/dist/quill.core.css";
  156. import "quill/dist/quill.snow.css";
  157. import "quill/dist/quill.bubble.css";
  158. import { quillEditor } from "vue-quill-editor";
  159. export default {
  160. name: "App",
  161. components: {
  162. roomFooter,
  163. roomFooterPhone,
  164. quillEditor,
  165. },
  166. data() {
  167. return {
  168. rightType:true,
  169. sharingType: "sharing",
  170. bodyPhoneType: "bodyPhone",
  171. videoList: "videoList",
  172. videoClass: "videoItem",
  173. resFlag: null,
  174. appFlag: null,
  175. userClassPhone: "userVideoPhone",
  176. userList: [1, 2],
  177. userHeight: "100%",
  178. userPhoneHeight: "92%",
  179. userSign: "",
  180. roomId: "",
  181. userId: null,
  182. id: null,
  183. showFlag: false,
  184. drawerMediatio: false,
  185. modileFlag: false,
  186. localStreamAsr: null,
  187. contentValue: "",
  188. textVisible: false,
  189. screenShareFlag: false,
  190. editorOption: {
  191. // Some Quill options...
  192. },
  193. asrList: {},
  194. updataFlag: true,
  195. token: "",
  196. applicantFile: [],
  197. resFile: [],
  198. mediateFile: [],
  199. formData: {
  200. mediaResult: 1,
  201. sealFlag: 1
  202. },
  203. caseFlowId: null,
  204. headers: {
  205. // Authorization: "Bearer " + token,
  206. Authorization: "",
  207. },
  208. filedata: {
  209. annexType: 2,
  210. officeFlag: 0,
  211. caseId: null,
  212. },
  213. fileList: [],
  214. headers1: {
  215. // Authorization: "Bearer " + token,
  216. Authorization: "",
  217. },
  218. filedata1: {
  219. annexType: 12,
  220. officeFlag: 0,
  221. caseId: null,
  222. },
  223. fileList1: [],
  224. headers3: {
  225. // Authorization: "Bearer " + token,
  226. Authorization: "",
  227. },
  228. filedata3: {
  229. annexType: 7,
  230. officeFlag: 0,
  231. isMediaBook: 1,
  232. caseId: null,
  233. },
  234. fileList3: [],
  235. editFlag: false,
  236. micFlag: true,
  237. videoFlag: true,
  238. sharFlag: true,
  239. };
  240. },
  241. methods: {
  242. UploadUrl() {
  243. return window.location.origin + "/tjformal/video/upload";
  244. },
  245. /**移动端点击换出/隐藏视频列表 */
  246. checkList(data) {
  247. if (data == 1) {
  248. if (this.userList.length < 1) {
  249. this.userClassPhone = "userVideoPhone2"
  250. }
  251. this.sharingType = "sharing1";
  252. this.bodyPhoneType = "bodyPhone1";
  253. this.rightType = false;
  254. } else if (data == 2) {
  255. console.log("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUu");
  256. this.sharingType = "sharing1";
  257. this.bodyPhoneType = "bodyPhone2";
  258. this.rightType = true;
  259. }
  260. },
  261. /**点击开启麦克风图标,关闭麦克风 */
  262. micClickOn() {
  263. trtc.updateLocalAudio({ mute: true }).then(() => {
  264. this.micFlag = false;
  265. this.$message({
  266. message: "麦克风关闭",
  267. type: "success",
  268. });
  269. });
  270. },
  271. /**点击关闭麦克风图标,开启麦克风 */
  272. micClickOff() {
  273. trtc.updateLocalAudio({ mute: false }).then(() => {
  274. this.micFlag = true;
  275. this.$message({
  276. message: "麦克风开启",
  277. type: "success",
  278. });
  279. });
  280. },
  281. /**点击开启摄像头图标,关闭摄像头 */
  282. videoClickOn() {
  283. trtc.updateLocalVideo({ mute: true }).then(() => {
  284. this.videoFlag = false;
  285. this.$message({
  286. message: "摄像头已关闭",
  287. type: "success",
  288. });
  289. });
  290. },
  291. /**点击关闭摄像头图标,开启摄像头 */
  292. videoClickOff() {
  293. trtc.updateLocalVideo({ mute: false }).then(() => {
  294. this.videoFlag = true;
  295. this.$message({
  296. message: "摄像头已开启",
  297. type: "success",
  298. });
  299. });
  300. },
  301. /**共享屏幕 */
  302. async sharClickOn() {
  303. // this.videoList = "videoList1";
  304. // this.videoClass = "videoItem2";
  305. // this.screenShareFlag = true;
  306. if (this.screenShareFlag) {
  307. alert("其他用户已经分享");
  308. return;
  309. }
  310. await trtc.startScreenShare().then(() => {
  311. this.sharFlag = false;
  312. });
  313. },
  314. /**关闭共享屏幕 */
  315. sharClickOff() {
  316. trtc.stopScreenShare().then(() => {
  317. this.sharFlag = true;
  318. this.videoList = "videoList";
  319. this.screenShareFlag = false;
  320. if (this.userList.length > 1) {
  321. this.videoClass = "videoItem1";
  322. } else if (this.userList.length < 1) {
  323. this.videoClass = "videoItem";
  324. } else if (this.userList.length == 1) {
  325. this.videoClass = "videoItem3";
  326. }
  327. });
  328. },
  329. /**获取当前用户操作权限 */
  330. getMenuPermsByUserFn() {
  331. getMenuPermsByUser().then((res) => {
  332. this.editFlag = res.perms.includes("caseManagement:list:editOffice");
  333. });
  334. },
  335. beforeUpload(file, fileList) {
  336. this.fileList = fileList;
  337. if (file.name.indexOf("docx") == -1) {
  338. this.filedata.officeFlag = 0;
  339. } else {
  340. this.filedata.officeFlag = 1;
  341. }
  342. },
  343. // 文件上传成功
  344. handlSuccess(res, file) {
  345. this.$message({
  346. message: "上传成功",
  347. type: "success",
  348. });
  349. this.$refs.upload.clearFiles();
  350. this.selectByIdFn(this.caseId);
  351. },
  352. beforeUpload1(file, fileList) {
  353. this.fileList1 = fileList;
  354. if (file.name.indexOf("docx") == -1) {
  355. this.filedata1.officeFlag = 0;
  356. } else {
  357. this.filedata1.officeFlag = 1;
  358. }
  359. },
  360. // 文件上传成功
  361. handlSuccess1(res, file) {
  362. this.$message({
  363. message: "上传成功",
  364. type: "success",
  365. });
  366. this.$refs.upload1.clearFiles();
  367. this.selectByIdFn(this.caseId);
  368. },
  369. beforeUpload3(file, fileList) {
  370. this.fileList3 = fileList;
  371. this.filedata3.officeFlag = 1;
  372. },
  373. // 文件上传成功
  374. handlSuccess3(res, file) {
  375. this.$message({
  376. message: "上传成功",
  377. type: "success",
  378. });
  379. this.$refs.upload3.clearFiles();
  380. this.selectByIdFn(this.caseId);
  381. },
  382. preview(item, type) {
  383. if (item.onlyOfficeFileId) {
  384. debugger
  385. // this.$router.push({
  386. // path: "/onlyoffice",
  387. // query: { id: item.onlyOfficeFileId, flag: flag },
  388. // });
  389. let flag = 1;
  390. if (this.editFlag && type != 0) {
  391. flag = 1;
  392. } else {
  393. flag = 0;
  394. }
  395. let token = sessionStorage.getItem("token");
  396. window.open(
  397. `http://121.40.189.20:9002/onlyoffice?id=${item.onlyOfficeFileId}&flag=${flag}&token=${token}`,
  398. "_black"
  399. // `http://localhost:81/onlyoffice?id=${item.onlyOfficeFileId}&flag=${flag}&token=${token}`,
  400. // "_black"
  401. );
  402. } else {
  403. window.open(window.location.origin + '/tiaojie' + item.annexPath, "_black");
  404. }
  405. },
  406. // 点击提交修改后的内容
  407. updataClick() {
  408. this.contentValue = this.contentValue.replace(/<br>/g, "");
  409. htmlToPDF({
  410. caseId: this.caseId,
  411. htmlContent: this.contentValue,
  412. }).then((res) => {
  413. if (res.code == 200) {
  414. this.$message({
  415. message: "提交修改成功",
  416. type: "success",
  417. });
  418. } else {
  419. this.$message({
  420. message: res.msg,
  421. type: "error",
  422. });
  423. }
  424. });
  425. },
  426. onEditorBlur(quill) {
  427. console.log("editor blur!", this.content, quill);
  428. },
  429. onEditorFocus(quill) {
  430. if (!this.updataFlag) {
  431. quill.enable(false);
  432. } else {
  433. quill.enable(true);
  434. }
  435. console.log("editor focus!", quill);
  436. },
  437. onEditorReady(quill) {
  438. console.log("editor ready!", quill);
  439. },
  440. onEditorChange({ quill, html, text }) {
  441. console.log("editor change!", quill, html, text);
  442. this.content = html;
  443. },
  444. // 点击显示修改的文本框
  445. txtContent() {
  446. this.textVisible = true;
  447. // setInterval(() => {
  448. // this.selectByIdFn(this.caseId);
  449. // }, 8000);
  450. // this.selectRoleMenuByCaseIdFn(this.caseId);
  451. // this.getMenuPermsByUserFn();
  452. },
  453. /** 获取证据列表 */
  454. selectByIdFn(id) {
  455. selectById(id).then((res) => {
  456. this.caseFlowId = res.data.caseFlowId;
  457. this.applicantFile = [];
  458. this.resFile = [];
  459. this.mediateFile = [];
  460. let fileList = res.data.caseAttachList;
  461. fileList.forEach((item) => {
  462. if (item.annexType == 2) {
  463. this.applicantFile.push(item);
  464. } else if (item.annexType == 12) {
  465. this.resFile.push(item);
  466. } else if (item.annexType == 7) {
  467. this.mediateFile.push(item);
  468. }
  469. });
  470. });
  471. },
  472. // 鼠标滑过显示操作栏
  473. mouseHover() {
  474. this.showFlag = true;
  475. setTimeout(() => {
  476. this.showFlag = false;
  477. }, 4000);
  478. },
  479. async exitRoom() {
  480. // // 关闭识别
  481. Object.keys(this.asrList).forEach((key) => {
  482. this.asrList[key].stop();
  483. });
  484. this.localStreamAsr.stop();
  485. await trtc.exitRoom();
  486. // await trtc.updateLocalVideo({ publish: false });
  487. // await trtc.updateLocalAudio({ publish: false });
  488. await trtc.stopLocalVideo();
  489. await trtc.stopLocalAudio();
  490. await trtc.destroy();
  491. this.$router.push({
  492. name: "Home",
  493. });
  494. },
  495. // 获取拉流信息
  496. getPushVideo() {
  497. trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, (event) => {
  498. const userId = event.userId;
  499. const streamType = event.streamType;
  500. if (streamType == "main") {
  501. this.userList.push(userId);
  502. setTimeout(() => {
  503. trtc.startRemoteVideo({ userId, streamType, view: `${userId}` });
  504. });
  505. } else if (streamType == "sub") {
  506. setTimeout(() => {
  507. trtc
  508. .startRemoteVideo({ userId, streamType, view: "screenShare" })
  509. .then(() => {
  510. this.videoList = "videoList1";
  511. this.videoClass = "videoItem2";
  512. });
  513. });
  514. this.screenShareFlag = true;
  515. }
  516. setTimeout(() => {
  517. let aoido = trtc.getAudioTrack(userId);
  518. this.asrList[this.userList[this.userList.length - 1]] = new ASR({
  519. secretKey: "INDrIXcT8YmomZBcsy0oNirnU0LTN4X7",
  520. secretId: "AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv",
  521. appId: 1304001529,
  522. engine_model_type: "16k_zh",
  523. voice_format: 1,
  524. needvad: 1,
  525. audioTrack: aoido,
  526. });
  527. this.asrList[this.userList[this.userList.length - 1]].start();
  528. // 开始识别
  529. this.asrList[
  530. this.userList[this.userList.length - 1]
  531. ].OnRecognitionStart = (res) => {
  532. console.log("远端流:开始识别", res);
  533. };
  534. this.asrList[this.userList[this.userList.length - 1]].OnError = (
  535. res
  536. ) => {
  537. console.log("远端流:识别失败", res);
  538. };
  539. // 一句话结束
  540. this.asrList[this.userList[this.userList.length - 1]].OnSentenceEnd =
  541. (res) => {
  542. console.log("远端流:一句话结束", res);
  543. this.contentValue =
  544. this.contentValue +
  545. `<h2>${userId}</h2>` +
  546. `<span>${res.result.voice_text_str}</span>`;
  547. };
  548. }, 2000);
  549. // })
  550. });
  551. },
  552. /**主持人解散房间监听事件 */
  553. exitRoomAll() {
  554. trtc.on(TRTC.EVENT.KICKED_OUT, event => {
  555. console.log(event.reason);
  556. alert("主持人已经解散会议");
  557. this.$router.push({
  558. name: "Home",
  559. });
  560. this.userList = [];
  561. });
  562. },
  563. // 删除退出会议人员列表
  564. deletePushVideo() {
  565. trtc.on(TRTC.EVENT.REMOTE_VIDEO_UNAVAILABLE, (event) => {
  566. const streamType = event.streamType;
  567. const userId = event.userId;
  568. if (streamType == "main") {
  569. let deleteIndex = this.userList.indexOf(userId);
  570. this.userList = this.userList.filter((item) => item !== userId);
  571. if (deleteIndex !== -1) {
  572. this.userList.splice(deleteIndex, 1);
  573. }
  574. Object.keys(this.asrList).forEach((key) => {
  575. this.asrList[userId].stop();
  576. });
  577. } else if (streamType == "sub") {
  578. this.sharFlag = true;
  579. this.videoList = "videoList";
  580. this.screenShareFlag = false;
  581. if (this.userList.length > 1) {
  582. this.videoClass = "videoItem1";
  583. } else if (this.userList.length < 1) {
  584. this.videoClass = "videoItem";
  585. } else if (this.userList.length == 1) {
  586. this.videoClass = "videoItem3";
  587. }
  588. }
  589. });
  590. },
  591. // 根据caseId查询房间相关信息
  592. reserveConferenceListFn(data) {
  593. reserveConferenceList(data).then((res) => {
  594. this.hostId = res.data[0].userName;
  595. });
  596. },
  597. // 根据userid查询是否是秘书角色
  598. secretaryRoleByUserIdFn(data, data1) {
  599. secretaryRoleByUserId(data, data1).then((res) => {
  600. this.updataFlag = res.data.isSecretaryRole;
  601. });
  602. },
  603. /**获取申请人被申请人权限 */
  604. selectRoleMenuByCaseIdFn(caseId) {
  605. selectRoleMenuByCaseId(caseId).then((res) => {
  606. if (res.appFlag && res.appFlag == "1") {
  607. this.appFlag = true;
  608. this.resFlag = false;
  609. } else if (res.resFlag && res.resFlag == "1") {
  610. this.resFlag = true;
  611. this.appFlag = false;
  612. }
  613. });
  614. },
  615. // 调解
  616. mediationPop() {
  617. this.drawerMediatio = true;
  618. this.selectByIdFn(this.caseId);
  619. setInterval(() => {
  620. this.selectByIdFn(this.caseId);
  621. }, 8000);
  622. this.selectRoleMenuByCaseIdFn(this.caseId);
  623. this.getMenuPermsByUserFn();
  624. },
  625. // 确定会议结果
  626. determineMeeting() {
  627. let valueMeeting = {
  628. id: this.caseId,
  629. mediaResult: this.formData.mediaResult,
  630. sealFlag: this.formData.sealFlag,
  631. caseFlowId: this.caseFlowId
  632. }
  633. confirmMeetingResult(valueMeeting).then(res => {
  634. if (res.code == 200) {
  635. this.$message({
  636. message: "确定成功",
  637. type: "success",
  638. });
  639. this.drawerMediatio = false
  640. } else {
  641. this.$message({
  642. message: res.msg,
  643. type: "error",
  644. });
  645. }
  646. })
  647. }
  648. },
  649. computed: {
  650. editor() {
  651. return this.$refs.myQuillEditor.quill;
  652. },
  653. },
  654. watch: {
  655. userList(value) {
  656. if (value.length == 1) {
  657. this.videoClass = "videoItem3";
  658. } else if (value.length > 1) {
  659. this.videoClass = "videoItem1";
  660. } else if (value.length < 1) {
  661. this.videoClass = "videoItem";
  662. }
  663. },
  664. },
  665. async mounted() {
  666. if (this.userList.length == 1) {
  667. this.videoClass = "videoItem3";
  668. this.userClassPhone = "userVideoPhone1";
  669. } else if (this.userList.length > 1) {
  670. this.videoClass = "videoItem1";
  671. this.userClassPhone = "userVideoPhone2";
  672. } else if (this.userList.length < 1) {
  673. this.videoClass = "videoItem";
  674. this.userClassPhone = "userVideoPhone";
  675. }
  676. // 判断设备类型
  677. this.modileFlag = getModile();
  678. let roomId = this.$route.query.roomId;
  679. this.roomId = this.$route.query.roomId;
  680. let userId = this.$route.query.userId;
  681. this.userId = this.$route.query.userId;
  682. this.caseId = this.$route.query.caseId;
  683. this.id = this.$route.query.id;
  684. this.token = this.$route.query.token;
  685. this.headers.Authorization = "Bearer " + this.token;
  686. this.headers1.Authorization = "Bearer " + this.token;
  687. this.headers3.Authorization = "Bearer " + this.token;
  688. this.filedata.caseId = this.caseId;
  689. this.filedata1.caseId = this.caseId;
  690. this.filedata3.caseId = this.caseId;
  691. window.sessionStorage.setItem("token", this.token);
  692. window.sessionStorage.setItem("userId", this.id);
  693. this.secretaryRoleByUserIdFn(this.id, this.caseId);
  694. // 获取主持人的userId
  695. this.reserveConferenceListFn(this.caseId);
  696. const sdkAppId = 1600011167;
  697. // 获取usersign
  698. await getUsersig(userId).then((res) => {
  699. this.userSign = res.msg;
  700. });
  701. this.getPushVideo();
  702. this.deletePushVideo();
  703. this.exitRoomAll();
  704. try {
  705. await trtc.enterRoom({
  706. roomId: Number(roomId),
  707. scene: "rtc",
  708. sdkAppId,
  709. userId,
  710. userSig: this.userSign,
  711. });
  712. await trtc.startLocalVideo({
  713. view: document.getElementById("localStream"), // 在 DOM 中的 elementId 为 localStream 的标签上预览视频。
  714. });
  715. await trtc.startLocalAudio();
  716. console.log("进房成功");
  717. this.$message({
  718. message: "进房成功",
  719. type: "success",
  720. });
  721. } catch (error) {
  722. console.error("进房失败 " + error);
  723. this.$message({
  724. message: "进房失败",
  725. type: "error",
  726. });
  727. // this.$router.push({
  728. // name: 'Home'
  729. // })
  730. }
  731. this.localStreamAsr = new ASR({
  732. secretKey: "INDrIXcT8YmomZBcsy0oNirnU0LTN4X7",
  733. secretId: "AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv",
  734. appId: 1304001529,
  735. engine_model_type: "16k_zh",
  736. voice_format: 1,
  737. needvad: 1,
  738. audioTrack: trtc.getAudioTrack(),
  739. });
  740. this.localStreamAsr.start();
  741. // 开始识别
  742. this.localStreamAsr.OnRecognitionStart = (res) => {
  743. console.log("本地流:开始识别", res);
  744. };
  745. this.localStreamAsr.OnError = (res) => {
  746. console.log("本地流:识别失败", res);
  747. };
  748. // 一句话结束
  749. this.localStreamAsr.OnSentenceEnd = (res) => {
  750. console.log("本地流:一句话结束", res);
  751. // this.contentValue = `<h2>${this.userId}</h2>` + `<span>${res.result.voice_text_str}</span>`;
  752. this.contentValue =
  753. this.contentValue +
  754. `<h2>${this.userId}</h2>` +
  755. `<span>${res.result.voice_text_str}</span>`;
  756. };
  757. },
  758. created() {
  759. trtc = TRTC.create();
  760. },
  761. };
  762. </script>
  763. <style scoped>
  764. .iconImg {
  765. position: fixed;
  766. z-index: 9999;
  767. top: 40%;
  768. height: 40px;
  769. width: 40px;
  770. right: 0px;
  771. }
  772. .roompage {
  773. width: 100%;
  774. height: 100vh;
  775. }
  776. .content {
  777. width: 100%;
  778. height: 90%;
  779. display: flex;
  780. }
  781. .videoList {
  782. width: 100%;
  783. height: 100%;
  784. display: flex;
  785. justify-content: space-around;
  786. flex-wrap: wrap;
  787. align-items: center;
  788. overflow-y: scroll;
  789. margin-bottom: 20px;
  790. position: relative;
  791. }
  792. .videoList1 {
  793. width: 20%;
  794. height: 100%;
  795. display: flex;
  796. justify-content: space-around;
  797. flex-wrap: wrap;
  798. align-items: center;
  799. overflow-y: scroll;
  800. margin-bottom: 20px;
  801. position: relative;
  802. }
  803. .txtContent {
  804. width: 100px;
  805. height: 50px;
  806. position: absolute;
  807. right: 5px;
  808. top: 20px;
  809. z-index: 10;
  810. cursor: pointer;
  811. }
  812. .videoItem {
  813. width: 100%;
  814. height: 100%;
  815. background: red;
  816. border-radius: 20px;
  817. }
  818. .videoItem1 {
  819. width: 32%;
  820. height: 32%;
  821. background: red;
  822. border-radius: 20px;
  823. }
  824. .videoItem3 {
  825. width: 48%;
  826. height: 100%;
  827. background: red;
  828. border-radius: 20px;
  829. }
  830. .videoItem2 {
  831. width: 90%;
  832. height: 25%;
  833. background: red;
  834. border-radius: 20px;
  835. margin-bottom: 20px;
  836. position: relative;
  837. }
  838. .footer {
  839. width: 100%;
  840. height: 10%;
  841. background: rgb(46 43 43 / 90%);
  842. position: absolute;
  843. bottom: 0;
  844. z-index: 10;
  845. }
  846. .screenShare {
  847. width: 80%;
  848. height: 100%;
  849. background: yellow;
  850. }
  851. .userName {
  852. border-radius: 10px;
  853. width: 90px;
  854. height: 40px;
  855. text-align: center;
  856. line-height: 40px;
  857. background-color: black;
  858. position: absolute;
  859. right: 0;
  860. bottom: 0;
  861. z-index: 9;
  862. color: #ffffff;
  863. }
  864. .footerList {
  865. width: 100%;
  866. height: 10%;
  867. background: green;
  868. }
  869. .userNamePhone {
  870. border-radius: 10px;
  871. min-width: 20%;
  872. height: 30px;
  873. line-height: 30px;
  874. text-align: center;
  875. background-color: black;
  876. font-size: 12px;
  877. position: absolute;
  878. right: 0;
  879. bottom: 0;
  880. z-index: 9;
  881. color: #ffffff;
  882. }
  883. /* .header {
  884. width: 100%;
  885. height: 8%;
  886. background-color: #716c6c;
  887. display: flex;
  888. flex-direction: row-reverse;
  889. align-items: center;
  890. } */
  891. /* 移动端样式 */
  892. .roomPhone {
  893. width: 100%;
  894. height: 100vh;
  895. }
  896. .footerPhone {
  897. width: 100%;
  898. height: 8%;
  899. background-color: greenyellow;
  900. }
  901. .bodyPhone {
  902. width: 100%;
  903. height: 92%;
  904. display: flex;
  905. justify-content: space-around;
  906. flex-wrap: wrap;
  907. align-items: center;
  908. overflow-y: scroll;
  909. }
  910. .bodyPhone1 {
  911. width: 40%;
  912. height: 92%;
  913. position: absolute;
  914. right: 0;
  915. top: 0;
  916. display: flex;
  917. justify-content: space-around;
  918. flex-wrap: wrap;
  919. align-items: center;
  920. overflow-y: scroll;
  921. }
  922. .bodyPhone2{
  923. width: 0;
  924. height: 0;
  925. position: absolute;
  926. right: 0;
  927. top: 0;
  928. display: flex;
  929. justify-content: space-around;
  930. flex-wrap: wrap;
  931. align-items: center;
  932. overflow-y: scroll;
  933. }
  934. /* 移动端样式 */
  935. .bodyVideo {
  936. width: 100%;
  937. height: 92%;
  938. display: flex;
  939. flex-wrap: wrap;
  940. /* justify-content: space-between; */
  941. }
  942. .userVideoPhone {
  943. width: 100%;
  944. height: 100%;
  945. background-color: rgb(124, 124, 104);
  946. position: relative;
  947. }
  948. .userVideoPhone1 {
  949. width: 100%;
  950. height: 49%;
  951. background-color: rgb(161, 160, 169);
  952. position: relative;
  953. }
  954. .userVideoPhone2 {
  955. width: 150px;
  956. height: 150px;
  957. background-color: rgb(161, 160, 169);
  958. position: relative;
  959. }
  960. .quill-editor {
  961. height: 70%;
  962. }
  963. .updataBtn {
  964. width: 100%;
  965. position: absolute;
  966. bottom: 8px;
  967. }
  968. .fileList {
  969. /* max-height: 300px; */
  970. /* overflow-y: scroll; */
  971. }
  972. .list {
  973. display: flex;
  974. flex-wrap: wrap;
  975. }
  976. .applicant,
  977. .res,
  978. .mediate {
  979. width: 100%;
  980. margin-left: 20px;
  981. margin-bottom: 10px;
  982. color: #38393b;
  983. }
  984. .videoPage {
  985. width: 100%;
  986. height: 100vh;
  987. }
  988. .sharing1 {
  989. width: 100%;
  990. height: 92%;
  991. background: yellow;
  992. }
  993. .sharing {
  994. width: 0;
  995. height: 0;
  996. }
  997. .el-icon-d-arrow-right {
  998. position: absolute;
  999. left: 0;
  1000. top: 45%;
  1001. z-index: 999;
  1002. }
  1003. </style>