Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8b36465e
authored
Sep 20, 2018
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://github.com/glsx-web/authority
2 parents
2bea3649
b2ccf800
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
243 additions
and
174 deletions
src/common/commonConst.js
src/common/roleConst.js
src/common/userConst.js
src/components/RoleCreate/src/main.vue
src/components/UserCreate/src/main.vue
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/common/commonConst.js
View file @
8b36465
import
{
roleCreateStructure
,
roleDataColumn
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'./roleConst'
import
{
userDetailColumn
}
from
'./userConst'
import
{
user
Form
,
user
DetailColumn
}
from
'./userConst'
export
{
roleCreateStructure
,
roleDataColumn
,
userRoleDetailColumn
,
userRoleDetailConsole
,
userDetailColumn
userDetailColumn
,
userForm
}
src/common/roleConst.js
View file @
8b36465
...
...
@@ -4,7 +4,9 @@ const roleCreateStructure = {
id
:
Number
,
roleName
:
''
,
description
:
''
,
departId
:
''
,
departName
:
''
,
departPath
:
''
,
rights
:
Array
,
state
:
1
,
createTime
:
''
...
...
src/common/userConst.js
View file @
8b36465
const
userForm
=
{
username
:
''
,
realname
:
''
,
password
:
''
,
mobile
:
''
,
joinip
:
''
,
email
:
''
,
state
:
''
,
isadmin
:
''
,
departName
:
''
,
roles
:
[
'1'
,
'2'
],
departId
:
''
,
roleList
:
[],
options
:
[
{
value
:
'1006'
,
label
:
'总经办'
},
{
value
:
'1001'
,
label
:
'研发中心-网络软件部'
}
]
}
const
userDetailColumn
=
[{
label
:
'用户名'
,
prop
:
'username'
...
...
@@ -27,4 +51,4 @@ const userDetailColumn = [{
}
}]
export
{
userDetailColumn
}
export
{
user
Form
,
user
DetailColumn
}
src/components/RoleCreate/src/main.vue
View file @
8b36465
...
...
@@ -13,20 +13,15 @@
<span
style=
"position:absolute; right:5px; top:-20px;"
>
/200
</span>
</gl-form-item>
<gl-form-item
label=
"所属部门:"
prop=
"departName"
>
<gl-select
v-model=
"createRuleForm.departName"
placeholder=
"请选择"
>
<gl-option
label=
"运营平台"
value=
"运营平台"
></gl-option>
<gl-select
placeholder=
"请选择"
v-model=
"createRuleForm.departName"
>
<gl-option
style=
"height:160px"
>
<tree
ref=
'tree'
:isDepart=
"isDepart"
v-model=
"createRuleForm.departName"
:defaultExpandAll=
"defaultExpandAll"
@
node-click=
'clickDepart'
style=
"height:160px"
></tree>
</gl-option>
<!--
<gl-option
label=
"运营平台"
value=
"运营平台"
></gl-option>
-->
</gl-select>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
prop=
"rights"
>
<tree
ref=
'tree'
v-model=
"createRuleForm.rights"
:show-checkbox=
"show_checkbox"
:defaultExpandAll=
"defaultExpandAll"
:defaultCheckedKeys=
"roleMenuTree"
@
input=
"getMenuOption"
style=
"height:160px"
></tree>
<tree
ref=
'tree'
v-model=
"createRuleForm.rights"
:show-checkbox=
"show_checkbox"
:defaultExpandAll=
"defaultExpandAll"
:defaultCheckedKeys=
"roleMenuTree"
@
input=
"getMenuOption"
style=
"height:160px"
></tree>
</gl-form-item>
</gl-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -49,18 +44,19 @@ export default {
createVisible
(
val
)
{
!
val
&&
this
.
$refs
[
'createRuleForm'
].
resetFields
()
// 考虑一下放这里还是放下面
this
.
c
hangeMenuTree
=
this
.
roleMenuTree
this
.
c
reateRuleForm
.
rights
=
this
.
roleMenuTree
},
flagCOrE
(
val
)
{
this
.
title
=
val
?
'新建角色'
:
'角色列表'
// this.c
hangeMenuTree
= this.roleMenuTree
// this.c
reateRuleForm.rights
= this.roleMenuTree
}
},
data
()
{
return
{
isDepart
:
true
,
show_checkbox
:
true
,
defaultExpandAll
:
true
,
changeMenuTre
e
:
[],
departNam
e
:
[],
title
:
''
,
createRules
:
{
roleName
:
[
...
...
@@ -82,11 +78,27 @@ export default {
methods
:
{
// tree-strat
getMenuOption
(
params
)
{
this
.
changeMenuTree
=
params
.
treeData
.
checkedKeys
.
concat
(
params
.
treeData
.
halfCheckedKeys
)
this
.
createRuleForm
.
rights
=
params
.
treeData
.
checkedKeys
.
concat
(
params
.
treeData
.
halfCheckedKeys
)
},
clickDepart
(
data
,
treeData
,
vue
,
props
)
{
if
(
data
.
parent
!==
'#'
||
!
data
.
children
)
{
this
.
createRuleForm
.
departId
=
data
.
id
this
.
createRuleForm
.
departPath
=
data
.
type
this
.
getDepartName
(
treeData
)
this
.
createRuleForm
.
departName
=
this
.
departName
.
join
(
' - '
)
this
.
departName
=
[]
}
},
getDepartName
(
params
)
{
this
.
departName
.
unshift
(
params
.
data
.
text
)
if
(
params
.
data
.
parent
!==
'#'
)
{
this
.
getDepartName
(
params
.
parent
)
}
else
{
return
true
}
},
// tree-end
getParams
()
{
this
.
createRuleForm
.
rights
=
this
.
changeMenuTree
return
this
.
$deep_clone
(
this
.
createRuleForm
)
},
handleCreateSubmit
(
formName
)
{
...
...
src/components/UserCreate/src/main.vue
View file @
8b36465
...
...
@@ -24,8 +24,8 @@
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"注册IP"
prop=
"
registeredIP
"
>
<gl-input
v-model=
"userManageForm.
registeredIP
"
clearable
></gl-input>
<gl-form-item
label=
"注册IP"
prop=
"
joinip
"
>
<gl-input
v-model=
"userManageForm.
joinip
"
clearable
></gl-input>
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
...
...
@@ -37,44 +37,44 @@
<gl-col
:span=
"12"
>
<gl-form-item
label=
"状态"
prop=
"state"
>
<gl-select
v-model=
"userManageForm.state"
placeholder=
"启用"
>
<gl-option
label=
"启用"
value=
"启用"
></gl-option>
<gl-option
label=
"禁用"
value=
"禁用"
></gl-option>
<gl-option
label=
"启用"
value=
'0'
></gl-option>
<gl-option
label=
"禁用"
value=
'1'
></gl-option>
</gl-select>
</gl-form-item>
</gl-col>
<gl-col
:span=
"12"
>
<gl-form-item
label=
"管理员"
>
<gl-select
v-model=
"userManageForm.isadmin"
placeholder=
"否"
>
<gl-option
label=
"否"
value=
"否"
></gl-option>
<gl-option
label=
"是"
value=
"是"
></gl-option>
<gl-option
label=
"否"
value=
'0'
></gl-option>
<gl-option
label=
"是"
value=
'1'
></gl-option>
</gl-select>
</gl-form-item>
</gl-col>
<gl-col
:span=
"24"
>
<gl-form-item
label=
"所属部门"
prop=
"departName"
>
<gl-select
v-model=
"userManageForm.departName"
placeholder=
"请选择"
>
<
!--
<
gl-select
v-model=
"userManageForm.departName"
placeholder=
"请选择"
>
<gl-option
v-for=
"item in userManageForm.options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</gl-option>
</gl-select>
</gl-select>
-->
<gl-select
v-model=
"userManageForm.departId"
placeholder=
"请选择"
>
<gl-option
v-for=
"item in userManageForm.options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</gl-option>
</gl-select>
</gl-form-item>
</gl-col>
<gl-col
:span=
"24"
>
<gl-form-item
label=
"角色选项"
prop=
"roles"
>
<gl-checkbox-group
v-model=
"userManageForm.roles"
>
<gl-checkbox
label=
"诺威达-艺展-系统日志上报"
></gl-checkbox>
<gl-checkbox
label=
"盗抢险"
></gl-checkbox>
<gl-checkbox
label=
"研发工具-增量"
></gl-checkbox>
<gl-checkbox
label=
"精品分期0329角色"
></gl-checkbox>
<gl-checkbox
label=
"好车主"
></gl-checkbox>
<gl-checkbox
label=
"云商分润"
></gl-checkbox>
<gl-checkbox
label=
"营销系统"
></gl-checkbox>
<gl-checkbox
label=
"GPS后台角色控制"
></gl-checkbox>
<gl-checkbox
label=
"外场测试"
></gl-checkbox>
</gl-checkbox-group>
<gl-col
:span=
"10"
>
<gl-checkbox
v-for=
"item in userManageForm.roleList"
:key=
"item.id"
v-model=
"item.isSelect"
@
change=
"handleCheckedChange"
>
{{
item
.
roleName
}}
</gl-checkbox>
</gl-col>
</gl-form-item>
</gl-col>
</gl-form>
...
...
@@ -86,108 +86,94 @@
</
template
>
<
script
>
import
{
userForm
}
from
'@/common/userConst'
export
default
{
name
:
'UserCreate'
,
props
:
{
dialogFormVisible
:
Boolean
,
editUser
:
Object
userManageForm
:
Object
},
components
:
{
userForm
},
watch
:
{
dialogFormVisible
(
val
)
{
val
&&
console
.
log
(
this
.
userManageForm
)
!
val
&&
this
.
$refs
[
'userManageForm'
].
resetFields
()
},
editUser
(
val
)
{
if
(
val
)
{
this
.
userManageForm
=
val
}
console
.
log
(
this
.
userManageForm
)
}
},
mounted
()
{
this
.
userManageForm
.
roleList
.
forEach
(
element
=>
{
element
.
isSelect
=
false
})
},
data
()
{
return
{
tel
:
'[ 1, /[34578]/, /\d/{9}]'
,
userManageForm
:
{
username
:
''
,
realname
:
''
,
password
:
''
,
mobile
:
''
,
registeredIP
:
''
,
email
:
''
,
state
:
''
,
isadmin
:
''
,
departName
:
''
,
roles
:
[],
options
:
[{
value
:
'选项1'
,
label
:
'总经办'
},
{
value
:
'选项2'
,
label
:
'研发中心-网络软件部'
}]
},
state
:
'1'
,
tel
:
'[ 1, /[34578]/, /d/{9}]'
,
rules
:
{
username
:
[
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
,
{
min
:
3
,
max
:
5
,
message
:
'长度在 2 到 5 个字符'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入用户名'
,
trigger
:
'blur'
}
//
{ min: 3, max: 5, message: '长度在 2 到 5 个字符', trigger: 'blur' }
],
realname
:
[
{
required
:
true
,
message
:
'请输入用户真实名字'
,
trigger
:
'blur'
}
,
{
min
:
2
,
max
:
4
,
message
:
'长度在 2 到 4 个字符'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入用户真实名字'
,
trigger
:
'blur'
}
//
{ min: 2, max: 4, message: '长度在 2 到 4 个字符', trigger: 'blur' }
],
password
:
[
{
required
:
true
,
message
:
'请输入用户密码'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
8
,
message
:
'长度在 6 到 8 个字符'
,
trigger
:
'blur'
}
],
phoneNumber
:
[
{
required
:
true
,
message
:
'请输入手机号码'
,
trigger
:
'blur'
},
{
length
:
11
,
message
:
'长度为11个字符'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入用户密码'
,
trigger
:
'blur'
}
]
// registeredIP: [
// { required: true, message: '请输入注册IP', trigger: 'blur' },
// { min: 6, max: 8, message: '长度在 6 到 8 个字符', trigger: 'blur' }
// ],
// email: [
// { required: true, message: '请输入邮箱', trigger: 'blur' },
// { min: 6, max: 8, message: '长度在 6 到 8 个字符', trigger: 'blur' }
// ]
}
}
},
methods
:
{
message
(
message
,
type
)
{
type
&&
this
.
$message
({
showClose
:
true
,
type
:
type
,
message
:
message
})
!
type
&&
this
.
$message
({
showClose
:
true
,
message
:
message
})
type
&&
this
.
$message
({
showClose
:
true
,
type
:
type
,
message
:
message
})
!
type
&&
this
.
$message
({
showClose
:
true
,
message
:
message
})
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
(
valid
)
=>
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
const
userData
=
this
.
$deep_clone
(
this
.
userManageForm
)
console
.
log
(
userData
.
roleList
)
// userData.roleList = userData.roleList.map(item => item.id).join(',')
userData
.
roles
=
userData
.
roles
.
join
(
','
)
// userData.departId = userData.options.map(item => item.value).join(',')
console
.
log
(
userData
)
const
isflagId
=
userData
.
id
if
(
valid
)
{
this
.
$emit
(
'userFormData'
,
isflagId
,
userData
)
}
else
{
return
false
}
console
.
log
(
userData
)
})
},
cancelForm
()
{
this
.
$emit
(
'userFormData'
)
},
handleCheckedChange
(
value
)
{
// console.log(value)
// this.userManageForm.roleList.map(item => {
// item.isSelect = value
// })
}
}
}
</
script
>
<
style
scoped
>
.el-checkbox
+
.el-checkbox
{
margin-left
:
0
!important
;
.el-checkbox
+
.el-checkbox
{
margin-left
:
0
!important
;
}
</
style
>
<
style
>
</
style
>
src/views/customer/role/index.vue
View file @
8b36465
...
...
@@ -32,7 +32,9 @@ export default {
components
:
{
RoleCreate
,
RoleDetail
,
UserDetail
UserDetail
,
saveRoleList
,
updateRole
},
data
()
{
return
{
...
...
@@ -176,23 +178,23 @@ export default {
// console.log(aa)
// console.log(editData)
// const cc = { roleName: 'ggg' }
saveRoleList
.
req
(
params
).
then
((
data
)
=>
{
// console.log(data)
// this.createOrEditSuccess()
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
//
saveRoleList.req(params).then((data) => {
// console.log(data)
// this.createOrEditSuccess()
//
}).catch(err => {
//
console.log(err)
//
})
},
// 编辑角色
updateRoleInfo
(
params
)
{
console
.
log
(
params
)
this
.
createOrEditSuccess
()
updateRole
.
req
(
params
).
then
((
data
)
=>
{
// console.log(data)
// this.createOrEditSuccess()
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
//
updateRole.req(params).then((data) => {
// console.log(data)
// this.createOrEditSuccess()
//
}).catch(err => {
//
console.log(err)
//
})
},
// 接口请求-end---------------------------------------
createDialogVisible
()
{
...
...
src/views/customer/user/index.vue
View file @
8b36465
...
...
@@ -8,9 +8,9 @@
<hr>
<div
class=
"default p-t15"
>
<div
class=
"control-tabledata-button"
>
<gl-button
size=
"small"
@
click=
"createUser(
editUser=
{}
)">新增用户
</gl-button>
<gl-button
size=
"small"
@
click=
"createUser()"
>
新增用户
</gl-button>
<gl-button
size=
"small"
@
click=
"toggleRowSelection"
>
删除选中
</gl-button>
<user-create
:dialogFormVisible=
"dialogFormVisible"
:
editUser=
"editUser
"
@
userFormData=
"handleUserFormData"
></user-create>
<user-create
:dialogFormVisible=
"dialogFormVisible"
:
userManageForm=
"userManageForm
"
@
userFormData=
"handleUserFormData"
></user-create>
</div>
<div
class=
"m-b8"
>
<gl-table
:table=
"userData"
ref=
"multipleTable"
></gl-table>
...
...
@@ -25,20 +25,22 @@
<
script
>
import
{
UserCreate
,
UserDetail
}
from
'@/components/index'
// 接口
import
{
findAll
}
from
'@/api/api'
import
{
user
DetailColumn
}
from
'@/common/common
Const'
import
{
findAll
,
updateUser
,
getRoleList
,
batcheDelUser
,
operatUser
}
from
'@/api/api'
import
{
user
Form
,
userDetailColumn
}
from
'@/common/user
Const'
export
default
{
name
:
'user'
,
components
:
{
UserCreate
,
UserDetail
UserDetail
,
updateUser
,
userForm
},
data
()
{
return
{
userName
:
''
,
toggle
:
[],
dialogFormVisible
:
false
,
editUser
:
{}
,
userManageForm
:
this
.
$deep_clone
(
userForm
)
,
userDetailVisible
:
false
,
userDetailTitle
:
'用户详情'
,
// 分页所需参数-start
...
...
@@ -104,16 +106,16 @@ export default {
this
.
handleGetUserDetail
(
index
,
rows
)
}
},
{
label
:
'
删除
'
,
label
:
'
禁用
'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
confirmDeleteOrNot
(
index
,
rows
)
this
.
$alert
(
rows
[
index
]
)
}
},
{
label
:
'
用户
'
,
label
:
'
删除
'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
$alert
(
rows
[
index
]
)
this
.
confirmDeleteOrNot
(
index
,
rows
)
}
}]
},
...
...
@@ -124,6 +126,7 @@ export default {
},
mounted
()
{
this
.
findUserList
()
this
.
getRoleOptions
()
},
watch
:
{
userName
(
val
)
{
...
...
@@ -145,6 +148,7 @@ export default {
findAll
.
req
(
params
).
then
(
res
=>
{
this
.
total
=
res
.
total
this
.
userData
.
data
=
res
.
list
console
.
log
(
this
.
userData
.
data
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
@@ -161,63 +165,100 @@ export default {
message
:
message
})
},
// 获取所有角色选项
getRoleOptions
()
{
getRoleList
.
req
().
then
(
res
=>
{
userForm
.
roleList
=
res
.
list
console
.
log
(
res
)
})
},
// 新增更新用户接口请求
updateUser_Post
(
params
)
{
if
(
params
)
{
updateUser
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
})
}
else
{
console
.
log
(
'no data!'
)
}
},
// 删除用户接口
batcheDel
(
params
)
{
console
.
log
(
params
)
if
(
params
)
{
batcheDelUser
.
req
({
ids
:
params
}).
then
(
res
=>
{
this
.
findUserList
()
})
}
else
{
console
.
log
(
'无数据!'
)
}
},
// 删除、禁用、启用接口
operatUser
(
params
)
{
console
.
log
(
params
)
if
(
params
)
{
operatUser
.
req
(
params
).
then
(
res
=>
{
this
.
findUserList
()
})
}
else
{
console
.
log
(
'无数据!'
)
}
},
// 接受子组件传递的值
handleUserFormData
(
isflag
,
params
)
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
userManageForm
=
{}
!
params
&&
this
.
message
(
'取消操作'
)
params
&&
!
isflag
&&
this
.
u
serDataCreate
(
params
)
params
&&
!
isflag
&&
this
.
u
pdateUser_Post
(
params
)
params
&&
isflag
&&
this
.
message
(
'已经成功修改数据!'
,
'success'
)
},
// 新增按钮
createUser
(
editUser
)
{
console
.
log
(
editUser
)
this
.
editUser
=
editUser
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
},
// 新增事件
userDataCreate
(
params
)
{
// this.dateFormat()
params
.
id
=
'100'
+
this
.
userData
.
data
.
length
params
.
createTime
=
this
.
dateFormat
()
const
newData
=
params
// { id: '100' + this.userData.data.length, username: params.username, realname: params.realname, isadmin: params.isadmin, mobile: params.mobile, state: params.state, createTime: this.dateFormat() }
this
.
userData
.
data
.
push
(
newData
)
this
.
message
(
'创建用户成功!'
,
'success'
)
},
dateFormat
()
{
const
zeroize
=
function
(
value
)
{
if
(
value
<
10
)
{
value
=
'0'
+
value
return
value
}
else
{
return
value
}
createUser
(
userManageForm
)
{
console
.
log
(
userManageForm
)
if
(
userManageForm
)
{
userManageForm
.
roleList
=
this
.
$deep_clone
(
userForm
.
roleList
)
console
.
log
(
userManageForm
.
roleList
)
userManageForm
.
options
=
userForm
.
options
userManageForm
.
state
=
userManageForm
.
state
+
''
userManageForm
.
isadmin
=
userManageForm
.
isadmin
+
''
Promise
.
all
([
findAll
,
updateUser
]).
then
((
result
)
=>
{
const
arr
=
userManageForm
.
roles
.
split
(
','
)
arr
.
forEach
(
index
=>
{
userManageForm
.
roleList
.
forEach
(
item
=>
{
if
(
+
item
.
id
===
+
index
)
{
console
.
log
(
item
.
id
)
item
.
isSelect
=
true
console
.
log
(
item
)
return
false
}
})
})
this
.
userManageForm
=
this
.
$deep_clone
(
userManageForm
)
})
// this.userManageForm = this.$deep_clone(userManageForm)
}
else
{
this
.
userManageForm
=
this
.
$deep_clone
(
userForm
)
}
const
currentTime
=
new
Date
()
const
year
=
currentTime
.
getFullYear
()
const
month
=
zeroize
(
currentTime
.
getMonth
()
+
1
)
const
day
=
zeroize
(
currentTime
.
getDate
())
const
h
=
zeroize
(
currentTime
.
getHours
())
const
m
=
zeroize
(
currentTime
.
getHours
())
const
s
=
zeroize
(
currentTime
.
getSeconds
())
const
createTime
=
year
+
'-'
+
month
+
'-'
+
day
+
' '
+
h
+
':'
+
m
+
':'
+
s
console
.
log
(
createTime
)
return
createTime
console
.
log
(
userManageForm
)
// this.userManageForm = userManageForm ? this.$deep_clone(userManageForm) : this.$deep_clone(userForm)
// console.log(userManageForm)
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
},
// 获取选中的行
handleSelectionChange
(
val
,
row
)
{
// this.multipleSelection = val
this
.
toggle
=
val
console
.
log
(
this
.
toggle
)
},
// 删除选中的行
toggleRowSelection
()
{
cons
ole
.
log
(
this
.
$refs
.
multipleTable
,
this
.
toggle
)
cons
t
ids
=
[]
if
(
this
.
toggle
)
{
this
.
toggle
.
forEach
(
row
=>
{
this
.
userData
.
data
.
splice
(
this
.
toggle
,
1
)
// this.$refs.multipleTable.$refs.table.toggleRowSelection(row)
ids
.
push
(
row
.
id
+
''
)
})
this
.
batcheDel
(
ids
.
join
(
','
))
}
else
{
// this.$refs.multipleTable.clearSelection(
)
this
.
message
(
''
,
'操作失败'
)
}
},
finduserName
()
{
...
...
@@ -233,21 +274,22 @@ export default {
this
.
pageNum
=
val
this
.
findUserList
()
},
delteSelected
(
val
)
{
console
.
log
(
val
)
},
confirmDeleteOrNot
(
index
,
rows
)
{
this
.
$confirm
(
'确定要删除这条数据?'
,
''
,
{
confirmButtonTest
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
// this.userData.data.splice(index, 1)
rows
.
splice
(
index
,
1
)
this
.
message
(
'success'
,
'删除成功'
)
}).
catch
(()
=>
{
this
.
message
(
''
,
'取消删除'
)
})
console
.
log
(
rows
[
index
].
id
)
this
.
operatUser
({
id
:
rows
[
index
].
id
,
state
:
2
})
// this.delectUser(rows[index].id)
// this.$confirm('确定要删除这条数据?', '', {
// confirmButtonTest: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// // this.userData.data.splice(index, 1)
// rows.splice(index, 1)
// this.message('success', '删除成功')
// }).catch(() => {
// this.message('', '取消删除')
// })
},
changeShowNumber
(
command
)
{
this
.
showNumber
=
command
...
...
@@ -271,9 +313,9 @@ export default {
</
script
>
<
style
scoped
>
.search-w250
{
width
:
250px
;
width
:
250px
;
}
.m-b8
{
margin-bottom
:
8px
;
margin-bottom
:
8px
;
}
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment