index.vue 35 KB

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