Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Guten-PigxUI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄卓然
Guten-PigxUI
Commits
1ac853e4
Commit
1ac853e4
authored
Nov 11, 2018
by
smallwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户管理用户名重复问题
parent
8c1fe991
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 deletions
+26
-20
user.js
src/const/crud/user.js
+9
-10
index.vue
src/views/admin/user/index.vue
+4
-3
vue.config.js
vue.config.js
+2
-2
yarn.lock
yarn.lock
+11
-5
No files found.
src/const/crud/user.js
View file @
1ac853e4
...
@@ -17,8 +17,9 @@
...
@@ -17,8 +17,9 @@
import
{
getDetails
}
from
"@/api/user"
;
import
{
getDetails
}
from
"@/api/user"
;
var
validateUsername
=
(
rule
,
value
,
callback
)
=>
{
var
validateUsername
=
(
rule
,
value
,
callback
)
=>
{
getDetails
(
value
).
then
(
response
=>
{
getDetails
(
value
).
then
(
response
=>
{
if
(
window
.
boxType
===
'edit'
)
callback
()
let
result
=
response
.
data
.
data
let
result
=
response
.
data
.
data
if
(
result
!==
null
){
if
(
result
!==
null
)
{
callback
(
new
Error
(
'用户名已经存在'
))
callback
(
new
Error
(
'用户名已经存在'
))
}
}
});
});
...
@@ -67,14 +68,12 @@ export const tableOption = {
...
@@ -67,14 +68,12 @@ export const tableOption = {
value
:
''
,
value
:
''
,
hide
:
true
,
hide
:
true
,
span
:
24
,
span
:
24
,
rules
:
[
rules
:
[{
{
min
:
6
,
min
:
6
,
max
:
20
,
max
:
20
,
message
:
"长度在 6 到 20 个字符"
,
message
:
"长度在 6 到 20 个字符"
,
trigger
:
"blur"
trigger
:
"blur"
}]
}
]
},
{
},
{
label
:
'所属部门'
,
label
:
'所属部门'
,
prop
:
'deptId'
,
prop
:
'deptId'
,
...
@@ -130,4 +129,4 @@ export const tableOption = {
...
@@ -130,4 +129,4 @@ export const tableOption = {
addVisdiplay
:
false
,
addVisdiplay
:
false
,
span
:
24
,
span
:
24
,
}]
}]
}
}
\ No newline at end of file
src/views/admin/user/index.vue
View file @
1ac853e4
...
@@ -42,9 +42,9 @@
...
@@ -42,9 +42,9 @@
<
template
slot=
"username"
<
template
slot=
"username"
slot-scope=
"scope"
>
slot-scope=
"scope"
>
<img
v-if=
"scope.row.avatar"
<img
v-if=
"scope.row.avatar"
class=
"user-avatar"
class=
"user-avatar"
style=
"width: 20px; height: 20px; border-radius: 50%;"
style=
"width: 20px; height: 20px; border-radius: 50%;"
:src=
"scope.row.avatar+'?imageView2/1/w/20/h/20'"
/>
:src=
"scope.row.avatar+'?imageView2/1/w/20/h/20'"
/>
<span>
{{
scope
.
row
.
username
}}
</span>
<span>
{{
scope
.
row
.
username
}}
</span>
</
template
>
</
template
>
<
template
slot=
"role"
<
template
slot=
"role"
...
@@ -199,6 +199,7 @@ export default {
...
@@ -199,6 +199,7 @@ export default {
this
.
$refs
.
crud
.
rowAdd
();
this
.
$refs
.
crud
.
rowAdd
();
},
},
handleOpenBefore
(
show
,
type
)
{
handleOpenBefore
(
show
,
type
)
{
window
.
boxType
=
type
;
this
.
handleDept
();
this
.
handleDept
();
if
([
'edit'
,
'views'
].
includes
(
type
))
{
if
([
'edit'
,
'views'
].
includes
(
type
))
{
this
.
role
=
[];
this
.
role
=
[];
...
...
vue.config.js
View file @
1ac853e4
const
url
=
'http://zn.huaxiadaowei.com
:9999
'
const
url
=
'http://zn.huaxiadaowei.com'
module
.
exports
=
{
module
.
exports
=
{
lintOnSave
:
true
,
lintOnSave
:
true
,
productionSourceMap
:
false
,
productionSourceMap
:
false
,
...
@@ -66,4 +66,4 @@ module.exports = {
...
@@ -66,4 +66,4 @@ module.exports = {
},
},
}
}
}
}
}
}
\ No newline at end of file
yarn.lock
View file @
1ac853e4
...
@@ -1249,9 +1249,9 @@
...
@@ -1249,9 +1249,9 @@
version "1.1.2"
version "1.1.2"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26"
"@smallwei/avue@^1.
1.21-beta1
":
"@smallwei/avue@^1.
3.1-beta3
":
version "1.
1.21-beta1
"
version "1.
3.2
"
resolved "https://registry.yarnpkg.com/@smallwei/avue/-/avue-1.
1.21-beta1.tgz#f78a0710c02d32f53421e3406d49732d402b7220
"
resolved "https://registry.yarnpkg.com/@smallwei/avue/-/avue-1.
3.2.tgz#c96753664ca722a2d2c07cbf2e6899a501af064f
"
dependencies:
dependencies:
async-validator "~1.8.1"
async-validator "~1.8.1"
axios "^0.16.2"
axios "^0.16.2"
...
@@ -1263,7 +1263,7 @@
...
@@ -1263,7 +1263,7 @@
resize-observer-polyfill "^1.5.0"
resize-observer-polyfill "^1.5.0"
throttle-debounce "^1.0.1"
throttle-debounce "^1.0.1"
vue "^2.5.2"
vue "^2.5.2"
vue-
quill-editor "^3.0.6
"
vue-
json-editor "^1.2.3
"
vuedraggable "^2.16.0"
vuedraggable "^2.16.0"
"@types/blob-util@1.3.3":
"@types/blob-util@1.3.3":
...
@@ -8611,6 +8611,12 @@ vue-hot-reload-api@^2.3.0:
...
@@ -8611,6 +8611,12 @@ vue-hot-reload-api@^2.3.0:
version "2.3.1"
version "2.3.1"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz#b2d3d95402a811602380783ea4f566eb875569a2"
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz#b2d3d95402a811602380783ea4f566eb875569a2"
vue-json-editor@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/vue-json-editor/-/vue-json-editor-1.2.3.tgz#b928415640af335490d41a4061136e25394f36f6"
dependencies:
vue "^2.2.6"
vue-json-tree-view@^2.1.4:
vue-json-tree-view@^2.1.4:
version "2.1.4"
version "2.1.4"
resolved "https://registry.yarnpkg.com/vue-json-tree-view/-/vue-json-tree-view-2.1.4.tgz#b6f8ae2ba2eec4eec5b6f53b90fa187054cad79b"
resolved "https://registry.yarnpkg.com/vue-json-tree-view/-/vue-json-tree-view-2.1.4.tgz#b6f8ae2ba2eec4eec5b6f53b90fa187054cad79b"
...
@@ -8657,7 +8663,7 @@ vue-template-es2015-compiler@^1.6.0:
...
@@ -8657,7 +8663,7 @@ vue-template-es2015-compiler@^1.6.0:
version "1.6.0"
version "1.6.0"
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18"
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18"
vue@^2.5.16, vue@^2.5.17, vue@^2.5.2:
vue@^2.
2.6, vue@^2.
5.16, vue@^2.5.17, vue@^2.5.2:
version "2.5.17"
version "2.5.17"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment