course.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041
  1. <template>
  2. <div class="pb_content" style="height: auto; width: 94%; margin: 10px auto;background: unset;">
  3. <backPage v-if="$route.query.gotype == 1" tit="协同建构"></backPage>
  4. <div style="width:100%;padding:0 21px;background:#fff;border-radius: 5px;box-sizing: border-box;">
  5. <div class="pb_head top">
  6. <div style="
  7. display: flex;
  8. align-items: center;
  9. ">
  10. <span>协同建构</span>
  11. </div>
  12. <div class="student_button">
  13. <button class="r_pub_button_course" @mouseenter="btnDisplay = true" @mouseleave="btnDisplay = false">
  14. <span>创建协同建构</span>
  15. <div v-show="btnDisplay" class="buttonBox">
  16. <div type="primary" @click="goToCourse3()">标准创建</div>
  17. <div type="primary" @click="goToCourseSimple()">快速创建</div>
  18. </div>
  19. </button>
  20. </div>
  21. </div>
  22. <div class="reBox">
  23. <div class="reTop">
  24. <!-- <div>分类筛选</div> -->
  25. <div class="reTopCh">
  26. <el-select v-model="groupA" @change="search" v-if="false">
  27. <el-option value="4" label="全部"></el-option>
  28. <el-option value="2" label="我的课程"></el-option>
  29. <el-option value="3" label="协同课程"></el-option>
  30. <el-option value="1" label="他人课程"></el-option>
  31. </el-select>
  32. <el-select v-model="groupA" @change="search" v-if="false">
  33. <el-option value="0" label="全部"></el-option>
  34. <el-option value="2" label="我的课程"></el-option>
  35. <el-option value="3" label="协同课程"></el-option>
  36. </el-select>
  37. <div class="searchI" style="margin: 0;">
  38. <div class="search">
  39. <img src="../../../assets/icon/search.png" alt="" />
  40. </div>
  41. <input class="sInput" type="text" placeholder="请输入关键字" v-model="courseName" @change="getCourse()" @input="getCourse()" />
  42. </div>
  43. <el-button type="primary" class="bgColor" style="margin-left: 10px;" @click="reset">重置</el-button>
  44. </div>
  45. </div>
  46. <div class="pType_box all_choose" v-if="oid == '69893dca-1d47-11ed-8c78-005056b86db5'">
  47. <span><span>类型</span></span>
  48. <el-radio-group v-model="pTypeCheckName" style="display: flex; align-items: center">
  49. <div class="all_choose" style="width: 100px" v-for="(item, index) in CourseType2" :key="index">
  50. <el-radio :label="item.name" @click.native.prevent="CourseType2Click(item.name)">{{ item.name }}</el-radio>
  51. </div>
  52. </el-radio-group>
  53. </div>
  54. <div class="choose">
  55. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
  56. :style="{ margin: !CourseTypeJson[item.id].length && 0 }">
  57. <span v-if="CourseTypeJson[item.id].length &&
  58. (oid == '69893dca-1d47-11ed-8c78-005056b86db5'
  59. ? pTypeCheck.indexOf(item.id) != -1
  60. : true)
  61. "><span>{{ item.name }}</span></span>
  62. <div class="typeCss" v-if="CourseTypeJson[item.id].length &&
  63. (oid == '69893dca-1d47-11ed-8c78-005056b86db5'
  64. ? pTypeCheck.indexOf(item.id) != -1
  65. : true)
  66. ">
  67. <div class="cName" @click="getCourse2(item.name, '', item.id, 1)"
  68. :class="typeE.indexOf(item.id) != -1 ? 'isCType' : ''">
  69. 全部
  70. </div>
  71. <div v-for="(item1, index1) in CourseTypeJson[item.id]" :key="index + '-' + index1" :label="item1.id"
  72. @click="getCourse2(item.name, item.id, item1.id, 2)">
  73. <div class="cName" :class="typea == item1.id || typeb == item1.id || typed == item1.id
  74. ? 'isCType'
  75. : ''
  76. ">
  77. {{ item1.name }}
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="all_choose" v-if="false">
  83. <span><span>所有者</span></span>
  84. <div class="typeCss">
  85. <div class="cName" :class="groupA == '4' ? 'isCType' : ''" @click="groupA = '4'; search();">
  86. 全部
  87. </div>
  88. <div class="cName" :class="groupA == '2' ? 'isCType' : ''" @click="groupA = '2'; search();">
  89. 我的课程
  90. </div>
  91. <div class="cName" :class="groupA == '3' ? 'isCType' : ''" @click="groupA = '3'; search();">
  92. 协同课程
  93. </div>
  94. <div class="cName" :class="groupA == '1' ? 'isCType' : ''" @click="groupA = '1'; search();">
  95. 他人课程
  96. </div>
  97. </div>
  98. </div>
  99. <div class="all_choose" v-if="false">
  100. <span><span>所有者</span></span>
  101. <div class="typeCss">
  102. <div class="cName" :class="groupA == '0' ? 'isCType' : ''" @click="groupA = '0'; search();">
  103. 全部
  104. </div>
  105. <div class="cName" :class="groupA == '2' ? 'isCType' : ''" @click="groupA = '2'; search();">
  106. 我的课程
  107. </div>
  108. <div class="cName" :class="groupA == '3' ? 'isCType' : ''" @click="groupA = '3'; search();">
  109. 协同课程
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="line"></div>
  117. <div class="pb_content_body" style="height: 100%;width: 100%;background: #e6eaf0;margin: 0 auto;">
  118. <div class="student_head" v-if="false">
  119. <div class="choose">
  120. <div class="student_search">
  121. <span>课程筛选</span>
  122. <el-select v-model="groupA" @change="search">
  123. <el-option value="0" label="我的课程"></el-option>
  124. <el-option value="1" label="他人课程"></el-option>
  125. </el-select>
  126. </div>
  127. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index">
  128. <span v-if="CourseTypeJson[item.id].length">{{ item.name }}</span>
  129. <el-select v-if="CourseTypeJson[item.id].length" v-model="courseTypeId[item.id]" placeholder="请选择"
  130. @change="getTypeName">
  131. <el-option label="全部" value="1">全部</el-option>
  132. <el-option v-for="item1 in CourseTypeJson[item.id]" :key="item1.id" :label="item1.name" :value="item1.id">
  133. </el-option>
  134. </el-select>
  135. </div>
  136. <div @click="clear" class="clear">重置</div>
  137. </div>
  138. <div class="student_right">
  139. <div class="head_left">
  140. <el-input v-model="courseName" class="student_input" placeholder="请输入课程名称"></el-input>
  141. <el-button class="course_button" @click="searchCourse">查询</el-button>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="student_table">
  146. <div class="course_box">
  147. <div class="out_box" v-for="(item, index) in course" :key="index">
  148. <div class="myCourse" v-if="item.userid == userid">我的创建</div>
  149. <div class="myCourse" style="background: #4187f0" v-else-if="!item.course_teacher ||
  150. (item.course_teacher &&
  151. item.course_teacher.indexOf(userid) == -1)
  152. ">
  153. 他人创建
  154. </div>
  155. <div class="xtCourse" v-else>协同建构</div>
  156. <div class="tup" @click="open(item.courseId, item.userid)" style="cursor: pointer;">
  157. <img :src="item.cover != null && item.cover != ''
  158. ? JSON.parse(item.cover).length > 0
  159. ? JSON.parse(item.cover)[0].url
  160. : mr
  161. : mr
  162. " alt />
  163. </div>
  164. <div class="bottom_box">
  165. <div>
  166. <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  167. <span>{{ item.title }}</span>
  168. </el-tooltip>
  169. <!-- <span>{{ item.state == 1 ? '阶段模式' : item.state == 2 ? '任务模式' : '极简模式' }}</span> -->
  170. </div>
  171. <!-- <div class="kc_t">
  172. 负责老师:{{ item.uname }}
  173. </div> -->
  174. <div class="kc_time">
  175. <!-- <span style="color: #717C8D">创建日期:</span> -->
  176. {{ item.time }}
  177. </div>
  178. <!-- <div class="kc_time">
  179. <span style="color: #717C8D">修改日期:</span>{{ item.utime }}
  180. </div> -->
  181. </div>
  182. <div class="three_bottom">
  183. <!-- v-if="role == '1'" @click="get(item)"-->
  184. <div @click="open(item.courseId, item.userid)">打开</div>
  185. <!-- <div @click="jump(item.courseId)" v-else>评课</div> -->
  186. <!-- <div v-if="((item.userid == userid) ||
  187. (item.course_teacher &&
  188. item.course_teacher.indexOf(userid) !== -1) || role == '1') &&
  189. item.state == 1
  190. " @click="goToCourse(item.courseId)">
  191. 修改
  192. </div>
  193. <div v-if="((item.userid == userid) ||
  194. (item.course_teacher &&
  195. item.course_teacher.indexOf(userid) !== -1) || role == '1') &&
  196. item.state == 2
  197. " @click="goToCourse2(item.courseId)">
  198. 修改
  199. </div> -->
  200. <!-- ||
  201. (item.course_teacher &&
  202. item.course_teacher.indexOf(userid) !== -1) || role == '1' -->
  203. <div v-if="((item.userid == userid)) &&
  204. item.state == 1
  205. " @click="goToCourse3(item.courseId)">
  206. 修改
  207. </div>
  208. <!-- <div v-if="groupA == '0'" @click="
  209. goTo(
  210. '/works?cid=' +
  211. item.courseId +
  212. '&userid=' +
  213. userid +
  214. '&oid=' +
  215. oid +
  216. '&org=' +
  217. org +
  218. '&role=' +
  219. role
  220. )
  221. ">
  222. 评价
  223. </div> -->
  224. <div v-if="((item.userid == userid))" @click="copyCourse(item.courseId)">
  225. 复制
  226. </div>
  227. <!-- v-if="item.isCourseType == 1 || role == '1'" -->
  228. <div v-if="((item.userid == userid))" @click="deleteCourse(item.courseId)">
  229. 删除
  230. </div>
  231. <!-- <div class="more">
  232. <span style="font-size: 18px; font-weight: 700">...</span>
  233. <div>
  234. <span @click="copyCourse(item.courseId)">复制</span>
  235. <span @click="jump(item.courseId)" v-if="role == '1'">评课</span>
  236. <span @click="get(item.courseId)" v-else>预览</span>
  237. <span @click="getNT(item.courseId)">无终端</span>
  238. </div>
  239. </div> -->
  240. </div>
  241. </div>
  242. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  243. </div>
  244. </div>
  245. </div>
  246. <div class="student_page">
  247. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  248. v-if="page && course.length" style="padding-bottom: 20px" @current-change="handleCurrentChange"></el-pagination>
  249. </div>
  250. <el-dialog :visible.sync="dialogVisible1" size="tiny">
  251. <img width="100%" :src="dialogImageUrl" alt />
  252. </el-dialog>
  253. <el-dialog title="查看协同课程" :visible.sync="dialogVisibleCourse" :append-to-body="true" width="850px"
  254. :before-close="handleClose" class="dialog_diy">
  255. <div class="ct_box">
  256. <div class="out_box" v-for="(item, index) in courseTeam" :key="index" style="margin-left: 15px">
  257. <div class="tup">
  258. <img :src="item.cover != null && item.cover != ''
  259. ? JSON.parse(item.cover).length > 0
  260. ? JSON.parse(item.cover)[0].url
  261. : mr
  262. : mr
  263. " alt />
  264. </div>
  265. <div class="bottom_box">
  266. <div>{{ item.title }}</div>
  267. <div class="kc_t">创建老师:{{ item.uname }}</div>
  268. <div class="kc_time">{{ item.time }}</div>
  269. </div>
  270. <div class="three_bottom">
  271. <div @click="jump(item.courseId)">查看内容</div>
  272. <div @click="
  273. goTo(
  274. '/course/addCourse?cid=' +
  275. item.courseId +
  276. '&userid=' +
  277. userid +
  278. '&oid=' +
  279. oid +
  280. '&org=' +
  281. org
  282. )
  283. ">
  284. 编辑
  285. </div>
  286. </div>
  287. </div>
  288. <div class="course_empty" v-if="courseTeam.length == 0">暂无数据</div>
  289. </div>
  290. <span slot="footer" class="dialog-footer">
  291. <el-button @click="dialogVisibleCourse = false">关 闭</el-button>
  292. </span>
  293. </el-dialog>
  294. </div>
  295. </template>
  296. <script>
  297. import "../../../common/aws-sdk-2.235.1.min";
  298. import EditorBar from "../../../components/tools/wangEnduit";
  299. // import CourseProblem from "./components/courseProblem";
  300. import { myMixin } from "@/mixins/mixin.js"
  301. import backPage from "../liyuan/components/backPage.vue";
  302. export default {
  303. mixins: [ myMixin ],
  304. components: { EditorBar,backPage },
  305. data() {
  306. return {
  307. itemCount: 1,
  308. courseTitle: "",
  309. courseText: "",
  310. courseTime: "",
  311. isLoading: false,
  312. fileList: [],
  313. fileList1: [],
  314. homeworkList: [{ name: "" }],
  315. formLabelWidth: "100px",
  316. dialogVisible: false,
  317. dialogVisible1: false,
  318. dialogVisibleCourse: false,
  319. dialogImageUrl: "",
  320. group: "",
  321. userid: this.$route.query.userid,
  322. oid: this.$route.query.oid,
  323. org: this.$route.query.org,
  324. role: this.$route.query.role,
  325. Juri: "",
  326. groupList: [],
  327. JuriList: [],
  328. page: 1,
  329. total: 0,
  330. pageSize: 20,
  331. tableData: [],
  332. now: "",
  333. courseDetail: {},
  334. addCourse: {},
  335. groupA: "0",
  336. classX: "",
  337. course: [],
  338. courseName: "",
  339. mr: require("../../../assets/icon/kc1.png"),
  340. CourseType: [],
  341. CourseType2: [],
  342. CourseTypeJson: {},
  343. courseTypeId: {},
  344. courseTypeSon: [],
  345. isChoose: 0,
  346. problemCourse: null, //查看提问的课程
  347. courseTeam: [],
  348. typeE: [],
  349. typea: "",
  350. typeb: "",
  351. typed: "",
  352. pTypeCheck: [],
  353. pTypeCheckName: [],
  354. btnDisplay: false
  355. };
  356. },
  357. methods: {
  358. change(val) {
  359. console.log(val);
  360. },
  361. time() {
  362. if (!this.now) {
  363. this.now = new Date().getTime();
  364. return true;
  365. } else {
  366. let time = new Date().getTime();
  367. if (time - this.now > 3000) {
  368. this.now = time;
  369. return true;
  370. } else {
  371. return false;
  372. }
  373. }
  374. },
  375. addHomeworkBox() {
  376. this.homeworkList.push({ name: "" });
  377. this.itemCount++;
  378. },
  379. reduceHomeworkBox() {
  380. var a = this.homeworkList;
  381. a.splice(a.length - 1);
  382. this.itemCount--;
  383. },
  384. goTo(path) {
  385. this.$router.push(path);
  386. },
  387. CourseType2Change(val) {
  388. this.pTypeCheck = [];
  389. for (var i = 0; i < this.CourseType2.length; i++) {
  390. let typeA = this.CourseType2[i];
  391. if (val.indexOf(typeA.name) != -1) {
  392. this.pTypeCheck.push(...typeA.id);
  393. }
  394. }
  395. this.typea = "";
  396. this.typeb = "";
  397. this.typed = "";
  398. this.getCourse();
  399. },
  400. CourseType2Click(val) {
  401. this.pTypeCheck = [];
  402. this.typeE = [];
  403. if (val === this.pTypeCheckName) {
  404. this.pTypeCheckName = "";
  405. } else {
  406. this.pTypeCheckName = val;
  407. for (var i = 0; i < this.CourseType2.length; i++) {
  408. let typeA = this.CourseType2[i];
  409. if (val.indexOf(typeA.name) != -1) {
  410. this.pTypeCheck.push(...typeA.id);
  411. this.typeE = [...typeA.id];
  412. }
  413. }
  414. }
  415. this.typea = "";
  416. this.typeb = "";
  417. this.typed = "";
  418. this.getCourse();
  419. },
  420. goToCourse(courseId) {
  421. if (courseId) {
  422. this.$router.push(
  423. "/course/addCourse?cid=" +
  424. courseId +
  425. "&userid=" +
  426. this.userid +
  427. "&oid=" +
  428. this.oid +
  429. "&org=" +
  430. this.org +
  431. "&role=" +
  432. this.role
  433. );
  434. } else {
  435. this.$router.push(
  436. "/course/addCourse?userid=" +
  437. this.userid +
  438. "&oid=" +
  439. this.oid +
  440. "&org=" +
  441. this.org +
  442. "&role=" +
  443. this.role
  444. );
  445. }
  446. // this.$router.push(path);
  447. },
  448. reset() {
  449. this.typeE = []
  450. this.typea = ''
  451. this.typeb = ''
  452. this.typed = ''
  453. this.courseName = ''
  454. if (this.role == "1") {
  455. this.groupA = "4";
  456. } else {
  457. this.groupA = "0";
  458. }
  459. this.getCourse();
  460. },
  461. goToCourse2(courseId) {
  462. if (courseId) {
  463. this.$router.push(
  464. "/course/addCourseT?cid=" +
  465. courseId +
  466. "&userid=" +
  467. this.userid +
  468. "&oid=" +
  469. this.oid +
  470. "&org=" +
  471. this.org +
  472. "&role=" +
  473. this.role
  474. );
  475. } else {
  476. this.$router.push(
  477. "/course/addCourseT?userid=" +
  478. this.userid +
  479. "&oid=" +
  480. this.oid +
  481. "&org=" +
  482. this.org +
  483. "&role=" +
  484. this.role
  485. );
  486. }
  487. },
  488. goToCourse3(courseId) {
  489. if (courseId) {
  490. this.$router.push(
  491. "/synergyCourse/add?cid=" +
  492. courseId +
  493. "&userid=" +
  494. this.userid +
  495. "&oid=" +
  496. this.oid +
  497. "&org=" +
  498. this.org +
  499. "&role=" +
  500. this.role
  501. );
  502. } else {
  503. this.$router.push(
  504. "/synergyCourse/add?userid=" +
  505. this.userid +
  506. "&oid=" +
  507. this.oid +
  508. "&org=" +
  509. this.org +
  510. "&role=" +
  511. this.role
  512. );
  513. this.addOp3('1', "", { type: "CocoNote_standard_add" }, "success")
  514. }
  515. },
  516. formatDateTime2(timestamp){
  517. const date = new Date(timestamp); // 根据时间戳创建Date对象
  518. const year = date.getFullYear(); // 获取年份
  519. const month = date.getMonth() + 1; // 获取月份,需要加1
  520. const day = date.getDate(); // 获取日期
  521. const formattedDate = `${year}-${this.handlerZero(month)}-${this.handlerZero(day)}`; // 拼接成格式化后的日期字符串
  522. return formattedDate;
  523. },
  524. handlerZero(param){
  525. return param= param<10?('0'+param):param
  526. },
  527. goToCourseSimple(){
  528. let params = [
  529. {
  530. uid: this.userid,
  531. title: window.topU.US.userInfo.username+this.formatDateTime2(new Date().getTime())+"的快速创建",
  532. //title: "黄明浩"+this.formatDateTime2(new Date().getTime())+"的快速创建",
  533. brief: "",
  534. cover:
  535. JSON.stringify([
  536. {
  537. name: "noBanner.jpg",
  538. url: "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/wu1676621845022.png",
  539. uid: 1656409780264,
  540. status: "success",
  541. },
  542. ]),
  543. evaId: "",
  544. astudent:"",
  545. see: 1,
  546. chapters: JSON.stringify([{"dyName":"","chapterInfo":[{"isread":false,"chapterid":"468faf7e-ff3e-c2bf-2829-a78fd5fea04e","title":"","courseName":"","taskJson":[{"task":"","taskDetail":"","chapterData":[],"toolChoose":[{"tool":[],"toolDetail":"","toolType":0,"askCount":1,"askTitle":"","askJson":[{"askstitle":"","askItem":1,"checkList":[]}]}],"toolText":"","isShowTools":false,"askCount":1,"isFold":0,"askTitle":"","askJson":[{"askstitle":"","askItem":1,"checkList":[]}],"checkJson":[{"checkCount":[],"checkPerent":[]}],"homeworkList":[],"proVisible":false,"proVisible2":false}],"itemCount":1,"fileList1":[],"video":[],"testData":[],"pData":[],"templateArray":[]}]}]),
  547. template: "" ,
  548. courseType: JSON.stringify(this.courseTypeId),
  549. ateacher:"",
  550. inviteCode: "[]",
  551. },
  552. ];
  553. this.ajax
  554. .post(this.$store.state.api + "addSynergyCourse", params)
  555. .then((res) => {
  556. console.log(res);
  557. this.$message({
  558. message: "新增成功",
  559. type: "success",
  560. });
  561. this.getCourse();
  562. this.open(res.data.courseId, this.userid)
  563. this.addOp3('1', "", { type: "CocoNote_fast_add" }, "success")
  564. })
  565. .catch((err) => {
  566. this.$message.error("网络不佳");
  567. console.error(err);
  568. this.addOp3('1', "", { type: "CocoNote_fast_add" }, err)
  569. });
  570. },
  571. tableRowClassName({ row, rowIndex }) {
  572. if ((rowIndex + 1) % 2 === 0) {
  573. return "even_row";
  574. } else {
  575. return "";
  576. }
  577. },
  578. open(cid, uid) {
  579. if (uid == this.userid || window.topU.US.userInfo.role==1) {
  580. window.topU.postMessage(
  581. {
  582. tools: "opencCscl",
  583. cid: cid,
  584. gid: '',
  585. },
  586. "*"
  587. );
  588. this.addOp3('1', "", { courseid: cid , type: "CocoNote_open" }, "success")
  589. return;
  590. }
  591. let params = {
  592. cid: cid,
  593. classid: '1',
  594. };
  595. this.ajax
  596. .get(this.$store.state.api + "getCourseGroup", params)
  597. .then((res) => {
  598. if (res.data && res.data[1].length) {
  599. let groupPerson = res.data[1]
  600. let groupCid = ''
  601. for (var i = 0; i < groupPerson.length; i++) {
  602. if (groupPerson[i].userid == this.userid) {
  603. groupCid = groupPerson[i].groupCid
  604. break;
  605. }
  606. }
  607. if (groupCid) {
  608. window.topU.postMessage(
  609. {
  610. tools: "opencCscl",
  611. cid: cid,
  612. gid: groupCid,
  613. },
  614. "*"
  615. );
  616. this.addOp3('1', "", { courseid: cid , type: "CocoNote_open" }, "success")
  617. } else {
  618. this.$message.error("没有加入分组请先加入分组");
  619. this.goToCourse3(cid)
  620. this.addOp3('1', "", { courseid: cid , type: "CocoNote_open" }, '没有加入分组请先加入分组')
  621. // window.topU.postMessage(
  622. // {
  623. // tools: "opencCscl",
  624. // cid: cid,
  625. // gid: '',
  626. // },
  627. // "*"
  628. // );
  629. }
  630. } else {
  631. this.$message.error("没有加入分组请先加入分组");
  632. this.goToCourse3(cid)
  633. this.addOp3('1', "", { courseid: cid , type: "CocoNote_open" }, '没有加入分组请先加入分组')
  634. // window.topU.postMessage(
  635. // {
  636. // tools: "opencCscl",
  637. // cid: cid,
  638. // gid: '',
  639. // },
  640. // "*"
  641. // );
  642. }
  643. })
  644. .catch((err) => {
  645. this.$message.error("网络不佳");
  646. console.error(err);
  647. this.addOp3('1', "", { courseid: cid , type: "CocoNote_open" }, err)
  648. });
  649. },
  650. jump(cid) {
  651. // window.open(
  652. // "//pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=" +
  653. // cid +
  654. // "&userid=" +
  655. // this.userid
  656. // );
  657. window.topU.postMessage({ cid: cid, screenType: "2" }, "*");
  658. },
  659. get(item) {
  660. window.topU.postMessage({ cid: item.courseId, screenType: "3" }, "*");
  661. },
  662. getNT(cid) {
  663. window.topU.postMessage({ cid: cid, screenType: "3NT" }, "*");
  664. },
  665. handle_remove(file, fileList) {
  666. var _tmp = this.fileList;
  667. for (var i = 0, len = _tmp.length; i < len; i++) {
  668. if (_tmp[i].uid == file.uid) {
  669. _tmp.splice(i, 1);
  670. break;
  671. }
  672. this.fileList = _tmp;
  673. }
  674. },
  675. handle_remove1(file, fileList) {
  676. var _tmp = this.fileList1;
  677. for (var i = 0, len = _tmp.length; i < len; i++) {
  678. if (_tmp[i].uid == file.uid) {
  679. _tmp.splice(i, 1);
  680. break;
  681. }
  682. this.fileList1 = _tmp;
  683. }
  684. },
  685. handleCurrentChange(val) {
  686. // console.log(`当前页: ${val}`);
  687. this.page = val;
  688. this.getCourse();
  689. },
  690. init() { },
  691. handleClose(done) {
  692. done();
  693. },
  694. handleRemove(file, fileList) {
  695. console.log(file, fileList);
  696. },
  697. handlePictureCardPreview(file) {
  698. this.dialogImageUrl = file.url;
  699. this.dialogVisible1 = true;
  700. },
  701. onExceed() {
  702. this.$message.error("课程海报仅支持上传一张,请删除后再进行上传");
  703. },
  704. //uuid生成
  705. guid() {
  706. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  707. /[xy]/g,
  708. function (c) {
  709. var r = (Math.random() * 16) | 0,
  710. v = c == "x" ? r : (r & 0x3) | 0x8;
  711. return v.toString(16);
  712. }
  713. );
  714. },
  715. time() {
  716. if (!this.now) {
  717. this.now = new Date().getTime();
  718. return true;
  719. } else {
  720. let time = new Date().getTime();
  721. if (time - this.now > 3000) {
  722. this.now = time;
  723. return true;
  724. } else {
  725. return false;
  726. }
  727. }
  728. },
  729. searchCourse() {
  730. this.page = 1;
  731. this.getCourse();
  732. },
  733. clear() {
  734. for (var i = 0; i < this.CourseType[0].length; i++) {
  735. this.courseTypeId[this.CourseType[0][i].id] = "";
  736. }
  737. this.getCourse();
  738. },
  739. getCourse2(typeName, ftypeId, typeid, type) {
  740. this.page = 1;
  741. if (typeid == "34628934-d02f-11ec-8c78-005056b86db5" || ftypeId == '34628934-d02f-11ec-8c78-005056b86db5' || typeid == "34628934-d02f-11ec-8c78-005056b86ac5" || ftypeId == "34628934-d02f-11ec-8c78-005056b86ac5") {
  742. if (type == 1) {
  743. if (this.typeE.indexOf(typeid) != -1) {
  744. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  745. return;
  746. } else {
  747. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  748. }
  749. } else {
  750. this.typeE.push(typeid);
  751. if (this.typea != "") {
  752. this.typea = "";
  753. }
  754. }
  755. } else {
  756. if (this.typea == typeid) {
  757. this.typea = "";
  758. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  759. this.typeE.push(ftypeId);
  760. }
  761. } else {
  762. this.typea = typeid;
  763. if (this.typeE.indexOf(ftypeId) != -1) {
  764. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  765. }
  766. }
  767. }
  768. } else if (typeName == "专栏") {
  769. if (type == 1) {
  770. if (this.typeE.indexOf(typeid) != -1) {
  771. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  772. return;
  773. } else {
  774. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  775. }
  776. } else {
  777. this.typeE.push(typeid);
  778. if (this.typeb != "") {
  779. this.typeb = "";
  780. }
  781. }
  782. } else {
  783. if (this.typeb == typeid) {
  784. this.typeb = "";
  785. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  786. this.typeE.push(ftypeId);
  787. }
  788. } else {
  789. this.typeb = typeid;
  790. if (this.typeE.indexOf(ftypeId) != -1) {
  791. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  792. }
  793. }
  794. }
  795. } else if (typeName == "栏目") {
  796. if (type == 1) {
  797. if (this.typeE.indexOf(typeid) != -1) {
  798. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  799. return;
  800. } else {
  801. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  802. }
  803. } else {
  804. this.typeE.push(typeid);
  805. if (this.typeb != "") {
  806. this.typeb = "";
  807. }
  808. }
  809. } else {
  810. if (this.typeb == typeid) {
  811. this.typeb = "";
  812. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  813. this.typeE.push(ftypeId);
  814. }
  815. } else {
  816. this.typeb = typeid;
  817. if (this.typeE.indexOf(ftypeId) != -1) {
  818. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  819. }
  820. }
  821. }
  822. } else if (typeid == "34629bcc-d02f-11ec-8c78-005056b86db5" || ftypeId == '34629bcc-d02f-11ec-8c78-005056b86db5') {
  823. if (type == 1) {
  824. if (this.typeE.indexOf(typeid) != -1) {
  825. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  826. return;
  827. } else {
  828. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  829. }
  830. } else {
  831. this.typeE.push(typeid);
  832. if (this.typeb != "") {
  833. this.typeb = "";
  834. }
  835. }
  836. } else {
  837. if (this.typeb == typeid) {
  838. this.typeb = "";
  839. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  840. this.typeE.push(ftypeId);
  841. }
  842. } else {
  843. this.typeb = typeid;
  844. if (this.typeE.indexOf(ftypeId) != -1) {
  845. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  846. }
  847. }
  848. }
  849. } else if (typeName == "学院") {
  850. if (type == 1) {
  851. if (this.typeE.indexOf(typeid) != -1) {
  852. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  853. return;
  854. } else {
  855. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  856. }
  857. } else {
  858. this.typeE.push(typeid);
  859. if (this.typeb != "") {
  860. this.typeb = "";
  861. }
  862. }
  863. } else {
  864. if (this.typeb == typeid) {
  865. this.typeb = "";
  866. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  867. this.typeE.push(ftypeId);
  868. }
  869. } else {
  870. this.typeb = typeid;
  871. if (this.typeE.indexOf(ftypeId) != -1) {
  872. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  873. }
  874. }
  875. }
  876. } else if (typeid == "34629907-d02f-11ec-8c78-005056b86db5" || ftypeId == '34629907-d02f-11ec-8c78-005056b86db5' || typeid == "34629907-d02f-11ec-8c78-005056b86ac5" || ftypeId == "34629907-d02f-11ec-8c78-005056b86ac5") {
  877. if (type == 1) {
  878. if (this.typeE.indexOf(typeid) != -1) {
  879. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  880. return;
  881. } else {
  882. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  883. }
  884. } else {
  885. this.typeE.push(typeid);
  886. if (this.typed != "") {
  887. this.typed = "";
  888. }
  889. }
  890. } else {
  891. if (this.typed == typeid) {
  892. this.typed = "";
  893. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  894. this.typeE.push(ftypeId);
  895. }
  896. } else {
  897. this.typed = typeid;
  898. if (this.typeE.indexOf(ftypeId) != -1) {
  899. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  900. }
  901. }
  902. }
  903. }
  904. // this.loading = true;
  905. this.getCourse();
  906. },
  907. getCourse() {
  908. if (!this.loading) {
  909. this.loading = this.openLoading(
  910. document.querySelector(".student_table")
  911. );
  912. }
  913. // var typeE = [];
  914. // var typea, typeb, typec, typed;
  915. // if (this.isChoose == 1) {
  916. // for (var i = 0; i < this.CourseType[0].length; i++) {
  917. // if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  918. // typeE.push(this.CourseType[0][i].id);
  919. // } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  920. // if (this.CourseType[0][i].name == "年级") {
  921. // typea = this.courseTypeId[this.CourseType[0][i].id];
  922. // } else if (this.CourseType[0][i].name == "专栏") {
  923. // typeb = this.courseTypeId[this.CourseType[0][i].id];
  924. // } else if (this.CourseType[0][i].name == "栏目") {
  925. // typeb = this.courseTypeId[this.CourseType[0][i].id];
  926. // } else if (this.CourseType[0][i].name == "学院") {
  927. // typeb = this.courseTypeId[this.CourseType[0][i].id];
  928. // } else if (this.CourseType[0][i].name == "主题") {
  929. // typeb = this.courseTypeId[this.CourseType[0][i].id];
  930. // } else if (this.CourseType[0][i].name == "新技能") {
  931. // typec = this.courseTypeId[this.CourseType[0][i].id];
  932. // } else if (this.CourseType[0][i].name == "学科") {
  933. // typed = this.courseTypeId[this.CourseType[0][i].id];
  934. // }
  935. // this.courseTypeSon.push(
  936. // this.courseTypeId[this.CourseType[0][i].id]
  937. // );
  938. // }
  939. // }
  940. // }
  941. //console.log("typea", this.typea);
  942. this.isLoading = true;
  943. let params = {
  944. type: this.groupA,
  945. uid: this.userid,
  946. oid: this.oid,
  947. org: this.org,
  948. typea: this.typea != undefined ? this.typea : "",
  949. typeb: this.typeb != undefined ? this.typeb : "",
  950. typec: "",
  951. typed: this.typed != undefined ? this.typed : "",
  952. typeE: this.typeE.join(","),
  953. cu: "",
  954. cn: this.courseName,
  955. page: this.page,
  956. pageSize: this.pageSize,
  957. };
  958. this.ajax
  959. .get(this.$store.state.api + "selectSynergyCourse", params)
  960. .then((res) => {
  961. if (this.loading) {
  962. this.loading.close();
  963. }
  964. this.loading = "";
  965. this.isLoading = false;
  966. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  967. this.course = res.data[0];
  968. })
  969. .catch((err) => {
  970. console.error(err);
  971. });
  972. },
  973. getTypeName() {
  974. this.$forceUpdate();
  975. this.page = 1;
  976. this.isChoose = 1;
  977. this.getCourse();
  978. },
  979. // searchCourse() {
  980. // this.isLoading = true;
  981. // let params = {
  982. // cu: "",
  983. // cn: this.courseName,
  984. // page: this.page,
  985. // };
  986. // this.ajax
  987. // .get(this.$store.state.api + "searchCourse", params)
  988. // .then((res) => {
  989. // this.isLoading = false;
  990. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  991. // this.course = res.data[0];
  992. // })
  993. // .catch((err) => {
  994. // this.isLoading = false;
  995. // console.error(err);
  996. // });
  997. // },
  998. deleteCourse(cid) {
  999. // if (this.time()) {
  1000. this.$confirm("确定删除吗?", "提示", {
  1001. confirmButtonText: "确定",
  1002. cancelButtonText: "取消",
  1003. type: "warning",
  1004. })
  1005. .then(() => {
  1006. const loading = this.openLoading(
  1007. document.querySelector(".student_table")
  1008. );
  1009. this.isLoading = true;
  1010. let params = {
  1011. cid: cid,
  1012. };
  1013. this.ajax
  1014. .get(this.$store.state.api + "deleteSynergyCourse", params)
  1015. .then((res) => {
  1016. loading.close();
  1017. this.isLoading = false;
  1018. this.$message.success("删除成功");
  1019. this.getCourse();
  1020. })
  1021. .catch((err) => {
  1022. console.error(err);
  1023. });
  1024. })
  1025. .catch(() => {
  1026. loading.close();
  1027. this.isLoading = false;
  1028. return;
  1029. });
  1030. // }
  1031. },
  1032. selectAllType() {
  1033. let params = {
  1034. org: this.org && this.org != "" ? this.org : "",
  1035. oid: this.oid && this.oid != "" ? this.oid : "",
  1036. stand: "cn"
  1037. };
  1038. this.ajax
  1039. .get(this.$store.state.api + "selectAllTypeStand", params)
  1040. .then((res) => {
  1041. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  1042. res.data[0] = [...res.data[0], ...res.data[4]]
  1043. }
  1044. this.CourseType = res.data;
  1045. this.CourseType2 = [
  1046. { name: "智见课程", id: [] },
  1047. { name: "智行课程", id: [] },
  1048. { name: "智创课程", id: [] },
  1049. ];
  1050. for (var cti = 0; cti < res.data[0].length; cti++) {
  1051. if (
  1052. res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86db5" ||
  1053. res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86db5"
  1054. ) {
  1055. this.CourseType2[0].id.push(res.data[0][cti].id);
  1056. } else if (res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86ac5" ||
  1057. res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86ac5") {
  1058. this.CourseType2[1].id.push(res.data[0][cti].id);
  1059. } else if (res.data[0][cti].id == "34629bcc-d02f-11ec-8c78-005056b86db5") {
  1060. this.CourseType2[2].id.push(res.data[0][cti].id);
  1061. }
  1062. if (res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86ac5") {
  1063. res.data[0][cti].name = "年级";
  1064. } else if (res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86ac5") {
  1065. res.data[0][cti].name = "学科";
  1066. } else if (res.data[0][cti].id == "34629bcc-d02f-11ec-8c78-005056b86db5") {
  1067. res.data[0][cti].name = "主题";
  1068. }
  1069. }
  1070. for (var i = 0; i < res.data[0].length; i++) {
  1071. if (!this.cid) {
  1072. this.courseTypeId[res.data[0][i].id] = [];
  1073. }
  1074. if (!this.CourseTypeJson[res.data[0][i].id]) {
  1075. this.CourseTypeJson[res.data[0][i].id] = [];
  1076. }
  1077. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  1078. if (res.data[0][i].name == "栏目") {
  1079. this.CourseType[0][i].name = "主题";
  1080. }
  1081. }
  1082. if (res.data[2].length == 0 && res.data[3].length == 0) {
  1083. for (var j = 0; j < res.data[1].length; j++) {
  1084. if (res.data[0][i].id == res.data[1][j].pid) {
  1085. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  1086. }
  1087. }
  1088. } else {
  1089. if (res.data[2].length > 0) {
  1090. for (var j = 0; j < res.data[2].length; j++) {
  1091. if (res.data[0][i].id == res.data[2][j].pid) {
  1092. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  1093. }
  1094. }
  1095. }
  1096. if (res.data[3].length > 0) {
  1097. for (var j = 0; j < res.data[3].length; j++) {
  1098. if (res.data[0][i].id == res.data[3][j].pid) {
  1099. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  1100. }
  1101. }
  1102. }
  1103. }
  1104. }
  1105. })
  1106. .catch((err) => {
  1107. console.error(err);
  1108. });
  1109. },
  1110. selectType() {
  1111. this.ajax
  1112. .get(this.$store.state.api + "selectType")
  1113. .then((res) => {
  1114. this.CourseType = res.data;
  1115. for (var i = 0; i < res.data[0].length; i++) {
  1116. if (!this.cid) {
  1117. this.courseTypeId[res.data[0][i].id] = "";
  1118. }
  1119. // if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  1120. // if (res.data[0][i].name == "栏目") {
  1121. // this.CourseType[0][i].name = "主题";
  1122. // }
  1123. // }
  1124. for (var j = 0; j < res.data[1].length; j++) {
  1125. if (res.data[0][i].id == res.data[1][j].pid) {
  1126. if (!this.CourseTypeJson[res.data[0][i].id]) {
  1127. this.CourseTypeJson[res.data[0][i].id] = [];
  1128. }
  1129. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); //去除公共分类
  1130. }
  1131. }
  1132. }
  1133. this.selectTypeByOid();
  1134. this.selectTypeByOrg();
  1135. })
  1136. .catch((err) => {
  1137. console.error(err);
  1138. });
  1139. },
  1140. selectTypeByOid() {
  1141. let params = {
  1142. oid: this.oid,
  1143. };
  1144. this.ajax
  1145. .get(this.$store.state.api + "selectTypeByOid", params)
  1146. .then((res) => {
  1147. for (var i = 0; i < res.data[0].length; i++) {
  1148. for (var j = 0; j < res.data[1].length; j++) {
  1149. if (res.data[0][i].id == res.data[1][j].pid) {
  1150. if (!this.CourseTypeJson[res.data[0][i].id]) {
  1151. this.CourseTypeJson[res.data[0][i].id] = [];
  1152. }
  1153. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  1154. }
  1155. }
  1156. }
  1157. this.$forceUpdate();
  1158. })
  1159. .catch((err) => {
  1160. console.error(err);
  1161. });
  1162. },
  1163. selectTypeByOrg() {
  1164. let params = {
  1165. oid: this.org,
  1166. };
  1167. this.ajax
  1168. .get(this.$store.state.api + "selectTypeByOrg", params)
  1169. .then((res) => {
  1170. for (var i = 0; i < res.data[0].length; i++) {
  1171. for (var j = 0; j < res.data[1].length; j++) {
  1172. if (res.data[0][i].id == res.data[1][j].pid) {
  1173. if (!this.CourseTypeJson[res.data[0][i].id]) {
  1174. this.CourseTypeJson[res.data[0][i].id] = [];
  1175. }
  1176. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  1177. }
  1178. }
  1179. }
  1180. this.$forceUpdate();
  1181. })
  1182. .catch((err) => {
  1183. console.error(err);
  1184. });
  1185. },
  1186. openCourse() {
  1187. this.dialogVisibleCourse = true;
  1188. this.getTeamCourse();
  1189. },
  1190. getTeamCourse() {
  1191. // let params = {
  1192. // uid: this.userid,
  1193. // oid: this.oid,
  1194. // };
  1195. // this.ajax
  1196. // .get(this.$store.state.api + "selectCourseTeam", params)
  1197. // .then((res) => {
  1198. // this.courseTeam = res.data[0];
  1199. // })
  1200. // .catch((err) => {
  1201. // console.error(err);
  1202. // });
  1203. },
  1204. search() {
  1205. this.page = 1;
  1206. this.getCourse();
  1207. },
  1208. checkProblem(res) {
  1209. this.problemCourse = res;
  1210. this.dialogVisible = true;
  1211. },
  1212. copyCourse(cid) {
  1213. let params = [
  1214. {
  1215. cid: cid,
  1216. uid: this.userid,
  1217. },
  1218. ];
  1219. this.ajax
  1220. .post(this.$store.state.api + "copySynergyCourse", params)
  1221. .then((res) => {
  1222. this.page = 1;
  1223. if (this.role == "1") {
  1224. this.groupA = "4";
  1225. } else {
  1226. this.groupA = "0";
  1227. }
  1228. this.$message.success("复制成功")
  1229. this.clear();
  1230. })
  1231. .catch((err) => {
  1232. console.error(err);
  1233. });
  1234. },
  1235. },
  1236. created() {
  1237. if (this.role == "1") {
  1238. this.groupA = "4";
  1239. }
  1240. this.page = 1;
  1241. // this.selectType();
  1242. this.selectAllType();
  1243. this.getCourse();
  1244. },
  1245. };
  1246. </script>
  1247. <style scoped>
  1248. @media screen and (max-width: 1380px) {
  1249. .out_box {
  1250. width: calc(100% / 4 - (15px * 3) / 4) !important;
  1251. }
  1252. .out_box:nth-child(5n) {
  1253. margin-right: 15px !important;
  1254. }
  1255. .out_box:nth-child(4n) {
  1256. margin-right: 0 !important;
  1257. }
  1258. }
  1259. @media screen and (max-width: 1080px) {
  1260. .out_box {
  1261. width: calc(100% / 3 - (15px * 2) / 3) !important;
  1262. }
  1263. .out_box:nth-child(5n) {
  1264. margin-right: 15px !important;
  1265. }
  1266. .out_box:nth-child(4n) {
  1267. margin-right: 15px !important;
  1268. }
  1269. .out_box:nth-child(3n) {
  1270. margin-right: 0 !important;
  1271. }
  1272. }
  1273. .dialog_diy>>>.el-dialog__header {
  1274. background: #3d67bc !important;
  1275. padding: 15px 20px;
  1276. }
  1277. .dialog_diy>>>.el-dialog__title {
  1278. color: #fff;
  1279. }
  1280. .dialog_diy>>>.el-dialog__headerbtn {
  1281. top: 19px;
  1282. }
  1283. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  1284. color: #fff;
  1285. }
  1286. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  1287. color: #fff;
  1288. }
  1289. .student_head>>>.el-button--primary {
  1290. background-color: #2268bc;
  1291. }
  1292. .xls_button {
  1293. font-size: 14px;
  1294. cursor: pointer;
  1295. text-decoration: underline;
  1296. color: rgb(34, 104, 188);
  1297. }
  1298. .student_head {
  1299. display: flex;
  1300. justify-content: space-between;
  1301. align-items: baseline;
  1302. flex-direction: row;
  1303. flex-wrap: wrap;
  1304. }
  1305. .top {
  1306. display: flex;
  1307. justify-content: space-between;
  1308. width: 100% !important;
  1309. box-sizing: border-box;
  1310. margin: 0px auto;
  1311. padding: 10px 5px;
  1312. height: 54px;
  1313. }
  1314. .bgColor {
  1315. background: #466b99;
  1316. }
  1317. .student_search {
  1318. display: flex;
  1319. align-items: center;
  1320. width: calc(100% / 3);
  1321. }
  1322. .student_search span {
  1323. margin: 0 10px 0 0;
  1324. min-width: 65px;
  1325. }
  1326. .student_button {
  1327. display: flex;
  1328. /* overflow: hidden; */
  1329. height: 40px;
  1330. position: relative;
  1331. }
  1332. .upload-demo {
  1333. display: flex;
  1334. flex-direction: column;
  1335. align-items: end;
  1336. /* position: relative; */
  1337. width: 100px;
  1338. overflow: hidden;
  1339. }
  1340. .student_table {
  1341. /* padding: 20px 0; */
  1342. height: 100%;
  1343. /* overflow: auto; */
  1344. min-height: 360px;
  1345. }
  1346. .student_empty {
  1347. display: flex;
  1348. justify-content: center;
  1349. align-items: center;
  1350. }
  1351. .el-table>>>.even_row {
  1352. background-color: #f1f1f1;
  1353. }
  1354. .time {
  1355. font-size: 13px;
  1356. color: #999;
  1357. }
  1358. .course_button {
  1359. padding: 10px 20px;
  1360. }
  1361. .course_button_box {
  1362. display: flex;
  1363. margin-top: 5px;
  1364. justify-content: space-between;
  1365. }
  1366. .course_rate {
  1367. margin-top: 5px;
  1368. }
  1369. .course_view {
  1370. display: flex;
  1371. align-items: center;
  1372. margin: 5px 0 0 0;
  1373. }
  1374. .course_view i {
  1375. background-image: url("../../../assets/liulan.png");
  1376. width: 25px;
  1377. height: 25px;
  1378. background-size: 100% 100%;
  1379. /* margin-top: 1px; */
  1380. line-height: 25px;
  1381. vertical-align: text-top;
  1382. background-repeat: no-repeat;
  1383. }
  1384. .image {
  1385. width: 100%;
  1386. height: 150px;
  1387. display: block;
  1388. }
  1389. .course_box {
  1390. display: flex;
  1391. flex-wrap: wrap;
  1392. }
  1393. .student_page {
  1394. width: 100%;
  1395. margin: 0 auto;
  1396. background: #e6eaf0;
  1397. }
  1398. .course_create_box {
  1399. font-size: 18px;
  1400. }
  1401. .course_name {
  1402. margin-top: 10px;
  1403. }
  1404. .course_name span {
  1405. margin-bottom: 10px;
  1406. display: block;
  1407. }
  1408. .homework_box {
  1409. display: flex;
  1410. align-items: center;
  1411. flex-wrap: wrap;
  1412. }
  1413. .course_homework {
  1414. width: 130px;
  1415. display: flex;
  1416. justify-content: center;
  1417. flex-direction: column;
  1418. align-items: center;
  1419. margin: 0 10px 10px 0;
  1420. }
  1421. .course_type {
  1422. margin-top: 10px;
  1423. display: flex;
  1424. }
  1425. .course_type1 span {
  1426. margin-bottom: 10px;
  1427. display: block;
  1428. }
  1429. .course_type2 {
  1430. margin-left: 20px;
  1431. }
  1432. .course_type2 span {
  1433. margin-bottom: 10px;
  1434. display: block;
  1435. }
  1436. .course_empty {
  1437. color: rgb(110, 110, 110);
  1438. width: 100%;
  1439. height: 100%;
  1440. display: flex;
  1441. align-items: center;
  1442. justify-content: center;
  1443. }
  1444. .el_cards>>>.el-card__body {
  1445. height: 100%;
  1446. }
  1447. .courseBtnBox {
  1448. display: flex;
  1449. flex-direction: column;
  1450. justify-content: space-between;
  1451. height: calc(100% - 170px);
  1452. padding: 10px;
  1453. }
  1454. .wordUpload {
  1455. display: flex;
  1456. }
  1457. .wordUpload>.buttonUp {
  1458. margin-right: 5px;
  1459. }
  1460. .out_box {
  1461. display: flex;
  1462. flex-direction: column;
  1463. flex-wrap: nowrap;
  1464. width: calc(100% / 5 - (15px * 4) / 5);
  1465. /* width: 280px; */
  1466. background: #fff;
  1467. margin-right: 15px;
  1468. /* border: 1px solid #ccc; */
  1469. height: fit-content;
  1470. box-sizing: border-box;
  1471. border-radius: 0px 0px 5px 5px;
  1472. /* overflow: hidden; */
  1473. margin-bottom: 15px;
  1474. position: relative;
  1475. border-radius: 8px;
  1476. box-sizing: border-box;
  1477. overflow: hidden;
  1478. border: 1px solid #3682fc00;
  1479. }
  1480. .out_box:hover {
  1481. border: 1px solid #3681FC;
  1482. }
  1483. .out_box:nth-child(5n) {
  1484. margin-right: 0;
  1485. }
  1486. .bottom_box {
  1487. display: flex;
  1488. padding: 10px;
  1489. flex-direction: column;
  1490. box-sizing: border-box;
  1491. /* height: 121px; */
  1492. flex-wrap: nowrap;
  1493. justify-content: space-evenly;
  1494. }
  1495. .bottom_box>div:nth-child(1) {
  1496. width: 100%;
  1497. /* overflow: hidden;
  1498. text-overflow: ellipsis;
  1499. white-space: nowrap;
  1500. font-weight: bold; */
  1501. display: flex;
  1502. align-items: center;
  1503. justify-content: space-between;
  1504. }
  1505. .bottom_box>div:nth-child(1)>span:nth-child(1) {
  1506. max-width: 100%;
  1507. overflow: hidden;
  1508. text-overflow: ellipsis;
  1509. white-space: nowrap;
  1510. font-weight: bold;
  1511. font-size: 16px;
  1512. }
  1513. .bottom_box>div:nth-child(1)>span:nth-child(2) {
  1514. min-width: fit-content;
  1515. font-size: 14px;
  1516. color: #8c8c8c;
  1517. }
  1518. .tup {
  1519. width: 100%;
  1520. height: 180px;
  1521. margin: 0 auto;
  1522. overflow: hidden;
  1523. display: flex;
  1524. align-items: center;
  1525. padding: 10px 10px 0;
  1526. box-sizing: border-box;
  1527. }
  1528. .tup>img {
  1529. width: 100%;
  1530. height: 100%;
  1531. object-fit: cover;
  1532. }
  1533. .kc_time {
  1534. margin-top: 8px;
  1535. font-size: 14px;
  1536. color: #717C8D;
  1537. }
  1538. .kc_time+.kc_time {
  1539. margin-top: 0;
  1540. }
  1541. .kc_t {
  1542. margin-top: 5px;
  1543. width: 100%;
  1544. white-space: nowrap;
  1545. overflow: hidden;
  1546. text-overflow: ellipsis;
  1547. }
  1548. .three_bottom {
  1549. display: flex;
  1550. flex-direction: row;
  1551. justify-content: space-around;
  1552. height: 45px;
  1553. align-items: center;
  1554. background: #fff;
  1555. font-size: 14px;
  1556. border-top: 1px solid #ddd;
  1557. box-sizing: border-box;
  1558. }
  1559. .three_bottom>div {
  1560. cursor: pointer;
  1561. width: 100%;
  1562. text-align: center;
  1563. }
  1564. .three_bottom>div+div {
  1565. border-left: 1px solid #ddd;
  1566. }
  1567. .three_bottom>div:hover {
  1568. color: #3681FC;
  1569. font-weight: bold;
  1570. }
  1571. .three_bottom .deleteB {
  1572. color: #E96E6E;
  1573. }
  1574. .three_bottom .deleteB:hover {
  1575. color: #E96E6E;
  1576. font-weight: bold;
  1577. }
  1578. .head_left {
  1579. display: flex;
  1580. }
  1581. .student_input>>>.el-input__inner {
  1582. height: 40px;
  1583. width: 190px;
  1584. font-size: 13px;
  1585. padding: 0 10px;
  1586. }
  1587. .course_button {
  1588. color: #fff;
  1589. background: #2268bc;
  1590. width: 75px;
  1591. height: 40px;
  1592. padding: 0 !important;
  1593. font-size: 12px;
  1594. line-height: 40px;
  1595. }
  1596. /* .all_choose {
  1597. margin: 15px 0 10px;
  1598. height: 20%;
  1599. display: flex;
  1600. flex-direction: row;
  1601. align-items: center;
  1602. max-width: calc(100% / 3);
  1603. }
  1604. .all_choose > span {
  1605. width: 50px;
  1606. display: block;
  1607. }
  1608. .choose {
  1609. display: flex;
  1610. flex-direction: row;
  1611. flex-wrap: wrap;
  1612. align-content: space-between;
  1613. height: 100%;
  1614. justify-content: flex-start;
  1615. width: 60%;
  1616. min-width: 868px;
  1617. align-items: center;
  1618. } */
  1619. /* .choose > div:nth-child(2) {
  1620. margin-left: 1%;
  1621. width: 32.33333%;
  1622. }
  1623. .choose > div:nth-child(4) {
  1624. margin-right: 1%;
  1625. width: 32.33333%;
  1626. }
  1627. .choose > div:nth-child(5) {
  1628. margin: 5px 0 0 1%;
  1629. }
  1630. .choose > div:nth-child(4) > span {
  1631. width: 74px !important;
  1632. min-width: 74px;
  1633. }
  1634. .choose > div:nth-child(4) >>> .el-select {
  1635. width: 217.5px;
  1636. min-width: 215.06px;
  1637. } */
  1638. .clear {
  1639. width: 70px;
  1640. height: 35px;
  1641. background: #2268bc;
  1642. color: #fff;
  1643. text-align: center;
  1644. border-radius: 5px;
  1645. line-height: 35px;
  1646. cursor: pointer;
  1647. margin-left: 20px;
  1648. }
  1649. .ct_box {
  1650. height: 500px;
  1651. overflow: auto;
  1652. display: flex;
  1653. flex-wrap: wrap;
  1654. }
  1655. .myCourse {
  1656. position: absolute;
  1657. background: #3c3c3c;
  1658. width: 70px;
  1659. height: 30px;
  1660. border-radius: 5px;
  1661. color: #fff;
  1662. font-size: 14px;
  1663. text-align: center;
  1664. line-height: 30px;
  1665. top: 5px;
  1666. left: 5px;
  1667. }
  1668. .xtCourse {
  1669. position: absolute;
  1670. background: #466b99;
  1671. width: 70px;
  1672. height: 30px;
  1673. border-radius: 5px;
  1674. color: #fff;
  1675. font-size: 14px;
  1676. text-align: center;
  1677. line-height: 30px;
  1678. top: 5px;
  1679. left: 5px;
  1680. }
  1681. .sub_head {
  1682. position: relative;
  1683. }
  1684. .sub_head::after {
  1685. content: "";
  1686. width: 100%;
  1687. background: #5a9cea;
  1688. height: 2px;
  1689. position: absolute;
  1690. left: 0;
  1691. bottom: -10px;
  1692. }
  1693. .subClick {
  1694. /* font-size: 16px; */
  1695. font-size: 26px;
  1696. cursor: pointer;
  1697. margin-left: 17.5px;
  1698. /* color: #ab582f; */
  1699. /* color: #409eff; */
  1700. color: #999;
  1701. }
  1702. .subClick:hover {
  1703. color: #000;
  1704. }
  1705. .more {
  1706. position: relative;
  1707. }
  1708. .more:hover div {
  1709. display: block;
  1710. color: #000;
  1711. }
  1712. .more div {
  1713. position: absolute;
  1714. bottom: 0px;
  1715. transform: translate(-50%, 100%);
  1716. background: #f5f4f4;
  1717. padding: 10px 20px;
  1718. z-index: 99;
  1719. width: 50px;
  1720. border-radius: 5px;
  1721. box-shadow: 0 0 3px 3px #80808020;
  1722. display: none;
  1723. }
  1724. .more div>span+span {
  1725. margin-top: 10px;
  1726. }
  1727. .more div>span {
  1728. display: block;
  1729. width: 100%;
  1730. text-align: center;
  1731. }
  1732. .more div>span:hover {
  1733. color: #79a2ff;
  1734. }
  1735. .line {
  1736. width: 100%;
  1737. height: 15px;
  1738. background: #e6eaf0;
  1739. }
  1740. .reBox {
  1741. width: 100%;
  1742. /* padding-left: 20px; */
  1743. margin: 0 auto;
  1744. box-sizing: border-box;
  1745. overflow: hidden;
  1746. padding: 10px 15px 0;
  1747. }
  1748. .reTop {
  1749. padding: 0 0 5px;
  1750. /* padding: 20px 0 0 0; */
  1751. /* border-bottom: 1px solid #eee; */
  1752. display: flex;
  1753. flex-direction: row;
  1754. flex-wrap: nowrap;
  1755. align-items: center;
  1756. justify-content: space-between;
  1757. }
  1758. .reTop>div:nth-child(1) {
  1759. font-weight: bold;
  1760. /* width: 40px; */
  1761. /* border-bottom: 1px solid #205cc6; */
  1762. /* padding-bottom: 20px; */
  1763. color: #205cc6;
  1764. /* font-size: 20px; */
  1765. }
  1766. .reTop .reTopCh {
  1767. display: flex;
  1768. }
  1769. .reTop .searchI {
  1770. display: flex;
  1771. flex-direction: row;
  1772. align-items: center;
  1773. border: 1px solid #ccced3;
  1774. width: 250px;
  1775. border-radius: 8px;
  1776. padding: 5px 0;
  1777. /* margin-bottom: 10px; */
  1778. background: #fafafa;
  1779. margin: 0 0 0 10px;
  1780. }
  1781. .search {
  1782. width: 20px;
  1783. padding: 0 5px;
  1784. display: flex;
  1785. align-items: center;
  1786. }
  1787. .search>img {
  1788. width: 100%;
  1789. height: 100%;
  1790. }
  1791. .sInput {
  1792. border: none;
  1793. width: 85%;
  1794. background: #fafafa;
  1795. }
  1796. .sInput:focus-visible {
  1797. outline: none;
  1798. }
  1799. .typeCss {
  1800. display: flex;
  1801. flex-direction: row;
  1802. flex-wrap: wrap;
  1803. justify-content: flex-start;
  1804. align-items: center;
  1805. }
  1806. .choose {
  1807. display: flex;
  1808. flex-direction: column;
  1809. flex-wrap: nowrap;
  1810. height: 100%;
  1811. justify-content: space-evenly;
  1812. align-items: flex-start;
  1813. padding: 10px 0;
  1814. }
  1815. .all_choose {
  1816. display: flex;
  1817. flex-direction: row;
  1818. align-items: baseline;
  1819. margin: 2px 0;
  1820. width: 100%;
  1821. }
  1822. .all_choose>span {
  1823. display: flex;
  1824. margin-right: 5px;
  1825. }
  1826. .all_choose>span>span {
  1827. min-width: 65px;
  1828. max-width: 65px;
  1829. display: block;
  1830. text-align-last: justify;
  1831. }
  1832. .all_choose>span::after {
  1833. content: ':';
  1834. }
  1835. .all_choose>span:nth-child(1) {
  1836. font-weight: bold;
  1837. }
  1838. .all_choose>>>.el-checkbox-group {
  1839. display: flex;
  1840. flex-direction: row;
  1841. width: 820px;
  1842. flex-wrap: wrap;
  1843. align-content: center;
  1844. justify-content: flex-start;
  1845. align-items: center;
  1846. margin-top: 3px;
  1847. }
  1848. .all_choose>.el-checkbox-group>>>.el-checkbox {
  1849. margin-bottom: 10px;
  1850. display: flex;
  1851. flex-direction: row;
  1852. align-items: center;
  1853. }
  1854. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label {
  1855. min-width: 80px;
  1856. overflow: hidden;
  1857. width: 80px;
  1858. text-overflow: ellipsis;
  1859. white-space: nowrap;
  1860. }
  1861. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label:hover {
  1862. width: auto;
  1863. }
  1864. .cName {
  1865. cursor: pointer;
  1866. margin: 0 10px 5px 0;
  1867. color: #b9b6b9;
  1868. min-width: 80px;
  1869. width: 80px;
  1870. white-space: nowrap;
  1871. overflow: hidden;
  1872. text-overflow: ellipsis;
  1873. }
  1874. .isCType {
  1875. color: #6282c2;
  1876. }
  1877. .pType_box {
  1878. margin-top: 0;
  1879. }
  1880. .pType_box>>>.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
  1881. -webkit-box-shadow: none !important;
  1882. box-shadow: none !important;
  1883. }
  1884. .buttonBox {
  1885. position: absolute;
  1886. bottom: -0;
  1887. transform: translateY(100%);
  1888. background: #fff;
  1889. border-radius: 5px;
  1890. box-shadow: 0 0 3px 1px #e3e3e3;
  1891. width: 100%;
  1892. font-size: 16px;
  1893. }
  1894. .buttonBox>div {
  1895. height: 40px;
  1896. line-height: 40px;
  1897. width: 100%;
  1898. text-align: center;
  1899. color: #000;
  1900. box-sizing: border-box;
  1901. }
  1902. .buttonBox>div+div {
  1903. border-top: 1px solid #e0e0e0;
  1904. }
  1905. .buttonBox>div:hover {
  1906. background: #f6f8ff;
  1907. }
  1908. </style>