safeTest.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. <template>
  2. <div class="i_body_box" style="padding: 0 90px;">
  3. <backPage style="padding: 40px 0 0;" tit="安全巡查"></backPage>
  4. <div class="check_nav" >
  5. <!-- <div class="nav all" v-show="this.ExamineBase.length > 0" :class="{ active: type == '1' }" @click="checkType('1')">
  6. 年度考核
  7. </div> -->
  8. <div class="nav all" :class="{ active: checkTypeValue == typeListStr }"
  9. @click="changeShowType(typeListStr)">
  10. 全部
  11. </div>
  12. <div class="nav" v-for="item in typeList" :key="item.id" :class="{ active: checkTypeValue == item.id,all:['8bfa67ce-e82a-11ef-b508-005056924926','9d3289d2-e82a-11ef-b508-005056924926','a824c728-e82a-11ef-b508-005056924926','8085418b-e82a-11ef-b508-005056924926'].includes(item.id)}"
  13. @click="changeShowType(item.id,item)">{{ item.name }}</div>
  14. </div>
  15. <div class="check_box" v-loading="loading" >
  16. <!-- <examine v-if="type==1"></examine> -->
  17. <div class="noneData" v-if="!worksArray.length && type!=1" style="text-align: center; margin-top: 20px;">
  18. 暂无数据
  19. </div>
  20. <template v-if="type!=1">
  21. <div class="test_panel" v-for="(item, index) in worksArray" :key="index">
  22. <div class="test_panel_title">
  23. <div class="title" :style="{paddingLeft: (item.array.length > 0 || item.carray.length > 0) ? '0' : '30px'}" @click="openWork(index)">
  24. <span class="open" :class="{active: item.open}" v-if="item.array.length > 0 || item.carray.length > 0"></span>
  25. <el-tooltip :content="item.title" placement="top" effect="dark">
  26. <span class="titleN">{{ item.title }}</span>
  27. </el-tooltip>
  28. </div>
  29. <div class="state">
  30. <span :class="{ is: item.array.length > 0, no: !item.array.length }">{{ item.array.length > 0 ? "已完成" : "未完成" }}</span>
  31. </div>
  32. <div class="time">
  33. <span v-if="item.overtime" :class="{isDead: isDeadlinePassed(item.overtime)}">截止时间:{{ item.overtime }}</span>
  34. <span v-else></span>
  35. </div>
  36. <div class="creator" :style="{paddingRight:(!item.carray.length > 0) ? '0' : '0px'}">
  37. <el-tooltip :content="item.username" placement="top" effect="dark">
  38. <span>创建者:{{ item.username }}</span>
  39. </el-tooltip>
  40. </div>
  41. <div class="editBtn2" :style="`${item.open?'display:flex':''}`" v-if="!item.carray.length > 0">
  42. <span v-if="item.array.length === 0">去填写</span>
  43. <span v-else>再填一份</span>
  44. </div>
  45. <div @click="doTest2(item.courseid)" class="editBtn" :style="`${item.open?'display:flex':''}`" v-if="!item.carray.length > 0">
  46. <span v-if="item.array.length === 0">去填写</span>
  47. <span v-else>再填一份</span>
  48. </div>
  49. </div>
  50. <div class="test_panel_box" v-if="item.open">
  51. <div class="test_add_box"
  52. v-if="item.array">
  53. <div class="test" v-for="(test, index) in item.array" :key="test.id">
  54. <div class="time">
  55. <span>提交记录{{item.array.length - index}}</span>
  56. </div>
  57. <!-- <img @click="deleteTest(test.id)" class="delete"
  58. src="../../../../assets/icon/test/delete.png" alt="" /> -->
  59. <div class="utime">
  60. <span>{{ test.utime }}</span>
  61. </div>
  62. <div class="mask">
  63. <div @click="doTest(test.courseid, test.id)">
  64. <span>编辑</span>
  65. </div>
  66. <div @click="deleteTest(test.id)" class="delete">
  67. <span>删除</span>
  68. </div>
  69. <!-- <div @click="checkTest(test.courseid, test.id)">
  70. <span></span><span>查看</span>
  71. </div>
  72. <div @click="copyTest(test.id)">
  73. <span></span><span>复制</span>
  74. </div> -->
  75. </div>
  76. </div>
  77. </div>
  78. <div class="test_add_box"
  79. v-else-if="item.carray" v-loading="!item.carray.length">
  80. <!-- <div class="courseLength" v-for="(course, index) in item.carray" :key="index" @click="doTest3(item, course)">
  81. <span class="finish" :class="{is: course.array.length}"></span>
  82. <span>{{ index+1 }}、</span>
  83. <span>{{ course.title }}</span>
  84. <span>{{ course.username }}</span>
  85. </div> -->
  86. <div class="test courseLength" v-for="(course, index) in item.carray" :key="index">
  87. <div class="time">
  88. <el-tooltip :content="course.title+'-'+course.username" placement="top" effect="dark">
  89. <span>{{ course.title }}-{{ course.username }}</span>
  90. </el-tooltip>
  91. </div>
  92. <div class="finishBox" :class="{is: course.array.length}">
  93. <span class="finish"></span>
  94. <span v-if="course.array.length">已评分</span>
  95. <span v-else>未评分</span>
  96. </div>
  97. <div class="utime" style="margin-left: 30px;">
  98. <span v-if="course.array.length">{{ course.array[0].utime }}</span>
  99. <span v-else></span>
  100. </div>
  101. <div class="mask">
  102. <div @click="doTest3(item, course)">
  103. <span>评分</span>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </template>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import backPage from '../components/backPage.vue'
  116. export default {
  117. components:{
  118. backPage
  119. },
  120. data() {
  121. return {
  122. userid: this.$route.query.userid,
  123. oid: this.$route.query.oid,
  124. type: "",
  125. typeId:'fb2a14c5-e828-11ef-b508-005056924926',
  126. typeList:[],
  127. ExamineBase: [],
  128. typeArray: [],
  129. typeArrayCheck: [],
  130. worksArray: [],
  131. org: this.$route.query.org,
  132. role: this.$route.query.role,
  133. loading: false,
  134. checkTypeValue:""
  135. };
  136. },
  137. computed: {
  138. getNum() {
  139. return function (array) {
  140. let _array = JSON.parse(array);
  141. let num = 0;
  142. _array.forEach(el => {
  143. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  144. el.array.forEach(item => {
  145. if (item.ttype == 2 && item.array.length > 0) {
  146. item.array.forEach(item2 => {
  147. if (item2.ttype == 1 && item2.json) {
  148. num++;
  149. }
  150. });
  151. } else if (item.ttype == 1 && item.json) {
  152. num++;
  153. }
  154. });
  155. } else if (el.ttype == 1 && el.json) {
  156. num++;
  157. }
  158. });
  159. return num;
  160. };
  161. },
  162. getScore() {
  163. return function (array) {
  164. // let _array = JSON.parse(array)
  165. let _score = 0;
  166. let scoreArray = [];
  167. for (var i = 0; i < array.length; i++) {
  168. let _array = JSON.parse(array[i].courseJson);
  169. let score = 0;
  170. for (var j = 0; j < _array.length; j++) {
  171. let el = _array[j];
  172. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  173. for (var k = 0; k < el.array.length; k++) {
  174. let item = el.array[k];
  175. if (item.ttype == 2 && item.array.length > 0) {
  176. for (var z = 0; z < item.array.length; z++) {
  177. let item2 = item.array[z];
  178. if (item2.ttype == 1 && item2.json && item2.json.score2) {
  179. score += parseInt(item2.json.score2);
  180. }
  181. }
  182. } else if (item.ttype == 1 && item.json && item.json.score2) {
  183. score += parseInt(item.json.score2);
  184. }
  185. }
  186. } else if (el.ttype == 1 && el.json && el.json.score2) {
  187. score += parseInt(el.json.score2);
  188. }
  189. }
  190. scoreArray.push(score);
  191. }
  192. scoreArray.forEach(el => {
  193. _score += el;
  194. });
  195. console.log(scoreArray);
  196. return _score ? _score / scoreArray.length : 0;
  197. };
  198. },
  199. getImg() {
  200. return function (array) {
  201. let _array = JSON.parse(array);
  202. let _img = "";
  203. s: for (var j = 0; j < _array.length; j++) {
  204. let el = _array[j];
  205. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  206. for (var k2 = 0; k2 < el.array.length; k2++) {
  207. let item = el.array[k2];
  208. console.log(k2);
  209. if (item.ttype == 2 && item.array.length > 0) {
  210. for (var z = 0; z < item.array.length; z++) {
  211. let item2 = item.array[z];
  212. if (
  213. item2.ttype == 1 &&
  214. item2.type == 5 &&
  215. item2.json &&
  216. item2.json.file &&
  217. item2.json.file.length > 0
  218. ) {
  219. for (var k4 = 0; k4 < item2.json.file.length; k4++) {
  220. let ik = item2.json.file[k4];
  221. if (ik.type == 3) {
  222. _img = ik.url;
  223. break s;
  224. }
  225. }
  226. }
  227. }
  228. } else if (
  229. item.ttype == 1 &&
  230. item.type == 5 &&
  231. item.json &&
  232. item.json.file &&
  233. item.json.file.length > 0
  234. ) {
  235. for (var k3 = 0; k3 < item.json.file.length; k3++) {
  236. let ik = item.json.file[k3];
  237. if (ik.type == 3) {
  238. _img = ik.url;
  239. break s;
  240. }
  241. }
  242. }
  243. }
  244. } else if (
  245. el.ttype == 1 &&
  246. el.type == 5 &&
  247. el.json &&
  248. el.json.file &&
  249. el.json.file.length > 0
  250. ) {
  251. for (var k = 0; k < el.json.file.length; k++) {
  252. let ik = el.json.file[k];
  253. if (ik.type == 3) {
  254. _img = ik.url;
  255. break s;
  256. }
  257. }
  258. }
  259. }
  260. return _img;
  261. };
  262. },
  263. typeListStr(){
  264. let _result = "";
  265. if(this.typeList.length){
  266. _result = this.typeList.map(i=>i.id)
  267. _result.push(this.typeId);
  268. _result = _result.join(',')
  269. }
  270. return _result;
  271. }
  272. },
  273. watch:{
  274. typeId(newValue){
  275. this.changeShowType(newValue)
  276. }
  277. },
  278. methods: {
  279. getNavType() {
  280. let params = {
  281. oid: "",//this.oid
  282. };
  283. this.ajax
  284. .get(this.$store.state.api + "selectTestType", params)
  285. .then(res => {
  286. let _data = res.data[0];
  287. console.log('_data',_data);
  288. // _data.fliter(e=>{
  289. // })
  290. this.typeList = _data.filter(function(item, index) {
  291. return item.pid == 'fb2a14c5-e828-11ef-b508-005056924926';
  292. });
  293. this.changeShowType(this.typeListStr)
  294. // = _data.fliter(e =>{ return e.pid == 'e18d88b3-e828-11ef-b508-005056924926'})
  295. console.log('this.typeList',this.typeList);
  296. })
  297. .catch(err => {
  298. console.log(err);
  299. });
  300. },
  301. getPageBase(type = 1) {
  302. let params = {
  303. typ: type,
  304. org: this.org,
  305. oid: this.oid
  306. };
  307. this.ajax
  308. .get(this.$store.state.api + "selectTestExamineBase", params)
  309. .then(res => {
  310. this.ExamineBase = res.data[0];
  311. if(type == 1 && !res.data[0].length){
  312. this.getPageBase(2)
  313. }
  314. // console.log("selectTestExamineBase", res.data);
  315. })
  316. .catch(error => {
  317. console.log(error);
  318. });
  319. },
  320. isDeadlinePassed(deadline) {
  321. let _line = new Date(deadline)
  322. const currentDate = new Date();
  323. return currentDate > _line;
  324. },
  325. checkType(type) {
  326. this.type = type;
  327. this.getWorks();
  328. },
  329. selectTestType(type) {
  330. let params = {
  331. oid: this.oid
  332. };
  333. this.ajax
  334. .get(this.$store.state.api + "selectTestType", params)
  335. .then(res => {
  336. this.typeArray = res.data[0];
  337. if(type == 1){
  338. this.type = ''
  339. // if (this.typeArray.length) {
  340. // this.type = this.typeArray[0].id;
  341. // } else {
  342. // this.type = '0';
  343. // }
  344. }
  345. this.getWorks()
  346. })
  347. .catch(err => {
  348. console.error(err);
  349. });
  350. },
  351. getWorks() {
  352. this.loading = true;
  353. let params = {
  354. uid: this.userid,
  355. typeid: this.checkTypeValue
  356. };
  357. this.ajax
  358. .get(this.$store.state.api + "getTestWorksPerson_2type", params)
  359. .then(res => {
  360. let array = res.data[0];
  361. let array2 = res.data[1];
  362. // 用于存储归类后的数据的对象
  363. let worksArray = {};
  364. // 遍历原始数据,根据 parentId 进行分组
  365. array2.forEach(item => {
  366. // console.log(item.chapters);
  367. worksArray[item.courseId] = {
  368. id: item.id,
  369. courseid: item.courseId,
  370. title: item.title,
  371. time: item.time,
  372. utime: item.utime,
  373. overtime: item.overtime,
  374. username: item.username,
  375. chapters: item.chapters,
  376. brief: item.brief,
  377. typeid: item.typeid,
  378. array: item.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123' ? 0 : [],
  379. carray: [],
  380. open: false
  381. };
  382. });
  383. worksArray = Object.values(worksArray);
  384. worksArray.forEach(async el => {
  385. if (el.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123') {
  386. let courseJson = this.returnCourseJSON(el.chapters)
  387. if(courseJson && courseJson.courses.length){
  388. let courses = courseJson.courses.join(',')
  389. let _res = await this.getAllCourse(courses)
  390. console.log(_res);
  391. let _carray = []
  392. for(var i=0;i<_res.length;i++){
  393. _carray.push({
  394. courseid: _res[i].courseId,
  395. title: _res[i].title,
  396. username: _res[i].username,
  397. array: []
  398. })
  399. }
  400. el.carray = _carray
  401. }
  402. }
  403. array.forEach(el2 => {
  404. if (el.courseid == el2.courseid && el.typeid != 'dda9728e-5f11-469e-89ee-aca518daf123') {
  405. el.array.push(el2);
  406. }
  407. if(el.courseid == el2.courseid && el.typeid == 'dda9728e-5f11-469e-89ee-aca518daf123'){
  408. let courseid = this.returnCourseId(el2.courseJson)
  409. for(var c = 0; c<el.carray.length;c++){
  410. if(el.carray[c].courseid == courseid){
  411. el.carray[c].array.push(el2);
  412. break
  413. }
  414. }
  415. }
  416. });
  417. });
  418. // worksArray[item.courseid].array.push(item);
  419. this.worksArray = worksArray;
  420. this.loading = false;
  421. this.$forceUpdate();
  422. })
  423. .catch(err => {
  424. this.loading = false;
  425. console.error(err);
  426. });
  427. },
  428. openWork(index){
  429. if(this.worksArray[index].array.length === 0 && this.worksArray[index].carray.length === 0){
  430. return
  431. }
  432. this.worksArray[index].open = !this.worksArray[index].open
  433. this.$forceUpdate()
  434. },
  435. returnA() {
  436. this.$router.push(
  437. "/testStudent?userid=" +
  438. this.userid +
  439. "&oid=" +
  440. this.oid +
  441. "&org=" +
  442. this.org +
  443. "&role=" +
  444. this.role
  445. );
  446. },
  447. checkTest(cid, tid) {
  448. this.$router.push(
  449. "/checkTest?cid=" +
  450. cid +
  451. "&tid=" +
  452. tid +
  453. "&userid=" +
  454. this.userid +
  455. "&oid=" +
  456. this.oid +
  457. "&org=" +
  458. this.org +
  459. "&type=3" +
  460. "&role=" +
  461. this.role
  462. );
  463. },
  464. doTest(cid, tid) {
  465. this.$router.push(
  466. "/doTest?cid=" +
  467. cid +
  468. "&tid=" +
  469. tid +
  470. "&userid=" +
  471. this.userid +
  472. "&oid=" +
  473. this.oid +
  474. "&org=" +
  475. this.org +
  476. "&type=3" +
  477. "&role=" +
  478. this.role
  479. );
  480. },
  481. doTest2(cid) {
  482. this.$router.push(
  483. "/doTest?cid=" +
  484. cid +
  485. "&userid=" +
  486. this.userid +
  487. "&oid=" +
  488. this.oid +
  489. "&org=" +
  490. this.org +
  491. "&type=3" +
  492. "&role=" +
  493. this.role
  494. );
  495. },
  496. doTest3(item, course){
  497. if(course.array.length){
  498. this.$router.push(
  499. "/doTest?cid=" +
  500. item.courseid +
  501. "&tid=" +
  502. course.array[0].id +
  503. "&userid=" +
  504. this.userid +
  505. "&oid=" +
  506. this.oid +
  507. "&org=" +
  508. this.org +
  509. "&type=3" +
  510. "&role=" +
  511. this.role
  512. );
  513. }else{
  514. this.$router.push(
  515. "/doTest?cid=" +
  516. item.courseid +
  517. "&userid=" +
  518. this.userid +
  519. "&oid=" +
  520. this.oid +
  521. "&org=" +
  522. this.org +
  523. "&type=3" +
  524. "&courseid=" +
  525. course.courseid +
  526. "&role=" +
  527. this.role
  528. );
  529. }
  530. },
  531. copyTest(tid) {
  532. let params = [
  533. {
  534. tid: tid,
  535. uid: this.userid
  536. }
  537. ];
  538. this.ajax
  539. .post(this.$store.state.api + "copyTestWorks", params)
  540. .then(res => {
  541. this.$message.success("复制成功");
  542. this.getWorks();
  543. })
  544. .catch(err => {
  545. console.error(err);
  546. });
  547. },
  548. deleteTest(tid) {
  549. let _this = this;
  550. _this
  551. .$confirm("确定删除此填写的表单么?", "提示", {
  552. confirmButtonText: "确定",
  553. cancelButtonText: "取消",
  554. type: "warning"
  555. })
  556. .then(() => {
  557. let params = [
  558. {
  559. tid: tid
  560. }
  561. ];
  562. _this.ajax
  563. .post(_this.$store.state.api + "deleteTestCourseWorks", params)
  564. .then(res => {
  565. _this.$message.success("删除成功");
  566. _this.getWorks();
  567. })
  568. .catch(err => {
  569. console.error(err);
  570. });
  571. })
  572. .catch(() => {
  573. return;
  574. });
  575. },
  576. returnCourseJSON(array) {
  577. let _array = JSON.parse(array);
  578. let courseJson = '';
  579. s: for (var j = 0; j < _array.length; j++) {
  580. let el = _array[j];
  581. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  582. for (var k2 = 0; k2 < el.array.length; k2++) {
  583. let item = el.array[k2];
  584. console.log(k2);
  585. if (item.ttype == 2 && item.array.length > 0) {
  586. for (var z = 0; z < item.array.length; z++) {
  587. let item2 = item.array[z];
  588. if (
  589. item2.ttype == 1 &&
  590. item2.type == 6 &&
  591. item2.json
  592. ) {
  593. courseJson = item2.json
  594. break s;
  595. }
  596. }
  597. } else if (
  598. item.ttype == 1 &&
  599. item.type == 6 &&
  600. item.json
  601. ) {
  602. courseJson = item.json
  603. break s;
  604. }
  605. }
  606. } else if (
  607. el.ttype == 1 &&
  608. el.type == 6 &&
  609. el.json
  610. ) {
  611. courseJson = el.json
  612. break s;
  613. }
  614. }
  615. return courseJson;
  616. },
  617. returnCourseId(array) {
  618. let _array = JSON.parse(array);
  619. let courseJson = '';
  620. s: for (var j = 0; j < _array.length; j++) {
  621. let el = _array[j];
  622. if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
  623. for (var k2 = 0; k2 < el.array.length; k2++) {
  624. let item = el.array[k2];
  625. console.log(k2);
  626. if (item.ttype == 2 && item.array.length > 0) {
  627. for (var z = 0; z < item.array.length; z++) {
  628. let item2 = item.array[z];
  629. if (
  630. item2.ttype == 1 &&
  631. item2.type == 6 &&
  632. item2.json && item2.json.answer2
  633. ) {
  634. courseJson = item2.json.answer2
  635. break s;
  636. }
  637. }
  638. } else if (
  639. item.ttype == 1 &&
  640. item.type == 6 &&
  641. item.json && item.json.answer2
  642. ) {
  643. courseJson = item.json.answer2
  644. break s;
  645. }
  646. }
  647. } else if (
  648. el.ttype == 1 &&
  649. el.type == 6 &&
  650. el.json && el.json.answer2
  651. ) {
  652. courseJson = el.json.answer2
  653. break s;
  654. }
  655. }
  656. return courseJson;
  657. },
  658. async getAllCourse(id) {
  659. let params = {
  660. cid: id,
  661. };
  662. let res = await this.ajax.get(this.$store.state.api + "getCourseInfoTestAll", params)
  663. return res.data[0]
  664. },
  665. changeShowType(value){
  666. console.log('value',value);
  667. this.checkTypeValue = value;
  668. this.getWorks();
  669. }
  670. },
  671. mounted() {
  672. // this.selectTestType(1);
  673. // this.getPageBase()
  674. this.getNavType()
  675. console.log('this.typeListStr',this.typeListStr);
  676. // if(this.typeListStr){
  677. // this.changeShowType(this.typeListStr)
  678. // this.checkTypeValue = this.typeId
  679. // }
  680. },
  681. // activated(){
  682. // // this.selectTestType(2);
  683. // if(this.typeListStr){
  684. // this.changeShowType(this.typeListStr)
  685. // // this.checkTypeValue = this.typeId
  686. // }
  687. // },
  688. };
  689. </script>
  690. <style scoped>
  691. .i_body_box {
  692. height: calc(100% - 10px);
  693. padding: 10px 0 0;
  694. box-sizing: border-box;
  695. }
  696. .check_nav {
  697. display: flex;
  698. height: 50px;
  699. align-items: center;
  700. padding: 0;
  701. box-sizing: border-box;
  702. width: 100%;
  703. overflow: auto;
  704. }
  705. .check_nav>.nav {
  706. width: 120px;
  707. height: 100%;
  708. display: flex;
  709. align-items: center;
  710. justify-content: center;
  711. color: rgb(167, 167, 167);
  712. /* background: #000000; */
  713. cursor: pointer;
  714. min-width: fit-content;
  715. margin-right: 10px;
  716. }
  717. .check_nav>.active {
  718. color: #3681fc;
  719. background: rgb(248, 250, 254);
  720. border-radius: 10px 10px 0 0;
  721. }
  722. .check_nav>.all::before,
  723. .check_nav>.gr::before,
  724. .check_nav>.md::before,
  725. .check_nav>.jy::before,
  726. .check_nav>.bj::before,
  727. .check_nav>.yy::before {
  728. content: "";
  729. display: block;
  730. width: 18px;
  731. height: 18px;
  732. background-size: 100% 100%;
  733. margin-right: 5px;
  734. }
  735. .check_nav>.all::before {
  736. background-image: url('../../../../assets/icon/test/all_icon.png');
  737. }
  738. .check_nav>.active.all::before {
  739. background-image: url('../../../../assets/icon/test/all_icon_active.png');
  740. }
  741. .check_nav>.gr::before {
  742. background-image: url('../../../../assets/icon/test/gr_icon.png');
  743. }
  744. .check_nav>.active.gr::before {
  745. background-image: url('../../../../assets/icon/test/gr_icon_active.png');
  746. }
  747. .check_nav>.md::before {
  748. background-image: url('../../../../assets/icon/test/md_icon.png');
  749. }
  750. .check_nav>.active.md::before {
  751. background-image: url('../../../../assets/icon/test/md_icon_active.png');
  752. }
  753. .check_nav>.jy::before {
  754. background-image: url('../../../../assets/icon/test/jy_icon.png');
  755. }
  756. .check_nav>.active.jy::before {
  757. background-image: url('../../../../assets/icon/test/jy_icon_active.png');
  758. }
  759. .check_nav>.yy::before {
  760. background-image: url('../../../../assets/icon/test/yy_icon.png');
  761. }
  762. .check_nav>.active.yy::before {
  763. background-image: url('../../../../assets/icon/test/yy_icon_active.png');
  764. }
  765. .check_nav>.bj::before {
  766. background-image: url('../../../../assets/icon/test/bj_icon.png');
  767. }
  768. .check_nav>.active.bj::before {
  769. background-image: url('../../../../assets/icon/test/bj_icon_active.png');
  770. }
  771. .check_box {
  772. height: calc(100% - 130px);
  773. overflow: auto;
  774. padding: 0 0 20px;
  775. box-sizing: border-box;
  776. background: rgb(248, 250, 254);
  777. }
  778. .test_panel {
  779. width: calc(100% - 40px);
  780. margin: 20px auto 0;
  781. background: #fff;
  782. border-radius: 10px;
  783. /* height: 300px; */
  784. overflow: hidden;
  785. box-shadow: 0 2px 5px 1px #0001;
  786. }
  787. .test_panel:hover{
  788. box-shadow: 0 0 2px 1px #3681FC;
  789. }
  790. .test_panel:hover>.test_panel_title>.title{
  791. color:#5996FD
  792. }
  793. .test_panel_title:hover>.editBtn{
  794. display: flex;
  795. }
  796. .test_panel_title:hover>.editBtn2{
  797. display: flex;
  798. }
  799. .test_panel+.test_panel {
  800. margin-top: 15px;
  801. }
  802. .test_panel_title {
  803. height: 50px;
  804. display: flex;
  805. align-items: center;
  806. width: 100%;
  807. position: relative;
  808. /* justify-content: space-between; */
  809. /* padding: 0 20px; */
  810. box-sizing: border-box;
  811. /* border-bottom: 2px solid #f0f0f0; */
  812. }
  813. .test_panel_title>.title {
  814. display: flex;
  815. align-items: center;
  816. width: 300px;
  817. margin-left: 20px;
  818. cursor: pointer;
  819. }
  820. .test_panel_title>.title>.open{
  821. width: 20px;
  822. height:20px;
  823. margin-right: 10px;
  824. background-image: url('../../../../assets/icon/test/chevron-right.png');
  825. background-size: 100% 100%;
  826. cursor:pointer;
  827. transition:all .3s;
  828. opacity: .5;
  829. }
  830. .test_panel_title>.title>.open.active{
  831. transform: rotate(90deg);
  832. opacity: 1;
  833. }
  834. .test_panel_title>.state{
  835. margin-left: auto;
  836. min-width: fit-content;
  837. }
  838. .test_panel_title>.state > span {
  839. font-size: 14px;
  840. padding: 5px 8px;
  841. border-radius: 5px;
  842. margin-right: 0;
  843. }
  844. .test_panel_title>.state>.is:nth-child(1) {
  845. color: #17C469;
  846. background: #EFFCF5;
  847. border: 1px solid #EFFCF5;
  848. }
  849. .test_panel_title>.state>.no:nth-child(1) {
  850. color: #3681FC;
  851. background: #E0EAFB;
  852. border: 1px solid #E0EAFB;
  853. }
  854. .test_panel_title>.title>.titleN {
  855. font-size: 18px;
  856. font-weight: 600;
  857. max-width: calc(100% - 20px - 10px);
  858. overflow: hidden;
  859. text-overflow: ellipsis;
  860. white-space: nowrap;
  861. }
  862. .test_panel_title>.time {
  863. font-size: 16px;
  864. color: #a1a1a1;
  865. min-width: 160px;
  866. margin: 0 30px;
  867. }
  868. .test_panel_title>.creator {
  869. font-size: 16px;
  870. color: #a1a1a1;
  871. max-width: 160px;
  872. min-width: 160px;
  873. overflow: hidden;
  874. text-overflow: ellipsis;
  875. white-space: nowrap;
  876. }
  877. .test_panel_title>.editBtn {
  878. font-size: 16px;
  879. color: #fff;
  880. background: #3681fc;
  881. height: 100%;
  882. display: none;
  883. align-items: center;
  884. padding: 0 15px;
  885. cursor: pointer;
  886. position: absolute;
  887. right: 0;
  888. }
  889. .test_panel_title>.editBtn2 {
  890. font-size: 16px;
  891. color: #fff;
  892. background: #3681fc;
  893. height: 100%;
  894. display: none;
  895. align-items: center;
  896. padding: 0 15px;
  897. cursor: pointer;
  898. }
  899. .test_panel_title>.time>span+span {
  900. margin-left: 10px;
  901. }
  902. .test_panel_box {
  903. border-top: 2px solid #f0f0f0;
  904. width: 100%;
  905. display: flex;
  906. align-items: center;
  907. padding: 5px 20px;
  908. box-sizing: border-box;
  909. }
  910. .test_panel_box>.detail {
  911. width: calc(100% - 350px - 20px);
  912. margin-right: 20px;
  913. color: #a1a1a1;
  914. font-size: 14px;
  915. line-height: 24px;
  916. word-break: break-all;
  917. display: -webkit-box;
  918. -webkit-line-clamp: 4;
  919. -webkit-box-orient: vertical;
  920. overflow: hidden;
  921. }
  922. .test_panel_box>.panel {
  923. display: flex;
  924. align-items: center;
  925. justify-content: space-between;
  926. width: 350px;
  927. min-width: 350px;
  928. }
  929. .test_panel_box>.panel>.score {
  930. height: 110px;
  931. display: flex;
  932. align-items: center;
  933. justify-content: center;
  934. flex-direction: column;
  935. border: 1px solid #dbdbdb;
  936. background: rgb(252, 252, 252);
  937. width: 120px;
  938. border-radius: 5px;
  939. }
  940. .test_panel_box>.panel>.score:nth-child(1) {
  941. display: flex;
  942. }
  943. .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(1) {
  944. font-size: 30px;
  945. font-weight: 700;
  946. }
  947. .test_panel_box>.panel>.score>div:nth-child(1)>span:nth-child(2) {
  948. margin-left: 5px;
  949. }
  950. .test_panel_box>.panel>.score>div:nth-child(2) {
  951. font-size: 14px;
  952. margin-top: 10px;
  953. color: #a1a1a1;
  954. }
  955. .test_panel_box>.panel>.btn {
  956. height: 100px;
  957. display: flex;
  958. flex-direction: column;
  959. justify-content: space-between;
  960. }
  961. .test_panel_box>.panel>.btn>div {
  962. display: flex;
  963. color: rgb(69, 141, 255);
  964. align-items: center;
  965. cursor: pointer;
  966. font-size: 14px;
  967. }
  968. /* .test_panel_box > .panel >.btn > div + div{
  969. margin: 15px 0 0 0;
  970. } */
  971. .test_panel_box>.panel>.btn>div>span:nth-child(1) {
  972. display: block;
  973. width: 13px;
  974. height: 13px;
  975. background-size: 100% 100%;
  976. margin-right: 7px;
  977. }
  978. .test_panel_box>.panel>.btn>div:nth-child(1)>span:nth-child(1) {
  979. background-image: url('../../../../assets/icon/test/edit_icon.png');
  980. }
  981. .test_panel_box>.panel>.btn>div:nth-child(2)>span:nth-child(1) {
  982. background-image: url('../../../../assets/icon/test/check_icon.png');
  983. }
  984. .test_panel_box>.panel>.btn>div:nth-child(3)>span:nth-child(1) {
  985. background-image: url('../../../../assets/icon/test/paste_icon.png');
  986. }
  987. .test_add_box {
  988. width: 100%;
  989. box-sizing: border-box;
  990. }
  991. .test_add_box>.test {
  992. width: 100%;
  993. height: 40px;
  994. border-radius: 5px;
  995. display: flex;
  996. align-items: center;
  997. }
  998. .test_add_box>.test>img {
  999. width: 100%;
  1000. height: 100%;
  1001. object-fit: cover;
  1002. border-radius: 5px;
  1003. }
  1004. .test_add_box>.test+.test {
  1005. /* margin-left: 10px; */
  1006. }
  1007. .test_add_box>.test>.time {
  1008. display: flex;
  1009. /* justify-content: center; */
  1010. align-items: center;
  1011. font-size: 14px;
  1012. width: 300px;
  1013. padding-left: 30px;
  1014. box-sizing: border-box;
  1015. }
  1016. .test_add_box>.test>.time>span {
  1017. /* margin-top: 5px; */
  1018. overflow: hidden;
  1019. text-overflow: ellipsis;
  1020. white-space: nowrap;
  1021. }
  1022. .test_add_box>.test>.utime {
  1023. font-size: 14px;
  1024. width: 160px;
  1025. min-width: 160px;
  1026. margin: 0 30px 0 auto;
  1027. }
  1028. .test_add_box>.test>.mask {
  1029. display: flex;
  1030. align-items: center;
  1031. padding-right: 58px;
  1032. max-width: 160px;
  1033. min-width: 160px;
  1034. }
  1035. .test_add_box>.test>.delete {
  1036. position: absolute;
  1037. width: 20px;
  1038. height: 20px;
  1039. right: -5px;
  1040. top: -5px;
  1041. cursor: pointer;
  1042. z-index: 2;
  1043. display: none;
  1044. }
  1045. .test_add_box>.test>.mask>div {
  1046. display: flex;
  1047. align-items: center;
  1048. cursor: pointer;
  1049. font-size: 14px;
  1050. color: #3681FC;
  1051. }
  1052. .test_add_box>.test>.mask>.delete {
  1053. color: #EE3E3E;
  1054. }
  1055. .test_add_box>.test>.mask>div+div {
  1056. /* margin: 10px 0 0 0; */
  1057. margin-left: 15px;
  1058. }
  1059. /*
  1060. .test_add_box>.test>.mask>div>span:nth-child(1) {
  1061. display: block;
  1062. width: 13px;
  1063. height: 13px;
  1064. background-size: 100% 100%;
  1065. margin-right: 7px;
  1066. }
  1067. .test_add_box>.test>.mask>div:nth-child(1)>span:nth-child(1) {
  1068. background-image: url('../../../../assets/icon/test/edit_icon.png');
  1069. }
  1070. .test_add_box>.test>.mask>div:nth-child(2)>span:nth-child(1) {
  1071. background-image: url('../../../../assets/icon/test/check_icon.png');
  1072. }
  1073. .test_add_box>.test>.mask>div:nth-child(3)>span:nth-child(1) {
  1074. background-image: url('../../../../assets/icon/test/paste_icon.png');
  1075. } */
  1076. .bgColor {
  1077. background: #466b99;
  1078. }
  1079. /* .courseLength{
  1080. width: 100%;
  1081. cursor: pointer;
  1082. margin-bottom: 10px;
  1083. display: flex;
  1084. align-items: center;
  1085. }
  1086. .courseLength > span + span{
  1087. margin-left: 10px;
  1088. } */
  1089. .courseLength > .finishBox {
  1090. display: flex;
  1091. color: #a1a1a1;
  1092. font-size: 14px;
  1093. margin-left: auto;
  1094. align-items: center;
  1095. }
  1096. .courseLength > .finishBox > .finish{
  1097. width: 15px;
  1098. height: 15px;
  1099. background-image: url('../../../../assets/icon/test/icon_course.png');
  1100. background-size: 100% 100%;
  1101. margin-right: 5px;
  1102. }
  1103. .courseLength > .finishBox.is > .finish{
  1104. background-image: url('../../../../assets/icon/test/icon_course_check.png');
  1105. }
  1106. .courseLength > .finishBox.is{
  1107. color: #000
  1108. }
  1109. .isDead{
  1110. color:#EE3E3E;
  1111. }
  1112. </style>