Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
d16501ea
提交
d16501ea
authored
3月 25, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(supply): 供应链报表添加自定义分组功能
同上
上级
fb9d59bc
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
83 行增加
和
11 行删除
+83
-11
index.vue
src/views/bi/supply/index.vue
+83
-11
没有找到文件。
src/views/bi/supply/index.vue
浏览文件 @
d16501ea
...
...
@@ -2,8 +2,10 @@
<div
class=
"app-container"
>
<el-card
class=
"container"
>
<template
#
header
>
<div
class=
"card-header"
>
<div
class=
"card-header
-left
"
>
<span>
常用报表
</span>
</div>
<div
class=
"card-header-right"
>
<el-button
class=
"custom"
type=
"primary"
link
...
...
@@ -38,9 +40,11 @@
</div>
</div>
</el-card>
<!-- 自定义报表分组 -->
<el-dialog
title=
"编辑常用报表"
v-model=
"visible"
>
<div
class=
"wrap"
>
<!-- 列表 -->
<div
class=
"left"
>
<draggable
v-model=
"reportList"
group=
"reports"
...
...
@@ -58,6 +62,7 @@
</
template
>
</draggable>
</div>
<!-- 编辑区 -->
<div
class=
"right"
>
<div
class=
"group-container"
>
<el-card
v-for=
"group in groups"
...
...
@@ -65,8 +70,24 @@
class=
"group_card"
:style=
"{ width: '100%' }"
>
<
template
#
header
>
<div
class=
"card-header"
>
<span>
{{
group
.
groupName
}}
</span>
<div
class=
"card-header-left"
>
<span
v-if=
"!group.showEdit"
>
{{
group
.
groupName
}}
</span>
<el-input
v-else
v-model=
"group.groupName"
ref=
"groupNameRef"
@
blur=
"group.showEdit = false"
></el-input>
</div>
<div
class=
"card-header-right"
>
<el-button
type=
"primary"
text
@
click=
"changeGroupName(group)"
>
重命名
</el-button>
<el-button
type=
"danger"
text
@
click=
"removeGroupName(group)"
>
删除
</el-button>
</div>
</
template
>
<draggable
v-model=
"group.items"
...
...
@@ -87,6 +108,16 @@
</draggable>
</el-card>
</div>
<!-- 新增分组 -->
<div
class=
"add-group"
>
<el-button
type=
"primary"
@
click=
"groups.push({ groupName: '新分组', showEdit: false, items: [] })"
>
<el-icon>
<Plus
/>
</el-icon>
新增分组
</el-button>
</div>
</div>
</div>
</el-dialog>
...
...
@@ -96,9 +127,11 @@
<
script
setup
>
import
{
getReportListAPI
,
getReportListBySelfAPI
,
getReportListByGroupAPI
,
addReportGroupAPI
}
from
'@/api'
import
draggable
from
'vuedraggable'
const
{
proxy
}
=
getCurrentInstance
()
const
visible
=
ref
(
false
)
const
groups
=
ref
([])
const
baseURL
=
ref
(
import
.
meta
.
env
.
VITE_APP_REPORT_URL
+
'/report'
)
const
reportList
=
ref
([])
const
getReportList
=
async
()
=>
{
...
...
@@ -129,17 +162,33 @@ const groupChange = async (e) => {
await
addReportGroupAPI
(
groups
.
value
)
}
getReportList
()
// 修改分组名
const
changeGroupName
=
(
group
)
=>
{
group
.
showEdit
=
true
nextTick
(()
=>
{
proxy
.
$refs
[
'groupNameRef'
][
0
].
focus
()
})
}
// 删除分组
const
removeGroupName
=
(
group
)
=>
{
// 判断组内还有下属表,给提示不让删除
if
(
group
.
items
.
length
>
0
)
{
proxy
.
$message
.
error
(
'分组内还有报表,无法删除,可重命名'
)
return
}
// 确认删除吗?
proxy
.
$modal
.
confirm
(
'确认删除分组"'
+
group
.
groupName
+
'"?删除后下属报表自动回到左侧列表中'
).
then
(
async
()
=>
{
// 把当前分组的报表放到左侧
reportList
.
value
=
reportList
.
value
.
concat
(
group
.
items
)
const
index
=
groups
.
value
.
indexOf
(
group
)
groups
.
value
.
splice
(
index
,
1
)
})
}
</
script
>
<
style
scoped
lang=
"scss"
>
.el-card__header
{
.custom
{
float
:
right
;
padding
:
3px
0
;
}
}
.group_item
{
.group_name
{
display
:
flex
;
...
...
@@ -172,9 +221,10 @@ getReportList()
gap
:
10px
;
}
.group-container
{
.group-container
{
padding-right
:
20px
;
}
.group_card
{
margin-top
:
20px
;
}
...
...
@@ -204,8 +254,29 @@ getReportList()
.dragging-item-left
{
background-color
:
transparent
;
}
.dragging-item
{
background-color
:
#a1ccf2
;
}
/* card 头部 */
::v-deep
(
.el-card__header
)
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.card-header-right
{
.el-button
{
margin
:
0
;
padding
:
10px
;
}
}
}
.add-group
{
margin-top
:
20px
;
.el-button
{
width
:
100%
;
}
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论