Merge remote-tracking branch 'origin/master'
| | |
| | | }, |
| | | alwaysShow: true, |
| | | children: [ |
| | | { |
| | | path: 'paper/list', |
| | | component: () => import('@/views/exam/paper/list'), |
| | | name: 'ExamPaperPageList', |
| | | meta: { title: '试卷列表', noCache: true } |
| | | }, |
| | | { |
| | | path: 'paper/edit', |
| | | component: () => import('@/views/exam/paper/edit'), |
| | | name: 'ExamPaperEdit', |
| | | meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/paper/list' }, |
| | | hidden: true |
| | | }, |
| | | // { |
| | | // path: 'paper/list', |
| | | // component: () => import('@/views/exam/paper/list'), |
| | | // name: 'ExamPaperPageList', |
| | | // meta: { title: '试卷列表', noCache: true } |
| | | // }, |
| | | // { |
| | | // path: 'paper/edit', |
| | | // component: () => import('@/views/exam/paper/edit'), |
| | | // name: 'ExamPaperEdit', |
| | | // meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/paper/list' }, |
| | | // hidden: true |
| | | // }, |
| | | { |
| | | path: 'personalRandomTemplate/list', |
| | | component: () => import('@/views/exam/personalRandomTemplate/list'), |
| | |
| | | |
| | | <el-form :model="form" ref="form" label-width="100px" v-loading="formLoading" :rules="rules"> |
| | | <el-form-item label="问题:" prop="question"> |
| | | <el-input v-model="form.question"></el-input> |
| | | <el-input v-model="form.question" maxlength="48"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="答案:" prop="answer"> |
| | | <el-input v-model="form.answer"></el-input> |
| | | <el-input v-model="form.answer" maxlength="1000"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="附件:" prop="attachment"> |
| | | <upload :fileUrl="form.contentUrl" :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getUploadAttachmentUrl" @removeFile="removeAttachmentFile"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">提交</el-button> |
| | |
| | | <script> |
| | | import { mapGetters, mapState, mapActions } from 'vuex' |
| | | import questionAnswerApi from '@/api/questionAnswer' |
| | | import Upload from '@/components/UploadC' |
| | | |
| | | export default { |
| | | components: { Upload }, |
| | | computed: { |
| | | fileContentUrl: () => { |
| | | return this.form ? this.form.contentUrl ? [this.form.contentUrl] : [] : []; |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | form: { |
| | | id: null, |
| | | question: '', |
| | | answer: '' |
| | | answer: '', |
| | | contentType: 'file', |
| | | subject: '', |
| | | belongType: 2, |
| | | contentUrl: [], |
| | | attachment: '', |
| | | temp: [] |
| | | }, |
| | | formLoading: false, |
| | | rules: { |
| | |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | questionAnswerApi.query(id).then(re => { |
| | | _this.form = re.response |
| | | _this.form.id = re.response.id |
| | | _this.form.question = re.response.question |
| | | _this.form.answer = re.response.answer |
| | | _this.form.attachment = re.response.attachment ? re.response.attachment : '' |
| | | _this.form.contentUrl = re.response.attachment ? JSON.parse(re.response.attachment) : [] |
| | | _this.formLoading = false |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | removeAttachmentFile(fileList, fileName) { |
| | | this.form.attachment = JSON.stringify(fileList.filter(item => item.name !== fileName)); |
| | | this.form.contentUrl = fileList.filter(item => item.name !== fileName); |
| | | }, |
| | | getUploadAttachmentUrl(uploadData) { |
| | | this.form.attachment = JSON.stringify(uploadData); |
| | | this.form.contentUrl = uploadData; |
| | | }, |
| | | submitForm () { |
| | | let _this = this |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.formLoading = true |
| | | |
| | | questionAnswerApi.save(this.form).then(data => { |
| | | if (data.code === 1) { |
| | | _this.$message.success(data.message) |
| | |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="question" label="问题" /> |
| | | <el-table-column prop="answer" label="回答" /> |
| | | <el-table-column prop="attachment" label="附件" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in getUrl(scope.row.attachment)" :key="item.url"> |
| | | <el-link :underline="false" type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name" >{{ item.name }}</el-link> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="status" width="70px"> |
| | | <template slot-scope="{row}"> |
| | | <el-tag :type="row.status !== '启用' ? 'danger' : 'success'"> |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | getUrl(urlJson) { |
| | | return urlJson ? JSON.parse(urlJson) : []; |
| | | }, |
| | | search() { |
| | | this.listLoading = true |
| | | questionAnswerApi.pageList(this.queryParam).then(data => { |
| | |
| | | <el-table-column prop="attachment" label="附件" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <div v-for="item in getUrl(scope.row.attachment)" :key="item.url"> |
| | | <el-link type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name" >{{ item.name }}</el-link> |
| | | <el-link :underline="false" type="primary" :href="'/api/upload/download?url=' + item.url +'&fileName=' + item.name" >{{ item.name }}</el-link> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="remark" label="审核意见" show-overflow-tooltip /> |
| | | <el-table-column prop="createUserName" label="创建人" /> |
| | | <el-table-column prop="createTime" label="创建时间" width="160px" /> |
| | | <el-table-column label="操作" align="center" v-if="isDeptAdmin()"> |
| | | <el-table-column label="操作" align="center" v-if="!deptAdmin()"> |
| | | <template slot-scope="{row}"> |
| | | <el-button v-if="row.result === '待审核'" type="primary" size="mini" @click="transposition(row)" class="link-left">审核</el-button> |
| | | <el-popconfirm title="确认删除" @confirm="deleteUser(row)"> |
| | |
| | | getUrl(urlJson) { |
| | | return urlJson ? JSON.parse(urlJson) : []; |
| | | }, |
| | | isDeptAdmin() { |
| | | return sessionStorage.getItem('deptAdmin') !== '1' |
| | | deptAdmin() { |
| | | return sessionStorage.getItem('deptAdmin') === '1' |
| | | }, |
| | | transposition(user) { |
| | | this.statusVisible = true; |
| | |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column width="400px" label="操作" fixed="right" align="center"> |
| | | <el-table-column :width="deptAdmin() ? '310px' : '400px'" label="操作" fixed="right" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="changeStatus(row)" class="link-left"> |
| | | <el-button size="mini" v-if="!deptAdmin()" @click="changeStatus(row)" class="link-left"> |
| | | {{ statusBtnFormatter(row.status) }} |
| | | </el-button> |
| | | <router-link :to="{path:'/user/student/edit', query:{id:row.id}}" class="link-left"> |
| | |
| | | <el-button size="mini" @click="status(row)" class="link-left">状态</el-button> |
| | | <el-button type="primary" size="mini" @click="transposition(row)" class="link-left">调动</el-button> |
| | | <el-popconfirm title="确认删除吗" @confirm="deleteUser(row)"> |
| | | <el-button slot="reference" size="mini" type="danger" class="link-left">删除</el-button> |
| | | <el-button v-if="!deptAdmin()" slot="reference" size="mini" type="danger" class="link-left">删除</el-button> |
| | | </el-popconfirm> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <el-input type="textarea" maxlength="100" show-word-limit :autosize="{ minRows: 4}" :rows="2" v-model="examine.reason" placeholder="请输入情况说明" style="margin-top: 30px;"></el-input> |
| | | <upload v-show="form.contentType" ref="upload" :fileUrl="form.contentUrl" :fileType="form.contentType" |
| | | :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getUploadUrl" @removeFile="removeFile" style="margin-top: 30px;"/> |
| | | <upload :fileUrl="examine.contentUrl" :fileSizeLimitM="1024" :uploadNum="1" @getUploadUrl="getUploadAttachmentUrl" @removeFile="removeAttachmentFile" style="margin-top: 30px;"/> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitExamine">确 定</el-button> |
| | |
| | | }, |
| | | data () { |
| | | return { |
| | | |
| | | form: { |
| | | contentType: 'file', |
| | | subject: '', |
| | | belongType: 2, |
| | | contentUrl: [], |
| | | attachment: [], |
| | | temp: [] |
| | | }, |
| | | user:{}, |
| | | statusVisible: false, |
| | | upLoadUrl:'/api/admin/user/import', |
| | |
| | | departmentId: [], |
| | | departmentIds: '', |
| | | nowDepartmentIds: '', |
| | | contentUrl: [], |
| | | attachment: '' |
| | | }, |
| | | title: '部门调动', |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | removeFile() { |
| | | this.examine.attachment = []; |
| | | deptAdmin() { |
| | | return sessionStorage.getItem('deptAdmin') === '1' |
| | | }, |
| | | getUploadUrl(uploadData) { |
| | | removeAttachmentFile(fileList, fileName) { |
| | | this.examine.attachment = JSON.stringify(fileList.filter(item => item.name !== fileName)); |
| | | this.examine.contentUrl = fileList.filter(item => item.name !== fileName); |
| | | }, |
| | | getUploadAttachmentUrl(uploadData) { |
| | | this.examine.attachment = JSON.stringify(uploadData); |
| | | this.examine.contentUrl = uploadData; |
| | | }, |
| | | submitExamine() { |
| | | this.examine.departmentIds = this.examine.departmentId.join(',') |