index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249
  1. <template>
  2. <div class="pb_content" style="background: #f0f2f5;" v-loading="loading">
  3. <div class="pb_content_body" style="position: relative; margin: 0">
  4. <div class="right">
  5. <div class="courseTop">
  6. <div class="stepsNav">
  7. <el-breadcrumb separator-class="el-icon-arrow-right">
  8. <el-breadcrumb-item :to="{
  9. path:
  10. '/test?userid=' +
  11. userid +
  12. '&oid=' +
  13. oid +
  14. '&org=' +
  15. org +
  16. '&role=' +
  17. role,
  18. }">表单管理</el-breadcrumb-item>
  19. <el-breadcrumb-item>
  20. <span style="color: rgb(15, 126, 255)">查看表单</span>
  21. </el-breadcrumb-item>
  22. </el-breadcrumb>
  23. </div>
  24. <div class="r_pub_button_retrun" @click="retrunCourse">返回</div>
  25. </div>
  26. <div class="step_box" ref="stepBox">
  27. <div class="test_title">
  28. <div class="left">
  29. <div class="title">{{ testJson.title }}</div>
  30. <div class="info">
  31. <div class="info_box" v-if="testJson.typeN">
  32. <span>类型:</span>
  33. <span>{{ testJson.typeN }}</span>
  34. </div>
  35. <div class="info_box">
  36. <span>填写范围:</span>
  37. <span>{{ testJson.juriP ? testJson.juriP : '所有人' }}</span>
  38. </div>
  39. <div class="info_box" v-if="testJson.overtime">
  40. <span>截止时间:</span>
  41. <span>{{ testJson.overtime }}</span>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="right">
  46. <div class="data_box">
  47. <span>提交数量</span>
  48. <span><span class="big">{{ works.length }}</span>份</span>
  49. </div>
  50. <div class="data_box" v-if="testJson.juriP">
  51. <span>表单完成率</span>
  52. <span><span class="big">{{ (iscount / pcount * 100).toFixed(0) }}</span>%</span>
  53. </div>
  54. <div class="data_box" v-if="testJson.juriP">
  55. <span>未完成人数</span>
  56. <span><span class="big">{{ pcount - iscount }}</span></span>
  57. </div>
  58. <div class="btn_box" @click="dialogVisibleShare = true">
  59. <span></span>
  60. <span>提醒</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="search_nav">
  65. <div class="right">
  66. <span :class="{ active: stype == 1 }" @click="checkDataType(1)">按题目查看</span>
  67. <span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
  68. </div>
  69. <div class="left">
  70. <div style="margin-right: 10px;position: relative;" v-if="stype == 2">
  71. <el-input v-model="courseName" class="student_input" placeholder="请输入需要搜索的姓名"></el-input>
  72. <span class="serach_icon" @click="searchCourse"></span>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="title_content" v-if="stype == 1">
  77. <div class="title_box" v-if="!testArray.length"
  78. style="display: flex;align-items: center;justify-content: center;height: 500px;">
  79. 暂无内容
  80. </div>
  81. <div class="title_box" v-for="(item, index) in testArray" :key="index">
  82. <div class="title">
  83. <el-tooltip :content="selectType(item)" placement="top" effect="dark">
  84. <span class="test_icon"
  85. :class="{ test_icon_check: item.type == 1 && item.atype == 2, test_icon_checkO: item.type == 1 && item.atype == 1, test_icon_gap: item.type == 3, test_icon_file: item.type == 5 }"></span>
  86. </el-tooltip>
  87. <span>{{ item.title }}</span>
  88. </div>
  89. <div class="detail" v-if="item.detail">{{ item.detail }}</div>
  90. <div class="content1" v-if="item.type == 1">
  91. <div class="left">
  92. <div class="title">
  93. <span>选项</span>
  94. <span>小计</span>
  95. <span>比例</span>
  96. </div>
  97. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  98. <span>
  99. <el-tooltip :content="data.name" placement="top" effect="dark">
  100. <!-- content to trigger tooltip here -->
  101. <span>{{ data.name }}</span>
  102. </el-tooltip>
  103. </span>
  104. <span>{{ data.count }}</span>
  105. <span>
  106. <el-progress style="display: flex;align-items: center;" :stroke-width="12" color="#3681fc"
  107. :percentage="data.count ? parseFloat(((data.count / item.count) * 100).toFixed(2)) : 0"></el-progress>
  108. </span>
  109. </div>
  110. </div>
  111. <div class="right">
  112. <checkPie :dataJ="item.array"></checkPie>
  113. </div>
  114. </div>
  115. <div class="content2" v-if="item.type == 3">
  116. <div class="left">
  117. <div class="title">
  118. <span>序号</span>
  119. <span>词频</span>
  120. <span>答案文本</span>
  121. </div>
  122. <div class="data" v-for="(data, index2) in item.array" :key="index + '-' + index2">
  123. <span>{{ index2 + 1 }}</span>
  124. <span>{{ data.count }}次</span>
  125. <el-tooltip :content="data.name" placement="top" effect="dark">
  126. <!-- content to trigger tooltip here -->
  127. <span>{{ data.name }}</span>
  128. </el-tooltip>
  129. </div>
  130. </div>
  131. <div class="right">
  132. <wordcloud :data="item.array" nameKey="name" valueKey="count" :showTooltip="false"
  133. :wordClick="wordClickHandler">
  134. </wordcloud>
  135. </div>
  136. </div>
  137. <div class="content3" v-if="item.type == 5">
  138. <div class="file" v-for="(file, index2) in item.array" :key="index + '-' + index2"
  139. @click.stop="checkFile(file)">
  140. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  141. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  142. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  143. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  144. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  145. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  146. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  147. <div class="name">
  148. <el-tooltip :content="file.name" placement="top" effect="dark">
  149. <span>{{ file.name }}</span>
  150. </el-tooltip>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="table_content" v-if="stype == 2">
  157. <el-table class="el-table" ref="table" :data="worksArray" border :height="tableHeight" :fit="true" :key="2"
  158. v-loading="isLoading" style="width: 100%" :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }">
  159. <el-table-column fixed label="序号" width="80px" align="left">
  160. <template slot-scope="scope">
  161. {{ scope.$index + 1 }}
  162. </template>
  163. </el-table-column>
  164. <el-table-column fixed prop="name" label="提交人" width="120px" align="left">
  165. </el-table-column>
  166. <el-table-column prop="time" label="提交时间" width="170px" align="left">
  167. </el-table-column>
  168. <el-table-column v-for="(item, index) in chapters" :key="index" :label="item.json.title" min-width="150"
  169. align="left"
  170. :filters="item.type == 1 ? item.nameFilters : null"
  171. :filter-method="item.type == 1 ? (value,row)=>{return filterName(value,row,index)} : null"
  172. :filter-placement="item.type == 1 ? filterPlacement : null">
  173. <template slot-scope="scope">
  174. <div v-if="scope.row.array[index].type == 1" style="display: flex; flex-wrap: wrap;">
  175. <span class="answer_type" v-for="(answer2, index2) in scope.row.array[index].json.answer2"
  176. :key="index + '-' + index2">{{ scope.row.array[index].json.array[answer2].option }}</span>
  177. </div>
  178. <div v-if="scope.row.array[index].type == 3" style="display: flex; flex-wrap: wrap;">
  179. {{ scope.row.array[index].json.answer2 }}
  180. </div>
  181. <div v-if="scope.row.array[index].type == 5" style="display: flex; flex-wrap: wrap;" class="table_file">
  182. <div class="file" v-for="(file, index2) in scope.row.array[index].json.file"
  183. :key="index + '-' + index2" @click.stop="checkFile(file)">
  184. <img class="download" src="../../../../assets/icon/fileIcon/download.png"
  185. @click.stop="downloadFile(file)" :style="{ right: '10px' }" />
  186. <img class="img" :src="wordIcon" alt="" v-if="file.type == 1" />
  187. <img class="img" :src="videoIcon" alt="" v-if="file.type == 2" />
  188. <img class="img" :src="file.url" alt="" v-if="file.type == 3" />
  189. <img class="img" :src="wordIcon" alt="" v-if="file.type == 4" />
  190. <img class="img" :src="fileIcon" alt="" v-if="file.type == 5" />
  191. <div class="name">
  192. <el-tooltip :content="file.name" placement="top" effect="dark">
  193. <span>{{ file.name }}</span>
  194. </el-tooltip>
  195. </div>
  196. </div>
  197. </div>
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="操作" width="200px" fixed="right">
  201. <template slot-scope="scope">
  202. <el-button @click="getTest(scope.row)" type="primary" size="small">查看</el-button>
  203. <el-button @click="deleteTest(scope.row.id)" type="primary" size="small">删除</el-button>
  204. </template>
  205. </el-table-column>
  206. </el-table>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <share-box :testJson="testJson" :dialogVisibleShare.sync="dialogVisibleShare"></share-box>
  212. <wpdf :dialogVisiblePdf.sync="dialogVisiblePdf" :url="wurl"></wpdf>
  213. <wVideo :dialogVisibleVideo.sync="dialogVisibleVideo" :url="wurl"></wVideo>
  214. <wOffice :dialogVisibleOffice.sync="dialogVisibleOffice" :url="wurl"></wOffice>
  215. </div>
  216. </template>
  217. <script>
  218. import shareBox from '../shareBox/index.vue'
  219. import videoIcon from '../../../../assets/icon/fileIcon/isVideo.png'
  220. import wordIcon from '../../../../assets/icon/fileIcon/isWord.png'
  221. import fileIcon from '../../../../assets/icon/fileIcon/word2.png'
  222. import wVideo from "../file/wVideo.vue";
  223. import wpdf from "../file/wPdf2.vue";
  224. import wOffice from "../file/wOffice.vue";
  225. import wordcloud from 'vue-wordcloud';
  226. import checkPie from '../data/checkPie.vue';
  227. export default {
  228. components: {
  229. shareBox,
  230. wVideo,
  231. wpdf,
  232. wOffice,
  233. checkPie,
  234. wordcloud
  235. },
  236. data() {
  237. return {
  238. userid: this.$route.query.userid,
  239. oid: this.$route.query.oid,
  240. org: this.$route.query.org,
  241. role: this.$route.query.role,
  242. cid: this.$route.query.cid,
  243. title: "",
  244. testType: [],
  245. see: false,
  246. cJson: [],
  247. loading: false,
  248. look: "",
  249. tableHeight: 500,
  250. isLoading: false,
  251. pageSize: 10,
  252. total: 0,
  253. page: 1,
  254. tableData: [],
  255. testJson: {},
  256. works: [],
  257. iscount: 0,
  258. pcount: 0,
  259. stype: 1,
  260. courseName: "",
  261. dialogVisibleShare: false,
  262. worksArray: [],
  263. testArray: [],
  264. options2: {
  265. 1: "选择题",
  266. // 2: "问答题",
  267. 3: "问答题",
  268. 4: "添加文档",
  269. 5: "附件"
  270. },
  271. videoIcon: videoIcon,
  272. wordIcon: wordIcon,
  273. fileIcon: fileIcon,
  274. dialogVisiblePdf: false,
  275. dialogVisibleVideo: false,
  276. dialogVisibleOffice: false,
  277. wurl: "",
  278. chapters: [],
  279. filterPlacement: 'bottom-end',
  280. };
  281. },
  282. watch: {},
  283. computed: {
  284. // vcWords() {
  285. // return function (array) {
  286. // let _array = [];
  287. // if (array.length) {
  288. // for (var i = 0; i < array.length; i++) {
  289. // _array.push(
  290. // {
  291. // text: array[i].name,
  292. // weight: array[i].count,
  293. // }
  294. // )
  295. // }
  296. // }
  297. // console.log(_array);
  298. // return array.length ? _array : [];
  299. // };
  300. // },
  301. selectType() {
  302. return function (item) {
  303. if (item.type == 1 && item.atype == 2) {
  304. return '多选题'
  305. } else if (item.type == 1 && item.atype == 1) {
  306. return '单选题'
  307. } else if (item.type == 3) {
  308. return '问答题'
  309. } else if (item.type == 5) {
  310. return '附件'
  311. }
  312. };
  313. }
  314. },
  315. methods: {
  316. filterName(value, row,index) {
  317. let name = []
  318. for(var i=0;i<row.array[index].json.answer2.length;i++){
  319. name.push(row.array[index].json.array[row.array[index].json.answer2[i]].option)
  320. }
  321. console.log(name.indexOf(value) != -1);
  322. return name.indexOf(value) != -1;
  323. },
  324. wordClickHandler(name, value) {
  325. // this.$notify({
  326. // title: name,
  327. // message: "数量:"+value
  328. // });
  329. },
  330. retrunCourse() {
  331. this.goTo(
  332. "/test?userid=" +
  333. this.userid +
  334. "&oid=" +
  335. this.oid +
  336. "&org=" +
  337. this.org +
  338. "&role=" +
  339. this.role
  340. );
  341. },
  342. goTo(path) {
  343. this.$router.push(path);
  344. },
  345. tableRowClassName({ row, rowIndex }) {
  346. if ((rowIndex + 1) % 2 === 0) {
  347. return "even_row";
  348. } else {
  349. return "";
  350. }
  351. },
  352. changeHeight() {
  353. if (this.stype == 1) {
  354. return
  355. }
  356. this.tableHeight = this.$refs.stepBox.offsetHeight - 100;
  357. if (this.tableHeight <= 530) {
  358. this.tableHeight = 530;
  359. }
  360. // 监听窗口大小变化
  361. let self = this;
  362. window.onresize = function () {
  363. if (self.stype == 1) {
  364. return
  365. }
  366. self.tableHeight = this.$refs.stepBox.offsetHeight - 100;
  367. if (self.tableHeight <= 530) {
  368. self.tableHeight = 530;
  369. }
  370. };
  371. // this.$refs.table.$el.offsetTop:表格距离浏览器的高度 //200表示你想要调整的表格距离底部的高度(你可以自己随意调整),因为我们一般都有放分页组件的,所以需要给它留一个高度
  372. },
  373. handleCurrentChange(val) {
  374. this.page = val;
  375. this.getData();
  376. },
  377. getTest(row) {
  378. this.$router.push(
  379. "/checkTest2?cid=" +
  380. row.courseid +
  381. "&userid=" +
  382. this.userid +
  383. "&userid2=" +
  384. row.userid +
  385. "&tid=" +
  386. row.id +
  387. "&oid=" +
  388. this.oid +
  389. "&org=" +
  390. this.org +
  391. "&type=2" +
  392. "&role=" +
  393. this.role
  394. );
  395. },
  396. checkDataType(type) {
  397. if (this.stype != type) {
  398. this.stype = type
  399. this.courseName = ''
  400. this.getData();
  401. this.changeHeight();
  402. }
  403. },
  404. searchCourse() {
  405. this.getData()
  406. },
  407. getData() {
  408. this.isLoading = true;
  409. let params = {
  410. cid: this.cid,
  411. cn: this.courseName
  412. };
  413. this.ajax
  414. .get(this.$store.state.api + "getTestWorksNoPage", params)
  415. .then((res) => {
  416. this.isLoading = false;
  417. this.testJson = res.data[0][0]
  418. this.works = res.data[1]
  419. this.iscount = res.data[2][0].count
  420. this.pcount = res.data[3][0].count
  421. let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  422. this.chapters = this.setFilter(this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
  423. let testArray = []
  424. let array = []
  425. for (let i = 0; i < this.works.length; i++) {
  426. let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  427. if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
  428. let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(this.works[i].courseJson))))
  429. array.push({
  430. courseid: this.works[i].courseid,
  431. id: this.works[i].id,
  432. userid: this.works[i].userid,
  433. name: this.works[i].username,
  434. time: this.works[i].time,
  435. array: _json
  436. })
  437. }
  438. }
  439. for (var i = 0; i < this.chapters.length; i++) {
  440. let el = this.chapters[i]
  441. let topic = {
  442. type: el.type,
  443. title: el.json ? el.json.title : '',
  444. detail: el.json ? el.json.detail : '',
  445. atype: el.json ? el.json.type : '',
  446. choice: el.json ? el.json.array : '',
  447. array: [],
  448. answer: el.json ? el.json.answer : '',
  449. count: 0
  450. }
  451. if (topic.type == 1) {
  452. for (var t = 0; t < topic.choice.length; t++) {
  453. topic.array.push({
  454. name: topic.choice[t].option,
  455. count: 0
  456. })
  457. }
  458. } else if (topic.type == 3) {
  459. } else if (topic.type == 5) {
  460. }
  461. for (var j = 0; j < array.length; j++) {
  462. let el2 = array[j]
  463. if (topic.type == 1) {
  464. let _answer = el2.array[i].json.answer2
  465. for (var k = 0; k < _answer.length; k++) {
  466. topic.array[_answer[k]].count++
  467. topic.count++
  468. }
  469. } else if (topic.type == 3) {
  470. let type3 = 1
  471. let _answer = el2.array[i].json.answer2
  472. if (_answer) {
  473. for (var k = 0; k < topic.array.length; k++) {
  474. if (topic.array[k].name == _answer) {
  475. topic.array[k].count++
  476. type3 = 2
  477. topic.count++
  478. break;
  479. }
  480. }
  481. if (type3 == 1) {
  482. topic.array.push({
  483. name: _answer,
  484. count: 1
  485. })
  486. }
  487. }
  488. } else if (topic.type == 5) {
  489. let _answer = el2.array[i].json.file ? el2.array[i].json.file : []
  490. for (var k = 0; k < _answer.length; k++) {
  491. topic.array.push(_answer[k])
  492. }
  493. }
  494. }
  495. testArray.push(topic)
  496. }
  497. this.testArray = testArray
  498. this.worksArray = array
  499. })
  500. .catch((err) => {
  501. console.error(err);
  502. });
  503. },
  504. setJSON(json) {
  505. return json.filter((item) => {
  506. if (item.array) {
  507. item.array = item.array.filter((item2) => {
  508. if (item2.ttype == 1 && item2.json) {
  509. delete item2.json.answer2
  510. delete item2.json.score2
  511. delete item2.json.file
  512. }
  513. if (item2.array) {
  514. item2.array = item2.array.filter((item3) => {
  515. if (item3.ttype == 1 && item3.json) {
  516. delete item3.json.answer2
  517. delete item3.json.score2
  518. delete item3.json.file
  519. }
  520. return item3;
  521. });
  522. }
  523. return item2;
  524. });
  525. } else if (item.ttype == 1 && item.json) {
  526. delete item.json.answer2
  527. delete item.json.score2
  528. delete item.json.file
  529. }
  530. return item
  531. console.log(item.array);
  532. });
  533. },
  534. setJson2(json) {
  535. let _json = json;
  536. // this.type = _json[0].ttype;
  537. let checkArray = _json.filter((item) => {
  538. if (item.array) {
  539. item.array = item.array.filter((item2) => {
  540. if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
  541. item2.json.answer2 = [];
  542. }
  543. if (item2.array) {
  544. item2.array = item2.array.filter((item3) => {
  545. if (item3.ttype == 1 && item3.json && !item3.json.answer2) {
  546. item3.json.answer2 = [];
  547. }
  548. return item3;
  549. });
  550. }
  551. return (
  552. (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
  553. );
  554. });
  555. }
  556. if (item.ttype == 1 && item.json && !item.json.answer2) {
  557. item.json.answer2 = [];
  558. }
  559. console.log(item.array);
  560. return (item.ttype != 1 && item.array.length > 0) || item.ttype == 1;
  561. });
  562. console.log(checkArray);
  563. return checkArray;
  564. },
  565. JSONSetting(json) {
  566. let _json = json
  567. let array = []
  568. _json.filter((item) => {
  569. if (item.array) {
  570. item.array = item.array.filter((item2) => {
  571. if (item2.ttype == 1 && item2.json) {
  572. array.push(item2)
  573. }
  574. if (item2.array) {
  575. item2.array = item2.array.filter((item3) => {
  576. if (item3.ttype == 1 && item3.json) {
  577. array.push(item3)
  578. }
  579. return item3;
  580. });
  581. }
  582. return item2;
  583. });
  584. }
  585. if (item.ttype == 1 && item.json) {
  586. array.push(item)
  587. }
  588. console.log(item.array);
  589. return item;
  590. });
  591. console.log(array);
  592. return array;
  593. },
  594. setFilter(json){
  595. let _json = json
  596. let array = []
  597. _json.filter((item) => {
  598. item.nameFilters = [],
  599. item.filterParams = {
  600. name: [],
  601. }
  602. if(item.type == 1){
  603. for(var i = 0; i < item.json.array.length; i++){
  604. item.nameFilters.push({text: item.json.array[i].option, value: item.json.array[i].option})
  605. }
  606. }
  607. array.push(item)
  608. return item;
  609. });
  610. return array
  611. },
  612. checkFile(item) {
  613. if (item.type == 3) {
  614. this.$hevueImgPreview(item.url);
  615. } else if (item.type == 5) {
  616. this.downloadFile(item);
  617. } else if (item.type == 1) {
  618. this.dialogVisibleOffice = true
  619. this.wurl = item.url
  620. } else if (item.type == 2) {
  621. this.dialogVisibleVideo = true
  622. this.wurl = item.url
  623. } else if (item.type == 4) {
  624. this.dialogVisiblePdf = true
  625. this.wurl = item.url
  626. }
  627. },
  628. downloadFile(f) {
  629. var credentials = {
  630. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  631. secretAccessKey: "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",
  632. }; //秘钥形式的登录上传
  633. window.AWS.config.update(credentials);
  634. window.AWS.config.region = "cn-northwest-1"; //设置区域
  635. let url2 = f.url;
  636. let _url2 = "";
  637. if (
  638. url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
  639. ) {
  640. _url2 = url2.split(
  641. "https://view.officeapps.live.com/op/view.aspx?src="
  642. )[1];
  643. } else {
  644. _url2 = url2;
  645. }
  646. let _this = this;
  647. _this.downLoading = _url2
  648. var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
  649. let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
  650. var params = {
  651. Bucket: "ccrb",
  652. Key: name
  653. };
  654. s3.getObject(params, function (err, data) {
  655. _this.downLoading = ''
  656. if (err) console.log(err, err.stack); // an error occurred
  657. else {
  658. let url = window.URL.createObjectURL(new Blob([data.Body]));
  659. let a = document.createElement("a");
  660. a.name = f.name;
  661. a.href = url;
  662. a.download = f.name;
  663. a.click();
  664. console.log(data);
  665. } // sxuccessful response
  666. });
  667. },
  668. deleteTest(tid) {
  669. let _this = this
  670. _this
  671. .$confirm("确定删除此提交的表单么?", "提示", {
  672. confirmButtonText: "确定",
  673. cancelButtonText: "取消",
  674. type: "warning",
  675. })
  676. .then(() => {
  677. let params = [{
  678. tid: tid,
  679. }];
  680. _this.ajax
  681. .post(_this.$store.state.api + "deleteTestCourseWorks", params)
  682. .then((res) => {
  683. _this.$message.success("删除成功");
  684. _this.getData();
  685. })
  686. .catch((err) => {
  687. console.error(err);
  688. });
  689. })
  690. .catch(() => {
  691. return;
  692. });
  693. }
  694. },
  695. beforeDestroy() {
  696. document.getElementsByTagName('html')[0].style.overflow = ''
  697. },
  698. mounted() {
  699. document.getElementsByTagName('html')[0].scrollTop = 0
  700. document.getElementsByTagName('html')[0].style.overflow = 'hidden'
  701. this.$nextTick(function () {
  702. this.getData();
  703. this.changeHeight()
  704. });
  705. },
  706. };
  707. </script>
  708. <style scoped>
  709. .pb_content {
  710. height: 100% !important;
  711. /* margin: 0 20px 0 20px; */
  712. }
  713. .pb_content_body {
  714. width: 100% !important;
  715. height: 100%;
  716. }
  717. .pb_content_body>.right {
  718. height: 100%;
  719. width: 100%;
  720. display: flex;
  721. overflow: hidden;
  722. flex-direction: column;
  723. }
  724. .basic_box {
  725. margin: 0 auto;
  726. position: relative;
  727. padding: 0 20px 0 20px;
  728. }
  729. .courseTop {
  730. display: flex;
  731. flex-direction: row;
  732. justify-content: space-between;
  733. align-items: center;
  734. width: calc(100% - 40px);
  735. margin: 0 auto;
  736. padding: 10px 0;
  737. }
  738. .stepsNav {
  739. display: flex;
  740. flex-direction: row;
  741. justify-content: flex-start;
  742. align-items: center;
  743. }
  744. .step_box {
  745. width: calc(100% - 40px);
  746. margin: 0 auto;
  747. height: calc(100% - 50px);
  748. overflow: auto;
  749. background: #ffff;
  750. border-radius: 5px;
  751. }
  752. .el-table>>>.even_row {
  753. background-color: #f1f1f1 !important;
  754. }
  755. .student_page {
  756. margin-top: 10px;
  757. }
  758. .test_title {
  759. display: flex;
  760. padding: 15px 15px;
  761. width: 100%;
  762. box-sizing: border-box;
  763. justify-content: space-between;
  764. align-items: center;
  765. flex-wrap: wrap;
  766. margin-bottom: 10px;
  767. }
  768. .test_title .left {
  769. max-width: 100%;
  770. margin-top: 10px
  771. }
  772. .test_title .left .title {
  773. width: 100%;
  774. font-size: 24px;
  775. font-weight: 700;
  776. overflow: hidden;
  777. text-overflow: ellipsis;
  778. white-space: nowrap;
  779. }
  780. .test_title .left .info {
  781. display: flex;
  782. margin-top: 15px;
  783. }
  784. .test_title .left .info .info_box {
  785. font-size: 14px;
  786. }
  787. .test_title .left .info .info_box+.info_box {
  788. margin-left: 20px;
  789. padding-left: 20px;
  790. border-left: 1px solid #E7E7E7;
  791. }
  792. .test_title .left .info .info_box span:nth-child(1) {
  793. color: #00000099;
  794. }
  795. .test_title .left .info .info_box span:nth-child(2) {}
  796. .test_title .right {
  797. display: flex;
  798. align-items: center;
  799. margin-top: 10px;
  800. max-width: 100%;
  801. }
  802. .test_title .right .data_box {
  803. margin-right: 15px;
  804. width: 150px;
  805. border: 1px solid #e7e7e7;
  806. border-radius: 5px;
  807. padding: 0 10px;
  808. height: 57px;
  809. font-size: 14px;
  810. color: #00000099;
  811. display: flex;
  812. justify-content: space-between;
  813. align-items: center;
  814. }
  815. .test_title .right .data_box span:nth-child(1) {}
  816. .test_title .right .data_box span:nth-child(2) {}
  817. .test_title .right .data_box span:nth-child(2) .big {
  818. font-size: 22px;
  819. }
  820. .test_title .right .btn_box {
  821. display: flex;
  822. flex-direction: column;
  823. width: 57px;
  824. height: 57px;
  825. background: #3681fc;
  826. border-radius: 5px;
  827. font-size: 14px;
  828. cursor: pointer;
  829. align-items: center;
  830. justify-content: center;
  831. color: #fff;
  832. }
  833. .test_title .right .btn_box span:nth-child(1) {
  834. display: block;
  835. width: 12px;
  836. height: 14px;
  837. margin-bottom: 5px;
  838. background-image: url('../../../../assets/icon/test/icon_share.png');
  839. background-size: 100% 100%;
  840. }
  841. .test_title .right .btn_box span:nth-child(2) {}
  842. .search_nav {
  843. border-bottom: 1px solid #E7E7E7;
  844. width: 100%;
  845. box-sizing: border-box;
  846. padding: 0 15px 10px;
  847. display: flex;
  848. align-items: flex-end;
  849. }
  850. .search_nav>.right {
  851. display: flex;
  852. align-items: center;
  853. }
  854. .search_nav>.right>span {
  855. height: 24px;
  856. font-size: 14px;
  857. color: #000;
  858. cursor: pointer;
  859. position: relative;
  860. }
  861. .search_nav>.right>span+span {
  862. margin-left: 35px;
  863. }
  864. .search_nav>.right>span.active {
  865. color: #3681FC;
  866. font-weight: 600;
  867. }
  868. .search_nav>.right>span.active::before {
  869. content: "";
  870. position: absolute;
  871. bottom: -10px;
  872. width: 15px;
  873. height: 3px;
  874. background: #3681fc;
  875. left: 50%;
  876. transform: translateX(-50%);
  877. }
  878. .search_nav>.left {
  879. display: flex;
  880. align-items: center;
  881. margin-left: auto;
  882. }
  883. .student_input>>>.el-input__inner {
  884. height: 40px;
  885. width: 190px;
  886. font-size: 13px;
  887. padding: 0 35px 0 10px;
  888. }
  889. .serach_icon {
  890. position: absolute;
  891. right: 12px;
  892. top: 50%;
  893. transform: translateY(-50%);
  894. width: 13px;
  895. height: 13px;
  896. background: url("../../../../assets/icon/test/test_search.png") no-repeat;
  897. background-size: 100% 100%;
  898. cursor: pointer;
  899. }
  900. .title_content {
  901. padding-bottom: 10px;
  902. }
  903. .title_content>.title_box {
  904. width: calc(100% - 48px);
  905. margin: 20px auto 0;
  906. }
  907. .title_content>.title_box>.title {
  908. font-size: 18px;
  909. display: flex;
  910. white-space: pre-line;
  911. }
  912. .title_content>.title_box>.title>.test_icon {
  913. min-width: 20px;
  914. height: 20px;
  915. }
  916. .title_content>.title_box>.detail {
  917. font-size: 14px;
  918. color: #00000099;
  919. margin-top: 8px;
  920. white-space: pre-line;
  921. }
  922. .title_content>.title_box>.content1 {
  923. display: flex;
  924. width: 100%;
  925. margin-top: 10px;
  926. }
  927. .title_content>.title_box>.content1>>>.el-progress__text {
  928. color: #3681FC;
  929. min-width: 55px;
  930. font-size: 16px !important;
  931. }
  932. .title_content>.title_box>.content1>.left {
  933. width: calc(100% - 620px);
  934. border: 1px solid #e7e7e7;
  935. }
  936. .title_content>.title_box>.content1>.left>div+div {
  937. border-top: 1px solid #e7e7e7;
  938. }
  939. .title_content>.title_box>.content1>.left>.title,
  940. .title_content>.title_box>.content1>.left>.data {
  941. display: flex;
  942. height: 40px;
  943. align-items: center;
  944. width: 100%;
  945. padding: 0 15px;
  946. box-sizing: border-box;
  947. line-height: 16px;
  948. }
  949. .title_content>.title_box>.content1>.left>.title>span,
  950. .title_content>.title_box>.content1>.left>.data>span {
  951. overflow: hidden;
  952. text-overflow: ellipsis;
  953. white-space: nowrap;
  954. }
  955. .title_content>.title_box>.content1>.left>.title>span:nth-child(1),
  956. .title_content>.title_box>.content1>.left>.data>span:nth-child(1) {
  957. width: calc(100% - 320px - 110px);
  958. }
  959. .title_content>.title_box>.content1>.left>.title>span:nth-child(2),
  960. .title_content>.title_box>.content1>.left>.data>span:nth-child(2) {
  961. width: 110px;
  962. }
  963. .title_content>.title_box>.content1>.left>.title>span:nth-child(3),
  964. .title_content>.title_box>.content1>.left>.data>span:nth-child(3) {
  965. width: 320px;
  966. }
  967. .title_content>.title_box>.content1>.left>.title {
  968. font-weight: 700;
  969. background: #F9FAFB;
  970. }
  971. .title_content>.title_box>.content1>.right {
  972. width: 600px;
  973. margin-left: 20px;
  974. border: 1px solid #e7e7e7;
  975. min-height: 300px;
  976. }
  977. .title_content>.title_box>.content2 {
  978. display: flex;
  979. width: 100%;
  980. margin-top: 10px;
  981. }
  982. .title_content>.title_box>.content2>.left {
  983. width: calc(100% - 620px);
  984. border: 1px solid #e7e7e7;
  985. }
  986. .title_content>.title_box>.content2>.left>div+div {
  987. border-top: 1px solid #e7e7e7;
  988. }
  989. .title_content>.title_box>.content2>.left>.title,
  990. .title_content>.title_box>.content2>.left>.data {
  991. display: flex;
  992. height: 40px;
  993. align-items: center;
  994. width: 100%;
  995. padding: 0 15px;
  996. box-sizing: border-box;
  997. line-height: 16px;
  998. }
  999. .title_content>.title_box>.content2>.left>.title>span,
  1000. .title_content>.title_box>.content2>.left>.data>span {
  1001. overflow: hidden;
  1002. text-overflow: ellipsis;
  1003. white-space: nowrap;
  1004. }
  1005. .title_content>.title_box>.content2>.left>.title>span:nth-child(1),
  1006. .title_content>.title_box>.content2>.left>.data>span:nth-child(1) {
  1007. width: 55px;
  1008. }
  1009. .title_content>.title_box>.content2>.left>.title>span:nth-child(2),
  1010. .title_content>.title_box>.content2>.left>.data>span:nth-child(2) {
  1011. width: 110px;
  1012. }
  1013. .title_content>.title_box>.content2>.left>.title>span:nth-child(3),
  1014. .title_content>.title_box>.content2>.left>.data>span:nth-child(3) {
  1015. max-width: calc(100% - 110px - 55px);
  1016. }
  1017. .title_content>.title_box>.content2>.left>.title {
  1018. font-weight: 700;
  1019. background: #F9FAFB;
  1020. }
  1021. .title_content>.title_box>.content2>.right {
  1022. width: 600px;
  1023. margin-left: 20px;
  1024. border: 1px solid #e7e7e7;
  1025. }
  1026. .title_content>.title_box>.content2>.right>>>.wordCloud {
  1027. height: auto;
  1028. min-height: 300px;
  1029. }
  1030. .title_content>.title_box>.content3 {
  1031. display: flex;
  1032. width: 100%;
  1033. overflow: auto;
  1034. }
  1035. .title_content>.title_box>.content3>.file {
  1036. min-width: 200px;
  1037. width: 200px;
  1038. height: 140px;
  1039. margin: 10px 10px 10px 0px;
  1040. border-radius: 15px;
  1041. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  1042. overflow: hidden;
  1043. margin-right: 15px;
  1044. position: relative;
  1045. display: flex;
  1046. flex-direction: column;
  1047. }
  1048. .title_content>.title_box>.content3>.file>.img {
  1049. width: 100%;
  1050. height: calc(100% - 35px);
  1051. object-fit: cover;
  1052. cursor: pointer;
  1053. }
  1054. .title_content>.title_box>.content3>.file>.del {
  1055. position: absolute;
  1056. width: 25px;
  1057. top: 10px;
  1058. right: 10px;
  1059. cursor: pointer;
  1060. }
  1061. .title_content>.title_box>.content3>.file>.download {
  1062. position: absolute;
  1063. width: 25px;
  1064. top: 10px;
  1065. right: 35px;
  1066. cursor: pointer;
  1067. opacity: .8;
  1068. }
  1069. .title_content>.title_box>.content3>.file>.name {
  1070. height: 35px;
  1071. width: 100%;
  1072. background: #f9f9f9;
  1073. display: flex;
  1074. align-items: center;
  1075. padding: 0 10px;
  1076. box-sizing: border-box;
  1077. }
  1078. .title_content>.title_box>.content3>.file>.name>span {
  1079. display: block;
  1080. text-overflow: ellipsis;
  1081. max-width: 100%;
  1082. white-space: nowrap;
  1083. overflow: hidden;
  1084. }
  1085. .table_content {
  1086. /* width: calc(100% - 48px);
  1087. margin: 20px auto 0; */
  1088. padding: 20px 24px;
  1089. width: 100%;
  1090. box-sizing: border-box;
  1091. }
  1092. .table_content>>>.el-table td {
  1093. padding: 5px 0;
  1094. }
  1095. .answer_type {
  1096. background: #F0F2F5;
  1097. padding: 5px 10px;
  1098. display: block;
  1099. border-radius: 3px;
  1100. margin: 5px;
  1101. }
  1102. .table_file>.file {
  1103. min-width: 100px;
  1104. width: 100px;
  1105. height: 70px;
  1106. margin: 10px 10px 10px 0px;
  1107. border-radius: 5px;
  1108. box-shadow: rgb(223, 218, 218) 0px 0px 6px 1px;
  1109. overflow: hidden;
  1110. margin-right: 15px;
  1111. position: relative;
  1112. display: flex;
  1113. flex-direction: column;
  1114. }
  1115. .table_file>.file>.img {
  1116. width: 100%;
  1117. height: calc(100% - 20px);
  1118. object-fit: cover;
  1119. cursor: pointer;
  1120. }
  1121. .table_file>.file>.del {
  1122. position: absolute;
  1123. width: 25px;
  1124. top: 10px;
  1125. right: 10px;
  1126. cursor: pointer;
  1127. }
  1128. .table_file>.file>.download {
  1129. position: absolute;
  1130. width: 25px;
  1131. top: 10px;
  1132. right: 35px;
  1133. cursor: pointer;
  1134. opacity: .8;
  1135. }
  1136. .table_file>.file>.name {
  1137. height: 20px;
  1138. width: 100%;
  1139. background: #f9f9f9;
  1140. display: flex;
  1141. align-items: center;
  1142. padding: 0 10px;
  1143. box-sizing: border-box;
  1144. font-size: 12px;
  1145. }
  1146. .table_file>.file>.name>span {
  1147. display: block;
  1148. text-overflow: ellipsis;
  1149. max-width: 100%;
  1150. white-space: nowrap;
  1151. overflow: hidden;
  1152. }
  1153. </style>