index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :xs="24">
  5. <el-row :gutter="10" class="mb8">
  6. <el-col :span="1.5">
  7. <el-button
  8. type="primary"
  9. plain
  10. icon="el-icon-refresh"
  11. size="mini"
  12. @click="refreshTable1"
  13. >刷新 </el-button>
  14. </el-col>
  15. <el-col :span="1.5">
  16. <el-button
  17. type="success"
  18. plain
  19. icon="el-icon-edit"
  20. size="mini"
  21. >批量确认已送</el-button>
  22. </el-col>
  23. </el-row>
  24. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  25. <el-table-column type="selection" width="50" align="center" />
  26. <el-table-column label="座号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
  27. <el-table-column label="更换件" align="center" key="className" prop="className" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  28. <el-table-column label="学员姓名" align="center" key="majorName" prop="majorName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  29. <el-table-column label="状态" align="center" key="remark" prop="remark1" v-if="columns[3].visible" :show-overflow-tooltip="true" />
  30. <el-table-column label="申请时间" align="center" prop="createTime" v-if="columns[4].visible" width="160">
  31. <template slot-scope="scope">
  32. <span>{{ parseTime(scope.row.createTime) }}</span>
  33. </template>
  34. </el-table-column>
  35. <el-table-column
  36. label="操作"
  37. align="center"
  38. width="160"
  39. class-name="small-padding fixed-width"
  40. >
  41. <template slot-scope="scope">
  42. <el-button
  43. size="mini"
  44. type="text"
  45. icon="el-icon-position"
  46. @click="handleUpdate(scope.row)"
  47. >已送</el-button>
  48. <el-button
  49. size="mini"
  50. type="text"
  51. icon="el-icon-finished"
  52. @click="handleDelete(scope.row)"
  53. >驳回</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <pagination
  58. v-show="total>0"
  59. :total="total"
  60. :page.sync="queryParams.pageNum"
  61. :limit.sync="queryParams.pageSize"
  62. @pagination="getList"
  63. />
  64. </el-col>
  65. </el-row>
  66. <el-row style="margin-top: 2%;">
  67. <el-col>
  68. <el-row :gutter="10" class="mb8">
  69. <el-col :span="1.5">
  70. <el-button
  71. type="primary"
  72. plain
  73. icon="el-icon-refresh"
  74. size="mini"
  75. @click="refreshTable1"
  76. >刷新</el-button>
  77. </el-col>
  78. </el-row>
  79. <el-table v-loading="loading" :data="tableArr1" >
  80. <el-table-column label="座号" align="center" key="xuehao" prop="zuohao" v-if="tab_columns[0].visible" />
  81. <el-table-column label="模拟器状态" align="center" key="className" prop="monitype" v-if="tab_columns[1].visible" :show-overflow-tooltip="true" >
  82. <template scope="scope">
  83. <span v-if="scope.row.monitype==='就绪'" style="color: green">就绪</span>
  84. <span v-else-if="scope.row.monitype==='离线'" style="color: red">离线</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="学员学号" align="center" key="majorName" prop="xuehao" v-if="tab_columns[2].visible" :show-overflow-tooltip="true" />
  88. <el-table-column label="学员姓名" align="center" key="remark" prop="xingming" v-if="tab_columns[3].visible" :show-overflow-tooltip="true" />
  89. <el-table-column label="考试状态" align="center" prop="kaoshitype" v-if="tab_columns[4].visible" width="160">
  90. <template scope="scope">
  91. <span v-if="scope.row.kaoshitype==='已交卷'" style="color: green">已交卷</span>
  92. <span v-else-if="scope.row.kaoshitype==='未登录'" style="color: red">未登录</span>
  93. <span v-else-if="scope.row.kaoshitype==='已登录'" style="color: blue">已登录</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="考试成绩" align="center" prop="chengji" v-if="tab_columns[5].visible" width="160"></el-table-column>
  97. <el-table-column label="出题题目" align="center" prop="timu" v-if="tab_columns[6].visible" width="160"></el-table-column>
  98. <el-table-column label="故障现象" align="center" prop="xianxiang" v-if="tab_columns[7].visible" width="160"></el-table-column>
  99. <el-table-column label="可能原因" align="center" prop="reason" v-if="tab_columns[8].visible" width="160"></el-table-column>
  100. <el-table-column label="故障部位" align="center" prop="buwen" v-if="tab_columns[9].visible" width="160"></el-table-column>
  101. <el-table-column label="排除方法" align="center" prop="fangfa" v-if="tab_columns[10].visible" width="160"></el-table-column>
  102. <el-table-column label="修复结论" align="center" prop="jielun" v-if="tab_columns[11].visible" width="160"></el-table-column>
  103. </el-table>
  104. </el-col>
  105. </el-row>
  106. <div slot="footer" style="margin-top: 2%; text-align: center;">
  107. <el-button type="primary">关闭</el-button>
  108. </div>
  109. </div>
  110. </template>
  111. <style>
  112. .borderless-input_defen {
  113. border: none;
  114. /* 移除边框 */
  115. outline: none; /* 移除点击输入框时浏览器自带的轮廓线 */
  116. text-align: center;
  117. }
  118. .box {
  119. width: 100%;
  120. height: 40px;
  121. display: flex;
  122. border-left: 1px solid #e9e9e9;
  123. border-top: 1px solid #e9e9e9;
  124. }
  125. .box1{
  126. width: 100%;
  127. height: 40px;
  128. display: flex;
  129. border-left: 1px solid #e9e9e9;
  130. border-top: 1px solid #e9e9e9;
  131. }
  132. .content1 {
  133. width: 80%;
  134. height: 40px;
  135. line-height: 40px;
  136. text-align: center;
  137. background-color: #fafafa;
  138. border-right: 1px solid #e9e9e9;
  139. border-bottom: 1px solid #e9e9e9;
  140. color:green;
  141. font-size: 14px;
  142. }
  143. .content11 {
  144. width: 199px;
  145. height: 40px;
  146. line-height: 40px;
  147. text-align: center;
  148. background-color: #fafafa;
  149. border-right: 1px solid #e9e9e9;
  150. border-bottom: 1px solid #e9e9e9;
  151. color: green;
  152. font-size: 14px;
  153. }
  154. .content2 {
  155. width: 60%;
  156. height: 40px;
  157. line-height: 40px;
  158. text-align: center;
  159. background-color: #fff;
  160. border-right: 1px solid #e9e9e9;
  161. border-bottom: 1px solid #e9e9e9;
  162. /* color: #b0b0b2; */
  163. font-size: 14px;
  164. }
  165. .content12 {
  166. width: 147px;
  167. height: 40px;
  168. line-height: 40px;
  169. text-align: center;
  170. background-color: #fff;
  171. border-right: 2px solid #e9e9e9;
  172. border-bottom: 1px solid #e9e9e9;
  173. /* color: #b0b0b2; */
  174. font-size: 14px;
  175. }
  176. </style>
  177. <script>
  178. import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
  179. import { getToken } from "@/utils/auth";
  180. export default {
  181. name: "User",
  182. dicts: ['sys_normal_disable', 'sys_user_sex'],
  183. data() {
  184. return {
  185. tableArr1: [{
  186. zuohao: '01',
  187. monitype: '就绪',
  188. xuehao: '2024001',
  189. xingming: '张三',
  190. kaoshitype: '未登录',
  191. chengji: '80',
  192. },
  193. {
  194. zuohao: '02',
  195. monitype: '离线',
  196. xuehao: '2024001',
  197. xingming: '李四',
  198. kaoshitype: '已登录',
  199. chengji: '80',
  200. },{
  201. zuohao: '03',
  202. monitype: '就绪',
  203. xuehao: '2024001',
  204. xingming: '张',
  205. kaoshitype: '已交卷',
  206. chengji: '80',
  207. },{
  208. zuohao: '04',
  209. monitype: '离线',
  210. xuehao: '2024001',
  211. xingming: '王',
  212. kaoshitype: '剩余时间',
  213. chengji: '80',
  214. },
  215. ],
  216. // 遮罩层
  217. loading: true,
  218. // 选中数组
  219. ids: [],
  220. // 非单个禁用
  221. single: true,
  222. // 非多个禁用
  223. multiple: true,
  224. // 显示搜索条件
  225. showSearch: true,
  226. // 总条数
  227. total: 0,
  228. // 用户表格数据
  229. userList: null,
  230. // 弹出层标题
  231. title: "",
  232. // 是否显示弹出层
  233. open: false,
  234. // 部门名称
  235. deptName: undefined,
  236. // 默认密码
  237. initPassword: undefined,
  238. // 日期范围
  239. dateRange: [],
  240. // 岗位选项
  241. postOptions: [],
  242. // 角色选项
  243. roleOptions: [],
  244. // 表单参数
  245. form: {},
  246. defaultProps: {
  247. children: "children",
  248. label: "label"
  249. },
  250. // 查询参数
  251. queryParams: {
  252. pageNum: 1,
  253. pageSize: 10,
  254. userName: undefined,
  255. phonenumber: undefined,
  256. status: undefined,
  257. deptId: undefined
  258. },
  259. // 列信息
  260. columns: [
  261. { key: 0, label: `编号`, visible: true },
  262. { key: 1, label: `班级名称`, visible: true },
  263. { key: 2, label: `专业`, visible: true },
  264. { key: 3, label: `备注`, visible: true },
  265. { key: 4, label: `创建时间`, visible: true }
  266. ],
  267. tab_columns: [
  268. { key: 0, label: `座号`, visible: true },
  269. { key: 1, label: `模拟器状态`, visible: true },
  270. { key: 2, label: `学员学号`, visible: true },
  271. { key: 3, label: `学员姓名`, visible: true },
  272. { key: 4, label: `考试状态`, visible: true },
  273. { key: 5, label: `考试成绩`, visible: true },
  274. { key: 6, label: `出题题目`, visible: true },
  275. { key: 7, label: `故障现象`, visible: true },
  276. { key: 8, label: `可能原因`, visible: true },
  277. { key: 9, label: `故障部位`, visible: true },
  278. { key: 10, label: `排除方法`, visible: true },
  279. { key: 11, label: `修复结论`, visible: true },
  280. ],
  281. };
  282. },
  283. watch: {
  284. // 根据名称筛选部门树
  285. deptName(val) {
  286. this.$refs.tree.filter(val);
  287. }
  288. },
  289. created() {
  290. this.getList();
  291. // this.getDeptTree();
  292. this.getConfigKey("sys.user.initPassword").then(response => {
  293. this.initPassword = response.msg;
  294. });
  295. },
  296. methods: {
  297. refreshTable1(){
  298. this.loading = true;
  299. listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  300. this.userList = response.rows;
  301. this.total = response.total;
  302. this.loading = false;
  303. }
  304. );
  305. },
  306. /** 查询用户列表 */
  307. getList() {
  308. this.loading = true;
  309. listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
  310. this.userList = response.rows;
  311. this.total = response.total;
  312. this.loading = false;
  313. }
  314. );
  315. },
  316. // 筛选节点
  317. filterNode(value, data) {
  318. if (!value) return true;
  319. return data.label.indexOf(value) !== -1;
  320. },
  321. // 取消按钮
  322. cancel() {
  323. this.open = false;
  324. this.reset();
  325. },
  326. // 表单重置
  327. reset() {
  328. this.form = {
  329. userId: undefined,
  330. deptId: undefined,
  331. userName: undefined,
  332. nickName: undefined,
  333. password: undefined,
  334. phonenumber: undefined,
  335. email: undefined,
  336. sex: undefined,
  337. status: "0",
  338. remark: undefined,
  339. postIds: [],
  340. roleIds: []
  341. };
  342. this.resetForm("form");
  343. },
  344. /** 搜索按钮操作 */
  345. handleQuery() {
  346. this.queryParams.pageNum = 1;
  347. this.getList();
  348. },
  349. /** 重置按钮操作 */
  350. resetQuery() {
  351. this.dateRange = [];
  352. this.resetForm("queryForm");
  353. this.queryParams.deptId = undefined;
  354. this.$refs.tree.setCurrentKey(null);
  355. },
  356. // 多选框选中数据
  357. handleSelectionChange(selection) {
  358. this.ids = selection.map(item => item.userId);
  359. this.single = selection.length != 1;
  360. this.multiple = !selection.length;
  361. },
  362. /** 提交按钮 */
  363. submitForm: function() {
  364. this.$refs["form"].validate(valid => {
  365. if (valid) {
  366. if (this.form.userId != undefined) {
  367. updateUser(this.form).then(response => {
  368. this.$modal.msgSuccess("修改成功");
  369. this.open = false;
  370. this.getList();
  371. });
  372. } else {
  373. addUser(this.form).then(response => {
  374. this.$modal.msgSuccess("新增成功");
  375. this.open = false;
  376. this.getList();
  377. });
  378. }
  379. }
  380. });
  381. },
  382. }
  383. };
  384. </script>