yujialong 4 years ago
parent f6f0231de4
commit ef8522d1e1
  1. 128
      package-lock.json
  2. 2
      package.json
  3. 9
      src/api/index.js
  4. 32
      src/components/testPaperDetail/index.vue
  5. 34
      src/pages/achievement/detail/index.vue
  6. 12
      src/pages/achievement/list/examResults.vue
  7. 34
      src/pages/assessment/detail/index.vue
  8. 32
      src/pages/practice/detail/index.vue
  9. 13
      src/pages/quesBank/list/globalQuesBank.vue
  10. 8
      src/pages/quesBank/list/index.vue
  11. 2
      src/pages/quesBank/list/myQuesBank.vue
  12. 237
      src/pages/quesBank/list/quesBankType.vue
  13. 46
      src/pages/quesBank/list/quesDialog.vue
  14. 2
      src/pages/student/list/index.vue
  15. 2
      src/pages/student/list/studentSide.vue
  16. 9
      src/pages/testPaper/add/index.vue
  17. 207
      src/pages/testPaper/list/myTestPaper.vue
  18. 2
      src/setting.js
  19. 12
      src/store/modules/assessment.js
  20. 8
      src/store/modules/practice.js
  21. 8
      src/store/modules/testpaper.js

128
package-lock.json generated

@ -820,6 +820,24 @@
} }
} }
}, },
"@babel/runtime-corejs3": {
"version": "7.12.5",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz",
"integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==",
"optional": true,
"requires": {
"core-js-pure": "^3.0.0",
"regenerator-runtime": "^0.13.4"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.7",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
"optional": true
}
}
},
"@babel/template": { "@babel/template": {
"version": "7.7.4", "version": "7.7.4",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz",
@ -1048,6 +1066,12 @@
"integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==",
"dev": true "dev": true
}, },
"@types/raf": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.0.tgz",
"integrity": "sha512-taW5/WYqo36N7V39oYyHP9Ipfd5pNFvGTIQsNGj86xV88YQ7GnI30/yMfKDF7Zgin0m3e+ikX88FvImnK4RjGw==",
"optional": true
},
"@vue/babel-helper-vue-jsx-merge-props": { "@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz", "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz",
@ -2156,6 +2180,11 @@
} }
} }
}, },
"base64-arraybuffer": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz",
"integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ=="
},
"base64-js": { "base64-js": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
@ -2440,6 +2469,11 @@
"node-releases": "^1.1.41" "node-releases": "^1.1.41"
} }
}, },
"btoa": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz",
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
},
"buffer": { "buffer": {
"version": "4.9.2", "version": "4.9.2",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz",
@ -2611,6 +2645,20 @@
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001012.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001012.tgz",
"integrity": "sha512-7RR4Uh04t9K1uYRWzOJmzplgEOAXbfK72oVNokCdMzA67trrhPzy93ahKk1AWHiA0c58tD2P+NHqxrA8FZ+Trg==" "integrity": "sha512-7RR4Uh04t9K1uYRWzOJmzplgEOAXbfK72oVNokCdMzA67trrhPzy93ahKk1AWHiA0c58tD2P+NHqxrA8FZ+Trg=="
}, },
"canvg": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.7.tgz",
"integrity": "sha512-4sq6iL5Q4VOXS3PL1BapiXIZItpxYyANVzsAKpTPS5oq4u3SKbGfUcbZh2gdLCQ3jWpG/y5wRkMlBBAJhXeiZA==",
"optional": true,
"requires": {
"@babel/runtime-corejs3": "^7.9.6",
"@types/raf": "^3.4.0",
"raf": "^3.4.1",
"rgbcolor": "^1.0.1",
"stackblur-canvas": "^2.0.0",
"svg-pathdata": "^5.0.5"
}
},
"case-sensitive-paths-webpack-plugin": { "case-sensitive-paths-webpack-plugin": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz",
@ -3262,6 +3310,12 @@
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz",
"integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA==" "integrity": "sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA=="
}, },
"core-js-pure": {
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.2.tgz",
"integrity": "sha512-v6zfIQqL/pzTVAbZvYUozsxNfxcFb6Ks3ZfEbuneJl3FW9Jb8F6vLWB6f+qTmAu72msUdyb84V8d/yBFf7FNnw==",
"optional": true
},
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -3395,6 +3449,14 @@
"timsort": "^0.3.0" "timsort": "^0.3.0"
} }
}, },
"css-line-break": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-1.1.1.tgz",
"integrity": "sha512-1feNVaM4Fyzdj4mKPIQNL2n70MmuYzAXZ1aytlROFX1JsOo070OsugwGjj7nl6jnDJWHDM8zRZswkmeYVWZJQA==",
"requires": {
"base64-arraybuffer": "^0.2.0"
}
},
"css-loader": { "css-loader": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-1.0.1.tgz", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-1.0.1.tgz",
@ -4062,6 +4124,12 @@
"domelementtype": "1" "domelementtype": "1"
} }
}, },
"dompurify": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.6.tgz",
"integrity": "sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==",
"optional": true
},
"domutils": { "domutils": {
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
@ -6878,6 +6946,14 @@
} }
} }
}, },
"html2canvas": {
"version": "1.0.0-rc.7",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.0.0-rc.7.tgz",
"integrity": "sha512-yvPNZGejB2KOyKleZspjK/NruXVQuowu8NnV2HYG7gW7ytzl+umffbtUI62v2dCHQLDdsK6HIDtyJZ0W3neerA==",
"requires": {
"css-line-break": "1.1.1"
}
},
"htmlparser2": { "htmlparser2": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
@ -7630,6 +7706,28 @@
"graceful-fs": "^4.1.6" "graceful-fs": "^4.1.6"
} }
}, },
"jspdf": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.2.0.tgz",
"integrity": "sha512-kz6blXdM+wQ0vWMDJsa7GW9Ya79DHQBWQL14urVsbr6mk9nsJCSqZuIgE1CPZ78i5Yih2uW4tqOTiLf5xSpT9Q==",
"requires": {
"atob": "^2.1.2",
"btoa": "^1.2.1",
"canvg": "^3.0.6",
"core-js": "^3.6.0",
"dompurify": "^2.2.0",
"html2canvas": "^1.0.0-rc.5",
"pako": "^1.0.11"
},
"dependencies": {
"core-js": {
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.2.tgz",
"integrity": "sha512-FfApuSRgrR6G5s58casCBd9M2k+4ikuu4wbW6pJyYU7bd9zvFc9qf7vr5xmrZOhT9nn+8uwlH1oRR9jTnFoA3A==",
"optional": true
}
}
},
"jsprim": { "jsprim": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
@ -9050,8 +9148,7 @@
"pako": { "pako": {
"version": "1.0.11", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
"dev": true
}, },
"parallel-transform": { "parallel-transform": {
"version": "1.2.0", "version": "1.2.0",
@ -10292,6 +10389,15 @@
"fast-diff": "1.1.2" "fast-diff": "1.1.2"
} }
}, },
"raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
"optional": true,
"requires": {
"performance-now": "^2.1.0"
}
},
"randombytes": { "randombytes": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@ -10770,6 +10876,12 @@
"integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
"dev": true "dev": true
}, },
"rgbcolor": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
"integrity": "sha1-1lBezbMEplldom+ktDMHMGd1lF0=",
"optional": true
},
"rimraf": { "rimraf": {
"version": "2.7.1", "version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
@ -11623,6 +11735,12 @@
"integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==",
"dev": true "dev": true
}, },
"stackblur-canvas": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.4.0.tgz",
"integrity": "sha512-Z+HixfgYV0ss3C342DxPwc+UvN1SYWqoz7Wsi3xEDWEnaBkSCL3Ey21gF4io+WlLm8/RIrSnCrDBIEcH4O+q5Q==",
"optional": true
},
"stackframe": { "stackframe": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.1.0.tgz", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.1.0.tgz",
@ -11860,6 +11978,12 @@
"has-flag": "^3.0.0" "has-flag": "^3.0.0"
} }
}, },
"svg-pathdata": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-5.0.5.tgz",
"integrity": "sha512-TAAvLNSE3fEhyl/Da19JWfMAdhSXTYeviXsLSoDT1UM76ADj5ndwAPX1FKQEgB/gFMPavOy6tOqfalXKUiXrow==",
"optional": true
},
"svg-tags": { "svg-tags": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz",

@ -13,7 +13,9 @@
"echarts": "^4.9.0", "echarts": "^4.9.0",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"html2canvas": "^1.0.0-rc.7",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"jspdf": "^2.2.0",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"mavon-editor": "^2.6.17", "mavon-editor": "^2.6.17",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",

@ -123,7 +123,6 @@ export default {
pageByChoiceList:`management/questions/pageByChoiceList`, pageByChoiceList:`management/questions/pageByChoiceList`,
statistical:`management/questions/statistical`, statistical:`management/questions/statistical`,
getQuestionListBySelect:`management/questions/getQuestionListBySelect`, getQuestionListBySelect:`management/questions/getQuestionListBySelect`,
listByPage:`cjEnterprise/questionBank/listByPage`,
// 考核管理 // 考核管理
addAssessment:`/management/assessment/addAssessment`, addAssessment:`/management/assessment/addAssessment`,
@ -143,6 +142,14 @@ export default {
reviewByid:`/management/review/reviewByid`, reviewByid:`/management/review/reviewByid`,
reviewList:`/management/review/reviewList`, reviewList:`/management/review/reviewList`,
// 题库分类
AddOneLevel:`cjEnterprise/questionBank/AddOneLevel`,
AddSecondLevel:`cjEnterprise/questionBank/AddSecondLevel`,
deleteById:`cjEnterprise/questionBank/deleteById`,
getTypeByOneLever:`cjEnterprise/questionBank/getTypeByOneLever`,
listByPage:`cjEnterprise/questionBank/listByPage`,
modifyLevel:`cjEnterprise/questionBank/modifyLevel`,
// 题库管理 // 题库管理
deleteByOne:`cjEnterprise/questions/deleteByOne`, deleteByOne:`cjEnterprise/questions/deleteByOne`,
findById:`cjEnterprise/questions/findById`, findById:`cjEnterprise/questions/findById`,

@ -6,7 +6,7 @@
<span class="name">总分</span> <span class="name">总分</span>
<span class="val">100</span> <span class="val">100</span>
</div> </div>
<div> <div v-if="totalDuration !== ''">
<span class="name">考试时长</span> <span class="name">考试时长</span>
<span class="val">{{totalDuration}}分钟</span> <span class="val">{{totalDuration}}分钟</span>
</div> </div>
@ -66,28 +66,28 @@ export default {
{ {
id: 1, id: 1,
name: '单选题', name: '单选题',
show: true show: false
},{ },{
id: 2, id: 2,
name: '多选题', name: '多选题',
show: true show: false
},{ },{
id: 3, id: 3,
name: '填空题', name: '填空题',
show: true show: false
},{ },{
id: 4, id: 4,
name: '判断题', name: '判断题',
show: true show: false
},{ },{
id: 5, id: 5,
name: '简答题', name: '简答题',
show: true show: false
} }
], ],
active: 1, active: 1,
allData: {}, allData: {},
curType: [] curType: [],
}; };
}, },
computed: { computed: {
@ -123,12 +123,18 @@ export default {
} }
this.allData = data this.allData = data
let tabs = this.tabs let tabs = this.tabs
data.list1.length || (tabs[0].show = false) data.list1.length && (tabs[0].show = true)
data.list2.length || (tabs[1].show = false) data.list2.length && (tabs[1].show = true)
data.list3.length || (tabs[2].show = false) data.list3.length && (tabs[2].show = true)
data.list4.length || (tabs[3].show = false) data.list4.length && (tabs[3].show = true)
data.list5.length || (tabs[4].show = false) data.list5.length && (tabs[4].show = true)
this.curType = this.allData.list1 for(let n of tabs){
if(n.show){
this.active = n.id
this.curType = this.allData[`list${n.id}`]
break
}
}
this.handleOptions() this.handleOptions()
}, },
initMedia(item){ initMedia(item){

@ -21,9 +21,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<!-- <template v-for="(item,index) in tabs"> --> <template v-for="(item,index) in tabs">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
<!-- </template> --> </template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -81,23 +81,23 @@ export default {
{ {
id: 1, id: 1,
name: '单选题', name: '单选题',
show: true show: false
},{ },{
id: 2, id: 2,
name: '多选题', name: '多选题',
show: true show: false
},{ },{
id: 3, id: 3,
name: '判断题', name: '判断题',
show: true show: false
},{ },{
id: 4, id: 4,
name: '简答题', name: '简答题',
show: true show: false
},{ },{
id: 5, id: 5,
name: '填空题', name: '填空题',
show: true show: false
} }
], ],
active: 1, active: 1,
@ -124,12 +124,18 @@ export default {
this.ranking = res.ranking this.ranking = res.ranking
this.allData = res.data this.allData = res.data
let tabs = this.tabs let tabs = this.tabs
res.data.list1.length || (tabs[0].show = false) res.data.list1.length && (tabs[0].show = true)
res.data.list2.length || (tabs[1].show = false) res.data.list2.length && (tabs[1].show = true)
res.data.list3.length || (tabs[2].show = false) res.data.list3.length && (tabs[2].show = true)
res.data.list4.length || (tabs[3].show = false) res.data.list4.length && (tabs[3].show = true)
res.data.list5.length || (tabs[4].show = false) res.data.list5.length && (tabs[4].show = true)
this.curType = this.allData.list1 for(let n of tabs){
if(n.show){
this.active = n.id
this.curType = this.allData[`list${n.id}`]
break
}
}
this.handleOptions() this.handleOptions()
}) })
.catch(err => {}) .catch(err => {})

@ -5,13 +5,13 @@
<div class="flex j-between"> <div class="flex j-between">
<el-form label-width="80px" inline> <el-form label-width="80px" inline>
<el-form-item class="no-mb" label="教学班级"> <el-form-item class="no-mb" label="教学班级">
<el-select v-model="classId" clearable placeholder="请选择教学班级" @change="getAssess"> <el-select v-model="classId" placeholder="请选择教学班级" @change="getAssess">
<el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option> <el-option v-for="(item,index) in classList" :key="index" :label="item.className" :value="item.classId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="no-mb" label="考试名称"> <el-form-item class="no-mb" label="考试名称">
<el-select v-model="assessmentName" clearable placeholder="请选择考试名称" @change="getData"> <el-select v-model="assessmentId" placeholder="请选择考试名称" @change="getData">
<el-option v-for="(item,index) in assessmentNameList" :key="index" :label="item.assessmentName" :value="item.assessmentName"></el-option> <el-option v-for="(item,index) in assessmentNameList" :key="index" :label="item.assessmentName" :value="item.assessmentId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -161,8 +161,7 @@ export default {
}) })
.then(res => { .then(res => {
this.assessmentNameList = res.data.list this.assessmentNameList = res.data.list
this.assessmentId = this.classList.find(n => n.classId == this.classId).assessmentId this.assessmentId = this.assessmentNameList[0].assessmentId
this.assessmentName = this.assessmentNameList[0].assessmentName
this.getData() this.getData()
}).catch(err => {}) }).catch(err => {})
}, },
@ -175,7 +174,7 @@ export default {
this.resetForm() this.resetForm()
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val
}, },
show(row){ show(row){
this.setAssDetailInfo({ this.setAssDetailInfo({
@ -188,6 +187,7 @@ export default {
}, },
toStat(){ toStat(){
if(this.listData.length){ if(this.listData.length){
this.assessmentName = this.assessmentNameList.find(n => n.assessmentId == this.assessmentId).assessmentName
this.setAssDetailInfo({ this.setAssDetailInfo({
id: this.listData[0].paperId, id: this.listData[0].paperId,
assessmentId: this.assessmentId, assessmentId: this.assessmentId,

@ -17,9 +17,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<!-- <template v-for="(item,index) in tabs"> --> <template v-for="(item,index) in tabs">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
<!-- </template> --> </template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -76,23 +76,23 @@ export default {
{ {
id: 1, id: 1,
name: '单选题', name: '单选题',
show: true show: false
},{ },{
id: 2, id: 2,
name: '多选题', name: '多选题',
show: true show: false
},{ },{
id: 3, id: 3,
name: '判断题', name: '判断题',
show: true show: false
},{ },{
id: 4, id: 4,
name: '简答题', name: '简答题',
show: true show: false
},{ },{
id: 5, id: 5,
name: '填空题', name: '填空题',
show: true show: false
} }
], ],
active: 1, active: 1,
@ -118,12 +118,18 @@ export default {
this.time = res.time this.time = res.time
this.allData = res.data this.allData = res.data
let tabs = this.tabs let tabs = this.tabs
res.data.list1.length || (tabs[0].show = false) res.data.list1.length && (tabs[0].show = true)
res.data.list2.length || (tabs[1].show = false) res.data.list2.length && (tabs[1].show = true)
res.data.list3.length || (tabs[2].show = false) res.data.list3.length && (tabs[2].show = true)
res.data.list4.length || (tabs[3].show = false) res.data.list4.length && (tabs[3].show = true)
res.data.list5.length || (tabs[4].show = false) res.data.list5.length && (tabs[4].show = true)
this.curType = this.allData.list1 for(let n of tabs){
if(n.show){
this.active = n.id
this.curType = this.allData[`list${n.id}`]
break
}
}
this.handleOptions() this.handleOptions()
}) })
.catch(err => {}) .catch(err => {})

@ -17,9 +17,9 @@
</div> </div>
<ul class="tab"> <ul class="tab">
<!-- <template v-for="(item,index) in tabs"> --> <template v-for="(item,index) in tabs">
<li v-for="(item,index) in tabs" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li> <li v-if="item.show" :key="index" :class="{active: active == item.id}" @click="tabChange(item.id)">{{item.name}}</li>
<!-- </template> --> </template>
</ul> </ul>
<div class="wrap"> <div class="wrap">
@ -76,23 +76,23 @@ export default {
{ {
id: 1, id: 1,
name: '单选题', name: '单选题',
show: true show: false
},{ },{
id: 2, id: 2,
name: '多选题', name: '多选题',
show: true show: false
},{ },{
id: 3, id: 3,
name: '判断题', name: '判断题',
show: true show: false
},{ },{
id: 4, id: 4,
name: '简答题', name: '简答题',
show: true show: false
},{ },{
id: 5, id: 5,
name: '填空题', name: '填空题',
show: true show: false
} }
], ],
typeNameList: ['单项选择','多项选择','判断题','简答题','填空题'], typeNameList: ['单项选择','多项选择','判断题','简答题','填空题'],
@ -131,11 +131,17 @@ export default {
}) })
this.list = data.list this.list = data.list
let tabs = this.tabs let tabs = this.tabs
data.list.find(n => n.typeName == '单项选择') || (tabs[0].show = false) data.list.find(n => n.typeName == '单项选择') && (tabs[0].show = true)
data.list.find(n => n.typeName == '多项选择') || (tabs[1].show = false) data.list.find(n => n.typeName == '多项选择') && (tabs[1].show = true)
data.list.find(n => n.typeName == '判断题') || (tabs[2].show = false) data.list.find(n => n.typeName == '判断题') && (tabs[2].show = true)
data.list.find(n => n.typeName == '简答题') || (tabs[3].show = false) data.list.find(n => n.typeName == '简答题') && (tabs[3].show = true)
data.list.find(n => n.typeName == '填空题') || (tabs[4].show = false) data.list.find(n => n.typeName == '填空题') && (tabs[4].show = true)
for(let n of tabs){
if(n.show){
this.active = n.id
break
}
}
this.handleOptions() this.handleOptions()
this.paperName = data.paperName this.paperName = data.paperName
this.userName = data.stuName this.userName = data.stuName

@ -31,8 +31,7 @@
<div class="flex j-between m-b-20"> <div class="flex j-between m-b-20">
<div class="p-title">公共题库</div> <div class="p-title">公共题库</div>
<div> <div>
<!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> --> <el-button type="primary" size="small" round @click="delAllData" v-auth>批量取消共享</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange"> <el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange">
@ -49,7 +48,7 @@
<el-table-column label="操作" align="center" width="120"> <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> <el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>取消共享</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -141,12 +140,12 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要取消共享吗?', '提示', {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=2&ids=${row.id}`).then(res => { this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=2&ids=${row.id}`).then(res => {
this.$message.success('删除成功') this.$message.success('取消共享成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}) })
@ -159,13 +158,13 @@ export default {
return item.id return item.id
}) })
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要取消共享吗?', '提示', {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=2&ids=${delList.join()}`).then(res => { this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=2&ids=${delList.join()}`).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功') this.$message.success('取消共享成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}) })

@ -4,24 +4,28 @@
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div> </div>
<my-ques-bank v-if="active == 'my'"></my-ques-bank> <ques-bank-type v-if="active == 'type'"></ques-bank-type>
<my-ques-bank v-else-if="active == 'my'"></my-ques-bank>
<global-ques-bank v-else></global-ques-bank> <global-ques-bank v-else></global-ques-bank>
</div> </div>
</template> </template>
<script> <script>
import quesBankType from './quesBankType'
import myQuesBank from './myQuesBank' import myQuesBank from './myQuesBank'
import globalQuesBank from './globalQuesBank' import globalQuesBank from './globalQuesBank'
export default { export default {
data() { data() {
return { return {
active: 'my', active: 'type',
tabs: { tabs: {
type: '题库分类',
my: '我上传的题库', my: '我上传的题库',
global: '公共题库' global: '公共题库'
} }
}; };
}, },
components: { components: {
quesBankType,
myQuesBank, myQuesBank,
globalQuesBank, globalQuesBank,
}, },

@ -89,7 +89,7 @@
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column> <el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column> <el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column> <el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看</el-button> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button> <el-button type="text" @click="edit(scope.row)">修改</el-button>

@ -0,0 +1,237 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入分类名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">分类管理</div>
<div>
<el-button type="primary" size="small" round @click="addFirst" v-auth>添加一级分类</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="9">
<el-table-column prop="typeName" label="分类名称">
<template slot-scope="scope">
<span style="display: inline-block;width: 23px;" v-if="!scope.row.secondColumn.length"></span>{{scope.row.typeName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button>
<el-button type="text" @click="editType(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
</div>
</el-card>
<el-dialog :title="isAddFirst ? '添加一级分类' : '编辑一级分类'" :visible.sync="firstVisible" width="24%" center @close="closeFirst" :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入题库分类名称" v-model="firstName" maxlength="15"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="firstVisible = false">取消</el-button>
<el-button type="primary" @click="firstSubmit">确定</el-button>
</span>
</el-dialog>
<el-dialog :title="isAddSecond ? '添加二级分类' : '编辑二级分类'" :visible.sync="secondVisible" width="24%" center @close="closeSecond" :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入题库分类名称" v-model="secondName" maxlength="15"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="secondVisible = false">取消</el-button>
<el-button type="primary" @click="secondSubmit">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
treeProps: {children: 'secondColumn', hasChildren: 'hasChildren'},
listData: [],
keyword: '',
page: 1,
pageSize: 10,
total: 0,
searchTimer: null,
firstVisible: false,
firstId: '',
firstName: '',
secondVisible: false,
secondName: '',
secondId: '',
curRow: {},
isAddFirst: false,
isAddSecond: false,
};
},
computed: {
...mapState('user', [
'userId','clientId'
])
},
mounted() {
this.getData()
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
methods: {
getData() {
let data = {
pageNum: this.page,
pageSize: this.pageSize,
keyword: this.keyword,
schoolId: this.clientId,
source: 2
}
this.$post(this.api.listByPage,data)
.then(res => {
this.listData = res.data.list.list
this.total = res.data.list.totalCount
}).catch(err => {})
},
handleCurrentChange(val) {
this.page = val
this.getData()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteById}?cid=${row.cid}`).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {})
},
addFirst(){
this.isAddFirst = true
this.firstVisible = true
},
firstSubmit(){
if(!this.firstName) return this.$message.warning('请填写题库分类名称')
let data = {
userId: this.userId,
typeName: this.firstName,
schoolId: this.clientId,
source: 2
}
if(this.curRow.cid){
data.cid = this.curRow.cid
this.$post(this.api.modifyLevel, data).then(res => {
if(res.success){
this.$message.success('修改成功');
this.firstVisible = false
this.getData()
}
}).catch(err => {})
}else{
this.$post(this.api.AddOneLevel, data).then(res => {
if(res.success){
this.$message.success('添加成功');
this.firstVisible = false
this.getData()
}
}).catch(err => {})
}
},
addSecond(row){
this.isAddSecond = true
this.curRow = row
this.secondVisible = true
},
closeFirst(){
this.curRow = {}
this.firstName = ''
},
closeSecond(){
this.curRow = {}
this.secondName = ''
},
editType(row){
this.curRow = row
if(row.parentId == 0){
this.isAddFirst = false
this.firstVisible = true
this.firstName = row.typeName
}else{
this.isAddSecond = false
this.secondVisible = true
this.secondName = row.typeName
}
},
secondSubmit(){
if(!this.secondName) return this.$message.warning('请填写题库分类名称')
let data = {
typeName: this.secondName,
userId: this.userId,
schoolId: this.clientId,
source: 2
}
if(this.curRow.parentId == 0){
data.parentId = this.curRow.cid
this.$post(this.api.AddSecondLevel, data).then(res => {
this.$message.success('添加成功');
this.secondVisible = false
this.getData()
}).catch(err => {})
}else{
data.cid = this.curRow.cid
this.$post(this.api.modifyLevel, data).then(res => {
this.$message.success('修改成功');
this.secondVisible = false
this.getData()
}).catch(err => {})
}
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {})
}).catch(() => {})
},
}
}
</script>
<style lang="scss" scoped>
</style>

@ -11,7 +11,12 @@
> >
<el-form-item label="所属题库" prop="cid"> <el-form-item label="所属题库" prop="cid">
<el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库"> <el-select v-model="topicForm.cid" clearable placeholder="请选择所属题库">
<el-option v-for="(item,index) in quesBankList" :key="index" :label="item.typeName" :value="item.cid"></el-option> <template v-for="(item,index) in quesBankList">
<el-option :key="index" :label="item.typeName" :value="item.cid"></el-option>
<template v-for="(item1,index1) in item.secondColumn">
<el-option class="second" :key="index1" :label="item1.typeName" :value="item1.cid"></el-option>
</template>
</template>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="所属课程" prop="courses"> <el-form-item label="所属课程" prop="courses">
@ -51,44 +56,44 @@
<el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'"> <el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'">
<template v-if="topicForm.questionType == '判断题'"> <template v-if="topicForm.questionType == '判断题'">
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>A</span> <span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionA" disabled></el-input> <el-input placeholder="请输入题目" v-model="topicForm.judgeOptionA" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="1">设为正确答案</el-radio> <el-radio v-model="topicForm.aisTrue" label="1">设为正确答案</el-radio>
</div> </div>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>B</span> <span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionB" disabled></el-input> <el-input placeholder="请输入题目" v-model="topicForm.judgeOptionB" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="2">设为正确答案</el-radio> <el-radio v-model="topicForm.aisTrue" label="2">设为正确答案</el-radio>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>A</span> <span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>B</span> <span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>C</span> <span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>D</span> <span>D</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div> </div>
<div class="input flex_around bt"> <div class="input flex j-around a-center m-b-15">
<span>E</span> <span>E</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class="input flex_around"> <div class="input flex j-around a-center">
<span>F</span> <span>F</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
@ -248,16 +253,13 @@ export default {
getQuesBank() { getQuesBank() {
let data = { let data = {
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 10000,
schoolId: this.clientId,
source: 2
} }
this.$post(this.api.listByPage,data) this.$post(this.api.listByPage,data)
.then(res => { .then(res => {
let list = res.data.list.list this.quesBankList = res.data.list.list
let result = list
list.map((n,i) => {
result = result.concat(n.secondColumn)
})
this.quesBankList = result
}) })
.catch(err => {}) .catch(err => {})
}, },
@ -444,16 +446,8 @@ export default {
::v-deep .el-checkbox-group{ ::v-deep .el-checkbox-group{
font-size: 2px; font-size: 2px;
} }
.Upload { .second{
text-align: center; padding-left: 46px !important;
}
.bt {
margin-bottom: 15px;
}
.flex_around {
display: flex;
justify-content: space-around;
align-items: center;
} }
.input ::v-deep .el-input { .input ::v-deep .el-input {
width: 50%; width: 50%;

@ -61,7 +61,7 @@
<el-dialog :title="isAdd ? '新增学生' : '编辑学生'" :visible.sync="studentVisible" <el-dialog :title="isAdd ? '新增学生' : '编辑学生'" :visible.sync="studentVisible"
width="30%" center @close="closestudent" class="dialog" :close-on-click-modal="false"> width="30%" center @close="closestudent" class="dialog" :close-on-click-modal="false">
<el-form ref="studentForm" :model="studentForm" :rules="rules" label-width="80px"> <el-form ref="studentForm" :model="studentForm" :rules="rules" label-width="90px">
<el-form-item prop="account" label="账号"> <el-form-item prop="account" label="账号">
<el-input v-model="studentForm.account" placeholder="请输入学生账号" @change="accountChange"></el-input> <el-input v-model="studentForm.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
</el-form-item> </el-form-item>

@ -256,7 +256,7 @@ export default {
}, },
sureDepartment(){ sureDepartment(){
if(!this.Form2.departmentName) return this.$message.warning('请输入年级名称') if(!this.Form2.departmentName) return this.$message.warning('请输入年级名称')
// if(isNaN(this.Form2.departmentName)) return this.$message.warning('') if(isNaN(this.Form2.departmentName)) return this.$message.warning('年级名称必须为数字')
let data = { let data = {
gradeName: this.Form2.departmentName, gradeName: this.Form2.departmentName,
gradeId: this.Form2.departmentId, gradeId: this.Form2.departmentId,

@ -249,7 +249,7 @@
</template> </template>
<script> <script>
import mixins from '@/mixins/setBackground' import mixins from '@/mixins/setBackground'
import { mapState } from 'vuex' import { mapState,mapActions } from 'vuex'
import testPaper from '@/components/testPaperDetail' import testPaper from '@/components/testPaperDetail'
import util from '@/libs/util' import util from '@/libs/util'
export default { export default {
@ -391,6 +391,9 @@ export default {
this.id && this.getInfo() this.id && this.getInfo()
}, },
methods: { methods: {
...mapActions('testpaper', [
'setInfo'
]),
getInfo() { getInfo() {
this.$post(`${this.api.detailtestPaper}?id=${this.id}`) this.$post(`${this.api.detailtestPaper}?id=${this.id}`)
.then(res => { .then(res => {
@ -540,6 +543,10 @@ export default {
preview(){ preview(){
this.$post(`${this.api.previewPaper}?qid=${this.selectedData.map(n => n.id).join(',')}`) this.$post(`${this.api.previewPaper}?qid=${this.selectedData.map(n => n.id).join(',')}`)
.then(res => { .then(res => {
this.setInfo({
paperName: this.name,
totalDuration: this.duration
})
this.previewIndex++ this.previewIndex++
this.previewList = res.data this.previewList = res.data
this.previewVisible = true this.previewVisible = true

@ -1,5 +1,83 @@
<template> <template>
<div> <div>
<el-dialog title="导出" :visible.sync="exportVisible" width="100%" :modal="false" v-loading="loading" top="5500px">
<div class="testpaper" id="pdfDom">
<h1 class="title">{{paperName}}</h1>
<ul class="types">
<li>
<h6 class="type">单选题</h6>
<ul class="ques">
<li v-for="(item,index) in paperList.list1" :key="index">
<div class="l-title">
<span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div>
</div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li>
</ul>
</li>
<li>
<h6 class="type">多选题</h6>
<ul class="ques">
<li v-for="(item,index) in paperList.list2" :key="index">
<div class="l-title">
<span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div>
</div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li>
</ul>
</li>
<li>
<h6 class="type">填空题</h6>
<ul class="ques">
<li v-for="(item,index) in paperList.list3" :key="index">
<div class="l-title">
<span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div>
</div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li>
</ul>
</li>
<li>
<h6 class="type">判断题</h6>
<ul class="ques">
<li v-for="(item,index) in paperList.list4" :key="index">
<div class="l-title">
<span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div>
</div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li>
</ul>
</li>
<li>
<h6 class="type">简答题</h6>
<ul class="ques">
<li v-for="(item,index) in paperList.list5" :key="index">
<div class="l-title">
<span class="index">{{index+1}}.</span>
<div v-html="item.questionStem"></div>
</div>
<div class="options">
<p v-for="(option,i) in item.options" :key="i">{{i}}.{{item.options[i]}}</p>
</div>
</li>
</ul>
</li>
</ul>
</div>
</el-dialog>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<div class="p-title m-b-20">筛选</div> <div class="p-title m-b-20">筛选</div>
@ -84,6 +162,7 @@
<el-button type="text" @click="copy(scope.row)" v-auth>复制</el-button> <el-button type="text" @click="copy(scope.row)" v-auth>复制</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button> <el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="exportData(scope.row)" v-auth>导出</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -92,11 +171,15 @@
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import { mapState,mapGetters,mapActions } from 'vuex' import { mapState,mapGetters,mapActions } from 'vuex'
import html2Canvas from 'html2canvas'
import JsPDF from 'jspdf'
export default { export default {
data() { data() {
return { return {
@ -115,6 +198,16 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
searchTimer: null, searchTimer: null,
exportVisible: false,
paperName: '',
paperList: {
list1: [],
list2: [],
list3: [],
list4: [],
list5: []
},
loading: false
}; };
}, },
computed: { computed: {
@ -175,7 +268,7 @@ export default {
}).catch(err => {}) }).catch(err => {})
}, },
handleSelecteChange(val){ handleSelecteChange(val){
this.multipleSelection = val; this.multipleSelection = val
}, },
getCourses() { getCourses() {
this.$post(`${this.api.getSelectInfo}?type=2`) this.$post(`${this.api.getSelectInfo}?type=2`)
@ -185,8 +278,8 @@ export default {
.catch(err => {}) .catch(err => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val
this.getData(); this.getData()
}, },
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
@ -196,9 +289,76 @@ export default {
this.$post(`${this.api.delByMyTestPaper}?ids=${row.id}`).then(res => { this.$post(`${this.api.delByMyTestPaper}?ids=${row.id}`).then(res => {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}, },
handleOptions(){
let list = this.paperList
for(let i in list){
list[i].map(n => {
if(i == 'list3'){
n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,`_____________`)
}
if(!n.options){
let options = {}
for(let i in n){
if(i.includes('option') && n[i]){
options[i.replace('option','')] = n[i]
}
}
n.options = options
}
})
}
this.paperList = list
},
exportData(row){
this.loading = true
this.exportVisible = true
this.paperName = row.name
this.$post(`${this.api.previewtestPaper}?id=1`)
.then(res => {
this.paperList = res.data
this.handleOptions()
var title = row.name
// return false
this.$nextTick(() => {
setTimeout(() => {
html2Canvas(document.querySelector('#pdfDom'), {
allowTaint: true
}).then(canvas => {
let contentWidth = canvas.width
let contentHeight = canvas.height
let pageHeight = contentWidth / 592.28 * 841.89
let leftHeight = contentHeight
let position = 0
let imgWidth = 595.28
let imgHeight = 592.28 / contentWidth * contentHeight
let pageData = canvas.toDataURL('image/jpeg', 1.0)
let PDF = new JsPDF('', 'pt', 'a4')
if (leftHeight < pageHeight) {
PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= 841.89
if (leftHeight > 0) {
PDF.addPage()
}
}
}
PDF.save(title + '.pdf')
this.loading = false
this.exportVisible = false
})
},500)
})
}).catch(err => {
this.loading = false
})
},
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length){ if(this.multipleSelection.length){
let newArr = this.multipleSelection let newArr = this.multipleSelection
@ -286,4 +446,43 @@ export default {
/deep/.no-mb.el-form-item{ /deep/.no-mb.el-form-item{
margin-bottom: 0; margin-bottom: 0;
} }
.testpaper{
width: 90%;
padding: 20px;
margin: 0 auto;
.title{
text-align: center;
font-size: 30px;
font-weight: bold;
}
.types{
&>li{
margin-bottom: 30px;
.type{
margin-bottom: 10px;
font-size: 16px;
}
}
.ques{
&>li{
margin-bottom: 20px;
.l-title{
display: flex;
margin-bottom: 10px;
font-size: 14px;
.index{
margin: 2px 10px 0 0;
}
}
.options{
display: flex;
p{
margin-right: 20px;
font-size: 12px;
}
}
}
}
}
}
</style> </style>

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
// 接口请求地址 // 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000/', // apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000/',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000', apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
// oss文件管理接口地址 // oss文件管理接口地址
apiUploadURL: 'http://8.134.8.197:8001', apiUploadURL: 'http://8.134.8.197:8001',
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒

@ -86,22 +86,22 @@ export default {
}, },
getters: { getters: {
getTypeName: state => id => { getTypeName: state => id => {
return state.typeList.find(n => n.id == id).name return id != null ? state.typeList.find(n => n.id == id).name : ''
}, },
getStateName: state => id => { getStateName: state => id => {
return state.stateList.find(n => n.id == id).name return id != null ? state.stateList.find(n => n.id == id).name : ''
}, },
getReviewStatusName: state => id => { getReviewStatusName: state => id => {
return state.reviewStatusList.find(n => n.id == id).name return id != null ? state.reviewStatusList.find(n => n.id == id).name : ''
}, },
getExamStatusName: state => id => { getExamStatusName: state => id => {
return state.examStatusList.find(n => n.id == id).name return id != null ? state.examStatusList.find(n => n.id == id).name : ''
}, },
getCorrectingName: state => id => { getCorrectingName: state => id => {
return state.correctingList.find(n => n.id == id).name return id != null ? state.correctingList.find(n => n.id == id).name : ''
}, },
getStudentStateName: state => id => { getStudentStateName: state => id => {
return state.studentStateList.find(n => n.id == id).name return id != null ? state.studentStateList.find(n => n.id == id).name : ''
}, },
}, },
mutations: { mutations: {

@ -65,16 +65,16 @@ export default {
}, },
getters: { getters: {
getStateName: state => id => { getStateName: state => id => {
return state.stateList.find(n => n.id == id).name return id != null ? state.stateList.find(n => n.id == id).name : ''
}, },
getReviewStatusName: state => id => { getReviewStatusName: state => id => {
return state.reviewStatusList.find(n => n.id == id).name return id != null ? state.reviewStatusList.find(n => n.id == id).name : ''
}, },
getExamStatusName: state => id => { getExamStatusName: state => id => {
return state.examStatusList.find(n => n.id == id).name return id != null ? state.examStatusList.find(n => n.id == id).name : ''
}, },
getCorrectingName: state => id => { getCorrectingName: state => id => {
return state.correctingList.find(n => n.id == id).name return id != null ? state.correctingList.find(n => n.id == id).name : ''
}, },
}, },
mutations: { mutations: {

@ -52,16 +52,16 @@ export default {
}, },
getters: { getters: {
getStatusName: state => id => { getStatusName: state => id => {
return state.statusList.find(n => n.id == id).name return id != null ? state.statusList.find(n => n.id == id).name : ''
}, },
getEffectName: state => id => { getEffectName: state => id => {
return state.effectList.find(n => n.id == id).label return id != null ? state.effectList.find(n => n.id == id).label : ''
}, },
getDegreeName: state => id => { getDegreeName: state => id => {
return state.degreeList.find(n => n.id == id).label return id != null ? state.degreeList.find(n => n.id == id).label : ''
}, },
getTypeName: state => id => { getTypeName: state => id => {
return state.typeList.find(n => n.id == id).label return id != null ? state.typeList.find(n => n.id == id).label : ''
}, },
}, },
mutations: { mutations: {

Loading…
Cancel
Save