course.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  1. <template>
  2. <div class="pb_content" style="height: auto">
  3. <div class="pb_head top">
  4. <div>
  5. <span>{{ orgArray.indexOf(org) != -1 || oidArray.indexOf(oid) != -1 ? "师生项目" : "项目管理" }}</span>
  6. <!-- <span class="subClick" @click="
  7. goTo('/works?userid=' + userid + '&oid=' + oid + '&org=' + org)
  8. ">评价管理</span> -->
  9. </div>
  10. <div class="student_button">
  11. <!-- <el-button type="primary" class="bgColor" @click="openCourse">协同编辑</el-button> -->
  12. <el-button type="primary" class="bgColor" @click="goToCourse()">添加项目</el-button>
  13. </div>
  14. </div>
  15. <div class="pb_content_body" style="height: 100%">
  16. <div class="student_head">
  17. <div class="choose">
  18. <!-- <div class="student_search">
  19. <span>项目筛选</span>
  20. <el-select v-model="groupA" @change="search">
  21. <el-option value="0" label="我的项目"></el-option>
  22. <el-option value="1" label="他人项目"></el-option>
  23. </el-select>
  24. </div> -->
  25. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index">
  26. <span v-if="CourseTypeJson[item.id].length">{{ item.name }}</span>
  27. <el-select v-if="CourseTypeJson[item.id].length" v-model="courseTypeId[item.id]" placeholder="请选择" @change="getTypeName">
  28. <el-option label="全部" value="1">全部</el-option>
  29. <el-option v-for="item1 in CourseTypeJson[item.id]" :key="item1.id" :label="item1.name" :value="item1.id">
  30. </el-option>
  31. </el-select>
  32. </div>
  33. <div @click="clear" class="clear" v-if="CourseType.length">重置</div>
  34. </div>
  35. <div class="student_right">
  36. <div class="head_left">
  37. <el-input v-model="courseName" class="student_input" placeholder="请输入项目名称"></el-input>
  38. <el-button class="course_button" @click="searchCourse">查询</el-button>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="student_table" v-loading="isLoading">
  43. <div class="course_box">
  44. <div class="out_box" v-for="(item, index) in course" :key="index">
  45. <div class="myCourse" v-if="item.isCourseType == 1 && groupA == 0">
  46. 我的项目
  47. </div>
  48. <div class="myCourse" style="background:#4187f0" v-else-if="groupA == 1">
  49. 他人项目
  50. </div>
  51. <div class="xtCourse" v-else>协同项目</div>
  52. <div class="tup">
  53. <img :src="
  54. item.cover != null && item.cover != ''
  55. ? JSON.parse(item.cover).length > 0
  56. ? JSON.parse(item.cover)[0].url
  57. : mr
  58. : mr
  59. " alt />
  60. </div>
  61. <!-- <div class="bottom_box">
  62. <div>{{ item.title }}</div>
  63. <div class="kc_t" v-if="groupA == '1'">
  64. 创建老师:{{ item.uname }}
  65. </div>
  66. <div class="kc_time">{{ item.time }}</div>
  67. </div> -->
  68. <div class="bottom_box">
  69. <div>{{ item.title }}</div>
  70. <div class="kc_t" v-if="item.isCourseType == 2 || groupA == 1">
  71. 负责人:{{ item.uname }}
  72. </div>
  73. <div class="kc_time">
  74. <span style="color: #4b4b4b">创建日期:</span>{{ item.time }}
  75. </div>
  76. <div class="kc_time">
  77. <span style="color: #4b4b4b">修改日期:</span>{{ item.utime }}
  78. </div>
  79. </div>
  80. <div class="three_bottom">
  81. <div @click="goToCourse2(item.courseId)">编辑</div>
  82. <div @click="get(item.courseId)">预览</div>
  83. <!-- 项目进展 -->
  84. <div @click="getA(item.courseId)">进展</div>
  85. <div @click="jump(item.courseId)">评论</div>
  86. <!-- <div v-if="groupA == '0'" @click="
  87. goTo(
  88. '/works?cid=' +
  89. item.courseId +
  90. '&userid=' +
  91. userid +
  92. '&oid=' +
  93. oid +
  94. '&org=' +
  95. org
  96. )
  97. ">
  98. 报告
  99. </div> -->
  100. <div v-if="(item.isCourseType == 1)" @click="deleteCourse(item.courseId)">
  101. 删除
  102. </div>
  103. <!-- <div class="more">
  104. <span style="font-size:18px;font-weight:700">...</span>
  105. <div>
  106. <span @click="copyCourse(item.courseId)">复制</span>
  107. <span @click="get(item.courseId)">查看</span>
  108. </div>
  109. </div> -->
  110. </div>
  111. </div>
  112. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="student_page">
  117. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total" v-if="page && course.length"
  118. style="padding-bottom: 20px" @current-change="handleCurrentChange"></el-pagination>
  119. </div>
  120. <el-dialog :visible.sync="dialogVisible1" size="tiny">
  121. <img width="100%" :src="dialogImageUrl" alt />
  122. </el-dialog>
  123. <el-dialog title="查看提问" :visible.sync="dialogVisible" :append-to-body="true" width="750px" :before-close="handleClose"
  124. class="dialog_diy">
  125. <div>
  126. <div class="a_addBox">
  127. <CourseProblem :problemCourse="problemCourse"></CourseProblem>
  128. </div>
  129. </div>
  130. <span slot="footer" class="dialog-footer">
  131. <el-button @click="dialogVisible = false">关 闭</el-button>
  132. </span>
  133. </el-dialog>
  134. <el-dialog title="查看协同项目" :visible.sync="dialogVisibleCourse" :append-to-body="true" width="850px"
  135. :before-close="handleClose" class="dialog_diy">
  136. <div class="ct_box">
  137. <div class="out_box" v-for="(item, index) in courseTeam" :key="index" style="margin-left: 15px">
  138. <div class="tup">
  139. <img :src="
  140. item.cover != null && item.cover != ''
  141. ? JSON.parse(item.cover).length > 0
  142. ? JSON.parse(item.cover)[0].url
  143. : mr
  144. : mr
  145. " alt />
  146. </div>
  147. <div class="bottom_box">
  148. <div>{{ item.title }}</div>
  149. <div class="kc_t">创建人:{{ item.uname }}</div>
  150. <div class="kc_time">{{ item.time }}</div>
  151. </div>
  152. <div class="three_bottom">
  153. <div @click="get(item.courseId)">查看内容</div>
  154. <div @click="getA(item.courseId)">项目进展</div>
  155. <div @click="
  156. goTo(
  157. '/studentAddCourse?cid=' +
  158. item.courseId +
  159. '&userid=' +
  160. userid +
  161. '&oid=' +
  162. oid +
  163. '&org=' +
  164. org
  165. )
  166. ">
  167. 编辑
  168. </div>
  169. </div>
  170. </div>
  171. <div class="course_empty" v-if="courseTeam.length == 0">暂无数据</div>
  172. </div>
  173. <span slot="footer" class="dialog-footer">
  174. <el-button @click="dialogVisibleCourse = false">关 闭</el-button>
  175. </span>
  176. </el-dialog>
  177. </div>
  178. </template>
  179. <script>
  180. import "../../../common/aws-sdk-2.235.1.min";
  181. import EditorBar from "../../../components/tools/wangEnduit";
  182. import CourseProblem from "../components/courseProblem";
  183. export default {
  184. components: { EditorBar, CourseProblem },
  185. data() {
  186. return {
  187. itemCount: 1,
  188. courseTitle: "",
  189. courseText: "",
  190. courseTime: "",
  191. isLoading: false,
  192. fileList: [],
  193. fileList1: [],
  194. homeworkList: [{ name: "" }],
  195. formLabelWidth: "100px",
  196. dialogVisible: false,
  197. dialogVisible1: false,
  198. dialogVisibleCourse: false,
  199. dialogImageUrl: "",
  200. group: "",
  201. userid: this.$route.query.userid,
  202. oid: this.$route.query.oid,
  203. org: this.$route.query.org,
  204. orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
  205. oidArray: [],
  206. Juri: "",
  207. groupList: [],
  208. JuriList: [],
  209. page: 1,
  210. total: 0,
  211. pageSize: 20,
  212. tableData: [],
  213. now: "",
  214. courseDetail: {},
  215. addCourse: {},
  216. groupA: "0",
  217. classX: "",
  218. course: [],
  219. courseName: "",
  220. mr: require("../../../assets/icon/kc1.png"),
  221. CourseType: [],
  222. CourseTypeJson: {},
  223. courseTypeId: {},
  224. courseTypeSon: [],
  225. isChoose: 0,
  226. problemCourse: null, //查看提问的项目
  227. courseTeam: [],
  228. };
  229. },
  230. methods: {
  231. change(val) {
  232. console.log(val);
  233. },
  234. time() {
  235. if (!this.now) {
  236. this.now = new Date().getTime();
  237. return true;
  238. } else {
  239. let time = new Date().getTime();
  240. if (time - this.now > 3000) {
  241. this.now = time;
  242. return true;
  243. } else {
  244. return false;
  245. }
  246. }
  247. },
  248. addHomeworkBox() {
  249. this.homeworkList.push({ name: "" });
  250. this.itemCount++;
  251. },
  252. reduceHomeworkBox() {
  253. var a = this.homeworkList;
  254. a.splice(a.length - 1);
  255. this.itemCount--;
  256. },
  257. goTo(path) {
  258. this.$router.push(path);
  259. },
  260. goToCourse(courseId) {
  261. if (courseId) {
  262. this.$router.push(
  263. "/studentAddCourse?cid=" +
  264. courseId +
  265. "&userid=" +
  266. this.userid +
  267. "&oid=" +
  268. this.oid +
  269. "&org=" +
  270. this.org
  271. );
  272. } else {
  273. this.$router.push(
  274. "/studentAddCourse?userid=" +
  275. this.userid +
  276. "&oid=" +
  277. this.oid +
  278. "&org=" +
  279. this.org
  280. );
  281. }
  282. // this.$router.push(path);
  283. },
  284. goToCourse2(cid) {
  285. this.$router.push(
  286. "/studentAddCourse?cid=" +
  287. cid +
  288. "&userid=" +
  289. this.userid +
  290. "&oid=" +
  291. this.oid +
  292. "&org=" +
  293. this.org +
  294. "&type=2"
  295. );
  296. },
  297. tableRowClassName({ row, rowIndex }) {
  298. if ((rowIndex + 1) % 2 === 0) {
  299. return "even_row";
  300. } else {
  301. return "";
  302. }
  303. },
  304. jump(cid) {
  305. // window.open(
  306. // "//pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=" +
  307. // cid +
  308. // "&userid=" +
  309. // this.userid
  310. // );
  311. window.parent.postMessage({ cid: cid, screenType: "2s" }, "*");
  312. },
  313. get(cid) {
  314. window.parent.postMessage({ cid: cid, screenType: "3s" }, "*");
  315. },
  316. getA(cid) {
  317. this.$router.push("/courseProgress?cid=" + cid + "&userid=" +
  318. this.userid +
  319. "&oid=" +
  320. this.oid +
  321. "&org=" +
  322. this.org)
  323. },
  324. handle_remove(file, fileList) {
  325. var _tmp = this.fileList;
  326. for (var i = 0, len = _tmp.length; i < len; i++) {
  327. if (_tmp[i].uid == file.uid) {
  328. _tmp.splice(i, 1);
  329. break;
  330. }
  331. this.fileList = _tmp;
  332. }
  333. },
  334. handle_remove1(file, fileList) {
  335. var _tmp = this.fileList1;
  336. for (var i = 0, len = _tmp.length; i < len; i++) {
  337. if (_tmp[i].uid == file.uid) {
  338. _tmp.splice(i, 1);
  339. break;
  340. }
  341. this.fileList1 = _tmp;
  342. }
  343. },
  344. handleCurrentChange(val) {
  345. // console.log(`当前页: ${val}`);
  346. this.page = val;
  347. this.getCourse();
  348. },
  349. init() { },
  350. handleClose(done) {
  351. done();
  352. },
  353. handleRemove(file, fileList) {
  354. console.log(file, fileList);
  355. },
  356. handlePictureCardPreview(file) {
  357. this.dialogImageUrl = file.url;
  358. this.dialogVisible1 = true;
  359. },
  360. onExceed() {
  361. this.$message.error("项目海报仅支持上传一张,请删除后再进行上传");
  362. },
  363. //uuid生成
  364. guid() {
  365. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  366. /[xy]/g,
  367. function (c) {
  368. var r = (Math.random() * 16) | 0,
  369. v = c == "x" ? r : (r & 0x3) | 0x8;
  370. return v.toString(16);
  371. }
  372. );
  373. },
  374. time() {
  375. if (!this.now) {
  376. this.now = new Date().getTime();
  377. return true;
  378. } else {
  379. let time = new Date().getTime();
  380. if (time - this.now > 3000) {
  381. this.now = time;
  382. return true;
  383. } else {
  384. return false;
  385. }
  386. }
  387. },
  388. searchCourse() {
  389. this.page = 1;
  390. this.getCourse();
  391. },
  392. clear() {
  393. for (var i = 0; i < this.CourseType[0].length; i++) {
  394. this.courseTypeId[this.CourseType[0][i].id] = "";
  395. }
  396. this.getCourse();
  397. },
  398. getCourse() {
  399. var typeE = [];
  400. var typea, typeb, typec, typed, typef;
  401. if (this.isChoose == 1) {
  402. for (var i = 0; i < this.CourseType[0].length; i++) {
  403. if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  404. typeE.push(this.CourseType[0][i].id);
  405. } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  406. if (this.CourseType[0][i].name == "年级") {
  407. typea = this.courseTypeId[this.CourseType[0][i].id];
  408. } else if (this.CourseType[0][i].name == "专栏") {
  409. typeb = this.courseTypeId[this.CourseType[0][i].id];
  410. } else if (this.CourseType[0][i].name == "栏目") {
  411. typeb = this.courseTypeId[this.CourseType[0][i].id];
  412. } else if (this.CourseType[0][i].name == "学院") {
  413. typeb = this.courseTypeId[this.CourseType[0][i].id];
  414. } else if (this.CourseType[0][i].name == "新技能") {
  415. typec = this.courseTypeId[this.CourseType[0][i].id];
  416. } else if (this.CourseType[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  417. typed = this.courseTypeId[this.CourseType[0][i].id];
  418. } else if (this.CourseType[0][i].name == "项目类型") {
  419. typed = this.courseTypeId[this.CourseType[0][i].id];
  420. } else if (this.CourseType[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5") {
  421. typef = this.courseTypeId[this.CourseType[0][i].id];
  422. }
  423. this.courseTypeSon.push(
  424. this.courseTypeId[this.CourseType[0][i].id]
  425. );
  426. }
  427. }
  428. }
  429. this.isLoading = true;
  430. let params = {
  431. type: this.groupA,
  432. uid: this.userid,
  433. oid: this.oid,
  434. org: this.org,
  435. typea: typea != undefined ? typea : "",
  436. typeb: typeb != undefined ? typeb : "",
  437. typec: typec != undefined ? typec : "",
  438. typed: typed != undefined ? typed : "",
  439. typef: typef != undefined ? typef : "",
  440. typeE: typeE.join(","),
  441. cu: "",
  442. cn: this.courseName,
  443. page: this.page,
  444. pageSize:this.pageSize,
  445. };
  446. this.ajax
  447. .get(this.$store.state.api + "selectStudentCourseNew22", params)
  448. .then((res) => {
  449. this.isLoading = false;
  450. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  451. this.course = res.data[0];
  452. })
  453. .catch((err) => {
  454. console.error(err);
  455. });
  456. },
  457. getTypeName() {
  458. this.$forceUpdate();
  459. this.page = 1;
  460. this.isChoose = 1;
  461. this.getCourse();
  462. },
  463. // searchCourse() {
  464. // this.isLoading = true;
  465. // let params = {
  466. // cu: "",
  467. // cn: this.courseName,
  468. // page: this.page,
  469. // };
  470. // this.ajax
  471. // .get(this.$store.state.api + "searchCourse", params)
  472. // .then((res) => {
  473. // this.isLoading = false;
  474. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  475. // this.course = res.data[0];
  476. // })
  477. // .catch((err) => {
  478. // this.isLoading = false;
  479. // console.error(err);
  480. // });
  481. // },
  482. deleteCourse(cid) {
  483. // if (this.time()) {
  484. this.$confirm("确定删除此项目吗?", "提示", {
  485. confirmButtonText: "确定",
  486. cancelButtonText: "取消",
  487. type: "warning",
  488. })
  489. .then(() => {
  490. this.isLoading = true;
  491. let params = {
  492. cid: cid,
  493. };
  494. this.ajax
  495. .get(this.$store.state.api + "deleteStudentCourse", params)
  496. .then((res) => {
  497. this.isLoading = false;
  498. this.$message.success("删除成功");
  499. if (this.tableData.length == 1 && this.page > 1) {
  500. this.page--
  501. }
  502. this.getCourse();
  503. })
  504. .catch((err) => {
  505. console.error(err);
  506. });
  507. })
  508. .catch(() => {
  509. loading.close();
  510. this.isLoading = false;
  511. return;
  512. });
  513. // }
  514. },
  515. selectAllType() {
  516. let params = {
  517. org: this.org && this.org != "" ? this.org : "",
  518. oid: this.oid && this.oid != "" ? this.oid : "",
  519. };
  520. this.ajax
  521. .get(this.$store.state.api + "selectAllTypeS", params)
  522. .then((res) => {
  523. this.CourseType = res.data;
  524. for (var i = 0; i < res.data[0].length; i++) {
  525. if(res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5"){
  526. res.data[0][i].name = "赛道";
  527. }else if(res.data[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5"){
  528. res.data[0][i].name = "主题";
  529. }
  530. if (!this.cid) {
  531. this.courseTypeId[res.data[0][i].id] = '';
  532. }
  533. if (!this.CourseTypeJson[res.data[0][i].id]) {
  534. this.CourseTypeJson[res.data[0][i].id] = [];
  535. }
  536. if (this.oid == "1c3b9def-8fbe-11ed-b13d-005056b86db5") {
  537. if (res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  538. this.CourseType[0][i].name = "项目类型";
  539. }
  540. }
  541. if (res.data[2].length == 0 && res.data[3].length == 0) {
  542. if(this.org == '150e3120-9195-11ed-b13d-005056b86db5'){
  543. for (var j = 0; j < res.data[1].length; j++) {
  544. if (res.data[0][i].id == res.data[1][j].pid) {
  545. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  546. }
  547. }
  548. }else{
  549. this.CourseType = []
  550. }
  551. } else {
  552. if (res.data[2].length > 0) {
  553. for (var j = 0; j < res.data[2].length; j++) {
  554. if (res.data[0][i].id == res.data[2][j].pid) {
  555. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  556. }
  557. }
  558. }
  559. if (res.data[3].length > 0) {
  560. for (var j = 0; j < res.data[3].length; j++) {
  561. if (res.data[0][i].id == res.data[3][j].pid) {
  562. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  563. }
  564. }
  565. }
  566. }
  567. }
  568. })
  569. .catch((err) => {
  570. console.error(err);
  571. });
  572. },
  573. selectType() {
  574. this.ajax
  575. .get(this.$store.state.api + "selectStudentType")
  576. .then((res) => {
  577. this.CourseType = res.data;
  578. for (var i = 0; i < res.data[0].length; i++) {
  579. if (!this.cid) {
  580. this.courseTypeId[res.data[0][i].id] = "";
  581. }
  582. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  583. if (res.data[0][i].name == "栏目") {
  584. this.CourseType[0][i].name = "主题";
  585. }
  586. }
  587. for (var j = 0; j < res.data[1].length; j++) {
  588. if (res.data[0][i].id == res.data[1][j].pid) {
  589. if (!this.CourseTypeJson[res.data[0][i].id]) {
  590. this.CourseTypeJson[res.data[0][i].id] = [];
  591. }
  592. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); //去除公共分类
  593. }
  594. }
  595. }
  596. this.selectTypeByOid();
  597. this.selectTypeByOrg();
  598. })
  599. .catch((err) => {
  600. console.error(err);
  601. });
  602. },
  603. selectTypeByOid() {
  604. let params = {
  605. oid: this.oid,
  606. };
  607. this.ajax
  608. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  609. .then((res) => {
  610. for (var i = 0; i < res.data[0].length; i++) {
  611. for (var j = 0; j < res.data[1].length; j++) {
  612. if (res.data[0][i].id == res.data[1][j].pid) {
  613. if (!this.CourseTypeJson[res.data[0][i].id]) {
  614. this.CourseTypeJson[res.data[0][i].id] = [];
  615. }
  616. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  617. }
  618. }
  619. }
  620. this.$forceUpdate();
  621. })
  622. .catch((err) => {
  623. console.error(err);
  624. });
  625. },
  626. selectTypeByOrg() {
  627. let params = {
  628. oid: this.org,
  629. };
  630. this.ajax
  631. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  632. .then((res) => {
  633. for (var i = 0; i < res.data[0].length; i++) {
  634. for (var j = 0; j < res.data[1].length; j++) {
  635. if (res.data[0][i].id == res.data[1][j].pid) {
  636. if (!this.CourseTypeJson[res.data[0][i].id]) {
  637. this.CourseTypeJson[res.data[0][i].id] = [];
  638. }
  639. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  640. }
  641. }
  642. }
  643. this.$forceUpdate();
  644. })
  645. .catch((err) => {
  646. console.error(err);
  647. });
  648. },
  649. openCourse() {
  650. this.dialogVisibleCourse = true;
  651. this.getTeamCourse();
  652. },
  653. getTeamCourse() {
  654. let params = {
  655. uid: this.userid,
  656. oid: this.oid,
  657. };
  658. this.ajax
  659. .get(this.$store.state.api + "selectCourseTeam", params)
  660. .then((res) => {
  661. this.courseTeam = res.data[0];
  662. })
  663. .catch((err) => {
  664. console.error(err);
  665. });
  666. },
  667. search() {
  668. this.page = 1;
  669. this.getCourse();
  670. },
  671. checkProblem(res) {
  672. this.problemCourse = res;
  673. this.dialogVisible = true;
  674. },
  675. copyCourse(cid) {
  676. let params = [{
  677. cid: cid,
  678. uid: this.userid
  679. }]
  680. this.ajax
  681. .post(this.$store.state.api + "copyCourse", params)
  682. .then((res) => {
  683. this.page = 1
  684. this.groupA = '0'
  685. this.clear()
  686. })
  687. .catch((err) => {
  688. console.error(err);
  689. });
  690. }
  691. },
  692. created() {
  693. this.page = 1;
  694. this.selectAllType();
  695. this.getCourse();
  696. },
  697. };
  698. </script>
  699. <style scoped>
  700. .dialog_diy>>>.el-dialog__header {
  701. background: #3d67bc !important;
  702. padding: 15px 20px;
  703. }
  704. .dialog_diy>>>.el-dialog__title {
  705. color: #fff;
  706. }
  707. .dialog_diy>>>.el-dialog__headerbtn {
  708. top: 19px;
  709. }
  710. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  711. color: #fff;
  712. }
  713. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  714. color: #fff;
  715. }
  716. .student_head>>>.el-button--primary {
  717. background-color: #2268bc;
  718. }
  719. .xls_button {
  720. font-size: 14px;
  721. cursor: pointer;
  722. text-decoration: underline;
  723. color: rgb(34, 104, 188);
  724. }
  725. .student_head {
  726. display: flex;
  727. justify-content: space-between;
  728. align-items: baseline;
  729. flex-direction: row;
  730. flex-wrap: wrap;
  731. }
  732. .top {
  733. display: flex;
  734. justify-content: space-between;
  735. }
  736. .bgColor {
  737. background: #466b99;
  738. }
  739. .student_search {
  740. display: flex;
  741. align-items: center;
  742. width: calc(100% / 3);
  743. }
  744. .student_search span {
  745. margin: 0 10px 0 0;
  746. min-width: 65px;
  747. }
  748. .student_button {
  749. display: flex;
  750. overflow: hidden;
  751. height: 40px;
  752. }
  753. .upload-demo {
  754. display: flex;
  755. flex-direction: column;
  756. align-items: end;
  757. /* position: relative; */
  758. width: 100px;
  759. overflow: hidden;
  760. }
  761. .student_table {
  762. padding: 20px 0;
  763. height: 100%;
  764. /* overflow: auto; */
  765. min-height: 360px;
  766. }
  767. .student_empty {
  768. display: flex;
  769. justify-content: center;
  770. align-items: center;
  771. }
  772. .el-table>>>.even_row {
  773. background-color: #f1f1f1;
  774. }
  775. .time {
  776. font-size: 13px;
  777. color: #999;
  778. }
  779. .course_button {
  780. padding: 10px 20px;
  781. }
  782. .course_button_box {
  783. display: flex;
  784. margin-top: 5px;
  785. justify-content: space-between;
  786. }
  787. .course_rate {
  788. margin-top: 5px;
  789. }
  790. .course_view {
  791. display: flex;
  792. align-items: center;
  793. margin: 5px 0 0 0;
  794. }
  795. .course_view i {
  796. background-image: url("../../../assets/liulan.png");
  797. width: 25px;
  798. height: 25px;
  799. background-size: 100% 100%;
  800. /* margin-top: 1px; */
  801. line-height: 25px;
  802. vertical-align: text-top;
  803. background-repeat: no-repeat;
  804. }
  805. .image {
  806. width: 100%;
  807. height: 150px;
  808. display: block;
  809. }
  810. .course_box {
  811. display: flex;
  812. flex-wrap: wrap;
  813. }
  814. .student_page {
  815. width: 95%;
  816. margin: 0 auto;
  817. }
  818. .course_create_box {
  819. font-size: 18px;
  820. }
  821. .course_name {
  822. margin-top: 10px;
  823. }
  824. .course_name span {
  825. margin-bottom: 10px;
  826. display: block;
  827. }
  828. .homework_box {
  829. display: flex;
  830. align-items: center;
  831. flex-wrap: wrap;
  832. }
  833. .course_homework {
  834. width: 130px;
  835. display: flex;
  836. justify-content: center;
  837. flex-direction: column;
  838. align-items: center;
  839. margin: 0 10px 10px 0;
  840. }
  841. .course_type {
  842. margin-top: 10px;
  843. display: flex;
  844. }
  845. .course_type1 span {
  846. margin-bottom: 10px;
  847. display: block;
  848. }
  849. .course_type2 {
  850. margin-left: 20px;
  851. }
  852. .course_type2 span {
  853. margin-bottom: 10px;
  854. display: block;
  855. }
  856. .course_empty {
  857. color: rgb(110, 110, 110);
  858. width: 100%;
  859. height: 100%;
  860. display: flex;
  861. align-items: center;
  862. justify-content: center;
  863. }
  864. .el_cards>>>.el-card__body {
  865. height: 100%;
  866. }
  867. .courseBtnBox {
  868. display: flex;
  869. flex-direction: column;
  870. justify-content: space-between;
  871. height: calc(100% - 170px);
  872. padding: 10px;
  873. }
  874. .wordUpload {
  875. display: flex;
  876. }
  877. .wordUpload>.buttonUp {
  878. margin-right: 5px;
  879. }
  880. .out_box {
  881. display: flex;
  882. flex-direction: column;
  883. flex-wrap: nowrap;
  884. width: 250px;
  885. background: #fff;
  886. margin-right: 25px;
  887. border: 1px solid #ccc;
  888. height: fit-content;
  889. box-sizing: border-box;
  890. border-radius: 0px 0px 5px 5px;
  891. /* overflow: hidden; */
  892. margin-bottom: 15px;
  893. position: relative;
  894. }
  895. .bottom_box {
  896. display: flex;
  897. padding: 10px 0 10px 10px;
  898. flex-direction: column;
  899. box-sizing: border-box;
  900. height: 140px;
  901. flex-wrap: nowrap;
  902. justify-content: space-evenly;
  903. }
  904. .bottom_box>div:nth-child(1) {
  905. width: 230px;
  906. overflow: hidden;
  907. text-overflow: ellipsis;
  908. white-space: nowrap;
  909. }
  910. .tup {
  911. width: 100%;
  912. height: 141.06px;
  913. margin: 0 auto;
  914. overflow: hidden;
  915. display: flex;
  916. align-items: center;
  917. }
  918. .tup>img {
  919. width: 100%;
  920. height: 100%;
  921. object-fit: contain;
  922. }
  923. .kc_time {
  924. margin-top: 8px;
  925. font-size: 14px;
  926. color: #999;
  927. }
  928. .kc_t {
  929. margin-top: 5px;
  930. width: 100%;
  931. white-space: nowrap;
  932. overflow: hidden;
  933. text-overflow: ellipsis;
  934. }
  935. .three_bottom {
  936. display: flex;
  937. flex-direction: row;
  938. justify-content: space-around;
  939. height: 40px;
  940. align-items: center;
  941. background: #f5f4f4;
  942. font-size: 14px;
  943. }
  944. .three_bottom>div {
  945. cursor: pointer;
  946. }
  947. .three_bottom>div:hover {
  948. color: #79a2ff;
  949. }
  950. .head_left {
  951. display: flex;
  952. }
  953. .student_input>>>.el-input__inner {
  954. height: 40px;
  955. width: 190px;
  956. font-size: 13px;
  957. padding: 0 10px;
  958. }
  959. .course_button {
  960. color: #fff;
  961. background: #2268bc;
  962. width: 75px;
  963. height: 40px;
  964. padding: 0 !important;
  965. font-size: 12px;
  966. line-height: 40px;
  967. }
  968. .all_choose {
  969. margin: 15px 0 10px;
  970. height: 20%;
  971. display: flex;
  972. flex-direction: row;
  973. align-items: center;
  974. max-width: calc(100% / 3 - 50px);
  975. }
  976. .all_choose>span {
  977. min-width: 75px;
  978. display: block;
  979. margin-right: 10px;
  980. text-align-last: justify;
  981. }
  982. .choose {
  983. display: flex;
  984. flex-direction: row;
  985. flex-wrap: wrap;
  986. align-content: space-between;
  987. height: 100%;
  988. justify-content: flex-start;
  989. width: 60%;
  990. min-width: 868px;
  991. align-items: center;
  992. }
  993. .choose>div:nth-child(2) {
  994. margin-left: 1%;
  995. width: 32.33333%;
  996. }
  997. /* .choose>div:nth-child(4) {
  998. margin-right: 1%;
  999. width: 32.33333%;
  1000. } */
  1001. .choose>div:nth-child(5) {
  1002. margin: 5px 0 0 1%;
  1003. }
  1004. .choose>div:nth-child(4)>span {
  1005. /* width: 74px !important;
  1006. min-width: 74px; */
  1007. }
  1008. .choose>div:nth-child(4)>>>.el-select {
  1009. /* width: 217.5px;
  1010. min-width: 215.06px; */
  1011. }
  1012. .clear {
  1013. width: 70px;
  1014. height: 35px;
  1015. background: #2268bc;
  1016. color: #fff;
  1017. text-align: center;
  1018. border-radius: 5px;
  1019. line-height: 35px;
  1020. cursor: pointer;
  1021. margin-left: 20px;
  1022. }
  1023. .ct_box {
  1024. height: 500px;
  1025. overflow: auto;
  1026. display: flex;
  1027. flex-wrap: wrap;
  1028. }
  1029. .myCourse {
  1030. position: absolute;
  1031. background: #3c3c3c;
  1032. width: 70px;
  1033. height: 30px;
  1034. border-radius: 30px;
  1035. color: #fff;
  1036. font-size: 14px;
  1037. text-align: center;
  1038. line-height: 30px;
  1039. top: 5px;
  1040. left: 5px;
  1041. }
  1042. .xtCourse {
  1043. position: absolute;
  1044. background: #41a5f0;
  1045. width: 70px;
  1046. height: 30px;
  1047. border-radius: 30px;
  1048. color: #fff;
  1049. font-size: 14px;
  1050. text-align: center;
  1051. line-height: 30px;
  1052. top: 5px;
  1053. left: 5px;
  1054. }
  1055. .subClick {
  1056. font-size: 16px;
  1057. cursor: pointer;
  1058. margin-left: 10px;
  1059. /* color: #ab582f; */
  1060. color: #409eff;
  1061. }
  1062. .more {
  1063. position: relative;
  1064. }
  1065. .more:hover div {
  1066. display: block;
  1067. color: #000;
  1068. }
  1069. .more div {
  1070. position: absolute;
  1071. bottom: 0px;
  1072. transform: translate(-50%, 100%);
  1073. background: #f5f4f4;
  1074. padding: 10px 20px;
  1075. z-index: 99;
  1076. width: 40px;
  1077. border-radius: 5px;
  1078. box-shadow: 0 0 3px 3px #80808020;
  1079. display: none;
  1080. }
  1081. .more div>span+span {
  1082. margin-top: 10px;
  1083. }
  1084. .more div>span {
  1085. display: block;
  1086. width: 100%;
  1087. text-align: center;
  1088. }
  1089. .more div>span:hover {
  1090. color: #79a2ff;
  1091. }
  1092. </style>