edit.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519
  1. <template>
  2. <div class="edit-page">
  3. <el-steps :active="stepsType" simple class="top-steps-box">
  4. <el-step title="资源信息" icon="el-icon-edit" :status="stepsType==0?'finish ':'process'"
  5. @click.native="stepsClick(0,$event)" style="cursor:pointer;"></el-step>
  6. <el-step title="资源章节" icon="el-icon-folder-add" :status="stepsType==1?'finish ':'process'"
  7. @click.native="stepsClick(1,$event)" style="cursor:pointer;"></el-step>
  8. <el-step title="资源设置" icon="el-icon-setting" :status="stepsType==2?'finish ':'process'"
  9. @click.native="stepsClick(2,$event)" style="cursor:pointer;"></el-step>
  10. </el-steps>
  11. <!--课程信息-->
  12. <div class="center-content-max-box info-max-box" v-if="stepsType === 0">
  13. <el-form :model="infoForm" ref="infoForm" :rules="infoRules" label-width="80px">
  14. <el-form-item label="课程名称" prop="title">
  15. <el-input
  16. style="width:400px;"
  17. v-model="infoForm.title"
  18. maxLength="25"
  19. placeholder="请输入课程名称"
  20. size="small"
  21. />
  22. {{infoForm.title.length}}/25
  23. </el-form-item>
  24. <el-form-item label="课程分类" prop="cateName">
  25. <div style="display: flex">
  26. <el-input
  27. style="width:400px;"
  28. v-model="infoForm.cateName"
  29. disabled
  30. maxLength="25"
  31. placeholder="请选择课程分类"
  32. size="small"
  33. />
  34. <p class="page-add-common-style-button"
  35. style="margin-left:20px;"
  36. @click="openClassTreeClick"
  37. >选择分类</p>
  38. </div>
  39. </el-form-item>
  40. <el-form-item label="适用类型" prop="checkList">
  41. <el-checkbox-group v-model="infoForm.checkList">
  42. <el-checkbox
  43. v-for="item in scopeTypeList"
  44. :label="item.id"
  45. :key="item.id">{{item.value}}
  46. </el-checkbox>
  47. </el-checkbox-group>
  48. </el-form-item>
  49. <el-form-item label="适用学院" prop="deptId">
  50. <el-cascader
  51. ref="deptCascader"
  52. style="width:400px;"
  53. @change="deptFun"
  54. v-model="infoForm.deptId"
  55. :options="deptOptions"
  56. :props="{value: 'deptId', label: 'deptName',children:'child',checkStrictly: false}"
  57. placeholder="请选择适用学院"
  58. collapse-tags></el-cascader>
  59. <!--<el-select v-model="infoForm.deptId" placeholder="请选择适用学院" @change="deptFun" style="width:400px;">-->
  60. <!--<el-option-->
  61. <!--v-for="item in deptOptions"-->
  62. <!--:key="item.deptId"-->
  63. <!--:label="item.deptName"-->
  64. <!--:value="item.deptId"-->
  65. <!--&gt;-->
  66. <!--</el-option>-->
  67. <!--</el-select>-->
  68. </el-form-item>
  69. </el-form>
  70. </div>
  71. <!--课程章节-->
  72. <div class="center-content-max-box chapter-max-box" v-if="stepsType === 1">
  73. <div class="left-new-chapter-box">
  74. <p class="title-p">新建章节</p>
  75. <p class="add-chapter-p page-add-common-style-button" @click="add_el_chapterClick">新增章节</p>
  76. <div class="chapter-list-for-max-box scrollbar-box">
  77. <div class="chapter-list-for-big-box" v-for="(item,index) in chapterList" :key="index" :index="item.id">
  78. <div class="chapter-list-for-box" :class="{'checkChapter':item.id == chapterIndex}"
  79. @click.stop="checkChapterClick(item)">
  80. <p v-if="item.showType" @click.stop="chapterTreeClick(item,false)"><i class="el-icon-remove-outline"></i>
  81. </p>
  82. <p v-if="!item.showType" @click.stop="chapterTreeClick(item,true)"><i
  83. class="el-icon-circle-plus-outline"></i></p>
  84. <p>{{item.title}}</p>
  85. <p @click.stop="del_el_chapter(item)"><i class="el-icon-circle-close"></i></p>
  86. </div>
  87. <div class="chapter-list-min-for-box" :class="{'checkChapter':minItem.id == chapterIndex}"
  88. @click.stop="checkChapterClick(minItem)"
  89. v-if="item.showType"
  90. v-for="(minItem,index2) in item.children" :key="index2" :index="minItem.id">
  91. <p>{{minItem.title}}</p>
  92. <p @click.stop="del_el_chapter(minItem)"><i class="el-icon-circle-close"></i></p>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="center-content-box scrollbar-box">
  98. <p class="title-p">编辑框</p>
  99. <p class="null-add-p" v-if="!chapterData.id">请先在左侧动作条选择或创建章节</p>
  100. <div class="center-content-box-one" v-if="!exerciseAddType">
  101. <el-form :model="chapterData" ref="chapterForm" :rules="chapterRules" v-if="chapterData.id">
  102. <div style="display: flex">
  103. <el-form-item label="标题" prop="title" style="margin:20px 0;" label-width="100px">
  104. <el-input
  105. style="width:190px;margin-right:20px;"
  106. v-model="chapterData.title"
  107. maxLength="20"
  108. minlength="1"
  109. placeholder="请输入标题"
  110. size="small"
  111. />
  112. </el-form-item>
  113. <el-form-item label="时间" prop="timeValue" style="margin:20px 0;display: flex"
  114. v-if="chapterData.chapterData">
  115. <el-time-picker
  116. @change="timeChange"
  117. v-model="chapterData.timeValue"
  118. format='HH:mm:ss'
  119. value-format='HH:mm:ss'
  120. placeholder="请选择时间">
  121. </el-time-picker>
  122. </el-form-item>
  123. <el-form-item label="课后考核" prop="exerciseValue1" style="margin:20px 0;" label-width="100px"
  124. v-if="chapterData.chapterData">
  125. <el-switch
  126. v-model="chapterData.isAssess"
  127. :active-value="true"
  128. :inactive-value="false">
  129. </el-switch>
  130. </el-form-item>
  131. <p style="flex:1;"></p>
  132. <el-button type="primary" style="margin:20px 20px 0 20px;" @click="edit_el_chapterClick">保存</el-button>
  133. </div>
  134. <div class="exercise-title-max-box" v-if="chapterData.isAssess">
  135. <el-form-item label="考核名称" prop="assessName" label-width="100px">
  136. <el-input
  137. style="width:300px;"
  138. v-model="chapterData.assessName"
  139. maxLength="20"
  140. minlength="1"
  141. placeholder="请输入考核名称"
  142. size="small"
  143. />
  144. </el-form-item>
  145. <div class="exercise-add-max-box">
  146. <p class="exercise-add-button page-add-common-style-button" @click="exerciseAddClickOn">设置考核题目</p>
  147. <div class="exercise-add-text-box">
  148. <div>题目总数:{{totalNum}}</div>
  149. <div>单选题数:{{oneNum}}</div>
  150. <div>多选题数:{{manyNum}}</div>
  151. <div>判断题数:{{judgeNum}}</div>
  152. </div>
  153. </div>
  154. </div>
  155. </el-form>
  156. <div class="center-info-components-max-box scrollbar-box" v-loading="loading">
  157. <!--图片-->
  158. <img
  159. style="display: block;margin:0 auto;max-width:900px;"
  160. v-if="chapterData.postfix == 'png' || chapterData.postfix == 'jpg'|| chapterData.postfix == 'jpeg' || chapterData.postfix == 'gif'"
  161. :src="chapterData.chapterData">
  162. <video class="video-player vjs-custom-skin"
  163. style="width:810px;height:512px;"
  164. autoplay="autoplay"
  165. :poster="videoCover"
  166. v-if="chapterData.chapterData && chapterData.postfix == 'mp4'">
  167. <source :src="chapterData.chapterData" type="video/mp4">
  168. </video>
  169. <!--word-->
  170. <vue-office-docx
  171. v-if="chapterData.postfix == 'docx'"
  172. :src="chapterData.iframeSrc"
  173. @rendered="renderedHandler"
  174. @error="errorHandler"
  175. />
  176. <vue-office-pdf
  177. v-if="chapterData.postfix == 'pdf'"
  178. :src="chapterData.iframeSrc"
  179. @rendered="renderedHandler"
  180. @error="errorHandler"
  181. />
  182. <!--富文本-->
  183. <div v-if="chapterData.type == 5" v-html="chapterData.chapterData"></div>
  184. </div>
  185. </div>
  186. <!--课后练习-->
  187. <div class="center-content-box-two" v-if="exerciseAddType">
  188. <el-form class="center-content-box-two-top" style="margin-bottom:10px;" :model="exerciseQueryParams"
  189. ref="exerciseQueryParams" :inline="true" label-width="80px">
  190. <el-form-item label="题目名称" prop="content">
  191. <el-input
  192. style="width:140px;"
  193. v-model="exerciseQueryParams.content"
  194. placeholder="请输入题目名称"
  195. />
  196. </el-form-item>
  197. <el-form-item label="题目类型" prop="quType">
  198. <el-select
  199. style="width:150px;"
  200. v-model="exerciseQueryParams.quType"
  201. placeholder="请选择题目类型">
  202. <el-option
  203. v-for="dict in quTypes"
  204. :key="dict.type"
  205. :label="dict.value"
  206. :value="dict.type">
  207. </el-option>
  208. </el-select>
  209. </el-form-item>
  210. <el-form-item label="题目分类" prop="classifyIds">
  211. <el-select
  212. style="width:150px;"
  213. v-model="exerciseQueryParams.classifyIds"
  214. placeholder="请选择题目分类">
  215. <el-option
  216. v-for="dict in optionList"
  217. :key="dict.id"
  218. :label="dict.title"
  219. :value="dict.id">
  220. </el-option>
  221. </el-select>
  222. </el-form-item>
  223. <el-form-item>
  224. <p class="page-inquire-common-style-button" @click="exerciseHandleQuery" style="margin:0 10px;">查询</p>
  225. <p class="page-reset-common-style-button" @click="exerciseResetQuery">重置</p>
  226. </el-form-item>
  227. </el-form>
  228. <div class="center-content-box-two-bottom">
  229. <div class="center-content-box-two-bottom-left">
  230. <el-table v-loading="loading" border :data="exerciseList" empty-text="请在右侧添加题目">
  231. <el-table-column label="题目名称" align="left" prop="content" :show-overflow-tooltip="true"/>
  232. <el-table-column width="40">
  233. <template slot-scope="scope">
  234. <i class="el-icon-circle-close del-i" @click="delExerciseListClick(scope.row)"></i>
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. </div>
  239. <div class="center-content-box-two-bottom-right">
  240. <div class="center-content-box-two-bottom-right-table scrollbar-box">
  241. <el-table v-loading="loading" class="table-box" border :data="el_courseList">
  242. <el-table-column label="题目名称" align="left" prop="content" :show-overflow-tooltip="true"/>
  243. <el-table-column label="题目类型" align="left" prop="title" width="120" :show-overflow-tooltip="true">
  244. <template slot-scope="scope">
  245. <span
  246. v-for="(item, index) in quTypes"
  247. :key="index"
  248. v-if="scope.row.quType == item.type"
  249. >{{ item.value }}</span>
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="操作" align="left" width="100">
  253. <template slot-scope="scope">
  254. <div class="table-button-box">
  255. <p class="table-button-null"></p>
  256. <p class="table-button-p"
  257. @click="exerciseAdd(scope.row)">添加</p>
  258. <p class="table-button-null"></p>
  259. </div>
  260. </template>
  261. </el-table-column>
  262. </el-table>
  263. <pagination :page-sizes="[20, 30, 40, 50]"
  264. v-show="el_courseTotal>0"
  265. :total="el_courseTotal"
  266. :pager-count="5"
  267. layout="total, pager, jumper"
  268. :page.sync="exerciseQueryParams.page"
  269. :limit.sync="exerciseQueryParams.pageSize"
  270. @pagination="getExerciseList"
  271. />
  272. </div>
  273. </div>
  274. </div>
  275. <div class="center-content-box-two-bottom-button">
  276. <p></p>
  277. <p class="reset-button-one" @click="exerciseAddClickOff">取消</p>
  278. <p class="inquire-button-one" @click="exerciseAddClickSave">提交</p>
  279. </div>
  280. </div>
  281. </div>
  282. <div class="right-courseware-box">
  283. <p class="title-p">资源管理</p>
  284. <div class="el-resources-tree scrollbar-box">
  285. <el-select v-model="selectTree" placeholder="请选择分类" style="width: 100%;margin-top: 20px;">
  286. <el-option :value="selectTreeValue" style="height: auto;">
  287. <el-tree
  288. :data="treeData"
  289. :props="defaultProps"
  290. :highlight-current="true"
  291. :expand-on-click-node="false"
  292. :filter-node-method="filterNode"
  293. ref="resourcesTree"
  294. default-expand-all
  295. @node-click="handleNodeClick"
  296. />
  297. </el-option>
  298. </el-select>
  299. <el-input class="el-resources-search" placeholder="请输入资源名称" v-model="resourceName"
  300. style="margin-top: 14px;">
  301. <i slot="append" class="el-icon-search" style="font-size: 22px;" @click="queryResources"></i>
  302. </el-input>
  303. </div>
  304. <div class="el-resources-list ">
  305. <el-table :data="el_resourcesList" class="table-box" border :show-header="false">
  306. <el-table-column label="课件名称" align="left" prop="title" width="240" :show-overflow-tooltip="true"/>
  307. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="80">
  308. <template slot-scope="scope">
  309. <div class="table-button-box">
  310. <p class="table-button-null"></p>
  311. <p class="table-button-p" @click="addMinChildren(scope.row)">添加</p>
  312. <p class="table-button-null"></p>
  313. </div>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. <pagination :page-sizes="[20, 30, 40, 50]"
  318. style="height:50px;margin-left:10px;"
  319. v-show="total>0"
  320. :total="total"
  321. layout="total, prev, next"
  322. :page.sync="queryParams.page"
  323. :limit.sync="queryParams.pageSize"
  324. @pagination="getResources"
  325. />
  326. </div>
  327. </div>
  328. </div>
  329. <!--课程设置-->
  330. <div class="center-content-max-box set-up-max-box" v-if="stepsType === 2">
  331. <el-form :model="setUpForm" ref="setUpForm" :rules="setUpRules" label-width="180px">
  332. <el-form-item label="有效时间类型" prop="ceType" style="margin-top:20px;">
  333. <el-radio v-model="setUpForm.ceType" :label="0" style="margin-right:20px;">永久</el-radio>
  334. <el-radio v-model="setUpForm.ceType" :label="1">有限</el-radio>
  335. </el-form-item>
  336. <el-form-item label="过期日期" prop="ceTime" v-if="setUpForm.ceType == 1" style="margin-top:20px;">
  337. <el-date-picker
  338. :clearable="false"
  339. v-model="setUpForm.ceTime"
  340. type="date"
  341. value-format="yyyy-MM-dd"
  342. placeholder="请选择过期日期">
  343. </el-date-picker>
  344. </el-form-item>
  345. <el-form-item label="课程上架状态" prop="status" style="margin-top:20px;">
  346. <el-switch
  347. v-model="setUpForm.status"
  348. active-color="#00b7ee"
  349. inactive-color="#dedede"
  350. :active-value=true
  351. :inactive-value=false>
  352. </el-switch>
  353. </el-form-item>
  354. <el-form-item label="显示课程拖拽进度" prop="videoDraggable" style="margin-top:20px;">
  355. <el-switch
  356. v-model="setUpForm.videoDraggable"
  357. active-color="#00b7ee"
  358. inactive-color="#dedede"
  359. :active-value="1"
  360. :inactive-value="0">
  361. </el-switch>
  362. </el-form-item>
  363. </el-form>
  364. </div>
  365. <div class="bottom-button-box">
  366. <el-button @click="offPage">取 消</el-button>
  367. <el-button type="primary" style="width:200px;" @click="stepsClick">
  368. {{stepsType==0?'保存并进入下一步':(stepsType==1?'下一步':stepsType==2?'完成':'')}}
  369. </el-button>
  370. </div>
  371. <!--选择分类-->
  372. <el-dialog title="选择分类" :visible.sync="openClassTree" width="700px" append-to-body :close-on-click-modal="false">
  373. <div style="height:500px;" class="scrollbar-box">
  374. <el-tree
  375. v-if="openClassTree"
  376. :data="classTree"
  377. show-checkbox
  378. default-expand-all
  379. node-key="id"
  380. :check-strictly="true"
  381. ref="ditTree"
  382. highlight-current
  383. @node-click="editCheck"
  384. @check="editCheck"
  385. :props="defaultProps">
  386. </el-tree>
  387. </div>
  388. <div slot="footer" class="dialog-footer dialog-footer-box">
  389. <p class="dialog-footer-button-null"></p>
  390. <p class="dialog-footer-button-info" @click="openClassTreeClickOff">取消</p>
  391. <p class="dialog-footer-button-primary" @click="openClassSubmit">提交</p>
  392. <p class="dialog-footer-button-null"></p>
  393. </div>
  394. </el-dialog>
  395. </div>
  396. </template>
  397. <script>
  398. import {
  399. examQuList, list_option, examElResourcesList, examElCourse, examElCourseAdd, examElCourseEdit, examElChapterAdd,
  400. examElChapterEdit, examElChapterDel, examElChapterQueryChapterQu, examElCategoryTreeList, examElClassifyQueryOption
  401. } from '@/api/safetyEducationExam/index'
  402. import { systemDeptOrganizeStructure, systemDeptOrganizeStructureByDept } from '@/api/commonality/permission'
  403. import { getToken } from '@/utils/auth'
  404. import { videoPlayer } from 'vue-video-player'
  405. import 'video.js/dist/video-js.css'
  406. //引入VueOfficeDocx组件
  407. import VueOfficeDocx from '@vue-office/docx'
  408. import '@vue-office/docx/lib/index.css'
  409. //引入VueOfficePdf组件
  410. import VueOfficePdf from '@vue-office/pdf'
  411. export default {
  412. name: 'edit',
  413. props: {
  414. infoId: {}
  415. },
  416. components: {
  417. videoPlayer,
  418. VueOfficeDocx,
  419. VueOfficePdf
  420. },
  421. data() {
  422. return {
  423. videoCover:localStorage.getItem('fileBrowseEnvironment')+ localStorage.getItem('videoCover'),
  424. selectTree: '',
  425. selectTreeValue: [],
  426. /******************基本信息-开始******************/
  427. //上传封面设置
  428. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  429. //步骤条状态
  430. stepsType: 0,
  431. //课程信息
  432. infoForm: {
  433. title: '',
  434. // content:"",
  435. cateName: '',
  436. // certUrl:"",
  437. checkList: [],
  438. deptId: ''
  439. },
  440. courseTypeList: [
  441. { id: '0', name: '基础课程' },
  442. { id: '1', name: '视频课程' },
  443. { id: '2', name: 'VR课程' },
  444. { id: '3', name: '趣味学习' }
  445. ],
  446. resourceName: '',//资源名称
  447. //课程信息校验
  448. infoRules: {
  449. title: [
  450. { required: true, message: '请输入课程名称', trigger: 'blur' },
  451. { required: true, message: '请输入课程名称', validator: this.spaceJudgment, trigger: 'blur' }
  452. ],
  453. cateName: [
  454. { required: true, message: '请选择课程分类', trigger: 'blur' }
  455. ],
  456. checkList: [
  457. { required: true, message: '请选择适用类型', trigger: 'blur' }
  458. ],
  459. deptId: [
  460. { required: true, message: '请选择适用学院', trigger: 'blur' }
  461. ]
  462. },
  463. //分类页面
  464. openClassTree: false,
  465. //分类树数据
  466. classTree: [],
  467. defaultProps: {
  468. children: 'children',
  469. label: 'title'
  470. },
  471. //分类选择临时数据
  472. openClassTreeType: {},
  473. //学院
  474. deptOptions: [],
  475. //适用类型
  476. scopeTypeList: [
  477. { id: '1', value: '安全准入考试' },
  478. { id: '2', value: '负面清单考试' },
  479. { id: '3', value: '黑名单考试' }
  480. ],
  481. /******************基本信息-结束******************/
  482. /******************章节信息-开始******************/
  483. // 章节数组
  484. chapterList: [],
  485. chapterIndex: 0,
  486. chapterData: {},
  487. //课程信息校验
  488. chapterRules: {
  489. title: [
  490. { required: true, message: '请输入标题', trigger: 'blur' }
  491. ],
  492. assessName: [
  493. { required: true, message: '请输入考核名称', trigger: 'blur' }
  494. ]
  495. },
  496. //课件列表
  497. // 查询参数
  498. queryParams: {
  499. page: 1,
  500. pageSize: 20
  501. },
  502. //树列表
  503. treeData: [],
  504. //课件列表
  505. el_resourcesList: [],
  506. total: 0,
  507. //加载动画
  508. loading: false,
  509. //pdf页数
  510. pdfNumPages: null,
  511. page: 1,
  512. pageTotalNum: 1, //# 总页数
  513. loadedRatio: 0, //# 当前页面的加载进度,范围是0-1 ,等于1的时候代表当前页已经完全加载完成了
  514. //视频设置
  515. playerOptions: {
  516. playbackRates: [], // 可选的播放速度
  517. autoplay: false, // 如果为true,浏览器准备好时开始回放。
  518. muted: false, // 默认情况下将会消除任何音频。
  519. loop: false, // 是否视频一结束就重新开始。
  520. preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
  521. language: 'zh-CN',
  522. aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
  523. fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
  524. sources: [],
  525. poster: '', // 封面地址
  526. notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
  527. controlBar: {
  528. timeDivider: true, // 当前时间和持续时间的分隔符
  529. durationDisplay: true, // 显示持续时间
  530. remainingTimeDisplay: false, // 是否显示剩余时间功能
  531. fullscreenToggle: true // 是否显示全屏按钮
  532. }
  533. },
  534. //课后题添加
  535. exerciseAddType: false,
  536. //题目类型
  537. quTypes: [
  538. {
  539. type: 1,
  540. value: '单选题'
  541. },
  542. {
  543. type: 2,
  544. value: '多选题'
  545. },
  546. {
  547. type: 3,
  548. value: '判断题'
  549. }
  550. ],
  551. //题目分类
  552. optionList: [],
  553. //题目搜索项
  554. exerciseQueryParams: {
  555. page: 1,
  556. pageSize: 20,
  557. content: null,
  558. quType: null,
  559. classifyIds: null
  560. },
  561. //题目数量
  562. el_courseTotal: 0,
  563. //题目列表
  564. el_courseList: [],
  565. //选中题目数据
  566. exerciseList: [],
  567. //总题数
  568. totalNum: 0,
  569. //单选数
  570. oneNum: 0,
  571. //多选数
  572. manyNum: 0,
  573. //判断数
  574. judgeNum: 0,
  575. /******************章节信息-结束******************/
  576. /******************设置信息-开始******************/
  577. setUpForm: {},
  578. durationNum: {},
  579. setUpRules: {
  580. duration: [
  581. { required: true, message: '请输入课程学习时长', trigger: 'blur' }
  582. ],
  583. // points: [
  584. // { required: true, message: "请输入积分值", trigger: "blur" },
  585. // ],
  586. // machinePoints: [
  587. // { required: true, message: "请输入学习机积分值", trigger: "blur" },
  588. // ],
  589. ceType: [
  590. { required: true, message: '请选择有效时间类型', trigger: 'blur' }
  591. ],
  592. ceTime: [
  593. { required: true, message: '请选择过期日期', trigger: 'blur' }
  594. ]
  595. }
  596. /******************设置信息-结束******************/
  597. }
  598. },
  599. created() {
  600. if (this.infoId.id) {
  601. this.getInfoData()
  602. }
  603. },
  604. mounted() {
  605. this.getTreeData()
  606. this.getResourceTreeData()
  607. this.getResources()
  608. this.getDeptList()
  609. this.getList_option()
  610. this.getExerciseList()
  611. },
  612. methods: {
  613. /******************基本信息-开始******************/
  614. /* 查询学院列表 */
  615. getDeptList() {
  616. systemDeptOrganizeStructure({}).then(response => {
  617. let list = JSON.parse(JSON.stringify(response.data));
  618. pushNode(list,false)
  619. function pushNode(list,type){
  620. for(let i=0;i<list.length;i++){
  621. if(!list[i].child[0]){
  622. delete list[i].child;
  623. }else if(type){
  624. delete list[i].child;
  625. }else{
  626. pushNode(list[i].child,true)
  627. }
  628. }
  629. }
  630. this.$set(this, 'deptOptions', list)
  631. })
  632. },
  633. //步骤条下一步按钮
  634. stepsClick(type, e) {
  635. if (type == 0 || type == 1 || type == 2) {
  636. if (this.infoId.id && this.stepsType != type) {
  637. if (type == 1) {
  638. this.queryParams.cateId = ''
  639. this.queryParams.page = 1
  640. this.queryParams.pageSize = 20
  641. this.getResources()
  642. }
  643. this.getInfoData()
  644. this.stepsType = type
  645. }
  646. } else if (this.stepsType == 0) {
  647. if (this.stepsType == 0) {
  648. this.addElCourseClick()
  649. }
  650. } else if (this.stepsType == 1) {
  651. // this.edit_el_chapterClick();
  652. this.stepsType++
  653. } else if (this.stepsType == 2) {
  654. this.edutSetUpClick()
  655. }
  656. //关闭课后题目选择页面
  657. this.exerciseAddClickOff()
  658. },
  659. //选择分类页面开启
  660. openClassTreeClick() {
  661. let self = this
  662. this.openClassTree = true
  663. if (this.infoForm.cateId) {
  664. setTimeout(function() {
  665. self.$refs.ditTree.setCheckedKeys([self.infoForm.cateId])
  666. }, 100)
  667. }
  668. },
  669. openClassTreeClickOff() {
  670. this.openClassTree = false
  671. this.openClassTreeType = {}
  672. },
  673. /** 查询课程分类树 */
  674. getTreeData() {
  675. examElCategoryTreeList({}, 2).then(response => {
  676. this.classTree = JSON.parse(JSON.stringify(response.data))
  677. })
  678. },
  679. /** 查询资源分类树 */
  680. getResourceTreeData() {
  681. examElCategoryTreeList({}, 1).then(response => {
  682. let list = []
  683. let obj = {
  684. children: [],
  685. title: '所有分类',
  686. id: ''
  687. }
  688. list.push(obj)
  689. for (let i = 0; i < response.data.length; i++) {
  690. list.push(response.data[i])
  691. }
  692. this.treeData = list
  693. })
  694. },
  695. //使用学院
  696. deptFun(value) {
  697. if(value){
  698. let list = this.$refs['deptCascader'].getCheckedNodes()
  699. let deptNames = [];
  700. list.forEach((item)=>{
  701. deptNames.push(item.label)
  702. })
  703. this.$set(this.infoForm,'deptNames',deptNames);
  704. }
  705. },
  706. //分类树点击事件
  707. editCheck(event) {
  708. this.$refs.ditTree.setCheckedKeys([event.id])
  709. this.openClassTreeType.cateName = event.title
  710. this.openClassTreeType.cateId = event.id
  711. },
  712. //选择分类确定
  713. openClassSubmit() {
  714. let obj = JSON.parse(JSON.stringify(this.openClassTreeType))
  715. this.infoForm.cateId = obj.cateId
  716. this.infoForm.cateName = obj.cateName
  717. this.openClassTree = !this.openClassTree
  718. },
  719. //退出上一页
  720. offPage() {
  721. this.$parent.goPageEdit(4)
  722. },
  723. //获取课程数据
  724. getInfoData() {
  725. let self = this
  726. examElCourse(this.infoId.id).then(response => {
  727. //基础信息
  728. this.$set(this.infoForm, 'title', response.data.title)
  729. this.$set(this.infoForm, 'cateName', response.data.cateTitle)
  730. this.$set(this.infoForm, 'cateId', response.data.cateId)
  731. if (response.data.scopeType) {
  732. let scopeList = response.data.scopeType.split(',')
  733. this.$set(this.infoForm, 'checkList', scopeList)
  734. }
  735. this.$set(this.infoForm, 'deptId', response.data.deptIds?response.data.deptIds.split(','):'')
  736. this.$set(this.infoForm, 'deptNames', response.data.deptNames?response.data.deptNames.split(','):'')
  737. //章节信息
  738. for (let i = 0; i < response.data.chapterList.length; i++) {
  739. response.data.chapterList[i].showType = true
  740. }
  741. this.$set(this, 'chapterList', response.data.chapterList)
  742. if (response.data.chapterList[0]) {
  743. this.chapterIndex = response.data.chapterList[0].id
  744. this.chapterData = JSON.parse(JSON.stringify(response.data.chapterList[0]))
  745. } else {
  746. this.chapterIndex = ''
  747. this.chapterData = {}
  748. }
  749. //设置信息
  750. this.$set(this.setUpForm, 'duration', response.data.duration)
  751. this.$set(this.setUpForm, 'ceType', response.data.ceType)
  752. this.$set(this.setUpForm, 'ceTime', response.data.ceTime)
  753. this.$set(this.setUpForm, 'status', response.data.status)
  754. this.$set(this.setUpForm, 'videoDraggable', response.data.videoDraggable)
  755. })
  756. },
  757. //获取课程信息不从新定义index
  758. getInfoDataTow() {
  759. examElCourse(this.infoId.id).then(response => {
  760. this.$set(this.infoForm, 'title', response.data.title)
  761. this.$set(this.infoForm, 'cateName', response.data.cateTitle)
  762. this.$set(this.infoForm, 'cateId', response.data.cateId)
  763. if (response.data.scopeType) {
  764. let scopeList = response.data.scopeType.split(',')
  765. this.$set(this.infoForm, 'checkList', scopeList)
  766. }
  767. this.$set(this.infoForm, 'dictType', response.data.dictType)
  768. for (let i = 0; i < response.data.chapterList.length; i++) {
  769. response.data.chapterList[i].showType = true
  770. }
  771. this.$set(this, 'chapterList', response.data.chapterList)
  772. })
  773. },
  774. //信息保存
  775. addElCourseClick() {
  776. let self = this
  777. this.$refs['infoForm'].validate(valid => {
  778. if (valid) {
  779. if (this.infoId.id) {
  780. let obj = {
  781. id: this.infoId.id,
  782. title: this.infoForm.title,
  783. cateId: this.infoForm.cateId,
  784. deptIds: this.infoForm.deptId+'',
  785. deptNames: this.infoForm.deptNames+'',
  786. }
  787. let scopeText = this.infoForm.checkList + ''
  788. obj.scopeType = scopeText
  789. examElCourseEdit(obj).then(response => {
  790. this.msgSuccess('修改成功')
  791. this.stepsType++
  792. })
  793. } else {
  794. let obj = {
  795. title: this.infoForm.title,
  796. cateId: this.infoForm.cateId,
  797. deptIds: this.infoForm.deptId+'',
  798. deptNames: this.infoForm.deptNames+'',
  799. }
  800. let scopeText = this.infoForm.checkList + ''
  801. obj.scopeType = scopeText
  802. examElCourseAdd(obj).then(response => {
  803. this.infoId.id = response.data.id
  804. this.getInfoData()
  805. this.msgSuccess('新增成功')
  806. this.stepsType++
  807. })
  808. }
  809. }
  810. })
  811. },
  812. /******************基本信息-结束******************/
  813. /******************章节信息-开始******************/
  814. //搜索查询课件
  815. queryResources() {
  816. this.queryParams.title = this.resourceName
  817. examElResourcesList(this.queryParams).then(response => {
  818. this.el_resourcesList = response.data.records
  819. this.total = response.data.total
  820. })
  821. },
  822. //获取课件
  823. getResources() {
  824. examElResourcesList(this.queryParams).then(response => {
  825. this.el_resourcesList = response.data.records
  826. this.total = response.data.total
  827. })
  828. },
  829. //获取题目分类
  830. getList_option() {
  831. examElClassifyQueryOption({pageSize:-1}).then(response => {
  832. this.optionList = response.data.records
  833. })
  834. },
  835. //选中章节
  836. checkChapterClick(item) {
  837. this.chapterIndex = item.id
  838. this.$set(this, 'chapterData', JSON.parse(JSON.stringify(item)))
  839. let hour = parseInt(this.chapterData.duration / 3600)
  840. let hourNum = this.chapterData.duration - this.accMul(hour, 3600)
  841. let minute = parseInt(hourNum / 60)
  842. let second = hourNum - this.accMul(minute, 60)
  843. let timeValue = hour + ':' + minute + ':' + second
  844. this.$set(this.chapterData, 'timeValue', timeValue)
  845. if (this.chapterData.postfix == 'mp4') {
  846. this.chapterData.chapterData = localStorage.getItem('fileBrowseEnvironment')+this.chapterData.chapterData
  847. } else if (this.chapterData.postfix == 'pdf' || this.chapterData.postfix == 'docx') {
  848. this.getWord()
  849. } else if (this.chapterData.type == 5) {
  850. this.getRichText()
  851. }
  852. if (this.chapterData.isAssess) {
  853. this.getQueryChapterQu(this.chapterData.id)
  854. }
  855. this.countTheNumberOfQuestions()
  856. this.exerciseAddClickOff()
  857. this.$forceUpdate()
  858. },
  859. //富文本处理
  860. getRichText() {
  861. this.chapterData.chapterData = unescape(this.chapterData.chapterData)
  862. },
  863. //word处理
  864. async getWord() {
  865. this.chapterData.iframeSrc = localStorage.getItem('fileBrowseEnvironment')+this.chapterData.chapterData
  866. },
  867. //文件加载成功
  868. renderedHandler() {
  869. // console.log("渲染完成")
  870. // this.$set(this,'officeNullType',false);
  871. },
  872. //文件加载失败
  873. errorHandler() {
  874. // console.log("渲染失败")
  875. // this.$set(this,'officeNullType',true);
  876. },
  877. //子类展开/关闭
  878. chapterTreeClick(item, type) {
  879. item.showType = type
  880. },
  881. //添加新章节
  882. add_el_chapterClick() {
  883. let obj = {
  884. type: 0,
  885. courseId: this.infoId.id,
  886. parentId: 0,
  887. title: '新章节'
  888. }
  889. examElChapterAdd(obj).then(response => {
  890. response.data.showType = true
  891. if (this.chapterList[0]) {
  892. this.chapterList.push(response.data)
  893. } else {
  894. this.chapterList.push(response.data)
  895. this.chapterIndex = response.data.id
  896. this.chapterData = JSON.parse(JSON.stringify(response.data))
  897. }
  898. this.msgSuccess('新增成功')
  899. })
  900. },
  901. //时间确定
  902. timeChange(data) {
  903. // this.$set(this.chapterData,'timeValue',data);
  904. let timeList = data.split(':')
  905. let hour = timeList[0]
  906. let minute = timeList[1]
  907. let second = timeList[2]
  908. minute = this.accAdd(minute, this.accMul(hour, 60))
  909. second = this.accAdd(second, this.accMul(minute, 60))
  910. this.$set(this.chapterData, 'duration', second)
  911. this.$forceUpdate()
  912. },
  913. //修改章节
  914. edit_el_chapterClick() {
  915. let self = this
  916. this.$refs['chapterForm'].validate(valid => {
  917. if (valid) {
  918. if (this.chapterData.chapterData) {
  919. if (self.chapterData.isAssess && !self.chapterData.exerciseList) {
  920. this.msgError('请添加题目或关闭课后考核')
  921. return
  922. }
  923. if (self.chapterData.isAssess && !self.chapterData.exerciseList[0]) {
  924. this.msgError('请添加题目或关闭课后考核')
  925. return
  926. }
  927. let list = []
  928. if (self.chapterData.isAssess && self.chapterData.exerciseList) {
  929. for (let i = 0; i < self.chapterData.exerciseList.length; i++) {
  930. let minObj = {
  931. quId: self.chapterData.exerciseList[i].quId
  932. }
  933. list.push(minObj)
  934. }
  935. }
  936. let obj = {
  937. courseId: this.infoId.id,
  938. id: this.chapterData.id,
  939. title: this.chapterData.title,
  940. // description:this.chapterData.description,
  941. duration: this.chapterData.duration,
  942. isAssess: this.chapterData.isAssess
  943. }
  944. if (list[0]) {
  945. obj.assessName = this.chapterData.assessName
  946. obj.chapterQuList = list
  947. }
  948. examElChapterEdit(obj).then(response => {
  949. this.msgSuccess('修改成功')
  950. this.getInfoDataTow()
  951. // this.stepsType++
  952. })
  953. } else {
  954. let obj = {
  955. courseId: this.infoId.id,
  956. id: this.chapterData.id,
  957. title: this.chapterData.title
  958. // description:this.chapterData.description,
  959. }
  960. examElChapterEdit(obj).then(response => {
  961. this.msgSuccess('修改成功')
  962. this.getInfoDataTow()
  963. // this.stepsType++
  964. })
  965. }
  966. }
  967. })
  968. },
  969. //删除章节
  970. del_el_chapter(item) {
  971. let self = this
  972. examElChapterDel({ id: item.id }).then(response => {
  973. for (let i = 0; i < self.chapterList.length; i++) {
  974. if (item.id == self.chapterList[i].id) {
  975. self.chapterList.splice(i, 1)
  976. }
  977. }
  978. if (item.id == this.chapterIndex) {
  979. if (self.chapterList[0]) {
  980. this.chapterIndex = self.chapterList[0].id
  981. this.chapterData = JSON.parse(JSON.stringify(self.chapterList[0]))
  982. } else {
  983. this.chapterIndex = ''
  984. this.chapterData = {}
  985. }
  986. }
  987. this.$forceUpdate()
  988. this.msgSuccess('删除成功')
  989. this.getInfoDataTow()
  990. })
  991. },
  992. //添加节
  993. addMinChildren(item) {
  994. if (!this.chapterData.id) {
  995. this.msgError('请先选择或添加章节')
  996. return
  997. }
  998. if (this.chapterData.chapterData) {
  999. this.msgError('无法给课程添加课程')
  1000. return
  1001. }
  1002. let obj = {
  1003. type: item.type,
  1004. courseId: this.infoId.id,
  1005. parentId: this.chapterData.id,
  1006. resourcesId: item.id,
  1007. chapterData: item.path,
  1008. title: item.title,
  1009. duration: item.duration
  1010. }
  1011. if (item.type == 5) {
  1012. obj.chapterData = item.content
  1013. }
  1014. examElChapterAdd(obj).then(response => {
  1015. this.msgSuccess('添加成功')
  1016. this.getInfoDataTow()
  1017. })
  1018. },
  1019. // 筛选节点
  1020. filterNode(value, data) {
  1021. if (!value) return true
  1022. return data.label.indexOf(value) !== -1
  1023. },
  1024. // 节点单击事件
  1025. handleNodeClick(data) {
  1026. this.selectTree = data.title
  1027. this.queryParams.cateId = data.id
  1028. this.getResources()
  1029. },
  1030. //打开课后练习页面
  1031. exerciseAddClickOn() {
  1032. this.exerciseAddType = true
  1033. if (!this.chapterData.exerciseList) {
  1034. this.$set(this.chapterData, 'exerciseList', [])
  1035. this.exerciseList = []
  1036. } else {
  1037. this.$set(this, 'exerciseList', this.chapterData.exerciseList)
  1038. }
  1039. },
  1040. //关闭课后练习页面
  1041. exerciseAddClickOff() {
  1042. this.exerciseAddType = false
  1043. },
  1044. //保存课后练习页面数据并计算题目数量
  1045. exerciseAddClickSave() {
  1046. this.$set(this.chapterData, 'exerciseList', this.exerciseList)
  1047. this.countTheNumberOfQuestions()
  1048. this.exerciseAddType = false
  1049. },
  1050. //删除已添加题目
  1051. delExerciseListClick(row) {
  1052. let self = this
  1053. for (let i = 0; self.exerciseList.length; i++) {
  1054. if (row.quId == self.exerciseList[i].quId) {
  1055. self.exerciseList.splice(i, 1)
  1056. }
  1057. }
  1058. },
  1059. //获取题目列表
  1060. getExerciseList() {
  1061. this.loading = true
  1062. examQuList(this.exerciseQueryParams).then((response) => {
  1063. this.el_courseList = response.data.records
  1064. this.el_courseTotal = response.data.total
  1065. this.loading = false
  1066. })
  1067. },
  1068. /** 搜索按钮操作 */
  1069. exerciseHandleQuery() {
  1070. this.exerciseQueryParams.page = 1
  1071. this.getExerciseList()
  1072. },
  1073. /** 重置按钮操作 */
  1074. exerciseResetQuery() {
  1075. this.resetForm('exerciseQueryParams')
  1076. this.handleQuery()
  1077. },
  1078. /** 添加题目*/
  1079. exerciseAdd(row) {
  1080. let self = this
  1081. for (let i = 0; i < self.exerciseList.length; i++) {
  1082. if (row.id == self.exerciseList[i].quId) {
  1083. this.msgError('该题目已添加')
  1084. return
  1085. }
  1086. }
  1087. row.quId = row.id
  1088. this.exerciseList.push(row)
  1089. },
  1090. /** 计算题目数量 */
  1091. countTheNumberOfQuestions() {
  1092. let self = this
  1093. if (this.stepsType == 1) {
  1094. if (this.chapterData.chapterData) {
  1095. if (this.chapterData.exerciseList) {
  1096. let total = 0
  1097. let one = 0
  1098. let many = 0
  1099. let judge = 0
  1100. for (let i = 0; i < self.chapterData.exerciseList.length; i++) {
  1101. total++
  1102. if (self.chapterData.exerciseList[i].quType == 1) {
  1103. one++
  1104. } else if (self.chapterData.exerciseList[i].quType == 2) {
  1105. many++
  1106. } else if (self.chapterData.exerciseList[i].quType == 3) {
  1107. judge++
  1108. }
  1109. }
  1110. this.totalNum = total
  1111. this.oneNum = one
  1112. this.manyNum = many
  1113. this.judgeNum = judge
  1114. } else {
  1115. this.totalNum = 0
  1116. this.oneNum = 0
  1117. this.manyNum = 0
  1118. this.judgeNum = 0
  1119. }
  1120. } else {
  1121. this.totalNum = 0
  1122. this.oneNum = 0
  1123. this.manyNum = 0
  1124. this.judgeNum = 0
  1125. }
  1126. }
  1127. },
  1128. //获取章节题目数据
  1129. getQueryChapterQu(id) {
  1130. examElChapterQueryChapterQu({ id: id }).then(res => {
  1131. this.$set(this.chapterData, 'exerciseList', res.data)
  1132. this.countTheNumberOfQuestions()
  1133. })
  1134. },
  1135. /******************章节信息-结束******************/
  1136. /******************设置信息-开始******************/
  1137. edutSetUpClick() {
  1138. this.$refs['setUpForm'].validate(valid => {
  1139. if (valid) {
  1140. let obj = {
  1141. id: this.infoId.id,
  1142. // duration:this.setUpForm.duration,
  1143. // points:this.setUpForm.points,
  1144. ceTime: this.setUpForm.ceTime,
  1145. ceType: this.setUpForm.ceType,
  1146. status: this.setUpForm.status,
  1147. videoDraggable: this.setUpForm.videoDraggable
  1148. }
  1149. examElCourseEdit(obj).then(response => {
  1150. this.msgSuccess('修改成功')
  1151. this.offPage()
  1152. })
  1153. }
  1154. })
  1155. },
  1156. /******************设置信息-结束******************/
  1157. //乘法
  1158. accMul(arg1, arg2) {
  1159. var m = 0, s1 = arg1.toString(), s2 = arg2.toString()
  1160. try {
  1161. m += s1.split('.')[1].length
  1162. } catch (e) {
  1163. }
  1164. try {
  1165. m += s2.split('.')[1].length
  1166. } catch (e) {
  1167. }
  1168. return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
  1169. },
  1170. //加法
  1171. accAdd(arg1, arg2) {
  1172. var r1, r2, m
  1173. try {
  1174. r1 = arg1.toString().split('.')[1].length
  1175. } catch (e) {
  1176. r1 = 0
  1177. }
  1178. try {
  1179. r2 = arg2.toString().split('.')[1].length
  1180. } catch (e) {
  1181. r2 = 0
  1182. }
  1183. m = Math.pow(10, Math.max(r1, r2))
  1184. return ((arg1 * m + arg2 * m) / m).toFixed(0)
  1185. }
  1186. }
  1187. }
  1188. </script>
  1189. <style scoped lang="scss">
  1190. .edit-page {
  1191. flex: 1;
  1192. display: flex !important;
  1193. flex-direction: column;
  1194. overflow: hidden;
  1195. /*box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);*/
  1196. /*padding:20px!important;*/
  1197. /*margin:9px 20px 20px;*/
  1198. .top-steps-box {
  1199. margin: 20px 20px 0;
  1200. }
  1201. .center-content-max-box {
  1202. flex: 1;
  1203. }
  1204. .bottom-button-box {
  1205. width: 280px;
  1206. margin: 0 auto 20px;
  1207. }
  1208. .info-max-box {
  1209. margin: 20px 20px 0;
  1210. }
  1211. .chapter-max-box {
  1212. * {
  1213. margin: 0;
  1214. padding: 0;
  1215. }
  1216. display: flex;
  1217. overflow: hidden;
  1218. .left-new-chapter-box {
  1219. /*backAnimation-color: blueviolet;*/
  1220. box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);
  1221. border-radius: 6px;
  1222. width: 270px;
  1223. overflow: hidden;
  1224. margin: 20px;
  1225. display: flex;
  1226. flex-direction: column;
  1227. .add-chapter-p {
  1228. margin: 15px auto;
  1229. }
  1230. .chapter-list-for-max-box {
  1231. flex: 1;
  1232. margin-bottom: 20px;
  1233. overflow-y: scroll;
  1234. padding: 0 !important;
  1235. .chapter-list-for-big-box {
  1236. margin: 10px 6px 0 10px;
  1237. .chapter-list-for-box {
  1238. display: flex;
  1239. background: #F2F2F2;
  1240. border: 1px solid #F2F2F2;
  1241. p {
  1242. line-height: 30px;
  1243. font-size: 15px;
  1244. }
  1245. p:nth-child(1) {
  1246. width: 30px;
  1247. text-align: center;
  1248. font-size: 18px;
  1249. cursor: pointer;
  1250. }
  1251. p:nth-child(2) {
  1252. flex: 1;
  1253. display: block;
  1254. overflow: hidden;
  1255. text-overflow: ellipsis;
  1256. white-space: nowrap;
  1257. }
  1258. p:nth-child(3) {
  1259. width: 30px;
  1260. text-align: center;
  1261. font-size: 18px;
  1262. cursor: pointer;
  1263. }
  1264. }
  1265. .chapter-list-min-for-box {
  1266. display: flex;
  1267. margin: 10px 0 0 10px;
  1268. border: 1px solid #F2F2F2;
  1269. p {
  1270. line-height: 30px;
  1271. font-size: 15px;
  1272. }
  1273. p:nth-child(1) {
  1274. flex: 1;
  1275. margin-left: 10px;
  1276. display: block;
  1277. overflow: hidden;
  1278. text-overflow: ellipsis;
  1279. white-space: nowrap;
  1280. }
  1281. p:nth-child(2) {
  1282. width: 30px;
  1283. text-align: center;
  1284. font-size: 18px;
  1285. cursor: pointer;
  1286. }
  1287. }
  1288. }
  1289. }
  1290. }
  1291. .center-content-box {
  1292. display: flex;
  1293. flex-direction: column;
  1294. /*backAnimation-color: red;*/
  1295. box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);
  1296. border-radius: 6px;
  1297. flex: 1;
  1298. margin: 20px 0;
  1299. width: 861px;
  1300. .center-content-box-one {
  1301. flex: 1;
  1302. display: flex;
  1303. flex-direction: column;
  1304. }
  1305. .center-content-box-two {
  1306. flex: 1;
  1307. display: flex;
  1308. flex-direction: column;
  1309. overflow: hidden;
  1310. .center-content-box-two-top {
  1311. padding-top: 10px;
  1312. }
  1313. .center-content-box-two-bottom {
  1314. flex: 1;
  1315. display: flex;
  1316. overflow: hidden;
  1317. /*max-width:956px;*/
  1318. .center-content-box-two-bottom-left {
  1319. width: 320px;
  1320. border: 1px solid #dedede;
  1321. border-radius: 4px;
  1322. margin: 0 20px;
  1323. display: flex;
  1324. flex-direction: column;
  1325. overflow-y: hidden;
  1326. .del-i {
  1327. color: #999;
  1328. cursor: pointer;
  1329. font-size: 16px;
  1330. }
  1331. .del-i:hover {
  1332. color: #FF6666;
  1333. }
  1334. .center-content-box-two-bottom-left-title {
  1335. background: #f8f8f9;
  1336. border-bottom: 1px solid #dfe6ec;
  1337. height: 40px;
  1338. line-height: 40px;
  1339. padding-left: 10px;
  1340. font-size: 14px;
  1341. }
  1342. .center-content-box-two-bottom-left-null {
  1343. line-height: 100px;
  1344. text-align: center;
  1345. font-size: 14px;
  1346. color: #999;
  1347. }
  1348. .center-content-box-two-bottom-left-for-box {
  1349. flex: 1;
  1350. display: flex;
  1351. flex-direction: column;
  1352. .center-content-box-two-bottom-left-for-p {
  1353. border-top: 1px solid #dfe6ec;
  1354. flex: 1;
  1355. line-height: 40px;
  1356. font-size: 14px;
  1357. color: #999;
  1358. font-weight: 500;
  1359. padding: 0 10px;
  1360. display: block;
  1361. white-space: nowrap;
  1362. }
  1363. }
  1364. }
  1365. .center-content-box-two-bottom-right {
  1366. flex: 1;
  1367. border: 1px solid #dedede;
  1368. border-radius: 4px;
  1369. display: flex;
  1370. flex-direction: column;
  1371. overflow-y: hidden;
  1372. margin-right: 20px;
  1373. position: relative;
  1374. .center-content-box-two-bottom-right-table {
  1375. display: flex;
  1376. flex-direction: column;
  1377. position: absolute;
  1378. width: 100%;
  1379. height: 100%;
  1380. }
  1381. }
  1382. }
  1383. .center-content-box-two-bottom-button {
  1384. height: 60px;
  1385. display: flex;
  1386. p:nth-child(1) {
  1387. flex: 1;
  1388. }
  1389. p:nth-child(2) {
  1390. height: 30px;
  1391. width: 70px;
  1392. margin: 10px;
  1393. line-height: 30px;
  1394. text-align: center;
  1395. border: 1px solid #E0E0E0;
  1396. background: #E0E0E0;
  1397. color: #999999;
  1398. cursor: pointer;
  1399. font-size: 12px;
  1400. border-radius: 6px;
  1401. }
  1402. p:nth-child(3) {
  1403. height: 30px;
  1404. width: 70px;
  1405. margin: 10px 20px 0 0;
  1406. line-height: 30px;
  1407. text-align: center;
  1408. border: 1px solid #0045AF;
  1409. color: #FFFFFF;
  1410. background: #0045AF;
  1411. cursor: pointer;
  1412. font-size: 12px;
  1413. border-radius: 6px;
  1414. }
  1415. }
  1416. }
  1417. .center-info-components-max-box {
  1418. margin: 20px;
  1419. overflow-y: scroll;
  1420. flex: 1;
  1421. display: flex;
  1422. flex-direction: column;
  1423. iframe {
  1424. flex: 1;
  1425. }
  1426. }
  1427. .exercise-add-max-box {
  1428. margin: 20px 20px 0;
  1429. display: flex;
  1430. .exercise-add-text-box {
  1431. display: flex;
  1432. flex: 1;
  1433. div {
  1434. flex: 1;
  1435. padding: 10px 20px;
  1436. background: #f5f5f5;
  1437. }
  1438. }
  1439. .exercise-add-button {
  1440. width: 200px;
  1441. line-height: 40px;
  1442. text-align: center;
  1443. border-radius: 6px;
  1444. margin-right: 20px;
  1445. }
  1446. }
  1447. }
  1448. .right-courseware-box {
  1449. /*backAnimation-color: blue;*/
  1450. display: flex;
  1451. flex-direction: column;
  1452. box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);
  1453. border-radius: 6px;
  1454. width: 365px;
  1455. margin: 20px;
  1456. padding: 0 20px;
  1457. box-sizing: border-box;
  1458. .el-resources-tree {
  1459. /* flex:1;*/
  1460. border-bottom: 1px solid #dedede;
  1461. overflow-y: scroll;
  1462. height: 130px;
  1463. }
  1464. .el-resources-search {
  1465. flex: 1;
  1466. }
  1467. .el-resources-list {
  1468. height: 72%;
  1469. overflow-y: auto;
  1470. .el-table {
  1471. height: 86%;
  1472. }
  1473. }
  1474. }
  1475. }
  1476. .set-up-max-box {
  1477. * {
  1478. margin: 0;
  1479. padding: 0;
  1480. }
  1481. }
  1482. .title-p {
  1483. margin: 0;
  1484. line-height: 40px;
  1485. font-size: 16px;
  1486. color: #0045AF;
  1487. font-weight: 500;
  1488. padding-left: 20px;
  1489. border-bottom: 2px solid #E0E0E0;
  1490. }
  1491. .null-add-p {
  1492. font-size: 20px;
  1493. color: #999;
  1494. text-align: center;
  1495. line-height: 300px;
  1496. font-weight: 500;
  1497. }
  1498. .checkChapter {
  1499. border: 1px solid #0045AF !important;
  1500. }
  1501. .video-player {
  1502. video {
  1503. object-fit: fill !important;
  1504. }
  1505. }
  1506. }
  1507. </style>