Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b1f5ad55
authored
Nov 19, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crm:code review 权限列表
parent
2e01944d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
+19
-7
src/api/crm/permission/index.ts
+2
-2
src/views/crm/components/CrmPermissionForm.vue
+3
-0
src/views/crm/components/CrmTeamList.vue
+12
-3
src/views/crm/customer/index.vue
+2
-2
No files found.
src/api/crm/permission/index.ts
View file @
b1f5ad55
...
@@ -6,9 +6,9 @@ export interface PermissionVO {
...
@@ -6,9 +6,9 @@ export interface PermissionVO {
bizType
:
number
|
undefined
// Crm 类型
bizType
:
number
|
undefined
// Crm 类型
bizId
:
number
|
undefined
// Crm 类型数据编号
bizId
:
number
|
undefined
// Crm 类型数据编号
level
:
number
|
undefined
// 权限级别
level
:
number
|
undefined
// 权限级别
deptName
?:
string
// 部门名称
deptName
?:
string
// 部门名称
// 岗位名称数组 TODO @puhui999:数组?
nickname
?:
string
// 用户昵称
nickname
?:
string
// 用户昵称
postNames
?:
string
// 岗位名称数组
postNames
?:
string
// 岗位名称数组
TODO @puhui999:数组?
createTime
?:
Date
createTime
?:
Date
}
}
...
...
src/views/crm/components/CrmPermissionForm.vue
View file @
b1f5ad55
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"权限级别"
prop=
"level"
>
<el-form-item
label=
"权限级别"
prop=
"level"
>
<el-radio-group
v-model=
"formData.level"
>
<el-radio-group
v-model=
"formData.level"
>
<!-- TODO @puhui999:搞个字典配置?然后这里 remove 掉负责人 -->
<el-radio
:label=
"CrmPermissionLevelEnum.READ"
>
只读
</el-radio>
<el-radio
:label=
"CrmPermissionLevelEnum.READ"
>
只读
</el-radio>
<el-radio
:label=
"CrmPermissionLevelEnum.WRITE"
>
读写
</el-radio>
<el-radio
:label=
"CrmPermissionLevelEnum.WRITE"
>
读写
</el-radio>
</el-radio-group>
</el-radio-group>
...
@@ -36,6 +37,7 @@ import * as PermissionApi from '@/api/crm/permission'
...
@@ -36,6 +37,7 @@ import * as PermissionApi from '@/api/crm/permission'
import
{
CrmPermissionLevelEnum
}
from
'./index'
import
{
CrmPermissionLevelEnum
}
from
'./index'
defineOptions
({
name
:
'CrmPermissionForm'
})
defineOptions
({
name
:
'CrmPermissionForm'
})
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
@@ -107,6 +109,7 @@ const resetForm = (bizType: number, bizId: number) => {
...
@@ -107,6 +109,7 @@ const resetForm = (bizType: number, bizId: number) => {
}
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 获得用户列表
// 获得用户列表
// TODO 芋艿:用户列表的选择组件
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
userOptions
.
value
=
await
UserApi
.
getSimpleUserList
()
})
})
</
script
>
</
script
>
src/views/crm/components/CrmTeamList.vue
View file @
b1f5ad55
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
<CrmPermissionForm
ref=
"crmPermissionFormRef"
/>
<CrmPermissionForm
ref=
"crmPermissionFormRef"
/>
</template>
</template>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
// TODO @puhui999:改成 CrmPermissionList
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
ElTable
}
from
'element-plus'
import
{
ElTable
}
from
'element-plus'
import
*
as
PermissionApi
from
'@/api/crm/permission'
import
*
as
PermissionApi
from
'@/api/crm/permission'
...
@@ -46,6 +47,9 @@ import CrmPermissionForm from './CrmPermissionForm.vue'
...
@@ -46,6 +47,9 @@ import CrmPermissionForm from './CrmPermissionForm.vue'
import
{
CrmPermissionLevelEnum
}
from
'./index'
import
{
CrmPermissionLevelEnum
}
from
'./index'
defineOptions
({
name
:
'CrmTeam'
})
defineOptions
({
name
:
'CrmTeam'
})
const
message
=
useMessage
()
// 消息
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
bizType
:
number
bizType
:
number
bizId
:
number
bizId
:
number
...
@@ -65,18 +69,22 @@ const list = ref<PermissionApi.PermissionVO[]>([
...
@@ -65,18 +69,22 @@ const list = ref<PermissionApi.PermissionVO[]>([
createTime
:
new
Date
()
createTime
:
new
Date
()
}
}
])
// 列表的数据
])
// 列表的数据
/** 查询列表 */
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
const
res
=
await
PermissionApi
.
getPermissionList
({
const
data
=
await
PermissionApi
.
getPermissionList
({
bizType
:
props
.
bizType
,
bizType
:
props
.
bizType
,
bizId
:
props
.
bizId
bizId
:
props
.
bizId
})
})
list
.
value
=
res
list
.
value
=
data
}
finally
{
}
finally
{
loading
.
value
=
false
loading
.
value
=
false
}
}
}
}
// TODO @puhui999:字典格式化
/**
/**
* 获得权限级别名称
* 获得权限级别名称
* @param level 权限级别
* @param level 权限级别
...
@@ -93,11 +101,12 @@ const getLevelName = computed(() => (level: number) => {
...
@@ -93,11 +101,12 @@ const getLevelName = computed(() => (level: number) => {
break
break
}
}
})
})
// TODO @puhui999:空行稍微注意下哈;一些注释补齐下;
const
multipleSelection
=
ref
<
PermissionApi
.
PermissionVO
[]
>
([])
const
multipleSelection
=
ref
<
PermissionApi
.
PermissionVO
[]
>
([])
const
handleSelectionChange
=
(
val
:
PermissionApi
.
PermissionVO
[])
=>
{
const
handleSelectionChange
=
(
val
:
PermissionApi
.
PermissionVO
[])
=>
{
multipleSelection
.
value
=
val
multipleSelection
.
value
=
val
}
}
const
message
=
useMessage
()
// TODO @puhui999:一些变量命名,看看有没可能跟列表界面的 index.vue 保持他统一的风格;
const
crmPermissionFormRef
=
ref
<
InstanceType
<
typeof
CrmPermissionForm
>>
()
const
crmPermissionFormRef
=
ref
<
InstanceType
<
typeof
CrmPermissionForm
>>
()
const
handleEdit
=
()
=>
{
const
handleEdit
=
()
=>
{
if
(
multipleSelection
.
value
?.
length
===
0
)
{
if
(
multipleSelection
.
value
?.
length
===
0
)
{
...
...
src/views/crm/customer/index.vue
View file @
b1f5ad55
...
@@ -185,8 +185,8 @@
...
@@ -185,8 +185,8 @@
@
pagination=
"getList"
@
pagination=
"getList"
/>
/>
</ContentWrap>
</ContentWrap>
<!-- TODO 方便查看效果 -->
<!-- TODO 方便查看效果
TODO 芋艿:先注释了,避免演示环境报错
-->
<
CrmTeam
:biz-id=
"1"
:biz-type=
"CrmBizTypeEnum.CRM_CUSTOMER"
/
>
<
!-- <CrmTeam :biz-id="1" :biz-type="CrmBizTypeEnum.CRM_CUSTOMER" />--
>
<!-- 表单弹窗:添加/修改 -->
<!-- 表单弹窗:添加/修改 -->
<CustomerForm
ref=
"formRef"
@
success=
"getList"
/>
<CustomerForm
ref=
"formRef"
@
success=
"getList"
/>
...
...
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