Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
19b17451
提交
19b17451
authored
1月 20, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(bi/finance): 口味规格和直播间支持全选
watch 观察表单参数有值显示对应列,暂时注释了,默认全都显示所有列
上级
4069f78a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
36 行增加
和
24 行删除
+36
-24
finance.js
src/api/bi/finance.js
+12
-6
index.vue
src/components/XLSelect/index.vue
+19
-16
date.js
src/hooks/date.js
+5
-2
index.vue
src/views/bi/finance/index.vue
+0
-0
没有找到文件。
src/api/bi/finance.js
浏览文件 @
19b17451
...
@@ -42,9 +42,12 @@ export const getFinanceListAPI = (data) => {
...
@@ -42,9 +42,12 @@ export const getFinanceListAPI = (data) => {
url
:
'/bi/finance/cost/list'
,
url
:
'/bi/finance/cost/list'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
{
data
:
{
zbjQdType
:
data
.
brand
,
zbjQdType
:
data
.
zbjQdType
,
flavor
:
data
.
taste
,
flavor
:
data
.
flavorErp
,
specName
:
data
.
spec
,
specName
:
data
.
specNameErp
,
zbjQdTypeAll
:
data
.
zbjQdTypeAll
,
flavorErpAll
:
data
.
flavorErpAll
,
specNameErpAll
:
data
.
specNameErpAll
,
series
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
0
]),
series
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
0
]),
goodsName
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
1
]),
goodsName
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
1
]),
startDate
:
parseTime
(
data
.
date
[
0
],
`{y}-{m}-{d}`
),
startDate
:
parseTime
(
data
.
date
[
0
],
`{y}-{m}-{d}`
),
...
@@ -58,9 +61,12 @@ export const getFinanceDetailAPI = (data) => {
...
@@ -58,9 +61,12 @@ export const getFinanceDetailAPI = (data) => {
url
:
'/bi/finance/cost/detail/list'
,
url
:
'/bi/finance/cost/detail/list'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
{
data
:
{
zbjQdType
:
data
.
brand
,
zbjQdType
:
data
.
zbjQdType
,
flavor
:
data
.
taste
,
flavor
:
data
.
flavorErp
,
specName
:
data
.
spec
,
specName
:
data
.
specNameErp
,
zbjQdTypeAll
:
data
.
zbjQdTypeAll
,
flavorErpAll
:
data
.
flavorErpAll
,
specNameErpAll
:
data
.
specNameErpAll
,
series
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
0
]),
series
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
0
]),
goodsName
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
1
]),
goodsName
:
data
.
seriesPrdMap
.
map
(
o
=>
o
[
1
]),
startDate
:
parseTime
(
data
.
date
[
0
],
`{y}-{m}-{d}`
),
startDate
:
parseTime
(
data
.
date
[
0
],
`{y}-{m}-{d}`
),
...
...
src/components/XLSelect/index.vue
浏览文件 @
19b17451
...
@@ -2,17 +2,18 @@
...
@@ -2,17 +2,18 @@
<el-select
v-bind=
"$attrs"
<el-select
v-bind=
"$attrs"
v-model=
"selectedOptions"
v-model=
"selectedOptions"
@
change=
"handleChange"
>
@
change=
"handleChange"
>
<el-option
v-for=
"str in options"
:label=
"str"
:value=
"str"
>
</el-option>
<li
class=
"el-select-dropdown__item all_item"
<li
class=
"el-select-dropdown__item all_item"
:class=
"
{ 'is-selected': isAll }"
:class=
"
{ 'is-selected': isAll }"
v-if="props.options.length > 0"
@click.stop="selectAll"
@click.stop="selectAll"
@mouseenter.stop="over"
@mouseenter.stop="over"
@mouseleave.stop="out">
@mouseleave.stop="out">
<span>
全选
</span>
<span>
全选
</span>
</li>
</li>
<el-option
v-for=
"obj in options"
:label=
"obj.label"
:value=
"obj.value"
>
</el-option>
</el-select>
</el-select>
</
template
>
</
template
>
...
@@ -20,7 +21,7 @@
...
@@ -20,7 +21,7 @@
const
selectedOptions
=
ref
([])
// 当前选中的值集合
const
selectedOptions
=
ref
([])
// 当前选中的值集合
const
isAll
=
ref
(
false
)
// 全选状态
const
isAll
=
ref
(
false
)
// 全选状态
const
emits
=
defineEmits
([
'update:modelValue'
]);
const
emits
=
defineEmits
([
'update:modelValue'
,
'change'
]);
const
props
=
defineProps
({
const
props
=
defineProps
({
options
:
{
options
:
{
...
@@ -35,43 +36,45 @@ const props = defineProps({
...
@@ -35,43 +36,45 @@ const props = defineProps({
watch
(()
=>
props
.
modelValue
,
val
=>
{
watch
(()
=>
props
.
modelValue
,
val
=>
{
selectedOptions
.
value
=
val
;
selectedOptions
.
value
=
val
;
isAll
.
value
=
val
.
length
===
props
.
options
.
length
if
(
props
.
options
.
length
>
0
)
{
isAll
.
value
=
val
.
length
===
props
.
options
.
length
}
},
{
},
{
deep
:
true
,
deep
:
true
,
immediate
:
true
immediate
:
true
})
})
// 设置样式
const
noHover
=
()
=>
{
const
list
=
document
.
querySelectorAll
(
'.el-select-dropdown .el-select-dropdown__item'
)
list
.
forEach
(
el
=>
el
.
classList
.
add
(
'no-hovering'
))
}
// 全选点击
// 全选点击
const
selectAll
=
()
=>
{
const
selectAll
=
()
=>
{
isAll
.
value
=
!
isAll
.
value
isAll
.
value
=
!
isAll
.
value
if
(
isAll
.
value
)
{
if
(
isAll
.
value
)
{
selectedOptions
.
value
=
[...
props
.
options
]
;
selectedOptions
.
value
=
props
.
options
.
map
(
item
=>
item
.
value
)
;
emits
(
'update:modelValue'
,
selectedOptions
.
value
);
emits
(
'update:modelValue'
,
selectedOptions
.
value
);
emits
(
'change'
)
}
else
{
}
else
{
selectedOptions
.
value
=
[];
selectedOptions
.
value
=
[];
emits
(
'update:modelValue'
,
selectedOptions
.
value
);
emits
(
'update:modelValue'
,
selectedOptions
.
value
);
emits
(
'change'
)
}
}
nextTick
(()
=>
{
nextTick
(()
=>
{
noHover
()
const
list
=
document
.
querySelectorAll
(
'.el-select-dropdown .el-select-dropdown__item'
)
list
.
forEach
(
el
=>
el
.
classList
.
add
(
'no-hovering'
))
})
})
}
}
const
handleChange
=
(
val
)
=>
{
const
handleChange
=
(
val
)
=>
{
isAll
.
value
=
val
.
length
===
props
.
options
.
length
isAll
.
value
=
val
.
length
===
props
.
options
.
length
emits
(
'update:modelValue'
,
val
)
emits
(
'update:modelValue'
,
val
)
emits
(
'change'
)
}
}
const
over
=
()
=>
{
const
over
=
()
=>
{
noHover
()
const
list
=
document
.
querySelectorAll
(
'.el-select-dropdown .el-select-dropdown__item'
)
list
.
forEach
(
el
=>
el
.
classList
.
add
(
'no-hovering'
))
}
}
const
out
=
()
=>
{
const
out
=
()
=>
{
noHover
()
const
list
=
document
.
querySelectorAll
(
'.el-select-dropdown .el-select-dropdown__item'
)
list
.
forEach
(
el
=>
el
.
classList
.
remove
(
'no-hovering'
))
}
}
</
script
>
</
script
>
...
...
src/hooks/date.js
浏览文件 @
19b17451
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
* @param {*} type 0:从今天开始往前,-1 则是 T - 1 开始日期往前
* @param {*} type 0:从今天开始往前,-1 则是 T - 1 开始日期往前
* @returns {}
* @returns {}
*/
*/
export
const
useDatePickerOptions
=
(
type
=
-
1
,
)
=>
{
export
const
useDatePickerOptions
=
(
type
=
-
1
)
=>
{
const
last30Date
=
[
new
Date
().
setDate
((
new
Date
().
getDate
()
-
(
30
-
1
))),
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
))]
const
last30Date
=
[
new
Date
().
setDate
((
new
Date
().
getDate
()
-
(
30
-
1
))),
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
))]
const
last7Date
=
[
new
Date
().
setDate
((
new
Date
().
getDate
()
-
(
7
-
1
))),
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
))]
const
last7Date
=
[
new
Date
().
setDate
((
new
Date
().
getDate
()
-
(
7
-
1
))),
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
))]
const
lastDate
=
[
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
)),
new
Date
().
setDate
((
new
Date
().
getDate
()
+
type
))]
const
recentPickerOptions
=
ref
([
// 日期选项配置
const
recentPickerOptions
=
ref
([
// 日期选项配置
{
{
text
:
'最近一周'
,
text
:
'最近一周'
,
...
@@ -47,9 +48,10 @@ export const useDatePickerOptions = (type = -1,) => {
...
@@ -47,9 +48,10 @@ export const useDatePickerOptions = (type = -1,) => {
}
}
])
])
return
{
return
{
lastDate
,
// 昨天
last30Date
,
// 前 30 天
last30Date
,
// 前 30 天
last7Date
,
// 前 7 天
last7Date
,
// 前 7 天
recentPickerOptions
,
// 最近一周/一月
recentPickerOptions
,
// 最近一周/一月
lastPickerOptions
lastPickerOptions
// 上一周/上一月
}
}
}
}
\ No newline at end of file
src/views/bi/finance/index.vue
浏览文件 @
19b17451
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论