将文件拖到此处,或
@@ -188,6 +137,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 {
@@ -304,6 +254,17 @@ export default {
this.getList()
},
methods: {
+ 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 +303,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 +331,8 @@ export default {
remark: undefined,
postIds: undefined,
roleIds: undefined,
- role: undefined
+ role: undefined,
+ callingcard: undefined
}
this.resetForm('form')
},
@@ -444,10 +406,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 +451,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 +465,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() {