index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186
  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="All" value="1">All</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="All"></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="All"></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="bottom_box">
  58. <div><span>{{ item.title }}</span><span>{{ item.look == '1' ? '未发布' : '已发布' }}</span></div>
  59. <div class="kc_t">
  60. 创建人:{{ item.uname }}
  61. </div>
  62. <div class="kc_time">
  63. <span style="color: #4b4b4b">创建日期:</span>{{ item.time }}
  64. </div>
  65. <div class="kc_time">
  66. <span style="color: #4b4b4b">修改日期:</span>{{ item.utime }}
  67. </div>
  68. </div>
  69. <div class="three_bottom">
  70. <div @click="goToCourse2(item.courseId)" v-if="((item.userid == userid) ||
  71. (item.course_teacher &&
  72. item.course_teacher.indexOf(userid) !== -1) || role == '1')">编辑</div>
  73. <div @click="checkToTest(item.courseId)">Details</div>
  74. <!-- <div @click="get(item.courseId)">预览</div> -->
  75. <!-- 项目进展 -->
  76. <!-- <div @click="copyCourse(item.courseId)">复制</div> -->
  77. <!-- <div v-if="(item.userid == userid || role == '1')" @click="deleteCourse(item.courseId)">
  78. 删除
  79. </div> -->
  80. </div>
  81. </div>
  82. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="student_page">
  87. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  88. v-if="page && course.length" style="padding-bottom: 20px"
  89. @current-change="handleCurrentChange"></el-pagination>
  90. </div>
  91. <el-dialog :visible.sync="dialogVisible1" size="tiny">
  92. <img width="100%" :src="dialogImageUrl" alt />
  93. </el-dialog>
  94. <el-dialog title="查看提问" :visible.sync="dialogVisible" :append-to-body="true" width="750px"
  95. :before-close="handleClose" class="dialog_diy">
  96. <div>
  97. <div class="a_addBox">
  98. <CourseProblem :problemCourse="problemCourse"></CourseProblem>
  99. </div>
  100. </div>
  101. <span slot="footer" class="dialog-footer">
  102. <el-button @click="dialogVisible = false">关 闭</el-button>
  103. </span>
  104. </el-dialog>
  105. <el-dialog title="查看协同项目" :visible.sync="dialogVisibleCourse" :append-to-body="true" width="850px"
  106. :before-close="handleClose" class="dialog_diy">
  107. <div class="ct_box">
  108. <div class="out_box" v-for="(item, index) in courseTeam" :key="index" style="margin-left: 15px">
  109. <div class="tup">
  110. <img :src="item.cover != null && item.cover != ''
  111. ? JSON.parse(item.cover).length > 0
  112. ? JSON.parse(item.cover)[0].url
  113. : mr
  114. : mr
  115. " alt />
  116. </div>
  117. <div class="bottom_box">
  118. <div>{{ item.title }}</div>
  119. <div class="kc_t">创建人:{{ item.uname }}</div>
  120. <div class="kc_time">{{ item.time }}</div>
  121. </div>
  122. <div class="three_bottom">
  123. <!-- <div @click="jump(item.courseId)">查看内容</div> -->
  124. <div @click="
  125. goTo(
  126. '/studentAddCourse?cid=' +
  127. item.courseId +
  128. '&userid=' +
  129. userid +
  130. '&oid=' +
  131. oid +
  132. '&org=' +
  133. org +
  134. '&role=' +
  135. role
  136. )
  137. ">
  138. 编辑
  139. </div>
  140. </div>
  141. </div>
  142. <div class="course_empty" v-if="courseTeam.length == 0">暂无数据</div>
  143. </div>
  144. <span slot="footer" class="dialog-footer">
  145. <el-button @click="dialogVisibleCourse = false">关 闭</el-button>
  146. </span>
  147. </el-dialog>
  148. </div>
  149. </template>
  150. <script>
  151. import "../../../common/aws-sdk-2.235.1.min";
  152. import EditorBar from "../../../components/tools/wangEnduit";
  153. import CourseProblem from "../components/courseProblem";
  154. export default {
  155. components: { EditorBar, CourseProblem },
  156. data() {
  157. return {
  158. itemCount: 1,
  159. courseTitle: "",
  160. courseText: "",
  161. courseTime: "",
  162. isLoading: false,
  163. fileList: [],
  164. fileList1: [],
  165. homeworkList: [{ name: "" }],
  166. formLabelWidth: "100px",
  167. dialogVisible: false,
  168. dialogVisible1: false,
  169. dialogVisibleCourse: false,
  170. dialogImageUrl: "",
  171. group: "",
  172. userid: this.$route.query.userid,
  173. oid: this.$route.query.oid,
  174. org: this.$route.query.org,
  175. role: this.$route.query.role,
  176. orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
  177. oidArray: [],
  178. Juri: "",
  179. groupList: [],
  180. JuriList: [],
  181. page: 1,
  182. total: 0,
  183. pageSize: 20,
  184. tableData: [],
  185. now: "",
  186. courseDetail: {},
  187. addCourse: {},
  188. groupA: "3",
  189. classX: "",
  190. course: [],
  191. courseName: "",
  192. mr: require("../../../assets/icon/kc1.png"),
  193. CourseType: [],
  194. CourseTypeJson: {},
  195. courseTypeId: {},
  196. courseTypeSon: [],
  197. isChoose: 0,
  198. problemCourse: null, //查看提问的项目
  199. courseTeam: [],
  200. };
  201. },
  202. methods: {
  203. change(val) {
  204. console.log(val);
  205. },
  206. time() {
  207. if (!this.now) {
  208. this.now = new Date().getTime();
  209. return true;
  210. } else {
  211. let time = new Date().getTime();
  212. if (time - this.now > 3000) {
  213. this.now = time;
  214. return true;
  215. } else {
  216. return false;
  217. }
  218. }
  219. },
  220. addHomeworkBox() {
  221. this.homeworkList.push({ name: "" });
  222. this.itemCount++;
  223. },
  224. reduceHomeworkBox() {
  225. var a = this.homeworkList;
  226. a.splice(a.length - 1);
  227. this.itemCount--;
  228. },
  229. goTo(path) {
  230. this.$router.push(path);
  231. },
  232. goToCourse(courseId) {
  233. if (courseId) {
  234. this.$router.push(
  235. "/addTest?cid=" +
  236. courseId +
  237. "&userid=" +
  238. this.userid +
  239. "&oid=" +
  240. this.oid +
  241. "&org=" +
  242. this.org +
  243. "&role=" +
  244. this.role
  245. );
  246. } else {
  247. this.$router.push(
  248. "/addTest?userid=" +
  249. this.userid +
  250. "&oid=" +
  251. this.oid +
  252. "&org=" +
  253. this.org +
  254. "&role=" +
  255. this.role
  256. );
  257. }
  258. // this.$router.push(path);
  259. },
  260. goToCourse2(cid) {
  261. this.$router.push(
  262. "/addTest?cid=" +
  263. cid +
  264. "&userid=" +
  265. this.userid +
  266. "&oid=" +
  267. this.oid +
  268. "&org=" +
  269. this.org +
  270. "&type=2" +
  271. "&role=" +
  272. this.role
  273. );
  274. },
  275. checkToTest(cid){
  276. this.$router.push(
  277. "/checkToTest?cid=" +
  278. cid +
  279. "&userid=" +
  280. this.userid +
  281. "&oid=" +
  282. this.oid +
  283. "&org=" +
  284. this.org +
  285. "&type=2" +
  286. "&role=" +
  287. this.role
  288. );
  289. },
  290. tableRowClassName({ row, rowIndex }) {
  291. if ((rowIndex + 1) % 2 === 0) {
  292. return "even_row";
  293. } else {
  294. return "";
  295. }
  296. },
  297. jump(cid) {
  298. // window.open(
  299. // "//pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=" +
  300. // cid +
  301. // "&userid=" +
  302. // this.userid
  303. // );
  304. window.parent.postMessage({ cid: cid, screenType: "2s" }, "*");
  305. },
  306. get(cid) {
  307. window.parent.postMessage({ cid: cid, screenType: "3s" }, "*");
  308. },
  309. getA(cid) {
  310. this.$router.push("/courseProgress?cid=" + cid + "&userid=" +
  311. this.userid +
  312. "&oid=" +
  313. this.oid +
  314. "&org=" +
  315. this.org)
  316. },
  317. handle_remove(file, fileList) {
  318. var _tmp = this.fileList;
  319. for (var i = 0, len = _tmp.length; i < len; i++) {
  320. if (_tmp[i].uid == file.uid) {
  321. _tmp.splice(i, 1);
  322. break;
  323. }
  324. this.fileList = _tmp;
  325. }
  326. },
  327. handle_remove1(file, fileList) {
  328. var _tmp = this.fileList1;
  329. for (var i = 0, len = _tmp.length; i < len; i++) {
  330. if (_tmp[i].uid == file.uid) {
  331. _tmp.splice(i, 1);
  332. break;
  333. }
  334. this.fileList1 = _tmp;
  335. }
  336. },
  337. handleCurrentChange(val) {
  338. // console.log(`当前页: ${val}`);
  339. this.page = val;
  340. this.getCourse();
  341. },
  342. init() { },
  343. handleClose(done) {
  344. done();
  345. },
  346. handleRemove(file, fileList) {
  347. console.log(file, fileList);
  348. },
  349. handlePictureCardPreview(file) {
  350. this.dialogImageUrl = file.url;
  351. this.dialogVisible1 = true;
  352. },
  353. onExceed() {
  354. this.$message.error("项目海报仅支持上传一张,请删除后再进行上传");
  355. },
  356. //uuid生成
  357. guid() {
  358. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  359. /[xy]/g,
  360. function (c) {
  361. var r = (Math.random() * 16) | 0,
  362. v = c == "x" ? r : (r & 0x3) | 0x8;
  363. return v.toString(16);
  364. }
  365. );
  366. },
  367. time() {
  368. if (!this.now) {
  369. this.now = new Date().getTime();
  370. return true;
  371. } else {
  372. let time = new Date().getTime();
  373. if (time - this.now > 3000) {
  374. this.now = time;
  375. return true;
  376. } else {
  377. return false;
  378. }
  379. }
  380. },
  381. searchCourse() {
  382. this.page = 1;
  383. this.getCourse();
  384. },
  385. clear() {
  386. if (this.CourseType.length) {
  387. for (var i = 0; i < this.CourseType[0].length; i++) {
  388. this.courseTypeId[this.CourseType[0][i].id] = "";
  389. }
  390. }
  391. this.getCourse();
  392. },
  393. getCourse() {
  394. var typeE = [];
  395. var typea, typeb, typec, typed, typef;
  396. if (this.isChoose == 1) {
  397. for (var i = 0; i < this.CourseType[0].length; i++) {
  398. if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  399. typeE.push(this.CourseType[0][i].id);
  400. } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  401. if (this.CourseType[0][i].name == "年级") {
  402. typea = this.courseTypeId[this.CourseType[0][i].id];
  403. } else if (this.CourseType[0][i].name == "学科") {
  404. typeb = this.courseTypeId[this.CourseType[0][i].id];
  405. } else if (this.CourseType[0][i].name == "栏目") {
  406. typeb = this.courseTypeId[this.CourseType[0][i].id];
  407. } else if (this.CourseType[0][i].name == "学院") {
  408. typeb = this.courseTypeId[this.CourseType[0][i].id];
  409. } else if (this.CourseType[0][i].name == "新技能") {
  410. typec = this.courseTypeId[this.CourseType[0][i].id];
  411. } else if (this.CourseType[0][i].name == "赛道") {
  412. typed = this.courseTypeId[this.CourseType[0][i].id];
  413. } else if (this.CourseType[0][i].name == "项目类型") {
  414. typed = this.courseTypeId[this.CourseType[0][i].id];
  415. } else if (this.CourseType[0][i].name == "主题") {
  416. typef = this.courseTypeId[this.CourseType[0][i].id];
  417. }
  418. this.courseTypeSon.push(
  419. this.courseTypeId[this.CourseType[0][i].id]
  420. );
  421. }
  422. }
  423. }
  424. this.isLoading = true;
  425. let params = {
  426. type: this.groupA,
  427. uid: this.userid,
  428. oid: this.oid,
  429. org: this.org,
  430. typea: typea != undefined ? typea : "",
  431. typeb: typeb != undefined ? typeb : "",
  432. typec: typec != undefined ? typec : "",
  433. typed: typed != undefined ? typed : "",
  434. typef: typef != undefined ? typef : "",
  435. typeE: typeE.join(","),
  436. cu: "",
  437. cn: this.courseName,
  438. page: this.page,
  439. pageSize: this.pageSize,
  440. };
  441. this.ajax
  442. .get(this.$store.state.api + "selectTesttCourse", params)
  443. .then((res) => {
  444. this.isLoading = false;
  445. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  446. this.course = res.data[0];
  447. })
  448. .catch((err) => {
  449. console.error(err);
  450. });
  451. },
  452. getTypeName() {
  453. this.$forceUpdate();
  454. this.page = 1;
  455. this.isChoose = 1;
  456. this.getCourse();
  457. },
  458. // searchCourse() {
  459. // this.isLoading = true;
  460. // let params = {
  461. // cu: "",
  462. // cn: this.courseName,
  463. // page: this.page,
  464. // };
  465. // this.ajax
  466. // .get(this.$store.state.api + "searchCourse", params)
  467. // .then((res) => {
  468. // this.isLoading = false;
  469. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  470. // this.course = res.data[0];
  471. // })
  472. // .catch((err) => {
  473. // this.isLoading = false;
  474. // console.error(err);
  475. // });
  476. // },
  477. deleteCourse(cid) {
  478. // if (this.time()) {
  479. this.$confirm("确定删除此项目吗?", "Notification", {
  480. confirmButtonText: "Save",
  481. cancelButtonText: "Cancel",
  482. type: "warning",
  483. })
  484. .then(() => {
  485. this.isLoading = true;
  486. let params = {
  487. cid: cid,
  488. };
  489. this.ajax
  490. .get(this.$store.state.api + "deleteStudentCourse", params)
  491. .then((res) => {
  492. this.isLoading = false;
  493. this.$message.success("删除成功");
  494. this.getCourse();
  495. })
  496. .catch((err) => {
  497. console.error(err);
  498. });
  499. })
  500. .catch(() => {
  501. loading.close();
  502. this.isLoading = false;
  503. return;
  504. });
  505. // }
  506. },
  507. selectAllType() {
  508. let params = {
  509. org: this.org && this.org != "" ? this.org : "",
  510. oid: this.oid && this.oid != "" ? this.oid : "",
  511. };
  512. this.ajax
  513. .get(this.$store.state.api + "selectAllTypeT", params)
  514. .then((res) => {
  515. this.CourseType = res.data;
  516. for (var i = 0; i < res.data[0].length; i++) {
  517. if (res.data[0][i].id == "34629907-d02f-11ec-8c78-005056b86db5") {
  518. res.data[0][i].name = "学科";
  519. } else if (res.data[0][i].id == "34628934-d02f-11ec-8c78-005056b86db5") {
  520. res.data[0][i].name = "年级";
  521. }
  522. if (!this.cid) {
  523. this.courseTypeId[res.data[0][i].id] = '';
  524. }
  525. if (!this.CourseTypeJson[res.data[0][i].id]) {
  526. this.CourseTypeJson[res.data[0][i].id] = [];
  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 = "0";
  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 = '0'
  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. padding-top: 30px;
  896. }
  897. .bottom_box {
  898. display: flex;
  899. padding: 0 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. display: flex;
  910. align-items: center;
  911. }
  912. .bottom_box>div:nth-child(1) span:nth-child(1){
  913. font-weight: bold;
  914. font-size: 18px;
  915. overflow: hidden;
  916. text-overflow: ellipsis;
  917. white-space: nowrap;
  918. max-width: 100%;
  919. }
  920. .bottom_box>div:nth-child(1) span:nth-child(2){
  921. font-size: 14px;
  922. min-width: fit-content;
  923. margin-left: 5px;
  924. color: #0074ff;
  925. }
  926. .tup {
  927. width: 100%;
  928. height: 141.06px;
  929. margin: 0 auto;
  930. overflow: hidden;
  931. display: flex;
  932. align-items: center;
  933. }
  934. .tup>img {
  935. width: 100%;
  936. height: 100%;
  937. object-fit: contain;
  938. }
  939. .kc_time {
  940. margin-top: 8px;
  941. font-size: 14px;
  942. color: #999;
  943. }
  944. .kc_t {
  945. margin-top: 5px;
  946. width: 100%;
  947. white-space: nowrap;
  948. overflow: hidden;
  949. text-overflow: ellipsis;
  950. }
  951. .three_bottom {
  952. display: flex;
  953. flex-direction: row;
  954. justify-content: space-around;
  955. height: 40px;
  956. align-items: center;
  957. background: #f5f4f4;
  958. font-size: 14px;
  959. }
  960. .three_bottom>div {
  961. cursor: pointer;
  962. }
  963. .three_bottom>div:hover {
  964. color: #79a2ff;
  965. }
  966. .head_left {
  967. display: flex;
  968. }
  969. .student_input>>>.el-input__inner {
  970. height: 40px;
  971. width: 190px;
  972. font-size: 13px;
  973. padding: 0 10px;
  974. }
  975. .course_button {
  976. color: #fff;
  977. background: #2268bc;
  978. width: 75px;
  979. height: 40px;
  980. padding: 0 !important;
  981. font-size: 12px;
  982. line-height: 40px;
  983. }
  984. .all_choose {
  985. margin: 15px 0 10px;
  986. height: 20%;
  987. display: flex;
  988. flex-direction: row;
  989. align-items: center;
  990. max-width: calc(100% / 3 - 50px);
  991. }
  992. .all_choose>span {
  993. min-width: 75px;
  994. display: block;
  995. margin-right: 10px;
  996. text-align-last: justify;
  997. }
  998. .choose {
  999. display: flex;
  1000. flex-direction: row;
  1001. flex-wrap: wrap;
  1002. align-content: space-between;
  1003. height: 100%;
  1004. justify-content: flex-start;
  1005. width: 60%;
  1006. min-width: 868px;
  1007. align-items: center;
  1008. }
  1009. .choose>div:nth-child(2) {
  1010. margin-left: 1%;
  1011. width: 32.33333%;
  1012. }
  1013. .choose>div:nth-child(3) {
  1014. margin-left: 1%;
  1015. width: 32.33333%;
  1016. }
  1017. .choose>div:nth-child(5) {
  1018. margin: 5px 0 0 1%;
  1019. }
  1020. .choose>div:nth-child(4)>span {
  1021. /* width: 74px !important;
  1022. min-width: 74px; */
  1023. }
  1024. .choose>div:nth-child(4)>>>.el-select {
  1025. /* width: 217.5px;
  1026. min-width: 215.06px; */
  1027. }
  1028. .clear {
  1029. width: 70px;
  1030. max-width: 70px;
  1031. height: 35px;
  1032. background: #2268bc;
  1033. color: #fff;
  1034. text-align: center;
  1035. border-radius: 5px;
  1036. line-height: 35px;
  1037. cursor: pointer;
  1038. margin-left: 20px;
  1039. }
  1040. .ct_box {
  1041. height: 500px;
  1042. overflow: auto;
  1043. display: flex;
  1044. flex-wrap: wrap;
  1045. }
  1046. .myCourse {
  1047. position: absolute;
  1048. background: #3c3c3c;
  1049. width: 65px;
  1050. height: 25px;
  1051. color: #fff;
  1052. font-size: 12px;
  1053. text-align: center;
  1054. line-height: 25px;
  1055. top: 0;
  1056. right: 0;
  1057. }
  1058. .xtCourse {
  1059. position: absolute;
  1060. background: #466b99;
  1061. width: 70px;
  1062. height: 30px;
  1063. border-radius: 30px;
  1064. color: #fff;
  1065. font-size: 14px;
  1066. text-align: center;
  1067. line-height: 30px;
  1068. top: 5px;
  1069. left: 5px;
  1070. }
  1071. .subClick {
  1072. font-size: 16px;
  1073. cursor: pointer;
  1074. margin-left: 10px;
  1075. /* color: #ab582f; */
  1076. color: #409eff;
  1077. }
  1078. .more {
  1079. position: relative;
  1080. }
  1081. .more:hover div {
  1082. display: block;
  1083. color: #000;
  1084. }
  1085. .more div {
  1086. position: absolute;
  1087. bottom: 0px;
  1088. transform: translate(-50%, 100%);
  1089. background: #f5f4f4;
  1090. padding: 10px 20px;
  1091. z-index: 99;
  1092. width: 40px;
  1093. border-radius: 5px;
  1094. box-shadow: 0 0 3px 3px #80808020;
  1095. display: none;
  1096. }
  1097. .more div>span+span {
  1098. margin-top: 10px;
  1099. }
  1100. .more div>span {
  1101. display: block;
  1102. width: 100%;
  1103. text-align: center;
  1104. }
  1105. .more div>span:hover {
  1106. color: #79a2ff;
  1107. }</style>