index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <!-- 试卷管理 -->
  2. <template>
  3. <div class="app-container testPaperManagement">
  4. <div class="page-container testPaperManagementPage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <el-form-item label="" prop="shareStatus">
  9. <el-select v-model="queryParams.shareStatus" placeholder="是否共享" style="width: 120px">
  10. <el-option label="共享" value="1"/>
  11. <el-option label="不共享" value="0"/>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="" prop="deptId">
  15. <el-cascader
  16. style="width: 180px"
  17. v-model="queryParams.deptId"
  18. :options="optionListB"
  19. :props="{
  20. emitPath:false,
  21. checkStrictly: true,
  22. value: 'deptId',
  23. label: 'deptName',
  24. children: 'child',
  25. }"
  26. :show-all-levels="false"
  27. filterable
  28. placeholder="来源"
  29. ></el-cascader>
  30. </el-form-item>
  31. <el-form-item label="" prop="knowledgePointId">
  32. <el-cascader
  33. style="width: 180px"
  34. v-model="queryParams.knowledgePointId"
  35. :options="optionListC"
  36. :props="{
  37. emitPath:false,
  38. checkStrictly: true,
  39. value: 'id',
  40. label: 'knowledgePointName',
  41. children: 'children',
  42. }"
  43. :show-all-levels="false"
  44. filterable
  45. placeholder="知识点"
  46. ></el-cascader>
  47. </el-form-item>
  48. <el-form-item label="" prop="disciplineTypeId">
  49. <el-select v-model="queryParams.disciplineTypeId" placeholder="专业类别" style="width: 140px">
  50. <el-option
  51. v-for="dict in optionListD"
  52. :key="dict.id"
  53. :label="dict.disciplineName"
  54. :value="dict.id"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="" prop="assemblyMode">
  59. <el-select v-model="queryParams.assemblyMode" placeholder="组卷方式" style="width: 140px">
  60. <el-option label="固定组卷" value="1"/>
  61. <el-option label="随机组卷" value="2"/>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item label="" prop="searchValue">
  65. <el-input
  66. maxLength="30"
  67. v-model="queryParams.searchValue"
  68. placeholder="搜索名称"
  69. style="width: 140px"
  70. />
  71. </el-form-item>
  72. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  73. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  74. <p class="page-submit-common-style-button"
  75. style="float: right;"
  76. @click="tableButton(1)"
  77. >新建试卷</p>
  78. </el-form>
  79. </div>
  80. <div class="page-content-box">
  81. <el-table class="table-box" border :data="dataList">
  82. <el-table-column label="试卷名称" prop="paperName" show-overflow-tooltip>
  83. <template slot-scope="scope">
  84. <span style="color:#0183fa;cursor: pointer" @click="tableButton(2,scope.row)">{{scope.row.paperName}}</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="组卷方式" prop="assemblyMode" width="120" show-overflow-tooltip>
  88. <template slot-scope="scope">
  89. <span>{{scope.row.assemblyMode==1?'固定组卷':'随机组卷'}}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="知识点" prop="knowledgePointNames" width="160" show-overflow-tooltip/>
  93. <el-table-column label="专业类别" prop="disciplineTypeName" width="120" show-overflow-tooltip/>
  94. <el-table-column label="是否共享" prop="shareStatus" width="120" show-overflow-tooltip>
  95. <template slot-scope="scope">
  96. <span style="padding:2px 10px;border:1px solid rgb(1, 131, 251);border-radius:4px;color: rgb(1, 131, 251);background-color:rgba(1, 131, 251,0.2)" v-if="scope.row.shareStatus==1">共享</span>
  97. <span style="padding:2px 10px;border:1px solid rgb(245, 154, 35);border-radius:4px;color: rgb(245, 154, 35);background-color:rgba(245, 154, 35,0.2)" v-if="scope.row.shareStatus==0">不共享</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="来源" prop="deptName" width="160" show-overflow-tooltip/>
  101. <el-table-column label="总分" prop="totalScore" width="100" show-overflow-tooltip/>
  102. <el-table-column label="及格分" prop="passScore" width="100" show-overflow-tooltip/>
  103. <el-table-column label="更新时间" prop="createTime" width="180" show-overflow-tooltip>
  104. <template slot-scope="scope">
  105. <span>{{ scope.row.updateTime?parseTime(scope.row.updateTime,"{y}-{m}-{d} {h}:{i}"):parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="操作" width="200" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <div class="table-button-box">
  111. <p class="table-button-null"></p>
  112. <p class="table-button-p"
  113. @click="tableButton(3,scope.row)"
  114. >编辑</p>
  115. <p class="table-button-p"
  116. @click="tableButton(4,scope.row)"
  117. >复制</p>
  118. <p class="table-button-p"
  119. @click="tableButton(5,scope.row)"
  120. >删除</p>
  121. <p class="table-button-null"></p>
  122. </div>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <pagination :page-sizes="[20, 30, 40, 50]"
  127. v-show="total>0"
  128. :total="total"
  129. :page.sync="queryParams.page"
  130. :limit.sync="queryParams.pageSize"
  131. @pagination="getList"
  132. />
  133. </div>
  134. </div>
  135. <add-page :propsData="propsData" v-if="pageType === 2"></add-page>
  136. </div>
  137. </template>
  138. <script>
  139. //import { getDicts } from "@/api/commonality/noPermission";
  140. //import { systemUserSelect } from "@/api/commonality/permission";
  141. //import { getInfo } from "@/api/basicsModules/index";
  142. import addPage from "./addPage.vue";
  143. import {
  144. examElPaperPage,examElPaperDel,examElPaperCopy,
  145. examElDisciplineTypeList,systemDeptCurrentDept,examElKnowledgePointTreeList,
  146. } from "@/api/safetyEducationExaminationNew/index";
  147. export default {
  148. name: 'index',
  149. components: {
  150. addPage
  151. },
  152. data () {
  153. return {
  154. tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
  155. //页面状态
  156. pageType:1,
  157. //下拉列表数据
  158. optionListB:[],
  159. optionListC:[],
  160. optionListD:[],
  161. //查询条件
  162. queryParams:{
  163. page:1,
  164. pageSize:20,
  165. searchValue:'',
  166. shareStatus :null,
  167. deptId :null,
  168. knowledgePointId :null,
  169. assemblyMode :null,
  170. disciplineTypeId :null,
  171. },
  172. //列表数据
  173. dataList:[],
  174. //数据数量
  175. total:0,
  176. //组件传参
  177. propsData:{},
  178. }
  179. },
  180. created () {
  181. },
  182. mounted () {
  183. this.systemDeptCurrentDept();
  184. this.examElKnowledgePointTreeList();
  185. this.examElDisciplineTypeList();
  186. this.getList();
  187. },
  188. methods: {
  189. //查询按钮
  190. handleQuery(){
  191. this.$set(this.queryParams,'page',1);
  192. this.getList();
  193. },
  194. //重置按钮
  195. resetQuery(){
  196. this.$set(this,'queryParams',{
  197. page:1,
  198. pageSize:20,
  199. searchValue:'',
  200. shareStatus :null,
  201. deptId :null,
  202. knowledgePointId :null,
  203. assemblyMode :null,
  204. disciplineTypeId :null,
  205. });
  206. this.getList();
  207. },
  208. //获取数据列表
  209. getList(){
  210. let obj = JSON.parse(JSON.stringify(this.queryParams))
  211. examElPaperPage(obj).then(response => {
  212. this.$set(this,'dataList',response.data.records);
  213. this.$set(this,'total',response.data.total);
  214. });
  215. },
  216. //操作按钮
  217. tableButton(type,row){
  218. let self = this;
  219. if(type == 1){
  220. //新增
  221. this.$set(this,'pageType',2);
  222. this.$set(this,'propsData',{});
  223. }else if(type == 2){
  224. //预览
  225. this.$set(this,'pageType',2);
  226. let obj = JSON.parse(JSON.stringify(row))
  227. obj.showType = true;
  228. this.$set(this,'propsData',obj);
  229. }else if(type == 3){
  230. //编辑
  231. this.$set(this,'pageType',2);
  232. let obj = JSON.parse(JSON.stringify(row))
  233. this.$set(this,'propsData',obj);
  234. }else if(type == 4){
  235. //复制
  236. this.$confirm('是否确认复制?', "警告", {
  237. confirmButtonText: "确定",
  238. cancelButtonText: "取消",
  239. type: "warning"
  240. }).then(function() {
  241. }).then(() => {
  242. examElPaperCopy({id:row.id}).then(response => {
  243. self.msgSuccess(response.message)
  244. self.getList();
  245. });
  246. }).catch(() => {});
  247. }else if(type == 5){
  248. //删除
  249. this.$confirm('是否确认删除?', "警告", {
  250. confirmButtonText: "确定",
  251. cancelButtonText: "取消",
  252. type: "warning"
  253. }).then(function() {
  254. }).then(() => {
  255. examElPaperDel({id:row.id}).then(response => {
  256. self.msgSuccess(response.message)
  257. self.getList();
  258. });
  259. }).catch(() => {});
  260. }else if(type == 6){
  261. //返回并刷新
  262. this.$set(this,'pageType',1);
  263. this.getList();
  264. }
  265. },
  266. //知识点
  267. examElKnowledgePointTreeList(){
  268. examElKnowledgePointTreeList({}).then(response => {
  269. const list = response.data || [];
  270. this.formatTreeData(list);
  271. this.$set(this, 'optionListC', list);
  272. });
  273. },
  274. //学院列表
  275. systemDeptCurrentDept(){
  276. systemDeptCurrentDept({}).then(response => {
  277. const list = response.data || [];
  278. this.formatTreeData(list);
  279. this.$set(this,'optionListB',response.data);
  280. });
  281. },
  282. //查询全部专业类别
  283. examElDisciplineTypeList(){
  284. examElDisciplineTypeList({}).then(response => {
  285. this.$set(this,'optionListD',response.data);
  286. });
  287. },
  288. },
  289. }
  290. </script>
  291. <style scoped lang="scss">
  292. .testPaperManagement{
  293. .testPaperManagementPage{
  294. }
  295. }
  296. </style>