course.vue 57 KB

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