Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
dea8597d
提交
dea8597d
authored
6月 28, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 新增批量删除标签
上级
f728161a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
17 行删除
+33
-17
api.ts
src/modules/label/api.ts
+5
-0
Index.vue
src/modules/label/views/Index.vue
+28
-17
没有找到文件。
src/modules/label/api.ts
浏览文件 @
dea8597d
...
...
@@ -41,6 +41,11 @@ export function deleteLabel(data: { id: string }) {
return
httpRequest
.
post
(
'/api/lab/v1/experiment/tag/bda-delete'
,
data
)
}
// 删除标签
export
function
deleteLabels
(
data
:
{
ids
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/tag/batch-delete'
,
data
)
}
// 获取标签数据信息
export
function
getLabelStatistics
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/experiment/tag/bda-statistics'
,
{
params
})
...
...
src/modules/label/views/Index.vue
浏览文件 @
dea8597d
<
script
setup
lang=
"ts"
>
import
type
{
Label
}
from
'../types'
import
{
Plus
}
from
'@element-plus/icons-vue'
import
{
Plus
,
Delete
}
from
'@element-plus/icons-vue'
import
AppList
from
'@/components/base/AppList.vue'
import
LabelType
from
'../components/LabelType.vue'
import
{
ElMessageBox
,
ElMessage
}
from
'element-plus'
import
{
getLabelList
,
deleteLabel
}
from
'../api'
import
{
getLabelList
,
deleteLabel
,
deleteLabels
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
import
{
getNameByValue
,
updateStatusRuleList
,
labelList
}
from
'@/utils/dictionary'
import
{
useLabelType
}
from
'../composables/useLabelType'
...
...
@@ -58,6 +58,7 @@ const listOptions = computed(() => {
{
type
:
'input'
,
prop
:
'updated_operator'
,
placeholder
:
'更新人'
,
slots
:
'filter-user'
}
],
columns
:
[
{
type
:
'selection'
},
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'标签ID'
,
prop
:
'id'
},
{
label
:
'标签名称'
,
prop
:
'name'
},
...
...
@@ -143,16 +144,35 @@ function handleSelect(id: string) {
appList
?.
refetch
()
})
}
let
multipleSelection
=
$ref
<
Label
[]
>
([])
function
handleSelectionChange
(
selection
:
Label
[])
{
multipleSelection
=
selection
}
const
handleRemoves
=
async
function
()
{
const
ids
=
multipleSelection
.
map
(
item
=>
item
.
id
)
await
ElMessageBox
.
confirm
(
'确定要删除选中的用户数据吗?'
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
await
deleteLabels
({
ids
:
JSON
.
stringify
(
ids
)
})
appList
?.
refetch
(
true
)
ElMessage
({
message
:
'删除成功'
,
type
:
'success'
})
}
</
script
>
<!-- import { useUserStore } from '@/stores/user'
const userStore = useUserStore() -->
<
template
>
<AppCard>
<div
class=
"label-wrap"
>
<div
class=
"label-left"
><LabelType
:active-id=
"listParams.type_id"
@
select=
"handleSelect"
></LabelType></div>
<AppList
v-bind=
"listOptions"
ref=
"appList"
class=
"label-right"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
class=
"label-right"
@
selection-change=
"handleSelectionChange"
>
<template
#
header-buttons
>
<el-button
type=
"primary"
:icon=
"Plus"
@
click=
"handleAdd"
v-if=
"!userStore.status.tag_status"
>
新建
</el-button>
<el-button
type=
"primary"
plain
:icon=
"Delete"
:disabled=
"!multipleSelection.length"
@
click=
"handleRemoves"
v-permission=
"'experiment_tag_delete'"
>
删除
</el-button
>
</
template
>
<
template
#
filter-user
>
<SelectUser
v-model=
"listParams.updated_operator"
placeholder=
"更新人"
@
change=
"handleRefresh"
></SelectUser>
...
...
@@ -161,23 +181,14 @@ const userStore = useUserStore() -->
<
template
#
table-x=
"{ row }"
>
<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=
"handleUpdate(row)"
v-permission=
"'experiment_tag_update'"
>
编辑
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'experiment_tag_delete'"
>
删除
</el-button
>
<el-button
type=
"primary"
plain
@
click=
"handleUpdate(row)"
v-permission=
"'experiment_tag_update'"
>
编辑
</el-button>
<el-button
type=
"primary"
plain
@
click=
"handleRemove(row)"
v-permission=
"'experiment_tag_delete'"
>
删除
</el-button>
</
template
>
</AppList>
</div>
</AppCard>
<!-- 新建/修改标签 -->
<LabelFormDialog
v-model=
"formVisible"
:data=
"currentRow"
@
update=
"handleRefresh"
v-if=
"formVisible"
></LabelFormDialog>
<LabelFormDialog
v-model=
"formVisible"
:data=
"currentRow"
@
update=
"handleRefresh"
v-if=
"formVisible"
></LabelFormDialog>
<!-- 查看标签 -->
<LabelViewDialog
v-model=
"viewVisible"
:data=
"currentRow"
v-if=
"viewVisible && currentRow"
></LabelViewDialog>
<!-- 规则 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论