batchCreationClassDialog.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. <template>
  2. <div class="batchCreationClassDialog">
  3. <el-dialog
  4. :visible.sync="show"
  5. width="100%"
  6. height="100%"
  7. fullscreen
  8. :modal="false"
  9. :close-on-click-modal="true"
  10. :show-close="false"
  11. >
  12. <div class="box">
  13. <div class="b_back">
  14. <div class="b_b_left" @click="close()">
  15. <img src="../../../../assets/icon/classroomObservation/right.svg" />
  16. <span>返回</span>
  17. </div>
  18. <div class="b_b_right">
  19. <el-button type="primary" size="small" @click="uploadFile"
  20. >上传文件</el-button
  21. >
  22. </div>
  23. </div>
  24. <div class="b_head">
  25. <span>已上传的课堂实录</span>
  26. </div>
  27. <div class="b_nav">
  28. <div class="b_n_left">
  29. <span
  30. :class="{ b_n_l_active: selectStatus == item.value }"
  31. v-for="item in statusList"
  32. :key="item.value"
  33. @click="changeStatus(item.value)"
  34. >{{ item.label }}</span
  35. >
  36. </div>
  37. <div class="b_n_right">
  38. <span>总计3个</span>
  39. </div>
  40. </div>
  41. <div class="b_bottom">
  42. <div class="b_b_operation">
  43. <div class="b_b_o_left">
  44. <span>当前进度 10/12</span>
  45. </div>
  46. <div class="b_b_o_right">
  47. <div><el-checkbox v-model="selectAll">全选</el-checkbox></div>
  48. <span>
  49. <img
  50. src="../../../../assets/icon/classroomObservation/del2.svg"
  51. />
  52. </span>
  53. </div>
  54. </div>
  55. <div class="b_b_list">
  56. <batchClassCard v-for="item in 10" :key="item" />
  57. </div>
  58. </div>
  59. </div>
  60. <uploadFileToCreateClassDialog
  61. ref="uploadFileToCreateClassDialogRef"
  62. @success="uploadFileSuccess"
  63. />
  64. </el-dialog>
  65. </div>
  66. </template>
  67. <script>
  68. import batchClassCard from "../newComponents/batchClassCard.vue";
  69. import uploadFileToCreateClassDialog from "./uploadFileToCreateClassDialog.vue";
  70. import { v4 as uuidv4 } from "uuid";
  71. export default {
  72. components: {
  73. batchClassCard,
  74. uploadFileToCreateClassDialog
  75. },
  76. data() {
  77. return {
  78. statusList: [
  79. { label: "全部", value: "0" },
  80. { label: "已完成", value: "1" },
  81. { label: "处理中", value: "2" },
  82. { label: "等待处理", value: "3" }
  83. ],
  84. userId: this.$route.query["userid"],
  85. selectStatus: "0",
  86. show: false,
  87. selectAll: false,
  88. dataList: [
  89. {
  90. id: "1",
  91. name: "文件名称文件名称文件名称",
  92. create_at: "2025-05-07 16.05.03",
  93. remarks: "备注1",
  94. jsonData: {
  95. baseMessage: {
  96. courseName: "",
  97. teacherName: "",
  98. time: "",
  99. grade: "",
  100. subject: "",
  101. textbook: "",
  102. studentNum: 0,
  103. imageList: {
  104. fileList1: [],
  105. fileList2: [],
  106. fileList3: [],
  107. NephogramList: [],
  108. videoList: []
  109. }
  110. },
  111. tagList: [
  112. { value: 0, name: "通用课堂分析", loading: false },
  113. { value: 1, name: "学科课堂分析", loading: false },
  114. { value: 2, name: "扩展分析", loading: false }
  115. ],
  116. steps: [
  117. {
  118. type: "uploadFile",
  119. text: "上传文件",
  120. status: "0",
  121. progress: "0"
  122. },
  123. {
  124. type: "transcription",
  125. text: "文本转录",
  126. status: "0",
  127. progress: "0"
  128. },
  129. {
  130. type: "automaticCoding",
  131. text: "自动编码",
  132. status: "0",
  133. progress: "0"
  134. },
  135. {
  136. type: "generateReport",
  137. text: "生成报告",
  138. status: "0",
  139. progress: "0"
  140. }
  141. ],
  142. analysisList:[],
  143. fileData:{
  144. name: "文件名称",
  145. url: "",
  146. type: "text/plain",
  147. size: "10kb"
  148. },
  149. automaticCoding:false,
  150. }
  151. }
  152. ]
  153. };
  154. },
  155. methods: {
  156. open() {
  157. this.show = true;
  158. },
  159. close() {
  160. this.show = false;
  161. },
  162. init() {},
  163. changeStatus(newValue) {
  164. this.selectStatus = newValue;
  165. },
  166. uploadFile() {
  167. this.$refs.uploadFileToCreateClassDialogRef.open();
  168. },
  169. async uploadFileSuccess(data) {
  170. this.$refs.uploadFileToCreateClassDialogRef.close();
  171. console.log("上传文件成功", data);
  172. let { fileList, automaticCoding, analysisTemplate } = data;
  173. this.loading = true;
  174. let fileDataList = fileList.map(i => i.successData);
  175. let _tempData = await this.getTemplateData(analysisTemplate[1]);
  176. let _analysisList = JSON.parse(_tempData.tips);
  177. let tagList = _analysisList.find(i => i.isOtherData);
  178. if (!tagList) {
  179. tagList = [
  180. { value: 0, name: "通用课堂分析", loading: false },
  181. { value: 1, name: "学科课堂分析", loading: false },
  182. { value: 2, name: "扩展分析", loading: false }
  183. ];
  184. }
  185. let batch = uuidv4();
  186. _analysisList = _analysisList.fileList(i=>(!i.isOtherData && i.jsonData.name!="词频词汇分析"));
  187. fileDataList.forEach(i=>{
  188. let data = {
  189. id: "1",
  190. name: i.name,
  191. create_at: "2025-05-07 16.05.03",
  192. remarks: "备注",
  193. batch:batch,
  194. jsonData: {
  195. file_ids:"",
  196. baseMessage: {
  197. courseName: i.name,
  198. teacherName: "",
  199. time: "",
  200. grade: "",
  201. subject: "",
  202. textbook: "",
  203. studentNum: 0,
  204. imageList: {
  205. fileList:[],
  206. fileList1: [],
  207. fileList2: [],
  208. fileList3: [],
  209. NephogramList: [],
  210. videoList: []
  211. }
  212. },
  213. tagList: tagList,
  214. steps: [],
  215. analysisList:_analysisList,
  216. fileData:i,
  217. automaticCoding:automaticCoding,
  218. }
  219. }
  220. if(i.type == "text/plain"){
  221. data.jsonData.steps= [
  222. {
  223. type: "uploadFile",
  224. text: "上传文件",
  225. status: "1",
  226. },
  227. {
  228. type: "transcription",
  229. text: "文本转录",
  230. status: "0",
  231. progress: "0"
  232. },
  233. {
  234. type: "getFileIds",
  235. text: "获取文件fileid",
  236. status: "0",
  237. },
  238. {
  239. type: "generateReport",
  240. text: "生成报告",
  241. status: "0",
  242. progress: "0"
  243. }
  244. ]
  245. }else if(i.type == "audio/wav"){
  246. data.jsonData.baseMessage.imageList.fileList = [{
  247. name: i.name,
  248. status: "success",
  249. url: i.url,
  250. uid:"1"
  251. }]
  252. data.jsonData.steps= [
  253. {
  254. type: "uploadFile",
  255. text: "上传文件",
  256. status: "1",
  257. },
  258. {
  259. type: "transcription",
  260. text: "文本转录",
  261. status: "0",
  262. progress: "0"
  263. },
  264. {
  265. type: "automaticCoding",
  266. text: "自动编码",
  267. status: "0",
  268. progress: "0"
  269. },
  270. {
  271. type: "getFileIds",
  272. text: "获取文件fileid",
  273. status: "0",
  274. },
  275. {
  276. type: "generateReport",
  277. text: "生成报告",
  278. status: "0",
  279. progress: "0"
  280. }
  281. ]
  282. }else if(i.type == "video/mp4"){
  283. data.jsonData.baseMessage.imageList.videoList = [{
  284. name: i.name,
  285. status: "success",
  286. url: i.url,
  287. uid:"1"
  288. }]
  289. data.jsonData.steps= [{
  290. type: "uploadFile",
  291. text: "上传文件",
  292. status: "1",
  293. },
  294. {
  295. type:"getVideoVoice",
  296. text:"视频提取音频",
  297. status:"0",
  298. progress: "0"
  299. },
  300. {
  301. type: "transcription",
  302. text: "文本转录",
  303. status: "0",
  304. progress: "0"
  305. },
  306. {
  307. type: "automaticCoding",
  308. text: "自动编码",
  309. status: "0",
  310. progress: "0"
  311. },
  312. {
  313. type: "getFileIds",
  314. text: "获取文件fileid",
  315. status: "0",
  316. },
  317. {
  318. type: "generateReport",
  319. text: "生成报告",
  320. status: "0",
  321. progress: "0"
  322. }]
  323. }
  324. })
  325. },
  326. getTemplateData(tid) {
  327. return new Promise(resolve => {
  328. let params = {
  329. uid: this.userId,
  330. cid: tid,
  331. st: 0
  332. };
  333. this.ajax
  334. .get(this.$store.state.api + "selectClassroomTemplateDetail", params)
  335. .then(res => {
  336. let _data = res.data[0][0];
  337. resolve(_data);
  338. });
  339. });
  340. }
  341. },
  342. mounted() {}
  343. };
  344. </script>
  345. <style scoped>
  346. .batchCreationClassDialog {
  347. width: 100vw;
  348. height: 100vh;
  349. }
  350. .batchCreationClassDialog >>> .el-dialog__header,
  351. .batchCreationClassDialog >>> .el-dialog__footer {
  352. display: none; /* 隐藏头部和底部 */
  353. }
  354. .batchCreationClassDialog >>> .el-dialog__body {
  355. padding: 0;
  356. margin: 0;
  357. height: 100vh;
  358. width: 100vw;
  359. overflow: auto;
  360. display: flex;
  361. justify-content: center;
  362. }
  363. .box {
  364. width: 70%;
  365. min-width: 500px;
  366. height: fit-content;
  367. box-sizing: border-box;
  368. border-left: solid 1px #e1e1e1;
  369. border-right: solid 1px #e1e1e1;
  370. padding: 0 40px;
  371. }
  372. .b_back {
  373. height: 50px;
  374. width: 100%;
  375. display: flex;
  376. align-items: center;
  377. justify-content: space-between;
  378. margin-top: 20px;
  379. }
  380. .b_b_left {
  381. display: flex;
  382. align-items: center;
  383. cursor: pointer;
  384. }
  385. .b_b_left > img {
  386. width: 30px;
  387. height: 30px;
  388. transform: rotate(180deg);
  389. }
  390. .b_b_left > span {
  391. font-size: 20px;
  392. font-weight: bold;
  393. margin-left: 5px;
  394. }
  395. .b_head {
  396. width: 100%;
  397. height: 50px;
  398. margin: 20px 0 10px 0;
  399. box-sizing: border-box;
  400. }
  401. .b_head > span {
  402. font-size: 26px;
  403. font-weight: bold;
  404. color: #000;
  405. }
  406. .b_nav {
  407. width: 100%;
  408. height: 50px;
  409. display: flex;
  410. align-items: center;
  411. justify-content: space-between;
  412. box-sizing: border-box;
  413. border-bottom: solid 1px rgba(150, 155, 163, 1);
  414. }
  415. .b_n_left {
  416. width: calc(100% - 60px);
  417. height: 100%;
  418. display: flex;
  419. align-items: center;
  420. }
  421. .b_n_left > span {
  422. height: 100%;
  423. padding: 0 20px;
  424. display: flex;
  425. align-items: center;
  426. justify-content: center;
  427. position: relative;
  428. cursor: pointer;
  429. transition: 0.3s;
  430. font-size: 16px;
  431. }
  432. .b_n_left > span:hover {
  433. color: rgba(5, 96, 253, 1);
  434. }
  435. .b_n_left > .b_n_l_active {
  436. color: rgba(5, 96, 253, 1);
  437. }
  438. .b_n_left > .b_n_l_active::after {
  439. content: "";
  440. position: absolute;
  441. width: 70%;
  442. height: 4px;
  443. border-radius: 4px;
  444. bottom: -1px;
  445. left: 50%;
  446. transform: translateX(-50%);
  447. background-color: rgba(5, 96, 253, 1);
  448. }
  449. .b_n_right {
  450. width: 60px;
  451. height: 100%;
  452. display: flex;
  453. align-items: center;
  454. justify-content: flex-end;
  455. color: rgba(150, 155, 163, 1);
  456. font-size: 16px;
  457. }
  458. .b_bottom {
  459. width: 100%;
  460. height: auto;
  461. /* height: calc(100% - 200px); */
  462. }
  463. .b_b_operation {
  464. width: 100%;
  465. height: 40px;
  466. display: flex;
  467. align-items: center;
  468. justify-content: space-between;
  469. margin-top: 10px;
  470. }
  471. .b_b_o_left {
  472. width: calc(100% - 100px);
  473. height: 100%;
  474. display: flex;
  475. align-items: center;
  476. font-size: 16px;
  477. }
  478. .b_b_o_right {
  479. width: 100px;
  480. height: 100%;
  481. display: flex;
  482. align-items: center;
  483. justify-content: space-between;
  484. }
  485. .b_b_o_right > div {
  486. margin-right: 10px;
  487. font-size: 16px;
  488. }
  489. .b_b_o_right > div >>> .el-checkbox {
  490. display: flex;
  491. align-items: center;
  492. }
  493. .b_b_o_right > span {
  494. width: 20px;
  495. height: 20px;
  496. cursor: pointer;
  497. }
  498. .b_b_o_right > span > img {
  499. width: 100%;
  500. height: 100%;
  501. }
  502. .b_b_list {
  503. width: 100%;
  504. height: auto;
  505. padding-bottom: 40px;
  506. }
  507. </style>