### 模板可以直接抄写 ```javascript // crud 需要查询参数时使用 cruds() { let params = {} if(location.search) { let serachArr = location.search.split('&') params = { deptId: serachArr[0].split('=')[1], id: serachArr[1].split('=')[1] } } // 只需要一个参数时用这个 let params = {} if(location.search) { params = { examId: location.search.split('=')[1], } } return CRUD({ title: '考试信息', url: 'api/elExam/statistics', sort: 'id,desc', crudMethod: { ...crudElExam }, optShow: { add: false, edit: false, del: false, reset: true },query: {type: 'USER', id: params.id, deptId: params.deptId}}) }, ``` ```javascript // 获取 字典里 标签内容 // 创建时间 ``` ```javascript // 不适用 dicts ,crud dicts: [], cruds() { return CRUD({}) }, methods: { // 禁止使用 crud 进行自动查询 [CRUD.HOOK.beforeRefresh]() { return false }, } ``` ```javascript // 在 create 里面进行数据得请求 created() { this.paperId = this.$route.params ? this.$route.params.id : null this.examId = this.$route.query ? this.$route.query.id : null this.$nextTick(()=>{ crudElPaper.getData({paperId: this.paperId}).then(res => { this.paperData = res.content[0] }).catch(err=> { this.$message.error(err) }) }) }, ``` ```javascript // table 里面的操作链接 // table 里面的格式化时间 // table 里面的字典查询 // table 里面的其他操作 // table 里面的 状态 // table 里面的宽度设置 // button 筛选操作 {{ scope.row.userModel.enabled ? '在职' : '离职' }} ``` ```javascript // 上传图片的操作 import _ from 'lodash' import { getToken } from '@/utils/auth' import { mapGetters } from 'vuex' headers: { Authorization: getToken() }, // 获取上传地址 computed: { ...mapGetters([ 'imagesUploadApi', 'baseApi', ]) }, // 在 form 中上传图片 点击上传 // 在 table 中上传图片 // 事件 handleRemove(file, index, str) { }, handleSuccess(response, file, index, str) { console.log('response.id', response.id) }, handleError(err, file, index, str) { this.$message.error(err) console.log('err',err) }, handleExceed(files, fileList) { this.$message.warning(`当前限制只能上传 1 个文件`); }, ``` ```javascript // 基本没有使用 crud 的页面 ``` ### OTHER 考试管理 elexam cate 考试目录 index 列表/添加/删除 exam 在线考试 argificial 人工阅卷列表页 correct 人工批改 entry 进入考试,考试进行 index 考试信息 online 在线考试列表页 record 人员考试记录 result 考试结果 statistics 考试统计 statisticsDept 部门考试统计 statisticsUser 用户考试统计 item edit 试题编辑页 index 试题列表页 itempool 题库管理 index 列表页 paper 试卷管理 edit 编辑试卷 index 列表,暂无用 tip: table hasChildren 若为 true 时, children 使用懒加载模式