diff --git a/src/views/sysuser/index.vue b/src/views/sysuser/index.vue index ae349c4..015e272 100644 --- a/src/views/sysuser/index.vue +++ b/src/views/sysuser/index.vue @@ -5,24 +5,12 @@ - + - + 搜索 @@ -31,12 +19,7 @@ - + @@ -44,12 +27,8 @@ @@ -57,41 +36,27 @@ {{ parseTime(scope.row.createtime) }} - + + + + - + - + @@ -107,13 +72,8 @@ - + @@ -127,17 +87,20 @@ + - {{ dict.dictLabel }} + {{ dict.dictLabel + }} + + + + + @@ -153,18 +116,9 @@ - +
将文件拖到此处,或 @@ -188,6 +142,7 @@ import { listUser, getUser, delUser, addUser, updateUser, exportUser, resetUserPwd, changeUserStatus, importTemplate, getUserInit } from '@/api/system/sysuser' import { getToken } from '@/utils/auth' import { getCourts } from '@/api/login' +import { addMedia } from '@/api/questionnaire/subject' import '@riophae/vue-treeselect/dist/vue-treeselect.css' export default { @@ -195,6 +150,7 @@ export default { // components: { Treeselect }, data() { return { + baseUrl: process.env.VUE_APP_BASE_API+'/', // 遮罩层 loading: true, // 选中数组 @@ -304,6 +260,20 @@ export default { this.getList() }, methods: { + viewCode(url){ + window.open(url, '_blank') + }, + previewUploadImg(el) { + this.upLoadImg(el.target.files[0]) + }, + upLoadImg(files) { + let uploadData = new FormData(); + uploadData.append('media', files); + addMedia(uploadData).then(res => { + this.msgSuccess('上传成功') + this.form.callingcard = res.data + }) + }, /** 查询用户列表 */ getList() { this.loading = true @@ -342,11 +312,11 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(function() { + }).then(function () { return changeUserStatus(row.userid, row.status) }).then(() => { this.msgSuccess(text + '成功') - }).catch(function() { + }).catch(function () { row.status = row.status === '0' ? '1' : '0' }) }, @@ -370,7 +340,8 @@ export default { remark: undefined, postIds: undefined, roleIds: undefined, - role: undefined + role: undefined, + callingcard: undefined } this.resetForm('form') }, @@ -444,10 +415,10 @@ export default { this.msgError(response.msg) } }) - }).catch(() => {}) + }).catch(() => { }) }, /** 提交按钮 */ - submitForm: function() { + submitForm: function () { this.$refs['form'].validate(valid => { if (valid) { this.roleOptions.forEach(item => { @@ -489,12 +460,12 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(function() { + }).then(function () { return delUser(userids) }).then(() => { this.getList() this.msgSuccess('删除成功') - }).catch(function() {}) + }).catch(function () { }) }, /** 导出按钮操作 */ handleExport() { @@ -503,11 +474,11 @@ export default { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(function() { + }).then(function () { return exportUser(queryParams) }).then(response => { this.download(response.msg) - }).catch(function() {}) + }).catch(function () { }) }, /** 导入按钮操作 */ handleImport() {