diff --git a/src/api/role.js b/src/api/role.js
new file mode 100644
index 0000000..9fbcb9b
--- /dev/null
+++ b/src/api/role.js
@@ -0,0 +1,37 @@
+import request from '@/utils/request'
+const qs = require('qs')
+
+export default {
+ roleList(params) {
+ return request({
+ url: '/role/list',
+ method: 'get',
+ params
+ })
+ },
+ add(data) {
+ return request({
+ url: '/role/add',
+ method: 'post',
+ data
+ })
+ },
+ update(data) {
+ return request({
+ url: 'role/update',
+ method: 'put',
+ data
+ })
+ },
+ delete(params) {
+ return request({
+ url: '/role/delete',
+ method: 'delete',
+ params,
+ paramsSerializer: function(params) {
+ return qs.stringify(params, { arrayFormat: 'repeat' })
+ }
+ })
+ }
+}
+
diff --git a/src/api/user.js b/src/api/user.js
index 82c3f59..ec59eca 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -1,4 +1,5 @@
import request from '@/utils/request'
+const qs = require('qs')
export function login(data) {
return request({
@@ -71,11 +72,14 @@ export function resetPass(id) {
})
}
-export function delUser(id) {
+export function delUser(params) {
return request({
url: 'user/delete',
method: 'delete',
- params: {id}
+ params,
+ paramsSerializer: function(params) {
+ return qs.stringify(params, { arrayFormat: 'repeat' })
+ }
})
}
diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue
index a32ca24..f7bb0e2 100644
--- a/src/components/Icon/Icon.vue
+++ b/src/components/Icon/Icon.vue
@@ -5,7 +5,7 @@
import { Icon } from 'ant-design-vue'
const IconFont = Icon.createFromIconfontCN({
- scriptUrl: '//at.alicdn.com/t/font_2024484_m4qfejm9sve.js'
+ scriptUrl: '//at.alicdn.com/t/font_2024484_tbuvjy9a4bi.js'
})
export default {
diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue
index 718c033..f5b3fc8 100644
--- a/src/components/ShowFile/ShowFile.vue
+++ b/src/components/ShowFile/ShowFile.vue
@@ -909,6 +909,10 @@ export default {
}
})
}
+ let that = this
+ window.onresize = function (){
+ that.clientHeight = document.documentElement.clientHeight - that.lessClientHeight
+ }
// 画矩形选区
this.darwRectangle()
diff --git a/src/components/SimpleUploader/globalUploader.vue b/src/components/SimpleUploader/globalUploader.vue
index a3375ae..29e1784 100755
--- a/src/components/SimpleUploader/globalUploader.vue
+++ b/src/components/SimpleUploader/globalUploader.vue
@@ -574,12 +574,12 @@
this.$nextTick(() => {
$(`
`).appendTo(`.file_${id} .uploader-file-status`).css({
'position': 'absolute',
- 'top': '-14px',
'font-size': '13px',
'left': '0',
'right': '0',
'bottom': '0',
'zIndex': '1',
+ 'marginBottom': '0',
'backgroundColor': statusMap[status].bgc
}).text(statusMap[status].text)
})
diff --git a/src/components/table/TableList.vue b/src/components/table/TableList.vue
new file mode 100644
index 0000000..c5f5796
--- /dev/null
+++ b/src/components/table/TableList.vue
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+ {{o.name}}
+
+
+
+
+ {{tagname}}
+
+
+ {{ item.formatData(scope.row[item.prop]) || scope.row[item.prop]}}
+
+
+
+ {{ scope.row[item.prop] }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 86fe1af..9f2d6b9 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -14,7 +14,7 @@
网站
- {{username}}
+ {{showName}}
@@ -125,11 +122,11 @@
{ min: 6, message: '密码不能小于6个字符', trigger: 'blur' }
],
checkPass: [
- { validator: validatePass, trigger: 'blur' }
+ { required: true, validator: validatePass, trigger: 'blur' }
],
},
validOldPass: false,
- passwordFormTitle: '旧密码',
+ passwordFormTitle: '',
dialogSelectFile: false,
}
},
@@ -184,13 +181,14 @@
}
await this.$nextTick()
this.cusomerInfoForm = this.userInfo
- this.srcImage = this.userInfo.avatar ? this.imageUrl + this.userInfo.avatar : require('../../../../assets/img/default-avatar.png')
+ this.srcImage = this.userInfo.avatar ? this.imageUrl + this.userInfo.avatar : require('../../../assets/img/default-avatar.png')
})
},
async changePassword() {
this.validOldPass = false
this.dialogChangePassword = true
await this.$nextTick()
+ this.passwordFormTitle = '旧密码'
this.$refs.passwordForm.resetFields()
},
onSubmit() {
@@ -204,39 +202,46 @@
},
// 确认密码
onSavePassword() {
- this.$refs.passwordForm.validate((valid) => {
- this.valid = valid
- if (valid) {
- if(this.validOldPass){
- // 修改密码
- this.userUpdateLoading = true
- let data = new FormData()
- data.append("id",this.$store.state.user.userId)
- data.append("password",this.passwordForm.password)
- updatePass(data).then(() => {
- this.userUpdateLoading = false
- this.dialogChangePassword = false
- }).catch(()=>{
- this.userUpdateLoading = false
- })
- }else{
- // 验证旧密码
- this.userUpdateLoading = true
- validOldPass({
- id: this.$store.state.user.userId,
- password: this.passwordForm.oldPassword
- }).then(() => {
- this.userUpdateLoading = false
- this.validOldPass = true
- this.passwordFormTitle = '新密码'
- }).catch(()=>{
- this.userUpdateLoading = false
- })
+ console.log('this.validOldPass', this.validOldPass)
+ if(this.validOldPass){
+ this.$refs.passwordForm.validate((valid) => {
+ this.valid = valid
+ if (valid) {
+ if(this.validOldPass){
+ // 修改密码
+ this.userUpdateLoading = true
+ let data = new FormData()
+ data.append("id",this.$store.state.user.userId)
+ data.append("password",this.passwordForm.password)
+ updatePass(data).then(() => {
+ this.userUpdateLoading = false
+ this.dialogChangePassword = false
+ }).catch(()=>{
+ this.userUpdateLoading = false
+ })
+ }
+ return true
}
- } else {
- return false;
- }
- });
+ return false
+ });
+ } else {
+ // 验证旧密码
+ this.userUpdateLoading = true
+ validOldPass({
+ id: this.$store.state.user.userId,
+ password: this.passwordForm.oldPassword
+ }).then(() => {
+ this.userUpdateLoading = false
+ this.validOldPass = true
+ this.passwordFormTitle = '新密码'
+ let that = this
+ setTimeout(function (){
+ that.$refs.newPasswordInput.focus()
+ })
+ }).catch(()=>{
+ this.userUpdateLoading = false
+ })
+ }
},
progressFormat() {
const space = this.userInfo.takeUpSpace/1024/1024/1024
@@ -291,11 +296,11 @@
this.srcImage = this.imageUrl + res.data
this.$store.state.user.avatar = res.data
}
+ if(data.get('showName') != null){
+ this.$store.state.user.showName = data.get('showName')
+ }
}).catch(() => {
- this.$message({
- message: '保存失败!',
- type: 'error'
- })
+ this.userUpdateLoading = false
})
}
}
diff --git a/src/views/setting/sys/cusomerManager.vue b/src/views/setting/sys/cusomerManager.vue
new file mode 100644
index 0000000..5d38e2f
--- /dev/null
+++ b/src/views/setting/sys/cusomerManager.vue
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/setting/user/index.vue b/src/views/setting/user/index.vue
index 2895271..3012c9a 100644
--- a/src/views/setting/user/index.vue
+++ b/src/views/setting/user/index.vue
@@ -21,8 +21,8 @@
-
-