index.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309
  1. <template>
  2. <div class="pptEasyClass">
  3. <div class="pec_main" v-loading="pageLoading">
  4. <!-- 录音转文字 -->
  5. <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="iframeSrcop" ref="iiframe"
  6. v-show="false"></iframe>
  7. <div class="pec_header">
  8. <div class="pec_h_left">
  9. <!-- || tType == 1 -->
  10. <div @click.stop="back" class="backBtn" v-if="screenType != 2">
  11. <img src="../../assets/icon/newIcon/return.svg" alt="" />
  12. </div>
  13. <div @click.stop="gotoCourseManage" class="backBtn" v-if="screenType == 2 && tType == 1">
  14. <img src="../../assets/icon/newIcon/return.svg" alt="" />
  15. </div>
  16. <div v-if="tcid" class="class-info-group">
  17. <span class="class-label">{{ lang.ssClass }}</span>
  18. <span class="class-value class-value2" @click="openSelectClass">
  19. {{ className }}
  20. <svg t="1776672009773" class="xia-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
  21. p-id="4735" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12">
  22. <path
  23. d="M562.5 771c-14.3 14.3-33.7 27.5-52 23.5-18.4 3.1-35.7-11.2-50-23.5L18.8 327.3c-22.4-22.4-22.4-59.2 0-81.6s59.2-22.4 81.6 0L511.5 668l412.1-422.3c22.4-22.4 59.2-22.4 81.6 0s22.4 59.2 0 81.6L562.5 771z"
  24. p-id="4736" fill="currentColor"></path>
  25. </svg>
  26. </span>
  27. </div>
  28. <div v-if="tcid" class="class-info-group">
  29. <span class="class-label" v-if="inviteCode">{{ lang.ssInviteCode }}</span>
  30. <span class="class-value" v-if="inviteCode">{{ inviteCode }}</span>
  31. </div>
  32. <div @click.stop="openShareDialog" class="shareBtn" v-if="tcid && tType == 1">
  33. <img src="../../assets/share.svg" alt="" />
  34. </div>
  35. </div>
  36. <div class="pec_h_center">
  37. <el-tooltip effect="dark" :content="lang.ssRefresh" placement="bottom">
  38. <div class="refresh_icon" @click="refreshCourse">
  39. <img src="../../assets/icon/course/refresh-2.svg" />
  40. </div>
  41. </el-tooltip>
  42. <el-tooltip class="item" effect="dark"
  43. :content="recordedForm.status == 1 ? lang.ssFinishClassRecording : lang.ssBeginClassRecording"
  44. placement="bottom"
  45. v-show="(jArray.includes(oid) || jArray.includes(org)) && courseDetail.userid == userid && tcid">
  46. <div class="pec_h_r_btn_refresh" :class="{ 'recording': recordedForm.status == 1 }"
  47. @click="toggleRecording">
  48. <svg t="1772588344140" viewBox="0 0 1024 1024" p-id="1693" width="200" height="200">
  49. <path
  50. d="M512 1024a512.568889 512.568889 0 0 1-512-512 512.625778 512.625778 0 0 1 512-512 512.568889 512.568889 0 0 1 512 512 512.568889 512.568889 0 0 1-512 512zM512 73.329778c-241.948444 0-438.670222 196.835556-438.670222 438.670222S270.051556 950.670222 512 950.670222s438.670222-196.835556 438.670222-438.670222S753.948444 73.329778 512 73.329778z m0 686.592a245.191111 245.191111 0 1 1 0-490.382222 245.191111 245.191111 0 0 1 0 490.382222z"
  51. p-id="1694"></path>
  52. </svg>
  53. <span>{{ recordedForm.status == 1 ? lang.ssStopRecording2 : lang.ssRecord }}</span>
  54. </div>
  55. </el-tooltip>
  56. <el-tooltip effect="dark" :content="courseDetail.title" placement="bottom">
  57. <div class="pec_h_l_title">
  58. <span>{{ courseDetail.title }}</span>
  59. </div>
  60. </el-tooltip>
  61. <div class="free-browse-switch" v-if="courseDetail.userid == userid">
  62. <el-switch v-model="freeBrowse" :active-value="false" :inactive-value="true" class="custom-switch"
  63. active-color="#03ae2b" inactive-color="#d8d8d8" @change="onFreeBrowseChange"></el-switch>
  64. <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
  65. lang.ssFollowMode }}</span>
  66. </div>
  67. <!-- <div class="free-browse-switch" v-if="courseDetail.userid == userid">
  68. <el-switch v-model="isCan" :active-value="true" :inactive-value="false" class="custom-switch"
  69. active-color="#03ae2b" inactive-color="#d8d8d8" @change="onIsCanChange"></el-switch>
  70. <span class="switch-label" :class="{ active: isCan }">{{ isCan ? lang.ssShowResult : lang.ssHideResult }}</span>
  71. </div> -->
  72. <div class="free-browse-switch" v-if="tType == 2">
  73. <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
  74. lang.ssFollowMode }}</span>
  75. </div>
  76. </div>
  77. <div class="pec_h_right">
  78. <div class="pec_h_r_btnArea">
  79. <!-- openObserveDialog -->
  80. <!-- toggleRecording -->
  81. <div class="pec_h_r_btn_uploadVoiceBtn" @click="uploadVoiceBtn" v-if="courseDetail.userid == userid"
  82. v-show="false">
  83. <span>{{ lang.ssUploadRecordingFile }}</span>
  84. </div>
  85. <div class="pec_h_r_btn_afterClass" @click="afterClass" v-if="courseDetail.userid == userid">
  86. <img src="../../assets/icon/newIcon/afterClass.svg" alt="" />
  87. <span>{{ lang.ssEndClass }}</span>
  88. </div>
  89. <div class="name_box" v-if="tType == 2">
  90. {{ userJson.username }}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="pec_content">
  96. <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;clipboard-write;clipboard-read"
  97. webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="no" border="0" :src="iframeSrc"
  98. v-if="showIframe" style="width: 100%; height: 100%; border: none" ref="ppt"></iframe>
  99. </div>
  100. </div>
  101. <!-- 课堂观察弹窗 -->
  102. <el-dialog :visible.sync="showObserveDialog" :close-on-click-modal="false" :close-on-press-escape="false"
  103. :show-close="true" width="90%" top="5vh" class="observe-dialog">
  104. <iframe v-if="showObserveDialog" :src="observeDialogUrl" frameborder="0"
  105. style="width: 100%; height: 85vh; border: none;"></iframe>
  106. </el-dialog>
  107. <selectTeachingClassDialog :courseDetail="courseDetail" :userId="userid" ref="selectTeachingClassDialogRef" @success="selectClassSuccess" @changeClassList="changeClassList"/>
  108. <!-- 消息提示组件 -->
  109. <messageInstruction ref="messageInstructionRef"></messageInstruction>
  110. <!-- 确认提示组件 -->
  111. <confirmInstruction ref="confirmInstructionRef"></confirmInstruction>
  112. <!-- 分享弹窗 -->
  113. <shareDialog ref="shareDialogRef"></shareDialog>
  114. </div>
  115. </template>
  116. <script>
  117. import { myMixin } from '../../mixins/mixin';
  118. import selectTeachingClassDialog from "../dialog/selectTeachingClassDialog2.vue";
  119. import messageInstruction from '../components/messageInstruction.vue';
  120. import confirmInstruction from '../components/confirmInstruction.vue';
  121. import shareDialog from './shareDialog.vue';
  122. export default {
  123. mixins: [myMixin],
  124. components: {
  125. messageInstruction,
  126. confirmInstruction,
  127. selectTeachingClassDialog,
  128. shareDialog
  129. },
  130. data() {
  131. return {
  132. id: this.$route.query.courseId,
  133. userid: this.$route.query.userid,
  134. classId: this.$route.query.cid,
  135. role: this.$route.query.role,
  136. oid: this.$route.query.oid,
  137. org: this.$route.query.org,
  138. tType: this.$route.query.tType,
  139. courseType: this.$route.query.type,
  140. screenType: this.$route.query.screenType,
  141. tcid2: this.$route.query.tcid,
  142. classList: [],
  143. tcid: "",
  144. className: "",
  145. showIframe: false,
  146. iframeSrc: "",
  147. courseDetail: {},
  148. pageLoading: false,
  149. inviteCode: "",
  150. startTime: "",
  151. freeBrowse: true, // 默认自由浏览
  152. opertimer: null, // 定时器
  153. jArray: [],
  154. // 录音相关变量
  155. languageRadio: 2, // 语言选择
  156. recordedForm: {
  157. status: 0, // 0: 未开始, 1: 录音中, 2: 暂停, 3: 结束
  158. startTime: 0,
  159. endTime: 0,
  160. timeDuration: 0,
  161. textList: [],
  162. audioBlob: []
  163. },
  164. controlsStatus: 0, // 控制状态
  165. showIndexPage: true, // 显示索引页
  166. pageStatus: 1, // 页面状态
  167. editorBarData: {
  168. type: "0",
  169. content: ""
  170. },
  171. uploadFileLoading: false, // 上传文件加载状态
  172. transcriptionData: {
  173. content: ""
  174. },
  175. showGetTextLoading: false, // 显示获取文本加载状态
  176. // 弹窗相关
  177. showObserveDialog: false, // 显示课堂观察弹窗
  178. observeDialogUrl: "", // 课堂观察链接
  179. // 录音时间记录
  180. recordingStartTime: "", // 开始录音时间
  181. recordingEndTime: "", // 结束录音时间
  182. isResultArray: [],
  183. isCan: false,
  184. timeoutPan: null,
  185. isTimeOutPan: false,
  186. };
  187. },
  188. computed: {
  189. iframeSrcop() {
  190. if (this.$region == 'hk') {
  191. return `https://cloud.cocorobo.hk/browser/public/index.html`;
  192. } else if (this.$region == 'com') {
  193. return `https://cloud.cocorobo.com/browser/public/index.html`;
  194. } else {
  195. return `https://beta.cloud.cocorobo.cn/browser/public/index.html`;
  196. }
  197. }
  198. },
  199. methods: {
  200. openSelectClass(){
  201. this.$refs.selectTeachingClassDialogRef.open({classList:this.classList}, this.tcid2)
  202. },
  203. addInviteCodeOne(cid) {
  204. return new Promise((resolve)=>{
  205. let params = [
  206. {
  207. courseId: this.id,
  208. inviteCode: cid,
  209. },
  210. ];
  211. this.ajax
  212. .post(this.$store.state.api + "add_courseInviteCode2", params)
  213. .then((res) => {
  214. console.log(res.data)
  215. resolve(res.data)
  216. })
  217. .catch((err) => {
  218. resolve(err.messages)
  219. console.error(err);
  220. });
  221. })
  222. },
  223. async selectClassSuccess(classId){
  224. if(classId){
  225. let data = await this.addInviteCodeOne(classId)
  226. console.log("addInviteCodeOne",data)
  227. this.tcid2 = classId
  228. this.getClassName()
  229. this.getCourseDetail();
  230. }else if(this.tcid2){
  231. this.ticd2 = ''
  232. this.getCourseDetail();
  233. }
  234. // this.gotoCourse(classId);
  235. this.$refs.selectTeachingClassDialogRef.close();
  236. this.setoTime("1");
  237. },
  238. async changeClassList(data){
  239. this.classList = JSON.parse(JSON.stringify(data))
  240. let params = [{
  241. cid:this.id,
  242. juri:this.classList.map(i=>i.id).join(',')
  243. }]
  244. this.ajax.post(this.$store.state.api+"update_CourseJuriById",params).then(res=>{
  245. if(res.data==1){
  246. console.log(this.lang.ssModifySuccess)
  247. }
  248. })
  249. //this.inviteCodeFn();
  250. },
  251. goTo(path) {
  252. this.$router.push(path);
  253. },
  254. refreshCourse() {
  255. this.getCourseDetail();
  256. },
  257. audioStart() {
  258. this.onStartRecordWithMicrosoft();
  259. },
  260. toggleRecording() {
  261. return new Promise(resolve => {
  262. if (this.recordedForm.status == 1) {
  263. // 检查录音时间是否至少为5秒
  264. const now = new Date();
  265. const duration = (now - new Date(this.recordingStartTime)) / 1000;
  266. if (duration < 5) {
  267. this.$message.warning(this.lang.ssRecordingTimeAtLeast5Seconds);
  268. return;
  269. }
  270. this.$refs.confirmInstructionRef.open({
  271. title: this.lang.ssStopRecordingConfirm,
  272. message: this.lang.ssStopRecordingNotice,
  273. cancelText: this.lang.ssCancel,
  274. submitText: this.lang.ssConfirm,
  275. submitCallback: () => {
  276. console.log("确定")
  277. this.onFinishRecordWithMicrosoft().then(() => {
  278. resolve(true)
  279. });
  280. },
  281. cancelCallback: () => {
  282. console.log("取消")
  283. resolve(false)
  284. },
  285. })
  286. // this.$confirm(this.lang.ssStopRecordingNotice, this.lang.ssStopRecordingConfirm, {
  287. // confirmButtonText: this.lang.ssConfirm,
  288. // cancelButtonText: this.lang.ssCancel,
  289. // confirmButtonClass: "pptEasyClassConfirmButtonText",
  290. // cancelButtonClass: "pptEasyClassCancelButtonText"
  291. // }).then(() => {
  292. // console.log("确定")
  293. // // this.$message({
  294. // // dangerouslyUseHTMLString: true,
  295. // // customClass:"pptEasyClassMessage",
  296. // // message: '已停止录制 <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank">查看结果</p>'
  297. // // });
  298. // this.onFinishRecordWithMicrosoft().then(() => {
  299. // resolve(true)
  300. // });
  301. // }).catch(() => {
  302. // console.log("取消")
  303. // resolve(false)
  304. // });
  305. } else {
  306. const now = new Date();
  307. const duration = (now - new Date(this.recordingEndTime)) / 1000;
  308. if (duration < 5) {
  309. this.$message.warning('录音时间至少间距5秒');
  310. return;
  311. }
  312. this.onStartRecordWithMicrosoft();
  313. resolve(true)
  314. }
  315. })
  316. // })
  317. },
  318. // ============ start 微软录音转译
  319. onStartRecordWithMicrosoft() {
  320. let iiframe = this.$refs["iiframe"];
  321. iiframe.contentWindow.window.document.getElementById(
  322. "languageOptions"
  323. ).selectedIndex = this.languageRadio;
  324. // 录音开始
  325. let flag = true;
  326. console.log("开始录音", iiframe);
  327. this.recordedForm.status = 1;
  328. // 记录开始录音时间
  329. this.recordingStartTime = new Date().toLocaleString("zh-CN", {
  330. hour12: false,
  331. timeZone: "Asia/Shanghai"
  332. }).replace(/\//g, "-");
  333. iiframe.contentWindow.window.onRecognizedResult = e => {
  334. console.log("onRecognizedResult", e);
  335. this.recordedForm.endTime = this.recordedForm.timeDuration;
  336. if (flag) {
  337. this.controlsStatus = 1;
  338. this.showIndexPage = false;
  339. this.pageStatus = 2;
  340. this.editorBarData.type = "0";
  341. flag = false;
  342. this.uploadFileLoading = false;
  343. this.transcriptionData.content = "";
  344. this.editorBarData.content = "";
  345. this.recordedForm.textList = [];
  346. }
  347. this.showGetTextLoading = true;
  348. let privText = e.privText;
  349. let privSpeakerId = e.privSpeakerId;
  350. let _copyPrivSpeakerId = privSpeakerId;
  351. console.log("👇转译对象👇");
  352. console.log(e);
  353. console.log("👇转译结果👇");
  354. console.log(privText);
  355. if (!privText || !privSpeakerId || privSpeakerId == "Unknown") {
  356. return;
  357. }
  358. const newItem = {
  359. value: privText,
  360. role: "",
  361. startTime: this.updateRecordedTime({
  362. duration: this.recordedForm.startTime
  363. }),
  364. endTime: this.updateRecordedTime({
  365. duration: this.recordedForm.endTime
  366. }),
  367. time: this.updateRecordedTime({
  368. duration: this.recordedForm.endTime - this.recordedForm.startTime
  369. })
  370. };
  371. this.recordedForm.textList.push(newItem);
  372. this.recordedForm.startTime = this.recordedForm.timeDuration + 1;
  373. this.transcriptionData.content +=
  374. _copyPrivSpeakerId + ":" + privText + "\n";
  375. this.onRecordAddLine(newItem);
  376. };
  377. iiframe.contentWindow.ConversationTranscriber();
  378. setTimeout(() => {
  379. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
  380. if (permissionStatus.state !== "granted") {
  381. // 没有开启录音权限,直接确定停止录音
  382. this.recordedForm.status = "0";
  383. let iframe = this.$refs["iiframe"];
  384. iframe.contentWindow.onSessionStopped = null;
  385. iframe.contentWindow.window.onRecognizedResult = null;
  386. this.$message.success(this.lang.ssNoPermStop);
  387. return;
  388. }
  389. })
  390. }, 10000)
  391. },
  392. async onFinishRecordWithMicrosoft() {
  393. return new Promise(resolve => {
  394. navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
  395. if (permissionStatus.state !== "granted") {
  396. // 没有开启录音权限,直接确定停止录音
  397. this.recordedForm.status = "0";
  398. let iframe = this.$refs["iiframe"];
  399. iframe.contentWindow.onSessionStopped = null;
  400. iframe.contentWindow.window.onRecognizedResult = null;
  401. this.$message.success(this.lang.ssNoPermStop);
  402. return;
  403. }
  404. if (this.recordedForm.status == 1) {
  405. //正在录音时
  406. let iiframe = this.$refs["iiframe"];
  407. iiframe.contentWindow.window.document
  408. .getElementById("scenarioStopButton")
  409. .click();
  410. // 录音借宿
  411. iiframe.contentWindow.onSessionStopped = async (s, e) => {
  412. this.recordedForm.status = 0;
  413. this.controlsStatus = 2;
  414. this.showGetTextLoading = false;
  415. // this.$message.success("已结束录音");
  416. console.log("结束录音👇");
  417. console.log("结束录音", e);
  418. this.recordedForm.audioBlob.push(e.preaudio);
  419. let blob = new Blob(this.recordedForm.audioBlob, {
  420. type: "audio/wav"
  421. });
  422. let file = new File([blob], "recordedFile.wav", {
  423. type: "audio/wav"
  424. });
  425. // 存储文件和文本到全局对象
  426. await this.storeRecordingData(file);
  427. // 记录结束录音时间
  428. this.recordingEndTime = await this.getServerTime()
  429. // 调用 addPPTClass 接口
  430. this.addPPTClass(file);
  431. iiframe.contentWindow.onSessionStopped = null;
  432. iiframe.contentWindow.window.onRecognizedResult = null;
  433. resolve(true)
  434. };
  435. } else if (this.recordedForm.status == 2) {
  436. //暂停录音时
  437. this.recordedForm.status = 0;
  438. this.controlsStatus = 2;
  439. this.showGetTextLoading = false;
  440. let blob = new Blob(this.recordedForm.audioBlob, {
  441. type: "audio/wav"
  442. });
  443. let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
  444. // 存储文件和文本到全局对象
  445. await this.storeRecordingData(file);
  446. // 记录结束录音时间
  447. this.recordingEndTime = await this.getServerTime()
  448. // 调用 addPPTClass 接口
  449. this.addPPTClass(file);
  450. resolve(true)
  451. }
  452. })
  453. })
  454. },
  455. storeRecordingData(file) {
  456. // 配置全局 window 对象存储录音数据
  457. return new Promise((resolve) => {
  458. if (!window.recordingData) {
  459. window.recordingData = {};
  460. }
  461. window.recordingData.file = file;
  462. window.recordingData.text = this.transcriptionData.content;
  463. window.recordingData.textList = this.recordedForm.textList;
  464. // 将录音文件转为base64并存入localStorage
  465. // const reader = new FileReader();
  466. // reader.onload = function(e) {
  467. // const base64data = e.target.result;
  468. // try {
  469. // localStorage.setItem("recordedFileBase64", base64data);
  470. // localStorage.setItem('recordedFileName', file.name);
  471. // localStorage.setItem('recordedFileType', file.type);
  472. resolve(true)
  473. // console.log("录音数据已存储到全局对象:", window.recordingData);
  474. // } catch (err) {
  475. // resolve(false)
  476. // console.error("localStorage存储base64文件失败:", err);
  477. // }
  478. // };
  479. // reader.readAsDataURL(file);
  480. })
  481. },
  482. openObserveDialog(pptid, file) {
  483. // this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  484. // this.showObserveDialog = true;
  485. const url = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
  486. const _pageWindow = window.open(url, '_blank');
  487. // if(!_pageWindow){
  488. // alert('浏览器弹窗被拦截,请允许弹窗后重试');
  489. // return;
  490. // }
  491. const sendData = {
  492. type: 'fileData',
  493. file,
  494. }
  495. const sendMessageToVue3 = () => {
  496. _pageWindow.postMessage(
  497. sendData,
  498. '*' // targetOrigin:必须是Vue3的实际域名,不要用*(安全)
  499. );
  500. };
  501. const handleVue3Ready = (e) => {
  502. // 校验消息来源(安全:只处理Vue3域名的消息)
  503. // 校验消息类型(确认是Vue3的就绪通知)
  504. if (e.data.type === 'READY') {
  505. console.log('已就绪,开始发送数据');
  506. sendMessageToVue3();
  507. }
  508. // 校验Vue3的"接收成功"确认(可选,进一步确保送达)
  509. if (e.data.type === 'DATA_RECEIVED') {
  510. console.log('数据已被接收');
  511. // 收到确认后移除监听,避免内存泄漏
  512. window.removeEventListener('message', handleVue3Ready);
  513. }
  514. };
  515. window.addEventListener('message', handleVue3Ready);
  516. const timeoutTimer = setTimeout(() => {
  517. console.log('未收到就绪通知,主动发送数据');
  518. sendMessageToVue3();
  519. // 移除监听(兜底后清理)
  520. window.removeEventListener('message', handleVue3Ready);
  521. }, 5000);
  522. const checkWinClosed = setInterval(() => {
  523. if (_pageWindow.closed) {
  524. clearTimeout(timeoutTimer);
  525. clearInterval(checkWinClosed);
  526. window.removeEventListener('message', handleVue3Ready);
  527. }
  528. }, 1000);
  529. // 优化:仅通过轮询方式检查窗口是否加载完成并发送消息,被打开页面无需做任何处理
  530. // const sendFileData = () => {
  531. // if (_pageWindow && !_pageWindow.closed) {
  532. // _pageWindow.postMessage(
  533. // {
  534. // type: 'fileData',
  535. // file,
  536. // },
  537. // '*'
  538. // );
  539. // }
  540. // };
  541. // let checkCount = 0;
  542. // const checkLoadedInterval = setInterval(() => {
  543. // if (!_pageWindow || _pageWindow.closed) {
  544. // clearInterval(checkLoadedInterval);
  545. // return;
  546. // }
  547. // try {
  548. // if (_pageWindow.document && _pageWindow.document.readyState === 'complete') {
  549. // clearInterval(checkLoadedInterval);
  550. // sendFileData();
  551. // }
  552. // } catch (err) {
  553. // // 跨域下直接尝试发送
  554. // clearInterval(checkLoadedInterval);
  555. // sendFileData();
  556. // }
  557. // if (++checkCount > 20) {
  558. // // 最多检测2秒(20次)
  559. // clearInterval(checkLoadedInterval);
  560. // sendFileData();
  561. // }
  562. // }, 100);
  563. setTimeout(() => {
  564. window.focus()
  565. }, 100)
  566. function openPageWindow() {
  567. _pageWindow.focus()
  568. }
  569. this.$refs.messageInstructionRef.pptMessage(`${this.lang.ssStoppedRecording} <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank" onClick="(${openPageWindow.toString()})()">${this.lang.ssViewRecordingResult}</p>`)
  570. },
  571. addPPTClass(file) {
  572. let params = {
  573. pptid: this.id,
  574. cid: this.tcid,
  575. st: this.recordingStartTime,
  576. et: this.recordingEndTime
  577. };
  578. this.ajax
  579. .post(this.$store.state.api + "addPPTClass", [params])
  580. .then(res => {
  581. console.log("addPPTClass", res);
  582. let id = res.data[0][0].id;
  583. this.openObserveDialog(id, file);
  584. })
  585. .catch(err => {
  586. console.error(err);
  587. this.$message.error("保存录音信息失败");
  588. });
  589. },
  590. updateRecordedTime({ duration }) {
  591. // 格式化录音时间
  592. const minutes = Math.floor(duration / 60);
  593. const seconds = Math.floor(duration % 60);
  594. return `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  595. },
  596. onRecordAddLine(item) {
  597. // 添加录音文本行
  598. console.log("添加录音文本行:", item);
  599. // 这里可以根据需要添加更多处理逻辑
  600. },
  601. getCourseDetail() {
  602. this.pageLoading = true;
  603. let params = {
  604. courseId: this.id
  605. };
  606. this.ajax
  607. .get(this.$store.state.api + "selectCourseDetail3", params)
  608. .then(res => {
  609. console.log("getCourseDetail", res);
  610. this.courseDetail = res.data[0][0];
  611. this.courseDetail.chapters = JSON.parse(this.courseDetail.chapters);
  612. this.tcid = this.arrayToArray(
  613. this.courseDetail.juri ? this.courseDetail.juri.split(",") : [],
  614. this.tcid2 ? this.tcid2.split(",") : []
  615. )[0] || "";
  616. console.log('tcid', this.tcid)
  617. console.log('tcid2', this.tcid2)
  618. if (this.tcid && res.data[1].length) {
  619. let _inviteA = [];
  620. for (var ik = 0; ik < res.data[1].length; ik++) {
  621. _inviteA.push({
  622. cid: res.data[1][ik].classid,
  623. ic: res.data[1][ik].code,
  624. });
  625. }
  626. for (var ik = 0; ik < _inviteA.length; ik++) {
  627. if (
  628. this.arrayToArray(
  629. _inviteA[ik].cid.split(","),
  630. this.tcid.split(",")
  631. ).length
  632. ) {
  633. this.inviteCode = _inviteA[ik].ic;
  634. break;
  635. }
  636. }
  637. }
  638. this.setPptIframe()
  639. this.classList = res.data[2]
  640. if(!this.tcid2 && this.tType == '1'){
  641. this.$refs.selectTeachingClassDialogRef.open({classList:this.classList})
  642. }
  643. this.pageLoading = false;
  644. })
  645. .catch(err => {
  646. console.log(err);
  647. this.$message.error(this.lang.ssGetCourseDataFail);
  648. this.pageLoading = false;
  649. });
  650. },
  651. setPptIframe() {
  652. this.showIframe = false;
  653. this.$nextTick(() => {
  654. let api = 'https://beta.ppt.cocorobo.cn'
  655. if (this.$region == 'beta') {
  656. api = 'https://beta.ppt.cocorobo.cn'
  657. } else if (this.$region == 'hk') {
  658. api = 'https://ppt.cocorobo.hk'
  659. } else if (this.$region == 'com') {
  660. api = 'https://ppt.cocorobo.com'
  661. } else {
  662. api = 'https://ppt.cocorobo.cn'
  663. }
  664. let _url = api + `/?mode=student&courseid=${this.id}&userid=${this.userid}&oid=${this.oid}&org=${this.org}&cid=${this.tcid}&type=${this.tType}`;
  665. this.iframeSrc = _url;
  666. this.showIframe = true;
  667. });
  668. },
  669. arrayToArray(arrayo, arrayt) {
  670. let array1 = arrayo;
  671. let array2 = arrayt;
  672. let commonElements = [];
  673. for (let i = 0; i < array1.length; i++) {
  674. for (let j = 0; j < array2.length; j++) {
  675. if (array1[i] === array2[j]) {
  676. commonElements.push(array1[i]);
  677. }
  678. }
  679. }
  680. return commonElements;
  681. },
  682. async getClassName() {
  683. let courseGrade = await this.ajax.get(this.$store.state.api + "getClassById", { id: this.tcid2 });
  684. this.className = courseGrade.data[0][0].grade;
  685. },
  686. back() {
  687. // if (this.tType != 2) {
  688. // this.goTo(
  689. // '/courseDetail?userid=' +
  690. // this.userid +
  691. // '&oid=' +
  692. // this.oid +
  693. // '&org=' +
  694. // this.org +
  695. // '&cid=' +
  696. // this.classId +
  697. // '&courseId=' +
  698. // this.id +
  699. // '&tType=' +
  700. // this.tType +
  701. // '&screenType=' +
  702. // this.screenType
  703. // )
  704. // } else {
  705. this.goTo(
  706. '/index?userid=' +
  707. this.userid +
  708. '&oid=' +
  709. this.oid +
  710. '&org=' +
  711. this.org +
  712. '&cid=' +
  713. this.classId +
  714. '&tType=' +
  715. this.tType +
  716. '&screenType=' +
  717. this.screenType
  718. )
  719. // }
  720. },
  721. gotoCourseManage(){
  722. parent.setCourseUrl();
  723. },
  724. afterClass() {
  725. if (this.recordedForm.status == 1) {
  726. this.toggleRecording().then((flag) => {
  727. if (flag) {
  728. this.$refs.confirmInstructionRef.open({
  729. title: this.lang.ssPrompt,
  730. message: this.lang.ssEndClassConfirm,
  731. cancelText: this.lang.ssCancel,
  732. submitText: this.lang.ssConfirm,
  733. submitCallback: () => {
  734. this.isTimeOutPan = false;
  735. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  736. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  737. setTimeout(() => {
  738. this.tcid2 = ""
  739. this.refreshCourse()
  740. }, 1000)
  741. },
  742. cancelCallback: () => {
  743. this.isTimeOutPan = false;
  744. console.log("取消")
  745. }
  746. })
  747. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  748. // confirmButtonText: this.lang.ssConfirm,
  749. // cancelButtonText: this.lang.ssCancel,
  750. // type: 'warning'
  751. // }).then(() => {
  752. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  753. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  754. // setTimeout(() => {
  755. // this.tcid2 = ""
  756. // this.refreshCourse()
  757. // }, 1000)
  758. // }).catch(() => { });
  759. }
  760. })
  761. } else {
  762. // this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
  763. // confirmButtonText: this.lang.ssConfirm,
  764. // cancelButtonText: this.lang.ssCancel,
  765. // type: 'warning'
  766. // }).then(() => {
  767. // this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  768. // this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  769. // setTimeout(() => {
  770. // this.tcid2 = ""
  771. // this.refreshCourse()
  772. // }, 1000)
  773. // }).catch(() => { });
  774. this.$refs.confirmInstructionRef.open({
  775. title: this.lang.ssPrompt,
  776. message: this.lang.ssEndClassConfirm,
  777. cancelText: this.lang.ssCancel,
  778. submitText: this.lang.ssConfirm,
  779. submitCallback: () => {
  780. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  781. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  782. setTimeout(() => {
  783. this.tcid2 = ""
  784. this.refreshCourse()
  785. }, 1000)
  786. },
  787. cancelCallback: () => {
  788. console.log("取消")
  789. }
  790. })
  791. }
  792. },
  793. onFreeBrowseChange(value) {
  794. this.freeBrowse = value;
  795. console.log('自由浏览模式已切换为1:', this.freeBrowse);
  796. this.$refs.ppt.contentWindow.PPTistStudent.toggleFollowMode()
  797. },
  798. onIsCanChange(value) {
  799. this.isCan = value;
  800. for(var i = 0; i < this.isResultArray.length; i++){
  801. let item = this.isResultArray[i];
  802. if(value && item.isTool){
  803. item.can = true
  804. }else if(item.isTool){
  805. item.can = false
  806. item.like = false
  807. }
  808. }
  809. this.$refs.ppt.contentWindow.PPTistStudent.setCan(this.isResultArray)
  810. },
  811. setOperationTime() {
  812. let _this = this;
  813. if (_this.opertimer) {
  814. clearInterval(_this.opertimer);
  815. _this.opertimer = null;
  816. }
  817. _this.opertimer = setInterval(() => {
  818. _this.setoTime("600");
  819. }, 600000);
  820. },
  821. setoTime(time) {
  822. this.doSyncClassData();
  823. let params = [
  824. {
  825. uid: this.userid,
  826. cid: this.id + (this.tcid2 || ''),
  827. type: "2",
  828. time: time,
  829. },
  830. ];
  831. this.ajax
  832. .post(this.$store.state.api + "addOperationTimeT2", params)
  833. .then((res) => { })
  834. .catch((err) => {
  835. console.error(err);
  836. });
  837. },
  838. getAIJ() {
  839. this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
  840. let a = res.data[4];
  841. console.log(a)
  842. let Array = [];
  843. a.forEach(i => Array.push(i.oid))
  844. this.jArray = Array;
  845. })
  846. },
  847. async doSyncClassData() {
  848. let userArray = ['6fbc6471-1d48-11ed-8c78-005056b86db5','333d0dfc-1cd9-11ef-bee5-005056b86db5','6fbce5ef-1d48-11ed-8c78-005056b86db5','66feffcc-ad35-11ed-b13d-005056b86db5']
  849. if (this.courseDetail.userid == this.userid && (this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840' || userArray.includes(this.userid))) {
  850. let endTime = await this.getServerTime()
  851. let courseTime = Math.floor((new Date(endTime) - new Date(this.startTime)) / (1000 * 60))
  852. this.syncClassData({
  853. courseId: this.id,
  854. title: this.courseDetail.title,
  855. ctitle: this.courseDetail.copyTitle || this.courseDetail.title,
  856. courseGrade: this.tcid2 ? this.tcid2 : '',
  857. courseTime: courseTime,
  858. startTime: this.startTime,
  859. endTime: endTime,
  860. })
  861. console.log('同步数据')
  862. }
  863. },
  864. // 直接上传录制音频/视频
  865. uploadVoiceBtn() {
  866. const input = document.createElement('input');
  867. input.type = 'file';
  868. input.accept = '.m4a,.mp4,.mov,.mp3,.wav';
  869. input.click();
  870. input.onchange = (e) => {
  871. const fileList = e.target.files;
  872. const file = fileList[0]
  873. this.recordingStartTime = new Date(window.recordingStartTime ? window.recordingStartTime : new Date()).toLocaleString("zh-CN", {
  874. hour12: false,
  875. timeZone: "Asia/Shanghai"
  876. }).replace(/\//g, "-");
  877. this.recordingEndTime = new Date(window.recordingEndTime ? window.recordingEndTime : new Date()).toLocaleString("zh-CN", {
  878. hour12: false,
  879. timeZone: "Asia/Shanghai"
  880. }).replace(/\//g, "-");
  881. this.addPPTClass(file)
  882. // 判断文件类型并获取音频或视频时长
  883. // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
  884. // const url = URL.createObjectURL(file);
  885. // let media;
  886. // if (file.type.startsWith('audio/')) {
  887. // media = new Audio();
  888. // } else {
  889. // media = document.createElement('video');
  890. // }
  891. // media.preload = 'metadata';
  892. // media.src = url;
  893. // media.onloadedmetadata = () => {
  894. // const duration = media.duration;
  895. // console.log('文件时长(秒):', duration);
  896. // // 这里可以赋值或者进一步处理时长 duration
  897. // URL.revokeObjectURL(url);
  898. // };
  899. // media.onerror = () => {
  900. // console.error('无法读取文件时长');
  901. // URL.revokeObjectURL(url);
  902. // };
  903. // }
  904. }
  905. },
  906. // 打开分享弹窗
  907. openShareDialog() {
  908. let code = this.userJson.oidCode || this.userJson.orgCode
  909. this.$refs.shareDialogRef.open(code, this.inviteCode)
  910. },
  911. resetIdleOp(){
  912. if(this.courseDetail.userId == this.userid){
  913. this.isTimeOutPan = true;
  914. this.afterClass()
  915. setTimeout(() => {
  916. if(this.isTimeOutPan){
  917. this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
  918. this.$refs.messageInstructionRef.pptMessage(this.lang.ssStudentLoggedOut)
  919. setTimeout(() => {
  920. this.tcid2 = ""
  921. this.refreshCourse()
  922. }, 1000)
  923. }
  924. }, 5000);
  925. }
  926. // console.log('resetIdleOp','重置空闲定时器')
  927. }
  928. },
  929. destroyed() {
  930. clearInterval(this.opertimer);
  931. this.opertimer = null;
  932. clearTimeout(this.timeoutPan);
  933. this.timeoutPan = null;
  934. this.doSyncClassData();
  935. this.stopIdleDetection(this.resetIdleOp);
  936. },
  937. async mounted() {
  938. this.setoTime("1");
  939. this.startTime = await this.getServerTime()
  940. console.log('this.startTime', this.startTime)
  941. this.timeoutPan = setTimeout(() => {
  942. this.startIdleDetection(this.resetIdleOp);
  943. }, 40 * 60 * 1000)
  944. // this.startIdleDetection(this.resetIdleOp);
  945. this.getClassName()
  946. this.getAIJ();
  947. this.getCourseDetail();
  948. this.setOperationTime();
  949. window.onFreeBrowseChange = (value) => {
  950. this.freeBrowse = value;
  951. console.log('自由浏览模式已切换为:', this.freeBrowse);
  952. }
  953. window.setIsResultArray = (value) => {
  954. this.isResultArray = value;
  955. // 判断数组中isTool为true的项的can是否都为true
  956. const toolItems = value.filter(item => item.isTool);
  957. if (toolItems.length > 0) {
  958. const allCanTrue = toolItems.every(item => item.can === true);
  959. const allCanFalse = toolItems.every(item => item.can === false);
  960. if (allCanTrue) {
  961. this.isCan = true;
  962. } else if (allCanFalse) {
  963. this.isCan = false;
  964. }
  965. }
  966. }
  967. if (!this.userJson || !this.userJson.accountNumber) {
  968. let res = await this.ajax.get(this.$store.state.api + "selectUser", {
  969. userid: this.$route.query.userid
  970. });
  971. this.userJson = res.data[0][0]
  972. }
  973. setTimeout(() => {
  974. this.doSyncClassData();
  975. }, 1000);
  976. }
  977. };
  978. </script>
  979. <style scoped>
  980. .pptEasyClass {
  981. width: 100vw;
  982. height: 100vh;
  983. display: flex;
  984. flex-direction: column;
  985. overflow: hidden;
  986. box-sizing: border-box;
  987. background-color: #f2f2f2;
  988. min-height: unset;
  989. }
  990. .pec_main {
  991. width: 100%;
  992. height: 100%;
  993. background-color: #fff;
  994. }
  995. .pec_header {
  996. width: 100%;
  997. height: 60px;
  998. background: #FCCF00;
  999. box-sizing: border-box;
  1000. display: flex;
  1001. align-items: center;
  1002. justify-content: space-between;
  1003. position: relative;
  1004. box-shadow: 0px 4px 12px 0px #3648601F;
  1005. padding: 0 10px;
  1006. box-sizing: border-box;
  1007. }
  1008. .pec_h_left {
  1009. width: auto;
  1010. height: 100%;
  1011. display: flex;
  1012. align-items: center;
  1013. gap: 25px;
  1014. /* 保持左侧靠左 */
  1015. }
  1016. .pec_h_center {
  1017. position: absolute;
  1018. left: 50%;
  1019. top: 0;
  1020. height: 100%;
  1021. display: flex;
  1022. align-items: center;
  1023. transform: translateX(-50%);
  1024. z-index: 1;
  1025. }
  1026. .pec_h_l_title {
  1027. font-weight: bold;
  1028. font-size: 20px;
  1029. color: #0e1e33;
  1030. overflow: hidden;
  1031. white-space: nowrap;
  1032. max-width: 500px;
  1033. text-overflow: ellipsis;
  1034. }
  1035. .pec_h_right {
  1036. width: auto;
  1037. height: 100%;
  1038. display: flex;
  1039. align-items: center;
  1040. }
  1041. .pec_h_r_btnArea {
  1042. display: flex;
  1043. align-items: center;
  1044. justify-content: center;
  1045. }
  1046. .pec_h_r_btnArea>div {
  1047. width: auto;
  1048. height: auto;
  1049. display: flex;
  1050. align-items: center;
  1051. justify-content: center;
  1052. padding: 10px 20px;
  1053. background-color: #f0f4fa;
  1054. border-radius: 4px;
  1055. cursor: pointer;
  1056. font-size: 14px;
  1057. font-weight: 400;
  1058. color: #000;
  1059. border: 1px solid #cad1dc;
  1060. }
  1061. .pec_h_r_btnArea>div+div {
  1062. margin-left: 10px;
  1063. }
  1064. .pec_h_r_btnArea>div>img {
  1065. width: 15px;
  1066. height: 15px;
  1067. margin-right: 5px;
  1068. }
  1069. .pec_h_center>.pec_h_r_btn_refresh {
  1070. color: #fff;
  1071. /* background-color: #0061ff;
  1072. border-color: #0061ff; */
  1073. padding: 9px 10px;
  1074. margin-right: 15px;
  1075. border-radius: 26px;
  1076. display: flex;
  1077. align-items: center;
  1078. justify-content: center;
  1079. gap: 5px;
  1080. background: #FFF7F5;
  1081. color: #000000;
  1082. font-weight: 400;
  1083. cursor: pointer;
  1084. fill: #666666;
  1085. }
  1086. .pec_h_center>.pec_h_r_btn_refresh>svg {
  1087. width: 1rem;
  1088. height: 1rem;
  1089. }
  1090. .pec_h_center>.pec_h_r_btn_refresh.recording {
  1091. /* background-color: #F53F3F;
  1092. border-color: #F53F3F; */
  1093. background: #FFF7E8;
  1094. fill: #FF9300;
  1095. animation: pulse 1.5s infinite;
  1096. }
  1097. @keyframes pulse {
  1098. 0% {
  1099. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.4);
  1100. }
  1101. 70% {
  1102. box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
  1103. }
  1104. 100% {
  1105. box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
  1106. }
  1107. }
  1108. .pec_h_r_btnArea>.pec_h_r_btn_afterClass {
  1109. border-color: #F0E1DD;
  1110. background-color: #FFF7F5;
  1111. color: #F53F3F;
  1112. }
  1113. .pec_h_r_btn_uploadVoiceBtn {
  1114. border-color: #F0E1DD;
  1115. background-color: #FFF7F5;
  1116. color: #000;
  1117. }
  1118. .backBtn {
  1119. width: 15px;
  1120. height: 15px;
  1121. display: flex;
  1122. align-items: center;
  1123. justify-content: center;
  1124. cursor: pointer;
  1125. }
  1126. .backBtn img {
  1127. width: 100%;
  1128. height: 100%;
  1129. }
  1130. .shareBtn {
  1131. width: 25px;
  1132. height: 25px;
  1133. display: flex;
  1134. align-items: center;
  1135. justify-content: center;
  1136. cursor: pointer;
  1137. }
  1138. .shareBtn img {
  1139. width: 100%;
  1140. height: 100%;
  1141. }
  1142. .class-info-group {
  1143. display: flex;
  1144. align-items: center;
  1145. gap: 10px;
  1146. }
  1147. .class-label {
  1148. font-size: 18px;
  1149. font-weight: bold;
  1150. color: #222;
  1151. margin-right: 5px;
  1152. }
  1153. .class-value {
  1154. font-size: 16px;
  1155. color: #222;
  1156. background: #FFFFFF3D;
  1157. border: 1px solid #00000080;
  1158. border-radius: 5px;
  1159. padding: 5px 18px;
  1160. min-width: 60px;
  1161. text-align: center;
  1162. display: inline-block;
  1163. box-sizing: border-box;
  1164. display: flex;
  1165. align-items: center;
  1166. }
  1167. .class-value2 {
  1168. cursor: pointer;
  1169. background: #fff;
  1170. }
  1171. .class-value > svg{
  1172. width: 13px;
  1173. height: 13px;
  1174. margin-left: 8px;
  1175. }
  1176. .pec_content {
  1177. width: 100%;
  1178. height: calc(100% - 60px);
  1179. border-radius: 0 0 12px 12px;
  1180. background-color: #fff;
  1181. }
  1182. .free-browse-switch {
  1183. display: flex;
  1184. align-items: center;
  1185. padding: 9px 10px;
  1186. background: #FFF7F5;
  1187. border-radius: 26px;
  1188. margin-left: 15px;
  1189. gap: 5px;
  1190. }
  1191. .switch-label {
  1192. /* background: linear-gradient(to right, #F53F3F, #FCCF00); */
  1193. /* -webkit-background-clip: text; */
  1194. color: #000;
  1195. }
  1196. .refresh_icon {
  1197. width: 35px;
  1198. height: 35px;
  1199. display: flex;
  1200. align-items: center;
  1201. justify-content: center;
  1202. background-color: #fff7f5;
  1203. border-radius: 45%;
  1204. cursor: pointer;
  1205. margin-right: 15px;
  1206. padding: 0 3px;
  1207. }
  1208. .refresh_icon img {
  1209. width: 16px;
  1210. height: 16px;
  1211. }
  1212. .name_box {
  1213. background: unset !important;
  1214. border: none !important;
  1215. cursor: unset !important;
  1216. }
  1217. .observe-dialog>>>.el-dialog__header {
  1218. padding: 0;
  1219. }
  1220. .observe-dialog>>>.el-dialog__body {
  1221. padding: 0;
  1222. }
  1223. .observe-dialog>>>.el-dialog__headerbtn {
  1224. top: 22px;
  1225. right: 20px;
  1226. z-index: 100;
  1227. }
  1228. </style>