generating.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <div class="generating_container app-container">
  3. <el-card>
  4. <div class="header_top">
  5. <div v-for="(tab,idx) in visibleTabs" :key="idx" class="pointer"
  6. :class="{'active-tab': tab.content==tabActive}"
  7. @click="handleTabChange(idx)">
  8. {{ tab.label }}
  9. </div>
  10. </div>
  11. </el-card>
  12. <!-- NOTE:类似延迟加载 -->
  13. <keep-alive v-for="tab in visibleTabs" :key="tab.content">
  14. <component :is="tab.content" v-if="tab.content==tabActive"></component>
  15. </keep-alive>
  16. </div>
  17. </template>
  18. <script>
  19. import PaperByHand from '@/views/questioncenter/components/generate-tabs/paper-by-hand'
  20. import PaperByIntelligent from '@/views/questioncenter/components/generate-tabs/paper-by-intelligent'
  21. import PaperRecord from '@/views/questioncenter/components/generate-tabs/paper-record'
  22. import PaperWorkIdentifierMixin from './components/generate-tabs/paper-work-identifier-mixin'
  23. import PaperWorkVideo from '@/views/questioncenter/components/generate-tabs/paper-work-video'
  24. import PaperWorkPast from '@/views/questioncenter/components/generate-tabs/paper-work-past'
  25. import PaperWorkPublish from '@/views/questioncenter/components/generate-tabs/paper-work-publish'
  26. import PaperWorkHistory from '@/views/questioncenter/components/generate-tabs/paper-work-history'
  27. export default {
  28. mixins: [PaperWorkIdentifierMixin],
  29. components: {
  30. PaperWorkHistory,
  31. PaperWorkPublish,
  32. PaperWorkPast,
  33. PaperWorkVideo,
  34. PaperRecord,
  35. PaperByIntelligent,
  36. PaperByHand
  37. },
  38. data() {
  39. return {
  40. normalTabs: [{
  41. label: '手动组卷',
  42. content: PaperByHand.name
  43. }, {
  44. label: '智能组卷',
  45. content: PaperByIntelligent.name
  46. }, {
  47. label: '组卷记录',
  48. content: PaperRecord.name
  49. }],
  50. paperWorkTabs: [{
  51. label: '组卷作业',
  52. content: PaperByHand.name
  53. }, {
  54. label: '视频作业',
  55. content: PaperWorkVideo.name
  56. }, {
  57. label: '试卷作业',
  58. content: PaperWorkPast.name
  59. }, {
  60. label: '发布作业',
  61. content: PaperWorkPublish.name
  62. }, {
  63. label: '检查作业',
  64. content: PaperWorkHistory.name
  65. }],
  66. visibleTabs: [],
  67. tabActive: ''
  68. }
  69. },
  70. created() {
  71. // visibleTabs不能做成计算属性,否则因为依赖于路由会在任意跳转时刷新
  72. this.visibleTabs = this.isPaperWork ? this.paperWorkTabs : this.normalTabs
  73. let query = this.$route.query
  74. const defaultActive = query.tabActive * 1 || 0
  75. this.handleTabChange(defaultActive)
  76. },
  77. methods: {
  78. handleTabChange(idx) {
  79. const current = this.visibleTabs[idx]
  80. this.tabActive = current.content
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .generating_container {
  87. .active-tab {
  88. color: #47c6a2;
  89. }
  90. .active-tab::after {
  91. content: "";
  92. width: 100%;
  93. height: 4px;
  94. position: absolute;
  95. background: #47c6a2;
  96. left: 0;
  97. transform: translateY(50%);
  98. bottom: 0;
  99. }
  100. .header_top {
  101. display: flex;
  102. border-bottom: 1px solid #b7b7b7;
  103. margin-bottom: 20px;
  104. }
  105. .header_top > div {
  106. position: relative;
  107. flex: 1;
  108. text-align: center;
  109. padding: 8px 0 24px 0;
  110. }
  111. .el-card {
  112. margin-bottom: 20px;
  113. }
  114. .generating_aside {
  115. padding-bottom: 104px;
  116. background: #fff;
  117. margin-right: 24px;
  118. height: 600px;
  119. overflow: scroll;
  120. overflow-x: hidden;
  121. }
  122. .el-aside {
  123. margin-bottom: 0;
  124. padding: 24px 0 0 16px;
  125. }
  126. .aside_header {
  127. display: flex;
  128. flex-direction: column;
  129. justify-content: left;
  130. }
  131. .aside_header > span:first-child {
  132. width: 173px;
  133. height: 27px;
  134. background: -webkit-gradient(
  135. linear,
  136. left top,
  137. left bottom,
  138. from(#ffffff),
  139. to(#47c6a2)
  140. );
  141. background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
  142. opacity: 0.5;
  143. }
  144. .aside_header > span:last-child {
  145. margin-bottom: 20px;
  146. }
  147. .aside_header > span {
  148. margin-top: 5px;
  149. width: 84px;
  150. height: 22px;
  151. font-size: 16px;
  152. font-family: PingFangSC-Medium, PingFang SC;
  153. font-weight: 500;
  154. color: #343434;
  155. line-height: 22px;
  156. }
  157. .el-main {
  158. //padding: 37px 28px 0 28px;
  159. }
  160. .main_header {
  161. display: flex;
  162. align-items: center;
  163. justify-content: space-between;
  164. margin-bottom: 20px;
  165. }
  166. .main_header .main_tit {
  167. font-size: 16px;
  168. font-weight: 500;
  169. color: #47c6a2;
  170. line-height: 22px;
  171. margin-right: 64px;
  172. }
  173. .main_header .filter {
  174. font-weight: 400;
  175. color: #4c4c4c;
  176. line-height: 20px;
  177. }
  178. .main_header .left {
  179. display: flex;
  180. }
  181. .search_box {
  182. display: flex;
  183. flex-direction: row;
  184. align-items: center;
  185. justify-content: flex-end;
  186. position: relative;
  187. margin-right: 20px;
  188. }
  189. .search_box img {
  190. position: absolute;
  191. right: 20px;
  192. cursor: pointer;
  193. top: 6px;
  194. }
  195. .search_box input {
  196. background: #f7f7ff;
  197. border-radius: 20px;
  198. border: 1px solid #c6cbf5;
  199. outline: none;
  200. width: 340px;
  201. height: 32px;
  202. padding-left: 24px;
  203. }
  204. .que_item {
  205. border-radius: 1px;
  206. border: 1px solid #dedede;
  207. margin-bottom: 8px;
  208. }
  209. .que_content {
  210. padding: 12px 24px 0 33px;
  211. font-size: 14px;
  212. font-family: PingFangSC-Medium, PingFang SC;
  213. font-weight: 500;
  214. color: #4c4c4c;
  215. line-height: 27px;
  216. margin-bottom: 40px;
  217. }
  218. .que-content-title {
  219. font-size: 14px;
  220. display: flex;
  221. }
  222. .que-option {
  223. line-height: 40px;
  224. }
  225. .que-option span {
  226. margin-right: 5px;
  227. }
  228. .que_footer {
  229. border-top: 1px solid #dedede;
  230. padding-left: 33px;
  231. overflow: hidden;
  232. padding-bottom: 23px;
  233. padding-top: 21px;
  234. }
  235. .que_footer .spans {
  236. float: left;
  237. font-size: 12px;
  238. font-family: PingFangSC-Regular, PingFang SC;
  239. font-weight: 400;
  240. color: #979797;
  241. line-height: 20px;
  242. }
  243. .que_footer .spans > span {
  244. margin-right: 20px;
  245. }
  246. .operation {
  247. display: flex;
  248. align-items: center;
  249. font-size: 14px;
  250. font-family: PingFangSC-Regular, PingFang SC;
  251. font-weight: 400;
  252. color: #47c6a2;
  253. line-height: 20px;
  254. float: right;
  255. }
  256. .operation > div {
  257. display: flex;
  258. align-items: center;
  259. cursor: pointer;
  260. }
  261. .operation .shoucan {
  262. margin-right: 46px;
  263. }
  264. .operation .jiucuo {
  265. color: #ff4e00;
  266. margin-right: 32px;
  267. }
  268. .operation .detail span {
  269. border-radius: 1px;
  270. border-bottom: 1px solid #47c6a2;
  271. }
  272. .operation .detail {
  273. margin-right: 32px;
  274. }
  275. .operation > div > img {
  276. margin-right: 10px;
  277. }
  278. .knowPoints .tags {
  279. margin-top: 24px;
  280. margin-bottom: 72px;
  281. }
  282. .knowPoints .tit {
  283. margin-bottom: 16px;
  284. overflow: hidden;
  285. color: #47c6a2;
  286. }
  287. .knowPoints .clear {
  288. float: right;
  289. margin-right: 40px;
  290. }
  291. .knowPoints .clear img {
  292. margin-right: 16px;
  293. }
  294. .que .tit {
  295. margin-bottom: 16px;
  296. overflow: hidden;
  297. color: #47c6a2;
  298. }
  299. .que .clear {
  300. float: right;
  301. margin-right: 40px;
  302. }
  303. .que .clear img {
  304. margin-right: 16px;
  305. }
  306. .el-divider.generating_divider {
  307. margin: 0;
  308. background: #47c6a2;
  309. }
  310. .computer {
  311. margin-top: 24px;
  312. display: flex;
  313. justify-content: flex-start;
  314. flex-wrap: wrap;
  315. }
  316. .computer .computer_item {
  317. flex: 33% 0 0;
  318. margin-bottom: 32px;
  319. }
  320. .computer .computer_item .tit {
  321. height: 20px;
  322. font-size: 14px;
  323. font-family: PingFangSC-Regular, PingFang SC;
  324. font-weight: 400;
  325. color: #343434;
  326. line-height: 20px;
  327. }
  328. .computer .computer_item .select {
  329. width: 58px;
  330. height: 17px;
  331. font-size: 12px;
  332. font-family: PingFangSC-Regular, PingFang SC;
  333. font-weight: 400;
  334. color: #969696;
  335. line-height: 17px;
  336. }
  337. ::-webkit-scrollbar {
  338. width: 4px;
  339. }
  340. ::-webkit-scrollbar-thumb {
  341. -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
  342. background-color: rgb(238, 241, 245);
  343. }
  344. .queBoxer {
  345. display: flex;
  346. position: fixed;
  347. right: 0;
  348. top: 50%;
  349. transform: translateY(-50%);
  350. }
  351. .queBoxer .main {
  352. border-top: 2px solid #47c6a2;
  353. padding: 10px 0;
  354. border-bottom: 2px solid #47c6a2;
  355. background: #fff;
  356. }
  357. .queBoxer > div > div {
  358. padding: 0 10px;
  359. }
  360. .queBoxer .left {
  361. padding: 10px;
  362. background: #47c6a2;
  363. color: white;
  364. display: flex;
  365. flex-direction: column;
  366. justify-content: space-between;
  367. align-items: center;
  368. }
  369. .queBoxer .main .btn {
  370. background: #47c6a2;
  371. color: white;
  372. border-radius: 4px;
  373. padding: 4px;
  374. cursor: pointer;
  375. margin: 5px 10px;
  376. text-align: center;
  377. }
  378. .queBoxer .left .tit {
  379. display: flex;
  380. writing-mode: lr-tb;
  381. align-items: center;
  382. flex-direction: column;
  383. justify-content: space-between;
  384. }
  385. .generateExam {
  386. padding: 14px 29px;
  387. background: #47c6a2;
  388. border-radius: 4px;
  389. cursor: pointer;
  390. color: white;
  391. }
  392. .el-button--success.is-plain.is-disabled {
  393. background-color: #ffffff;
  394. border-color: #e6ebf5;
  395. color: #c0c4cc;
  396. }
  397. .el-tree-node__content {
  398. padding-top: 6px;
  399. padding-bottom: 6px;
  400. height: 32px;
  401. font-size: 14px;
  402. font-family: PingFangSC-Medium, PingFang SC;
  403. font-weight: 500;
  404. color: #343434;
  405. line-height: 20px;
  406. }
  407. & .split_page .el-pager > li {
  408. border-radius: 50%;
  409. }
  410. & .el-tree-node {
  411. padding-left: 16px;
  412. }
  413. & .el-tree-node__expand-icon.expanded {
  414. content: "";
  415. }
  416. & .el-tree-node__content > .el-tree-node__expand-icon {
  417. padding: 6px;
  418. /* position: absolute; */
  419. right: 16px;
  420. }
  421. & .radio_contianer .is-active .el-radio-button__inner {
  422. border-left: none;
  423. }
  424. .empty-text {
  425. margin-top: 150px;
  426. text-align: center;
  427. color: #ccc;
  428. }
  429. & .el-input-number.is-controls-right .el-input-number__decrease {
  430. width: 16px;
  431. }
  432. & .el-input-number.is-controls-right[class*="medium"] [class*="increase"],
  433. & .el-input-number.is-controls-right[class*="medium"] [class*="decrease"] {
  434. width: 16px;
  435. }
  436. & .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
  437. color: #47c6a2;
  438. background: #ffffff;
  439. }
  440. & .table-delete-icon {
  441. cursor: pointer;
  442. }
  443. }
  444. </style>