From 85e10f08753643e5dee2480bd8510945c68a9c52 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期三, 22 五月 2024 11:36:02 +0800 Subject: [PATCH] feat:问答支持上传附件、部门管理员隐藏删除、禁用按钮、试卷列表菜单 --- src/views/user/student/list.vue | 37 ++++++++++++++++++++++++++++++------- 1 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue index ba02de0..35740e3 100644 --- a/src/views/user/student/list.vue +++ b/src/views/user/student/list.vue @@ -40,7 +40,7 @@ <el-tag :type="row.condition == '姝e父' || row.condition == null ? 'success' : 'warning'">{{ row.condition ? row.condition : '姝e父' }}</el-tag> </template> </el-table-column> - <el-table-column prop="conditionDetail" label="鍏蜂綋鎯呭喌" show-overflow-tooltip="true"/> + <el-table-column prop="conditionDetail" label="鍏蜂綋鎯呭喌" :show-overflow-tooltip="true"/> <el-table-column prop="sex" label="鎬у埆" width="60px;" :formatter="sexFormatter"/> <el-table-column prop="phone" label="鎵嬫満鍙�" width="120"/> <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" width="160px"/> @@ -51,9 +51,9 @@ </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"> @@ -64,7 +64,9 @@ </router-link> <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-button size="mini" type="danger" @click="deleteUser(row)" class="link-left">鍒犻櫎</el-button> + <el-popconfirm title="纭鍒犻櫎鍚�" @confirm="deleteUser(row)"> + <el-button v-if="!deptAdmin()" slot="reference" size="mini" type="danger" class="link-left">鍒犻櫎</el-button> + </el-popconfirm> </template> </el-table-column> </el-table> @@ -72,7 +74,7 @@ @pagination="search"/> <!-- 鐘舵�佸脊绐� --> - <el-dialog :visible.sync="statusVisible" append-to-body :close-on-click-modal="false" :show-close="false" center width="400px"> + <el-dialog :visible.sync="statusVisible" append-to-body :show-close="false" center width="400px"> <el-radio-group v-model="user.condition"> <el-radio label="姝e父">姝e父</el-radio> <el-radio label="鐥呭亣">鐥呭亣</el-radio> @@ -99,6 +101,8 @@ :value="item.id"> </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 :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> @@ -112,9 +116,15 @@ import Pagination from '@/components/Pagination' import userApi from '@/api/user' import departmentExamineApi from '@/api/departmentExamine' +import Upload from '@/components/UploadC' export default { - components: { Pagination }, + components: { Pagination, Upload }, + computed: { + fileContentUrl: () => { + return this.form ? this.form.contentUrl ? [this.form.contentUrl] : [] : []; + } + }, data () { return { user:{}, @@ -123,7 +133,7 @@ fileList:[], queryParam: { userName: '', - role: 1, + roles: [1], pageIndex: 1, pageSize: 10 }, @@ -135,6 +145,8 @@ departmentId: [], departmentIds: '', nowDepartmentIds: '', + contentUrl: [], + attachment: '' }, title: '閮ㄩ棬璋冨姩', dialogVisible: false, @@ -145,6 +157,17 @@ this.search() }, methods: { + deptAdmin() { + return sessionStorage.getItem('deptAdmin') === '1' + }, + 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(',') departmentExamineApi.save(this.examine).then(res => { -- Gitblit v1.8.0