Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
93e4e3c3
提交
93e4e3c3
authored
4月 25, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 新增权限控制
上级
b4be7f62
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
255 行增加
和
67 行删除
+255
-67
base.ts
src/api/base.ts
+6
-0
Index.vue
src/modules/group/views/Index.vue
+12
-3
LabelType.vue
src/modules/label/components/LabelType.vue
+9
-3
Index.vue
src/modules/label/views/Index.vue
+9
-5
Index.vue
src/modules/material/audio/views/Index.vue
+24
-6
Index.vue
src/modules/material/card/views/Index.vue
+24
-6
Index.vue
src/modules/material/h5/views/Index.vue
+24
-6
Index.vue
src/modules/material/image/views/Index.vue
+24
-6
Index.vue
src/modules/material/mini/views/Index.vue
+24
-6
Index.vue
src/modules/material/qrcode/views/Index.vue
+24
-6
Index.vue
src/modules/material/text/views/Index.vue
+24
-6
Index.vue
src/modules/material/video/views/Index.vue
+24
-6
Index.vue
src/modules/user/views/Index.vue
+18
-6
user.ts
src/stores/user.ts
+7
-2
permission.ts
src/utils/permission.ts
+2
-0
没有找到文件。
src/api/base.ts
浏览文件 @
93e4e3c3
...
@@ -5,6 +5,12 @@ export function getUser() {
...
@@ -5,6 +5,12 @@ export function getUser() {
return
httpRequest
.
get
(
'/api/lab/v1/common/permission/role'
)
return
httpRequest
.
get
(
'/api/lab/v1/common/permission/role'
)
}
}
// 获取旅程的数据使用状态(是否使用公共数据)
// true 是学员且使用公共数据(学员不能自己创建数据) false 学员可以自己创建数据
export
function
checkDataStatus
()
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/itinerary/check-data-status'
)
}
// 退出登录
// 退出登录
export
function
logout
()
{
export
function
logout
()
{
return
httpRequest
.
get
(
'/api/passport/rest/logout'
)
return
httpRequest
.
get
(
'/api/passport/rest/logout'
)
...
...
src/modules/group/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -114,7 +114,7 @@ function handleView(row: Group) {
...
@@ -114,7 +114,7 @@ function handleView(row: Group) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-dropdown>
<el-dropdown
v-permission=
"['experiment_group_create_dynamic_group', 'experiment_group_create_static_group']"
>
<el-button
type=
"primary"
:icon=
"Plus"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
>
新建
</el-button>
<template
#
dropdown
>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
...
@@ -129,6 +129,7 @@ function handleView(row: Group) {
...
@@ -129,6 +129,7 @@ function handleView(row: Group) {
:icon=
"Delete"
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemove(multipleSelection)"
@
click=
"handleRemove(multipleSelection)"
v-permission=
"'experiment_group_delete'"
>
删除
</el-button
>
删除
</el-button
>
>
</el-space>
</el-space>
...
@@ -139,8 +140,16 @@ function handleView(row: Group) {
...
@@ -139,8 +140,16 @@ function handleView(row: Group) {
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove([row])"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleUpdate(row)"
v-permission=
"['experiment_group_create_dynamic_group', 'experiment_group_update_static_group']"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove([row])"
v-permission=
"'experiment_group_delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
</AppCard>
</AppCard>
...
...
src/modules/label/components/LabelType.vue
浏览文件 @
93e4e3c3
...
@@ -34,7 +34,9 @@ function handleRemove(row: LabelType) {
...
@@ -34,7 +34,9 @@ function handleRemove(row: LabelType) {
</
script
>
</
script
>
<
template
>
<
template
>
<el-button
type=
"primary"
style=
"width: 100%"
@
click=
"handleAdd"
>
添加标签类型
</el-button>
<el-button
type=
"primary"
style=
"width: 100%"
@
click=
"handleAdd"
v-permission=
"'experiment_tag_type_create'"
>
添加标签类型
</el-button
>
<div
class=
"label-type-total"
>
<div
class=
"label-type-total"
>
<h4>
全部标签
</h4>
<h4>
全部标签
</h4>
<p>
{{
labelCount
}}
</p>
<p>
{{
labelCount
}}
</p>
...
@@ -54,8 +56,12 @@ function handleRemove(row: LabelType) {
...
@@ -54,8 +56,12 @@ function handleRemove(row: LabelType) {
</svg>
</svg>
<p>
{{
item
.
name
}}
</p>
<p>
{{
item
.
name
}}
</p>
<div
class=
"label-type-actions"
>
<div
class=
"label-type-actions"
>
<el-icon
class=
"label-type-item__edit"
@
click=
"handleUpdate(item)"
><Edit
/></el-icon>
<el-icon
class=
"label-type-item__edit"
@
click=
"handleUpdate(item)"
v-permission=
"'experiment_tag_type_update'"
<el-icon
class=
"label-type-item__remove"
@
click=
"handleRemove(item)"
><Delete
/></el-icon>
><Edit
/></el-icon>
<el-icon
class=
"label-type-item__remove"
@
click=
"handleRemove(item)"
v-permission=
"'experiment_tag_type_delete'"
><Delete
/></el-icon>
</div>
</div>
</li>
</li>
</ul>
</ul>
...
...
src/modules/label/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -117,9 +117,9 @@ function handleRule(row: Label) {
...
@@ -117,9 +117,9 @@ function handleRule(row: Label) {
<div
class=
"label-left"
><LabelType></LabelType></div>
<div
class=
"label-left"
><LabelType></LabelType></div>
<AppList
v-bind=
"listOptions"
ref=
"appList"
class=
"label-right"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
class=
"label-right"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-
space>
<el-
button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'experiment_tag_create'"
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
>
新建
</el-button
</el-space
>
>
</
template
>
</
template
>
<
template
#
filter-user
>
<
template
#
filter-user
>
<SelectUser
v-model=
"listParams.updated_operator"
placeholder=
"更新人"
@
change=
"handleRefresh"
></SelectUser>
<SelectUser
v-model=
"listParams.updated_operator"
placeholder=
"更新人"
@
change=
"handleRefresh"
></SelectUser>
...
@@ -128,8 +128,12 @@ function handleRule(row: Label) {
...
@@ -128,8 +128,12 @@ function handleRule(row: Label) {
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleRule(row)"
>
规则
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleRule(row)"
>
规则
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleUpdate(row)"
>
编辑
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleUpdate(row)"
v-permission=
"'experiment_tag_update'"
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'experiment_tag_delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
</div>
</div>
...
...
src/modules/material/audio/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/card/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/h5/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/image/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/mini/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/qrcode/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/text/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/material/video/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
...
@@ -92,6 +92,7 @@ function handleSelectionChange(selection: MaterialProp[]) {
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
const
handleRemove
=
function
(
row
:
{
id
:
string
})
{
deleteMembers
(
row
.
id
)
deleteMembers
(
row
.
id
)
}
}
const
handleRemoves
=
function
()
{
const
handleRemoves
=
function
()
{
const
ids
=
multipleSelection
const
ids
=
multipleSelection
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
.
reduce
((
a
:
any
,
b
:
any
)
=>
{
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
...
@@ -103,7 +104,7 @@ const handleRemoves = function () {
}
}
const
deleteMembers
=
function
(
ids
:
string
)
{
const
deleteMembers
=
function
(
ids
:
string
)
{
deleteMaterial
({
id
:
ids
}).
then
(
res
=>
{
deleteMaterial
({
id
:
ids
}).
then
(
()
=>
{
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
handleRefresh
()
handleRefresh
()
})
})
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
...
@@ -115,7 +116,13 @@ const deleteMembers = function (ids: string) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-marketing-material-create'"
>
新建
</el-button
>
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<!--
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
>
删除
</el-button
>
删除
</el-button
>
-->
>
-->
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
...
@@ -123,8 +130,20 @@ const deleteMembers = function (ids: string) {
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-marketing-material-update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-marketing-material-delete'"
>
删除
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
<UpdateMaterialDialog
<UpdateMaterialDialog
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
...
@@ -132,7 +151,6 @@ const deleteMembers = function (ids: string) {
:data=
"currentRow"
:data=
"currentRow"
@
update=
"handleRefresh()"
@
update=
"handleRefresh()"
v-if=
"updateVisible"
v-if=
"updateVisible"
v-model=
"updateVisible"
v-model=
"updateVisible"
></UpdateMaterialDialog>
></UpdateMaterialDialog>
</AppCard>
</AppCard>
</template>
</template>
src/modules/user/views/Index.vue
浏览文件 @
93e4e3c3
...
@@ -197,8 +197,10 @@ const downloadMember = function (isAll?: boolean) {
...
@@ -197,8 +197,10 @@ const downloadMember = function (isAll?: boolean) {
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-space>
<el-space>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
>
新建
</el-button>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-permission=
"'v1-experiment-member-create'"
<el-dropdown>
>
新建
</el-button
>
<el-dropdown
v-permission=
"'v1-experiment-member-download'"
>
<el-button
type=
"primary"
:icon=
"Download"
>
导出
</el-button>
<el-button
type=
"primary"
:icon=
"Download"
>
导出
</el-button>
<template
#
dropdown
>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
...
@@ -207,7 +209,7 @@ const downloadMember = function (isAll?: boolean) {
...
@@ -207,7 +209,7 @@ const downloadMember = function (isAll?: boolean) {
</el-dropdown-menu>
</el-dropdown-menu>
</
template
>
</
template
>
</el-dropdown>
</el-dropdown>
<el-dropdown>
<el-dropdown
v-permission=
"['v1-experiment-member-member-upload', 'v1-experiment-member-event-upload']"
>
<el-button
type=
"primary"
:icon=
"Upload"
>
导入
</el-button>
<el-button
type=
"primary"
:icon=
"Upload"
>
导入
</el-button>
<
template
#
dropdown
>
<
template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-menu>
...
@@ -217,7 +219,13 @@ const downloadMember = function (isAll?: boolean) {
...
@@ -217,7 +219,13 @@ const downloadMember = function (isAll?: boolean) {
</
template
>
</
template
>
</el-dropdown>
</el-dropdown>
<el-button
type=
"primary"
@
click=
"progressVisible = true"
>
数据导入进度
</el-button>
<el-button
type=
"primary"
@
click=
"progressVisible = true"
>
数据导入进度
</el-button>
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
<el-button
type=
"danger"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves()"
v-permission=
"'v1-experiment-member-delete'"
>
删除
</el-button
>
删除
</el-button
>
>
</el-space>
</el-space>
...
@@ -225,8 +233,12 @@ const downloadMember = function (isAll?: boolean) {
...
@@ -225,8 +233,12 @@ const downloadMember = function (isAll?: boolean) {
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
type=
"primary"
plain
@
click=
"handleImage(row)"
>
画像
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleImage(row)"
>
画像
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleView(row)"
>
查看
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
>
编辑
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleEdit(row)"
v-permission=
"'v1-experiment-member-update'"
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
>
删除
</el-button>
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'v1-experiment-member-delete'"
>
删除
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"goPage(row)"
>
事件
</el-button>
<el-button
type=
"primary"
plain
@
click=
"goPage(row)"
>
事件
</el-button>
</
template
>
</
template
>
</AppList>
</AppList>
...
...
src/stores/user.ts
浏览文件 @
93e4e3c3
import
type
{
UserType
,
ProjectType
,
OrganizationType
,
RoleType
,
PermissionType
}
from
'@/types'
import
type
{
UserType
,
ProjectType
,
OrganizationType
,
RoleType
,
PermissionType
}
from
'@/types'
import
{
defineStore
}
from
'pinia'
import
{
defineStore
}
from
'pinia'
import
{
getUser
,
logout
}
from
'@/api/base'
import
{
getUser
,
logout
,
checkDataStatus
}
from
'@/api/base'
import
{
useMapStore
}
from
'@/stores/map'
import
{
useMapStore
}
from
'@/stores/map'
// 角色信息(1学员;5教师; 6管理员)
// 角色信息(1学员;5教师; 6管理员)
...
@@ -15,6 +15,7 @@ interface State {
...
@@ -15,6 +15,7 @@ interface State {
organization
:
OrganizationType
|
null
organization
:
OrganizationType
|
null
roles
:
RoleType
[]
roles
:
RoleType
[]
permissions
:
PermissionType
[]
permissions
:
PermissionType
[]
status
:
boolean
}
}
export
const
useUserStore
=
defineStore
({
export
const
useUserStore
=
defineStore
({
...
@@ -25,7 +26,8 @@ export const useUserStore = defineStore({
...
@@ -25,7 +26,8 @@ export const useUserStore = defineStore({
organization
:
null
,
organization
:
null
,
project
:
null
,
project
:
null
,
roles
:
[],
roles
:
[],
permissions
:
[]
permissions
:
[],
status
:
false
}),
}),
getters
:
{
getters
:
{
isLogin
:
state
=>
!!
state
.
user
isLogin
:
state
=>
!!
state
.
user
...
@@ -42,6 +44,9 @@ export const useUserStore = defineStore({
...
@@ -42,6 +44,9 @@ export const useUserStore = defineStore({
this
.
roles
=
roles
this
.
roles
=
roles
this
.
permissions
=
permissions
this
.
permissions
=
permissions
await
useMapStore
().
getMapList
()
await
useMapStore
().
getMapList
()
await
checkDataStatus
().
then
(
res
=>
{
this
.
status
=
res
.
data
.
status
})
},
},
async
logout
()
{
async
logout
()
{
await
logout
()
await
logout
()
...
...
src/utils/permission.ts
浏览文件 @
93e4e3c3
...
@@ -4,6 +4,8 @@ import type { DirectiveBinding } from 'vue'
...
@@ -4,6 +4,8 @@ import type { DirectiveBinding } from 'vue'
// 判断是否有权限
// 判断是否有权限
export
function
checkPermission
(
value
:
string
|
string
[]):
boolean
{
export
function
checkPermission
(
value
:
string
|
string
[]):
boolean
{
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
// true 是学员且使用公共数据(学员不能自己创建数据) false 学员可以自己创建数据
if
(
userStore
.
status
)
return
true
const
permissions
=
userStore
.
permissions
const
permissions
=
userStore
.
permissions
if
(
Array
.
isArray
(
value
))
{
if
(
Array
.
isArray
(
value
))
{
return
permissions
.
some
(
item
=>
value
.
includes
(
item
.
tag
))
return
permissions
.
some
(
item
=>
value
.
includes
(
item
.
tag
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论