scourse.vue 29 KB

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