index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <!--用户数据-->
  5. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
  6. <el-form-item label="考试名称" prop="examCollectionName">
  7. <el-input
  8. v-model="queryParams.examCollectionName"
  9. placeholder="请输入考试名称"
  10. clearable
  11. style="width: 240px"
  12. @keyup.enter.native="handleQuery"
  13. />
  14. </el-form-item>
  15. <!-- <el-form-item label="考试状态" prop="examCollectionState">
  16. <el-select
  17. v-model="queryParams.status"
  18. placeholder="考试状态"
  19. clearable
  20. style="width: 200px"
  21. >
  22. <el-option
  23. v-for="dict in dict.type.sys_normal_disable"
  24. :key="dict.value"
  25. :label="dict.label"
  26. :value="dict.value"
  27. />
  28. </el-select>
  29. </el-form-item> -->
  30. <el-form-item label="考试时间">
  31. <el-date-picker
  32. v-model="dateRange"
  33. style="width: 260px"
  34. value-format="yyyy-MM-dd"
  35. type="daterange"
  36. range-separator="-"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. ></el-date-picker>
  40. </el-form-item>
  41. <el-form-item label="模拟器类型" prop="simType">
  42. <el-select
  43. v-model="queryParams.simType"
  44. placeholder="模拟器类型"
  45. clearable
  46. style="width: 240px"
  47. >
  48. <el-option
  49. v-for="dict in dict.type.sim_sim_type"
  50. :key="dict.value"
  51. :label="dict.label"
  52. :value="dict.value"
  53. />
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="创建时间">
  57. <el-date-picker
  58. style="width: 260px"
  59. value-format="yyyy-MM-dd"
  60. type="daterange"
  61. range-separator="-"
  62. start-placeholder="开始日期"
  63. end-placeholder="结束日期"
  64. ></el-date-picker>
  65. </el-form-item>
  66. <el-form-item>
  67. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  68. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  69. </el-form-item>
  70. </el-form>
  71. <el-row :gutter="10" class="mb8">
  72. <el-col :span="1.5">
  73. <el-button
  74. type="primary"
  75. plain
  76. icon="el-icon-plus"
  77. size="mini"
  78. @click="handleAdd"
  79. >新增</el-button>
  80. </el-col>
  81. <el-col :span="1.5">
  82. <el-button
  83. type="success"
  84. plain
  85. icon="el-icon-edit"
  86. size="mini"
  87. :disabled="single"
  88. @click="handleUpdate"
  89. >修改</el-button>
  90. </el-col>
  91. <el-col :span="1.5">
  92. <el-button
  93. type="danger"
  94. plain
  95. icon="el-icon-delete"
  96. size="mini"
  97. :disabled="multiple"
  98. @click="handleDelete"
  99. >删除</el-button>
  100. </el-col>
  101. <!-- <el-col :span="1.5">
  102. <el-button
  103. type="warning"
  104. plain
  105. icon="el-icon-s-operation"
  106. size="mini"
  107. :disabled="single"
  108. @click="handleKaoshi"
  109. >当前考试</el-button>
  110. </el-col> -->
  111. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
  112. </el-row>
  113. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  114. <el-table-column type="selection" width="50" align="center" />
  115. <el-table-column label="编号" align="center" key="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" width="80"/>
  116. <el-table-column label="考试名称" align="center" key="examCollectionName" prop="examCollectionName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  117. <el-table-column label="考试时长" align="center" key="limitDuration" prop="limitDuration" v-if="columns[2].visible" :show-overflow-tooltip="true" width="100"/>
  118. <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[3].visible" :show-overflow-tooltip="true" >
  119. <template slot-scope="scope">
  120. <span>{{scope.row.startTime}}</span> ~ <span>{{scope.row.endTime}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="模拟器类型" align="center" key="simType" prop="simType" v-if="columns[4].visible" :show-overflow-tooltip="true" >
  124. <template slot-scope="scope">
  125. <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.simType"/>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="创建老师" align="center" key="createBy" prop="createBy" v-if="columns[5].visible" :show-overflow-tooltip="true" width="100" />
  129. <el-table-column label="考试状态" align="center" key="examCollectionState" v-if="columns[6].visible" width="100">
  130. <template slot-scope="scope">
  131. <el-switch
  132. v-model="scope.row.examCollectionState"
  133. active-value="2"
  134. inactive-value="3"
  135. @change="handleStatusChange(scope.row)"
  136. ></el-switch>
  137. </template>
  138. </el-table-column>
  139. <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[7].visible" width="160">
  140. <template slot-scope="scope">
  141. <span>{{ parseTime(scope.row.createTime) }}</span>
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. label="操作"
  146. align="center"
  147. width="160"
  148. class-name="small-padding fixed-width"
  149. >
  150. <template slot-scope="scope">
  151. <el-button
  152. size="mini"
  153. type="text"
  154. icon="el-icon-edit"
  155. @click="handleUpdate(scope.row)"
  156. >修改</el-button>
  157. <el-button
  158. size="mini"
  159. type="text"
  160. icon="el-icon-delete"
  161. @click="handleDelete(scope.row)"
  162. >删除</el-button>
  163. </template>
  164. </el-table-column>
  165. </el-table>
  166. <pagination
  167. v-show="total>0"
  168. :total="total"
  169. :page.sync="queryParams.pageNum"
  170. :limit.sync="queryParams.pageSize"
  171. @pagination="getList"
  172. />
  173. </el-row>
  174. <!-- 添加或修改用户配置对话框 -->
  175. <el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
  176. <el-form ref="form" :model="form" :rules="rules" label-width="80px" >
  177. <el-row>
  178. <el-col :span="8">
  179. <el-form-item label="考试名称" prop="examCollectionName">
  180. <el-input placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName" style="width: 65%;"/>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="8" >
  184. <el-form-item label="型号" prop="simType">
  185. <el-select v-model="form.simType" placeholder="请选择模拟器类型" style="width: 65%;">
  186. <el-option
  187. v-for="dict in dict.type.sim_sim_type"
  188. :key="dict.value"
  189. :label="dict.label"
  190. :value="dict.value"
  191. ></el-option>
  192. </el-select>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="8">
  196. <el-form-item label="考试时间" prop="examTime">
  197. <el-date-picker type="daterange" v-model="form.examTime" format="yyyy-MM-dd"
  198. value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始时间" end-placeholder="结束时间"
  199. range-separator="至" clearable></el-date-picker>
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="8">
  203. <el-form-item label="考试时长" prop="limitDuration">
  204. <el-input v-model="form.limitDuration" placeholder="请输入考试时长" style="width: 65%;">
  205. <template slot="append">
  206. <el-button type="primary">
  207. 单位(分)
  208. </el-button>
  209. </template>
  210. </el-input>
  211. </el-form-item>
  212. </el-col>
  213. <el-col :span="8">
  214. <el-form-item label="出题方式" prop="questionSettingMethod">
  215. <el-select v-model="form.questionSettingMethod" placeholder="请选择出题方式" style="width: 65%;" @change="selectmethod">
  216. <el-option
  217. value="请选择"
  218. >请选择</el-option>
  219. <el-option
  220. v-for="dict in dict.type.sim_question_setting_method"
  221. :key="dict.value"
  222. :label="dict.label"
  223. :value="dict.value"
  224. ></el-option>
  225. </el-select>
  226. </el-form-item>
  227. </el-col>
  228. <el-button type="primary" round @click="handleSelectType" v-show="isShow" style="margin-left: 15px;">自选考题编辑</el-button>
  229. </el-row>
  230. </el-form>
  231. <el-descriptions title="班级列表" :column="3" ></el-descriptions>
  232. <el-row :gutter="20">
  233. <el-col :xs="24">
  234. <el-row :gutter="10" class="mb8">
  235. <!-- <el-col :span="1.5">
  236. <el-button
  237. type="primary"
  238. plain
  239. icon="el-icon-plus"
  240. size="mini"
  241. @click="handleAdd"
  242. v-hasPermi="['system:user:add']"
  243. >添加</el-button>
  244. </el-col>
  245. <el-col :span="1.5">
  246. <el-button
  247. type="success"
  248. plain
  249. icon="el-icon-edit"
  250. size="mini"
  251. :disabled="single"
  252. @click="handleUpdate"
  253. v-hasPermi="['system:user:edit']"
  254. >修改</el-button>
  255. </el-col>
  256. <el-col :span="1.5">
  257. <el-button
  258. type="danger"
  259. plain
  260. icon="el-icon-delete"
  261. size="mini"
  262. :disabled="multiple"
  263. @click="handleDelete"
  264. v-hasPermi="['system:user:remove']"
  265. >删除</el-button>
  266. </el-col> -->
  267. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList1" :columns="columns"></right-toolbar>
  268. </el-row>
  269. <el-table v-loading="loading" :data="userList1" @selection-change="handleSelectionChange">
  270. <el-table-column type="selection" width="50" align="center" />
  271. <el-table-column label="区队/班级" align="center" key="className" prop="className" v-if="columns[0].visible" :show-overflow-tooltip="true" />
  272. <el-table-column label="专业名称" align="center" key="majorName" prop="majorName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  273. <el-table-column label="全部学员数量" align="center" key="remark" prop="remark" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  274. <!-- <el-table-column
  275. label="操作"
  276. align="center"
  277. width="160"
  278. class-name="small-padding fixed-width"
  279. >
  280. <template slot-scope="scope">
  281. <el-button
  282. size="mini"
  283. type="text"
  284. icon="el-icon-edit"
  285. @click="handleUpdate(scope.row)"
  286. v-hasPermi="['system:user:edit']"
  287. >修改</el-button>
  288. <el-button
  289. size="mini"
  290. type="text"
  291. icon="el-icon-delete"
  292. @click="handleDelete(scope.row)"
  293. v-hasPermi="['system:user:remove']"
  294. >删除</el-button>
  295. </template>
  296. </el-table-column> -->
  297. </el-table>
  298. <pagination
  299. v-show="total>0"
  300. :total="total"
  301. :page.sync="queryParams.pageNum"
  302. :limit.sync="queryParams.pageSize"
  303. @pagination="getList1"
  304. />
  305. </el-col>
  306. </el-row>
  307. <h4 class="h4" style="font-size: 16px;font-weight: bold;margin-left: 2%;">统计情况</h4>
  308. <div class="shixiang">
  309. <div>本次考试班级数量:2</div>
  310. <div>计划参加考试学员数量:34</div>
  311. <div>每批次考试学员数量:34</div>
  312. <div>计划考试批次:5</div>
  313. </div>
  314. <div slot="footer" class="dialog-footer" style="margin-top: 10%;">
  315. <el-button type="primary" @click="submitForm" v-if="form.examCollectionId == undefined" >添加考试</el-button>
  316. <el-button type="primary" @click="submitForm" v-if="form.examCollectionId != undefined" >确定考试</el-button>
  317. <el-button @click="cancel">取 消</el-button>
  318. </div>
  319. </el-dialog>
  320. <!-- 自选题目编辑 -->
  321. <el-dialog :title="title" :visible.sync="selectopen" width="70%" append-to-body>
  322. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  323. <el-row>
  324. <el-col :span="6">
  325. <el-form-item label="型号">
  326. <el-select v-model="selectedEquip" placeholder="请选择模拟器型号">
  327. <el-option
  328. v-for="dict in dict.type.sim_equip_type"
  329. :key="dict.value"
  330. :label="dict.label"
  331. :value="dict.value"
  332. ></el-option>
  333. </el-select>
  334. </el-form-item>
  335. </el-col>
  336. <el-col :span="6">
  337. <el-form-item label="训练任务">
  338. <el-select v-model="selectedEquip" placeholder="请选择训练任务">
  339. <el-option
  340. value="请选择"
  341. >请选择</el-option>
  342. </el-select>
  343. </el-form-item>
  344. </el-col>
  345. <div style="text-align: right;">
  346. <el-button @click="toggleSelection(tableData_tm)">选择全部</el-button>
  347. <el-button @click="toggleSelection()">取消选择</el-button>
  348. </div>
  349. </el-row>
  350. <el-table
  351. :data="tableData_tm" border ref="multipleTable" @selection-change="handleSelectionRow"
  352. :span-method="objectSpanMethod"
  353. style="width:100%;text-align:center;margin-left:10px; margin-top:10px">
  354. <el-table-column
  355. prop="xinghao"
  356. label="型号">
  357. </el-table-column>
  358. <el-table-column
  359. prop="xianxiang"
  360. label="故障现象">
  361. </el-table-column>
  362. <el-table-column
  363. prop="name"
  364. label="故障部位">
  365. </el-table-column>
  366. <el-table-column
  367. type="selection" prop="ids"
  368. label="ID"
  369. width="55"></el-table-column>
  370. </el-table>
  371. </el-form>
  372. <div slot="footer" class="dialog-footer">
  373. <el-button type="primary" @click="submitForm">确定</el-button>
  374. <el-button @click="cancel">取 消</el-button>
  375. </div>
  376. </el-dialog>
  377. </div>
  378. </template>
  379. <style>
  380. .el-table__header tr th .cell{
  381. text-align: center;
  382. }
  383. .el-table__row .cell {
  384. text-align: center;
  385. }
  386. .shixiang{
  387. margin-left: 2%;
  388. height: 30px;
  389. line-height: 30px;
  390. padding-left: 0%;
  391. }
  392. </style>
  393. <script>
  394. import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet,examTearcheropen,examTearcherclose} from "@/api/sim/exam";
  395. export default {
  396. name: "Exam",
  397. dicts: ['sim_sim_type','sim_question_setting_method','sys_normal_disable',],
  398. data() {
  399. return {
  400. multipleSelection: [],
  401. selectedEquip: '',
  402. // selectmethod:'',
  403. isShow:false,
  404. selectedZjEquip: '',
  405. tableData_tm: [
  406. {
  407. ids:1,
  408. xinghao: 'FZD04B型侦毒器',
  409. xianxiang: '开机无响应',
  410. name: '1.电源开关',
  411. },{
  412. ids:2,
  413. name: '2.DC/DC转换芯片',
  414. },{
  415. ids:3,
  416. xianxiang: '开机后按抽气开关,微电机不工作',
  417. name: '3.微电机',
  418. },{
  419. ids:4,
  420. name: '4.Q2',
  421. },{
  422. ids:5,
  423. xianxiang: '抽气流量不足',
  424. name: '5.滤网',
  425. },{
  426. ids:6,
  427. name: '6.调速电位器',
  428. },{
  429. ids:7,
  430. xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
  431. name: '7.加热指示灯',
  432. },{
  433. ids:8,
  434. name: '8.热敏开关',
  435. },
  436. {
  437. ids:9,
  438. xianxiang: '不能正常工作',
  439. name: '9.外壳及零件',
  440. },{
  441. ids:10,
  442. xianxiang: '电压低',
  443. name: '10.供电模块',
  444. },{
  445. ids:11,
  446. xianxiang: '抽气指示灯不亮',
  447. name: '11.抽气指示灯',
  448. },
  449. {
  450. ids:21,
  451. xinghao:'FZB006型毒剂报警器',
  452. xianxiang: '仪器无法开机',
  453. name: '1.薄膜开关FPC排线',
  454. },{
  455. ids:22,
  456. name: '2.主控板开机电路',
  457. },
  458. {
  459. ids:23,
  460. xianxiang: '蜂鸣器自检时,声音异常',
  461. name: '3.蜂鸣器出声口',
  462. },{
  463. ids:24,
  464. name: '4.接口接线板',
  465. },{
  466. ids:25,
  467. xianxiang: '仪器进入检测界面后,通入检测剂不报警',
  468. name: '5.检测剂',
  469. },{
  470. ids:26,
  471. name: '6.主控板信号采集电路',
  472. },
  473. {
  474. ids:27,
  475. xianxiang: '显示屏无显示',
  476. name: '7.主控板显示屏供电电路',
  477. },{
  478. ids:28,
  479. name: '8.显示屏',
  480. },
  481. {
  482. ids:29,
  483. xianxiang: '长时间不进入“检测中”',
  484. name: '9.干燥管',
  485. },{
  486. ids:210,
  487. name: '10.维护管',
  488. },
  489. {
  490. ids:211,
  491. xianxiang: '不能正常工作',
  492. name: '11.外壳及零件',
  493. },{
  494. ids:212,
  495. xianxiang: '电压低',
  496. name: '12.供电模块',
  497. },{
  498. ids:213,
  499. xianxiang: '无法开机',
  500. name: '13.DC/DC',
  501. },
  502. {
  503. ids:31,
  504. xinghao: '防化兵用毒剂报警器',
  505. xianxiang: '仪器无法开机',
  506. name: '1.FFC排线',
  507. },{
  508. ids:32,
  509. name: '2.汇总主控板',
  510. },{
  511. ids:33,
  512. xianxiang: '开机后,显示屏无显示',
  513. name: '3.显控报警板',
  514. },{
  515. ids:34,
  516. name: '4.显示屏',
  517. },{
  518. ids:35,
  519. xianxiang: '检测状态下模拟剂不报警',
  520. name: '5.汇总主控板信号采集电路',
  521. },{
  522. ids:36,
  523. name: '6.检测剂',
  524. },{
  525. ids:37,
  526. xianxiang: '长时间不能进入检测状态',
  527. name: '7.干燥管',
  528. },{
  529. ids:38,
  530. name: '8.维护管',
  531. },{
  532. ids:39,
  533. xianxiang: '固液检测/气体检测模式切换失败',
  534. name: '9.固液检测单元与主控板连接线',
  535. },{
  536. ids:310,
  537. name: '10.汇总主控板固液通信电路',
  538. },{
  539. ids:311,
  540. name: '11.切换按键',
  541. },{
  542. ids:312,
  543. xianxiang: '有毒有害气体检测模块不报警',
  544. name: '12.高压驱动板与汇总主控板连接线',
  545. },{
  546. ids:313,
  547. name: '13.汇总主控板毒害模块通信电路',
  548. },{
  549. ids:314,
  550. xianxiang: '不能正常工作',
  551. name: '14.外壳及零件',
  552. },{
  553. ids:315,
  554. xianxiang: '电压低',
  555. name: '15.供电模块',
  556. },{
  557. ids:316,
  558. xianxiang: '无法开机',
  559. name: '16.DC/DC',
  560. },
  561. ],
  562. // 遮罩层
  563. loading: true,
  564. // 选中数组
  565. ids: [],
  566. // 非单个禁用
  567. single: true,
  568. // 非多个禁用
  569. multiple: true,
  570. // 显示搜索条件
  571. showSearch: true,
  572. // 总条数
  573. total: 0,
  574. // 用户表格数据
  575. userList: null,
  576. // 用户表格数据
  577. userList1: null,
  578. // 弹出层标题
  579. title: "",
  580. // 部门树选项
  581. deptOptions: undefined,
  582. // 是否显示弹出层
  583. open: false,
  584. //自检弹出框
  585. zijianopen:false,
  586. // 自选题目编辑
  587. selectopen:false,
  588. // 默认密码
  589. initPassword: undefined,
  590. // 日期范围
  591. dateRange: [],
  592. // 岗位选项
  593. postOptions: [],
  594. // 角色选项
  595. roleOptions: [],
  596. // 表单参数
  597. form: {
  598. simType:'',
  599. questionSettingMethod:'',
  600. examTime:[],
  601. startTime:'',
  602. endTime:'',
  603. },
  604. defaultProps: {
  605. children: "children",
  606. label: "label"
  607. },
  608. // 查询参数
  609. queryParams: {
  610. pageNum: 1,
  611. pageSize: 10,
  612. userName: undefined,
  613. phonenumber: undefined,
  614. status: undefined,
  615. deptId: undefined
  616. },
  617. // 列信息
  618. columns: [
  619. { key: 0, label: `编号`, visible: true },
  620. { key: 1, label: `考试名称`, visible: true },
  621. { key: 2, label: `考试时长`, visible: true },
  622. { key: 3, label: `考试时间`, visible: true },
  623. { key: 4, label: `模拟器类型`, visible: true },
  624. { key: 5, label: `考试状态`, visible: true },
  625. { key: 6, label: `创建老师`, visible: true },
  626. { key: 7, label: `创建时间`, visible: true }
  627. ],
  628. // 表单校验
  629. rules: {
  630. examCollectionName: [
  631. { required: true,
  632. message: "考试名称不能为空",
  633. trigger: "blur" },
  634. ],
  635. limitDuration:[
  636. { required: true,
  637. message: "考试时长不能为空",
  638. trigger: "blur" },
  639. ],
  640. simType: [
  641. { required: true,
  642. message: "模拟器型号不能为空",
  643. trigger: "change"}
  644. ],
  645. questionSettingMethod: [
  646. { required: true,
  647. message: "出题方式不能为空",
  648. trigger: "change"}
  649. ],
  650. examTime:[{
  651. required: true,
  652. type: 'array',
  653. message: '请选择考试时间',
  654. trigger: 'change'
  655. }],
  656. }
  657. };
  658. },
  659. watch: {
  660. selectedEquip(newValue) {
  661. // console.log(newValue);
  662. // 根据newValue更新tableData
  663. // this.tableData = this.getNewTableData(newValue);
  664. // console.log(this.getNewTableData(newValue);
  665. if(newValue == 1){
  666. this.tableData_tm = [{
  667. ids:1,
  668. xinghao: 'FZD04B型侦毒器',
  669. xianxiang: '开机无响应',
  670. name: '1.电源开关',
  671. },{
  672. ids:2,
  673. name: '2.DC/DC转换芯片',
  674. },{
  675. ids:3,
  676. xianxiang: '开机后按抽气开关,微电机不工作',
  677. name: '3.微电机',
  678. },{
  679. ids:4,
  680. name: '4.Q2',
  681. },{
  682. ids:5,
  683. xianxiang: '抽气流量不足',
  684. name: '5.滤网',
  685. },{
  686. ids:6,
  687. name: '6.调速电位器',
  688. },{
  689. ids:7,
  690. xianxiang: '开机后按下加热开关,加热灯不亮,也未加热',
  691. name: '7.加热指示灯',
  692. },{
  693. ids:8,
  694. name: '8.热敏开关',
  695. },
  696. {
  697. ids:9,
  698. xianxiang: '不能正常工作',
  699. name: '9.外壳及零件',
  700. },{
  701. ids:10,
  702. xianxiang: '电压低',
  703. name: '10.供电模块',
  704. },{
  705. ids:11,
  706. xianxiang: '抽气指示灯不亮',
  707. name: '11.抽气指示灯',
  708. }];
  709. }else if(newValue == 2){
  710. this.tableData_tm = [{
  711. ids:21,
  712. xinghao:'FZB006型毒剂报警器',
  713. xianxiang: '仪器无法开机',
  714. name: '1.薄膜开关FPC排线',
  715. },{
  716. ids:22,
  717. name: '2.主控板开机电路',
  718. },
  719. {
  720. ids:23,
  721. xianxiang: '蜂鸣器自检时,声音异常',
  722. name: '3.蜂鸣器出声口',
  723. },{
  724. ids:24,
  725. name: '4.接口接线板',
  726. },{
  727. ids:25,
  728. xianxiang: '仪器进入检测界面后,通入检测剂不报警',
  729. name: '5.检测剂',
  730. },{
  731. ids:26,
  732. name: '6.主控板信号采集电路',
  733. },
  734. {
  735. ids:27,
  736. xianxiang: '显示屏无显示',
  737. name: '7.主控板显示屏供电电路',
  738. },{
  739. ids:28,
  740. name: '8.显示屏',
  741. },
  742. {
  743. ids:29,
  744. xianxiang: '长时间不进入“检测中”',
  745. name: '9.干燥管',
  746. },{
  747. ids:210,
  748. name: '10.维护管',
  749. },
  750. {
  751. ids:211,
  752. xianxiang: '不能正常工作',
  753. name: '11.外壳及零件',
  754. },{
  755. ids:212,
  756. xianxiang: '电压低',
  757. name: '12.供电模块',
  758. },{
  759. ids:213,
  760. xianxiang: '无法开机',
  761. name: '13.DC/DC',
  762. }]
  763. }else if(newValue == 3){
  764. this.tableData_tm = [{
  765. ids:31,
  766. xinghao: '防化兵用毒剂报警器',
  767. xianxiang: '仪器无法开机',
  768. name: '1.FFC排线',
  769. },{
  770. ids:32,
  771. name: '2.汇总主控板',
  772. },{
  773. ids:33,
  774. xianxiang: '开机后,显示屏无显示',
  775. name: '3.显控报警板',
  776. },{
  777. ids:34,
  778. name: '4.显示屏',
  779. },{
  780. ids:35,
  781. xianxiang: '检测状态下模拟剂不报警',
  782. name: '5.汇总主控板信号采集电路',
  783. },{
  784. ids:36,
  785. name: '6.检测剂',
  786. },{
  787. ids:37,
  788. xianxiang: '长时间不能进入检测状态',
  789. name: '7.干燥管',
  790. },{
  791. ids:38,
  792. name: '8.维护管',
  793. },{
  794. ids:39,
  795. xianxiang: '固液检测/气体检测模式切换失败',
  796. name: '9.固液检测单元与主控板连接线',
  797. },{
  798. ids:310,
  799. name: '10.汇总主控板固液通信电路',
  800. },{
  801. ids:311,
  802. name: '11.切换按键',
  803. },{
  804. ids:312,
  805. xianxiang: '有毒有害气体检测模块不报警',
  806. name: '12.高压驱动板与汇总主控板连接线',
  807. },{
  808. ids:313,
  809. name: '13.汇总主控板毒害模块通信电路',
  810. },{
  811. ids:314,
  812. xianxiang: '不能正常工作',
  813. name: '14.外壳及零件',
  814. },{
  815. ids:315,
  816. xianxiang: '电压低',
  817. name: '15.供电模块',
  818. },{
  819. ids:316,
  820. xianxiang: '无法开机',
  821. name: '16.DC/DC',
  822. }]
  823. }
  824. },
  825. },
  826. created() {
  827. this.getList();
  828. //this.getDeptTree();
  829. this.getConfigKey("sys.user.initPassword").then(response => {
  830. this.initPassword = response.msg;
  831. });
  832. },
  833. methods: {
  834. selectmethod(value){
  835. console.log('出题方式:'+value)
  836. if(value==2 || value==3){
  837. this.isShow = true;
  838. }else{
  839. this.isShow = false;
  840. }
  841. },
  842. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  843. // console.log(this.selectedEquip+'@@@')
  844. //第一列型号
  845. if(columnIndex === 0) {
  846. if(this.selectedEquip==2){
  847. if(rowIndex==0){
  848. return { rowspan: 13, colspan: 1 };
  849. }
  850. return { rowspan: 0, colspan: 0 };
  851. }else if(this.selectedEquip==3){
  852. if(rowIndex==0){
  853. return { rowspan: 16, colspan: 1 };
  854. }
  855. return { rowspan: 0, colspan: 0};
  856. }else{
  857. if(rowIndex==0){
  858. return { rowspan: 11, colspan: 1 };
  859. }else if(rowIndex==11){
  860. return { rowspan: 13, colspan: 1 };
  861. }else if(rowIndex==24){
  862. return { rowspan: 16, colspan: 1 };
  863. }else{
  864. return { rowspan: 0, colspan: 0 };
  865. }
  866. }
  867. }
  868. //第二列故障现象
  869. if(columnIndex === 1) {
  870. if(this.selectedEquip==2){
  871. // console.log(rowIndex+'####')
  872. if(rowIndex<9 && rowIndex % 2 === 0){
  873. return { rowspan: 2, colspan: 1 };
  874. }else if((rowIndex>9&&rowIndex<13)){
  875. return { rowspan: 1, colspan: 1 };
  876. }else{
  877. return { rowspan: 0, colspan: 0 };
  878. }
  879. }else if(this.selectedEquip==3){
  880. if(rowIndex<7 && rowIndex % 2 === 0){
  881. return { rowspan: 2, colspan: 1 };
  882. }else if((rowIndex==8)){
  883. return { rowspan: 3, colspan: 1 };
  884. }else if(rowIndex==11){
  885. return { rowspan: 2, colspan: 1 };
  886. }else if(rowIndex>12 && rowIndex<16){
  887. return { rowspan: 1, colspan: 1 };
  888. }else{
  889. return { rowspan: 0, colspan: 0 };
  890. }
  891. }else{
  892. if(rowIndex<7 && rowIndex % 2 === 0){
  893. return { rowspan: 2, colspan: 1 };
  894. }else if((rowIndex>7&&rowIndex<11) || (rowIndex>20&&rowIndex<24) || (rowIndex>36)){
  895. return { rowspan: 1, colspan: 1 };
  896. }else if((rowIndex==35) || (rowIndex>10 && rowIndex<20) && rowIndex % 2 === 1){
  897. return { rowspan: 2, colspan: 1 };
  898. }else if(rowIndex>23 && rowIndex<32 && rowIndex % 2 === 0){
  899. return { rowspan: 2, colspan: 1 };
  900. }else if(rowIndex==32){
  901. return { rowspan: 3, colspan: 1 };
  902. }else{
  903. return { rowspan: 0, colspan: 0 };
  904. }
  905. }
  906. }
  907. //故障部位 和 选择
  908. if(columnIndex === 2 || columnIndex === 3){
  909. //return { rowspan: 1, colspan: 1 };
  910. }
  911. },
  912. handleSelectionRow(val) {
  913. this.multipleSelection = val;
  914. },
  915. // 根据选择的option获取新的数据
  916. // getNewTableData(option) {
  917. // // 逻辑处理返回新的数据数组
  918. // return [
  919. // // ...新数据
  920. // ];
  921. // },
  922. toggleSelection(rows) {
  923. if (rows) {
  924. rows.forEach(row => {
  925. this.$refs.multipleTable.toggleRowSelection(row);
  926. console.log(row.ids+'###')
  927. console.log(row.name+'@@@')
  928. });
  929. } else {
  930. this.$refs.multipleTable.clearSelection();
  931. }
  932. },
  933. handleSelectionRow(val) {
  934. this.multipleSelection = val;
  935. },
  936. /** 查询考试列表 */
  937. getList() {
  938. this.loading = true;
  939. examTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  940. //将返回值注释
  941. this.userList = response.rows;
  942. this.total = response.total;
  943. this.loading = false;
  944. }
  945. );
  946. },
  947. getList1() {
  948. this.loading = true;
  949. listMajor(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  950. //将返回值注释
  951. this.userList1 = response.rows;
  952. this.total = response.total;
  953. this.loading = false;
  954. }
  955. );
  956. },
  957. /** 查询部门下拉树结构 */
  958. getDeptTree() {
  959. deptTreeSelect().then(response => {
  960. this.deptOptions = response.data;
  961. });
  962. },
  963. // 筛选节点
  964. filterNode(value, data) {
  965. if (!value) return true;
  966. return data.label.indexOf(value) !== -1;
  967. },
  968. // 节点单击事件
  969. handleNodeClick(data) {
  970. this.queryParams.deptId = data.id;
  971. this.handleQuery();
  972. },
  973. // 状态修改
  974. handleStatusChange(row) {
  975. console.log(row.examCollectionState);
  976. let text = row.examCollectionState === "2" ? "开启" : "关闭";
  977. this.$modal.confirm('确认要"' + text + '""' + row.examCollectionName + '"吗?').then(function() {
  978. if(row.examCollectionState==2){
  979. return examTearcherclose(row.examCollectionId,row.examCollectionState);
  980. }else{
  981. return examTearcheropen(row.examCollectionId,row.examCollectionState);
  982. }
  983. }).then(() => {
  984. this.$modal.msgSuccess(text + "成功");
  985. }).catch(function() {
  986. row.status = row.status === "0" ? "1" : "0";
  987. });
  988. },
  989. // 取消按钮
  990. cancel() {
  991. this.open = false;
  992. this.zijianopen = false;
  993. this.selectopen = false;
  994. this.reset();
  995. },
  996. // 表单重置
  997. reset() {
  998. this.form = {
  999. examCollectionId: undefined,
  1000. examCollectionType:3,
  1001. // deptId: undefined,
  1002. // userName: undefined,
  1003. // password: undefined,
  1004. // phonenumber: undefined,
  1005. // email: undefined,
  1006. // sex: undefined,
  1007. // status: "0",
  1008. // remark: undefined,
  1009. // postIds: [],
  1010. // roleIds: []
  1011. };
  1012. this.resetForm("form");
  1013. },
  1014. /** 搜索按钮操作 */
  1015. handleQuery() {
  1016. this.queryParams.pageNum = 1;
  1017. this.getList();
  1018. },
  1019. /** 重置按钮操作 */
  1020. resetQuery() {
  1021. this.dateRange = [];
  1022. this.resetForm("queryForm");
  1023. // this.queryParams.deptId = undefined;
  1024. // this.$refs.tree.setCurrentKey(null);
  1025. this.handleQuery();
  1026. },
  1027. // 多选框选中数据
  1028. handleSelectionChange(selection) {
  1029. this.ids = selection.map(item => item.examCollectionId);
  1030. this.single = selection.length != 1;
  1031. this.multiple = !selection.length;
  1032. },
  1033. /** 新增按钮操作 */
  1034. handleAdd() {
  1035. this.reset();
  1036. // getUser().then(response => {
  1037. // this.postOptions = response.posts;
  1038. // this.roleOptions = response.roles;
  1039. this.open = true;
  1040. this.title = "新增考试";
  1041. // this.form.password = this.initPassword;
  1042. // });
  1043. },
  1044. /** 修改按钮操作 */
  1045. handleUpdate(row) {
  1046. this.reset();
  1047. const examCollectionId = row.examCollectionId || this.ids;
  1048. examTearcherGet(examCollectionId).then(response => {
  1049. this.form = response.data;
  1050. this.form.examTime= [response.data.startTime,response.data.endTime];
  1051. // this.postOptions = response.posts;
  1052. // this.roleOptions = response.roles;
  1053. // this.$set(this.form, "postIds", response.postIds);
  1054. // this.$set(this.form, "roleIds", response.roleIds);
  1055. this.open = true;
  1056. this.title = "修改考试";
  1057. // this.form.password = "";
  1058. });
  1059. },
  1060. /** 当前考试查询 */
  1061. handleKaoshi(row) {
  1062. const kaoshiId = row.jobId || 0;
  1063. this.$router.push('/peoples/present/ids/' + kaoshiId)
  1064. },
  1065. /** 总选题目编辑按钮操作 */
  1066. handleSelectType(row) {
  1067. this.reset();
  1068. const userId = row.userId || this.ids;
  1069. // getUser(userId).then(response => {
  1070. // this.form = response.data;
  1071. this.selectopen = true;
  1072. // this.open = false;
  1073. this.title = "选择考题";
  1074. // });
  1075. },
  1076. /** 提交按钮 */
  1077. submitForm: function() {
  1078. this.$refs["form"].validate(valid => {
  1079. if (valid) {
  1080. if(this.form.examTime){
  1081. const start_time = this.form.examTime[0];
  1082. const end_time = this.form.examTime[1];
  1083. this.form.startTime = start_time;
  1084. this.form.endTime = end_time;
  1085. }
  1086. if (this.form.examCollectionId != undefined) {
  1087. examTearcherupdate(this.form).then(response => {
  1088. this.$modal.msgSuccess("修改成功");
  1089. this.open = false;
  1090. this.getList();
  1091. });
  1092. } else {
  1093. examTearcheradd(this.form).then(response => {
  1094. this.$modal.msgSuccess("新增成功");
  1095. this.open = false;
  1096. this.getList();
  1097. });
  1098. }
  1099. }
  1100. });
  1101. },
  1102. /** 删除按钮操作 */
  1103. handleDelete(row) {
  1104. const examCollectionIds = row.examCollectionId || this.ids;
  1105. this.$modal.confirm('是否确认删除编号为"' + examCollectionIds + '"的数据项?').then(function() {
  1106. return examTearcherdel(examCollectionIds);
  1107. }).then(() => {
  1108. this.getList();
  1109. this.$modal.msgSuccess("删除成功");
  1110. }).catch(() => {});
  1111. },
  1112. }
  1113. };
  1114. </script>