courseDetail.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461
  1. <template>
  2. <div class="pb_content">
  3. <div class="pb_content_body" style="height: 100%">
  4. <div class="body_student">
  5. <div class="student_head">
  6. <!-- <div v-if="tType != 4" class="return" @click.stop="
  7. goTo(
  8. '/index?userid=' +
  9. userid +
  10. '&oid=' +
  11. oid +
  12. '&org=' +
  13. org +
  14. '&cid=' +
  15. classId +
  16. '&tType=' +
  17. tType +
  18. '&screenType=' +
  19. screenType
  20. )
  21. ">
  22. 返回
  23. </div> -->
  24. <div class="box_course">
  25. <div class="wheel">
  26. <img style="object-fit: cover" :src="
  27. this.courseDetail.cover != null &&
  28. this.courseDetail.cover != ''
  29. ? JSON.parse(this.courseDetail.cover).length > 0
  30. ? JSON.parse(this.courseDetail.cover)[0].url
  31. : mr
  32. : mr
  33. " alt />
  34. </div>
  35. <div class="right_box">
  36. <div class="rightT">
  37. <div class="right_box_title">{{ courseDetail.title }}</div>
  38. <div class="jd">{{ chapInfo.length }}阶段</div>
  39. <div class="jd">{{ rw }}任务</div>
  40. </div>
  41. <div class="cType">
  42. <div class="all_choose" v-for="(item, index) in courseType" :key="index">
  43. <span style="color: #6c6c6c">{{ item + ":" }}</span>
  44. <span class="type_children" v-for="(item2, index2) in courseTypeJson[item]" :key="index2">{{ item2
  45. }}</span>
  46. </div>
  47. </div>
  48. <div class="cType" style="font-size: 18px; color: #6c6c6c">
  49. <div style="min-width:150px">
  50. 创建者:<span style="color: #000">{{
  51. courseDetail.username
  52. }}</span>
  53. </div>
  54. <div class="Tname" v-if="Tname.length > 0">
  55. 协同人员:<span v-for="(tname, tIndex) in Tname" :key="tIndex" style="margin: 0 5px; color: #000">{{ tname
  56. }}</span>
  57. </div>
  58. </div>
  59. <div class="cType" style="font-size: 18px; color: #6c6c6c">
  60. <!-- <div style="display:flex; align-items: center;">
  61. <div>参与人数:</div>
  62. <div class="man">
  63. <img src="../../assets/people.png" alt />
  64. </div>
  65. <div class="person" style=" color: #000">
  66. {{ courseDetail.vcount != null ? courseDetail.vcount : 0 }}人
  67. </div>
  68. </div>
  69. <div class="Tname" v-if="courseDetail.classname">
  70. 授课班级:<span style="margin: 0 5px; color: #000">{{ courseDetail.classname
  71. }}</span>
  72. </div> -->
  73. </div>
  74. <!-- <div class="now_study" @click="dialogVisible = true">
  75. 立即学习
  76. </div> -->
  77. </div>
  78. </div>
  79. </div>
  80. <div class="student_body">
  81. <div class="sLeft" v-if="courseDetail.brief">
  82. <div class="courseT">项目详情</div>
  83. <div class="courseTd">{{ courseDetail.brief }}</div>
  84. </div>
  85. <div :class="courseDetail.brief != '' ? 'rightTd' : 'noBRight'">
  86. <!-- <div v-if="(tType == 1 || tType == 4)" class="checkBox">
  87. <span :class="{ active: type == 1 }" @click="type = 1">课程分析</span>
  88. <span :class="{ active: type == 2 }" @click="type = 2">阶段选择</span>
  89. </div> -->
  90. <!-- v-if="((tType == 1 || tType == 4) && type == 2) || tType == 2" -->
  91. <div :class="courseDetail.brief != '' ? 'rightTd' : 'noBRight'">
  92. <div class="blue_box_one" v-for="(item, index) in chapInfo" :key="index" @click="addUserRate(index)">
  93. <div>第{{ index + 1 }}阶段</div>
  94. <div :title="item.dyName">{{ item.dyName }}</div>
  95. <div>{{ item.chapterInfo[0].taskJson.length }}个任务</div>
  96. </div>
  97. </div>
  98. <!-- <div v-if="(tType == 1 || tType == 4) && Object.keys(chaptersJson).length && type == 1" class="detail">
  99. <div class="detail_box">
  100. <div class="title"><span class="toolIcon">工具分析</span>
  101. <div class="statebox">
  102. <div><span class="taskIcon">全部阶段:</span><span>{{ chaptersJson.state.stage }}</span></div>
  103. <div><span class="finishIcon">已进行:</span><span>{{ chaptersJson.state.finish }}</span></div>
  104. <div><span class="learningIcon">未进行:</span><span>{{ chaptersJson.state.learing }}</span></div>
  105. </div>
  106. </div>
  107. <div class="box" v-if="chaptersJson.tool.length">
  108. <div class="progress">
  109. <div v-for="(item, index) in chaptersJson.tool" :key="index" class="chapter">
  110. <div class="stage">第{{ index + 1 }}阶段</div>
  111. <div class="task">
  112. <div v-for="(item2, index2) in item" :key="index + '-' + index2" class="taskBox">
  113. <div class="taskName">任务{{ index2 + 1 }}</div>
  114. <div class="p_tool_box">
  115. <span v-for="(item3, index3) in item2" :key="index + '-' + index2 + '-' + index3"
  116. class="p_tool">
  117. <div v-if="item3.tool == 1">
  118. <img src="../../assets/icon/secondToolList/whiteBoard.png" alt />
  119. <div>电子白板</div>
  120. </div>
  121. <div v-if="item3.tool == 3">
  122. <img src="../../assets/icon/secondToolList/mindMapping.png" alt />
  123. <div>思维导图</div>
  124. </div>
  125. <div v-if="item3.tool == 6">
  126. <img src="../../assets/icon/secondToolList/doc.png" alt />
  127. <div>协同文档</div>
  128. </div>
  129. <div v-if="item3.tool == 7">
  130. <img src="../../assets/icon/secondToolList/mindNetwork.png" alt />
  131. <div>思维网格</div>
  132. </div>
  133. <div v-if="item3.tool == 8">
  134. <img src="../../assets/icon/secondToolList/library.png" alt />
  135. <div>素材库</div>
  136. </div>
  137. <div v-if="item3.tool == 17">
  138. <img src="../../assets/icon/secondToolList/library.png" alt />
  139. <div>学习资料</div>
  140. </div>
  141. <div v-if="item3.tool == 2">
  142. <img src="../../assets/icon/secondToolList/note.png" alt />
  143. <div>便签</div>
  144. </div>
  145. <div v-if="item3.tool == 4">
  146. <img src="../../assets/icon/thirdToolList/ask.png" alt />
  147. <div>问卷调查</div>
  148. </div>
  149. <div v-if="item3.tool == 45">
  150. <img src="../../assets/icon/thirdToolList/choose.png" alt />
  151. <div>选择题</div>
  152. </div>
  153. <div v-if="item3.tool == 10">
  154. <img src="../../assets/icon/thirdToolList/time.png" alt />
  155. <div>倒计时</div>
  156. </div>
  157. <div v-if="item3.tool == 15">
  158. <img src="../../assets/icon/thirdToolList/answer.png" alt />
  159. <div>问答工具</div>
  160. </div>
  161. <div v-if="item3.tool == 26">
  162. <img src="../../assets/icon/thirdToolList/courseDesign.png" alt />
  163. <div>课程设计</div>
  164. </div>
  165. <div v-if="item3.tool == 18">
  166. <img src="../../assets/icon/thirdToolList/trainPlatform.png" alt />
  167. <div>训练服务器</div>
  168. </div>
  169. <div v-if="item3.tool == 16">
  170. <img src="../../assets/icon/thirdToolList/work.png" alt />
  171. <div>作业提交</div>
  172. </div>
  173. <div v-if="item3.tool == 21">
  174. <img src="../../assets/icon/fourthToolList/program.png" alt />
  175. <div>编程平台</div>
  176. </div>
  177. <div v-if="item3.tool == 22">
  178. <img src="../../assets/icon/fourthToolList/program.png" alt />
  179. <div>AI体验</div>
  180. </div>
  181. <div v-if="item3.tool == 23">
  182. <img src="../../assets/icon/fourthToolList/program.png" alt />
  183. <div>Python</div>
  184. </div>
  185. <div v-if="item3.tool == 24">
  186. <img src="../../assets/icon/fourthToolList/AIprogram.png" alt />
  187. <div>AI平台</div>
  188. </div>
  189. <div v-if="item3.tool == 25">
  190. <img src="../../assets/icon/thirdToolList/evalua.png" alt />
  191. <div>目标管理</div>
  192. </div>
  193. <div v-if="item3.tool == 31">
  194. <img src="../../assets/icon/secondToolList/networkPanel.png" alt />
  195. <div>数学画板</div>
  196. </div>
  197. <div v-if="item3.tool == 28">
  198. <img src="../../assets/icon/secondToolList/translation.png" alt />
  199. <div>翻译</div>
  200. </div>
  201. <div v-if="item3.tool == 37">
  202. <img src="../../assets/icon/secondToolList/mohe.png" alt />
  203. <div>魔盒识字</div>
  204. </div>
  205. <div v-if="item3.tool == 38">
  206. <img src="../../assets/icon/secondToolList/24game.png" alt />
  207. <div>24点</div>
  208. </div>
  209. <div v-if="item3.tool == 39">
  210. <img src="../../assets/icon/secondToolList/GeoGebra.png" alt />
  211. <div>GeoGebra</div>
  212. </div>
  213. <div v-if="item3.tool == 32">
  214. <img src="../../assets/icon/thirdToolList/code.png" alt />
  215. <div>源码编辑</div>
  216. </div>
  217. <div v-if="item3.tool == 40">
  218. <img src="../../assets/icon/secondToolList/eval.png" alt />
  219. <div>学生评价</div>
  220. </div>
  221. <div v-if="item3.tool == 41">
  222. <img src="../../assets/icon/thirdToolList/select.png" alt />
  223. <div>选择填空</div>
  224. </div>
  225. <div v-if="item3.tool == 44">
  226. <img src="../../assets/icon/thirdToolList/hanClass.png" alt />
  227. <div>汉字宫</div>
  228. </div>
  229. <div v-if="item3.tool == 47">
  230. <img src="../../assets/icon/fourthToolList/conSentences.png" alt />
  231. <div>连词成句</div>
  232. </div>
  233. <div v-if="(item3.tool == 48)">
  234. <img src="../../assets/icon/fourthToolList/conSentences.png" alt />
  235. <div>表格</div>
  236. </div>
  237. <div v-if="(item3.tool == 49)">
  238. <img src="../../assets/icon/fourthToolList/group.png" alt />
  239. <div>学生分组</div>
  240. </div>
  241. <div v-if="(item3.tool == undefined)">
  242. <img src="../../assets/icon/empytool.png" alt style="width: 64px;height: 75px;" />
  243. </div>
  244. </span>
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. </div>
  252. <div class="detail_box" v-if="Object.keys(chaptersJson.time).length">
  253. <div class="title"><span class="frequencyIcon">作业频率</span></div>
  254. <div class="box">
  255. <div>
  256. <Heatmap :Josn="chaptersJson.time" :num="chaptersJson.studentCount"></Heatmap>
  257. </div>
  258. </div>
  259. </div>
  260. <div class="detail_box">
  261. <div class="title"><span class="timeIcon">实施时间</span></div>
  262. <div class="box">
  263. <div style="font-size: 22px;margin: 15px 0 45px;">{{ courseDetail.title }}</div>
  264. <div class="chapter_time_box">
  265. <div v-for="(item, index) in chaptersJson.work" :key="index" class="c_box">
  266. <div class="stage_box">
  267. <div class="yuan"></div>
  268. <div class="stage">第{{ index + 1 }}阶段 {{ item.name }}</div>
  269. <div class="s_up" :class="{ s_up2: !item.is }" @click="item.is = !item.is"><img
  270. src="../../assets/icon/up.png" alt=""></div>
  271. </div>
  272. <div v-show="item.is">
  273. <div v-for="(item2, index2) in item.chapter" :key="index + '-' + index2">
  274. <div style="color:#737373">任务{{ index2 + 1 }}:{{ item2.name }}</div>
  275. <div class="p_tool_box2">
  276. <span v-for="(item3, index3) in item2.task" :key="index + '-' + index2 + '-' + index3"
  277. class="p_tool2">
  278. <div class="toolBigBox">
  279. <div class="toolbox">
  280. <div>工具{{ index3 + 1 }}:</div>
  281. <div v-if="item3.tool == 1">
  282. 电子白板
  283. </div>
  284. <div v-if="item3.tool == 3">
  285. 思维导图
  286. </div>
  287. <div v-if="item3.tool == 6">
  288. 协同文档
  289. </div>
  290. <div v-if="item3.tool == 7">
  291. 思维网格
  292. </div>
  293. <div v-if="item3.tool == 8">
  294. 素材库
  295. </div>
  296. <div v-if="item3.tool == 17">
  297. 学习资料
  298. </div>
  299. <div v-if="item3.tool == 2">
  300. 便签
  301. </div>
  302. <div v-if="item3.tool == 4">
  303. 问卷调查
  304. </div>
  305. <div v-if="item3.tool == 45">
  306. 选择题
  307. </div>
  308. <div v-if="item3.tool == 10">
  309. 倒计时
  310. </div>
  311. <div v-if="item3.tool == 15">
  312. 问答工具
  313. </div>
  314. <div v-if="item3.tool == 26">
  315. 课程设计
  316. </div>
  317. <div v-if="item3.tool == 18">
  318. 训练服务器
  319. </div>
  320. <div v-if="item3.tool == 16">
  321. 作业提交
  322. </div>
  323. <div v-if="item3.tool == 21">
  324. 编程平台
  325. </div>
  326. <div v-if="item3.tool == 22">
  327. AI体验
  328. </div>
  329. <div v-if="item3.tool == 23">
  330. Python
  331. </div>
  332. <div v-if="item3.tool == 24">
  333. AI平台
  334. </div>
  335. <div v-if="item3.tool == 25">
  336. 目标管理
  337. </div>
  338. <div v-if="item3.tool == 31">
  339. 数学画板
  340. </div>
  341. <div v-if="item3.tool == 28">
  342. 翻译
  343. </div>
  344. <div v-if="item3.tool == 37">
  345. 魔盒识字
  346. </div>
  347. <div v-if="item3.tool == 38">
  348. 24点
  349. </div>
  350. <div v-if="item3.tool == 39">
  351. GeoGebra
  352. </div>
  353. <div v-if="item3.tool == 32">
  354. 源码编辑
  355. </div>
  356. <div v-if="item3.tool == 40">
  357. 学生评价
  358. </div>
  359. <div v-if="item3.tool == 41">
  360. 选择填空
  361. </div>
  362. <div v-if="item3.tool == 44">
  363. 汉字宫
  364. </div>
  365. <div v-if="item3.tool == 47">
  366. 连词成句
  367. </div>
  368. <div v-if="(item3.tool == 48)">
  369. 表格
  370. </div>
  371. <div v-if="(item3.tool == 49)">
  372. 学生分组
  373. </div>
  374. </div>
  375. <div class="toolSta" v-if="item3.works.length">
  376. <div>
  377. <div>任务实施情况:</div>
  378. <div>
  379. <div>作业数量:{{ item3.works.length }}</div>
  380. <div v-if="chaptersJson.studentCount">任务完成率:{{ ((item3.works.length /
  381. chaptersJson.studentCount) * 100).toFixed(2) + '%'
  382. }} </div>
  383. <div>
  384. <div>点赞:{{ item3.likeCount }}</div>
  385. <div>评论:{{ item3.commentCount }}</div>
  386. </div>
  387. </div>
  388. </div>
  389. <div v-if="item3.isScore">
  390. <div>任务效果:</div>
  391. <div>
  392. <div>作业评价量:{{ item3.isScore }}</div>
  393. <div>评价平均分:{{ (item3.score / item3.isScore).toFixed(2)
  394. }}分</div>
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. </span>
  400. </div>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div> -->
  408. </div>
  409. </div>
  410. <el-dialog title="阶段选择" :visible.sync="dialogVisible" :append-to-body="true" width="700px"
  411. :before-close="handleClose" class="dialog_change">
  412. <div style="font-size: 20px">请选择阶段</div>
  413. <div style="
  414. padding: 20px 30px;
  415. display: flex;
  416. flex-direction: row;
  417. flex-wrap: wrap;
  418. ">
  419. <div class="blue_box" v-for="(item, index) in chapInfo" :key="index" @click="addUserRate(index)">
  420. <div>第{{ index + 1 }}阶段</div>
  421. <div>{{ item.dyName }}</div>
  422. <div>{{ item.chapterInfo[0].taskJson.length }}个任务</div>
  423. </div>
  424. </div>
  425. </el-dialog>
  426. </div>
  427. </div>
  428. </div>
  429. </template>
  430. <script>
  431. import Heatmap from '../tools/heatmap.vue'
  432. export default {
  433. components: {
  434. Heatmap,
  435. },
  436. data() {
  437. return {
  438. choose: 0,
  439. dialogVisible: false,
  440. id: this.$route.query.courseId,
  441. userid: this.$route.query.userid,
  442. oid: this.$route.query.oid,
  443. org: this.$route.query.org,
  444. classId: this.$route.query.cid,
  445. tType: this.$route.query.tType,
  446. screenType: this.$route.query.screenType,
  447. courseDetail: {},
  448. aStudentName: [],
  449. chapInfo: [],
  450. courseType: [],
  451. Tname: [],
  452. courseTypeJson: {},
  453. userinfo: [],
  454. mr: require("../../assets/icon/wheel.png"),
  455. rw: 0,
  456. chaptersJson: {},
  457. type: 1,
  458. };
  459. },
  460. methods: {
  461. handleClose(done) {
  462. done();
  463. },
  464. goTo(path) {
  465. this.$router.push(path);
  466. },
  467. addUserRate(i) {
  468. // var suid = this.userid;
  469. // if (
  470. // JSON.parse(this.courseDetail.course_student).indexOf(suid) == -1 &&
  471. // JSON.parse(this.courseDetail.userid) != suid
  472. // ) {
  473. // this.$message.error("你没有该权限");
  474. // return;
  475. // }
  476. // var a =
  477. // this.courseDetail.course_student != ""
  478. // ? JSON.parse(this.courseDetail.course_student)
  479. // : "";
  480. // if (this.courseDetail.userid != suid) {
  481. // if (this.userinfo.type == 2) {
  482. // if (a != "") {
  483. // if (
  484. // JSON.parse(this.courseDetail.course_student).indexOf(suid) == -1
  485. // ) {
  486. // this.$message.error("你没有该权限");
  487. // return;
  488. // }
  489. // } else {
  490. // this.$message.error("暂无项目学员,请联系老师添加项目学员!");
  491. // return;
  492. // }
  493. // }
  494. // }
  495. // let params = {
  496. // uid: this.userid,
  497. // cid: this.id,
  498. // };
  499. // this.ajax
  500. // .get(this.$store.state.api + "addUserR", params)
  501. // .then((res) => {
  502. // console.log(res.data);
  503. // this.updateVc();
  504. this.goTo(
  505. "/studyStudentS?type=" +
  506. i +
  507. "&courseId=" +
  508. this.id +
  509. "&userid=" +
  510. this.userid +
  511. "&oid=" +
  512. this.oid +
  513. "&org=" +
  514. this.org +
  515. "&cid=" +
  516. this.classId +
  517. "&tType=" +
  518. this.tType +
  519. "&screenType=" +
  520. this.screenType
  521. );
  522. // })
  523. // .catch((err) => {
  524. // console.error(err);
  525. // });
  526. },
  527. updateVc() {
  528. let params = {
  529. cid: this.id,
  530. };
  531. this.ajax
  532. .get(this.$store.state.api + "updateVc", params)
  533. .then((res) => {
  534. console.log(res.data);
  535. })
  536. .catch((err) => {
  537. console.error(err);
  538. });
  539. },
  540. getCourseDetail() {
  541. const loading = this.$loading.service({
  542. background: "rgba(255, 255, 255, 0.7)",
  543. target: document.querySelector(".student_table"),
  544. });
  545. let params = {
  546. courseId: this.id,
  547. };
  548. this.ajax
  549. .get(this.$store.state.api + "selectStudentCourseDetail", params)
  550. .then((res) => {
  551. loading.close();
  552. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  553. this.courseDetail = res.data[0][0];
  554. var a = res.data[0];
  555. var b = res.data[1];
  556. var c = res.data[2];
  557. for (var i = 0; i < b.length; i++) {
  558. // if (!this.id) {
  559. // this.courseType[b[i].id] = [];
  560. // }
  561. for (var j = 0; j < a.length; j++) {
  562. if (b[i].id == a[j].pid) {
  563. if (!this.courseTypeJson[b[i].name]) {
  564. this.courseType.push(b[i].name);
  565. this.courseTypeJson[b[i].name] = [];
  566. }
  567. this.courseTypeJson[b[i].name].push(a[j].name);
  568. }
  569. }
  570. }
  571. for (var k = 0; k < c.length; k++) {
  572. this.Tname.push(c[k].name);
  573. }
  574. console.log(this.courseTypeJson.length);
  575. this.aStudentName = res.data[2];
  576. this.chapInfo = JSON.parse(this.courseDetail.chapters);
  577. for (var z = 0; z < this.chapInfo.length; z++) {
  578. this.rw += this.chapInfo[z].chapterInfo[0].taskJson.length;
  579. }
  580. let _chapters = JSON.parse(a[0].chapters)
  581. let _works = res.data[3];
  582. let _sCont = res.data[4];
  583. let _comment = res.data[5];
  584. let _chaptersJson = {
  585. chapterState: _chapters,
  586. state: {
  587. stage: _chapters.length,
  588. finish: 0,
  589. learing: 0,
  590. },
  591. tool: [],
  592. chapter: [],
  593. time: {},
  594. startTime: _works.length ? _works[0].time : '',
  595. work: [],
  596. studentCount: _sCont[0].usercount
  597. }
  598. let timeAarry = []
  599. for (var j = 0; j < _works.length; j++) {
  600. timeAarry.push(_works[j].vtime)
  601. }
  602. timeAarry.forEach(item => {
  603. _chaptersJson.time[item] = (_chaptersJson.time[item] + 1) || 1
  604. })
  605. for (var i = 0; i < _chapters.length; i++) {
  606. _chaptersJson.chapterState[i].isFinsh = false;
  607. _chaptersJson.tool[i] = []
  608. _chaptersJson.chapter[i] = []
  609. _chaptersJson.work[i] = { name: _chapters[i].dyName, chapter: [] }
  610. for (var j = 0; j < _works.length; j++) {
  611. if (i == _works[j].stage) {
  612. _chaptersJson.chapterState[i].isFinsh = true;
  613. _chaptersJson.state.finish++
  614. break;
  615. }
  616. }
  617. let el = _chapters[i].chapterInfo[0].taskJson;
  618. for (var z = 0; z < el.length; z++) {
  619. _chaptersJson.tool[i][z] = []
  620. _chaptersJson.chapter[i][z] = []
  621. _chaptersJson.work[i].chapter[z] = { name: el[z].task, task: [] }
  622. _chaptersJson.work[i].is = false;
  623. let tools = el[z].toolChoose
  624. for (var k = 0; k < tools.length; k++) {
  625. _chaptersJson.work[i].chapter[z].task[k] = { tool: tools[k].tool[0], works: [], likeCount: 0, commentCount: 0, score: 0, isScore: 0 }
  626. for (var j = 0; j < _works.length; j++) {
  627. if (i == _works[j].stage && z == _works[j].task && k == _works[j].tool) {
  628. _chaptersJson.work[i].chapter[z].task[k].works.push(_works[j])
  629. if (_works[j].score) {
  630. _chaptersJson.work[i].chapter[z].task[k].score += JSON.parse(_works[j].score).wScore
  631. _chaptersJson.work[i].chapter[z].task[k].isScore++
  632. }
  633. }
  634. }
  635. for (var j = 0; j < _comment.length; j++) {
  636. if (i == _comment[j].stage && z == _comment[j].task && k == _comment[j].tool) {
  637. if (_comment[j].cType == 1) {
  638. _chaptersJson.work[i].chapter[z].task[k].likeCount++
  639. }
  640. if (_comment[j].cType == 2) {
  641. _chaptersJson.work[i].chapter[z].task[k].commentCount++
  642. }
  643. }
  644. }
  645. // if (_chaptersJson.chapter[i][z].indexOf(tools[k].tool[0]) == -1) {
  646. // _chaptersJson.tool[i][z].push(tools[k].tool[0])
  647. // }
  648. _chaptersJson.chapter[i][z][k] = { tool: tools[k].tool[0] }
  649. _chaptersJson.tool[i][z][k] = { tool: tools[k].tool[0] }
  650. }
  651. }
  652. }
  653. _chaptersJson.state.learing = _chaptersJson.state.stage - _chaptersJson.state.finish
  654. this.chaptersJson = _chaptersJson
  655. // debugger
  656. })
  657. .catch((err) => {
  658. loading.close();
  659. console.error(err);
  660. });
  661. },
  662. getUser() {
  663. let params = { uid: this.userid };
  664. this.ajax
  665. .get(this.$store.state.api + "getUser", params)
  666. .then((res) => {
  667. this.userinfo = res.data[0][0];
  668. })
  669. .catch((err) => {
  670. console.error(err);
  671. });
  672. },
  673. // getSName() {
  674. // let params = {
  675. // uid: JSON.stringify(this.courseDetail.course_student),
  676. // };
  677. // this.ajax
  678. // .get(this.$store.state.api + "selectSName", params)
  679. // .then((res) => {
  680. // this.aStudentName = res.data[0];
  681. // })
  682. // .catch((err) => {
  683. // console.error(err);
  684. // });
  685. // },
  686. },
  687. created() {
  688. this.getCourseDetail();
  689. this.getUser();
  690. document.scrollingElement.scrollTop = 0;
  691. // this.getSName();
  692. },
  693. };
  694. </script>
  695. <style scoped>
  696. @media screen and (max-width: 1024px) {
  697. .Tname {
  698. width: 500px;
  699. white-space: nowrap;
  700. overflow: hidden;
  701. text-overflow: ellipsis;
  702. }
  703. }
  704. .body_student {
  705. margin: 10px auto;
  706. width: 98%;
  707. height: 100%;
  708. }
  709. .student_head {
  710. width: 100%;
  711. background: #fff;
  712. height: 30%;
  713. position: relative;
  714. }
  715. .wheel {
  716. width: 250px;
  717. max-height: 146px;
  718. display: flex;
  719. align-items: center;
  720. }
  721. .man {
  722. width: 16px;
  723. height: 16px;
  724. }
  725. .wheel>img,
  726. .man>img {
  727. width: 100%;
  728. height: 100%;
  729. }
  730. .box_course {
  731. display: flex;
  732. padding: 25px 0 20px 60px;
  733. }
  734. .right_box {
  735. display: flex;
  736. flex-direction: column;
  737. margin-left: 30px;
  738. align-items: flex-start;
  739. width: calc(100% - 350px);
  740. }
  741. .right_box_title {
  742. font-size: 23px;
  743. max-width: calc(100% - 190px);
  744. white-space: nowrap;
  745. overflow: hidden;
  746. text-overflow: ellipsis;
  747. }
  748. .people {
  749. display: flex;
  750. margin-top: 20px;
  751. }
  752. .person {
  753. margin-left: 10px;
  754. /* line-height: 18px; */
  755. }
  756. .now_study {
  757. width: 150px;
  758. height: 35px;
  759. color: #fff;
  760. background: #4a9eed;
  761. text-align: center;
  762. line-height: 35px;
  763. border-radius: 5px;
  764. font-size: 13px;
  765. cursor: pointer;
  766. margin-top: 30px;
  767. }
  768. .choose_who {
  769. display: flex;
  770. margin: 15px 0 0 25px;
  771. }
  772. .who_choose {
  773. height: 28px;
  774. cursor: pointer;
  775. }
  776. .choose_who>div:nth-child(2) {
  777. margin-left: 35px;
  778. }
  779. .choose {
  780. border-bottom: 5px solid #4a9eed;
  781. color: #4a9eed;
  782. }
  783. .student_body {
  784. display: flex;
  785. }
  786. .student_body,
  787. .right {
  788. width: 100%;
  789. margin: 10px auto;
  790. min-height: 688px;
  791. }
  792. .nav {
  793. margin: auto 25px;
  794. width: 80%;
  795. padding-top: 5px;
  796. text-indent: 25px;
  797. }
  798. .pic {
  799. width: 100%;
  800. display: flex;
  801. flex-direction: row;
  802. flex-wrap: wrap;
  803. height: 100%;
  804. justify-content: space-evenly;
  805. }
  806. .Img {
  807. /*width: 30%; */
  808. width: 300px;
  809. margin: 20px 50px;
  810. margin: 20px 10px;
  811. border: 1px solid #dbdbdb;
  812. border-radius: 5px;
  813. overflow: hidden;
  814. }
  815. .Img>img {
  816. width: 100%;
  817. height: 100%;
  818. }
  819. .student_body_one,
  820. .right_one {
  821. width: 100%;
  822. margin: 0 auto;
  823. background: #fff;
  824. margin-top: 10px;
  825. min-height: 688px;
  826. }
  827. .student {
  828. width: 85%;
  829. display: flex;
  830. flex-direction: row;
  831. flex-wrap: wrap;
  832. justify-content: flex-start;
  833. margin: auto 10px;
  834. }
  835. .student>div {
  836. width: 12%;
  837. height: 35px;
  838. background: #e3759a;
  839. text-align: center;
  840. border: 1px solid #e3759a;
  841. border-radius: 5px;
  842. color: #fff;
  843. line-height: 35px;
  844. margin: 10px;
  845. }
  846. .dialog_change>>>.el-dialog {
  847. border-radius: 5px;
  848. }
  849. .dialog_change>>>.el-dialog__header {
  850. background: #303030;
  851. height: 36px;
  852. line-height: 36px;
  853. padding-left: 10px;
  854. padding: 0px 10px 0px;
  855. }
  856. .dialog_change>>>.el-dialog__headerbtn {
  857. top: 10px !important;
  858. right: 10px !important;
  859. }
  860. .dialog_change>>>.el-dialog__title {
  861. color: #fff;
  862. font-size: 14px;
  863. line-height: 5px;
  864. }
  865. .dialog_change>>>.el-dialog__body {
  866. background: #f5f5f5;
  867. }
  868. .blue_box {
  869. align-items: center;
  870. display: flex;
  871. flex-direction: column;
  872. justify-content: center;
  873. }
  874. .blue_box,
  875. .blue_box_one {
  876. width: 30%;
  877. height: 100px;
  878. text-align: center;
  879. color: #fff;
  880. background-image: linear-gradient(90deg, #477cd7, #65b9fc);
  881. border-radius: 15px;
  882. margin: 15px 0 15px 15px;
  883. cursor: pointer;
  884. }
  885. .blue_box_one {
  886. width: 200px;
  887. height: 200px;
  888. background-image: linear-gradient(90deg, #477cd7, #65b9fc);
  889. display: flex;
  890. flex-direction: column;
  891. flex-wrap: nowrap;
  892. align-items: center;
  893. justify-content: center;
  894. }
  895. .blue_box_one>div {
  896. margin: 5px 0;
  897. }
  898. .blue_box_one>div:nth-child(1) {
  899. font-size: 20px;
  900. font-weight: bold;
  901. }
  902. .blue_box>div:nth-child(2) {
  903. margin-top: 10px;
  904. }
  905. .blue_box_one>div:nth-child(2) {
  906. white-space: nowrap;
  907. text-overflow: ellipsis;
  908. overflow: hidden;
  909. word-break: break-all;
  910. width: 100%;
  911. text-align: center;
  912. max-width: calc(100% - 85px);
  913. margin: 0 auto;
  914. }
  915. .return {
  916. background: #205cc6;
  917. width: 70px;
  918. height: 30px;
  919. color: #fff;
  920. text-align: center;
  921. line-height: 32px;
  922. margin-right: 20px;
  923. cursor: pointer;
  924. border-radius: 5px;
  925. position: absolute;
  926. right: 0;
  927. top: 24px;
  928. font-size: 14px;
  929. }
  930. .return>img {
  931. width: 100%;
  932. height: 100%;
  933. }
  934. .cType {
  935. display: flex;
  936. flex-direction: row;
  937. justify-content: center;
  938. align-items: center;
  939. margin-top: 20px;
  940. }
  941. .cType>div>span {
  942. font-size: 18px;
  943. }
  944. .type_children+.type_children {
  945. margin-left: 10px;
  946. }
  947. .all_choose {
  948. margin-right: 10px;
  949. max-width: 250px;
  950. white-space: nowrap;
  951. overflow: hidden;
  952. text-overflow: ellipsis;
  953. }
  954. .rightT {
  955. display: flex;
  956. flex-direction: row;
  957. flex-wrap: nowrap;
  958. align-items: center;
  959. width: calc(100% - 20px);
  960. }
  961. .jd {
  962. background: #4a9eed;
  963. margin-left: 15px;
  964. border-radius: 10px;
  965. color: #fff;
  966. width: 70px;
  967. height: 25px;
  968. text-align: center;
  969. line-height: 25px;
  970. }
  971. .sLeft {
  972. width: 14%;
  973. margin-right: 10px;
  974. background: rgb(255, 255, 255);
  975. padding: 20px 15px 0 15px;
  976. box-sizing: border-box;
  977. border-radius: 10px;
  978. }
  979. .courseT {
  980. border-left: 3px solid #2e66c9;
  981. padding-left: 5px;
  982. color: #2e66c9;
  983. font-weight: bold;
  984. }
  985. .courseTd {
  986. padding-top: 15px;
  987. height: 700px;
  988. overflow: auto;
  989. word-break: break-word;
  990. }
  991. .courseTd::-webkit-scrollbar {
  992. /*滚动条整体样式*/
  993. width: 6px;
  994. /*高宽分别对应横竖滚动条的尺寸*/
  995. height: 6px;
  996. }
  997. /*定义滚动条轨道 内阴影+圆角*/
  998. .courseTd::-webkit-scrollbar {
  999. border-radius: 10px;
  1000. background-color: #eee;
  1001. }
  1002. /*定义滑块 内阴影+圆角*/
  1003. .courseTd::-webkit-scrollbar-thumb {
  1004. border-radius: 10px;
  1005. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1006. background-color: rgba(0, 0, 0, 0.1);
  1007. }
  1008. .rightTd,
  1009. .noBRight {
  1010. width: 84%;
  1011. background: #fff;
  1012. display: flex;
  1013. flex-direction: row;
  1014. flex-wrap: wrap;
  1015. align-content: flex-start;
  1016. align-items: center;
  1017. justify-content: flex-start;
  1018. }
  1019. .noBRight {
  1020. width: 100%;
  1021. }
  1022. .Tname {
  1023. margin-left: 40px;
  1024. word-break: break-all;
  1025. }
  1026. .detail {
  1027. width: 100%;
  1028. padding: 15px;
  1029. box-sizing: border-box;
  1030. }
  1031. .statebox {
  1032. display: flex;
  1033. align-items: center;
  1034. box-sizing: border-box;
  1035. margin-left: 30px;
  1036. }
  1037. .statebox div {
  1038. padding: 10px 20px;
  1039. border-radius: 5px;
  1040. background: #fff;
  1041. display: flex;
  1042. align-items: center;
  1043. }
  1044. .statebox div+div {
  1045. margin-left: 20px;
  1046. }
  1047. .statebox div span {
  1048. font-size: 16px;
  1049. display: flex;
  1050. align-items: center;
  1051. }
  1052. .statebox div span+span {
  1053. margin-left: 10px;
  1054. color: #1463eb;
  1055. }
  1056. .p_tool_box {
  1057. display: flex;
  1058. flex-wrap: wrap;
  1059. background: rgb(217, 227, 239);
  1060. /* color: #fff; */
  1061. padding: 0 15px 10px;
  1062. align-items: center;
  1063. justify-content: space-evenly;
  1064. border-radius: 5px;
  1065. height: 200px;
  1066. overflow: auto;
  1067. }
  1068. .p_tool {
  1069. display: flex;
  1070. margin-top: 10px;
  1071. }
  1072. .p_tool>div {
  1073. display: flex;
  1074. flex-direction: column;
  1075. align-items: center;
  1076. min-width: 60px;
  1077. }
  1078. .p_tool>div img {
  1079. width: 50px;
  1080. height: 50px;
  1081. }
  1082. .p_tool>div>div {
  1083. margin-top: 5px;
  1084. font-size: 12px;
  1085. }
  1086. .p_tool_box2 {
  1087. padding: 10px 15px;
  1088. }
  1089. .p_tool2 {
  1090. margin-right: 20px;
  1091. display: flex;
  1092. flex-direction: column;
  1093. align-items: flex-start;
  1094. /* margin-bottom: 10px; */
  1095. }
  1096. .p_tool2>div:nth-child(1) {
  1097. margin-bottom: 10px;
  1098. }
  1099. .toolBigBox {
  1100. display: flex;
  1101. flex-direction: column;
  1102. }
  1103. .toolSta {
  1104. display: flex;
  1105. margin: 20px 0 0;
  1106. }
  1107. .toolSta>div {
  1108. display: flex;
  1109. }
  1110. .toolSta>div+div {
  1111. margin-left: 50px;
  1112. }
  1113. .toolSta>div>div:nth-child(1) {
  1114. margin: 10px 10px 0 0;
  1115. }
  1116. .toolSta>div>div:nth-child(2)>div {
  1117. background: rgb(79, 140, 223);
  1118. color: #fff;
  1119. display: flex;
  1120. padding: 10px 15px;
  1121. min-width: 150px;
  1122. font-size: 16px;
  1123. align-items: center;
  1124. border-radius: 5px;
  1125. }
  1126. .toolSta>div:nth-child(2)>div:nth-child(2)>div {
  1127. background: rgb(53, 103, 172);
  1128. }
  1129. .toolSta>div>div:nth-child(2)>div+div {
  1130. margin-top: 10px;
  1131. }
  1132. .toolSta>div>div:nth-child(2)>div>div+div {
  1133. margin: 0 20px;
  1134. }
  1135. .p_tool2 .toolbox {
  1136. display: flex;
  1137. align-items: center;
  1138. margin-top: 10px;
  1139. }
  1140. .checkBox {
  1141. display: flex;
  1142. padding: 20px 0 0 20px;
  1143. box-sizing: border-box;
  1144. width: 100%;
  1145. }
  1146. .checkBox span {
  1147. padding: 0 10px 5px;
  1148. cursor: pointer;
  1149. font-size: 18px;
  1150. }
  1151. .checkBox span+span {
  1152. margin-left: 20px;
  1153. }
  1154. .checkBox .active {
  1155. border-bottom: 2px solid rgb(75, 151, 229);
  1156. cursor: pointer;
  1157. }
  1158. .detail_box {
  1159. background-color: rgb(231, 240, 247);
  1160. padding: 15px 20px;
  1161. box-sizing: border-box;
  1162. width: 100%;
  1163. }
  1164. .detail_box+.detail_box {
  1165. margin-top: 20px;
  1166. }
  1167. .detail_box .title {
  1168. display: flex;
  1169. align-items: center;
  1170. }
  1171. .detail_box .title>span:nth-child(1) {
  1172. font-size: 20px;
  1173. display: flex;
  1174. align-items: center;
  1175. }
  1176. .detail_box .box {
  1177. margin-top: 20px;
  1178. background-color: #fff;
  1179. padding: 15px 20px;
  1180. border-radius: 5px;
  1181. /* width: 100%; */
  1182. box-sizing: border-box;
  1183. overflow: auto;
  1184. }
  1185. .progress {
  1186. display: -webkit-box;
  1187. display: -ms-flexbox;
  1188. width: 100%;
  1189. overflow: auto;
  1190. padding: 15px 0;
  1191. }
  1192. .chapter {
  1193. margin-right: 10px;
  1194. }
  1195. .chapter+.chapter {
  1196. padding-left: 10px;
  1197. border-left: 1px solid rgb(220, 220, 220);
  1198. }
  1199. .chapter .stage {
  1200. width: 100%;
  1201. color: #fff;
  1202. background: linear-gradient(90deg, #477cd7, #65b9fc);
  1203. border-radius: 5px;
  1204. height: 50px;
  1205. line-height: 50px;
  1206. font-size: 18px;
  1207. text-align: center;
  1208. }
  1209. .chapter .task {
  1210. display: flex;
  1211. width: 100%;
  1212. }
  1213. .chapter .task .taskBox {
  1214. min-width: 110px;
  1215. max-width: 180px;
  1216. height: 100%;
  1217. }
  1218. .chapter .task .taskBox+.taskBox {
  1219. margin-left: 10px;
  1220. }
  1221. .chapter .task .taskBox .taskName {
  1222. text-align: center;
  1223. margin: 10px
  1224. }
  1225. .toolIcon::before {
  1226. content: '';
  1227. width: 26px;
  1228. height: 26px;
  1229. display: inline-block;
  1230. background-image: url(../../assets/icon/toolion.png);
  1231. background-size: 100% 100%;
  1232. }
  1233. .toolIcon::before {
  1234. content: '';
  1235. width: 26px;
  1236. height: 26px;
  1237. display: inline-block;
  1238. background-image: url(../../assets/icon/toolion.png);
  1239. background-size: 100% 100%;
  1240. }
  1241. .taskIcon::before {
  1242. content: '';
  1243. width: 26px;
  1244. height: 26px;
  1245. display: inline-block;
  1246. background-image: url(../../assets/icon/task.png);
  1247. background-size: 100% 100%;
  1248. }
  1249. .finishIcon::before {
  1250. content: '';
  1251. width: 26px;
  1252. height: 26px;
  1253. display: inline-block;
  1254. background-image: url(../../assets/icon/finish.png);
  1255. background-size: 100% 100%;
  1256. }
  1257. .learningIcon::before {
  1258. content: '';
  1259. width: 22px;
  1260. height: 22px;
  1261. display: inline-block;
  1262. background-image: url(../../assets/icon/learning.png);
  1263. background-size: 100% 100%;
  1264. }
  1265. .frequencyIcon::before {
  1266. content: '';
  1267. width: 26px;
  1268. height: 26px;
  1269. display: inline-block;
  1270. background-image: url(../../assets/icon/frequency.png);
  1271. background-size: 100% 100%;
  1272. }
  1273. .timeIcon::before {
  1274. content: '';
  1275. width: 26px;
  1276. height: 26px;
  1277. display: inline-block;
  1278. background-image: url(../../assets/icon/time.png);
  1279. background-size: 100% 100%;
  1280. }
  1281. .chapter_time_box {
  1282. border-left: 5px solid #f0f0f0;
  1283. padding: 0 30px;
  1284. box-sizing: border-box;
  1285. margin-top: 35px;
  1286. }
  1287. .c_box {
  1288. padding-top: 40px;
  1289. position: relative;
  1290. margin-top: 45px;
  1291. }
  1292. .c_box .stage_box {
  1293. display: flex;
  1294. align-items: center;
  1295. position: absolute;
  1296. top: -20px;
  1297. left: -45px;
  1298. }
  1299. .c_box .stage_box .yuan {
  1300. width: 25px;
  1301. height: 25px;
  1302. background: rgb(244, 244, 244);
  1303. border-radius: 25px;
  1304. display: flex;
  1305. align-items: center;
  1306. justify-content: center;
  1307. margin-right: 10px;
  1308. }
  1309. .c_box .stage_box .yuan::before {
  1310. content: '';
  1311. width: 15px;
  1312. height: 15px;
  1313. background: rgb(59, 149, 238);
  1314. border-radius: 25px;
  1315. }
  1316. .c_box .stage_box .stage {
  1317. background: linear-gradient(90deg, #477cd7, #65b9fc);
  1318. border-radius: 5px;
  1319. height: 50px;
  1320. line-height: 50px;
  1321. font-size: 18px;
  1322. color: #fff;
  1323. width: fit-content;
  1324. padding: 0 20px;
  1325. }
  1326. .s_up {
  1327. cursor: pointer;
  1328. transition: all .5s;
  1329. }
  1330. .s_up img {
  1331. width: 35px;
  1332. }
  1333. .s_up2 {
  1334. transform: rotate(90deg);
  1335. }
  1336. </style>