Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intelligent_qp_manager
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
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
张伯涛
intelligent_qp_manager
Commits
dfdca5bc
Commit
dfdca5bc
authored
Oct 18, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理模块代码调整
parent
e8b5a88c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
451 additions
and
64 deletions
+451
-64
system.ts
src/api/demo/system.ts
+1
-1
user.ts
src/api/system/user/user.ts
+39
-0
index.ts
src/utils/http/axios/index.ts
+1
-1
DeptModal.vue
src/views/system/dept/DeptModal.vue
+58
-0
dept.data.ts
src/views/system/dept/dept.data.ts
+110
-0
index.vue
src/views/system/dept/index.vue
+80
-5
AccountModal.vue
src/views/system/user/AccountModal.vue
+80
-16
account.data.ts
src/views/system/user/account.data.ts
+78
-38
index.vue
src/views/system/user/index.vue
+4
-3
No files found.
src/api/demo/system.ts
View file @
dfdca5bc
...
@@ -20,7 +20,7 @@ enum Api {
...
@@ -20,7 +20,7 @@ enum Api {
setRoleStatus
=
'/system/setRoleStatus'
,
setRoleStatus
=
'/system/setRoleStatus'
,
MenuList
=
'/system/getMenuList'
,
MenuList
=
'/system/getMenuList'
,
RolePageList
=
'/system/getRoleListByPage'
,
RolePageList
=
'/system/getRoleListByPage'
,
GetAllRoleList
=
'/system/
getAllRoleList
'
,
GetAllRoleList
=
'/system/
role/listAll
'
,
}
}
export
const
getAccountList
=
(
params
:
AccountParams
)
=>
export
const
getAccountList
=
(
params
:
AccountParams
)
=>
...
...
src/api/system/user/user.ts
0 → 100644
View file @
dfdca5bc
import
{
AccountParams
,
DeptListItem
,
MenuParams
,
RoleParams
,
RolePageParams
,
MenuListGetResultModel
,
DeptListGetResultModel
,
AccountListGetResultModel
,
RolePageListGetResultModel
,
RoleListGetResultModel
,
}
from
'../../demo/model/systemModel'
;
import
{
defHttp
}
from
'@/utils/http/axios'
;
enum
Api
{
addUser
=
'/system/user/add'
,
userDetail
=
'/system/user/'
,
updataApi
=
'/system/user/update'
,
}
/** 用户add*/
export
const
addUserApi
=
(
params
:
any
)
=>
defHttp
.
post
({
url
:
Api
.
addUser
,
params
:
params
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
});
/** 获取用户详情信息*/
export
const
UserDetailApi
=
(
params
:
any
)
=>
defHttp
.
get
<
any
>
({
url
:
Api
.
userDetail
+
params
,
});
/** 用户信息编辑*/
export
const
UserUpdataApi
=
(
params
:
any
)
=>
defHttp
.
put
<
any
>
({
url
:
Api
.
updataApi
,
params
:
params
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
});
src/utils/http/axios/index.ts
View file @
dfdca5bc
...
@@ -167,7 +167,7 @@ const transform: AxiosTransform = {
...
@@ -167,7 +167,7 @@ const transform: AxiosTransform = {
* @description: 响应拦截器处理
* @description: 响应拦截器处理
*/
*/
responseInterceptors
:
(
res
:
AxiosResponse
<
any
>
)
=>
{
responseInterceptors
:
(
res
:
AxiosResponse
<
any
>
)
=>
{
console
.
log
(
'ree'
,
res
)
//
console.log('ree',res)
return
res
;
return
res
;
},
},
...
...
src/views/system/dept/DeptModal.vue
0 → 100644
View file @
dfdca5bc
<
template
>
<BasicModal
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
formSchema
}
from
'./dept.data'
;
import
{
getDeptList
}
from
'@/api/demo/system'
;
defineOptions
({
name
:
'DeptModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
updateSchema
,
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
span
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
});
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
setFieldsValue
({
...
data
.
record
,
});
}
const
treeData
=
await
getDeptList
();
updateSchema
({
field
:
'parentDept'
,
componentProps
:
{
treeData
},
});
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增部门'
:
'编辑部门'
));
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
setModalProps
({
confirmLoading
:
true
});
// TODO custom api
console
.
log
(
values
);
closeModal
();
emit
(
'success'
);
}
finally
{
setModalProps
({
confirmLoading
:
false
});
}
}
</
script
>
src/views/system/dept/dept.data.ts
0 → 100644
View file @
dfdca5bc
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
import
{
h
}
from
'vue'
;
import
{
Tag
}
from
'ant-design-vue'
;
export
const
columns
:
BasicColumn
[]
=
[
{
title
:
'部门名称'
,
dataIndex
:
'deptName'
,
width
:
160
,
align
:
'left'
,
},
{
title
:
'排序'
,
dataIndex
:
'orderNo'
,
width
:
50
,
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
width
:
80
,
customRender
:
({
record
})
=>
{
const
status
=
record
.
status
;
const
enable
=
~~
status
===
0
;
const
color
=
enable
?
'green'
:
'red'
;
const
text
=
enable
?
'启用'
:
'停用'
;
return
h
(
Tag
,
{
color
:
color
},
()
=>
text
);
},
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
width
:
180
,
},
{
title
:
'备注'
,
dataIndex
:
'remark'
,
},
];
export
const
searchFormSchema
:
FormSchema
[]
=
[
{
field
:
'deptName'
,
label
:
'部门名称'
,
component
:
'Input'
,
colProps
:
{
span
:
8
},
},
{
field
:
'status'
,
label
:
'状态'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'启用'
,
value
:
'0'
},
{
label
:
'停用'
,
value
:
'1'
},
],
},
colProps
:
{
span
:
8
},
},
];
export
const
formSchema
:
FormSchema
[]
=
[
{
field
:
'deptName'
,
label
:
'部门名称'
,
component
:
'Input'
,
required
:
true
,
},
{
field
:
'parentDept'
,
label
:
'上级部门'
,
component
:
'TreeSelect'
,
ifShow
({
values
})
{
const
{
deptName
,
parentDept
}
=
values
;
// Hide without a parentDept when editing
return
parentDept
||
(
!
deptName
&&
!
parentDept
);
},
componentProps
:
{
fieldNames
:
{
label
:
'deptName'
,
value
:
'id'
,
},
getPopupContainer
:
()
=>
document
.
body
,
},
required
:
true
,
},
{
field
:
'orderNo'
,
label
:
'排序'
,
component
:
'InputNumber'
,
required
:
true
,
},
{
field
:
'status'
,
label
:
'状态'
,
component
:
'RadioButtonGroup'
,
defaultValue
:
'0'
,
componentProps
:
{
options
:
[
{
label
:
'启用'
,
value
:
'0'
},
{
label
:
'停用'
,
value
:
'1'
},
],
},
required
:
true
,
},
{
label
:
'备注'
,
field
:
'remark'
,
component
:
'InputTextArea'
,
},
];
src/views/system/dept/index.vue
View file @
dfdca5bc
<
template
>
<
template
>
<div>
<div>
部门管理
<BasicTable
@
register=
"registerTable"
>
<template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新增部门
</a-button>
</
template
>
<!-- <template #bodyCell="{ column, record }">-->
<!-- <template v-if="column.key === 'action'">-->
<!-- <TableAction-->
<!-- :actions="[-->
<!-- {-->
<!-- icon: 'clarity:note-edit-line',-->
<!-- onClick: handleEdit.bind(null, record),-->
<!-- },-->
<!-- {-->
<!-- icon: 'ant-design:delete-outlined',-->
<!-- color: 'error',-->
<!-- popConfirm: {-->
<!-- title: '是否确认删除',-->
<!-- placement: 'left',-->
<!-- confirm: handleDelete.bind(null, record),-->
<!-- },-->
<!-- },-->
<!-- ]"-->
<!-- />-->
<!-- </template>-->
<!-- </template>-->
</BasicTable>
<!-- <DeptModal @register="registerModal" @success="handleSuccess" />-->
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getDeptList
}
from
'@/api/demo/system'
;
</
script
>
import
{
useModal
}
from
'@/components/Modal'
;
import
DeptModal
from
'./DeptModal.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./dept.data'
;
defineOptions
({
name
:
'DeptManagement'
});
<
style
scoped
>
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'部门列表'
,
api
:
getDeptList
,
columns
,
formConfig
:
{
labelWidth
:
120
,
schemas
:
searchFormSchema
,
},
pagination
:
false
,
striped
:
false
,
useSearchForm
:
true
,
showTableSetting
:
true
,
bordered
:
true
,
showIndexColumn
:
false
,
canResize
:
false
,
actionColumn
:
{
width
:
80
,
title
:
'操作'
,
dataIndex
:
'action'
,
// slots: { customRender: 'action' },
fixed
:
undefined
,
},
});
</
style
>
function
handleCreate
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
function
handleEdit
(
record
:
Recordable
)
{
openModal
(
true
,
{
record
,
isUpdate
:
true
,
});
}
function
handleDelete
(
record
:
Recordable
)
{
console
.
log
(
record
);
}
function
handleSuccess
()
{
reload
();
}
</
script
>
src/views/system/user/AccountModal.vue
View file @
dfdca5bc
...
@@ -4,19 +4,22 @@
...
@@ -4,19 +4,22 @@
</BasicModal>
</BasicModal>
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
ref
,
computed
,
unref
,
reactive
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
accountFormSchema
}
from
'./account.data'
;
import
{
accountFormSchema
}
from
'./account.data'
;
import
{
getDeptList
}
from
'@/api/demo/system'
;
import
{
getDeptList
,
getAllRoleList
}
from
'@/api/demo/system'
;
import
{
addUserApi
,
UserDetailApi
,
UserUpdataApi
}
from
'@/api/system/user/user'
import
{
encryptTwo
}
from
'../../../../src/utils/jsencrypt.js'
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
defineOptions
({
name
:
'AccountModal'
});
defineOptions
({
name
:
'AccountModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
const
rowId
=
ref
(
''
);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
const
[
registerForm
,
{
setFieldsValue
,
updateSchema
,
resetFields
,
validate
}]
=
useForm
({
labelWidth
:
100
,
labelWidth
:
100
,
baseColProps
:
{
span
:
24
},
baseColProps
:
{
span
:
24
},
...
@@ -26,42 +29,103 @@
...
@@ -26,42 +29,103 @@
span
:
23
,
span
:
23
,
},
},
});
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
resetFields
();
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
if
(
unref
(
isUpdate
))
{
rowId
.
value
=
data
.
record
.
id
;
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
// 通过id获取行详情信息
UserDetailApi
(
rowId
.
value
).
then
(
res
=>
{
const
form
=
res
.
data
// 数据处理反显用户角色
const
roleData
=
res
.
data
.
roleIds
.
split
(
','
)
form
.
roleList
=
[]
roleData
.
forEach
(
item
=>
{
const
id
=
Number
(
item
)
form
.
roleList
.
push
(
id
)
})
// 塞值
setFieldsValue
({
setFieldsValue
({
...
data
.
record
,
...
form
,
});
});
})
}
}
const
treeData
=
await
getDeptList
();
const
treeData
=
await
getDeptList
();
const
treeList
=
handleTree
(
treeData
.
data
,
'businessId'
,
undefined
,
undefined
,
undefined
)
updateSchema
([
updateSchema
([
{
{
field
:
'
pwd
'
,
field
:
'
username
'
,
show
:
!
unref
(
isUpdate
),
show
:
!
unref
(
isUpdate
),
},
},
{
{
field
:
'dept'
,
field
:
'password'
,
componentProps
:
{
treeData
},
show
:
!
unref
(
isUpdate
),
},
{
field
:
'flag'
,
show
:
!
unref
(
isUpdate
),
},
{
field
:
'deptId'
,
componentProps
:
{
treeData
:
treeList
},
},
},
]);
]);
});
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增账号'
:
'编辑账号'
));
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增账号'
:
'编辑账号'
));
function
handleTree
(
data
,
id
,
parentId
,
children
,
rootId
)
{
id
=
id
||
'id'
parentId
=
parentId
||
'parentId'
children
=
children
||
'children'
rootId
=
rootId
||
Math
.
min
.
apply
(
Math
,
data
.
map
(
item
=>
{
return
item
[
parentId
]
}))
||
0
// 对源数据深度克隆
const
cloneData
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
// 循环所有项
const
treeData
=
cloneData
.
filter
(
father
=>
{
const
branchArr
=
cloneData
.
filter
(
child
=>
{
// 返回每一项的子级数组
return
father
[
id
]
===
child
[
parentId
]
})
branchArr
.
length
>
0
?
father
.
children
=
branchArr
:
''
// 返回第一层
return
father
[
parentId
]
===
rootId
})
return
treeData
!==
''
?
treeData
:
data
}
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
try
{
try
{
const
values
=
await
validate
();
const
values
=
await
validate
();
setModalProps
({
confirmLoading
:
true
});
setModalProps
({
confirmLoading
:
true
});
// TODO custom api
// TODO custom api
console
.
log
(
values
);
console
.
log
(
values
);
// 编辑
if
(
unref
(
isUpdate
))
{
values
.
businessId
=
rowId
.
value
UserUpdataApi
(
values
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
createMessage
.
success
(
'编辑成功'
);
closeModal
();
closeModal
();
emit
(
'success'
,
{
isUpdate
:
unref
(
isUpdate
),
values
:
{
...
values
,
id
:
rowId
.
value
}
});
emit
(
'success'
,
{
isUpdate
:
unref
(
isUpdate
),
values
:
{
...
values
,
id
:
rowId
.
value
}
});
}
})
}
else
{
values
.
password
=
encryptTwo
(
values
.
password
)
addUserApi
(
values
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
createMessage
.
success
(
'新增成功'
);
closeModal
();
emit
(
'success'
,
{
isUpdate
:
unref
(
isUpdate
),
values
:
{
...
values
,
id
:
rowId
.
value
}
});
}
})
}
}
finally
{
}
finally
{
setModalProps
({
confirmLoading
:
false
});
setModalProps
({
confirmLoading
:
false
});
}
}
...
...
src/views/system/user/account.data.ts
View file @
dfdca5bc
import
{
getAllRoleList
,
isAccountExist
}
from
'@/api/demo/system'
;
import
{
getAllRoleList
,
isAccountExist
}
from
'@/api/demo/system'
;
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
import
{
BasicColumn
,
FormSchema
}
from
'@/components/Table'
;
import
{
optionsListApi
}
from
"@/api/demo/select"
;
/**
/**
* transform mock data
* transform mock data
...
@@ -79,80 +80,119 @@ export const searchFormSchema: FormSchema[] = [
...
@@ -79,80 +80,119 @@ export const searchFormSchema: FormSchema[] = [
},
},
];
];
export
const
accountFormSchema
:
FormSchema
[]
=
[
export
const
accountFormSchema
:
any
[]
=
[
{
{
field
:
'
account
'
,
field
:
'
username
'
,
label
:
'
用户
名'
,
label
:
'
登录
名'
,
component
:
'Input'
,
component
:
'Input'
,
helpMessage
:
[
'本字段演示异步验证'
,
'不能输入带有admin的用户名'
],
//
helpMessage: ['本字段演示异步验证', '不能输入带有admin的用户名'],
rules
:
[
rules
:
[
{
{
required
:
true
,
required
:
true
,
message
:
'请输入用户名'
,
message
:
'请输入登录名'
,
},
{
trigger
:
'blur'
,
validator
(
_
,
value
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
value
)
return
resolve
();
isAccountExist
(
value
)
.
then
(
resolve
)
.
catch
((
err
)
=>
{
reject
(
err
.
message
||
'验证失败'
);
});
});
},
},
},
// {
// trigger: 'blur',
// validator(_, value) {
// return new Promise((resolve, reject) => {
// if (!value) return resolve();
// isAccountExist(value)
// .then(resolve)
// .catch((err) => {
// reject(err.message || '验证失败');
// });
// });
// },
// },
],
],
},
},
{
{
field
:
'p
w
d'
,
field
:
'p
asswor
d'
,
label
:
'密码'
,
label
:
'密码'
,
component
:
'InputPassword'
,
component
:
'InputPassword'
,
required
:
true
,
required
:
true
,
ifShow
:
false
,
//
ifShow: false,
},
},
{
{
label
:
'角色'
,
field
:
'name'
,
field
:
'role'
,
label
:
'姓名'
,
component
:
'ApiSelect'
,
component
:
'Input'
,
},
{
field
:
'nickName'
,
label
:
'昵称'
,
component
:
'Input'
,
},
{
field
:
'sex'
,
label
:
'性别'
,
component
:
'Select'
,
componentProps
:
{
componentProps
:
{
api
:
getAllRoleList
,
options
:
[
labelField
:
'roleName'
,
{
label
:
'男'
,
value
:
'1'
},
valueField
:
'roleValue'
,
{
label
:
'女'
,
value
:
'0'
},
],
},
},
{
field
:
'phone'
,
label
:
'手机号码'
,
component
:
'Input'
,
},
{
field
:
'idNumber'
,
label
:
'身份证号'
,
component
:
'Input'
,
},
{
field
:
'email'
,
label
:
'邮箱'
,
component
:
'Input'
,
},
{
field
:
'flag'
,
label
:
'状态'
,
component
:
'RadioGroup'
,
componentProps
:
{
options
:
[
{
label
:
'启用'
,
value
:
1
},
{
label
:
'停用'
,
value
:
0
},
],
},
},
required
:
true
,
required
:
true
,
},
},
{
{
field
:
'dept'
,
field
:
'dept
Id
'
,
label
:
'所属部门'
,
label
:
'所属部门'
,
component
:
'TreeSelect'
,
component
:
'TreeSelect'
,
componentProps
:
{
componentProps
:
{
fieldNames
:
{
fieldNames
:
{
label
:
'deptName'
,
label
:
'deptName'
,
value
:
'
i
d'
,
value
:
'
businessI
d'
,
},
},
getPopupContainer
:
()
=>
document
.
body
,
getPopupContainer
:
()
=>
document
.
body
,
},
},
required
:
true
,
required
:
true
,
},
},
{
{
field
:
'nickname'
,
field
:
'roleList'
,
label
:
'昵称'
,
label
:
'角色'
,
component
:
'Input'
,
component
:
'ApiSelect'
,
required
:
true
,
componentProps
:
{
api
:
getAllRoleList
,
labelField
:
'roleName'
,
valueField
:
'businessId'
,
resultField
:
'data'
,
},
},
{
label
:
'邮箱'
,
field
:
'email'
,
component
:
'Input'
,
required
:
true
,
required
:
true
,
},
},
{
{
label
:
'备注'
,
label
:
'备注'
,
field
:
'remark'
,
field
:
'remark
s
'
,
component
:
'InputTextArea'
,
component
:
'InputTextArea'
,
},
},
];
];
src/views/system/user/index.vue
View file @
dfdca5bc
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
import
{
getAccountList
,
deleteUser
}
from
'@/api/demo/system'
;
import
{
getAccountList
,
deleteUser
}
from
'@/api/demo/system'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
DeptTree
from
'./DeptTree.vue'
;
import
DeptTree
from
'./DeptTree.vue'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
AccountModal
from
'./AccountModal.vue'
;
import
AccountModal
from
'./AccountModal.vue'
;
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
import
{
useGo
}
from
'@/hooks/web/usePage'
;
import
{
useGo
}
from
'@/hooks/web/usePage'
;
defineOptions
({
name
:
'AccountManagement'
});
defineOptions
({
name
:
'AccountManagement'
});
const
{
createMessage
}
=
useMessage
();
const
go
=
useGo
();
const
go
=
useGo
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
searchInfo
=
reactive
<
Recordable
>
({});
const
searchInfo
=
reactive
<
Recordable
>
({});
...
@@ -84,7 +84,6 @@
...
@@ -84,7 +84,6 @@
}
}
/** 编辑按钮*/
/** 编辑按钮*/
function
handleEdit
(
record
:
Recordable
)
{
function
handleEdit
(
record
:
Recordable
)
{
console
.
log
(
record
);
openModal
(
true
,
{
openModal
(
true
,
{
record
,
record
,
isUpdate
:
true
,
isUpdate
:
true
,
...
@@ -108,7 +107,9 @@
...
@@ -108,7 +107,9 @@
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
// 注意:updateTableDataRecord要求表格的rowKey属性为string并且存在于每一行的record的keys中
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
const
result
=
updateTableDataRecord
(
values
.
id
,
values
);
console
.
log
(
result
);
console
.
log
(
result
);
reload
();
}
else
{
}
else
{
createMessage
.
success
(
'新增成功'
);
reload
();
reload
();
}
}
}
}
...
...
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