index.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478
  1. <template>
  2. <div class="pb_content" style="height: auto; width: 94%; margin: 10px auto;background: unset;">
  3. <div style="width:100%;padding:0 21px;background:#fff;border-radius: 5px;box-sizing: border-box;">
  4. <div class="pb_head top">
  5. <div>
  6. <span>评测管理</span>
  7. </div>
  8. <div class="student_button">
  9. <el-button type="primary" class="bgColor" @click="goToCourse()">新建评测</el-button>
  10. </div>
  11. </div>
  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" v-if="typeArray.length">
  25. <span>类型</span>
  26. <el-select v-model="typeCheck" placeholder="请选择" clearable @change="search">
  27. <el-option v-for="(item, index) in typeArray" :key="index" :label="item.name"
  28. :value="item.id"></el-option>
  29. </el-select>
  30. </div>
  31. <!-- <div class="student_search">
  32. <span></span>
  33. <el-select v-model="groupA" @change="search">
  34. <el-option value="0" label="我的"></el-option>
  35. </el-select>
  36. </div> -->
  37. <div @click="clear" class="clear" v-if="CourseType.length">重置</div>
  38. </div>
  39. <div class="student_right">
  40. <div class="head_left">
  41. <el-input v-model="courseName" class="student_input" placeholder="请输入项目名称"></el-input>
  42. <el-button class="course_button" @click="searchCourse">查询</el-button>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="pb_content_body" style="height: 100%;width: 100%;">
  48. <div class="student_table" v-loading="isLoading">
  49. <div class="course_box">
  50. <!-- <div class="out_box" v-for="(item, index) in course" :key="index">
  51. <div class="myCourse" v-if="item.userid == userid">
  52. 我的项目
  53. </div>
  54. <div class="myCourse" style="background:#4187f0" v-else-if="!item.course_teacher ||
  55. (item.course_teacher &&
  56. item.course_teacher.indexOf(userid) == -1)">
  57. 他人项目
  58. </div>
  59. <div class="xtCourse" v-else>协同项目</div>
  60. <div class="bottom_box">
  61. <div>
  62. <el-tooltip :content="item.title" placement="top" effect="dark">
  63. <span>{{ item.title }}</span>
  64. </el-tooltip>
  65. <span>{{ item.look == '1' ? '未发布' : '已发布' }}</span>
  66. </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="checkToTest(item.courseId)">查看</div>
  82. <div @click="deleteCourse(item.courseId)">删除</div>
  83. </div>
  84. </div> -->
  85. <div class="test_box" v-for="(item, index) in course" :key="index">
  86. <div class="test_top">
  87. <div class="test_top_img" v-if="!item.typeN"></div>
  88. <el-tooltip :content="item.typeN" placement="top" effect="dark" v-else>
  89. <div class="test_top_img"
  90. :class="{ gr: item.typeid == 'afc3f97f-2429-408d-8dcd-5e63a44d355a', md: item.typeid == '478bcccd-e3a1-472b-aa29-3ed7bc479469', js: item.typeid == '178a377a-b4f1-4a75-b3c3-2787a7c98784', yy: item.typeid == 'dda9728e-5f11-469e-89ee-aca518daf223', bj: item.typeid == 'afc3f97f-2429-408d-8dcd-5e63a44d355c' }">
  91. </div>
  92. </el-tooltip>
  93. <div class="test_top_title">
  94. <span>{{ item.title }}</span>
  95. <!-- <span>创建人:{{ item.uname }}</span> -->
  96. <span>提交数量:{{ item.worksCount }}</span>
  97. </div>
  98. </div>
  99. <div class="test_time">
  100. <span><span>创建日期</span></span><span>{{ item.time }}</span>
  101. </div>
  102. <div class="test_time">
  103. <span><span>修改日期</span></span><span>{{ item.utime }}</span>
  104. </div>
  105. <div class="test_time tset_type">
  106. <span><span>类型</span></span>
  107. <span v-if="!item.typeN">未设置类型</span>
  108. <span v-else>{{ item.typeN }}</span>
  109. </div>
  110. <div class="test_time">
  111. <span><span>分类</span></span>
  112. <span v-if="!item.typename">未设置分类</span>
  113. <el-tooltip :content="item.typename" placement="top" effect="dark" v-else>
  114. <!-- content to trigger tooltip here -->
  115. <span>{{ item.typename }}</span>
  116. </el-tooltip>
  117. </div>
  118. <div class="test_btn">
  119. <div class="test_o_btn">
  120. <el-tooltip content="编辑" placement="top" effect="dark">
  121. <span class="edit" @click="goToCourse2(item.courseId)" v-if="((item.userid == userid) ||
  122. (item.course_teacher &&
  123. item.course_teacher.indexOf(userid) !== -1) || role == '1')"></span>
  124. </el-tooltip>
  125. <el-tooltip class="check" content="查看" placement="top" effect="dark">
  126. <span @click="checkToTest(item.courseId)"></span>
  127. </el-tooltip>
  128. <el-tooltip class="delete" content="删除" placement="top" effect="dark">
  129. <span @click="deleteCourse(item.courseId)"></span>
  130. </el-tooltip>
  131. </div>
  132. <div class="test_type" :class="{ no: item.look == '1', is: item.look == '2' }">
  133. <span>{{ item.look == '1' ? '未发布' : '已发布' }}</span>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="student_page">
  142. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  143. v-if="page && course.length" style="padding-bottom: 20px"
  144. @current-change="handleCurrentChange"></el-pagination>
  145. </div>
  146. <el-dialog :visible.sync="dialogVisible1" size="tiny">
  147. <img width="100%" :src="dialogImageUrl" alt />
  148. </el-dialog>
  149. <el-dialog title="查看提问" :visible.sync="dialogVisible" :append-to-body="true" width="750px"
  150. :before-close="handleClose" class="dialog_diy">
  151. <div>
  152. <div class="a_addBox">
  153. <CourseProblem :problemCourse="problemCourse"></CourseProblem>
  154. </div>
  155. </div>
  156. <span slot="footer" class="dialog-footer">
  157. <el-button @click="dialogVisible = false">关 闭</el-button>
  158. </span>
  159. </el-dialog>
  160. <el-dialog title="查看协同项目" :visible.sync="dialogVisibleCourse" :append-to-body="true" width="850px"
  161. :before-close="handleClose" class="dialog_diy">
  162. <div class="ct_box">
  163. <div class="out_box" v-for="(item, index) in courseTeam" :key="index" style="margin-left: 15px">
  164. <div class="tup">
  165. <img :src="item.cover != null && item.cover != ''
  166. ? JSON.parse(item.cover).length > 0
  167. ? JSON.parse(item.cover)[0].url
  168. : mr
  169. : mr
  170. " alt />
  171. </div>
  172. <div class="bottom_box">
  173. <div>{{ item.title }}</div>
  174. <div class="kc_t">创建人:{{ item.uname }}</div>
  175. <div class="kc_time">{{ item.time }}</div>
  176. </div>
  177. <div class="three_bottom">
  178. <!-- <div @click="jump(item.courseId)">查看内容</div> -->
  179. <div @click="
  180. goTo(
  181. '/studentAddCourse?cid=' +
  182. item.courseId +
  183. '&userid=' +
  184. userid +
  185. '&oid=' +
  186. oid +
  187. '&org=' +
  188. org +
  189. '&role=' +
  190. role
  191. )
  192. ">
  193. 编辑
  194. </div>
  195. </div>
  196. </div>
  197. <div class="course_empty" v-if="courseTeam.length == 0">暂无数据</div>
  198. </div>
  199. <span slot="footer" class="dialog-footer">
  200. <el-button @click="dialogVisibleCourse = false">关 闭</el-button>
  201. </span>
  202. </el-dialog>
  203. </div>
  204. </template>
  205. <script>
  206. import "../../../common/aws-sdk-2.235.1.min";
  207. import EditorBar from "../../../components/tools/wangEnduit";
  208. import CourseProblem from "../components/courseProblem";
  209. export default {
  210. components: { EditorBar, CourseProblem },
  211. data() {
  212. return {
  213. itemCount: 1,
  214. courseTitle: "",
  215. courseText: "",
  216. courseTime: "",
  217. isLoading: false,
  218. fileList: [],
  219. fileList1: [],
  220. homeworkList: [{ name: "" }],
  221. formLabelWidth: "100px",
  222. dialogVisible: false,
  223. dialogVisible1: false,
  224. dialogVisibleCourse: false,
  225. dialogImageUrl: "",
  226. group: "",
  227. userid: this.$route.query.userid,
  228. oid: this.$route.query.oid,
  229. org: this.$route.query.org,
  230. role: this.$route.query.role,
  231. orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
  232. oidArray: [],
  233. Juri: "",
  234. groupList: [],
  235. JuriList: [],
  236. page: 1,
  237. total: 0,
  238. pageSize: 20,
  239. tableData: [],
  240. now: "",
  241. courseDetail: {},
  242. addCourse: {},
  243. groupA: "0",
  244. classX: "",
  245. course: [],
  246. courseName: "",
  247. mr: require("../../../assets/icon/kc1.png"),
  248. CourseType: [],
  249. CourseTypeJson: {},
  250. courseTypeId: {},
  251. courseTypeSon: [],
  252. isChoose: 0,
  253. problemCourse: null, //查看提问的项目
  254. courseTeam: [],
  255. typeArray: [],
  256. typeCheck: "",
  257. };
  258. },
  259. methods: {
  260. change(val) {
  261. console.log(val);
  262. },
  263. time() {
  264. if (!this.now) {
  265. this.now = new Date().getTime();
  266. return true;
  267. } else {
  268. let time = new Date().getTime();
  269. if (time - this.now > 3000) {
  270. this.now = time;
  271. return true;
  272. } else {
  273. return false;
  274. }
  275. }
  276. },
  277. addHomeworkBox() {
  278. this.homeworkList.push({ name: "" });
  279. this.itemCount++;
  280. },
  281. reduceHomeworkBox() {
  282. var a = this.homeworkList;
  283. a.splice(a.length - 1);
  284. this.itemCount--;
  285. },
  286. goTo(path) {
  287. this.$router.push(path);
  288. },
  289. goToCourse(courseId) {
  290. if (courseId) {
  291. this.$router.push(
  292. "/addTest?cid=" +
  293. courseId +
  294. "&userid=" +
  295. this.userid +
  296. "&oid=" +
  297. this.oid +
  298. "&org=" +
  299. this.org +
  300. "&role=" +
  301. this.role
  302. );
  303. } else {
  304. this.$router.push(
  305. "/addTest?userid=" +
  306. this.userid +
  307. "&oid=" +
  308. this.oid +
  309. "&org=" +
  310. this.org +
  311. "&role=" +
  312. this.role
  313. );
  314. }
  315. // this.$router.push(path);
  316. },
  317. goToCourse2(cid) {
  318. this.$router.push(
  319. "/addTest?cid=" +
  320. cid +
  321. "&userid=" +
  322. this.userid +
  323. "&oid=" +
  324. this.oid +
  325. "&org=" +
  326. this.org +
  327. "&type=2" +
  328. "&role=" +
  329. this.role
  330. );
  331. },
  332. checkToTest(cid) {
  333. this.$router.push(
  334. "/checkToTest?cid=" +
  335. cid +
  336. "&userid=" +
  337. this.userid +
  338. "&oid=" +
  339. this.oid +
  340. "&org=" +
  341. this.org +
  342. "&type=2" +
  343. "&role=" +
  344. this.role
  345. );
  346. },
  347. tableRowClassName({ row, rowIndex }) {
  348. if ((rowIndex + 1) % 2 === 0) {
  349. return "even_row";
  350. } else {
  351. return "";
  352. }
  353. },
  354. jump(cid) {
  355. // window.open(
  356. // "//pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=" +
  357. // cid +
  358. // "&userid=" +
  359. // this.userid
  360. // );
  361. window.parent.postMessage({ cid: cid, screenType: "2s" }, "*");
  362. },
  363. get(cid) {
  364. window.parent.postMessage({ cid: cid, screenType: "3s" }, "*");
  365. },
  366. getA(cid) {
  367. this.$router.push("/courseProgress?cid=" + cid + "&userid=" +
  368. this.userid +
  369. "&oid=" +
  370. this.oid +
  371. "&org=" +
  372. this.org)
  373. },
  374. handle_remove(file, fileList) {
  375. var _tmp = this.fileList;
  376. for (var i = 0, len = _tmp.length; i < len; i++) {
  377. if (_tmp[i].uid == file.uid) {
  378. _tmp.splice(i, 1);
  379. break;
  380. }
  381. this.fileList = _tmp;
  382. }
  383. },
  384. handle_remove1(file, fileList) {
  385. var _tmp = this.fileList1;
  386. for (var i = 0, len = _tmp.length; i < len; i++) {
  387. if (_tmp[i].uid == file.uid) {
  388. _tmp.splice(i, 1);
  389. break;
  390. }
  391. this.fileList1 = _tmp;
  392. }
  393. },
  394. handleCurrentChange(val) {
  395. // console.log(`当前页: ${val}`);
  396. this.page = val;
  397. this.getCourse();
  398. },
  399. init() { },
  400. handleClose(done) {
  401. done();
  402. },
  403. handleRemove(file, fileList) {
  404. console.log(file, fileList);
  405. },
  406. handlePictureCardPreview(file) {
  407. this.dialogImageUrl = file.url;
  408. this.dialogVisible1 = true;
  409. },
  410. onExceed() {
  411. this.$message.error("项目海报仅支持上传一张,请删除后再进行上传");
  412. },
  413. //uuid生成
  414. guid() {
  415. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  416. /[xy]/g,
  417. function (c) {
  418. var r = (Math.random() * 16) | 0,
  419. v = c == "x" ? r : (r & 0x3) | 0x8;
  420. return v.toString(16);
  421. }
  422. );
  423. },
  424. time() {
  425. if (!this.now) {
  426. this.now = new Date().getTime();
  427. return true;
  428. } else {
  429. let time = new Date().getTime();
  430. if (time - this.now > 3000) {
  431. this.now = time;
  432. return true;
  433. } else {
  434. return false;
  435. }
  436. }
  437. },
  438. searchCourse() {
  439. this.page = 1;
  440. this.getCourse();
  441. },
  442. clear() {
  443. if (this.CourseType.length) {
  444. for (var i = 0; i < this.CourseType[0].length; i++) {
  445. this.courseTypeId[this.CourseType[0][i].id] = "";
  446. }
  447. }
  448. this.typeCheck = ''
  449. this.page = 1
  450. this.getCourse();
  451. },
  452. getCourse() {
  453. var typeE = [];
  454. var typea, typeb, typec, typed, typef;
  455. if (this.isChoose == 1) {
  456. for (var i = 0; i < this.CourseType[0].length; i++) {
  457. if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  458. typeE.push(this.CourseType[0][i].id);
  459. } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  460. if (this.CourseType[0][i].name == "年级") {
  461. typea = this.courseTypeId[this.CourseType[0][i].id];
  462. } else if (this.CourseType[0][i].name == "学科") {
  463. typeb = this.courseTypeId[this.CourseType[0][i].id];
  464. } else if (this.CourseType[0][i].name == "栏目") {
  465. typeb = this.courseTypeId[this.CourseType[0][i].id];
  466. } else if (this.CourseType[0][i].name == "学院") {
  467. typeb = this.courseTypeId[this.CourseType[0][i].id];
  468. } else if (this.CourseType[0][i].name == "新技能") {
  469. typec = this.courseTypeId[this.CourseType[0][i].id];
  470. } else if (this.CourseType[0][i].name == "赛道") {
  471. typed = this.courseTypeId[this.CourseType[0][i].id];
  472. } else if (this.CourseType[0][i].name == "项目类型") {
  473. typed = this.courseTypeId[this.CourseType[0][i].id];
  474. } else if (this.CourseType[0][i].name == "主题") {
  475. // typef = this.courseTypeId[this.CourseType[0][i].id];
  476. }
  477. this.courseTypeSon.push(
  478. this.courseTypeId[this.CourseType[0][i].id]
  479. );
  480. }
  481. }
  482. }
  483. this.isLoading = true;
  484. let params = {
  485. type: this.groupA,
  486. uid: this.userid,
  487. oid: this.oid,
  488. org: this.org,
  489. typea: typea != undefined ? typea : "",
  490. typeb: typeb != undefined ? typeb : "",
  491. typec: typec != undefined ? typec : "",
  492. typed: typed != undefined ? typed : "",
  493. typef: this.typeCheck,
  494. typeE: typeE.join(","),
  495. cu: "",
  496. cn: this.courseName,
  497. page: this.page,
  498. pageSize: this.pageSize,
  499. };
  500. this.ajax
  501. .get(this.$store.state.api + "selectTesttCourse", params)
  502. .then((res) => {
  503. this.isLoading = false;
  504. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  505. this.course = res.data[0];
  506. })
  507. .catch((err) => {
  508. console.error(err);
  509. });
  510. },
  511. getTypeName() {
  512. this.$forceUpdate();
  513. this.page = 1;
  514. this.isChoose = 1;
  515. this.getCourse();
  516. },
  517. // searchCourse() {
  518. // this.isLoading = true;
  519. // let params = {
  520. // cu: "",
  521. // cn: this.courseName,
  522. // page: this.page,
  523. // };
  524. // this.ajax
  525. // .get(this.$store.state.api + "searchCourse", params)
  526. // .then((res) => {
  527. // this.isLoading = false;
  528. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  529. // this.course = res.data[0];
  530. // })
  531. // .catch((err) => {
  532. // this.isLoading = false;
  533. // console.error(err);
  534. // });
  535. // },
  536. deleteCourse(cid) {
  537. // if (this.time()) {
  538. this.$confirm("确定删除此评测吗?", "提示", {
  539. confirmButtonText: "确定",
  540. cancelButtonText: "取消",
  541. type: "warning",
  542. })
  543. .then(() => {
  544. this.isLoading = true;
  545. let params = [{
  546. cid: cid,
  547. }];
  548. this.ajax
  549. .post(this.$store.state.api + "deleteTestCourse", params)
  550. .then((res) => {
  551. this.isLoading = false;
  552. this.$message.success("删除成功");
  553. this.getCourse();
  554. })
  555. .catch((err) => {
  556. loading.close();
  557. this.isLoading = false;
  558. console.error(err);
  559. });
  560. })
  561. .catch(() => {
  562. return;
  563. });
  564. // }
  565. },
  566. selectAllType() {
  567. let params = {
  568. org: this.org && this.org != "" ? this.org : "",
  569. oid: this.oid && this.oid != "" ? this.oid : "",
  570. };
  571. this.ajax
  572. .get(this.$store.state.api + "selectAllTypeT", params)
  573. .then((res) => {
  574. this.CourseType = res.data;
  575. for (var i = 0; i < res.data[0].length; i++) {
  576. if (res.data[0][i].id == "34629907-d02f-11ec-8c78-005056b86db5") {
  577. res.data[0][i].name = "学科";
  578. } else if (res.data[0][i].id == "34628934-d02f-11ec-8c78-005056b86db5") {
  579. res.data[0][i].name = "年级";
  580. }
  581. if (!this.cid) {
  582. this.courseTypeId[res.data[0][i].id] = '';
  583. }
  584. if (!this.CourseTypeJson[res.data[0][i].id]) {
  585. this.CourseTypeJson[res.data[0][i].id] = [];
  586. }
  587. if (res.data[2].length == 0 && res.data[3].length == 0) {
  588. // for (var j = 0; j < res.data[1].length; j++) {
  589. // if (res.data[0][i].id == res.data[1][j].pid) {
  590. // this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  591. // }
  592. // }
  593. // if(this.org == '150e3120-9195-11ed-b13d-005056b86db5'){
  594. for (var j = 0; j < res.data[1].length; j++) {
  595. if (res.data[0][i].id == res.data[1][j].pid) {
  596. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  597. }
  598. }
  599. // }else{
  600. // this.CourseType = []
  601. // }
  602. } else {
  603. if (res.data[2].length > 0) {
  604. for (var j = 0; j < res.data[2].length; j++) {
  605. if (res.data[0][i].id == res.data[2][j].pid) {
  606. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  607. }
  608. }
  609. }
  610. if (res.data[3].length > 0) {
  611. for (var j = 0; j < res.data[3].length; j++) {
  612. if (res.data[0][i].id == res.data[3][j].pid) {
  613. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  614. }
  615. }
  616. }
  617. }
  618. }
  619. })
  620. .catch((err) => {
  621. console.error(err);
  622. });
  623. },
  624. selectTestType() {
  625. let params = {
  626. oid: this.oid,
  627. };
  628. this.ajax
  629. .get(this.$store.state.api + "selectTestType", params)
  630. .then((res) => {
  631. this.typeArray = res.data[0];
  632. })
  633. .catch((err) => {
  634. console.error(err);
  635. });
  636. },
  637. selectType() {
  638. this.ajax
  639. .get(this.$store.state.api + "selectStudentType")
  640. .then((res) => {
  641. this.CourseType = res.data;
  642. for (var i = 0; i < res.data[0].length; i++) {
  643. if (!this.cid) {
  644. this.courseTypeId[res.data[0][i].id] = "";
  645. }
  646. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  647. if (res.data[0][i].name == "栏目") {
  648. this.CourseType[0][i].name = "主题";
  649. }
  650. }
  651. for (var j = 0; j < res.data[1].length; j++) {
  652. if (res.data[0][i].id == res.data[1][j].pid) {
  653. if (!this.CourseTypeJson[res.data[0][i].id]) {
  654. this.CourseTypeJson[res.data[0][i].id] = [];
  655. }
  656. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); //去除公共分类
  657. }
  658. }
  659. }
  660. this.selectTypeByOid();
  661. this.selectTypeByOrg();
  662. })
  663. .catch((err) => {
  664. console.error(err);
  665. });
  666. },
  667. selectTypeByOid() {
  668. let params = {
  669. oid: this.oid,
  670. };
  671. this.ajax
  672. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  673. .then((res) => {
  674. for (var i = 0; i < res.data[0].length; i++) {
  675. for (var j = 0; j < res.data[1].length; j++) {
  676. if (res.data[0][i].id == res.data[1][j].pid) {
  677. if (!this.CourseTypeJson[res.data[0][i].id]) {
  678. this.CourseTypeJson[res.data[0][i].id] = [];
  679. }
  680. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  681. }
  682. }
  683. }
  684. this.$forceUpdate();
  685. })
  686. .catch((err) => {
  687. console.error(err);
  688. });
  689. },
  690. selectTypeByOrg() {
  691. let params = {
  692. oid: this.org,
  693. };
  694. this.ajax
  695. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  696. .then((res) => {
  697. for (var i = 0; i < res.data[0].length; i++) {
  698. for (var j = 0; j < res.data[1].length; j++) {
  699. if (res.data[0][i].id == res.data[1][j].pid) {
  700. if (!this.CourseTypeJson[res.data[0][i].id]) {
  701. this.CourseTypeJson[res.data[0][i].id] = [];
  702. }
  703. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  704. }
  705. }
  706. }
  707. this.$forceUpdate();
  708. })
  709. .catch((err) => {
  710. console.error(err);
  711. });
  712. },
  713. openCourse() {
  714. this.dialogVisibleCourse = true;
  715. this.getTeamCourse();
  716. },
  717. getTeamCourse() {
  718. let params = {
  719. uid: this.userid,
  720. oid: this.oid,
  721. };
  722. this.ajax
  723. .get(this.$store.state.api + "selectCourseTeam", params)
  724. .then((res) => {
  725. this.courseTeam = res.data[0];
  726. })
  727. .catch((err) => {
  728. console.error(err);
  729. });
  730. },
  731. search() {
  732. this.page = 1;
  733. this.getCourse();
  734. },
  735. checkProblem(res) {
  736. this.problemCourse = res;
  737. this.dialogVisible = true;
  738. },
  739. copyCourse(cid) {
  740. let params = [{
  741. cid: cid,
  742. uid: this.userid
  743. }]
  744. this.ajax
  745. .post(this.$store.state.api + "copySCourse", params)
  746. .then((res) => {
  747. this.page = 1
  748. if (this.role == "1") {
  749. this.groupA = "0";
  750. } else {
  751. this.groupA = "0";
  752. }
  753. this.$message.success("复制成功")
  754. this.clear()
  755. })
  756. .catch((err) => {
  757. console.error(err);
  758. });
  759. }
  760. },
  761. created() {
  762. if (this.role == '1') {
  763. this.groupA = '0'
  764. }
  765. this.page = 1;
  766. this.selectAllType();
  767. this.getCourse();
  768. this.selectTestType();
  769. },
  770. };
  771. </script>
  772. <style scoped>
  773. @media screen and (max-width: 1380px) {
  774. .test_box {
  775. width: calc(100% / 4 - (15px * 3) / 4) !important;
  776. }
  777. .test_box:nth-child(5n) {
  778. margin-right: 15px !important;
  779. }
  780. .test_box:nth-child(4n) {
  781. margin-right: 0 !important;
  782. }
  783. }
  784. @media screen and (max-width: 1080px) {
  785. .test_box {
  786. width: calc(100% / 3 - (15px * 2) / 3) !important;
  787. }
  788. .test_box:nth-child(5n) {
  789. margin-right: 15px !important;
  790. }
  791. .test_box:nth-child(4n) {
  792. margin-right: 15px !important;
  793. }
  794. .test_box:nth-child(3n) {
  795. margin-right: 0 !important;
  796. }
  797. }
  798. .dialog_diy>>>.el-dialog__header {
  799. background: #3d67bc !important;
  800. padding: 15px 20px;
  801. }
  802. .dialog_diy>>>.el-dialog__title {
  803. color: #fff;
  804. }
  805. .dialog_diy>>>.el-dialog__headerbtn {
  806. top: 19px;
  807. }
  808. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  809. color: #fff;
  810. }
  811. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  812. color: #fff;
  813. }
  814. .student_head>>>.el-button--primary {
  815. background-color: #3681fc;
  816. }
  817. .xls_button {
  818. font-size: 14px;
  819. cursor: pointer;
  820. text-decoration: underline;
  821. color: rgb(34, 104, 188);
  822. }
  823. .student_head {
  824. display: flex;
  825. justify-content: space-between;
  826. align-items: baseline;
  827. flex-direction: row;
  828. flex-wrap: wrap;
  829. padding: 0 0 15px;
  830. }
  831. .top {
  832. display: flex;
  833. justify-content: space-between;
  834. width: 100% !important;
  835. box-sizing: border-box;
  836. margin: 0px auto;
  837. padding: 10px 0;
  838. height: 54px;
  839. }
  840. .bgColor {
  841. background: #3681fc;
  842. }
  843. .student_search {
  844. display: flex;
  845. align-items: center;
  846. /* width: calc(100% / 3); */
  847. width: 190px;
  848. }
  849. .student_search span {
  850. margin: 0 10px 0 0;
  851. min-width: 50px;
  852. text-align-last: justify;
  853. }
  854. .student_button {
  855. display: flex;
  856. overflow: hidden;
  857. height: 40px;
  858. }
  859. .upload-demo {
  860. display: flex;
  861. flex-direction: column;
  862. align-items: end;
  863. /* position: relative; */
  864. width: 100px;
  865. overflow: hidden;
  866. }
  867. .student_table {
  868. padding: 0 0;
  869. height: 100%;
  870. /* overflow: auto; */
  871. min-height: 360px;
  872. }
  873. .student_empty {
  874. display: flex;
  875. justify-content: center;
  876. align-items: center;
  877. }
  878. .el-table>>>.even_row {
  879. background-color: #f1f1f1;
  880. }
  881. .time {
  882. font-size: 13px;
  883. color: #999;
  884. }
  885. .course_button {
  886. padding: 10px 20px;
  887. }
  888. .course_button_box {
  889. display: flex;
  890. margin-top: 5px;
  891. justify-content: space-between;
  892. }
  893. .course_rate {
  894. margin-top: 5px;
  895. }
  896. .course_view {
  897. display: flex;
  898. align-items: center;
  899. margin: 5px 0 0 0;
  900. }
  901. .course_view i {
  902. background-image: url("../../../assets/liulan.png");
  903. width: 25px;
  904. height: 25px;
  905. background-size: 100% 100%;
  906. /* margin-top: 1px; */
  907. line-height: 25px;
  908. vertical-align: text-top;
  909. background-repeat: no-repeat;
  910. }
  911. .image {
  912. width: 100%;
  913. height: 150px;
  914. display: block;
  915. }
  916. .course_box {
  917. display: flex;
  918. flex-wrap: wrap;
  919. }
  920. .student_page {
  921. width: 100%;
  922. margin: 0 auto;
  923. }
  924. .course_create_box {
  925. font-size: 18px;
  926. }
  927. .course_name {
  928. margin-top: 10px;
  929. }
  930. .course_name span {
  931. margin-bottom: 10px;
  932. display: block;
  933. }
  934. .homework_box {
  935. display: flex;
  936. align-items: center;
  937. flex-wrap: wrap;
  938. }
  939. .course_homework {
  940. width: 130px;
  941. display: flex;
  942. justify-content: center;
  943. flex-direction: column;
  944. align-items: center;
  945. margin: 0 10px 10px 0;
  946. }
  947. .course_type {
  948. margin-top: 10px;
  949. display: flex;
  950. }
  951. .course_type1 span {
  952. margin-bottom: 10px;
  953. display: block;
  954. }
  955. .course_type2 {
  956. margin-left: 20px;
  957. }
  958. .course_type2 span {
  959. margin-bottom: 10px;
  960. display: block;
  961. }
  962. .course_empty {
  963. color: rgb(110, 110, 110);
  964. width: 100%;
  965. height: 100%;
  966. display: flex;
  967. align-items: center;
  968. justify-content: center;
  969. }
  970. .el_cards>>>.el-card__body {
  971. height: 100%;
  972. }
  973. .courseBtnBox {
  974. display: flex;
  975. flex-direction: column;
  976. justify-content: space-between;
  977. height: calc(100% - 170px);
  978. padding: 10px;
  979. }
  980. .wordUpload {
  981. display: flex;
  982. }
  983. .wordUpload>.buttonUp {
  984. margin-right: 5px;
  985. }
  986. .out_box {
  987. display: flex;
  988. flex-direction: column;
  989. flex-wrap: nowrap;
  990. width: 250px;
  991. background: #fff;
  992. margin-right: 25px;
  993. border: 1px solid #ccc;
  994. height: fit-content;
  995. box-sizing: border-box;
  996. border-radius: 0px 0px 5px 5px;
  997. /* overflow: hidden; */
  998. margin-bottom: 15px;
  999. position: relative;
  1000. padding-top: 30px;
  1001. }
  1002. .bottom_box {
  1003. display: flex;
  1004. padding: 0 0 10px 10px;
  1005. flex-direction: column;
  1006. box-sizing: border-box;
  1007. height: 140px;
  1008. flex-wrap: nowrap;
  1009. justify-content: space-evenly;
  1010. }
  1011. .bottom_box>div:nth-child(1) {
  1012. width: 230px;
  1013. overflow: hidden;
  1014. display: flex;
  1015. align-items: center;
  1016. }
  1017. .bottom_box>div:nth-child(1) span:nth-child(1) {
  1018. font-weight: bold;
  1019. font-size: 18px;
  1020. overflow: hidden;
  1021. text-overflow: ellipsis;
  1022. white-space: nowrap;
  1023. max-width: 100%;
  1024. }
  1025. .bottom_box>div:nth-child(1) span:nth-child(2) {
  1026. font-size: 14px;
  1027. min-width: fit-content;
  1028. margin-left: 5px;
  1029. color: #0074ff;
  1030. }
  1031. .tup {
  1032. width: 100%;
  1033. height: 141.06px;
  1034. margin: 0 auto;
  1035. overflow: hidden;
  1036. display: flex;
  1037. align-items: center;
  1038. }
  1039. .tup>img {
  1040. width: 100%;
  1041. height: 100%;
  1042. object-fit: contain;
  1043. }
  1044. .kc_time {
  1045. margin-top: 8px;
  1046. font-size: 14px;
  1047. color: #999;
  1048. }
  1049. .kc_t {
  1050. margin-top: 5px;
  1051. width: 100%;
  1052. white-space: nowrap;
  1053. overflow: hidden;
  1054. text-overflow: ellipsis;
  1055. }
  1056. .three_bottom {
  1057. display: flex;
  1058. flex-direction: row;
  1059. justify-content: space-around;
  1060. height: 40px;
  1061. align-items: center;
  1062. background: #f5f4f4;
  1063. font-size: 14px;
  1064. }
  1065. .three_bottom>div {
  1066. cursor: pointer;
  1067. }
  1068. .three_bottom>div:hover {
  1069. color: #79a2ff;
  1070. }
  1071. .head_left {
  1072. display: flex;
  1073. margin-top: 15px;
  1074. }
  1075. .student_input>>>.el-input__inner {
  1076. height: 40px;
  1077. width: 190px;
  1078. font-size: 13px;
  1079. padding: 0 10px;
  1080. }
  1081. .course_button {
  1082. color: #fff;
  1083. background: #3681fc;
  1084. width: 75px;
  1085. height: 40px;
  1086. padding: 0 !important;
  1087. font-size: 12px;
  1088. line-height: 40px;
  1089. }
  1090. .all_choose {
  1091. /* margin: 15px 0 10px; */
  1092. /* height: 20%; */
  1093. display: flex;
  1094. flex-direction: row;
  1095. align-items: center;
  1096. max-width: 180px;
  1097. width: 180px;
  1098. }
  1099. .all_choose>span {
  1100. min-width: 50px;
  1101. display: block;
  1102. margin-right: 10px;
  1103. text-align-last: justify;
  1104. }
  1105. .choose {
  1106. display: flex;
  1107. flex-direction: row;
  1108. flex-wrap: wrap;
  1109. align-content: space-between;
  1110. height: 100%;
  1111. justify-content: flex-start;
  1112. /* width: 60%; */
  1113. /* min-width: 868px; */
  1114. align-items: center;
  1115. }
  1116. .choose>div {
  1117. margin-left: 10px;
  1118. width: 180px;
  1119. margin-top: 15px;
  1120. }
  1121. .choose>.clear {
  1122. width: 70px
  1123. }
  1124. .clear {
  1125. width: 70px;
  1126. max-width: 70px;
  1127. height: 35px;
  1128. background: #3681fc;
  1129. color: #fff;
  1130. text-align: center;
  1131. border-radius: 5px;
  1132. line-height: 35px;
  1133. cursor: pointer;
  1134. margin-left: 20px;
  1135. }
  1136. .ct_box {
  1137. height: 500px;
  1138. overflow: auto;
  1139. display: flex;
  1140. flex-wrap: wrap;
  1141. }
  1142. .myCourse {
  1143. position: absolute;
  1144. background: #3c3c3c;
  1145. width: 65px;
  1146. height: 25px;
  1147. color: #fff;
  1148. font-size: 12px;
  1149. text-align: center;
  1150. line-height: 25px;
  1151. top: 0;
  1152. right: 0;
  1153. }
  1154. .xtCourse {
  1155. position: absolute;
  1156. background: #3681fc;
  1157. width: 70px;
  1158. height: 30px;
  1159. border-radius: 30px;
  1160. color: #fff;
  1161. font-size: 14px;
  1162. text-align: center;
  1163. line-height: 30px;
  1164. top: 5px;
  1165. left: 5px;
  1166. }
  1167. .subClick {
  1168. font-size: 16px;
  1169. cursor: pointer;
  1170. margin-left: 10px;
  1171. /* color: #ab582f; */
  1172. color: #409eff;
  1173. }
  1174. .more {
  1175. position: relative;
  1176. }
  1177. .more:hover div {
  1178. display: block;
  1179. color: #000;
  1180. }
  1181. .more div {
  1182. position: absolute;
  1183. bottom: 0px;
  1184. transform: translate(-50%, 100%);
  1185. background: #f5f4f4;
  1186. padding: 10px 20px;
  1187. z-index: 99;
  1188. width: 40px;
  1189. border-radius: 5px;
  1190. box-shadow: 0 0 3px 3px #80808020;
  1191. display: none;
  1192. }
  1193. .more div>span+span {
  1194. margin-top: 10px;
  1195. }
  1196. .more div>span {
  1197. display: block;
  1198. width: 100%;
  1199. text-align: center;
  1200. }
  1201. .more div>span:hover {
  1202. color: #79a2ff;
  1203. }
  1204. .test_box {
  1205. width: calc(100% / 5 - (15px * 4) / 5);
  1206. /* width: 250px; */
  1207. background: #fff;
  1208. border-radius: 5px;
  1209. padding: 20px;
  1210. margin: 5px 15px 10px 0;
  1211. box-sizing: border-box;
  1212. }
  1213. .test_box:nth-child(5n) {
  1214. margin-right: 0;
  1215. }
  1216. .test_top {
  1217. width: 100%;
  1218. display: flex;
  1219. align-items: center;
  1220. }
  1221. .test_top>.test_top_img {
  1222. height: 40px;
  1223. width: 40px;
  1224. background: rgb(108 150 217);
  1225. margin-right: 10px;
  1226. border-radius: 5px;
  1227. display: flex;
  1228. align-items: center;
  1229. justify-content: center;
  1230. }
  1231. .test_top>.gr {
  1232. background: rgb(142, 189, 176);
  1233. }
  1234. .test_top>.md {
  1235. background: rgb(139, 174, 227);
  1236. }
  1237. .test_top>.js {
  1238. background: rgb(64, 149, 174);
  1239. }
  1240. .test_top>.yy {
  1241. background: rgb(98, 102, 188);
  1242. }
  1243. .test_top>.bj {
  1244. background: rgb(98, 158, 188);
  1245. }
  1246. .test_top>.test_top_img:after {
  1247. content: '';
  1248. display: block;
  1249. width: 23px;
  1250. height: 23px;
  1251. background-size: 100% 100%;
  1252. background-image: url('../../../assets/icon/test/all_icon_b.png');
  1253. }
  1254. .test_top>.gr:after {
  1255. background-image: url('../../../assets/icon/test/gr_icon_b.png');
  1256. }
  1257. .test_top>.md:after {
  1258. background-image: url('../../../assets/icon/test/md_icon_b.png');
  1259. }
  1260. .test_top>.js:after {
  1261. background-image: url('../../../assets/icon/test/js_icon_b.png');
  1262. }
  1263. .test_top>.yy:after {
  1264. background-image: url('../../../assets/icon/test/yy_icon_b.png');
  1265. }
  1266. .test_top>.bj:after {
  1267. background-image: url('../../../assets/icon/test/bj_icon_b.png');
  1268. }
  1269. .test_top>.test_top_title {
  1270. display: flex;
  1271. flex-direction: column;
  1272. justify-content: space-between;
  1273. height: 40px;
  1274. width: calc(100% - 40px - 10px)
  1275. }
  1276. .test_top>.test_top_title>span {
  1277. width: 100;
  1278. display: block;
  1279. word-break: break-all;
  1280. overflow: hidden;
  1281. text-overflow: ellipsis;
  1282. white-space: nowrap;
  1283. }
  1284. .test_top>.test_top_title>span:nth-child(1) {
  1285. font-size: 15px;
  1286. }
  1287. .test_top>.test_top_title>span:nth-child(2) {
  1288. font-size: 14px;
  1289. color: rgb(58, 131, 252);
  1290. }
  1291. .test_box>.test_time {
  1292. margin-top: 10px;
  1293. font-size: 14px;
  1294. color: #a7a7a7;
  1295. display: flex;
  1296. }
  1297. .test_box>.test_time>span:nth-child(1) {
  1298. width: 70px;
  1299. display: flex;
  1300. }
  1301. .test_box>.test_time>span:nth-child(1) > span{
  1302. width: 100%;
  1303. text-align-last: justify;
  1304. }
  1305. .test_box>.test_time>span:nth-child(1)::after{
  1306. content: ':';
  1307. }
  1308. .test_box>.test_time>span:nth-child(2) {
  1309. width: calc(100% - 70px);
  1310. overflow: hidden;
  1311. display: block;
  1312. text-overflow: ellipsis;
  1313. white-space: nowrap;
  1314. word-break: break-all;
  1315. }
  1316. .test_box>.test_btn {
  1317. margin-top: 10px;
  1318. display: flex;
  1319. align-items: center;
  1320. justify-content: space-between;
  1321. }
  1322. .test_box>.test_btn>.test_o_btn {
  1323. display: flex;
  1324. align-items: center;
  1325. }
  1326. .test_box>.test_btn>.test_o_btn>span {
  1327. display: block;
  1328. width: 18px;
  1329. height: 18px;
  1330. background-size: 100% 100%;
  1331. cursor: pointer;
  1332. }
  1333. .test_box>.test_btn>.test_o_btn>.edit {
  1334. background-image: url('../../../assets/icon/test/edit_test_icon.png');
  1335. margin-right: 20px;
  1336. }
  1337. .test_box>.test_btn>.test_o_btn>.check {
  1338. background-image: url('../../../assets/icon/test/check_test_icon.png');
  1339. margin-right: 20px;
  1340. }
  1341. .test_box>.test_btn>.test_o_btn>.delete {
  1342. background-image: url('../../../assets/icon/test/delete_test_icon.png');
  1343. }
  1344. .test_box>.test_btn>.test_type {
  1345. font-size: 12px;
  1346. border-radius: 5px;
  1347. border: 1.5px solid;
  1348. padding: 3px 8px;
  1349. }
  1350. .test_box>.test_btn>.is {
  1351. color: rgb(57, 204, 127);
  1352. background-color: rgba(57, 204, 127, .1);
  1353. }
  1354. .test_box>.test_btn>.no {
  1355. color: rgb(235, 154, 96);
  1356. background-color: rgba(235, 154, 96, .1);
  1357. }
  1358. </style>