course.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174
  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="All" value="1">All</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. if(this.CourseType.length){
  394. for (var i = 0; i < this.CourseType[0].length; i++) {
  395. this.courseTypeId[this.CourseType[0][i].id] = "";
  396. }
  397. }
  398. this.getCourse();
  399. },
  400. getCourse() {
  401. var typeE = [];
  402. var typea, typeb, typec, typed, typef;
  403. if (this.isChoose == 1) {
  404. for (var i = 0; i < this.CourseType[0].length; i++) {
  405. if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  406. typeE.push(this.CourseType[0][i].id);
  407. } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  408. if (this.CourseType[0][i].name == "年级") {
  409. typea = 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. typeb = this.courseTypeId[this.CourseType[0][i].id];
  416. } else if (this.CourseType[0][i].name == "新技能") {
  417. typec = this.courseTypeId[this.CourseType[0][i].id];
  418. } else if (this.CourseType[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  419. typed = this.courseTypeId[this.CourseType[0][i].id];
  420. } else if (this.CourseType[0][i].name == "项目类型") {
  421. typed = this.courseTypeId[this.CourseType[0][i].id];
  422. } else if (this.CourseType[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5") {
  423. typef = this.courseTypeId[this.CourseType[0][i].id];
  424. }
  425. this.courseTypeSon.push(
  426. this.courseTypeId[this.CourseType[0][i].id]
  427. );
  428. }
  429. }
  430. }
  431. this.isLoading = true;
  432. let params = {
  433. type: this.groupA,
  434. uid: this.userid,
  435. oid: this.oid,
  436. org: this.org,
  437. typea: typea != undefined ? typea : "",
  438. typeb: typeb != undefined ? typeb : "",
  439. typec: typec != undefined ? typec : "",
  440. typed: typed != undefined ? typed : "",
  441. typef: typef != undefined ? typef : "",
  442. typeE: typeE.join(","),
  443. cu: "",
  444. cn: this.courseName,
  445. page: this.page,
  446. pageSize:this.pageSize,
  447. };
  448. this.ajax
  449. .get(this.$store.state.api + "selectStudentCourseNew22", params)
  450. .then((res) => {
  451. this.isLoading = false;
  452. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  453. this.course = res.data[0];
  454. })
  455. .catch((err) => {
  456. console.error(err);
  457. });
  458. },
  459. getTypeName() {
  460. this.$forceUpdate();
  461. this.page = 1;
  462. this.isChoose = 1;
  463. this.getCourse();
  464. },
  465. // searchCourse() {
  466. // this.isLoading = true;
  467. // let params = {
  468. // cu: "",
  469. // cn: this.courseName,
  470. // page: this.page,
  471. // };
  472. // this.ajax
  473. // .get(this.$store.state.api + "searchCourse", params)
  474. // .then((res) => {
  475. // this.isLoading = false;
  476. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  477. // this.course = res.data[0];
  478. // })
  479. // .catch((err) => {
  480. // this.isLoading = false;
  481. // console.error(err);
  482. // });
  483. // },
  484. deleteCourse(cid) {
  485. // if (this.time()) {
  486. this.$confirm("确定删除此项目吗?", "Notification", {
  487. confirmButtonText: "Save",
  488. cancelButtonText: "Cancel",
  489. type: "warning",
  490. })
  491. .then(() => {
  492. this.isLoading = true;
  493. let params = {
  494. cid: cid,
  495. };
  496. this.ajax
  497. .get(this.$store.state.api + "deleteStudentCourse", params)
  498. .then((res) => {
  499. this.isLoading = false;
  500. this.$message.success("删除成功");
  501. if (this.tableData.length == 1 && this.page > 1) {
  502. this.page--
  503. }
  504. this.getCourse();
  505. })
  506. .catch((err) => {
  507. console.error(err);
  508. });
  509. })
  510. .catch(() => {
  511. loading.close();
  512. this.isLoading = false;
  513. return;
  514. });
  515. // }
  516. },
  517. selectAllType() {
  518. let params = {
  519. org: this.org && this.org != "" ? this.org : "",
  520. oid: this.oid && this.oid != "" ? this.oid : "",
  521. };
  522. this.ajax
  523. .get(this.$store.state.api + "selectAllTypeS", params)
  524. .then((res) => {
  525. this.CourseType = res.data;
  526. for (var i = 0; i < res.data[0].length; i++) {
  527. if(res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5"){
  528. res.data[0][i].name = "赛道";
  529. }else if(res.data[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5"){
  530. res.data[0][i].name = "主题";
  531. }
  532. if (!this.cid) {
  533. this.courseTypeId[res.data[0][i].id] = '';
  534. }
  535. if (!this.CourseTypeJson[res.data[0][i].id]) {
  536. this.CourseTypeJson[res.data[0][i].id] = [];
  537. }
  538. if (this.oid == "1c3b9def-8fbe-11ed-b13d-005056b86db5") {
  539. if (res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  540. this.CourseType[0][i].name = "项目类型";
  541. }
  542. }
  543. if (res.data[2].length == 0 && res.data[3].length == 0) {
  544. if(this.org == '150e3120-9195-11ed-b13d-005056b86db5'){
  545. for (var j = 0; j < res.data[1].length; j++) {
  546. if (res.data[0][i].id == res.data[1][j].pid) {
  547. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  548. }
  549. }
  550. }else{
  551. this.CourseType = []
  552. }
  553. } else {
  554. if (res.data[2].length > 0) {
  555. for (var j = 0; j < res.data[2].length; j++) {
  556. if (res.data[0][i].id == res.data[2][j].pid) {
  557. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  558. }
  559. }
  560. }
  561. if (res.data[3].length > 0) {
  562. for (var j = 0; j < res.data[3].length; j++) {
  563. if (res.data[0][i].id == res.data[3][j].pid) {
  564. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  565. }
  566. }
  567. }
  568. }
  569. }
  570. })
  571. .catch((err) => {
  572. console.error(err);
  573. });
  574. },
  575. selectType() {
  576. this.ajax
  577. .get(this.$store.state.api + "selectStudentType")
  578. .then((res) => {
  579. this.CourseType = res.data;
  580. for (var i = 0; i < res.data[0].length; i++) {
  581. if (!this.cid) {
  582. this.courseTypeId[res.data[0][i].id] = "";
  583. }
  584. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  585. if (res.data[0][i].name == "栏目") {
  586. this.CourseType[0][i].name = "主题";
  587. }
  588. }
  589. for (var j = 0; j < res.data[1].length; j++) {
  590. if (res.data[0][i].id == res.data[1][j].pid) {
  591. if (!this.CourseTypeJson[res.data[0][i].id]) {
  592. this.CourseTypeJson[res.data[0][i].id] = [];
  593. }
  594. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); //去除公共分类
  595. }
  596. }
  597. }
  598. this.selectTypeByOid();
  599. this.selectTypeByOrg();
  600. })
  601. .catch((err) => {
  602. console.error(err);
  603. });
  604. },
  605. selectTypeByOid() {
  606. let params = {
  607. oid: this.oid,
  608. };
  609. this.ajax
  610. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  611. .then((res) => {
  612. for (var i = 0; i < res.data[0].length; i++) {
  613. for (var j = 0; j < res.data[1].length; j++) {
  614. if (res.data[0][i].id == res.data[1][j].pid) {
  615. if (!this.CourseTypeJson[res.data[0][i].id]) {
  616. this.CourseTypeJson[res.data[0][i].id] = [];
  617. }
  618. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  619. }
  620. }
  621. }
  622. this.$forceUpdate();
  623. })
  624. .catch((err) => {
  625. console.error(err);
  626. });
  627. },
  628. selectTypeByOrg() {
  629. let params = {
  630. oid: this.org,
  631. };
  632. this.ajax
  633. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  634. .then((res) => {
  635. for (var i = 0; i < res.data[0].length; i++) {
  636. for (var j = 0; j < res.data[1].length; j++) {
  637. if (res.data[0][i].id == res.data[1][j].pid) {
  638. if (!this.CourseTypeJson[res.data[0][i].id]) {
  639. this.CourseTypeJson[res.data[0][i].id] = [];
  640. }
  641. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  642. }
  643. }
  644. }
  645. this.$forceUpdate();
  646. })
  647. .catch((err) => {
  648. console.error(err);
  649. });
  650. },
  651. openCourse() {
  652. this.dialogVisibleCourse = true;
  653. this.getTeamCourse();
  654. },
  655. getTeamCourse() {
  656. let params = {
  657. uid: this.userid,
  658. oid: this.oid,
  659. };
  660. this.ajax
  661. .get(this.$store.state.api + "selectCourseTeam", params)
  662. .then((res) => {
  663. this.courseTeam = res.data[0];
  664. })
  665. .catch((err) => {
  666. console.error(err);
  667. });
  668. },
  669. search() {
  670. this.page = 1;
  671. this.getCourse();
  672. },
  673. checkProblem(res) {
  674. this.problemCourse = res;
  675. this.dialogVisible = true;
  676. },
  677. copyCourse(cid) {
  678. let params = [{
  679. cid: cid,
  680. uid: this.userid
  681. }]
  682. this.ajax
  683. .post(this.$store.state.api + "copyCourse", params)
  684. .then((res) => {
  685. this.page = 1
  686. this.groupA = '0'
  687. this.clear()
  688. })
  689. .catch((err) => {
  690. console.error(err);
  691. });
  692. }
  693. },
  694. created() {
  695. this.page = 1;
  696. this.selectAllType();
  697. this.getCourse();
  698. },
  699. };
  700. </script>
  701. <style scoped>
  702. .dialog_diy>>>.el-dialog__header {
  703. background: #3d67bc !important;
  704. padding: 15px 20px;
  705. }
  706. .dialog_diy>>>.el-dialog__title {
  707. color: #fff;
  708. }
  709. .dialog_diy>>>.el-dialog__headerbtn {
  710. top: 19px;
  711. }
  712. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  713. color: #fff;
  714. }
  715. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  716. color: #fff;
  717. }
  718. .student_head>>>.el-button--primary {
  719. background-color: #0061FF;
  720. }
  721. .xls_button {
  722. font-size: 14px;
  723. cursor: pointer;
  724. text-decoration: underline;
  725. color: rgb(34, 104, 188);
  726. }
  727. .student_head {
  728. display: flex;
  729. justify-content: space-between;
  730. align-items: baseline;
  731. flex-direction: row;
  732. flex-wrap: wrap;
  733. }
  734. .top {
  735. display: flex;
  736. justify-content: space-between;
  737. }
  738. .bgColor {
  739. background: #0061FF;
  740. }
  741. .student_search {
  742. display: flex;
  743. align-items: center;
  744. width: calc(100% / 3);
  745. }
  746. .student_search span {
  747. margin: 0 10px 0 0;
  748. min-width: 65px;
  749. }
  750. .student_button {
  751. display: flex;
  752. overflow: hidden;
  753. height: 40px;
  754. }
  755. .upload-demo {
  756. display: flex;
  757. flex-direction: column;
  758. align-items: end;
  759. /* position: relative; */
  760. width: 100px;
  761. overflow: hidden;
  762. }
  763. .student_table {
  764. padding: 20px 0;
  765. height: 100%;
  766. /* overflow: auto; */
  767. min-height: 360px;
  768. }
  769. .student_empty {
  770. display: flex;
  771. justify-content: center;
  772. align-items: center;
  773. }
  774. .el-table>>>.even_row {
  775. background-color: #f1f1f1;
  776. }
  777. .time {
  778. font-size: 13px;
  779. color: #999;
  780. }
  781. .course_button {
  782. padding: 10px 20px;
  783. }
  784. .course_button_box {
  785. display: flex;
  786. margin-top: 5px;
  787. justify-content: space-between;
  788. }
  789. .course_rate {
  790. margin-top: 5px;
  791. }
  792. .course_view {
  793. display: flex;
  794. align-items: center;
  795. margin: 5px 0 0 0;
  796. }
  797. .course_view i {
  798. background-image: url("../../../assets/liulan.png");
  799. width: 25px;
  800. height: 25px;
  801. background-size: 100% 100%;
  802. /* margin-top: 1px; */
  803. line-height: 25px;
  804. vertical-align: text-top;
  805. background-repeat: no-repeat;
  806. }
  807. .image {
  808. width: 100%;
  809. height: 150px;
  810. display: block;
  811. }
  812. .course_box {
  813. display: flex;
  814. flex-wrap: wrap;
  815. }
  816. .student_page {
  817. width: 95%;
  818. margin: 0 auto;
  819. }
  820. .course_create_box {
  821. font-size: 18px;
  822. }
  823. .course_name {
  824. margin-top: 10px;
  825. }
  826. .course_name span {
  827. margin-bottom: 10px;
  828. display: block;
  829. }
  830. .homework_box {
  831. display: flex;
  832. align-items: center;
  833. flex-wrap: wrap;
  834. }
  835. .course_homework {
  836. width: 130px;
  837. display: flex;
  838. justify-content: center;
  839. flex-direction: column;
  840. align-items: center;
  841. margin: 0 10px 10px 0;
  842. }
  843. .course_type {
  844. margin-top: 10px;
  845. display: flex;
  846. }
  847. .course_type1 span {
  848. margin-bottom: 10px;
  849. display: block;
  850. }
  851. .course_type2 {
  852. margin-left: 20px;
  853. }
  854. .course_type2 span {
  855. margin-bottom: 10px;
  856. display: block;
  857. }
  858. .course_empty {
  859. color: rgb(110, 110, 110);
  860. width: 100%;
  861. height: 100%;
  862. display: flex;
  863. align-items: center;
  864. justify-content: center;
  865. }
  866. .el_cards>>>.el-card__body {
  867. height: 100%;
  868. }
  869. .courseBtnBox {
  870. display: flex;
  871. flex-direction: column;
  872. justify-content: space-between;
  873. height: calc(100% - 170px);
  874. padding: 10px;
  875. }
  876. .wordUpload {
  877. display: flex;
  878. }
  879. .wordUpload>.buttonUp {
  880. margin-right: 5px;
  881. }
  882. .out_box {
  883. display: flex;
  884. flex-direction: column;
  885. flex-wrap: nowrap;
  886. width: 250px;
  887. background: #fff;
  888. margin-right: 25px;
  889. border: 1px solid #ccc;
  890. height: fit-content;
  891. box-sizing: border-box;
  892. border-radius: 0px 0px 5px 5px;
  893. /* overflow: hidden; */
  894. margin-bottom: 15px;
  895. position: relative;
  896. }
  897. .bottom_box {
  898. display: flex;
  899. padding: 10px 0 10px 10px;
  900. flex-direction: column;
  901. box-sizing: border-box;
  902. height: 140px;
  903. flex-wrap: nowrap;
  904. justify-content: space-evenly;
  905. }
  906. .bottom_box>div:nth-child(1) {
  907. width: 230px;
  908. overflow: hidden;
  909. text-overflow: ellipsis;
  910. white-space: nowrap;
  911. }
  912. .tup {
  913. width: 100%;
  914. height: 141.06px;
  915. margin: 0 auto;
  916. overflow: hidden;
  917. display: flex;
  918. align-items: center;
  919. }
  920. .tup>img {
  921. width: 100%;
  922. height: 100%;
  923. object-fit: contain;
  924. }
  925. .kc_time {
  926. margin-top: 8px;
  927. font-size: 14px;
  928. color: #999;
  929. }
  930. .kc_t {
  931. margin-top: 5px;
  932. width: 100%;
  933. white-space: nowrap;
  934. overflow: hidden;
  935. text-overflow: ellipsis;
  936. }
  937. .three_bottom {
  938. display: flex;
  939. flex-direction: row;
  940. justify-content: space-around;
  941. height: 40px;
  942. align-items: center;
  943. background: #f5f4f4;
  944. font-size: 14px;
  945. }
  946. .three_bottom>div {
  947. cursor: pointer;
  948. }
  949. .three_bottom>div:hover {
  950. color: #79a2ff;
  951. }
  952. .head_left {
  953. display: flex;
  954. }
  955. .student_input>>>.el-input__inner {
  956. height: 40px;
  957. width: 190px;
  958. font-size: 13px;
  959. padding: 0 10px;
  960. }
  961. .course_button {
  962. color: #fff;
  963. background: #0061FF;
  964. width: 75px;
  965. height: 40px;
  966. padding: 0 !important;
  967. font-size: 12px;
  968. line-height: 40px;
  969. }
  970. .all_choose {
  971. margin: 15px 0 10px;
  972. height: 20%;
  973. display: flex;
  974. flex-direction: row;
  975. align-items: center;
  976. max-width: calc(100% / 3 - 50px);
  977. }
  978. .all_choose>span {
  979. min-width: 75px;
  980. display: block;
  981. margin-right: 10px;
  982. text-align-last: justify;
  983. }
  984. .choose {
  985. display: flex;
  986. flex-direction: row;
  987. flex-wrap: wrap;
  988. align-content: space-between;
  989. height: 100%;
  990. justify-content: flex-start;
  991. width: 60%;
  992. min-width: 868px;
  993. align-items: center;
  994. }
  995. .choose>div:nth-child(2) {
  996. margin-left: 1%;
  997. width: 32.33333%;
  998. }
  999. /* .choose>div:nth-child(4) {
  1000. margin-right: 1%;
  1001. width: 32.33333%;
  1002. } */
  1003. .choose>div:nth-child(5) {
  1004. margin: 5px 0 0 1%;
  1005. }
  1006. .choose>div:nth-child(4)>span {
  1007. /* width: 74px !important;
  1008. min-width: 74px; */
  1009. }
  1010. .choose>div:nth-child(4)>>>.el-select {
  1011. /* width: 217.5px;
  1012. min-width: 215.06px; */
  1013. }
  1014. .clear {
  1015. width: 70px;
  1016. height: 35px;
  1017. background: #2268bc;
  1018. color: #fff;
  1019. text-align: center;
  1020. border-radius: 5px;
  1021. line-height: 35px;
  1022. cursor: pointer;
  1023. margin-left: 20px;
  1024. }
  1025. .ct_box {
  1026. height: 500px;
  1027. overflow: auto;
  1028. display: flex;
  1029. flex-wrap: wrap;
  1030. }
  1031. .myCourse {
  1032. position: absolute;
  1033. background: #3c3c3c;
  1034. width: 70px;
  1035. height: 30px;
  1036. border-radius: 30px;
  1037. color: #fff;
  1038. font-size: 14px;
  1039. text-align: center;
  1040. line-height: 30px;
  1041. top: 5px;
  1042. left: 5px;
  1043. }
  1044. .xtCourse {
  1045. position: absolute;
  1046. background: #466b99;
  1047. width: 70px;
  1048. height: 30px;
  1049. border-radius: 30px;
  1050. color: #fff;
  1051. font-size: 14px;
  1052. text-align: center;
  1053. line-height: 30px;
  1054. top: 5px;
  1055. left: 5px;
  1056. }
  1057. .subClick {
  1058. font-size: 16px;
  1059. cursor: pointer;
  1060. margin-left: 10px;
  1061. /* color: #ab582f; */
  1062. color: #409eff;
  1063. }
  1064. .more {
  1065. position: relative;
  1066. }
  1067. .more:hover div {
  1068. display: block;
  1069. color: #000;
  1070. }
  1071. .more div {
  1072. position: absolute;
  1073. bottom: 0px;
  1074. transform: translate(-50%, 100%);
  1075. background: #f5f4f4;
  1076. padding: 10px 20px;
  1077. z-index: 99;
  1078. width: 40px;
  1079. border-radius: 5px;
  1080. box-shadow: 0 0 3px 3px #80808020;
  1081. display: none;
  1082. }
  1083. .more div>span+span {
  1084. margin-top: 10px;
  1085. }
  1086. .more div>span {
  1087. display: block;
  1088. width: 100%;
  1089. text-align: center;
  1090. }
  1091. .more div>span:hover {
  1092. color: #79a2ff;
  1093. }
  1094. </style>